@solid-design-system/components 5.15.12 → 5.15.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/cdn/chunks/chunk.HAL7R4WT.js +1 -0
  2. package/cdn/chunks/chunk.US3OB3XU.js +1 -0
  3. package/cdn/custom-elements.json +1 -1
  4. package/cdn/web-types.json +1 -1
  5. package/cdn-versioned/chunks/chunk.2KRS2HQF.js +1 -1
  6. package/cdn-versioned/chunks/chunk.2UNWLMKE.js +1 -1
  7. package/cdn-versioned/chunks/chunk.2YG34O7F.js +1 -1
  8. package/cdn-versioned/chunks/chunk.35PQ7S2O.js +1 -1
  9. package/cdn-versioned/chunks/chunk.3JOVDAJX.js +1 -1
  10. package/cdn-versioned/chunks/chunk.3UAOIDF2.js +1 -1
  11. package/cdn-versioned/chunks/chunk.4RHXHQ7H.js +1 -1
  12. package/cdn-versioned/chunks/chunk.5CAMYQMD.js +1 -1
  13. package/cdn-versioned/chunks/chunk.5HQBAJ66.js +1 -1
  14. package/cdn-versioned/chunks/chunk.AEVPJRUQ.js +1 -1
  15. package/cdn-versioned/chunks/chunk.ALSSHD3Q.js +1 -1
  16. package/cdn-versioned/chunks/chunk.ARYMSO7N.js +1 -1
  17. package/cdn-versioned/chunks/chunk.AVUZZRFT.js +1 -1
  18. package/cdn-versioned/chunks/chunk.BFDYLZMG.js +1 -1
  19. package/cdn-versioned/chunks/chunk.BZJ7O5ES.js +1 -1
  20. package/cdn-versioned/chunks/chunk.CEVVDV52.js +1 -1
  21. package/cdn-versioned/chunks/chunk.CJ53PV6X.js +1 -1
  22. package/cdn-versioned/chunks/chunk.CODHT433.js +1 -1
  23. package/cdn-versioned/chunks/chunk.CVNGM52W.js +1 -1
  24. package/cdn-versioned/chunks/chunk.CWOKJQSQ.js +1 -1
  25. package/cdn-versioned/chunks/chunk.DKN2DIAH.js +1 -1
  26. package/cdn-versioned/chunks/chunk.EGDPRSOF.js +1 -1
  27. package/cdn-versioned/chunks/chunk.ET34FEK2.js +2 -2
  28. package/cdn-versioned/chunks/chunk.FAPJVEMZ.js +1 -1
  29. package/cdn-versioned/chunks/chunk.FSATHYQT.js +1 -1
  30. package/cdn-versioned/chunks/chunk.GEOVNECI.js +1 -1
  31. package/cdn-versioned/chunks/chunk.HAL7R4WT.js +1 -0
  32. package/cdn-versioned/chunks/chunk.HJ4O4XQA.js +1 -1
  33. package/cdn-versioned/chunks/chunk.HX23UDYZ.js +1 -1
  34. package/cdn-versioned/chunks/chunk.HYCWRAJB.js +1 -1
  35. package/cdn-versioned/chunks/chunk.ISZAAZUB.js +1 -1
  36. package/cdn-versioned/chunks/chunk.IWPBSEAW.js +1 -1
  37. package/cdn-versioned/chunks/chunk.JCU3EXPE.js +1 -1
  38. package/cdn-versioned/chunks/chunk.JXQJUYEC.js +1 -1
  39. package/cdn-versioned/chunks/chunk.K7JNBY7N.js +1 -1
  40. package/cdn-versioned/chunks/chunk.KOERGSAL.js +1 -1
  41. package/cdn-versioned/chunks/chunk.MRAHMGRF.js +1 -1
  42. package/cdn-versioned/chunks/chunk.NRBNWX7R.js +1 -1
  43. package/cdn-versioned/chunks/chunk.O4L5OULX.js +1 -1
  44. package/cdn-versioned/chunks/chunk.OG46JDG7.js +2 -2
  45. package/cdn-versioned/chunks/chunk.P6QOQEIF.js +1 -1
  46. package/cdn-versioned/chunks/chunk.PZC43SIH.js +1 -1
  47. package/cdn-versioned/chunks/chunk.R3WH26GI.js +1 -1
  48. package/cdn-versioned/chunks/chunk.R5PJYTZQ.js +4 -4
  49. package/cdn-versioned/chunks/chunk.RXMJRA5Q.js +1 -1
  50. package/cdn-versioned/chunks/chunk.SGXM6Y2P.js +1 -1
  51. package/cdn-versioned/chunks/chunk.SJLZKEAQ.js +1 -1
  52. package/cdn-versioned/chunks/chunk.SX2XEIQL.js +1 -1
  53. package/cdn-versioned/chunks/chunk.TJ7ZA5LO.js +1 -1
  54. package/cdn-versioned/chunks/chunk.TL3K6WJI.js +1 -1
  55. package/cdn-versioned/chunks/chunk.TUU3QZXR.js +1 -1
  56. package/cdn-versioned/chunks/chunk.UBEW2PY5.js +1 -1
  57. package/cdn-versioned/chunks/chunk.US3OB3XU.js +1 -0
  58. package/cdn-versioned/chunks/chunk.UXY3AL7C.js +1 -1
  59. package/cdn-versioned/chunks/chunk.VFOVKA46.js +1 -1
  60. package/cdn-versioned/chunks/chunk.W7A3TU2Z.js +1 -1
  61. package/cdn-versioned/chunks/chunk.XEK5QKES.js +1 -1
  62. package/cdn-versioned/chunks/chunk.Y7AL7I2Z.js +1 -1
  63. package/cdn-versioned/chunks/chunk.YFGMDOCE.js +1 -1
  64. package/cdn-versioned/chunks/chunk.YHHVM7YY.js +1 -1
  65. package/cdn-versioned/chunks/chunk.ZA3AQWM7.js +4 -4
  66. package/cdn-versioned/chunks/chunk.ZNWCIW62.js +1 -1
  67. package/cdn-versioned/chunks/chunk.ZQBF4WJL.js +1 -1
  68. package/cdn-versioned/components/accordion/accordion.d.ts +1 -1
  69. package/cdn-versioned/components/accordion-group/accordion-group.d.ts +1 -1
  70. package/cdn-versioned/components/animation/animation.d.ts +1 -1
  71. package/cdn-versioned/components/audio/audio.d.ts +1 -1
  72. package/cdn-versioned/components/badge/badge.d.ts +1 -1
  73. package/cdn-versioned/components/brandshape/brandshape.d.ts +1 -1
  74. package/cdn-versioned/components/breadcrumb/breadcrumb.d.ts +1 -1
  75. package/cdn-versioned/components/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  76. package/cdn-versioned/components/button/button.d.ts +1 -1
  77. package/cdn-versioned/components/button-group/button-group.d.ts +1 -1
  78. package/cdn-versioned/components/carousel/carousel.d.ts +1 -1
  79. package/cdn-versioned/components/carousel-item/carousel-item.d.ts +1 -1
  80. package/cdn-versioned/components/checkbox/checkbox.d.ts +1 -1
  81. package/cdn-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
  82. package/cdn-versioned/components/combobox/combobox.d.ts +1 -1
  83. package/cdn-versioned/components/dialog/dialog.d.ts +1 -1
  84. package/cdn-versioned/components/divider/divider.d.ts +1 -1
  85. package/cdn-versioned/components/drawer/drawer.d.ts +1 -1
  86. package/cdn-versioned/components/dropdown/dropdown.d.ts +1 -1
  87. package/cdn-versioned/components/expandable/expandable.d.ts +1 -1
  88. package/cdn-versioned/components/flipcard/flipcard.d.ts +1 -1
  89. package/cdn-versioned/components/header/header.d.ts +1 -1
  90. package/cdn-versioned/components/icon/icon.d.ts +1 -1
  91. package/cdn-versioned/components/include/include.d.ts +1 -1
  92. package/cdn-versioned/components/input/input.d.ts +1 -1
  93. package/cdn-versioned/components/link/link.d.ts +1 -1
  94. package/cdn-versioned/components/loader/loader.d.ts +1 -1
  95. package/cdn-versioned/components/map-marker/map-marker.d.ts +1 -1
  96. package/cdn-versioned/components/menu/menu.d.ts +1 -1
  97. package/cdn-versioned/components/menu-item/menu-item.d.ts +1 -1
  98. package/cdn-versioned/components/navigation-item/navigation-item.d.ts +1 -1
  99. package/cdn-versioned/components/notification/notification.d.ts +1 -1
  100. package/cdn-versioned/components/optgroup/optgroup.d.ts +1 -1
  101. package/cdn-versioned/components/option/option.d.ts +1 -1
  102. package/cdn-versioned/components/popup/popup.d.ts +1 -1
  103. package/cdn-versioned/components/quickfact/quickfact.d.ts +1 -1
  104. package/cdn-versioned/components/radio/radio.d.ts +1 -1
  105. package/cdn-versioned/components/radio-button/radio-button.d.ts +1 -1
  106. package/cdn-versioned/components/radio-group/radio-group.d.ts +1 -1
  107. package/cdn-versioned/components/range/range.d.ts +1 -1
  108. package/cdn-versioned/components/range-tick/range-tick.d.ts +1 -1
  109. package/cdn-versioned/components/scrollable/scrollable.d.ts +1 -1
  110. package/cdn-versioned/components/select/select.d.ts +1 -1
  111. package/cdn-versioned/components/spinner/spinner.d.ts +1 -1
  112. package/cdn-versioned/components/step/step.d.ts +1 -1
  113. package/cdn-versioned/components/step-group/step-group.d.ts +1 -1
  114. package/cdn-versioned/components/switch/switch.d.ts +1 -1
  115. package/cdn-versioned/components/tab/tab.d.ts +1 -1
  116. package/cdn-versioned/components/tab-group/tab-group.d.ts +1 -1
  117. package/cdn-versioned/components/tab-panel/tab-panel.d.ts +1 -1
  118. package/cdn-versioned/components/tag/tag.d.ts +1 -1
  119. package/cdn-versioned/components/textarea/textarea.d.ts +1 -1
  120. package/cdn-versioned/components/tooltip/tooltip.d.ts +1 -1
  121. package/cdn-versioned/components/video/video.d.ts +1 -1
  122. package/cdn-versioned/custom-elements.json +238 -238
  123. package/cdn-versioned/internal/form.js +3 -3
  124. package/cdn-versioned/solid-components.bundle.js +14 -14
  125. package/cdn-versioned/solid-components.css +2 -2
  126. package/cdn-versioned/solid-components.iife.js +14 -14
  127. package/cdn-versioned/vscode.html-custom-data.json +91 -91
  128. package/cdn-versioned/web-types.json +154 -154
  129. package/dist/chunks/chunk.HAL7R4WT.js +1 -0
  130. package/dist/custom-elements.json +1 -1
  131. package/dist/web-types.json +1 -1
  132. package/dist-versioned/chunks/chunk.23KFQ6DK.js +2 -2
  133. package/dist-versioned/chunks/chunk.34OZXOJP.js +1 -1
  134. package/dist-versioned/chunks/chunk.45BEUHRF.js +2 -2
  135. package/dist-versioned/chunks/chunk.4D3N4MVV.js +14 -14
  136. package/dist-versioned/chunks/chunk.5YOGUSPL.js +26 -26
  137. package/dist-versioned/chunks/chunk.6DKXZWRN.js +4 -4
  138. package/dist-versioned/chunks/chunk.6ITI3HNP.js +3 -3
  139. package/dist-versioned/chunks/chunk.6MHK4U6F.js +12 -12
  140. package/dist-versioned/chunks/chunk.7UTPAUSQ.js +2 -2
  141. package/dist-versioned/chunks/chunk.A2M7C3CD.js +1 -1
  142. package/dist-versioned/chunks/chunk.AKPCSVRG.js +1 -1
  143. package/dist-versioned/chunks/chunk.AKX7VXML.js +6 -6
  144. package/dist-versioned/chunks/chunk.AYDMEA3C.js +4 -4
  145. package/dist-versioned/chunks/chunk.BUFXMACO.js +2 -2
  146. package/dist-versioned/chunks/chunk.CFBWKOJD.js +1 -1
  147. package/dist-versioned/chunks/chunk.DHRQZSXG.js +8 -8
  148. package/dist-versioned/chunks/chunk.DQ6G3W3V.js +2 -2
  149. package/dist-versioned/chunks/chunk.E57K3AFR.js +1 -1
  150. package/dist-versioned/chunks/chunk.HAL7R4WT.js +1 -0
  151. package/dist-versioned/chunks/chunk.HOXI77KQ.js +3 -3
  152. package/dist-versioned/chunks/chunk.HP7WJYO4.js +2 -2
  153. package/dist-versioned/chunks/chunk.HYPCYXQP.js +1 -1
  154. package/dist-versioned/chunks/chunk.I7VRBYGO.js +2 -2
  155. package/dist-versioned/chunks/chunk.IAL4GVA4.js +5 -5
  156. package/dist-versioned/chunks/chunk.IRZ3M2OA.js +1 -1
  157. package/dist-versioned/chunks/chunk.IUS3S54L.js +2 -2
  158. package/dist-versioned/chunks/chunk.JM3YRKVA.js +3 -3
  159. package/dist-versioned/chunks/chunk.JMHQQHEP.js +2 -2
  160. package/dist-versioned/chunks/chunk.JOYITBGJ.js +2 -2
  161. package/dist-versioned/chunks/chunk.JTKHYOJO.js +12 -12
  162. package/dist-versioned/chunks/chunk.KEJFWGZI.js +4 -4
  163. package/dist-versioned/chunks/chunk.KVLD4JWK.js +5 -5
  164. package/dist-versioned/chunks/chunk.M5FO7PXK.js +4 -4
  165. package/dist-versioned/chunks/chunk.MBFZWG5H.js +3 -3
  166. package/dist-versioned/chunks/chunk.NVXUSMMW.js +2 -2
  167. package/dist-versioned/chunks/chunk.PEAIITW7.js +5 -5
  168. package/dist-versioned/chunks/chunk.PHHK74M7.js +6 -6
  169. package/dist-versioned/chunks/chunk.PPVX563E.js +2 -2
  170. package/dist-versioned/chunks/chunk.PRTWW2BW.js +1 -1
  171. package/dist-versioned/chunks/chunk.Q44CB3ZY.js +2 -2
  172. package/dist-versioned/chunks/chunk.QAJG6PYM.js +1 -1
  173. package/dist-versioned/chunks/chunk.QDZS6M4T.js +3 -3
  174. package/dist-versioned/chunks/chunk.QZBSHWMK.js +5 -5
  175. package/dist-versioned/chunks/chunk.R735ROML.js +1 -1
  176. package/dist-versioned/chunks/chunk.RAYANOK2.js +4 -4
  177. package/dist-versioned/chunks/chunk.RRNLIX2S.js +3 -3
  178. package/dist-versioned/chunks/chunk.S3BSVYPB.js +1 -1
  179. package/dist-versioned/chunks/chunk.SDWNASDC.js +3 -3
  180. package/dist-versioned/chunks/chunk.SE4CTFYY.js +1 -1
  181. package/dist-versioned/chunks/chunk.SJPDNEHE.js +3 -3
  182. package/dist-versioned/chunks/chunk.T2AOG5F2.js +24 -24
  183. package/dist-versioned/chunks/chunk.T6DXPJAI.js +1 -1
  184. package/dist-versioned/chunks/chunk.TIBLXIJV.js +6 -6
  185. package/dist-versioned/chunks/chunk.TKJFMHFU.js +2 -2
  186. package/dist-versioned/chunks/chunk.TMWT3ROD.js +2 -2
  187. package/dist-versioned/chunks/chunk.UAVNEMEF.js +1 -1
  188. package/dist-versioned/chunks/chunk.UIQBHPD3.js +2 -2
  189. package/dist-versioned/chunks/chunk.VMVBXZ2U.js +1 -1
  190. package/dist-versioned/chunks/chunk.WWBNZDY7.js +11 -11
  191. package/dist-versioned/chunks/chunk.WZZP5YIS.js +1 -1
  192. package/dist-versioned/chunks/chunk.XCQC3F3H.js +3 -3
  193. package/dist-versioned/chunks/chunk.Z2RQUXP5.js +2 -2
  194. package/dist-versioned/components/accordion/accordion.d.ts +1 -1
  195. package/dist-versioned/components/accordion-group/accordion-group.d.ts +1 -1
  196. package/dist-versioned/components/animation/animation.d.ts +1 -1
  197. package/dist-versioned/components/audio/audio.d.ts +1 -1
  198. package/dist-versioned/components/badge/badge.d.ts +1 -1
  199. package/dist-versioned/components/brandshape/brandshape.d.ts +1 -1
  200. package/dist-versioned/components/breadcrumb/breadcrumb.d.ts +1 -1
  201. package/dist-versioned/components/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  202. package/dist-versioned/components/button/button.d.ts +1 -1
  203. package/dist-versioned/components/button-group/button-group.d.ts +1 -1
  204. package/dist-versioned/components/carousel/carousel.d.ts +1 -1
  205. package/dist-versioned/components/carousel-item/carousel-item.d.ts +1 -1
  206. package/dist-versioned/components/checkbox/checkbox.d.ts +1 -1
  207. package/dist-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
  208. package/dist-versioned/components/combobox/combobox.d.ts +1 -1
  209. package/dist-versioned/components/dialog/dialog.d.ts +1 -1
  210. package/dist-versioned/components/divider/divider.d.ts +1 -1
  211. package/dist-versioned/components/drawer/drawer.d.ts +1 -1
  212. package/dist-versioned/components/dropdown/dropdown.d.ts +1 -1
  213. package/dist-versioned/components/expandable/expandable.d.ts +1 -1
  214. package/dist-versioned/components/flipcard/flipcard.d.ts +1 -1
  215. package/dist-versioned/components/header/header.d.ts +1 -1
  216. package/dist-versioned/components/icon/icon.d.ts +1 -1
  217. package/dist-versioned/components/include/include.d.ts +1 -1
  218. package/dist-versioned/components/input/input.d.ts +1 -1
  219. package/dist-versioned/components/link/link.d.ts +1 -1
  220. package/dist-versioned/components/loader/loader.d.ts +1 -1
  221. package/dist-versioned/components/map-marker/map-marker.d.ts +1 -1
  222. package/dist-versioned/components/menu/menu.d.ts +1 -1
  223. package/dist-versioned/components/menu-item/menu-item.d.ts +1 -1
  224. package/dist-versioned/components/navigation-item/navigation-item.d.ts +1 -1
  225. package/dist-versioned/components/notification/notification.d.ts +1 -1
  226. package/dist-versioned/components/optgroup/optgroup.d.ts +1 -1
  227. package/dist-versioned/components/option/option.d.ts +1 -1
  228. package/dist-versioned/components/popup/popup.d.ts +1 -1
  229. package/dist-versioned/components/quickfact/quickfact.d.ts +1 -1
  230. package/dist-versioned/components/radio/radio.d.ts +1 -1
  231. package/dist-versioned/components/radio-button/radio-button.d.ts +1 -1
  232. package/dist-versioned/components/radio-group/radio-group.d.ts +1 -1
  233. package/dist-versioned/components/range/range.d.ts +1 -1
  234. package/dist-versioned/components/range-tick/range-tick.d.ts +1 -1
  235. package/dist-versioned/components/scrollable/scrollable.d.ts +1 -1
  236. package/dist-versioned/components/select/select.d.ts +1 -1
  237. package/dist-versioned/components/spinner/spinner.d.ts +1 -1
  238. package/dist-versioned/components/step/step.d.ts +1 -1
  239. package/dist-versioned/components/step-group/step-group.d.ts +1 -1
  240. package/dist-versioned/components/switch/switch.d.ts +1 -1
  241. package/dist-versioned/components/tab/tab.d.ts +1 -1
  242. package/dist-versioned/components/tab-group/tab-group.d.ts +1 -1
  243. package/dist-versioned/components/tab-panel/tab-panel.d.ts +1 -1
  244. package/dist-versioned/components/tag/tag.d.ts +1 -1
  245. package/dist-versioned/components/textarea/textarea.d.ts +1 -1
  246. package/dist-versioned/components/tooltip/tooltip.d.ts +1 -1
  247. package/dist-versioned/components/video/video.d.ts +1 -1
  248. package/dist-versioned/custom-elements.json +238 -238
  249. package/dist-versioned/internal/form.js +3 -3
  250. package/dist-versioned/solid-components.css +2 -2
  251. package/dist-versioned/vscode.html-custom-data.json +91 -91
  252. package/dist-versioned/web-types.json +154 -154
  253. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{a as k}from"./chunk.CGQ2BPPZ.js";import{a as m,c as f}from"./chunk.SKUMYG4O.js";import{a as v}from"./chunk.KLRPP4NQ.js";import{a as d}from"./chunk.YEDQWNIV.js";import{a as x}from"./chunk.Y7NVH75J.js";import{a as h}from"./chunk.E2DRD2OX.js";import{a as b,b as o,d as n,h as c}from"./chunk.TJ7ZA5LO.js";import{b as g,e as r}from"./chunk.RZUTJ36B.js";import{b as p,c as l,e as u}from"./chunk.6OTM3PE5.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends c{constructor(){super(...arguments);this.localize=new x(this);this.hasSlotController=new k(this,"[default]","content");this.size="lg";this.content="";this.placement="top";this.disabled=!1;this.open=!1;this.trigger="click focus";this.hoist=!1;this.handleMouseInteraction=()=>{this.interactionType="mouse"};this.handleKeyboardInteraction=()=>{this.interactionType="keyboard"}}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseOver=this.handleMouseOver.bind(this),this.handleMouseOut=this.handleMouseOut.bind(this),document.addEventListener("mousedown",this.handleMouseInteraction),document.addEventListener("keydown",this.handleKeyboardInteraction),this.updateComplete.then(()=>{this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)})}firstUpdated(){this.body.hidden=!this.open,this.formatDefaultSlot(this.defaultSlot),this.open&&(this.popup.active=!0,this.popup.reposition())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("blur",this.handleBlur,!0),this.removeEventListener("focus",this.handleFocus,!0),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("mouseover",this.handleMouseOver),this.removeEventListener("mouseout",this.handleMouseOut),document.removeEventListener("mousedown",this.handleMouseInteraction),document.removeEventListener("keydown",this.handleKeyboardInteraction)}get hasCustomTrigger(){return this.hasSlotController.test("[default]")}formatDefaultSlot(e){if(!e)return;e.assignedNodes({flatten:!0}).forEach(s=>{var w,y;s.nodeType===Node.TEXT_NODE&&!((w=s==null?void 0:s.textContent)!=null&&w.trim())&&((y=s==null?void 0:s.parentNode)==null||y.removeChild(s))})}handleBlur(){this.hasTrigger("focus")&&this.hide()}handleClick(){this.hasTrigger("click")&&(this.open?this.hide():this.show())}handleFocus(){this.hasTrigger("focus")&&this.interactionType==="keyboard"&&this.show()}handleKeyDown(e){this.open&&e.key==="Escape"&&(e.stopPropagation(),this.hide())}handleMouseOver(){if(this.hasTrigger("hover")){let e=l(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>this.show(),e)}}handleMouseOut(){if(this.hasTrigger("hover")){let e=l(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>this.hide(),e)}}hasTrigger(e){return this.trigger.split(" ").includes(e)}async handleOpenChange(){if(this.open){if(this.disabled)return;this.emit("sd-show"),await u(this.body),this.body.hidden=!1,this.popup.active=!0;let{keyframes:e,options:a}=f(this,"tooltip.show",{dir:this.localize.dir()});await p(this.popup.popup,e,a),this.emit("sd-after-show")}else{this.emit("sd-hide"),await u(this.body);let{keyframes:e,options:a}=f(this,"tooltip.hide",{dir:this.localize.dir()});await p(this.popup.popup,e,a),this.popup.active=!1,this.body.hidden=!0,this.emit("sd-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,v(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,this.trigger==="click"||this.trigger==="click focus"?this.focus():this.blur(),v(this,"sd-after-hide")}render(){let e=this.placement.endsWith("-start"),a=this.placement.endsWith("-end");return r`<sd-5-15-12-popup part="base" exportparts="
1
+ import{a as k}from"./chunk.CGQ2BPPZ.js";import{a as m,c as f}from"./chunk.SKUMYG4O.js";import{a as v}from"./chunk.KLRPP4NQ.js";import{a as d}from"./chunk.YEDQWNIV.js";import{a as x}from"./chunk.Y7NVH75J.js";import{a as h}from"./chunk.E2DRD2OX.js";import{a as b,b as o,d as n,h as c}from"./chunk.TJ7ZA5LO.js";import{b as g,e as r}from"./chunk.RZUTJ36B.js";import{b as p,c as l,e as u}from"./chunk.6OTM3PE5.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends c{constructor(){super(...arguments);this.localize=new x(this);this.hasSlotController=new k(this,"[default]","content");this.size="lg";this.content="";this.placement="top";this.disabled=!1;this.open=!1;this.trigger="click focus";this.hoist=!1;this.handleMouseInteraction=()=>{this.interactionType="mouse"};this.handleKeyboardInteraction=()=>{this.interactionType="keyboard"}}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseOver=this.handleMouseOver.bind(this),this.handleMouseOut=this.handleMouseOut.bind(this),document.addEventListener("mousedown",this.handleMouseInteraction),document.addEventListener("keydown",this.handleKeyboardInteraction),this.updateComplete.then(()=>{this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)})}firstUpdated(){this.body.hidden=!this.open,this.formatDefaultSlot(this.defaultSlot),this.open&&(this.popup.active=!0,this.popup.reposition())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("blur",this.handleBlur,!0),this.removeEventListener("focus",this.handleFocus,!0),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("mouseover",this.handleMouseOver),this.removeEventListener("mouseout",this.handleMouseOut),document.removeEventListener("mousedown",this.handleMouseInteraction),document.removeEventListener("keydown",this.handleKeyboardInteraction)}get hasCustomTrigger(){return this.hasSlotController.test("[default]")}formatDefaultSlot(e){if(!e)return;e.assignedNodes({flatten:!0}).forEach(s=>{var w,y;s.nodeType===Node.TEXT_NODE&&!((w=s==null?void 0:s.textContent)!=null&&w.trim())&&((y=s==null?void 0:s.parentNode)==null||y.removeChild(s))})}handleBlur(){this.hasTrigger("focus")&&this.hide()}handleClick(){this.hasTrigger("click")&&(this.open?this.hide():this.show())}handleFocus(){this.hasTrigger("focus")&&this.interactionType==="keyboard"&&this.show()}handleKeyDown(e){this.open&&e.key==="Escape"&&(e.stopPropagation(),this.hide())}handleMouseOver(){if(this.hasTrigger("hover")){let e=l(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>this.show(),e)}}handleMouseOut(){if(this.hasTrigger("hover")){let e=l(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>this.hide(),e)}}hasTrigger(e){return this.trigger.split(" ").includes(e)}async handleOpenChange(){if(this.open){if(this.disabled)return;this.emit("sd-show"),await u(this.body),this.body.hidden=!1,this.popup.active=!0;let{keyframes:e,options:a}=f(this,"tooltip.show",{dir:this.localize.dir()});await p(this.popup.popup,e,a),this.emit("sd-after-show")}else{this.emit("sd-hide"),await u(this.body);let{keyframes:e,options:a}=f(this,"tooltip.hide",{dir:this.localize.dir()});await p(this.popup.popup,e,a),this.popup.active=!1,this.body.hidden=!0,this.emit("sd-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,v(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,this.trigger==="click"||this.trigger==="click focus"?this.focus():this.blur(),v(this,"sd-after-hide")}render(){let e=this.placement.endsWith("-start"),a=this.placement.endsWith("-end");return r`<sd-5-15-13-popup part="base" exportparts="
2
2
  popup:base__popup,
3
3
  arrow:base__arrow
4
- " class="${d(this.open&&"tooltip--open")}" placement="${this.placement}" distance="10" skidding="${{start:2,end:-2,default:0}[e?"start":a?"end":"default"]*(this.size==="sm"?-1:1)}" strategy="${this.hoist?"fixed":"absolute"}" flip shift arrow auto-size="vertical" arrow-padding="0">${this.hasCustomTrigger?r`<slot slot="anchor"></slot>`:r`<button slot="anchor" aria-describedby="tooltip" class="${d("flex sd-interactive rounded-full",this.size==="lg"?"text-xl":"text-base")}" ?disabled="${this.disabled}" aria-expanded="${this.open}" aria-controls="tooltip"><sd-5-15-12-icon library="_internal" name="info-circle" label="Tooltip" class="${d(this.disabled&&"sd-interactive--disabled")}"></sd-5-15-12-icon></button>`}<slot name="content" part="body" id="tooltip" class="bg-primary text-white py-3 px-4 block rounded-none text-sm text-left" role="tooltip" aria-label="${this.content}" aria-live="${this.open?"polite":"off"}">${this.content}</slot></sd-5-15-12-popup>`}};t.styles=[...c.styles,g`:host{--hide-delay:0ms;--show-delay:150ms;display:contents}sd-5-15-12-popup{--arrow-color:rgb(var(--sd-color-primary,0 53 142)/1);--arrow-size:10px}sd-5-15-12-popup::part(popup){pointer-events:none;z-index:10;--tw-shadow:var(--sd-shadow,0px 1px 3px 0px rgba(81,81,81,.75));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-5-15-12-popup::part(arrow){--tw-shadow:var(--sd-shadow,0px 1px 3px 0px rgba(81,81,81,.75));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-5-15-12-popup[placement^=top]::part(popup){transform-origin:bottom}sd-5-15-12-popup[placement^=bottom]::part(popup){transform-origin:top}#tooltip{max-width:var(--max-width)}::slotted([slot=content]){max-height:var(--auto-size-available-height)!important;max-width:var(--auto-size-available-width)!important;overflow:auto}`],i([n("slot:not([name])")],t.prototype,"defaultSlot",2),i([n("#tooltip")],t.prototype,"body",2),i([n("sd-5-15-12-popup")],t.prototype,"popup",2),i([o({type:String,reflect:!0})],t.prototype,"size",2),i([o({type:String,reflect:!0})],t.prototype,"content",2),i([o({type:String,reflect:!0})],t.prototype,"placement",2),i([o({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([o({type:Boolean,reflect:!0})],t.prototype,"open",2),i([o({type:String,reflect:!0})],t.prototype,"trigger",2),i([o({type:Boolean,reflect:!0})],t.prototype,"hoist",2),i([h("open",{waitUntilFirstUpdate:!0})],t.prototype,"handleOpenChange",1),i([h(["content","hoist","placement"])],t.prototype,"handleOptionsChange",1),i([h("disabled")],t.prototype,"handleDisabledChange",1),t=i([b("sd-5-15-12-tooltip")],t);m("tooltip.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});m("tooltip.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{t as a};
4
+ " class="${d(this.open&&"tooltip--open")}" placement="${this.placement}" distance="10" skidding="${{start:2,end:-2,default:0}[e?"start":a?"end":"default"]*(this.size==="sm"?-1:1)}" strategy="${this.hoist?"fixed":"absolute"}" flip shift arrow auto-size="vertical" arrow-padding="0">${this.hasCustomTrigger?r`<slot slot="anchor"></slot>`:r`<button slot="anchor" aria-describedby="tooltip" class="${d("flex sd-interactive rounded-full",this.size==="lg"?"text-xl":"text-base")}" ?disabled="${this.disabled}" aria-expanded="${this.open}" aria-controls="tooltip"><sd-5-15-13-icon library="_internal" name="info-circle" label="Tooltip" class="${d(this.disabled&&"sd-interactive--disabled")}"></sd-5-15-13-icon></button>`}<slot name="content" part="body" id="tooltip" class="bg-primary text-white py-3 px-4 block rounded-none text-sm text-left" role="tooltip" aria-label="${this.content}" aria-live="${this.open?"polite":"off"}">${this.content}</slot></sd-5-15-13-popup>`}};t.styles=[...c.styles,g`:host{--hide-delay:0ms;--show-delay:150ms;display:contents}sd-5-15-13-popup{--arrow-color:rgb(var(--sd-color-primary,0 53 142)/1);--arrow-size:10px}sd-5-15-13-popup::part(popup){pointer-events:none;z-index:10;--tw-shadow:var(--sd-shadow,0px 1px 3px 0px rgba(81,81,81,.75));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-5-15-13-popup::part(arrow){--tw-shadow:var(--sd-shadow,0px 1px 3px 0px rgba(81,81,81,.75));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-5-15-13-popup[placement^=top]::part(popup){transform-origin:bottom}sd-5-15-13-popup[placement^=bottom]::part(popup){transform-origin:top}#tooltip{max-width:var(--max-width)}::slotted([slot=content]){max-height:var(--auto-size-available-height)!important;max-width:var(--auto-size-available-width)!important;overflow:auto}`],i([n("slot:not([name])")],t.prototype,"defaultSlot",2),i([n("#tooltip")],t.prototype,"body",2),i([n("sd-5-15-13-popup")],t.prototype,"popup",2),i([o({type:String,reflect:!0})],t.prototype,"size",2),i([o({type:String,reflect:!0})],t.prototype,"content",2),i([o({type:String,reflect:!0})],t.prototype,"placement",2),i([o({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([o({type:Boolean,reflect:!0})],t.prototype,"open",2),i([o({type:String,reflect:!0})],t.prototype,"trigger",2),i([o({type:Boolean,reflect:!0})],t.prototype,"hoist",2),i([h("open",{waitUntilFirstUpdate:!0})],t.prototype,"handleOpenChange",1),i([h(["content","hoist","placement"])],t.prototype,"handleOptionsChange",1),i([h("disabled")],t.prototype,"handleDisabledChange",1),t=i([b("sd-5-15-13-tooltip")],t);m("tooltip.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});m("tooltip.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{t as a};
@@ -1 +1 @@
1
- import{a as Dt}from"./chunk.YEDQWNIV.js";import{a as kt,b as E,d as Rt,h as Ct}from"./chunk.TJ7ZA5LO.js";import{b as Mt,e as Et}from"./chunk.RZUTJ36B.js";import{a as C,b as V,c as dt,e as v}from"./chunk.TJOCV4DC.js";var _=Math.min,S=Math.max,ct=Math.round,ft=Math.floor,F=t=>({x:t,y:t}),me={left:"right",right:"left",bottom:"top",top:"bottom"},pe={start:"end",end:"start"};function pt(t,e,n){return S(t,_(e,n))}function Z(t,e){return typeof t=="function"?t(e):t}function Y(t){return t.split("-")[0]}function tt(t){return t.split("-")[1]}function St(t){return t==="x"?"y":"x"}function gt(t){return t==="y"?"height":"width"}var ge=new Set(["top","bottom"]);function j(t){return ge.has(Y(t))?"y":"x"}function wt(t){return St(j(t))}function $t(t,e,n){n===void 0&&(n=!1);let i=tt(t),o=wt(t),s=gt(o),r=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=at(r)),[r,at(r)]}function Nt(t){let e=at(t);return[mt(t),e,mt(e)]}function mt(t){return t.replace(/start|end/g,e=>pe[e])}var Bt=["left","right"],Ft=["right","left"],we=["top","bottom"],ye=["bottom","top"];function xe(t,e,n){switch(t){case"top":case"bottom":return n?e?Ft:Bt:e?Bt:Ft;case"left":case"right":return e?we:ye;default:return[]}}function Ht(t,e,n,i){let o=tt(t),s=xe(Y(t),n==="start",i);return o&&(s=s.map(r=>r+"-"+o),e&&(s=s.concat(s.map(mt)))),s}function at(t){return t.replace(/left|right|bottom|top/g,e=>me[e])}function be(t){return C({top:0,right:0,bottom:0,left:0},t)}function Tt(t){return typeof t!="number"?be(t):{top:t,right:t,bottom:t,left:t}}function et(t){let{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function Wt(t,e,n){let{reference:i,floating:o}=t,s=j(e),r=wt(e),l=gt(r),f=Y(e),a=s==="y",c=i.x+i.width/2-o.width/2,h=i.y+i.height/2-o.height/2,m=i[l]/2-o[l]/2,u;switch(f){case"top":u={x:c,y:i.y-o.height};break;case"bottom":u={x:c,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:h};break;case"left":u={x:i.x-o.width,y:h};break;default:u={x:i.x,y:i.y}}switch(tt(e)){case"start":u[r]-=m*(n&&a?-1:1);break;case"end":u[r]+=m*(n&&a?-1:1);break}return u}var Vt=async(t,e,n)=>{let{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:r}=n,l=s.filter(Boolean),f=await(r.isRTL==null?void 0:r.isRTL(e)),a=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:c,y:h}=Wt(a,i,f),m=i,u={},d=0;for(let p=0;p<l.length;p++){let{name:w,fn:g}=l[p],{x:y,y:b,data:A,reset:O}=await g({x:c,y:h,initialPlacement:i,placement:m,strategy:o,middlewareData:u,rects:a,platform:r,elements:{reference:t,floating:e}});c=y!=null?y:c,h=b!=null?b:h,u=V(C({},u),{[w]:C(C({},u[w]),A)}),O&&d<=50&&(d++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(a=O.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:o}):O.rects),{x:c,y:h}=Wt(a,m,f)),p=-1)}return{x:c,y:h,placement:m,strategy:o,middlewareData:u}};async function yt(t,e){var n;e===void 0&&(e={});let{x:i,y:o,platform:s,rects:r,elements:l,strategy:f}=t,{boundary:a="clippingAncestors",rootBoundary:c="viewport",elementContext:h="floating",altBoundary:m=!1,padding:u=0}=Z(e,t),d=Tt(u),w=l[m?h==="floating"?"reference":"floating":h],g=et(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:a,rootBoundary:c,strategy:f})),y=h==="floating"?{x:i,y:o,width:r.floating.width,height:r.floating.height}:r.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),A=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},O=et(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:b,strategy:f}):y);return{top:(g.top-O.top+d.top)/A.y,bottom:(O.bottom-g.bottom+d.bottom)/A.y,left:(g.left-O.left+d.left)/A.x,right:(O.right-g.right+d.right)/A.x}}var _t=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:i,placement:o,rects:s,platform:r,elements:l,middlewareData:f}=e,{element:a,padding:c=0}=Z(t,e)||{};if(a==null)return{};let h=Tt(c),m={x:n,y:i},u=wt(o),d=gt(u),p=await r.getDimensions(a),w=u==="y",g=w?"top":"left",y=w?"bottom":"right",b=w?"clientHeight":"clientWidth",A=s.reference[d]+s.reference[u]-m[u]-s.floating[d],O=m[u]-s.reference[u],k=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a)),R=k?k[b]:0;(!R||!await(r.isElement==null?void 0:r.isElement(k)))&&(R=l.floating[b]||s.floating[d]);let I=A/2-O/2,H=R/2-p[d]/2-1,L=_(h[g],H),U=_(h[y],H),W=L,K=R-p[d]-U,P=R/2-p[d]/2+I,D=pt(W,P,K),J=!f.arrow&&tt(o)!=null&&P!==D&&s.reference[d]/2-(P<W?L:U)-p[d]/2<0,X=J?P<W?P-W:P-K:0;return{[u]:m[u]+X,data:C({[u]:D,centerOffset:P-D-X},J&&{alignmentOffset:X}),reset:J}}});var jt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;let{placement:o,middlewareData:s,rects:r,initialPlacement:l,platform:f,elements:a}=e,P=Z(t,e),{mainAxis:c=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:p=!0}=P,w=dt(P,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=s.arrow)!=null&&n.alignmentOffset)return{};let g=Y(o),y=j(l),b=Y(l)===l,A=await(f.isRTL==null?void 0:f.isRTL(a.floating)),O=m||(b||!p?[at(l)]:Nt(l)),k=d!=="none";!m&&k&&O.push(...Ht(l,p,d,A));let R=[l,...O],I=await yt(e,w),H=[],L=((i=s.flip)==null?void 0:i.overflows)||[];if(c&&H.push(I[g]),h){let D=$t(o,r,A);H.push(I[D[0]],I[D[1]])}if(L=[...L,{placement:o,overflows:H}],!H.every(D=>D<=0)){var U,W;let D=(((U=s.flip)==null?void 0:U.index)||0)+1,J=R[D];if(J&&(!(h==="alignment"?y!==j(J):!1)||L.every(B=>j(B.placement)===y?B.overflows[0]>0:!0)))return{data:{index:D,overflows:L},reset:{placement:J}};let X=(W=L.filter(Q=>Q.overflows[0]<=0).sort((Q,B)=>Q.overflows[1]-B.overflows[1])[0])==null?void 0:W.placement;if(!X)switch(u){case"bestFit":{var K;let Q=(K=L.filter(B=>{if(k){let G=j(B.placement);return G===y||G==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(G=>G>0).reduce((G,de)=>G+de,0)]).sort((B,G)=>B[1]-G[1])[0])==null?void 0:K[0];Q&&(X=Q);break}case"initialPlacement":X=l;break}if(o!==X)return{reset:{placement:X}}}return{}}}};var ve=new Set(["left","top"]);async function Ae(t,e){let{placement:n,platform:i,elements:o}=t,s=await(i.isRTL==null?void 0:i.isRTL(o.floating)),r=Y(n),l=tt(n),f=j(n)==="y",a=ve.has(r)?-1:1,c=s&&f?-1:1,h=Z(e,t),{mainAxis:m,crossAxis:u,alignmentAxis:d}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof d=="number"&&(u=l==="end"?d*-1:d),f?{x:u*c,y:m*a}:{x:m*a,y:u*c}}var It=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;let{x:o,y:s,placement:r,middlewareData:l}=e,f=await Ae(e,t);return r===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:o+f.x,y:s+f.y,data:V(C({},f),{placement:r})}}}},Xt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:o}=e,w=Z(t,e),{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:g=>{let{x:y,y:b}=g;return{x:y,y:b}}}}=w,f=dt(w,["mainAxis","crossAxis","limiter"]),a={x:n,y:i},c=await yt(e,f),h=j(Y(o)),m=St(h),u=a[m],d=a[h];if(s){let g=m==="y"?"top":"left",y=m==="y"?"bottom":"right",b=u+c[g],A=u-c[y];u=pt(b,u,A)}if(r){let g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",b=d+c[g],A=d-c[y];d=pt(b,d,A)}let p=l.fn(V(C({},e),{[m]:u,[h]:d}));return V(C({},p),{data:{x:p.x-n,y:p.y-i,enabled:{[m]:s,[h]:r}}})}}};var Yt=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;let{placement:o,rects:s,platform:r,elements:l}=e,L=Z(t,e),{apply:f=()=>{}}=L,a=dt(L,["apply"]),c=await yt(e,a),h=Y(o),m=tt(o),u=j(o)==="y",{width:d,height:p}=s.floating,w,g;h==="top"||h==="bottom"?(w=h,g=m===(await(r.isRTL==null?void 0:r.isRTL(l.floating))?"start":"end")?"left":"right"):(g=h,w=m==="end"?"top":"bottom");let y=p-c.top-c.bottom,b=d-c.left-c.right,A=_(p-c[w],y),O=_(d-c[g],b),k=!e.middlewareData.shift,R=A,I=O;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(I=b),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(R=y),k&&!m){let U=S(c.left,0),W=S(c.right,0),K=S(c.top,0),P=S(c.bottom,0);u?I=d-2*(U!==0||W!==0?U+W:S(c.left,c.right)):R=p-2*(K!==0||P!==0?K+P:S(c.top,c.bottom))}await f(V(C({},e),{availableWidth:I,availableHeight:R}));let H=await r.getDimensions(l.floating);return d!==H.width||p!==H.height?{reset:{rects:!0}}:{}}}};function xt(){return typeof window!="undefined"}function nt(t){return Ut(t)?(t.nodeName||"").toLowerCase():"#document"}function T(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $(t){var e;return(e=(Ut(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ut(t){return xt()?t instanceof Node||t instanceof T(t).Node:!1}function z(t){return xt()?t instanceof Element||t instanceof T(t).Element:!1}function N(t){return xt()?t instanceof HTMLElement||t instanceof T(t).HTMLElement:!1}function qt(t){return!xt()||typeof ShadowRoot=="undefined"?!1:t instanceof ShadowRoot||t instanceof T(t).ShadowRoot}var Oe=new Set(["inline","contents"]);function st(t){let{overflow:e,overflowX:n,overflowY:i,display:o}=M(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!Oe.has(o)}var Ee=new Set(["table","td","th"]);function Kt(t){return Ee.has(nt(t))}var Re=[":popover-open",":modal"];function ut(t){return Re.some(e=>{try{return t.matches(e)}catch(n){return!1}})}var Ce=["transform","translate","scale","rotate","perspective"],Se=["transform","translate","scale","rotate","perspective","filter"],Te=["paint","layout","strict","content"];function bt(t){let e=vt(),n=z(t)?M(t):t;return Ce.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Se.some(i=>(n.willChange||"").includes(i))||Te.some(i=>(n.contain||"").includes(i))}function Gt(t){let e=q(t);for(;N(e)&&!it(e);){if(bt(e))return e;if(ut(e))return null;e=q(e)}return null}function vt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var Pe=new Set(["html","body","#document"]);function it(t){return Pe.has(nt(t))}function M(t){return T(t).getComputedStyle(t)}function ht(t){return z(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function q(t){if(nt(t)==="html")return t;let e=t.assignedSlot||t.parentNode||qt(t)&&t.host||$(t);return qt(e)?e.host:e}function Jt(t){let e=q(t);return it(e)?t.ownerDocument?t.ownerDocument.body:t.body:N(e)&&st(e)?e:Jt(e)}function rt(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let o=Jt(t),s=o===((i=t.ownerDocument)==null?void 0:i.body),r=T(o);if(s){let l=At(r);return e.concat(r,r.visualViewport||[],st(o)?o:[],l&&n?rt(l):[])}return e.concat(o,rt(o,[],n))}function At(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ee(t){let e=M(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,o=N(t),s=o?t.offsetWidth:n,r=o?t.offsetHeight:i,l=ct(n)!==s||ct(i)!==r;return l&&(n=s,i=r),{width:n,height:i,$:l}}function Lt(t){return z(t)?t:t.contextElement}function lt(t){let e=Lt(t);if(!N(e))return F(1);let n=e.getBoundingClientRect(),{width:i,height:o,$:s}=ee(e),r=(s?ct(n.width):n.width)/i,l=(s?ct(n.height):n.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}var Le=F(0);function ne(t){let e=T(t);return!vt()||!e.visualViewport?Le:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ze(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==T(t)?!1:e}function ot(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let o=t.getBoundingClientRect(),s=Lt(t),r=F(1);e&&(i?z(i)&&(r=lt(i)):r=lt(t));let l=ze(s,n,i)?ne(s):F(0),f=(o.left+l.x)/r.x,a=(o.top+l.y)/r.y,c=o.width/r.x,h=o.height/r.y;if(s){let m=T(s),u=i&&z(i)?T(i):i,d=m,p=At(d);for(;p&&i&&u!==d;){let w=lt(p),g=p.getBoundingClientRect(),y=M(p),b=g.left+(p.clientLeft+parseFloat(y.paddingLeft))*w.x,A=g.top+(p.clientTop+parseFloat(y.paddingTop))*w.y;f*=w.x,a*=w.y,c*=w.x,h*=w.y,f+=b,a+=A,d=T(p),p=At(d)}}return et({width:c,height:h,x:f,y:a})}function Ot(t,e){let n=ht(t).scrollLeft;return e?e.left+n:ot($(t)).left+n}function ie(t,e){let n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-Ot(t,n),o=n.top+e.scrollTop;return{x:i,y:o}}function Me(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t,s=o==="fixed",r=$(i),l=e?ut(e.floating):!1;if(i===r||l&&s)return n;let f={scrollLeft:0,scrollTop:0},a=F(1),c=F(0),h=N(i);if((h||!h&&!s)&&((nt(i)!=="body"||st(r))&&(f=ht(i)),N(i))){let u=ot(i);a=lt(i),c.x=u.x+i.clientLeft,c.y=u.y+i.clientTop}let m=r&&!h&&!s?ie(r,f):F(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-f.scrollLeft*a.x+c.x+m.x,y:n.y*a.y-f.scrollTop*a.y+c.y+m.y}}function ke(t){return Array.from(t.getClientRects())}function De(t){let e=$(t),n=ht(t),i=t.ownerDocument.body,o=S(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=S(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),r=-n.scrollLeft+Ot(t),l=-n.scrollTop;return M(i).direction==="rtl"&&(r+=S(e.clientWidth,i.clientWidth)-o),{width:o,height:s,x:r,y:l}}var Qt=25;function Be(t,e){let n=T(t),i=$(t),o=n.visualViewport,s=i.clientWidth,r=i.clientHeight,l=0,f=0;if(o){s=o.width,r=o.height;let c=vt();(!c||c&&e==="fixed")&&(l=o.offsetLeft,f=o.offsetTop)}let a=Ot(i);if(a<=0){let c=i.ownerDocument,h=c.body,m=getComputedStyle(h),u=c.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,d=Math.abs(i.clientWidth-h.clientWidth-u);d<=Qt&&(s-=d)}else a<=Qt&&(s+=a);return{width:s,height:r,x:l,y:f}}var Fe=new Set(["absolute","fixed"]);function $e(t,e){let n=ot(t,!0,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft,s=N(t)?lt(t):F(1),r=t.clientWidth*s.x,l=t.clientHeight*s.y,f=o*s.x,a=i*s.y;return{width:r,height:l,x:f,y:a}}function Zt(t,e,n){let i;if(e==="viewport")i=Be(t,n);else if(e==="document")i=De($(t));else if(z(e))i=$e(e,n);else{let o=ne(t);i={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return et(i)}function oe(t,e){let n=q(t);return n===e||!z(n)||it(n)?!1:M(n).position==="fixed"||oe(n,e)}function Ne(t,e){let n=e.get(t);if(n)return n;let i=rt(t,[],!1).filter(l=>z(l)&&nt(l)!=="body"),o=null,s=M(t).position==="fixed",r=s?q(t):t;for(;z(r)&&!it(r);){let l=M(r),f=bt(r);!f&&l.position==="fixed"&&(o=null),(s?!f&&!o:!f&&l.position==="static"&&!!o&&Fe.has(o.position)||st(r)&&!f&&oe(t,r))?i=i.filter(c=>c!==r):o=l,r=q(r)}return e.set(t,i),i}function He(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t,r=[...n==="clippingAncestors"?ut(e)?[]:Ne(e,this._c):[].concat(n),i],l=r[0],f=r.reduce((a,c)=>{let h=Zt(e,c,o);return a.top=S(h.top,a.top),a.right=_(h.right,a.right),a.bottom=_(h.bottom,a.bottom),a.left=S(h.left,a.left),a},Zt(e,l,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function We(t){let{width:e,height:n}=ee(t);return{width:e,height:n}}function Ve(t,e,n){let i=N(e),o=$(e),s=n==="fixed",r=ot(t,!0,s,e),l={scrollLeft:0,scrollTop:0},f=F(0);function a(){f.x=Ot(o)}if(i||!i&&!s)if((nt(e)!=="body"||st(o))&&(l=ht(e)),i){let u=ot(e,!0,s,e);f.x=u.x+e.clientLeft,f.y=u.y+e.clientTop}else o&&a();s&&!i&&o&&a();let c=o&&!i&&!s?ie(o,l):F(0),h=r.left+l.scrollLeft-f.x-c.x,m=r.top+l.scrollTop-f.y-c.y;return{x:h,y:m,width:r.width,height:r.height}}function Pt(t){return M(t).position==="static"}function te(t,e){if(!N(t)||M(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return $(t)===n&&(n=n.ownerDocument.body),n}function re(t,e){let n=T(t);if(ut(t))return n;if(!N(t)){let o=q(t);for(;o&&!it(o);){if(z(o)&&!Pt(o))return o;o=q(o)}return n}let i=te(t,e);for(;i&&Kt(i)&&Pt(i);)i=te(i,e);return i&&it(i)&&Pt(i)&&!bt(i)?n:i||Gt(t)||n}var _e=async function(t){let e=this.getOffsetParent||re,n=this.getDimensions,i=await n(t.floating);return{reference:Ve(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function je(t){return M(t).direction==="rtl"}var Ie={convertOffsetParentRelativeRectToViewportRelativeRect:Me,getDocumentElement:$,getClippingRect:He,getOffsetParent:re,getElementRects:_e,getClientRects:ke,getDimensions:We,getScale:lt,isElement:z,isRTL:je};function se(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Xe(t,e){let n=null,i,o=$(t);function s(){var l;clearTimeout(i),(l=n)==null||l.disconnect(),n=null}function r(l,f){l===void 0&&(l=!1),f===void 0&&(f=1),s();let a=t.getBoundingClientRect(),{left:c,top:h,width:m,height:u}=a;if(l||e(),!m||!u)return;let d=ft(h),p=ft(o.clientWidth-(c+m)),w=ft(o.clientHeight-(h+u)),g=ft(c),b={rootMargin:-d+"px "+-p+"px "+-w+"px "+-g+"px",threshold:S(0,_(1,f))||1},A=!0;function O(k){let R=k[0].intersectionRatio;if(R!==f){if(!A)return r();R?r(!1,R):i=setTimeout(()=>{r(!1,1e-7)},1e3)}R===1&&!se(a,t.getBoundingClientRect())&&r(),A=!1}try{n=new IntersectionObserver(O,V(C({},b),{root:o.ownerDocument}))}catch(k){n=new IntersectionObserver(O,b)}n.observe(t)}return r(!0),s}function le(t,e,n,i){i===void 0&&(i={});let{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:f=!1}=i,a=Lt(t),c=o||s?[...a?rt(a):[],...rt(e)]:[];c.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});let h=a&&l?Xe(a,n):null,m=-1,u=null;r&&(u=new ResizeObserver(g=>{let[y]=g;y&&y.target===a&&u&&(u.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=u)==null||b.observe(e)})),n()}),a&&!f&&u.observe(a),u.observe(e));let d,p=f?ot(t):null;f&&w();function w(){let g=ot(t);p&&!se(p,g)&&n(),p=g,d=requestAnimationFrame(w)}return n(),()=>{var g;c.forEach(y=>{o&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),h==null||h(),(g=u)==null||g.disconnect(),u=null,f&&cancelAnimationFrame(d)}}var ae=It;var ce=Xt,fe=jt,zt=Yt;var ue=_t;var he=(t,e,n)=>{let i=new Map,o=C({platform:Ie},n),s=V(C({},o.platform),{_c:i});return Vt(t,e,V(C({},o),{platform:s}))};var x=class extends Ct{constructor(){super(...arguments);this.active=!1;this.placement="top";this.strategy="absolute";this.distance=0;this.skidding=0;this.arrow=!1;this.arrowPlacement="anchor";this.arrowPadding=10;this.flip=!1;this.flipFallbackPlacements="";this.flipFallbackStrategy="best-fit";this.flipPadding=0;this.shift=!1;this.shiftPadding=0;this.autoSizePadding=0}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start(),this.setupMutationObserver()}disconnectedCallback(){this.stop(),this.mutationObserver&&this.mutationObserver.disconnect()}async updated(n){super.updated(n),n.has("active")&&(this.active?this.start():this.stop()),n.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}setupMutationObserver(){this.mutationObserver=new MutationObserver(i=>this.handleCurrentPlacementChange(i));let n={attributes:!0};this.mutationObserver.observe(this,n)}handleCurrentPlacementChange(n){return n.forEach(i=>{if(i.attributeName==="data-current-placement"){let o=this.getAttribute("data-current-placement");this.emit("sd-current-placement",{detail:o})}})}async handleAnchorChange(){if(await this.stop(),this.anchor&&typeof this.anchor=="string"){let n=this.getRootNode();this.anchorEl=n.getElementById(this.anchor)}else this.anchor instanceof HTMLElement?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');if(this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),!this.anchorEl)throw new Error("Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.");this.start()}start(){this.anchorEl&&(this.cleanup=le(this.anchorEl,this.popup,()=>{this.reposition()}))}async stop(){return new Promise(n=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame(()=>n())):n()})}reposition(){if(!this.active||!this.anchorEl)return;let n=[ae({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?n.push(zt({apply:({rects:i})=>{let o=this.sync==="width"||this.sync==="both",s=this.sync==="height"||this.sync==="both";this.popup.style.width=o?`${i.reference.width}px`:"",this.popup.style.height=s?`${i.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&n.push(fe({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:this.flipFallbackStrategy==="best-fit"?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&n.push(ce({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?n.push(zt({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:i,availableHeight:o})=>{this.autoSize==="vertical"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-height",`${o}px`):this.style.removeProperty("--auto-size-available-height"),this.autoSize==="horizontal"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-width",`${i}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&n.push(ue({element:this.arrowEl,padding:this.arrowPadding})),he(this.anchorEl,this.popup,{placement:this.placement,middleware:n,strategy:this.strategy}).then(({x:i,y:o,middlewareData:s,placement:r})=>{let l=getComputedStyle(this).direction==="rtl",f={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]];if(this.setAttribute("data-current-placement",r),Object.assign(this.popup.style,{left:`${i}px`,top:`${o}px`}),this.arrow){let a=s.arrow.x,c=s.arrow.y,h="",m="",u="",d="";if(this.arrowPlacement==="start"){let p=typeof a=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";h=typeof c=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",m=l?p:"",d=l?"":p}else if(this.arrowPlacement==="end"){let p=typeof a=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";m=l?"":p,d=l?p:"",u=typeof c=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else this.arrowPlacement==="center"?(d=typeof a=="number"?"calc(50% - var(--arrow-size-diagonal))":"",h=typeof c=="number"?"calc(50% - var(--arrow-size-diagonal))":""):(d=typeof a=="number"?`${a}px`:"",h=typeof c=="number"?`${c}px`:"");Object.assign(this.arrowEl.style,{top:h,right:m,bottom:u,left:d,[f]:"calc(var(--arrow-size-diagonal) * -1)"})}}),this.emit("sd-reposition")}render(){return Et`<slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot><div part="popup" class="${Dt("isolate",this.strategy!=="fixed"?"absolute":"fixed",!this.active&&"hidden")}"><slot></slot>${this.arrow?Et`<div part="arrow" class="absolute rotate-45 -z-10" role="presentation"></div>`:""}</div>`}};x.styles=[...Ct.styles,Mt`:host{--arrow-color:var(--sd-color-neutral-1000);--arrow-size:6px;--arrow-size-diagonal:calc(var(--arrow-size)*0.7071);--arrow-padding-offset:calc(var(--arrow-size-diagonal) - var(--arrow-size));display:contents}[part=popup]{max-height:var(--auto-size-available-height,none);max-width:var(--auto-size-available-width,none)}[part=arrow]{background:var(--arrow-color);height:calc(var(--arrow-size-diagonal)*2);width:calc(var(--arrow-size-diagonal)*2)}`],v([Rt('[part="popup"]')],x.prototype,"popup",2),v([Rt('[part="arrow"]')],x.prototype,"arrowEl",2),v([E({reflect:!0})],x.prototype,"anchor",2),v([E({type:Boolean,reflect:!0})],x.prototype,"active",2),v([E({type:String,reflect:!0})],x.prototype,"placement",2),v([E({type:String,reflect:!0})],x.prototype,"strategy",2),v([E({type:Number,reflect:!0})],x.prototype,"distance",2),v([E({type:Number,reflect:!0})],x.prototype,"skidding",2),v([E({type:Boolean,reflect:!0})],x.prototype,"arrow",2),v([E({type:String,attribute:"arrow-placement",reflect:!0})],x.prototype,"arrowPlacement",2),v([E({attribute:"arrow-padding",type:Number,reflect:!0})],x.prototype,"arrowPadding",2),v([E({type:Boolean,reflect:!0})],x.prototype,"flip",2),v([E({attribute:"flip-fallback-placements",converter:{fromAttribute:n=>n.split(" ").map(i=>i.trim()).filter(i=>i!==""),toAttribute:n=>n.join(" ")}})],x.prototype,"flipFallbackPlacements",2),v([E({type:String,attribute:"flip-fallback-strategy"})],x.prototype,"flipFallbackStrategy",2),v([E({type:Object})],x.prototype,"flipBoundary",2),v([E({attribute:"flip-padding",type:Number})],x.prototype,"flipPadding",2),v([E({type:Boolean})],x.prototype,"shift",2),v([E({type:Object})],x.prototype,"shiftBoundary",2),v([E({attribute:"shift-padding",type:Number})],x.prototype,"shiftPadding",2),v([E({type:String,attribute:"auto-size"})],x.prototype,"autoSize",2),v([E()],x.prototype,"sync",2),v([E({type:Object})],x.prototype,"autoSizeBoundary",2),v([E({attribute:"auto-size-padding",type:Number})],x.prototype,"autoSizePadding",2),x=v([kt("sd-5-15-12-popup")],x);export{x as a};
1
+ import{a as Dt}from"./chunk.YEDQWNIV.js";import{a as kt,b as E,d as Rt,h as Ct}from"./chunk.TJ7ZA5LO.js";import{b as Mt,e as Et}from"./chunk.RZUTJ36B.js";import{a as C,b as V,c as dt,e as v}from"./chunk.TJOCV4DC.js";var _=Math.min,S=Math.max,ct=Math.round,ft=Math.floor,F=t=>({x:t,y:t}),me={left:"right",right:"left",bottom:"top",top:"bottom"},pe={start:"end",end:"start"};function pt(t,e,n){return S(t,_(e,n))}function Z(t,e){return typeof t=="function"?t(e):t}function Y(t){return t.split("-")[0]}function tt(t){return t.split("-")[1]}function St(t){return t==="x"?"y":"x"}function gt(t){return t==="y"?"height":"width"}var ge=new Set(["top","bottom"]);function j(t){return ge.has(Y(t))?"y":"x"}function wt(t){return St(j(t))}function $t(t,e,n){n===void 0&&(n=!1);let i=tt(t),o=wt(t),s=gt(o),r=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=at(r)),[r,at(r)]}function Nt(t){let e=at(t);return[mt(t),e,mt(e)]}function mt(t){return t.replace(/start|end/g,e=>pe[e])}var Bt=["left","right"],Ft=["right","left"],we=["top","bottom"],ye=["bottom","top"];function xe(t,e,n){switch(t){case"top":case"bottom":return n?e?Ft:Bt:e?Bt:Ft;case"left":case"right":return e?we:ye;default:return[]}}function Ht(t,e,n,i){let o=tt(t),s=xe(Y(t),n==="start",i);return o&&(s=s.map(r=>r+"-"+o),e&&(s=s.concat(s.map(mt)))),s}function at(t){return t.replace(/left|right|bottom|top/g,e=>me[e])}function be(t){return C({top:0,right:0,bottom:0,left:0},t)}function Tt(t){return typeof t!="number"?be(t):{top:t,right:t,bottom:t,left:t}}function et(t){let{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function Wt(t,e,n){let{reference:i,floating:o}=t,s=j(e),r=wt(e),l=gt(r),f=Y(e),a=s==="y",c=i.x+i.width/2-o.width/2,h=i.y+i.height/2-o.height/2,m=i[l]/2-o[l]/2,u;switch(f){case"top":u={x:c,y:i.y-o.height};break;case"bottom":u={x:c,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:h};break;case"left":u={x:i.x-o.width,y:h};break;default:u={x:i.x,y:i.y}}switch(tt(e)){case"start":u[r]-=m*(n&&a?-1:1);break;case"end":u[r]+=m*(n&&a?-1:1);break}return u}var Vt=async(t,e,n)=>{let{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:r}=n,l=s.filter(Boolean),f=await(r.isRTL==null?void 0:r.isRTL(e)),a=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:c,y:h}=Wt(a,i,f),m=i,u={},d=0;for(let p=0;p<l.length;p++){let{name:w,fn:g}=l[p],{x:y,y:b,data:A,reset:O}=await g({x:c,y:h,initialPlacement:i,placement:m,strategy:o,middlewareData:u,rects:a,platform:r,elements:{reference:t,floating:e}});c=y!=null?y:c,h=b!=null?b:h,u=V(C({},u),{[w]:C(C({},u[w]),A)}),O&&d<=50&&(d++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(a=O.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:o}):O.rects),{x:c,y:h}=Wt(a,m,f)),p=-1)}return{x:c,y:h,placement:m,strategy:o,middlewareData:u}};async function yt(t,e){var n;e===void 0&&(e={});let{x:i,y:o,platform:s,rects:r,elements:l,strategy:f}=t,{boundary:a="clippingAncestors",rootBoundary:c="viewport",elementContext:h="floating",altBoundary:m=!1,padding:u=0}=Z(e,t),d=Tt(u),w=l[m?h==="floating"?"reference":"floating":h],g=et(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:a,rootBoundary:c,strategy:f})),y=h==="floating"?{x:i,y:o,width:r.floating.width,height:r.floating.height}:r.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),A=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},O=et(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:b,strategy:f}):y);return{top:(g.top-O.top+d.top)/A.y,bottom:(O.bottom-g.bottom+d.bottom)/A.y,left:(g.left-O.left+d.left)/A.x,right:(O.right-g.right+d.right)/A.x}}var _t=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:i,placement:o,rects:s,platform:r,elements:l,middlewareData:f}=e,{element:a,padding:c=0}=Z(t,e)||{};if(a==null)return{};let h=Tt(c),m={x:n,y:i},u=wt(o),d=gt(u),p=await r.getDimensions(a),w=u==="y",g=w?"top":"left",y=w?"bottom":"right",b=w?"clientHeight":"clientWidth",A=s.reference[d]+s.reference[u]-m[u]-s.floating[d],O=m[u]-s.reference[u],k=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a)),R=k?k[b]:0;(!R||!await(r.isElement==null?void 0:r.isElement(k)))&&(R=l.floating[b]||s.floating[d]);let I=A/2-O/2,H=R/2-p[d]/2-1,L=_(h[g],H),U=_(h[y],H),W=L,K=R-p[d]-U,P=R/2-p[d]/2+I,D=pt(W,P,K),J=!f.arrow&&tt(o)!=null&&P!==D&&s.reference[d]/2-(P<W?L:U)-p[d]/2<0,X=J?P<W?P-W:P-K:0;return{[u]:m[u]+X,data:C({[u]:D,centerOffset:P-D-X},J&&{alignmentOffset:X}),reset:J}}});var jt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;let{placement:o,middlewareData:s,rects:r,initialPlacement:l,platform:f,elements:a}=e,P=Z(t,e),{mainAxis:c=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:p=!0}=P,w=dt(P,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=s.arrow)!=null&&n.alignmentOffset)return{};let g=Y(o),y=j(l),b=Y(l)===l,A=await(f.isRTL==null?void 0:f.isRTL(a.floating)),O=m||(b||!p?[at(l)]:Nt(l)),k=d!=="none";!m&&k&&O.push(...Ht(l,p,d,A));let R=[l,...O],I=await yt(e,w),H=[],L=((i=s.flip)==null?void 0:i.overflows)||[];if(c&&H.push(I[g]),h){let D=$t(o,r,A);H.push(I[D[0]],I[D[1]])}if(L=[...L,{placement:o,overflows:H}],!H.every(D=>D<=0)){var U,W;let D=(((U=s.flip)==null?void 0:U.index)||0)+1,J=R[D];if(J&&(!(h==="alignment"?y!==j(J):!1)||L.every(B=>j(B.placement)===y?B.overflows[0]>0:!0)))return{data:{index:D,overflows:L},reset:{placement:J}};let X=(W=L.filter(Q=>Q.overflows[0]<=0).sort((Q,B)=>Q.overflows[1]-B.overflows[1])[0])==null?void 0:W.placement;if(!X)switch(u){case"bestFit":{var K;let Q=(K=L.filter(B=>{if(k){let G=j(B.placement);return G===y||G==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(G=>G>0).reduce((G,de)=>G+de,0)]).sort((B,G)=>B[1]-G[1])[0])==null?void 0:K[0];Q&&(X=Q);break}case"initialPlacement":X=l;break}if(o!==X)return{reset:{placement:X}}}return{}}}};var ve=new Set(["left","top"]);async function Ae(t,e){let{placement:n,platform:i,elements:o}=t,s=await(i.isRTL==null?void 0:i.isRTL(o.floating)),r=Y(n),l=tt(n),f=j(n)==="y",a=ve.has(r)?-1:1,c=s&&f?-1:1,h=Z(e,t),{mainAxis:m,crossAxis:u,alignmentAxis:d}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof d=="number"&&(u=l==="end"?d*-1:d),f?{x:u*c,y:m*a}:{x:m*a,y:u*c}}var It=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;let{x:o,y:s,placement:r,middlewareData:l}=e,f=await Ae(e,t);return r===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:o+f.x,y:s+f.y,data:V(C({},f),{placement:r})}}}},Xt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:o}=e,w=Z(t,e),{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:g=>{let{x:y,y:b}=g;return{x:y,y:b}}}}=w,f=dt(w,["mainAxis","crossAxis","limiter"]),a={x:n,y:i},c=await yt(e,f),h=j(Y(o)),m=St(h),u=a[m],d=a[h];if(s){let g=m==="y"?"top":"left",y=m==="y"?"bottom":"right",b=u+c[g],A=u-c[y];u=pt(b,u,A)}if(r){let g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",b=d+c[g],A=d-c[y];d=pt(b,d,A)}let p=l.fn(V(C({},e),{[m]:u,[h]:d}));return V(C({},p),{data:{x:p.x-n,y:p.y-i,enabled:{[m]:s,[h]:r}}})}}};var Yt=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;let{placement:o,rects:s,platform:r,elements:l}=e,L=Z(t,e),{apply:f=()=>{}}=L,a=dt(L,["apply"]),c=await yt(e,a),h=Y(o),m=tt(o),u=j(o)==="y",{width:d,height:p}=s.floating,w,g;h==="top"||h==="bottom"?(w=h,g=m===(await(r.isRTL==null?void 0:r.isRTL(l.floating))?"start":"end")?"left":"right"):(g=h,w=m==="end"?"top":"bottom");let y=p-c.top-c.bottom,b=d-c.left-c.right,A=_(p-c[w],y),O=_(d-c[g],b),k=!e.middlewareData.shift,R=A,I=O;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(I=b),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(R=y),k&&!m){let U=S(c.left,0),W=S(c.right,0),K=S(c.top,0),P=S(c.bottom,0);u?I=d-2*(U!==0||W!==0?U+W:S(c.left,c.right)):R=p-2*(K!==0||P!==0?K+P:S(c.top,c.bottom))}await f(V(C({},e),{availableWidth:I,availableHeight:R}));let H=await r.getDimensions(l.floating);return d!==H.width||p!==H.height?{reset:{rects:!0}}:{}}}};function xt(){return typeof window!="undefined"}function nt(t){return Ut(t)?(t.nodeName||"").toLowerCase():"#document"}function T(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $(t){var e;return(e=(Ut(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ut(t){return xt()?t instanceof Node||t instanceof T(t).Node:!1}function z(t){return xt()?t instanceof Element||t instanceof T(t).Element:!1}function N(t){return xt()?t instanceof HTMLElement||t instanceof T(t).HTMLElement:!1}function qt(t){return!xt()||typeof ShadowRoot=="undefined"?!1:t instanceof ShadowRoot||t instanceof T(t).ShadowRoot}var Oe=new Set(["inline","contents"]);function st(t){let{overflow:e,overflowX:n,overflowY:i,display:o}=M(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!Oe.has(o)}var Ee=new Set(["table","td","th"]);function Kt(t){return Ee.has(nt(t))}var Re=[":popover-open",":modal"];function ut(t){return Re.some(e=>{try{return t.matches(e)}catch(n){return!1}})}var Ce=["transform","translate","scale","rotate","perspective"],Se=["transform","translate","scale","rotate","perspective","filter"],Te=["paint","layout","strict","content"];function bt(t){let e=vt(),n=z(t)?M(t):t;return Ce.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Se.some(i=>(n.willChange||"").includes(i))||Te.some(i=>(n.contain||"").includes(i))}function Gt(t){let e=q(t);for(;N(e)&&!it(e);){if(bt(e))return e;if(ut(e))return null;e=q(e)}return null}function vt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var Pe=new Set(["html","body","#document"]);function it(t){return Pe.has(nt(t))}function M(t){return T(t).getComputedStyle(t)}function ht(t){return z(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function q(t){if(nt(t)==="html")return t;let e=t.assignedSlot||t.parentNode||qt(t)&&t.host||$(t);return qt(e)?e.host:e}function Jt(t){let e=q(t);return it(e)?t.ownerDocument?t.ownerDocument.body:t.body:N(e)&&st(e)?e:Jt(e)}function rt(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let o=Jt(t),s=o===((i=t.ownerDocument)==null?void 0:i.body),r=T(o);if(s){let l=At(r);return e.concat(r,r.visualViewport||[],st(o)?o:[],l&&n?rt(l):[])}return e.concat(o,rt(o,[],n))}function At(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ee(t){let e=M(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,o=N(t),s=o?t.offsetWidth:n,r=o?t.offsetHeight:i,l=ct(n)!==s||ct(i)!==r;return l&&(n=s,i=r),{width:n,height:i,$:l}}function Lt(t){return z(t)?t:t.contextElement}function lt(t){let e=Lt(t);if(!N(e))return F(1);let n=e.getBoundingClientRect(),{width:i,height:o,$:s}=ee(e),r=(s?ct(n.width):n.width)/i,l=(s?ct(n.height):n.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}var Le=F(0);function ne(t){let e=T(t);return!vt()||!e.visualViewport?Le:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ze(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==T(t)?!1:e}function ot(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let o=t.getBoundingClientRect(),s=Lt(t),r=F(1);e&&(i?z(i)&&(r=lt(i)):r=lt(t));let l=ze(s,n,i)?ne(s):F(0),f=(o.left+l.x)/r.x,a=(o.top+l.y)/r.y,c=o.width/r.x,h=o.height/r.y;if(s){let m=T(s),u=i&&z(i)?T(i):i,d=m,p=At(d);for(;p&&i&&u!==d;){let w=lt(p),g=p.getBoundingClientRect(),y=M(p),b=g.left+(p.clientLeft+parseFloat(y.paddingLeft))*w.x,A=g.top+(p.clientTop+parseFloat(y.paddingTop))*w.y;f*=w.x,a*=w.y,c*=w.x,h*=w.y,f+=b,a+=A,d=T(p),p=At(d)}}return et({width:c,height:h,x:f,y:a})}function Ot(t,e){let n=ht(t).scrollLeft;return e?e.left+n:ot($(t)).left+n}function ie(t,e){let n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-Ot(t,n),o=n.top+e.scrollTop;return{x:i,y:o}}function Me(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t,s=o==="fixed",r=$(i),l=e?ut(e.floating):!1;if(i===r||l&&s)return n;let f={scrollLeft:0,scrollTop:0},a=F(1),c=F(0),h=N(i);if((h||!h&&!s)&&((nt(i)!=="body"||st(r))&&(f=ht(i)),N(i))){let u=ot(i);a=lt(i),c.x=u.x+i.clientLeft,c.y=u.y+i.clientTop}let m=r&&!h&&!s?ie(r,f):F(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-f.scrollLeft*a.x+c.x+m.x,y:n.y*a.y-f.scrollTop*a.y+c.y+m.y}}function ke(t){return Array.from(t.getClientRects())}function De(t){let e=$(t),n=ht(t),i=t.ownerDocument.body,o=S(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=S(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),r=-n.scrollLeft+Ot(t),l=-n.scrollTop;return M(i).direction==="rtl"&&(r+=S(e.clientWidth,i.clientWidth)-o),{width:o,height:s,x:r,y:l}}var Qt=25;function Be(t,e){let n=T(t),i=$(t),o=n.visualViewport,s=i.clientWidth,r=i.clientHeight,l=0,f=0;if(o){s=o.width,r=o.height;let c=vt();(!c||c&&e==="fixed")&&(l=o.offsetLeft,f=o.offsetTop)}let a=Ot(i);if(a<=0){let c=i.ownerDocument,h=c.body,m=getComputedStyle(h),u=c.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,d=Math.abs(i.clientWidth-h.clientWidth-u);d<=Qt&&(s-=d)}else a<=Qt&&(s+=a);return{width:s,height:r,x:l,y:f}}var Fe=new Set(["absolute","fixed"]);function $e(t,e){let n=ot(t,!0,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft,s=N(t)?lt(t):F(1),r=t.clientWidth*s.x,l=t.clientHeight*s.y,f=o*s.x,a=i*s.y;return{width:r,height:l,x:f,y:a}}function Zt(t,e,n){let i;if(e==="viewport")i=Be(t,n);else if(e==="document")i=De($(t));else if(z(e))i=$e(e,n);else{let o=ne(t);i={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return et(i)}function oe(t,e){let n=q(t);return n===e||!z(n)||it(n)?!1:M(n).position==="fixed"||oe(n,e)}function Ne(t,e){let n=e.get(t);if(n)return n;let i=rt(t,[],!1).filter(l=>z(l)&&nt(l)!=="body"),o=null,s=M(t).position==="fixed",r=s?q(t):t;for(;z(r)&&!it(r);){let l=M(r),f=bt(r);!f&&l.position==="fixed"&&(o=null),(s?!f&&!o:!f&&l.position==="static"&&!!o&&Fe.has(o.position)||st(r)&&!f&&oe(t,r))?i=i.filter(c=>c!==r):o=l,r=q(r)}return e.set(t,i),i}function He(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t,r=[...n==="clippingAncestors"?ut(e)?[]:Ne(e,this._c):[].concat(n),i],l=r[0],f=r.reduce((a,c)=>{let h=Zt(e,c,o);return a.top=S(h.top,a.top),a.right=_(h.right,a.right),a.bottom=_(h.bottom,a.bottom),a.left=S(h.left,a.left),a},Zt(e,l,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function We(t){let{width:e,height:n}=ee(t);return{width:e,height:n}}function Ve(t,e,n){let i=N(e),o=$(e),s=n==="fixed",r=ot(t,!0,s,e),l={scrollLeft:0,scrollTop:0},f=F(0);function a(){f.x=Ot(o)}if(i||!i&&!s)if((nt(e)!=="body"||st(o))&&(l=ht(e)),i){let u=ot(e,!0,s,e);f.x=u.x+e.clientLeft,f.y=u.y+e.clientTop}else o&&a();s&&!i&&o&&a();let c=o&&!i&&!s?ie(o,l):F(0),h=r.left+l.scrollLeft-f.x-c.x,m=r.top+l.scrollTop-f.y-c.y;return{x:h,y:m,width:r.width,height:r.height}}function Pt(t){return M(t).position==="static"}function te(t,e){if(!N(t)||M(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return $(t)===n&&(n=n.ownerDocument.body),n}function re(t,e){let n=T(t);if(ut(t))return n;if(!N(t)){let o=q(t);for(;o&&!it(o);){if(z(o)&&!Pt(o))return o;o=q(o)}return n}let i=te(t,e);for(;i&&Kt(i)&&Pt(i);)i=te(i,e);return i&&it(i)&&Pt(i)&&!bt(i)?n:i||Gt(t)||n}var _e=async function(t){let e=this.getOffsetParent||re,n=this.getDimensions,i=await n(t.floating);return{reference:Ve(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function je(t){return M(t).direction==="rtl"}var Ie={convertOffsetParentRelativeRectToViewportRelativeRect:Me,getDocumentElement:$,getClippingRect:He,getOffsetParent:re,getElementRects:_e,getClientRects:ke,getDimensions:We,getScale:lt,isElement:z,isRTL:je};function se(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Xe(t,e){let n=null,i,o=$(t);function s(){var l;clearTimeout(i),(l=n)==null||l.disconnect(),n=null}function r(l,f){l===void 0&&(l=!1),f===void 0&&(f=1),s();let a=t.getBoundingClientRect(),{left:c,top:h,width:m,height:u}=a;if(l||e(),!m||!u)return;let d=ft(h),p=ft(o.clientWidth-(c+m)),w=ft(o.clientHeight-(h+u)),g=ft(c),b={rootMargin:-d+"px "+-p+"px "+-w+"px "+-g+"px",threshold:S(0,_(1,f))||1},A=!0;function O(k){let R=k[0].intersectionRatio;if(R!==f){if(!A)return r();R?r(!1,R):i=setTimeout(()=>{r(!1,1e-7)},1e3)}R===1&&!se(a,t.getBoundingClientRect())&&r(),A=!1}try{n=new IntersectionObserver(O,V(C({},b),{root:o.ownerDocument}))}catch(k){n=new IntersectionObserver(O,b)}n.observe(t)}return r(!0),s}function le(t,e,n,i){i===void 0&&(i={});let{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:f=!1}=i,a=Lt(t),c=o||s?[...a?rt(a):[],...rt(e)]:[];c.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});let h=a&&l?Xe(a,n):null,m=-1,u=null;r&&(u=new ResizeObserver(g=>{let[y]=g;y&&y.target===a&&u&&(u.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=u)==null||b.observe(e)})),n()}),a&&!f&&u.observe(a),u.observe(e));let d,p=f?ot(t):null;f&&w();function w(){let g=ot(t);p&&!se(p,g)&&n(),p=g,d=requestAnimationFrame(w)}return n(),()=>{var g;c.forEach(y=>{o&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),h==null||h(),(g=u)==null||g.disconnect(),u=null,f&&cancelAnimationFrame(d)}}var ae=It;var ce=Xt,fe=jt,zt=Yt;var ue=_t;var he=(t,e,n)=>{let i=new Map,o=C({platform:Ie},n),s=V(C({},o.platform),{_c:i});return Vt(t,e,V(C({},o),{platform:s}))};var x=class extends Ct{constructor(){super(...arguments);this.active=!1;this.placement="top";this.strategy="absolute";this.distance=0;this.skidding=0;this.arrow=!1;this.arrowPlacement="anchor";this.arrowPadding=10;this.flip=!1;this.flipFallbackPlacements="";this.flipFallbackStrategy="best-fit";this.flipPadding=0;this.shift=!1;this.shiftPadding=0;this.autoSizePadding=0}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start(),this.setupMutationObserver()}disconnectedCallback(){this.stop(),this.mutationObserver&&this.mutationObserver.disconnect()}async updated(n){super.updated(n),n.has("active")&&(this.active?this.start():this.stop()),n.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}setupMutationObserver(){this.mutationObserver=new MutationObserver(i=>this.handleCurrentPlacementChange(i));let n={attributes:!0};this.mutationObserver.observe(this,n)}handleCurrentPlacementChange(n){return n.forEach(i=>{if(i.attributeName==="data-current-placement"){let o=this.getAttribute("data-current-placement");this.emit("sd-current-placement",{detail:o})}})}async handleAnchorChange(){if(await this.stop(),this.anchor&&typeof this.anchor=="string"){let n=this.getRootNode();this.anchorEl=n.getElementById(this.anchor)}else this.anchor instanceof HTMLElement?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');if(this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),!this.anchorEl)throw new Error("Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.");this.start()}start(){this.anchorEl&&(this.cleanup=le(this.anchorEl,this.popup,()=>{this.reposition()}))}async stop(){return new Promise(n=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame(()=>n())):n()})}reposition(){if(!this.active||!this.anchorEl)return;let n=[ae({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?n.push(zt({apply:({rects:i})=>{let o=this.sync==="width"||this.sync==="both",s=this.sync==="height"||this.sync==="both";this.popup.style.width=o?`${i.reference.width}px`:"",this.popup.style.height=s?`${i.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&n.push(fe({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:this.flipFallbackStrategy==="best-fit"?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&n.push(ce({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?n.push(zt({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:i,availableHeight:o})=>{this.autoSize==="vertical"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-height",`${o}px`):this.style.removeProperty("--auto-size-available-height"),this.autoSize==="horizontal"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-width",`${i}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&n.push(ue({element:this.arrowEl,padding:this.arrowPadding})),he(this.anchorEl,this.popup,{placement:this.placement,middleware:n,strategy:this.strategy}).then(({x:i,y:o,middlewareData:s,placement:r})=>{let l=getComputedStyle(this).direction==="rtl",f={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]];if(this.setAttribute("data-current-placement",r),Object.assign(this.popup.style,{left:`${i}px`,top:`${o}px`}),this.arrow){let a=s.arrow.x,c=s.arrow.y,h="",m="",u="",d="";if(this.arrowPlacement==="start"){let p=typeof a=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";h=typeof c=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",m=l?p:"",d=l?"":p}else if(this.arrowPlacement==="end"){let p=typeof a=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";m=l?"":p,d=l?p:"",u=typeof c=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else this.arrowPlacement==="center"?(d=typeof a=="number"?"calc(50% - var(--arrow-size-diagonal))":"",h=typeof c=="number"?"calc(50% - var(--arrow-size-diagonal))":""):(d=typeof a=="number"?`${a}px`:"",h=typeof c=="number"?`${c}px`:"");Object.assign(this.arrowEl.style,{top:h,right:m,bottom:u,left:d,[f]:"calc(var(--arrow-size-diagonal) * -1)"})}}),this.emit("sd-reposition")}render(){return Et`<slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot><div part="popup" class="${Dt("isolate",this.strategy!=="fixed"?"absolute":"fixed",!this.active&&"hidden")}"><slot></slot>${this.arrow?Et`<div part="arrow" class="absolute rotate-45 -z-10" role="presentation"></div>`:""}</div>`}};x.styles=[...Ct.styles,Mt`:host{--arrow-color:var(--sd-color-neutral-1000);--arrow-size:6px;--arrow-size-diagonal:calc(var(--arrow-size)*0.7071);--arrow-padding-offset:calc(var(--arrow-size-diagonal) - var(--arrow-size));display:contents}[part=popup]{max-height:var(--auto-size-available-height,none);max-width:var(--auto-size-available-width,none)}[part=arrow]{background:var(--arrow-color);height:calc(var(--arrow-size-diagonal)*2);width:calc(var(--arrow-size-diagonal)*2)}`],v([Rt('[part="popup"]')],x.prototype,"popup",2),v([Rt('[part="arrow"]')],x.prototype,"arrowEl",2),v([E({reflect:!0})],x.prototype,"anchor",2),v([E({type:Boolean,reflect:!0})],x.prototype,"active",2),v([E({type:String,reflect:!0})],x.prototype,"placement",2),v([E({type:String,reflect:!0})],x.prototype,"strategy",2),v([E({type:Number,reflect:!0})],x.prototype,"distance",2),v([E({type:Number,reflect:!0})],x.prototype,"skidding",2),v([E({type:Boolean,reflect:!0})],x.prototype,"arrow",2),v([E({type:String,attribute:"arrow-placement",reflect:!0})],x.prototype,"arrowPlacement",2),v([E({attribute:"arrow-padding",type:Number,reflect:!0})],x.prototype,"arrowPadding",2),v([E({type:Boolean,reflect:!0})],x.prototype,"flip",2),v([E({attribute:"flip-fallback-placements",converter:{fromAttribute:n=>n.split(" ").map(i=>i.trim()).filter(i=>i!==""),toAttribute:n=>n.join(" ")}})],x.prototype,"flipFallbackPlacements",2),v([E({type:String,attribute:"flip-fallback-strategy"})],x.prototype,"flipFallbackStrategy",2),v([E({type:Object})],x.prototype,"flipBoundary",2),v([E({attribute:"flip-padding",type:Number})],x.prototype,"flipPadding",2),v([E({type:Boolean})],x.prototype,"shift",2),v([E({type:Object})],x.prototype,"shiftBoundary",2),v([E({attribute:"shift-padding",type:Number})],x.prototype,"shiftPadding",2),v([E({type:String,attribute:"auto-size"})],x.prototype,"autoSize",2),v([E()],x.prototype,"sync",2),v([E({type:Object})],x.prototype,"autoSizeBoundary",2),v([E({attribute:"auto-size-padding",type:Number})],x.prototype,"autoSizePadding",2),x=v([kt("sd-5-15-13-popup")],x);export{x as a};
@@ -1 +1 @@
1
- import{a as p}from"./chunk.CGQ2BPPZ.js";import{a as n}from"./chunk.CHU57RUD.js";import{a as h,b as a}from"./chunk.PVM2WKMA.js";import{a as e}from"./chunk.YEDQWNIV.js";import{a as l}from"./chunk.E2DRD2OX.js";import{a as m,b as r,h as d}from"./chunk.TJ7ZA5LO.js";import{b}from"./chunk.RZUTJ36B.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends d{constructor(){super(...arguments);this.hasSlotController=new p(this,"label","[default]");this.size="lg";this.orientation="horizontal";this.horizontalInline=!1;this.waiting=!1;this.disabled=!1;this.current=!1;this.noTail=!1;this.notInteractive=!1;this.label="";this.description="";this.index=1;this.href=""}connectedCallback(){super.connectedCallback()}isLink(){return!!this.href}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleCurrentChange(){this.current&&(this.disabled=!1,this.waiting=!1)}handleDisabledChange(){this.disabled&&(this.current=!1,this.waiting=!1)}handleWaitingChange(){this.waiting&&(this.current=!1,this.disabled=!1)}handleInteractivityChange(){this.notInteractive&&(this.current=!1,this.disabled=!1,this.waiting=!1)}render(){let f=this.isLink(),u=this.notInteractive||this.waiting?h`div`:f?h`a`:h`button`,g=this.hasSlotController.test("label"),c=this.label?!0:g,v=this.hasSlotController.test("[default]"),s=this.description?!0:v,o=this.horizontalInline&&this.orientation==="horizontal",w=e("flex shrink-0 gap-2",this.noTail&&!o&&"w-max",this.orientation==="horizontal"?"flex-row":"flex-col items-stretch",o&&"items-start",this.orientation==="horizontal"&&!this.horizontalInline?this.size==="lg"?"translateLg":"translateSm":this.size==="lg"?"mt-1":"mt-3"),x=e("border rounded-full aspect-square circle flex items-center justify-center shrink-0 font-bold select-none",this.disabled?"focus-visible:outline-none cursor-not-allowed":!this.notInteractive&&!this.waiting?"focus-visible:focus-outline hover:cursor-pointer":"",this.notInteractive?this.size==="lg"?"not-interactive-lg":"w-12":this.size==="lg"?"w-12":"w-8",this.disabled&&"border-neutral-500 text-neutral-500",this.waiting&&"border-neutral-400 text-neutral-700",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting&&"border-primary hover:bg-primary-100 hover:border-primary-500",this.notInteractive&&"border-neutral-400",this.current&&"bg-accent border-none text-white");return a`<div role="listitem" part="base" class="${e("flex pt-1",this.orientation==="horizontal"?"flex-col w-full":"flex-row gap-4 items-stretch h-full w-full overflow-hidden",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting&&"group")}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"><div part="circle-and-tail-container" class="${w}"><${u} part="circle" href="${n(f?this.href:void 0)}" aria-disabled="${n(this.disabled||this.waiting||void 0)}" aria-current="${this.current?"step":void 0}" aria-labelledby="${n(this.notInteractive||this.waiting||!c?void 0:"label")}" aria-describedby="${n(this.notInteractive||this.waiting||!s?void 0:"description")}" class="${x}"><slot name="circle-content" class="${e("text-lg",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting&&"text-primary hover:text-primary-500 hover:fill-primary-500",this.notInteractive&&"text-primary")}">${!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting?a`<sd-5-15-12-icon name="status-check" library="_internal" class="${e(this.size==="sm"&&"text-sm")}"></sd-5-15-12-icon>`:a`${this.index}`}</slot></${u}>${o?a`<div class="${e(!this.noTail&&"flex-1","flex flex-col gap-1")}"><div class="${e("flex w-full",c&&"gap-2",this.size==="sm"&&!s?"mt-1":"mt-3")}">${c&&a`<div part="label" id="label" class="${e("font-bold sd-paragraph whitespace-nowrap",this.disabled&&"text-neutral-500",this.waiting&&"text-neutral-700",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting?"text-primary":"text-black")}"><slot name="label">${this.label}</slot></div>`} ${this.noTail?"":a`<div part="tail" class="${e("border-t flex-1 mr-2 mt-3",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting?"border-primary":"border-neutral-500")}"></div>`}</div>${s?a`<div part="description" id="description" class="${e("sd-paragraph sd-paragraph--size-sm break-words",s?"flex-1":"w-0 h-0 overflow-hidden",s&&!this.noTail&&"pr-4",(this.disabled||this.waiting)&&"!text-neutral-700")}">${this.description||a`<slot></slot>`}</div>`:""}</div>`:this.noTail?"":a`<div part="tail" class="${e(this.orientation==="horizontal"?"border-t w-full my-auto mr-2":"border-l flex-grow flex-shrink-0 basis-auto h-full w-[1px] mx-auto",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting?"border-primary":"border-neutral-400")}"></div>`}</div>${o?"":a`<div part="text-container" class="${e("mt-4 break-words flex flex-col gap-2",this.orientation==="horizontal"?"text-center w-40":"text-left",this.disabled&&"text-neutral-500",this.waiting&&"text-neutral-700",this.notInteractive?"ml-2":"mr-4")}"><div part="label" id="label" class="${e("!font-bold sd-paragraph",this.disabled&&"text-neutral-500",this.waiting&&"text-neutral-700",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting?"text-primary":"text-black")}"><slot name="label">${this.label}</slot></div><div part="description" id="description" class="${e("sd-paragraph sd-paragraph--size-sm",(this.disabled||this.waiting)&&"text-neutral-700")}">${this.description||a`<slot></slot>`}</div></div>`}</div>`}};t.styles=[...d.styles,b`:host{flex:1 1 0%}:host([no-tail]){flex-grow:0}:host([horizontal-inline]):has([part=description]){flex:1 1 0%;min-width:var(--sd-spacing-0,0)}.translateLg{transform:translateX(3.438rem)}.translateSm{transform:translateX(4rem)}.not-interactive-lg{width:4.5rem}`],i([r({type:String,reflect:!0})],t.prototype,"size",2),i([r({type:String,reflect:!0})],t.prototype,"orientation",2),i([r({type:Boolean,reflect:!0,attribute:"horizontal-inline"})],t.prototype,"horizontalInline",2),i([r({type:Boolean,reflect:!0})],t.prototype,"waiting",2),i([r({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([r({type:Boolean,reflect:!0})],t.prototype,"current",2),i([r({reflect:!0,type:Boolean,attribute:"no-tail"})],t.prototype,"noTail",2),i([r({type:Boolean,reflect:!0,attribute:"not-interactive"})],t.prototype,"notInteractive",2),i([r({type:String,reflect:!0})],t.prototype,"label",2),i([r({type:String,reflect:!0})],t.prototype,"description",2),i([r({type:Number,reflect:!0,attribute:"index"})],t.prototype,"index",2),i([r({type:String,reflect:!0})],t.prototype,"href",2),i([l("current")],t.prototype,"handleCurrentChange",1),i([l("disabled")],t.prototype,"handleDisabledChange",1),i([l("waiting")],t.prototype,"handleWaitingChange",1),i([l("notInteractive")],t.prototype,"handleInteractivityChange",1),t=i([m("sd-5-15-12-step")],t);export{t as a};
1
+ import{a as p}from"./chunk.CGQ2BPPZ.js";import{a as n}from"./chunk.CHU57RUD.js";import{a as h,b as a}from"./chunk.PVM2WKMA.js";import{a as e}from"./chunk.YEDQWNIV.js";import{a as l}from"./chunk.E2DRD2OX.js";import{a as m,b as r,h as d}from"./chunk.TJ7ZA5LO.js";import{b}from"./chunk.RZUTJ36B.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends d{constructor(){super(...arguments);this.hasSlotController=new p(this,"label","[default]");this.size="lg";this.orientation="horizontal";this.horizontalInline=!1;this.waiting=!1;this.disabled=!1;this.current=!1;this.noTail=!1;this.notInteractive=!1;this.label="";this.description="";this.index=1;this.href=""}connectedCallback(){super.connectedCallback()}isLink(){return!!this.href}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleCurrentChange(){this.current&&(this.disabled=!1,this.waiting=!1)}handleDisabledChange(){this.disabled&&(this.current=!1,this.waiting=!1)}handleWaitingChange(){this.waiting&&(this.current=!1,this.disabled=!1)}handleInteractivityChange(){this.notInteractive&&(this.current=!1,this.disabled=!1,this.waiting=!1)}render(){let f=this.isLink(),u=this.notInteractive||this.waiting?h`div`:f?h`a`:h`button`,g=this.hasSlotController.test("label"),c=this.label?!0:g,v=this.hasSlotController.test("[default]"),s=this.description?!0:v,o=this.horizontalInline&&this.orientation==="horizontal",w=e("flex shrink-0 gap-2",this.noTail&&!o&&"w-max",this.orientation==="horizontal"?"flex-row":"flex-col items-stretch",o&&"items-start",this.orientation==="horizontal"&&!this.horizontalInline?this.size==="lg"?"translateLg":"translateSm":this.size==="lg"?"mt-1":"mt-3"),x=e("border rounded-full aspect-square circle flex items-center justify-center shrink-0 font-bold select-none",this.disabled?"focus-visible:outline-none cursor-not-allowed":!this.notInteractive&&!this.waiting?"focus-visible:focus-outline hover:cursor-pointer":"",this.notInteractive?this.size==="lg"?"not-interactive-lg":"w-12":this.size==="lg"?"w-12":"w-8",this.disabled&&"border-neutral-500 text-neutral-500",this.waiting&&"border-neutral-400 text-neutral-700",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting&&"border-primary hover:bg-primary-100 hover:border-primary-500",this.notInteractive&&"border-neutral-400",this.current&&"bg-accent border-none text-white");return a`<div role="listitem" part="base" class="${e("flex pt-1",this.orientation==="horizontal"?"flex-col w-full":"flex-row gap-4 items-stretch h-full w-full overflow-hidden",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting&&"group")}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"><div part="circle-and-tail-container" class="${w}"><${u} part="circle" href="${n(f?this.href:void 0)}" aria-disabled="${n(this.disabled||this.waiting||void 0)}" aria-current="${this.current?"step":void 0}" aria-labelledby="${n(this.notInteractive||this.waiting||!c?void 0:"label")}" aria-describedby="${n(this.notInteractive||this.waiting||!s?void 0:"description")}" class="${x}"><slot name="circle-content" class="${e("text-lg",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting&&"text-primary hover:text-primary-500 hover:fill-primary-500",this.notInteractive&&"text-primary")}">${!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting?a`<sd-5-15-13-icon name="status-check" library="_internal" class="${e(this.size==="sm"&&"text-sm")}"></sd-5-15-13-icon>`:a`${this.index}`}</slot></${u}>${o?a`<div class="${e(!this.noTail&&"flex-1","flex flex-col gap-1")}"><div class="${e("flex w-full",c&&"gap-2",this.size==="sm"&&!s?"mt-1":"mt-3")}">${c&&a`<div part="label" id="label" class="${e("font-bold sd-paragraph whitespace-nowrap",this.disabled&&"text-neutral-500",this.waiting&&"text-neutral-700",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting?"text-primary":"text-black")}"><slot name="label">${this.label}</slot></div>`} ${this.noTail?"":a`<div part="tail" class="${e("border-t flex-1 mr-2 mt-3",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting?"border-primary":"border-neutral-500")}"></div>`}</div>${s?a`<div part="description" id="description" class="${e("sd-paragraph sd-paragraph--size-sm break-words",s?"flex-1":"w-0 h-0 overflow-hidden",s&&!this.noTail&&"pr-4",(this.disabled||this.waiting)&&"!text-neutral-700")}">${this.description||a`<slot></slot>`}</div>`:""}</div>`:this.noTail?"":a`<div part="tail" class="${e(this.orientation==="horizontal"?"border-t w-full my-auto mr-2":"border-l flex-grow flex-shrink-0 basis-auto h-full w-[1px] mx-auto",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting?"border-primary":"border-neutral-400")}"></div>`}</div>${o?"":a`<div part="text-container" class="${e("mt-4 break-words flex flex-col gap-2",this.orientation==="horizontal"?"text-center w-40":"text-left",this.disabled&&"text-neutral-500",this.waiting&&"text-neutral-700",this.notInteractive?"ml-2":"mr-4")}"><div part="label" id="label" class="${e("!font-bold sd-paragraph",this.disabled&&"text-neutral-500",this.waiting&&"text-neutral-700",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting?"text-primary":"text-black")}"><slot name="label">${this.label}</slot></div><div part="description" id="description" class="${e("sd-paragraph sd-paragraph--size-sm",(this.disabled||this.waiting)&&"text-neutral-700")}">${this.description||a`<slot></slot>`}</div></div>`}</div>`}};t.styles=[...d.styles,b`:host{flex:1 1 0%}:host([no-tail]){flex-grow:0}:host([horizontal-inline]):has([part=description]){flex:1 1 0%;min-width:var(--sd-spacing-0,0)}.translateLg{transform:translateX(3.438rem)}.translateSm{transform:translateX(4rem)}.not-interactive-lg{width:4.5rem}`],i([r({type:String,reflect:!0})],t.prototype,"size",2),i([r({type:String,reflect:!0})],t.prototype,"orientation",2),i([r({type:Boolean,reflect:!0,attribute:"horizontal-inline"})],t.prototype,"horizontalInline",2),i([r({type:Boolean,reflect:!0})],t.prototype,"waiting",2),i([r({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([r({type:Boolean,reflect:!0})],t.prototype,"current",2),i([r({reflect:!0,type:Boolean,attribute:"no-tail"})],t.prototype,"noTail",2),i([r({type:Boolean,reflect:!0,attribute:"not-interactive"})],t.prototype,"notInteractive",2),i([r({type:String,reflect:!0})],t.prototype,"label",2),i([r({type:String,reflect:!0})],t.prototype,"description",2),i([r({type:Number,reflect:!0,attribute:"index"})],t.prototype,"index",2),i([r({type:String,reflect:!0})],t.prototype,"href",2),i([l("current")],t.prototype,"handleCurrentChange",1),i([l("disabled")],t.prototype,"handleDisabledChange",1),i([l("waiting")],t.prototype,"handleWaitingChange",1),i([l("notInteractive")],t.prototype,"handleInteractivityChange",1),t=i([m("sd-5-15-13-step")],t);export{t as a};
@@ -1 +1 @@
1
- import{a as b}from"./chunk.CGQ2BPPZ.js";import{a as p}from"./chunk.CHU57RUD.js";import{a as o}from"./chunk.YEDQWNIV.js";import{a as h}from"./chunk.E2DRD2OX.js";import{a as c,b as i,c as u,d as r,h as n}from"./chunk.TJ7ZA5LO.js";import{b as d,e as a}from"./chunk.RZUTJ36B.js";import{e as s}from"./chunk.TJOCV4DC.js";var t=class extends n{constructor(){super(...arguments);this.hasSlotController=new b(this,"[default]","icon");this.hasFocus=!1;this.size="lg";this.disabled=!1;this.visuallyDisabled=!1;this.checked=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(e){if(this.disabled||this.visuallyDisabled){e.preventDefault(),e.stopPropagation();return}this.checked=!0}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleDisabledChange(){let e=this.disabled||this.visuallyDisabled;this.setAttribute("aria-disabled",e?"true":"false")}focus(e){this.input.focus(e)}blur(){this.input.blur()}render(){let e=this.hasSlotController.test("[default]"),l=this.hasSlotController.test("icon"),m=`${this.size}-${e?"label":"no-label"}`;return a`<div part="base" role="presentation" class="relative"><button part="${`button${this.checked?" button--checked":""}`}" role="radio" aria-checked="${this.checked}" class="${o("relative text-center rounded-full transition-all ease-in-out duration-100 items-center justify-center focus-visible:focus-outline",this.size==="sm"?"text-sm":"text-base",this.checked&&!this.disabled&&!this.visuallyDisabled?"bg-primary text-white hover:bg-primary-500":!this.checked&&(this.disabled||this.visuallyDisabled)?"text-neutral-500 hover:cursor-not-allowed":this.checked&&(this.disabled||this.visuallyDisabled)?"bg-neutral-400 text-white hover:cursor-not-allowed ":"bg-transparent text-primary border-primary hover:text-primary-500 cursor-pointer",e&&{sm:"px-3",md:"px-4",lg:"px-5"}[this.size],this.hasFocus&&"focused-class",e&&"button--has-label",l&&"button--has-icon flex gap-2",m)}" aria-disabled="${this.disabled||this.visuallyDisabled}" type="button" value="${p(this.value)}" tabindex="${this.checked?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @click="${this.handleClick}"><slot name="icon" part="icon" class="${o(l&&"inline-flex relative items-center",{sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size])}" ?hidden="${!l}"></slot>${e?a`<slot part="label" class="button__label inline-flex relative items-center whitespace-nowrap"></slot>`:null}</button></div>`}};t.styles=[...n.styles,d`:host{display:block;width:-moz-min-content;width:min-content}.hidden-input{all:unset;inset:var(--sd-spacing-0,0);opacity:var(--sd-opacity-0,0);outline-color:rgb(var(--sd-color-error,204 25 55)/1);outline-style:dotted;outline-width:1px;position:absolute;z-index:-10}.lg-label,.lg-no-label{height:var(--sd-spacing-12,3rem)}.lg-no-label{padding-left:var(--sd-spacing-5,1.25rem);padding-right:var(--sd-spacing-5,1.25rem)}.md-label,.md-no-label{height:var(--sd-spacing-10,2.5rem)}.md-no-label{padding-left:var(--sd-spacing-4,1rem);padding-right:var(--sd-spacing-4,1rem)}.sm-label,.sm-no-label{height:var(--sd-spacing-8,2rem)}.sm-no-label{padding-left:var(--sd-spacing-3,.75rem);padding-right:var(--sd-spacing-3,.75rem)}:host([size=lg].sd-5-15-12-button-group__button:not(.sd-5-15-12-button-group__button--first)){margin-inline-start:calc(var(--sd-spacing-3,.75rem)*-1)}:host([size=md].sd-5-15-12-button-group__button:not(.sd-5-15-12-button-group__button--first)){margin-inline-start:calc(var(--sd-spacing-2,.5rem)*-1)}:host([size=sm].sd-5-15-12-button-group__button:not(.sd-5-15-12-button-group__button--first)){margin-inline-start:calc(var(--sd-spacing-1,.25rem)*-1)}:host(.sd-5-15-12-button-group__button--hover){z-index:20}:host(.sd-5-15-12-button-group__button--focus),:host(.sd-5-15-12-button-group__button[checked]){z-index:10}`],s([r(".button")],t.prototype,"input",2),s([r(".hidden-input")],t.prototype,"hiddenInput",2),s([u()],t.prototype,"hasFocus",2),s([i({type:String,reflect:!0})],t.prototype,"size",2),s([i({type:Boolean,reflect:!0})],t.prototype,"disabled",2),s([i({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),s([i({type:Boolean,reflect:!0})],t.prototype,"checked",2),s([i()],t.prototype,"value",2),s([h(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),t=s([c("sd-5-15-12-radio-button")],t);export{t as a};
1
+ import{a as b}from"./chunk.CGQ2BPPZ.js";import{a as p}from"./chunk.CHU57RUD.js";import{a as o}from"./chunk.YEDQWNIV.js";import{a as h}from"./chunk.E2DRD2OX.js";import{a as c,b as i,c as u,d as r,h as n}from"./chunk.TJ7ZA5LO.js";import{b as d,e as a}from"./chunk.RZUTJ36B.js";import{e as s}from"./chunk.TJOCV4DC.js";var t=class extends n{constructor(){super(...arguments);this.hasSlotController=new b(this,"[default]","icon");this.hasFocus=!1;this.size="lg";this.disabled=!1;this.visuallyDisabled=!1;this.checked=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(e){if(this.disabled||this.visuallyDisabled){e.preventDefault(),e.stopPropagation();return}this.checked=!0}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleDisabledChange(){let e=this.disabled||this.visuallyDisabled;this.setAttribute("aria-disabled",e?"true":"false")}focus(e){this.input.focus(e)}blur(){this.input.blur()}render(){let e=this.hasSlotController.test("[default]"),l=this.hasSlotController.test("icon"),m=`${this.size}-${e?"label":"no-label"}`;return a`<div part="base" role="presentation" class="relative"><button part="${`button${this.checked?" button--checked":""}`}" role="radio" aria-checked="${this.checked}" class="${o("relative text-center rounded-full transition-all ease-in-out duration-100 items-center justify-center focus-visible:focus-outline",this.size==="sm"?"text-sm":"text-base",this.checked&&!this.disabled&&!this.visuallyDisabled?"bg-primary text-white hover:bg-primary-500":!this.checked&&(this.disabled||this.visuallyDisabled)?"text-neutral-500 hover:cursor-not-allowed":this.checked&&(this.disabled||this.visuallyDisabled)?"bg-neutral-400 text-white hover:cursor-not-allowed ":"bg-transparent text-primary border-primary hover:text-primary-500 cursor-pointer",e&&{sm:"px-3",md:"px-4",lg:"px-5"}[this.size],this.hasFocus&&"focused-class",e&&"button--has-label",l&&"button--has-icon flex gap-2",m)}" aria-disabled="${this.disabled||this.visuallyDisabled}" type="button" value="${p(this.value)}" tabindex="${this.checked?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @click="${this.handleClick}"><slot name="icon" part="icon" class="${o(l&&"inline-flex relative items-center",{sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size])}" ?hidden="${!l}"></slot>${e?a`<slot part="label" class="button__label inline-flex relative items-center whitespace-nowrap"></slot>`:null}</button></div>`}};t.styles=[...n.styles,d`:host{display:block;width:-moz-min-content;width:min-content}.hidden-input{all:unset;inset:var(--sd-spacing-0,0);opacity:var(--sd-opacity-0,0);outline-color:rgb(var(--sd-color-error,204 25 55)/1);outline-style:dotted;outline-width:1px;position:absolute;z-index:-10}.lg-label,.lg-no-label{height:var(--sd-spacing-12,3rem)}.lg-no-label{padding-left:var(--sd-spacing-5,1.25rem);padding-right:var(--sd-spacing-5,1.25rem)}.md-label,.md-no-label{height:var(--sd-spacing-10,2.5rem)}.md-no-label{padding-left:var(--sd-spacing-4,1rem);padding-right:var(--sd-spacing-4,1rem)}.sm-label,.sm-no-label{height:var(--sd-spacing-8,2rem)}.sm-no-label{padding-left:var(--sd-spacing-3,.75rem);padding-right:var(--sd-spacing-3,.75rem)}:host([size=lg].sd-5-15-13-button-group__button:not(.sd-5-15-13-button-group__button--first)){margin-inline-start:calc(var(--sd-spacing-3,.75rem)*-1)}:host([size=md].sd-5-15-13-button-group__button:not(.sd-5-15-13-button-group__button--first)){margin-inline-start:calc(var(--sd-spacing-2,.5rem)*-1)}:host([size=sm].sd-5-15-13-button-group__button:not(.sd-5-15-13-button-group__button--first)){margin-inline-start:calc(var(--sd-spacing-1,.25rem)*-1)}:host(.sd-5-15-13-button-group__button--hover){z-index:20}:host(.sd-5-15-13-button-group__button--focus),:host(.sd-5-15-13-button-group__button[checked]){z-index:10}`],s([r(".button")],t.prototype,"input",2),s([r(".hidden-input")],t.prototype,"hiddenInput",2),s([u()],t.prototype,"hasFocus",2),s([i({type:String,reflect:!0})],t.prototype,"size",2),s([i({type:Boolean,reflect:!0})],t.prototype,"disabled",2),s([i({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),s([i({type:Boolean,reflect:!0})],t.prototype,"checked",2),s([i()],t.prototype,"value",2),s([h(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),t=s([c("sd-5-15-13-radio-button")],t);export{t as a};
@@ -1,11 +1,11 @@
1
- import{a as M}from"./chunk.EJI65G6N.js";import{c as I}from"./chunk.3L472FD4.js";import{b as z}from"./chunk.NRBNWX7R.js";import{a as L}from"./chunk.CGQ2BPPZ.js";import{a as w,c as O}from"./chunk.SKUMYG4O.js";import{a as C}from"./chunk.KLRPP4NQ.js";import{a as D}from"./chunk.BOIDC3L5.js";import{a as d}from"./chunk.YEDQWNIV.js";import{a as k}from"./chunk.Y7NVH75J.js";import{a as b}from"./chunk.E2DRD2OX.js";import{a as $,b as a,c as u,d as c,g as E,h as x}from"./chunk.TJ7ZA5LO.js";import{b as T,e as p}from"./chunk.RZUTJ36B.js";import{b as g,e as y}from"./chunk.6OTM3PE5.js";import{e as s}from"./chunk.TJOCV4DC.js";var i=class extends x{constructor(){super(...arguments);this.formControlController=new z(this,{assumeInteractionOn:["sd-blur","sd-5-15-12-input"]});this.hasSlotController=new L(this,"help-text","label");this.localize=new k(this);this.typeToSelectString="";this.deletedTagLabel="";this.hasFocus=!1;this.selectedOptions=[];this.showValidStyle=!1;this.showInvalidStyle=!1;this.defaultValue="";this.open=!1;this.size="lg";this.placement="bottom";this.label="";this.placeholder="";this.maxOptionsTagLabel="";this.disabled=!1;this.visuallyDisabled=!1;this.helpText="";this.currentPlacement=this.placement;this.clearable=!1;this.multiple=!1;this.useTags=!1;this.maxOptionsVisible=3;this.form="";this.name="";this.value="";this.required=!1;this.styleOnValid=!1;this.hoist=!1;this.getTag=t=>p`<sd-5-15-12-tag class="relative z-10" ?disabled="${this.disabled}" part="tag" exportparts="
1
+ import{a as M}from"./chunk.EJI65G6N.js";import{c as I}from"./chunk.3L472FD4.js";import{b as z}from"./chunk.NRBNWX7R.js";import{a as L}from"./chunk.CGQ2BPPZ.js";import{a as w,c as O}from"./chunk.SKUMYG4O.js";import{a as C}from"./chunk.KLRPP4NQ.js";import{a as D}from"./chunk.BOIDC3L5.js";import{a as d}from"./chunk.YEDQWNIV.js";import{a as k}from"./chunk.Y7NVH75J.js";import{a as b}from"./chunk.E2DRD2OX.js";import{a as $,b as a,c as u,d as c,g as E,h as x}from"./chunk.TJ7ZA5LO.js";import{b as T,e as p}from"./chunk.RZUTJ36B.js";import{b as g,e as y}from"./chunk.6OTM3PE5.js";import{e as s}from"./chunk.TJOCV4DC.js";var i=class extends x{constructor(){super(...arguments);this.formControlController=new z(this,{assumeInteractionOn:["sd-blur","sd-5-15-13-input"]});this.hasSlotController=new L(this,"help-text","label");this.localize=new k(this);this.typeToSelectString="";this.deletedTagLabel="";this.hasFocus=!1;this.selectedOptions=[];this.showValidStyle=!1;this.showInvalidStyle=!1;this.defaultValue="";this.open=!1;this.size="lg";this.placement="bottom";this.label="";this.placeholder="";this.maxOptionsTagLabel="";this.disabled=!1;this.visuallyDisabled=!1;this.helpText="";this.currentPlacement=this.placement;this.clearable=!1;this.multiple=!1;this.useTags=!1;this.maxOptionsVisible=3;this.form="";this.name="";this.value="";this.required=!1;this.styleOnValid=!1;this.hoist=!1;this.getTag=t=>p`<sd-5-15-13-tag class="relative z-10" ?disabled="${this.disabled}" part="tag" exportparts="
2
2
  base:tag__base,
3
3
  content:tag__content,
4
4
  removable-indicator:tag__removable-indicator,
5
- " size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-5-15-12-tag>`;this.handleDocumentFocusIn=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()};this.handleDocumentKeyDown=t=>{let e=t.target,o=e.closest(".select__clear")!==null,l=e.closest("sd-5-15-12-icon-button")!==null;if(!(o||l)){if(t.key==="Escape"&&this.open&&(t.preventDefault(),t.stopPropagation(),this.hide(),this.combobox.focus({preventScroll:!0})),t.key==="Enter"||t.key===" "&&this.typeToSelectString===""){if(t.preventDefault(),t.stopImmediatePropagation(),!this.open){this.show(),this.setCurrentOption(this.currentOption||this.getFirstOption(),t);return}this.currentOption&&!this.currentOption.disabled&&(this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.combobox.focus({preventScroll:!0})));return}if(["ArrowUp","ArrowDown","Home","End"].includes(t.key)){let h=this.getAllOptions(),n=h.indexOf(this.currentOption),r=Math.max(0,n);if(t.preventDefault(),!this.open&&(this.show(),this.currentOption))return;t.key==="ArrowDown"?(r=n+1,r>h.length-1&&(r=0)):t.key==="ArrowUp"?(r=n-1,r<0&&(r=h.length-1)):t.key==="Home"?r=0:t.key==="End"&&(r=h.length-1),this.setCurrentOption(h[r],t)}if(t.key.length===1||t.key==="Backspace"){let h=this.getAllOptions();if(t.metaKey||t.ctrlKey||t.altKey)return;if(!this.open){if(t.key==="Backspace")return;this.show()}t.stopPropagation(),t.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout(()=>this.typeToSelectString="",1e3),t.key==="Backspace"?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=t.key.toLowerCase();for(let n of h)if(n.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(n);break}}}};this.handleDocumentMouseDown=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()}}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}connectedCallback(){super.connectedCallback(),this.open=!1}firstUpdated(){this.applySizeToOptions()}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){var o,l,h;if((t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple){t.preventDefault(),t.stopPropagation();let n=(o=t.currentTarget)==null?void 0:o.parentElement,r=(l=n==null?void 0:n.previousElementSibling)==null?void 0:l.querySelector("sd-5-15-12-tag"),m=(h=n==null?void 0:n.nextElementSibling)==null?void 0:h.querySelector("sd-5-15-12-tag");this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then(()=>{m?m.focus():r?r.focus():this.focus({preventScroll:!0})})}}handleTagMaxOptionsKeyDown(t){(t.key==="Backspace"||t.key==="Enter")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>{var o;let e=(o=this.shadowRoot)==null?void 0:o.querySelectorAll("sd-5-15-12-tag");e&&e.length>0?e==null||e[(e==null?void 0:e.length)-1].focus():this.focus({preventScroll:!0})}))}handleLabelClick(){this.combobox.focus()}handleComboboxMouseDown(t){let o=t.composedPath().some(l=>l instanceof HTMLSlotElement&&l.name==="removable-indicator");this.disabled||o||this.visuallyDisabled||(t.preventDefault(),this.combobox.focus({preventScroll:!0}),this.open=!this.open,this.setCurrentOption(this.currentOption||this.getFirstOption(),t))}handleComboboxKeyDown(t){t.stopPropagation(),this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearSelect()}clearSelect(){this.setSelectedOptions([]),this.combobox.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")})}handleClearMouseDown(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){let o=t.target.closest("sd-5-15-12-option"),l=this.value;o&&!o.disabled&&(this.multiple?this.toggleOptionSelection(o):this.setSelectedOptions(o),this.updateComplete.then(()=>this.combobox.focus({preventScroll:!0})),this.value!==l&&this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.combobox.focus({preventScroll:!0})))}handleDefaultSlotChange(){let t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value],o=[];customElements.get("sd-5-15-12-option")?(t.forEach(l=>{this.multiple&&(l.checkbox=!0),o.push(l.value)}),this.setSelectedOptions(t.filter(l=>e.includes(l.value)))):customElements.whenDefined("sd-5-15-12-option").then(()=>this.handleDefaultSlotChange())}handleTagRemove(t,e){t.stopPropagation(),e||this.clearSelect(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.deletedTagLabel=this.localize.term("removed",e.textContent),this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}))}getAllOptions(){return[...this.querySelectorAll("sd-5-15-12-option")]}getFirstOption(){return this.querySelector("sd-5-15-12-option")}setCurrentOption(t,e){this.getAllOptions().forEach(l=>{l.current=!1,l.tabIndex=-1,((e==null?void 0:e.type)==="keydown"||(e==null?void 0:e.type)==="mousedown")&&(l.isKeyboardFocus=!1)}),t&&(this.currentOption=t,t.current=!0,t.tabIndex=0,t.focus()),t&&(e==null?void 0:e.type)==="keydown"&&(t.isKeyboardFocus=!0)}setSelectedOptions(t){let e=this.getAllOptions(),o=Array.isArray(t)?t:[t];e.forEach(l=>l.selected=!1),o.length&&o.forEach(l=>l.selected=!0),Array.isArray(t)?this.selectionChanged():this.selectionChanged(t)}toggleOptionSelection(t,e){e===!0||e===!1?t.selected=e:t.selected=!t.selected,Array.isArray(t)?this.selectionChanged():this.selectionChanged(t)}get displayLabel(){var t,e;return this.multiple?this.useTags||this.value.length===0?"":this.localize.term("numOptionsSelected",this.selectedOptions.length):(e=(t=this.selectedOptions[0])==null?void 0:t.getTextLabel())!=null?e:""}selectionChanged(t){var e,o;t&&this.multiple?this.selectedOptions.find(l=>l.value===t.value)?this.selectedOptions=this.selectedOptions.filter(l=>l.value!==t.value):this.selectedOptions=[...this.selectedOptions,t]:this.selectedOptions=this.getAllOptions().filter(l=>l.selected),this.multiple?this.value=this.selectedOptions.map(l=>l.value):this.value=(o=(e=this.selectedOptions[0])==null?void 0:e.value)!=null?o:"",this.updateComplete.then(()=>{this.formControlController.updateValidity()})}get tags(){return this.selectedOptions.length<=this.maxOptionsVisible?this.selectedOptions.map((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){let o=this.getTag(t,e);return p`<div @sd-remove="${l=>this.handleTagRemove(l,t)}">${typeof o=="string"?D(o):o}</div>`}return[p``]}):[p`<sd-5-15-12-tag class="z-10" ?disabled="${this.disabled}" part="tag" exportparts="
5
+ " size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-5-15-13-tag>`;this.handleDocumentFocusIn=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()};this.handleDocumentKeyDown=t=>{let e=t.target,o=e.closest(".select__clear")!==null,l=e.closest("sd-5-15-13-icon-button")!==null;if(!(o||l)){if(t.key==="Escape"&&this.open&&(t.preventDefault(),t.stopPropagation(),this.hide(),this.combobox.focus({preventScroll:!0})),t.key==="Enter"||t.key===" "&&this.typeToSelectString===""){if(t.preventDefault(),t.stopImmediatePropagation(),!this.open){this.show(),this.setCurrentOption(this.currentOption||this.getFirstOption(),t);return}this.currentOption&&!this.currentOption.disabled&&(this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.combobox.focus({preventScroll:!0})));return}if(["ArrowUp","ArrowDown","Home","End"].includes(t.key)){let h=this.getAllOptions(),n=h.indexOf(this.currentOption),r=Math.max(0,n);if(t.preventDefault(),!this.open&&(this.show(),this.currentOption))return;t.key==="ArrowDown"?(r=n+1,r>h.length-1&&(r=0)):t.key==="ArrowUp"?(r=n-1,r<0&&(r=h.length-1)):t.key==="Home"?r=0:t.key==="End"&&(r=h.length-1),this.setCurrentOption(h[r],t)}if(t.key.length===1||t.key==="Backspace"){let h=this.getAllOptions();if(t.metaKey||t.ctrlKey||t.altKey)return;if(!this.open){if(t.key==="Backspace")return;this.show()}t.stopPropagation(),t.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout(()=>this.typeToSelectString="",1e3),t.key==="Backspace"?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=t.key.toLowerCase();for(let n of h)if(n.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(n);break}}}};this.handleDocumentMouseDown=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()}}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}connectedCallback(){super.connectedCallback(),this.open=!1}firstUpdated(){this.applySizeToOptions()}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){var o,l,h;if((t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple){t.preventDefault(),t.stopPropagation();let n=(o=t.currentTarget)==null?void 0:o.parentElement,r=(l=n==null?void 0:n.previousElementSibling)==null?void 0:l.querySelector("sd-5-15-13-tag"),m=(h=n==null?void 0:n.nextElementSibling)==null?void 0:h.querySelector("sd-5-15-13-tag");this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then(()=>{m?m.focus():r?r.focus():this.focus({preventScroll:!0})})}}handleTagMaxOptionsKeyDown(t){(t.key==="Backspace"||t.key==="Enter")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>{var o;let e=(o=this.shadowRoot)==null?void 0:o.querySelectorAll("sd-5-15-13-tag");e&&e.length>0?e==null||e[(e==null?void 0:e.length)-1].focus():this.focus({preventScroll:!0})}))}handleLabelClick(){this.combobox.focus()}handleComboboxMouseDown(t){let o=t.composedPath().some(l=>l instanceof HTMLSlotElement&&l.name==="removable-indicator");this.disabled||o||this.visuallyDisabled||(t.preventDefault(),this.combobox.focus({preventScroll:!0}),this.open=!this.open,this.setCurrentOption(this.currentOption||this.getFirstOption(),t))}handleComboboxKeyDown(t){t.stopPropagation(),this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearSelect()}clearSelect(){this.setSelectedOptions([]),this.combobox.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")})}handleClearMouseDown(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){let o=t.target.closest("sd-5-15-13-option"),l=this.value;o&&!o.disabled&&(this.multiple?this.toggleOptionSelection(o):this.setSelectedOptions(o),this.updateComplete.then(()=>this.combobox.focus({preventScroll:!0})),this.value!==l&&this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.combobox.focus({preventScroll:!0})))}handleDefaultSlotChange(){let t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value],o=[];customElements.get("sd-5-15-13-option")?(t.forEach(l=>{this.multiple&&(l.checkbox=!0),o.push(l.value)}),this.setSelectedOptions(t.filter(l=>e.includes(l.value)))):customElements.whenDefined("sd-5-15-13-option").then(()=>this.handleDefaultSlotChange())}handleTagRemove(t,e){t.stopPropagation(),e||this.clearSelect(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.deletedTagLabel=this.localize.term("removed",e.textContent),this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}))}getAllOptions(){return[...this.querySelectorAll("sd-5-15-13-option")]}getFirstOption(){return this.querySelector("sd-5-15-13-option")}setCurrentOption(t,e){this.getAllOptions().forEach(l=>{l.current=!1,l.tabIndex=-1,((e==null?void 0:e.type)==="keydown"||(e==null?void 0:e.type)==="mousedown")&&(l.isKeyboardFocus=!1)}),t&&(this.currentOption=t,t.current=!0,t.tabIndex=0,t.focus()),t&&(e==null?void 0:e.type)==="keydown"&&(t.isKeyboardFocus=!0)}setSelectedOptions(t){let e=this.getAllOptions(),o=Array.isArray(t)?t:[t];e.forEach(l=>l.selected=!1),o.length&&o.forEach(l=>l.selected=!0),Array.isArray(t)?this.selectionChanged():this.selectionChanged(t)}toggleOptionSelection(t,e){e===!0||e===!1?t.selected=e:t.selected=!t.selected,Array.isArray(t)?this.selectionChanged():this.selectionChanged(t)}get displayLabel(){var t,e;return this.multiple?this.useTags||this.value.length===0?"":this.localize.term("numOptionsSelected",this.selectedOptions.length):(e=(t=this.selectedOptions[0])==null?void 0:t.getTextLabel())!=null?e:""}selectionChanged(t){var e,o;t&&this.multiple?this.selectedOptions.find(l=>l.value===t.value)?this.selectedOptions=this.selectedOptions.filter(l=>l.value!==t.value):this.selectedOptions=[...this.selectedOptions,t]:this.selectedOptions=this.getAllOptions().filter(l=>l.selected),this.multiple?this.value=this.selectedOptions.map(l=>l.value):this.value=(o=(e=this.selectedOptions[0])==null?void 0:e.value)!=null?o:"",this.updateComplete.then(()=>{this.formControlController.updateValidity()})}get tags(){return this.selectedOptions.length<=this.maxOptionsVisible?this.selectedOptions.map((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){let o=this.getTag(t,e);return p`<div @sd-remove="${l=>this.handleTagRemove(l,t)}">${typeof o=="string"?D(o):o}</div>`}return[p``]}):[p`<sd-5-15-13-tag class="z-10" ?disabled="${this.disabled}" part="tag" exportparts="
6
6
  base:tag__base,
7
7
  content:tag__content,
8
8
  removable-indicator:tag__removable-indicator,
9
- " size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-5-15-12-tag>`]}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleCurrentPlacement(t){let e=t.detail;e&&(this.currentPlacement=e)}handleUseTagsChange(){let t=this.getAllOptions();customElements.get("sd-5-15-12-option")&&t.forEach(e=>{e.checkbox=this.multiple})}handleDisabledChange(){(this.disabled||this.visuallyDisabled)&&(this.open=!1,this.handleOpenChange())}async handleOpenChange(){if(this.open&&(!this.disabled||!this.visuallyDisabled)){this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("sd-show"),this.addOpenListeners(),await y(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame(()=>{this.setCurrentOption(this.currentOption)});let{keyframes:t,options:e}=O(this,"select.show",{dir:this.localize.dir()});await g(this.popup.popup,t,e),this.currentOption&&I(this.currentOption,this.listbox,"vertical","auto"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await y(this);let{keyframes:t,options:e}=O(this,"select.hide",{dir:this.localize.dir()});await g(this.popup.popup,t,e),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}applySizeToOptions(){this._optionsInDefaultSlot.forEach(t=>{t.size=this.size})}handleValueChange(){if(this.selectedOptions.length===(Array.isArray(this.value)?this.value.length:1))return;let t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(t.filter(o=>e.includes(o.value)))}async show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}return this.open=!0,C(this,"sd-after-show")}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.open=!1,C(this,"sd-after-hide")}checkValidity(){var t;return(t=this.valueInput)==null?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.combobox.focus(t)}blur(){this.combobox.blur()}render(){let t={default:this.hasSlotController.test("[default]"),label:this.hasSlotController.test("label"),clearIcon:this.hasSlotController.test("clear-icon"),expandIcon:this.hasSlotController.test("expand-icon"),helpText:this.hasSlotController.test("help-text"),tooltip:this.hasSlotController.test("tooltip")},e=this.label?!0:!!t.label,o=this.helpText?!0:!!t.helpText,l=this.clearable&&!this.disabled,h=!!t.tooltip,n=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",r=this.disabled||this.visuallyDisabled?"cursor-not-allowed":"cursor-pointer",m={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],f={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return p`<div part="form-control" class="${d("relative text-left",r,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}"><span class="sr-only" aria-live="polite">${this.deletedTagLabel}</span> ${e||h?p`<div class="flex items-center gap-1 mb-2"><label id="label" part="form-control-label" class="${e&&"inline-block"}" aria-hidden="${e?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label> ${t.tooltip?p`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${d("relative w-full bg-white",n==="disabled"?"text-neutral-500":"text-black")}"><div part="border" class="${d("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",{disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[n],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-5-15-12-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${d("inline-flex relative w-full",this.currentPlacement==="bottom"?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
9
+ " size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-5-15-13-tag>`]}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleCurrentPlacement(t){let e=t.detail;e&&(this.currentPlacement=e)}handleUseTagsChange(){let t=this.getAllOptions();customElements.get("sd-5-15-13-option")&&t.forEach(e=>{e.checkbox=this.multiple})}handleDisabledChange(){(this.disabled||this.visuallyDisabled)&&(this.open=!1,this.handleOpenChange())}async handleOpenChange(){if(this.open&&(!this.disabled||!this.visuallyDisabled)){this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("sd-show"),this.addOpenListeners(),await y(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame(()=>{this.setCurrentOption(this.currentOption)});let{keyframes:t,options:e}=O(this,"select.show",{dir:this.localize.dir()});await g(this.popup.popup,t,e),this.currentOption&&I(this.currentOption,this.listbox,"vertical","auto"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await y(this);let{keyframes:t,options:e}=O(this,"select.hide",{dir:this.localize.dir()});await g(this.popup.popup,t,e),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}applySizeToOptions(){this._optionsInDefaultSlot.forEach(t=>{t.size=this.size})}handleValueChange(){if(this.selectedOptions.length===(Array.isArray(this.value)?this.value.length:1))return;let t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(t.filter(o=>e.includes(o.value)))}async show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}return this.open=!0,C(this,"sd-after-show")}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.open=!1,C(this,"sd-after-hide")}checkValidity(){var t;return(t=this.valueInput)==null?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.combobox.focus(t)}blur(){this.combobox.blur()}render(){let t={default:this.hasSlotController.test("[default]"),label:this.hasSlotController.test("label"),clearIcon:this.hasSlotController.test("clear-icon"),expandIcon:this.hasSlotController.test("expand-icon"),helpText:this.hasSlotController.test("help-text"),tooltip:this.hasSlotController.test("tooltip")},e=this.label?!0:!!t.label,o=this.helpText?!0:!!t.helpText,l=this.clearable&&!this.disabled,h=!!t.tooltip,n=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",r=this.disabled||this.visuallyDisabled?"cursor-not-allowed":"cursor-pointer",m={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],f={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return p`<div part="form-control" class="${d("relative text-left",r,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}"><span class="sr-only" aria-live="polite">${this.deletedTagLabel}</span> ${e||h?p`<div class="flex items-center gap-1 mb-2"><label id="label" part="form-control-label" class="${e&&"inline-block"}" aria-hidden="${e?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label> ${t.tooltip?p`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${d("relative w-full bg-white",n==="disabled"?"text-neutral-500":"text-black")}"><div part="border" class="${d("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",{disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[n],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-5-15-13-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${d("inline-flex relative w-full",this.currentPlacement==="bottom"?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
10
10
  popup:popup__content,
11
- "><div class="${d("relative w-full h-full grid rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200")}" slot="anchor"><div class="${d("input-container flex items-center w-full h-full px-4",{sm:"py-1",md:"py-1",lg:"py-2"}[this.size])}"><input name="${this.name}" form="${this.form}" part="display-input" class="${d("top-0 left-0 appearance-none outline-none flex-grow bg-transparent flex-1 placeholder-neutral-700",r,this.multiple&&this.useTags&&this.value.length>0?"hidden":"")}" type="text" .disabled="${this.disabled}" placeholder="${this.placeholder||this.localize.term("selectDefaultPlaceholder")}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled||this.visuallyDisabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" aria-describedby="help-text invalid-message" role="combobox" tabindex="-1"> ${this.multiple&&this.useTags?p`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>`:""}<div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(v=>v==null?void 0:v.getTextLabel()).join(", ")}</div><input class="${d("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",r)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${l?p`<button part="clear-button" class="${d("select__clear flex justify-center",m,this.value.length>0?"visible":"invisible")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-15-12-icon class="${d("text-neutral-700 z-10",f)}" library="_internal" name="closing-round"></sd-5-15-12-icon></slot></button>`:""} ${this.showInvalidStyle?p`<sd-5-15-12-icon part="invalid-icon" class="${d(m,f,"text-error")}" library="_internal" name="risk"></sd-5-15-12-icon>`:""} ${this.styleOnValid&&this.showValidStyle?p`<sd-5-15-12-icon part="valid-icon" class="${d("flex-shrink-0 text-success",m,f)}" library="_internal" name="confirm-circle"></sd-5-15-12-icon>`:""}<slot name="expand-icon" part="expand-icon" class="${d("inline-flex ml-2 items-center transition-transform duration-medium ease-in-out",this.open?"rotate-180":"rotate-0",this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",f)}"><sd-5-15-12-icon name="chevron-down" part="chevron" library="_internal" color="currentColor"></sd-5-15-12-icon></slot></div><button part="combobox" class="${d("relative w-full px-4 flex flex-row items-center rounded-default focus-visible:outline-none",r,this.open&&"shadow transition-shadow duration-medium ease-in-out",{sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]"}[this.size])}" type="button" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-labelledby="label"></button></div><div id="listbox" role="listbox" aria-expanded="${this.open?"true":"false"}" aria-multiselectable="${this.multiple?"true":"false"}" aria-labelledby="label" part="listbox" class="${d("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow transition-shadow duration-medium ease-in-out",this.currentPlacement==="bottom"?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-5-15-12-popup></div><div class="text-sm text-neutral-700 mt-1" part="form-control-help-text" id="help-text" aria-hidden="${o?"false":"true"}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};i.styles=[...x.styles,T`:host{display:block;position:relative;width:var(--sd-spacing-auto,auto)}:host([required]) #label:after{content:" *"}:host([disabled]) ::-moz-placeholder,:host([visually-disabled]) ::-moz-placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([disabled]) ::placeholder,:host([visually-disabled]) ::placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}[part=listbox]{max-height:var(--auto-size-available-height,auto)}.input-container,[part=combobox]{grid-column:1/1;grid-row:1/1}sd-5-15-12-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-5-15-12-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-5-15-12-tag::part(content){display:inline-block;max-width:var(--tag-max-width,15ch);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-5-15-12-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-5-15-12-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249)/var(--tw-bg-opacity,1))}`],s([E({selector:"sd-5-15-12-option"})],i.prototype,"_optionsInDefaultSlot",2),s([c("sd-5-15-12-popup")],i.prototype,"popup",2),s([c('[part="combobox"]')],i.prototype,"combobox",2),s([c('[part="display-input"]')],i.prototype,"displayInput",2),s([c(".value-input")],i.prototype,"valueInput",2),s([c('[part="listbox"]')],i.prototype,"listbox",2),s([c("#invalid-message")],i.prototype,"invalidMessage",2),s([u()],i.prototype,"deletedTagLabel",2),s([u()],i.prototype,"hasFocus",2),s([u()],i.prototype,"currentOption",2),s([u()],i.prototype,"selectedOptions",2),s([u()],i.prototype,"showValidStyle",2),s([u()],i.prototype,"showInvalidStyle",2),s([M()],i.prototype,"defaultValue",2),s([a({type:Boolean,reflect:!0})],i.prototype,"open",2),s([a({type:String,reflect:!0})],i.prototype,"size",2),s([a({type:String,reflect:!0})],i.prototype,"placement",2),s([a({type:String,reflect:!0})],i.prototype,"label",2),s([a({type:String,reflect:!0})],i.prototype,"placeholder",2),s([a({type:String,attribute:"max-options-tag-label",reflect:!0})],i.prototype,"maxOptionsTagLabel",2),s([a({type:Boolean,reflect:!0})],i.prototype,"disabled",2),s([a({type:Boolean,reflect:!0,attribute:"visually-disabled"})],i.prototype,"visuallyDisabled",2),s([a({type:String,attribute:"help-text",reflect:!0})],i.prototype,"helpText",2),s([u()],i.prototype,"currentPlacement",2),s([a({type:Boolean,reflect:!0})],i.prototype,"clearable",2),s([a({type:Boolean,reflect:!0})],i.prototype,"multiple",2),s([a({type:Boolean,reflect:!0})],i.prototype,"useTags",2),s([a({attribute:"max-options-visible",type:Number,reflect:!0})],i.prototype,"maxOptionsVisible",2),s([a({reflect:!0})],i.prototype,"form",2),s([a({reflect:!0})],i.prototype,"name",2),s([a({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],i.prototype,"value",2),s([a({type:Boolean,reflect:!0})],i.prototype,"required",2),s([a({type:Boolean,reflect:!0,attribute:"style-on-valid"})],i.prototype,"styleOnValid",2),s([a({type:Boolean,reflect:!0})],i.prototype,"hoist",2),s([a()],i.prototype,"getTag",2),s([b("useTags",{waitUntilFirstUpdate:!0})],i.prototype,"handleUseTagsChange",1),s([b(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],i.prototype,"handleDisabledChange",1),s([b("open",{waitUntilFirstUpdate:!0})],i.prototype,"handleOpenChange",1),s([b("size",{waitUntilFirstUpdate:!0})],i.prototype,"applySizeToOptions",1),s([b("value",{waitUntilFirstUpdate:!0})],i.prototype,"handleValueChange",1),i=s([$("sd-5-15-12-select")],i);w("select.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});w("select.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{i as a};
11
+ "><div class="${d("relative w-full h-full grid rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200")}" slot="anchor"><div class="${d("input-container flex items-center w-full h-full px-4",{sm:"py-1",md:"py-1",lg:"py-2"}[this.size])}"><input name="${this.name}" form="${this.form}" part="display-input" class="${d("top-0 left-0 appearance-none outline-none flex-grow bg-transparent flex-1 placeholder-neutral-700",r,this.multiple&&this.useTags&&this.value.length>0?"hidden":"")}" type="text" .disabled="${this.disabled}" placeholder="${this.placeholder||this.localize.term("selectDefaultPlaceholder")}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled||this.visuallyDisabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" aria-describedby="help-text invalid-message" role="combobox" tabindex="-1"> ${this.multiple&&this.useTags?p`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>`:""}<div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(v=>v==null?void 0:v.getTextLabel()).join(", ")}</div><input class="${d("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",r)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${l?p`<button part="clear-button" class="${d("select__clear flex justify-center",m,this.value.length>0?"visible":"invisible")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-15-13-icon class="${d("text-neutral-700 z-10",f)}" library="_internal" name="closing-round"></sd-5-15-13-icon></slot></button>`:""} ${this.showInvalidStyle?p`<sd-5-15-13-icon part="invalid-icon" class="${d(m,f,"text-error")}" library="_internal" name="risk"></sd-5-15-13-icon>`:""} ${this.styleOnValid&&this.showValidStyle?p`<sd-5-15-13-icon part="valid-icon" class="${d("flex-shrink-0 text-success",m,f)}" library="_internal" name="confirm-circle"></sd-5-15-13-icon>`:""}<slot name="expand-icon" part="expand-icon" class="${d("inline-flex ml-2 items-center transition-transform duration-medium ease-in-out",this.open?"rotate-180":"rotate-0",this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",f)}"><sd-5-15-13-icon name="chevron-down" part="chevron" library="_internal" color="currentColor"></sd-5-15-13-icon></slot></div><button part="combobox" class="${d("relative w-full px-4 flex flex-row items-center rounded-default focus-visible:outline-none",r,this.open&&"shadow transition-shadow duration-medium ease-in-out",{sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]"}[this.size])}" type="button" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-labelledby="label"></button></div><div id="listbox" role="listbox" aria-expanded="${this.open?"true":"false"}" aria-multiselectable="${this.multiple?"true":"false"}" aria-labelledby="label" part="listbox" class="${d("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow transition-shadow duration-medium ease-in-out",this.currentPlacement==="bottom"?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-5-15-13-popup></div><div class="text-sm text-neutral-700 mt-1" part="form-control-help-text" id="help-text" aria-hidden="${o?"false":"true"}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};i.styles=[...x.styles,T`:host{display:block;position:relative;width:var(--sd-spacing-auto,auto)}:host([required]) #label:after{content:" *"}:host([disabled]) ::-moz-placeholder,:host([visually-disabled]) ::-moz-placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([disabled]) ::placeholder,:host([visually-disabled]) ::placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}[part=listbox]{max-height:var(--auto-size-available-height,auto)}.input-container,[part=combobox]{grid-column:1/1;grid-row:1/1}sd-5-15-13-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-5-15-13-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-5-15-13-tag::part(content){display:inline-block;max-width:var(--tag-max-width,15ch);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-5-15-13-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-5-15-13-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249)/var(--tw-bg-opacity,1))}`],s([E({selector:"sd-5-15-13-option"})],i.prototype,"_optionsInDefaultSlot",2),s([c("sd-5-15-13-popup")],i.prototype,"popup",2),s([c('[part="combobox"]')],i.prototype,"combobox",2),s([c('[part="display-input"]')],i.prototype,"displayInput",2),s([c(".value-input")],i.prototype,"valueInput",2),s([c('[part="listbox"]')],i.prototype,"listbox",2),s([c("#invalid-message")],i.prototype,"invalidMessage",2),s([u()],i.prototype,"deletedTagLabel",2),s([u()],i.prototype,"hasFocus",2),s([u()],i.prototype,"currentOption",2),s([u()],i.prototype,"selectedOptions",2),s([u()],i.prototype,"showValidStyle",2),s([u()],i.prototype,"showInvalidStyle",2),s([M()],i.prototype,"defaultValue",2),s([a({type:Boolean,reflect:!0})],i.prototype,"open",2),s([a({type:String,reflect:!0})],i.prototype,"size",2),s([a({type:String,reflect:!0})],i.prototype,"placement",2),s([a({type:String,reflect:!0})],i.prototype,"label",2),s([a({type:String,reflect:!0})],i.prototype,"placeholder",2),s([a({type:String,attribute:"max-options-tag-label",reflect:!0})],i.prototype,"maxOptionsTagLabel",2),s([a({type:Boolean,reflect:!0})],i.prototype,"disabled",2),s([a({type:Boolean,reflect:!0,attribute:"visually-disabled"})],i.prototype,"visuallyDisabled",2),s([a({type:String,attribute:"help-text",reflect:!0})],i.prototype,"helpText",2),s([u()],i.prototype,"currentPlacement",2),s([a({type:Boolean,reflect:!0})],i.prototype,"clearable",2),s([a({type:Boolean,reflect:!0})],i.prototype,"multiple",2),s([a({type:Boolean,reflect:!0})],i.prototype,"useTags",2),s([a({attribute:"max-options-visible",type:Number,reflect:!0})],i.prototype,"maxOptionsVisible",2),s([a({reflect:!0})],i.prototype,"form",2),s([a({reflect:!0})],i.prototype,"name",2),s([a({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],i.prototype,"value",2),s([a({type:Boolean,reflect:!0})],i.prototype,"required",2),s([a({type:Boolean,reflect:!0,attribute:"style-on-valid"})],i.prototype,"styleOnValid",2),s([a({type:Boolean,reflect:!0})],i.prototype,"hoist",2),s([a()],i.prototype,"getTag",2),s([b("useTags",{waitUntilFirstUpdate:!0})],i.prototype,"handleUseTagsChange",1),s([b(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],i.prototype,"handleDisabledChange",1),s([b("open",{waitUntilFirstUpdate:!0})],i.prototype,"handleOpenChange",1),s([b("size",{waitUntilFirstUpdate:!0})],i.prototype,"applySizeToOptions",1),s([b("value",{waitUntilFirstUpdate:!0})],i.prototype,"handleValueChange",1),i=s([$("sd-5-15-13-select")],i);w("select.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});w("select.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{i as a};
@@ -1 +1 @@
1
- import{a as h}from"./chunk.CGQ2BPPZ.js";import{a as r}from"./chunk.YEDQWNIV.js";import{a as s,b as n,d,h as i}from"./chunk.TJ7ZA5LO.js";import{b as o,e as l}from"./chunk.RZUTJ36B.js";import{e}from"./chunk.TJOCV4DC.js";var t=class extends i{constructor(){super(...arguments);this.variant="white";this.hasSlotController=new h(this,"[default]","media","meta","headline","expandable")}render(){let a={"teaser-has-default":this.hasSlotController.test("[default]"),"teaser-has-media":this.hasSlotController.test("media"),"teaser-has-meta":this.hasSlotController.test("meta"),"teaser-has-headline":this.hasSlotController.test("headline"),"teaser-has-expandable":this.hasSlotController.test("expandable")};return l`<div class="relative flex flex-col group" part="base"><div class="absolute flex flex-col justify-end h-full w-full pb-4"><div class="${r("flex-1",this.variant==="gradient-light"&&"bg-gradient-to-t from-white/[.8] to-60%",this.variant==="gradient-dark"&&"bg-gradient-to-t from-primary-800/[.6] to-60%")}"></div><div class="${r({white:"bg-white/[.8] group-hover:bg-white/90","neutral-100":"bg-neutral-100/[.8] group-hover:bg-neutral-100/90",primary:"bg-primary/[.8] text-white group-hover:bg-primary/90","primary-100":"bg-primary-100/[.8] group-hover:bg-primary-100/90","gradient-light":"bg-gradient-to-t from-white/90 to-white/[.8]","gradient-dark":"bg-gradient-to-t from-primary-800/75 to-primary-800/[.6] text-white"}[this.variant])}"><div class="flex-col text-left p-4" part="content"><div class="flex flex-col"><div part="headline" class="text-lg font-bold m-0 order-2"><slot name="headline">Always insert one semantically correct heading element here (e. g. &lt;h2>)</slot></div><div part="meta" class="${r("gap-2 mb-4 order-1",!a["teaser-has-meta"]&&"hidden")}"><slot name="meta"></slot></div></div><div class="${r("hidden",a["teaser-has-expandable"]&&"h-[0px] invisible opacity-0 md:[transition:_height_0.2s_linear,opacity_0.1s_linear_0.1s] md:block md:group-hover:h-auto md:group-hover:my-4 md:group-hover:opacity-[100%] md:group-hover:visible")}" part="expandable" aria-hidden="true"><slot name="expandable"></slot></div><div part="main" class="${r(!a["teaser-has-default"]&&"hidden")}"><slot></slot></div></div></div></div><div class="${r("mb-4 -z-10",!a["teaser-has-media"]&&"hidden")}" part="media"><slot name="media"></slot></div></div>`}};t.styles=[...i.styles,o`:host{display:block}::slotted(*){margin:var(--sd-spacing-0,0)}::slotted([slot=headline]){font-size:var(--sd-font-size-lg,1.25rem)!important;font-weight:700;margin:var(--sd-spacing-0,0)!important}:host([variant=white]) .background:focus-within{background-color:rgb(var(--sd-color-white,255 255 255)/var(--sd-opacity-90,.9))}:host([variant=neutral-100]) .background:focus-within{background-color:rgb(var(--sd-color-neutral-100,246 246 246)/var(--sd-opacity-90,.9))}:host([variant=primary]) .background:focus-within{background-color:rgb(var(--sd-color-primary,0 53 142)/var(--sd-opacity-90,.9))}:host([variant=primary-100]) .background:focus-within{background-color:rgb(var(--sd-color-primary-100,236 240 249)/var(--sd-opacity-90,.9))}`],e([n({type:String,reflect:!0})],t.prototype,"variant",2),e([d('[part="base"]')],t.prototype,"teaserMedia",2),t=e([s("sd-5-15-12-teaser-media")],t);export{t as a};
1
+ import{a as h}from"./chunk.CGQ2BPPZ.js";import{a as r}from"./chunk.YEDQWNIV.js";import{a as s,b as n,d,h as i}from"./chunk.TJ7ZA5LO.js";import{b as o,e as l}from"./chunk.RZUTJ36B.js";import{e}from"./chunk.TJOCV4DC.js";var t=class extends i{constructor(){super(...arguments);this.variant="white";this.hasSlotController=new h(this,"[default]","media","meta","headline","expandable")}render(){let a={"teaser-has-default":this.hasSlotController.test("[default]"),"teaser-has-media":this.hasSlotController.test("media"),"teaser-has-meta":this.hasSlotController.test("meta"),"teaser-has-headline":this.hasSlotController.test("headline"),"teaser-has-expandable":this.hasSlotController.test("expandable")};return l`<div class="relative flex flex-col group" part="base"><div class="absolute flex flex-col justify-end h-full w-full pb-4"><div class="${r("flex-1",this.variant==="gradient-light"&&"bg-gradient-to-t from-white/[.8] to-60%",this.variant==="gradient-dark"&&"bg-gradient-to-t from-primary-800/[.6] to-60%")}"></div><div class="${r({white:"bg-white/[.8] group-hover:bg-white/90","neutral-100":"bg-neutral-100/[.8] group-hover:bg-neutral-100/90",primary:"bg-primary/[.8] text-white group-hover:bg-primary/90","primary-100":"bg-primary-100/[.8] group-hover:bg-primary-100/90","gradient-light":"bg-gradient-to-t from-white/90 to-white/[.8]","gradient-dark":"bg-gradient-to-t from-primary-800/75 to-primary-800/[.6] text-white"}[this.variant])}"><div class="flex-col text-left p-4" part="content"><div class="flex flex-col"><div part="headline" class="text-lg font-bold m-0 order-2"><slot name="headline">Always insert one semantically correct heading element here (e. g. &lt;h2>)</slot></div><div part="meta" class="${r("gap-2 mb-4 order-1",!a["teaser-has-meta"]&&"hidden")}"><slot name="meta"></slot></div></div><div class="${r("hidden",a["teaser-has-expandable"]&&"h-[0px] invisible opacity-0 md:[transition:_height_0.2s_linear,opacity_0.1s_linear_0.1s] md:block md:group-hover:h-auto md:group-hover:my-4 md:group-hover:opacity-[100%] md:group-hover:visible")}" part="expandable" aria-hidden="true"><slot name="expandable"></slot></div><div part="main" class="${r(!a["teaser-has-default"]&&"hidden")}"><slot></slot></div></div></div></div><div class="${r("mb-4 -z-10",!a["teaser-has-media"]&&"hidden")}" part="media"><slot name="media"></slot></div></div>`}};t.styles=[...i.styles,o`:host{display:block}::slotted(*){margin:var(--sd-spacing-0,0)}::slotted([slot=headline]){font-size:var(--sd-font-size-lg,1.25rem)!important;font-weight:700;margin:var(--sd-spacing-0,0)!important}:host([variant=white]) .background:focus-within{background-color:rgb(var(--sd-color-white,255 255 255)/var(--sd-opacity-90,.9))}:host([variant=neutral-100]) .background:focus-within{background-color:rgb(var(--sd-color-neutral-100,246 246 246)/var(--sd-opacity-90,.9))}:host([variant=primary]) .background:focus-within{background-color:rgb(var(--sd-color-primary,0 53 142)/var(--sd-opacity-90,.9))}:host([variant=primary-100]) .background:focus-within{background-color:rgb(var(--sd-color-primary-100,236 240 249)/var(--sd-opacity-90,.9))}`],e([n({type:String,reflect:!0})],t.prototype,"variant",2),e([d('[part="base"]')],t.prototype,"teaserMedia",2),t=e([s("sd-5-15-13-teaser-media")],t);export{t as a};
@@ -1 +1 @@
1
- import{a as p}from"./chunk.HJ4O4XQA.js";import{a as d,b as u}from"./chunk.CGQ2BPPZ.js";import{a as l}from"./chunk.YEDQWNIV.js";import{a as r}from"./chunk.E2DRD2OX.js";import{a as h,b as a,d as o,h as n}from"./chunk.TJ7ZA5LO.js";import{b as c,e as i}from"./chunk.RZUTJ36B.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends n{constructor(){super(...arguments);this.type="normal";this.checked=!1;this.disabled=!1;this.value="";this.chevron=!1;this.hasSlotController=new d(this,"submenu");this.submenuController=new p(this,this.hasSlotController);this.handleHostClick=s=>{this.disabled&&(s.preventDefault(),s.stopImmediatePropagation())};this.handleMouseOver=s=>{this.focus(),s.stopPropagation()}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleHostClick),this.addEventListener("mouseover",this.handleMouseOver)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleHostClick),this.removeEventListener("mouseover",this.handleMouseOver)}handleDefaultSlotChange(){let s=this.getTextLabel();if(typeof this.cachedTextLabel=="undefined"){this.cachedTextLabel=s;return}s!==this.cachedTextLabel&&(this.cachedTextLabel=s,this.emit("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}handleCheckedChange(){if(this.checked&&this.type!=="checkbox"){this.checked=!1,console.error('The checked attribute can only be used on menu items with type="checkbox"',this);return}this.type==="checkbox"?this.setAttribute("aria-checked",this.checked?"true":"false"):this.removeAttribute("aria-checked")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.setAttribute("tabindex",this.disabled?"-1":"0")}handleTypeChange(){this.type==="checkbox"?(this.setAttribute("role","menuitemcheckbox"),this.setAttribute("aria-checked",this.checked?"true":"false")):(this.setAttribute("role","menuitem"),this.removeAttribute("aria-checked"))}getTextLabel(){return u(this.defaultSlot)}isSubmenu(){return this.hasSlotController.test("submenu")}render(){let s=this.submenuController.isExpanded(),b={label:this.hasSlotController.test("[default]"),iconIndent:this.hasSlotController.test("icon-indent")};return i`<div id="anchor" part="base" class="${l("relative flex items-stretch whitespace-nowrap py-3 px-4 no-wrap",this.disabled?"outline-none cursor-not-allowed text-neutral-500 hover:bg-transparent":"cursor-pointer text-primary hover:bg-neutral-200",this.isSubmenu()&&s&&"submenu-expanded")}" .disabled="${this.disabled}" ?aria-haspopup="${this.isSubmenu()}" ?aria-expanded="${!!s}">${this.type==="checkbox"?i`<span part="checked-icon" class="${l("flex items-center justify-center grow-0 shrink-0 basis-auto",this.checked?"visible":"invisible")}"><sd-5-15-12-icon name="status-check" library="sd-status-assets" aria-hidden="true"></sd-5-15-12-icon></span>`:""} ${b.iconIndent?i`<slot name="icon-indent" part="icon-indent" class="flex items-center grow-0 shrink-0 basis-auto mr-2"></slot>`:""}<slot part="label" class="inline-flex grow shrink basis-auto text-ellipsis overflow-hidden" @slotchange="${this.handleDefaultSlotChange}"></slot>${this.chevron||this.isSubmenu()?i`<span part="submenu-icon" class="flex items-center justify-center grow-0 shrink-0 basis-auto ml-3"><sd-5-15-12-icon name="chevron-right" library="_internal" aria-hidden="true" class="h-6 w-6"></sd-5-15-12-icon></span>`:""} ${this.submenuController.renderSubmenu()}</div>`}};e.styles=[...n.styles,c`:host{--submenu-offset:-6px;display:block}:host(:focus-visible){outline:2px solid transparent;outline-offset:2px}::slotted(sd-5-15-12-icon){height:var(--sd-spacing-6,1.5rem);width:var(--sd-spacing-6,1.5rem)}[part=checked-icon]{margin-right:var(--sd-spacing-3,.75rem)}.submenu-expanded:after{bottom:var(--sd-spacing-0,0);left:var(--sd-spacing-0,0);position:fixed;right:var(--sd-spacing-0,0);top:var(--sd-spacing-0,0);z-index:calc(var(z-dropdown) - 1);--tw-content:"";clip-path:polygon(var(--safe-triangle-cursor-x,0) var(--safe-triangle-cursor-y,0),var(--safe-triangle-submenu-start-x,0) var(--safe-triangle-submenu-start-y,0),var(--safe-triangle-submenu-end-x,0) var(--safe-triangle-submenu-end-y,0));content:var(--tw-content)}:host(:hover:not([aria-disabled=true],:focus-visible)) [part=base]{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233)/var(--tw-bg-opacity,1));outline:2px solid transparent;outline-offset:2px}:host(:focus-visible:not([aria-disabled=true])) [part=base]{outline-color:rgb(var(--sd-color-primary,0 53 142)/1);outline-offset:-2px;outline-style:solid;outline-width:2px}:host(:hover) [part=base]{outline:2px solid transparent;outline-offset:2px}sd-5-15-12-popup::part(popup){z-index:var(--sd-z-index-dropdown,900);--tw-bg-opacity:1;background-color:rgb(var(--sd-color-white,255 255 255)/var(--tw-bg-opacity,1));margin-left:var(--submenu-offset)}::slotted(sd-5-15-12-menu){max-height:var(--auto-size-available-height)!important;max-width:var(--auto-size-available-width)!important}`],t([o("slot:not([name])")],e.prototype,"defaultSlot",2),t([o('part="base"')],e.prototype,"menuItem",2),t([a()],e.prototype,"type",2),t([a({type:Boolean,reflect:!0})],e.prototype,"checked",2),t([a({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([a()],e.prototype,"value",2),t([a({type:Boolean,reflect:!0})],e.prototype,"chevron",2),t([r("checked")],e.prototype,"handleCheckedChange",1),t([r("disabled")],e.prototype,"handleDisabledChange",1),t([r("type")],e.prototype,"handleTypeChange",1),e=t([h("sd-5-15-12-menu-item")],e);export{e as a};
1
+ import{a as p}from"./chunk.HJ4O4XQA.js";import{a as d,b as u}from"./chunk.CGQ2BPPZ.js";import{a as l}from"./chunk.YEDQWNIV.js";import{a as r}from"./chunk.E2DRD2OX.js";import{a as h,b as a,d as o,h as n}from"./chunk.TJ7ZA5LO.js";import{b as c,e as i}from"./chunk.RZUTJ36B.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends n{constructor(){super(...arguments);this.type="normal";this.checked=!1;this.disabled=!1;this.value="";this.chevron=!1;this.hasSlotController=new d(this,"submenu");this.submenuController=new p(this,this.hasSlotController);this.handleHostClick=s=>{this.disabled&&(s.preventDefault(),s.stopImmediatePropagation())};this.handleMouseOver=s=>{this.focus(),s.stopPropagation()}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleHostClick),this.addEventListener("mouseover",this.handleMouseOver)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleHostClick),this.removeEventListener("mouseover",this.handleMouseOver)}handleDefaultSlotChange(){let s=this.getTextLabel();if(typeof this.cachedTextLabel=="undefined"){this.cachedTextLabel=s;return}s!==this.cachedTextLabel&&(this.cachedTextLabel=s,this.emit("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}handleCheckedChange(){if(this.checked&&this.type!=="checkbox"){this.checked=!1,console.error('The checked attribute can only be used on menu items with type="checkbox"',this);return}this.type==="checkbox"?this.setAttribute("aria-checked",this.checked?"true":"false"):this.removeAttribute("aria-checked")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.setAttribute("tabindex",this.disabled?"-1":"0")}handleTypeChange(){this.type==="checkbox"?(this.setAttribute("role","menuitemcheckbox"),this.setAttribute("aria-checked",this.checked?"true":"false")):(this.setAttribute("role","menuitem"),this.removeAttribute("aria-checked"))}getTextLabel(){return u(this.defaultSlot)}isSubmenu(){return this.hasSlotController.test("submenu")}render(){let s=this.submenuController.isExpanded(),b={label:this.hasSlotController.test("[default]"),iconIndent:this.hasSlotController.test("icon-indent")};return i`<div id="anchor" part="base" class="${l("relative flex items-stretch whitespace-nowrap py-3 px-4 no-wrap",this.disabled?"outline-none cursor-not-allowed text-neutral-500 hover:bg-transparent":"cursor-pointer text-primary hover:bg-neutral-200",this.isSubmenu()&&s&&"submenu-expanded")}" .disabled="${this.disabled}" ?aria-haspopup="${this.isSubmenu()}" ?aria-expanded="${!!s}">${this.type==="checkbox"?i`<span part="checked-icon" class="${l("flex items-center justify-center grow-0 shrink-0 basis-auto",this.checked?"visible":"invisible")}"><sd-5-15-13-icon name="status-check" library="sd-status-assets" aria-hidden="true"></sd-5-15-13-icon></span>`:""} ${b.iconIndent?i`<slot name="icon-indent" part="icon-indent" class="flex items-center grow-0 shrink-0 basis-auto mr-2"></slot>`:""}<slot part="label" class="inline-flex grow shrink basis-auto text-ellipsis overflow-hidden" @slotchange="${this.handleDefaultSlotChange}"></slot>${this.chevron||this.isSubmenu()?i`<span part="submenu-icon" class="flex items-center justify-center grow-0 shrink-0 basis-auto ml-3"><sd-5-15-13-icon name="chevron-right" library="_internal" aria-hidden="true" class="h-6 w-6"></sd-5-15-13-icon></span>`:""} ${this.submenuController.renderSubmenu()}</div>`}};e.styles=[...n.styles,c`:host{--submenu-offset:-6px;display:block}:host(:focus-visible){outline:2px solid transparent;outline-offset:2px}::slotted(sd-5-15-13-icon){height:var(--sd-spacing-6,1.5rem);width:var(--sd-spacing-6,1.5rem)}[part=checked-icon]{margin-right:var(--sd-spacing-3,.75rem)}.submenu-expanded:after{bottom:var(--sd-spacing-0,0);left:var(--sd-spacing-0,0);position:fixed;right:var(--sd-spacing-0,0);top:var(--sd-spacing-0,0);z-index:calc(var(z-dropdown) - 1);--tw-content:"";clip-path:polygon(var(--safe-triangle-cursor-x,0) var(--safe-triangle-cursor-y,0),var(--safe-triangle-submenu-start-x,0) var(--safe-triangle-submenu-start-y,0),var(--safe-triangle-submenu-end-x,0) var(--safe-triangle-submenu-end-y,0));content:var(--tw-content)}:host(:hover:not([aria-disabled=true],:focus-visible)) [part=base]{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233)/var(--tw-bg-opacity,1));outline:2px solid transparent;outline-offset:2px}:host(:focus-visible:not([aria-disabled=true])) [part=base]{outline-color:rgb(var(--sd-color-primary,0 53 142)/1);outline-offset:-2px;outline-style:solid;outline-width:2px}:host(:hover) [part=base]{outline:2px solid transparent;outline-offset:2px}sd-5-15-13-popup::part(popup){z-index:var(--sd-z-index-dropdown,900);--tw-bg-opacity:1;background-color:rgb(var(--sd-color-white,255 255 255)/var(--tw-bg-opacity,1));margin-left:var(--submenu-offset)}::slotted(sd-5-15-13-menu){max-height:var(--auto-size-available-height)!important;max-width:var(--auto-size-available-width)!important}`],t([o("slot:not([name])")],e.prototype,"defaultSlot",2),t([o('part="base"')],e.prototype,"menuItem",2),t([a()],e.prototype,"type",2),t([a({type:Boolean,reflect:!0})],e.prototype,"checked",2),t([a({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([a()],e.prototype,"value",2),t([a({type:Boolean,reflect:!0})],e.prototype,"chevron",2),t([r("checked")],e.prototype,"handleCheckedChange",1),t([r("disabled")],e.prototype,"handleDisabledChange",1),t([r("type")],e.prototype,"handleTypeChange",1),e=t([h("sd-5-15-13-menu-item")],e);export{e as a};
@@ -1 +1 @@
1
- import{a as M}from"./chunk.2AQOPKKH.js";import{a as C}from"./chunk.G7HKVXLR.js";import{a as y,b as v}from"./chunk.3L472FD4.js";import{a as k}from"./chunk.CGQ2BPPZ.js";import{a as f}from"./chunk.CHU57RUD.js";import{a,c as s}from"./chunk.SKUMYG4O.js";import{a as m}from"./chunk.KLRPP4NQ.js";import{a as p}from"./chunk.YEDQWNIV.js";import{a as x}from"./chunk.Y7NVH75J.js";import{a as b}from"./chunk.E2DRD2OX.js";import{a as w,b as h,d as c,h as u}from"./chunk.TJ7ZA5LO.js";import{b as g,e as l}from"./chunk.RZUTJ36B.js";import{b as n,e as d}from"./chunk.6OTM3PE5.js";import{e as o}from"./chunk.TJOCV4DC.js";var t=class extends u{constructor(){super(...arguments);this.hasSlotController=new k(this,"footer");this.localize=new x(this);this.open=!1;this.headline="";this.noCloseButton=!1}connectedCallback(){super.connectedCallback(),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.modal=new M(this)}firstUpdated(){this.dialog.hidden=!this.open,this.open&&(this.addOpenListeners(),this.modal.activate(),y(this))}disconnectedCallback(){super.disconnectedCallback(),v(this)}get prefersReducedMotion(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}requestClose(e){if(this.emit("sd-request-close",{cancelable:!0,detail:{source:e}}).defaultPrevented){let i=s(this,"dialog.denyClose",{dir:this.localize.dir()});n(this.panel,i.keyframes,i.options);return}this.hide()}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}handleDocumentKeyDown(e){this.open&&e.key==="Escape"&&(e.stopPropagation(),this.requestClose("keyboard"))}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.addOpenListeners(),this.originalTrigger=C(),this.modal.activate(),y(this);let e=this.querySelector("[autofocus]");e&&e.removeAttribute("autofocus"),await Promise.all([d(this.dialog),d(this.overlay)]),this.dialog.hidden=!1,requestAnimationFrame(()=>{this.emit("sd-initial-focus",{cancelable:!0}).defaultPrevented||(e?e.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),e&&e.setAttribute("autofocus","")});let r=this.prefersReducedMotion?s(this,"dialog.showReducedMotion",{dir:this.localize.dir()}):s(this,"dialog.show",{dir:this.localize.dir()}),i=s(this,"dialog.overlay.show",{dir:this.localize.dir()});await Promise.all([n(this.panel,r.keyframes,r.options),n(this.overlay,i.keyframes,i.options)]),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),this.modal.deactivate(),await Promise.all([d(this.dialog),d(this.overlay)]);let e=this.prefersReducedMotion?s(this,"dialog.hideReducedMotion",{dir:this.localize.dir()}):s(this,"dialog.hide",{dir:this.localize.dir()}),r=s(this,"dialog.overlay.hide",{dir:this.localize.dir()});await Promise.all([n(this.overlay,r.keyframes,r.options).then(()=>{this.overlay.hidden=!0}),n(this.panel,e.keyframes,e.options).then(()=>{this.panel.hidden=!0})]),this.dialog.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1,v(this);let i=this.originalTrigger;typeof(i==null?void 0:i.focus)=="function"&&i.isConnected&&setTimeout(()=>{try{i.focus({preventScroll:!0})}catch(E){i.focus()}this.originalTrigger=null}),this.emit("sd-after-hide")}}async show(){if(!this.open)return this.open=!0,m(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,m(this,"sd-after-hide")}render(){return l`<div part="base" class="${p("flex items-center justify-center fixed inset-0 z-dialog",this.hasSlotController.test("footer")&&"dialog--has-footer")}"><div part="overlay" class="fixed inset-0 bg-primary-800 opacity-90" @click="${()=>this.requestClose("overlay")}" tabindex="-1"></div><div part="panel" class="${p("flex flex-col z-20 bg-white py-4 sm:py-8 relative gap-6 focus-visible:focus-outline-inverted overflow-y-auto",this.open&&"flex opacity-100")}" role="dialog" aria-modal="true" aria-hidden="${this.open?"false":"true"}" aria-label="${f(this.headline?this.headline:void 0)}" aria-labelledby="${f(this.headline?void 0:"title")}" tabindex="0"><header part="header" class="flex flex-grow-0 flex-shrink-0 basis-auto px-6 sm:px-10"><h2 part="title" class="flex-auto m-0" id="title">${this.headline.length>0?l`<span class="sd-headline sd-headline--size-3xl leading-tight">${this.headline}</span>`:l`<slot name="headline"></slot>`}</h2>${this.noCloseButton?"":l`<sd-5-15-12-button part="close-button" variant="tertiary" exportparts="base:close-button__base" class="${p("absolute top-2 right-2")}" name="x-lg" @click="${()=>this.requestClose("close-button")}" type="button"><sd-5-15-12-icon label="${this.localize.term("close")}" name="close" library="_internal" color="currentColor"></sd-5-15-12-icon></sd-5-15-12-button>`}</header><main part="body" class="flex flex-auto overflow-auto w-full px-6 sm:px-10"><slot></slot></main><footer part="footer" class="flex flex-grow-0 flex-shrink-0 basis-auto ml-auto gap-4 px-6 sm:px-10"><slot name="footer"></slot></footer></div></div>`}};t.styles=[...u.styles,g`:host{--width:662px}[part=panel]{max-height:80vh;width:var(--width)}[part=body]{-webkit-overflow-scrolling:touch}@media (max-width:414px){:host{--width:335px}[part=body]{min-height:50px}[part=footer]{width:100%}}`],o([c('[part="base"]')],t.prototype,"dialog",2),o([c('[part="panel"]')],t.prototype,"panel",2),o([c('[part="overlay"]')],t.prototype,"overlay",2),o([h({type:Boolean,reflect:!0})],t.prototype,"open",2),o([h({type:String,reflect:!0})],t.prototype,"headline",2),o([h({attribute:"no-close-button",type:Boolean,reflect:!0})],t.prototype,"noCloseButton",2),o([b("open",{waitUntilFirstUpdate:!0})],t.prototype,"handleOpenChange",1),t=o([w("sd-5-15-12-dialog")],t);a("dialog.show",{keyframes:[{opacity:0,transform:"translate(-50%, 100%)"},{opacity:1,transform:"translate(0, 0)"}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});a("dialog.showReducedMotion",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out",reducedMotion:"allow"}});a("dialog.hide",{keyframes:[{opacity:1,transform:"translate(0, 0)"},{opacity:0,transform:"translate(50%, -100%)"}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});a("dialog.hideReducedMotion",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out",reducedMotion:"allow"}});a("dialog.denyClose",{keyframes:[{scale:1},{scale:1.02},{scale:1}],options:{duration:250}});a("dialog.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out",reducedMotion:"allow"}});a("dialog.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out",reducedMotion:"allow"}});export{t as a};
1
+ import{a as M}from"./chunk.2AQOPKKH.js";import{a as C}from"./chunk.G7HKVXLR.js";import{a as y,b as v}from"./chunk.3L472FD4.js";import{a as k}from"./chunk.CGQ2BPPZ.js";import{a as f}from"./chunk.CHU57RUD.js";import{a,c as s}from"./chunk.SKUMYG4O.js";import{a as m}from"./chunk.KLRPP4NQ.js";import{a as p}from"./chunk.YEDQWNIV.js";import{a as x}from"./chunk.Y7NVH75J.js";import{a as b}from"./chunk.E2DRD2OX.js";import{a as w,b as h,d as c,h as u}from"./chunk.TJ7ZA5LO.js";import{b as g,e as l}from"./chunk.RZUTJ36B.js";import{b as n,e as d}from"./chunk.6OTM3PE5.js";import{e as o}from"./chunk.TJOCV4DC.js";var t=class extends u{constructor(){super(...arguments);this.hasSlotController=new k(this,"footer");this.localize=new x(this);this.open=!1;this.headline="";this.noCloseButton=!1}connectedCallback(){super.connectedCallback(),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.modal=new M(this)}firstUpdated(){this.dialog.hidden=!this.open,this.open&&(this.addOpenListeners(),this.modal.activate(),y(this))}disconnectedCallback(){super.disconnectedCallback(),v(this)}get prefersReducedMotion(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}requestClose(e){if(this.emit("sd-request-close",{cancelable:!0,detail:{source:e}}).defaultPrevented){let i=s(this,"dialog.denyClose",{dir:this.localize.dir()});n(this.panel,i.keyframes,i.options);return}this.hide()}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}handleDocumentKeyDown(e){this.open&&e.key==="Escape"&&(e.stopPropagation(),this.requestClose("keyboard"))}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.addOpenListeners(),this.originalTrigger=C(),this.modal.activate(),y(this);let e=this.querySelector("[autofocus]");e&&e.removeAttribute("autofocus"),await Promise.all([d(this.dialog),d(this.overlay)]),this.dialog.hidden=!1,requestAnimationFrame(()=>{this.emit("sd-initial-focus",{cancelable:!0}).defaultPrevented||(e?e.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),e&&e.setAttribute("autofocus","")});let r=this.prefersReducedMotion?s(this,"dialog.showReducedMotion",{dir:this.localize.dir()}):s(this,"dialog.show",{dir:this.localize.dir()}),i=s(this,"dialog.overlay.show",{dir:this.localize.dir()});await Promise.all([n(this.panel,r.keyframes,r.options),n(this.overlay,i.keyframes,i.options)]),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),this.modal.deactivate(),await Promise.all([d(this.dialog),d(this.overlay)]);let e=this.prefersReducedMotion?s(this,"dialog.hideReducedMotion",{dir:this.localize.dir()}):s(this,"dialog.hide",{dir:this.localize.dir()}),r=s(this,"dialog.overlay.hide",{dir:this.localize.dir()});await Promise.all([n(this.overlay,r.keyframes,r.options).then(()=>{this.overlay.hidden=!0}),n(this.panel,e.keyframes,e.options).then(()=>{this.panel.hidden=!0})]),this.dialog.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1,v(this);let i=this.originalTrigger;typeof(i==null?void 0:i.focus)=="function"&&i.isConnected&&setTimeout(()=>{try{i.focus({preventScroll:!0})}catch(E){i.focus()}this.originalTrigger=null}),this.emit("sd-after-hide")}}async show(){if(!this.open)return this.open=!0,m(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,m(this,"sd-after-hide")}render(){return l`<div part="base" class="${p("flex items-center justify-center fixed inset-0 z-dialog",this.hasSlotController.test("footer")&&"dialog--has-footer")}"><div part="overlay" class="fixed inset-0 bg-primary-800 opacity-90" @click="${()=>this.requestClose("overlay")}" tabindex="-1"></div><div part="panel" class="${p("flex flex-col z-20 bg-white py-4 sm:py-8 relative gap-6 focus-visible:focus-outline-inverted overflow-y-auto",this.open&&"flex opacity-100")}" role="dialog" aria-modal="true" aria-hidden="${this.open?"false":"true"}" aria-label="${f(this.headline?this.headline:void 0)}" aria-labelledby="${f(this.headline?void 0:"title")}" tabindex="0"><header part="header" class="flex flex-grow-0 flex-shrink-0 basis-auto px-6 sm:px-10"><h2 part="title" class="flex-auto m-0" id="title">${this.headline.length>0?l`<span class="sd-headline sd-headline--size-3xl leading-tight">${this.headline}</span>`:l`<slot name="headline"></slot>`}</h2>${this.noCloseButton?"":l`<sd-5-15-13-button part="close-button" variant="tertiary" exportparts="base:close-button__base" class="${p("absolute top-2 right-2")}" name="x-lg" @click="${()=>this.requestClose("close-button")}" type="button"><sd-5-15-13-icon label="${this.localize.term("close")}" name="close" library="_internal" color="currentColor"></sd-5-15-13-icon></sd-5-15-13-button>`}</header><main part="body" class="flex flex-auto overflow-auto w-full px-6 sm:px-10"><slot></slot></main><footer part="footer" class="flex flex-grow-0 flex-shrink-0 basis-auto ml-auto gap-4 px-6 sm:px-10"><slot name="footer"></slot></footer></div></div>`}};t.styles=[...u.styles,g`:host{--width:662px}[part=panel]{max-height:80vh;width:var(--width)}[part=body]{-webkit-overflow-scrolling:touch}@media (max-width:414px){:host{--width:335px}[part=body]{min-height:50px}[part=footer]{width:100%}}`],o([c('[part="base"]')],t.prototype,"dialog",2),o([c('[part="panel"]')],t.prototype,"panel",2),o([c('[part="overlay"]')],t.prototype,"overlay",2),o([h({type:Boolean,reflect:!0})],t.prototype,"open",2),o([h({type:String,reflect:!0})],t.prototype,"headline",2),o([h({attribute:"no-close-button",type:Boolean,reflect:!0})],t.prototype,"noCloseButton",2),o([b("open",{waitUntilFirstUpdate:!0})],t.prototype,"handleOpenChange",1),t=o([w("sd-5-15-13-dialog")],t);a("dialog.show",{keyframes:[{opacity:0,transform:"translate(-50%, 100%)"},{opacity:1,transform:"translate(0, 0)"}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});a("dialog.showReducedMotion",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out",reducedMotion:"allow"}});a("dialog.hide",{keyframes:[{opacity:1,transform:"translate(0, 0)"},{opacity:0,transform:"translate(50%, -100%)"}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});a("dialog.hideReducedMotion",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out",reducedMotion:"allow"}});a("dialog.denyClose",{keyframes:[{scale:1},{scale:1.02},{scale:1}],options:{duration:250}});a("dialog.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out",reducedMotion:"allow"}});a("dialog.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out",reducedMotion:"allow"}});export{t as a};
@@ -1 +1 @@
1
- import{a as p,c as m}from"./chunk.SKUMYG4O.js";import{b as w}from"./chunk.PVM2WKMA.js";import{a as u}from"./chunk.KLRPP4NQ.js";import{a as s}from"./chunk.YEDQWNIV.js";import{a as g}from"./chunk.Y7NVH75J.js";import{a as b}from"./chunk.E2DRD2OX.js";import{a as y,b as n,d as a,h as c}from"./chunk.TJ7ZA5LO.js";import{b as f}from"./chunk.RZUTJ36B.js";import{b as l,e as h,f as d}from"./chunk.6OTM3PE5.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends c{constructor(){super(...arguments);this.localize=new g(this);this.open=!1}firstUpdated(){this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0",this.open&&(this.accordion.open=!0),this.accordionObserver=new MutationObserver(e=>{for(let o of e)o.type==="attributes"&&o.attributeName==="open"&&(this.accordion.open?this.show():this.hide())}),this.accordionObserver.observe(this.accordion,{attributes:!0})}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.accordionObserver)==null||e.disconnect()}handleSummaryClick(e){e.preventDefault(),this.open?this.hide():this.show()}handleSummaryKeyDown(e){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.open?this.hide():this.show()),(e.key==="ArrowUp"||e.key==="ArrowLeft")&&(e.preventDefault(),this.hide()),(e.key==="ArrowDown"||e.key==="ArrowRight")&&(e.preventDefault(),this.show())}async handleOpenChange(){if(this.open){if(this.accordion.open=!0,this.emit("sd-show",{cancelable:!0}).defaultPrevented){this.open=!1,this.accordion.open=!1;return}await h(this.body),this.body.hidden=!1;let{keyframes:o,options:r}=m(this,"accordion.show",{dir:this.localize.dir()});await l(this.body,d(o,this.body.scrollHeight),r),this.body.style.height="auto",this.emit("sd-after-show")}else{if(this.emit("sd-hide",{cancelable:!0}).defaultPrevented){this.accordion.open=!0,this.open=!0;return}await h(this.body);let{keyframes:o,options:r}=m(this,"accordion.hide",{dir:this.localize.dir()});await l(this.body,d(o,this.body.scrollHeight),r),this.body.hidden=!0,this.body.style.height="auto",this.accordion.open=!1,this.emit("sd-after-hide")}}async show(){if(!this.open)return this.open=!0,u(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,u(this,"sd-after-hide")}render(){return w`<details part="base" class="border-y border-neutral-400"><summary part="header" id="header" class="${s("flex text-base gap-4 font-bold items-center cursor-pointer select-none px-4 py-3 focus-visible:focus-outline text-primary relative group transition-colors ease-in-out duration-fast hover:bg-neutral-200")}" aria-expanded="${this.open?"true":"false"}" aria-controls="content" tabindex="0" @click="${this.handleSummaryClick}" @keydown="${this.handleSummaryKeyDown}"><div part="summary-border" class="${s(!this.open&&"opacity-0","w-1 bg-accent absolute left-0 transition-height duration-fast ease-in-out h-[calc(100%-16px)] group-hover:h-full")}"></div><slot name="summary" part="summary" class="flex flex-auto items-center text-left">${this.summary}</slot><span part="summary-icon" class="${s("flex flex-grow-0 flex-shrink-0 flex-auto items-center transition-all ease-in-out duration-medium text-xl",this.open&&"rotate-180")}"><slot name="expand-icon" class="${s(this.open&&"hidden")}"><sd-5-15-12-icon library="_internal" name="chevron-down"></sd-5-15-12-icon></slot><slot name="collapse-icon" class="${s(!this.open&&"hidden")}"><sd-5-15-12-icon library="_internal" name="chevron-down"></sd-5-15-12-icon></slot></span></summary><div part="content" id="content" class="overflow-hidden"><slot part="content__slot" class="block px-4 py-6" role="region" aria-labelledby="header"></slot></div></details>`}};t.styles=[...c.styles,f`:host{display:block}[part=header]::-webkit-details-marker{display:none}`],i([a('[part="base"]')],t.prototype,"accordion",2),i([a('[part="header"]')],t.prototype,"header",2),i([a('[part="content"]')],t.prototype,"body",2),i([n({type:Boolean,reflect:!0})],t.prototype,"open",2),i([n({reflect:!0})],t.prototype,"summary",2),i([b("open",{waitUntilFirstUpdate:!0})],t.prototype,"handleOpenChange",1),t=i([y("sd-5-15-12-accordion")],t);p("accordion.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});p("accordion.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{t as a};
1
+ import{a as p,c as m}from"./chunk.SKUMYG4O.js";import{b as w}from"./chunk.PVM2WKMA.js";import{a as u}from"./chunk.KLRPP4NQ.js";import{a as s}from"./chunk.YEDQWNIV.js";import{a as g}from"./chunk.Y7NVH75J.js";import{a as b}from"./chunk.E2DRD2OX.js";import{a as y,b as n,d as a,h as c}from"./chunk.TJ7ZA5LO.js";import{b as f}from"./chunk.RZUTJ36B.js";import{b as l,e as h,f as d}from"./chunk.6OTM3PE5.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends c{constructor(){super(...arguments);this.localize=new g(this);this.open=!1}firstUpdated(){this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0",this.open&&(this.accordion.open=!0),this.accordionObserver=new MutationObserver(e=>{for(let o of e)o.type==="attributes"&&o.attributeName==="open"&&(this.accordion.open?this.show():this.hide())}),this.accordionObserver.observe(this.accordion,{attributes:!0})}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.accordionObserver)==null||e.disconnect()}handleSummaryClick(e){e.preventDefault(),this.open?this.hide():this.show()}handleSummaryKeyDown(e){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.open?this.hide():this.show()),(e.key==="ArrowUp"||e.key==="ArrowLeft")&&(e.preventDefault(),this.hide()),(e.key==="ArrowDown"||e.key==="ArrowRight")&&(e.preventDefault(),this.show())}async handleOpenChange(){if(this.open){if(this.accordion.open=!0,this.emit("sd-show",{cancelable:!0}).defaultPrevented){this.open=!1,this.accordion.open=!1;return}await h(this.body),this.body.hidden=!1;let{keyframes:o,options:r}=m(this,"accordion.show",{dir:this.localize.dir()});await l(this.body,d(o,this.body.scrollHeight),r),this.body.style.height="auto",this.emit("sd-after-show")}else{if(this.emit("sd-hide",{cancelable:!0}).defaultPrevented){this.accordion.open=!0,this.open=!0;return}await h(this.body);let{keyframes:o,options:r}=m(this,"accordion.hide",{dir:this.localize.dir()});await l(this.body,d(o,this.body.scrollHeight),r),this.body.hidden=!0,this.body.style.height="auto",this.accordion.open=!1,this.emit("sd-after-hide")}}async show(){if(!this.open)return this.open=!0,u(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,u(this,"sd-after-hide")}render(){return w`<details part="base" class="border-y border-neutral-400"><summary part="header" id="header" class="${s("flex text-base gap-4 font-bold items-center cursor-pointer select-none px-4 py-3 focus-visible:focus-outline text-primary relative group transition-colors ease-in-out duration-fast hover:bg-neutral-200")}" aria-expanded="${this.open?"true":"false"}" aria-controls="content" tabindex="0" @click="${this.handleSummaryClick}" @keydown="${this.handleSummaryKeyDown}"><div part="summary-border" class="${s(!this.open&&"opacity-0","w-1 bg-accent absolute left-0 transition-height duration-fast ease-in-out h-[calc(100%-16px)] group-hover:h-full")}"></div><slot name="summary" part="summary" class="flex flex-auto items-center text-left">${this.summary}</slot><span part="summary-icon" class="${s("flex flex-grow-0 flex-shrink-0 flex-auto items-center transition-all ease-in-out duration-medium text-xl",this.open&&"rotate-180")}"><slot name="expand-icon" class="${s(this.open&&"hidden")}"><sd-5-15-13-icon library="_internal" name="chevron-down"></sd-5-15-13-icon></slot><slot name="collapse-icon" class="${s(!this.open&&"hidden")}"><sd-5-15-13-icon library="_internal" name="chevron-down"></sd-5-15-13-icon></slot></span></summary><div part="content" id="content" class="overflow-hidden"><slot part="content__slot" class="block px-4 py-6" role="region" aria-labelledby="header"></slot></div></details>`}};t.styles=[...c.styles,f`:host{display:block}[part=header]::-webkit-details-marker{display:none}`],i([a('[part="base"]')],t.prototype,"accordion",2),i([a('[part="header"]')],t.prototype,"header",2),i([a('[part="content"]')],t.prototype,"body",2),i([n({type:Boolean,reflect:!0})],t.prototype,"open",2),i([n({reflect:!0})],t.prototype,"summary",2),i([b("open",{waitUntilFirstUpdate:!0})],t.prototype,"handleOpenChange",1),t=i([y("sd-5-15-13-accordion")],t);p("accordion.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});p("accordion.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{t as a};