@baloise/ds-core 19.9.0 → 19.9.1

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 (164) hide show
  1. package/components/floating-ui.dom.js +151 -125
  2. package/components/index.js +1 -1
  3. package/components/svg.js +1595 -1325
  4. package/components/tokens.esm.js +1 -1
  5. package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
  6. package/dist/baloise-design-system/index.esm.js +1 -1
  7. package/dist/baloise-design-system/{p-79006350e3.system.entry.js → p-00d493e589.system.entry.js} +1 -1
  8. package/dist/baloise-design-system/{p-862bf2c3e6.entry.js → p-01b27feafd.entry.js} +1 -1
  9. package/dist/baloise-design-system/{p-2333a469fa.entry.js → p-02323ca1fe.entry.js} +1 -1
  10. package/dist/baloise-design-system/{p-c23854bd63.entry.js → p-0732a81f81.entry.js} +1 -1
  11. package/dist/baloise-design-system/{p-efd2551aca.entry.js → p-0974dcb139.entry.js} +1 -1
  12. package/dist/baloise-design-system/{p-b9bbf796f3.system.entry.js → p-0c0190dc67.system.entry.js} +1 -1
  13. package/dist/baloise-design-system/{p-493e239429.entry.js → p-12d43e06d9.entry.js} +1 -1
  14. package/dist/baloise-design-system/{p-bd5655b6a8.entry.js → p-198c6e75ad.entry.js} +1 -1
  15. package/dist/baloise-design-system/{p-1ee3f23f54.entry.js → p-1c913d4359.entry.js} +1 -1
  16. package/dist/baloise-design-system/{p-a7503a0c9d.entry.js → p-1f0f2e599d.entry.js} +1 -1
  17. package/dist/baloise-design-system/{p-44137a3d17.system.entry.js → p-213c4d93f4.system.entry.js} +1 -1
  18. package/dist/baloise-design-system/{p-7f2e1e1be7.entry.js → p-239ed27774.entry.js} +1 -1
  19. package/dist/baloise-design-system/{p-5c3f48e883.system.entry.js → p-25dce380f8.system.entry.js} +1 -1
  20. package/dist/baloise-design-system/{p-e9095ec856.system.entry.js → p-29defa9270.system.entry.js} +1 -1
  21. package/dist/baloise-design-system/{p-586de1181e.entry.js → p-340cd7b9e8.entry.js} +1 -1
  22. package/dist/baloise-design-system/p-38d8f6459e.system.entry.js +1 -0
  23. package/dist/baloise-design-system/{p-c637edb9ea.entry.js → p-3d9d33c487.entry.js} +1 -1
  24. package/dist/baloise-design-system/{p-b75b727fbc.entry.js → p-3ec4feac2e.entry.js} +1 -1
  25. package/dist/baloise-design-system/{p-772db94619.system.entry.js → p-3ff089ddd6.system.entry.js} +1 -1
  26. package/dist/baloise-design-system/{p-Dn1vzM6-.js → p-4MIQMEtx.js} +1 -1
  27. package/dist/baloise-design-system/{p-0556bebe3a.system.entry.js → p-5ed691fea4.system.entry.js} +1 -1
  28. package/dist/baloise-design-system/{p-fb980109e2.system.entry.js → p-6620c99966.system.entry.js} +1 -1
  29. package/dist/baloise-design-system/p-777471c320.entry.js +1 -0
  30. package/dist/baloise-design-system/{p-14ae6214c4.system.entry.js → p-78eb8b6cd9.system.entry.js} +1 -1
  31. package/dist/baloise-design-system/{p-0077e5a12f.entry.js → p-79d0e94ea1.entry.js} +1 -1
  32. package/dist/baloise-design-system/p-992840a30d.entry.js +1 -0
  33. package/dist/baloise-design-system/p-BFRjY4w3.js +1 -1
  34. package/dist/baloise-design-system/p-BRAmUyPx.system.js +1 -1
  35. package/dist/baloise-design-system/p-Bk7UdnZ5.system.js +1 -1
  36. package/dist/baloise-design-system/p-BmOE4zEk.system.js +1 -0
  37. package/dist/baloise-design-system/{p-TqRS9XF1.system.js → p-Bp0A6Ore.system.js} +1 -1
  38. package/dist/baloise-design-system/{p-DmVt6SeJ.js → p-BzAHSyRi.js} +1 -1
  39. package/dist/baloise-design-system/p-C8LDaK6Z.system.js +1 -0
  40. package/dist/baloise-design-system/p-CAb2C8az.js +1 -0
  41. package/dist/baloise-design-system/p-Ck7YRry-.system.js +2 -0
  42. package/dist/baloise-design-system/{p-BDYdAsv_.system.js → p-CkIgsCwS.system.js} +1 -1
  43. package/dist/baloise-design-system/p-Cr2H7Jt3.js +1 -0
  44. package/dist/baloise-design-system/p-DojUs2K8.js +2 -0
  45. package/dist/baloise-design-system/{p-CE3V5D8z.system.js → p-DvahsaGu.system.js} +1 -1
  46. package/dist/baloise-design-system/{p-bNRkwxp2.system.js → p-G8UK5F7H.system.js} +1 -1
  47. package/dist/baloise-design-system/p-P4eJh_wN.js +1 -0
  48. package/dist/baloise-design-system/{p-7cb15b231d.entry.js → p-a1482cbe4a.entry.js} +1 -1
  49. package/dist/baloise-design-system/p-a9d42c63a1.system.entry.js +1 -0
  50. package/dist/baloise-design-system/{p-ee0b45ff30.system.entry.js → p-b1877d6778.system.entry.js} +1 -1
  51. package/dist/baloise-design-system/{p-393a31ad6e.system.entry.js → p-bc641f2029.system.entry.js} +1 -1
  52. package/dist/baloise-design-system/{p-6191805e40.system.entry.js → p-d41ca5c096.system.entry.js} +1 -1
  53. package/dist/baloise-design-system/{p-bb255885a4.system.entry.js → p-d5de2680ad.system.entry.js} +1 -1
  54. package/dist/baloise-design-system/{p-fec5974e23.entry.js → p-dafa925d2c.entry.js} +1 -1
  55. package/dist/baloise-design-system/{p-3ed3bfc59a.system.entry.js → p-f22c5ab5ed.system.entry.js} +1 -1
  56. package/dist/baloise-design-system/{p-eb98a3713f.system.entry.js → p-f481d72c52.system.entry.js} +1 -1
  57. package/dist/baloise-design-system/{p-8029d2f939.entry.js → p-f4c4d03e6e.entry.js} +1 -1
  58. package/dist/baloise-design-system/{p-c8491fda99.system.entry.js → p-fc8024a9d7.system.entry.js} +1 -1
  59. package/dist/baloise-design-system/{p-a10bc9e5d8.entry.js → p-fc9a46b295.entry.js} +1 -1
  60. package/dist/baloise-design-system/{p-a3558335f2.system.entry.js → p-fd5d4c0fd7.system.entry.js} +1 -1
  61. package/dist/cjs/bal-carousel_2.cjs.entry.js +5 -4
  62. package/dist/cjs/bal-date.cjs.entry.js +1 -1
  63. package/dist/cjs/bal-dropdown_3.cjs.entry.js +1 -1
  64. package/dist/cjs/bal-field_5.cjs.entry.js +3 -3
  65. package/dist/cjs/bal-footer.cjs.entry.js +1 -1
  66. package/dist/cjs/bal-hint_5.cjs.entry.js +3 -3
  67. package/dist/cjs/bal-icon.cjs.entry.js +1 -1
  68. package/dist/cjs/bal-list_8.cjs.entry.js +3 -3
  69. package/dist/cjs/bal-logo.cjs.entry.js +3 -3
  70. package/dist/cjs/bal-nav_8.cjs.entry.js +5 -4
  71. package/dist/cjs/bal-navbar_5.cjs.entry.js +3 -3
  72. package/dist/cjs/bal-pagination.cjs.entry.js +3 -3
  73. package/dist/cjs/bal-popup.cjs.entry.js +1 -1
  74. package/dist/cjs/bal-progress-bar.cjs.entry.js +4 -4
  75. package/dist/cjs/bal-segment_2.cjs.entry.js +4 -4
  76. package/dist/cjs/bal-shape.cjs.entry.js +1 -1
  77. package/dist/cjs/bal-steps.cjs.entry.js +3 -3
  78. package/dist/cjs/bal-tab-item_2.cjs.entry.js +3 -3
  79. package/dist/cjs/bal-tooltip.cjs.entry.js +1 -1
  80. package/dist/cjs/{breakpoints.decorator-DhiWnqha.js → breakpoints.decorator-Cc1aDi12.js} +1 -1
  81. package/dist/cjs/{breakpoints.subject-DPTVZ3As.js → breakpoints.subject-CEyIkleD.js} +1 -1
  82. package/dist/cjs/{floating-ui-DyN44UhF.js → floating-ui-BE1Qsw-b.js} +1 -1
  83. package/dist/cjs/{floating-ui.dom-BPU3HWKX.js → floating-ui.dom-DCg2YBDr.js} +151 -125
  84. package/dist/cjs/index.cjs.js +2 -2
  85. package/dist/cjs/initialize-BzrcZo6Y.js +1 -1
  86. package/dist/cjs/svg-qEvvK3mS.js +1607 -0
  87. package/dist/cjs/{tokens.esm-DM_dMnsW.js → tokens.esm-CO4NpDkI.js} +1 -1
  88. package/dist/cjs/{window-resize.decorator-oyMA7gDI.js → window-resize.decorator-DiYHzl6q.js} +1 -1
  89. package/dist/collection/utils/constants/version.constant.js +1 -1
  90. package/dist/esm/bal-carousel_2.entry.js +5 -4
  91. package/dist/esm/bal-date.entry.js +1 -1
  92. package/dist/esm/bal-dropdown_3.entry.js +1 -1
  93. package/dist/esm/bal-field_5.entry.js +3 -3
  94. package/dist/esm/bal-footer.entry.js +1 -1
  95. package/dist/esm/bal-hint_5.entry.js +3 -3
  96. package/dist/esm/bal-icon.entry.js +1 -1
  97. package/dist/esm/bal-list_8.entry.js +3 -3
  98. package/dist/esm/bal-logo.entry.js +3 -3
  99. package/dist/esm/bal-nav_8.entry.js +5 -4
  100. package/dist/esm/bal-navbar_5.entry.js +3 -3
  101. package/dist/esm/bal-pagination.entry.js +3 -3
  102. package/dist/esm/bal-popup.entry.js +1 -1
  103. package/dist/esm/bal-progress-bar.entry.js +4 -4
  104. package/dist/esm/bal-segment_2.entry.js +4 -4
  105. package/dist/esm/bal-shape.entry.js +1 -1
  106. package/dist/esm/bal-steps.entry.js +3 -3
  107. package/dist/esm/bal-tab-item_2.entry.js +3 -3
  108. package/dist/esm/bal-tooltip.entry.js +1 -1
  109. package/dist/esm/{breakpoints.decorator-C-DmFJbn.js → breakpoints.decorator-CFE2cXqN.js} +1 -1
  110. package/dist/esm/{breakpoints.subject-Iyftu-nV.js → breakpoints.subject-BtghxYYt.js} +1 -1
  111. package/dist/esm/{floating-ui-Bx04QSXP.js → floating-ui-gZ7E41T8.js} +1 -1
  112. package/dist/esm/{floating-ui.dom-DKxvaA1I.js → floating-ui.dom-Cr2H7Jt3.js} +151 -125
  113. package/dist/esm/index.js +3 -3
  114. package/dist/esm/initialize-W3od-FM9.js +1 -1
  115. package/dist/esm/svg-DhNz-XmR.js +1605 -0
  116. package/dist/esm/{tokens.esm-C9EQ_6RZ.js → tokens.esm-DcKTia-G.js} +1 -1
  117. package/dist/esm/{window-resize.decorator-BU569j2_.js → window-resize.decorator-DJtj2dCF.js} +1 -1
  118. package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
  119. package/dist/esm-es5/bal-date.entry.js +1 -1
  120. package/dist/esm-es5/bal-dropdown_3.entry.js +1 -1
  121. package/dist/esm-es5/bal-field_5.entry.js +1 -1
  122. package/dist/esm-es5/bal-footer.entry.js +1 -1
  123. package/dist/esm-es5/bal-hint_5.entry.js +1 -1
  124. package/dist/esm-es5/bal-icon.entry.js +1 -1
  125. package/dist/esm-es5/bal-list_8.entry.js +1 -1
  126. package/dist/esm-es5/bal-logo.entry.js +1 -1
  127. package/dist/esm-es5/bal-nav_8.entry.js +1 -1
  128. package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
  129. package/dist/esm-es5/bal-pagination.entry.js +1 -1
  130. package/dist/esm-es5/bal-popup.entry.js +1 -1
  131. package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
  132. package/dist/esm-es5/bal-segment_2.entry.js +1 -1
  133. package/dist/esm-es5/bal-shape.entry.js +1 -1
  134. package/dist/esm-es5/bal-steps.entry.js +1 -1
  135. package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
  136. package/dist/esm-es5/bal-tooltip.entry.js +1 -1
  137. package/dist/esm-es5/{breakpoints.decorator-C-DmFJbn.js → breakpoints.decorator-CFE2cXqN.js} +1 -1
  138. package/dist/esm-es5/{breakpoints.subject-Iyftu-nV.js → breakpoints.subject-BtghxYYt.js} +1 -1
  139. package/dist/esm-es5/{floating-ui-Bx04QSXP.js → floating-ui-gZ7E41T8.js} +1 -1
  140. package/dist/esm-es5/floating-ui.dom-Cr2H7Jt3.js +1 -0
  141. package/dist/esm-es5/index.js +1 -1
  142. package/dist/esm-es5/initialize-W3od-FM9.js +1 -1
  143. package/dist/esm-es5/svg-DhNz-XmR.js +2 -0
  144. package/dist/esm-es5/{window-resize.decorator-BU569j2_.js → window-resize.decorator-DJtj2dCF.js} +1 -1
  145. package/dist/types/utils/svg.d.ts +1 -1
  146. package/package.json +9 -9
  147. package/dist/baloise-design-system/p-37641c340c.entry.js +0 -1
  148. package/dist/baloise-design-system/p-BIBFYhYa.system.js +0 -1
  149. package/dist/baloise-design-system/p-BS3tl84b.system.js +0 -3
  150. package/dist/baloise-design-system/p-CI2FR64u.js +0 -1
  151. package/dist/baloise-design-system/p-DKxvaA1I.js +0 -1
  152. package/dist/baloise-design-system/p-DUNB4kTY.js +0 -2
  153. package/dist/baloise-design-system/p-Dz-E2PRm.system.js +0 -1
  154. package/dist/baloise-design-system/p-Ere8qsaI.js +0 -1
  155. package/dist/baloise-design-system/p-a31aacd887.system.entry.js +0 -1
  156. package/dist/baloise-design-system/p-c1f871bb5b.system.entry.js +0 -1
  157. package/dist/baloise-design-system/p-dc45f7cf9c.entry.js +0 -1
  158. package/dist/cjs/svg-Bw61tXih.js +0 -1337
  159. package/dist/esm/svg-DUNB4kTY.js +0 -1335
  160. package/dist/esm-es5/floating-ui.dom-DKxvaA1I.js +0 -1
  161. package/dist/esm-es5/svg-DUNB4kTY.js +0 -2
  162. /package/dist/baloise-design-system/{p-C9EQ_6RZ.js → p-DcKTia-G.js} +0 -0
  163. /package/dist/baloise-design-system/{p-dEE6wNs_.system.js → p-q1IO5uRR.system.js} +0 -0
  164. /package/dist/esm-es5/{tokens.esm-C9EQ_6RZ.js → tokens.esm-DcKTia-G.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 03 Mar 2026 13:24:10 GMT
3
+ * Generated on Thu, 05 Mar 2026 14:38:20 GMT
4
4
  */
5
5
 
6
6
  const balColorGreen3 = "#94e3d4";
@@ -1,4 +1,4 @@
1
- import { B as BalWindowResizeListener } from './breakpoints.subject-Iyftu-nV.js';
1
+ import { B as BalWindowResizeListener } from './breakpoints.subject-BtghxYYt.js';
2
2
  import { a as SingleSubject } from './listener-CClDIhvK.js';
3
3
  import { b as balBrowser } from './browser-B1u-Mq75.js';
4
4
 
@@ -1 +1 @@
1
- import{__awaiter,__generator}from"tslib";import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{L as ListenToBreakpoints}from"./breakpoints.decorator-C-DmFJbn.js";import{s as stopEventBubbling}from"./form-input-DYvzaBlM.js";import{a as ariaBooleanToString}from"./aria-DBsOHTWj.js";import{t as toKebabCase,S as SwiperUtil}from"./string-Dk4PnSfl.js";import{L as ListenToMutation}from"./mutation.decorator-DhVeNnnY.js";import{L as ListenToSwipe}from"./swipe.decorator-B_Ghrp1o.js";import{L as ListenToResize}from"./resize.decorator-ZKPOJfw5.js";import{b as balBreakpoints}from"./breakpoints.subject-Iyftu-nV.js";import{d as defaultConfig}from"./config.default-RE8-gLMQ.js";import{L as ListenToVisibility}from"./visibility.decorator-zTjPC2du.js";import{L as ListenToConfig}from"./config.decorator-3bfyZ-0Y.js";import{s as sanitizeSvg}from"./svg-DUNB4kTY.js";import{i as inheritAttributes}from"./attributes-C4sZQbkT.js";import{l as rOnLoad,a as waitAfterFramePaint}from"./helpers-BNj87EbG.js";import"./keyboard.helpers-BERg8BNc.js";import"./listener-CClDIhvK.js";import"./browser-B1u-Mq75.js";import"./swipe.subject-T0VStuOK.js";import"./device-TtMibDFL.js";import"./tokens.esm-C9EQ_6RZ.js";import"./config.utils-B7jugjyM.js";import"./log-CwssmmaV.js";var TabControl=function(e){var t=e.value,r=e.items,a=e.containerId,o=e.onControlChange;var i=BEM.block("carousel");var n=i.element("controls");return h("div",{class:Object.assign(Object.assign({},n.class()),n.modifier("tabs").class())},h("bal-card",null,h("bal-card-content",{role:"tabs"},r.map((function(e){return h("button",{class:{button:true,"is-fullwidth":true,"is-primary":t===e.value,"is-light":t!==e.value},role:"tab","aria-selected":ariaBooleanToString(t===e.value),"aria-controls":a+"-"+toKebabCase(e.label),key:e.value,onClick:function(){return o(e)}},e.label)})))))};var balCarouselCss=':root{--bal-carousel-inner-border-background:var(--bal-color-border);--bal-carousel-inner-border-background-inverted:var(--bal-color-border-primary-light);--bal-carousel-inner-shadow-left-background-before:var(--bal-color-white);--bal-carousel-inner-shadow-right-background-after:var(--bal-color-white);--bal-carousel-inner-shadow-left-background-inverted-before:var(--bal-color-primary);--bal-carousel-inner-shadow-right-background-inverted-after:var(--bal-color-primary);--bal-carousel-product-item-button-background:var(--bal-color-white);--bal-carousel-product-item-button-background-green:var(--bal-color-green-1);--bal-carousel-product-item-button-background-green-hover:var(--bal-color-green-1);--bal-carousel-product-item-button-background-green-active:var(--bal-color-green-2);--bal-carousel-product-item-button-background-red:var(--bal-color-red-1);--bal-carousel-product-item-button-background-red-hover:var(--bal-color-red-1);--bal-carousel-product-item-button-background-red-active:var(--bal-color-red-2);--bal-carousel-product-item-button-background-yellow:var(--bal-color-yellow-1);--bal-carousel-product-item-button-background-yellow-hover:var(--bal-color-yellow-1);--bal-carousel-product-item-button-background-yellow-active:var(--bal-color-yellow-2);--bal-carousel-product-item-button-background-purple:var(--bal-color-purple-1);--bal-carousel-product-item-button-background-purple-hover:var(--bal-color-purple-1);--bal-carousel-product-item-button-background-purple-active:var(--bal-color-purple-2);--bal-carousel-inner-border-radius:var(--bal-radius-rounded);--bal-carousel-image-border-radius:var(--bal-radius-normal);--bal-carousel-product-item-button-border-radius:var(--bal-radius-large);--bal-carousel-product-item-button-label-text-color:var(--bal-color-text-primary);--bal-carousel-sticky-top:0}.bal-swiper{position:relative;display:block}.bal-swiper__inner{display:block;position:relative;margin-left:auto;margin-right:auto;overflow:clip;list-style:none;padding:0;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-overflow-scrolling:touch}.bal-swiper__inner--items-per-view-auto .bal-carousel__item{width:auto}.bal-swiper__inner--items-per-view-1 .bal-carousel__item{width:100%}.bal-swiper__inner--items-per-view-2 .bal-carousel__item{width:50%}.bal-swiper__inner--items-per-view-3 .bal-carousel__item{width:33.3333%}.bal-swiper__inner--items-per-view-4 .bal-carousel__item{width:25%}.bal-swiper__container{position:relative;max-width:100%;width:100%;height:100%;display:-ms-flexbox;display:flex;-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-transition-duration:0ms;transition-duration:0ms;-webkit-transform:translate3d(0px, 0px, 0px);transform:translate3d(0px, 0px, 0px)}.bal-swiper__container--gap-none{gap:0}.bal-swiper__container--gap-normal{gap:1rem}.bal-swiper__container--gap-medium{gap:1.5rem}.bal-swiper__controls{width:100%}.bal-swiper__controls--dots{position:relative}@media screen and (max-width: 768px){.bal-swiper__controls--large{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:2rem;margin-top:1rem}}@media screen and (min-width: 769px),print{.bal-swiper__controls--large{position:absolute;top:calc(50% - 1.5rem)}.bal-swiper__controls--large .bal-swiper__controls__button{position:absolute;z-index:7}.bal-swiper__controls--large .bal-swiper__controls__button--left{left:0}.bal-swiper__controls--large .bal-swiper__controls__button--right{right:0}}.bal-swiper__controls__button--hidden{display:none !important;visibility:none !important}.bal-swiper__controls--small{position:absolute;top:calc(50% - 1rem)}.bal-swiper__controls--small .bal-swiper__controls__button{position:absolute;z-index:7}.bal-swiper__controls--small .bal-swiper__controls__button--left{left:0}.bal-swiper__controls--small .bal-swiper__controls__button--right{right:0}.bal-swiper__controls--small .bal-swiper__controls__button--hidden{display:none !important;visibility:hidden !important}.bal-swiper__inner--shadow-left::before,.bal-swiper__inner--shadow-right::after{position:absolute;width:3rem;height:100%;top:0}.bal-swiper__inner--shadow-left::before{content:"";left:0;background:-webkit-gradient(linear, left top, right top, color-stop(50%, var(--bal-carousel-inner-shadow-left-background-before)), to(rgba(255, 255, 255, 0)));background:linear-gradient(90deg, var(--bal-carousel-inner-shadow-left-background-before) 50%, rgba(255, 255, 255, 0) 100%)}.bal-swiper__inner--shadow-right::after{content:"";right:0;background:-webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), color-stop(50%, var(--bal-carousel-inner-shadow-right-background-after)));background:linear-gradient(90deg, rgba(255, 255, 255, 0), var(--bal-carousel-inner-shadow-right-background-after) 50%)}.bal-swiper__inner--shadow-left.bal-swiper__inner--inverted::before{background:-webkit-gradient(linear, left top, right top, color-stop(50%, var(--bal-carousel-inner-shadow-left-background-inverted-before)), to(rgba(255, 255, 255, 0)));background:linear-gradient(90deg, var(--bal-carousel-inner-shadow-left-background-inverted-before) 50%, rgba(255, 255, 255, 0) 100%)}.bal-swiper__inner--shadow-right.bal-swiper__inner--inverted::after{background:-webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), color-stop(50%, var(--bal-carousel-inner-shadow-right-background-inverted-after)));background:linear-gradient(90deg, rgba(255, 255, 255, 0), var(--bal-carousel-inner-shadow-right-background-inverted-after) 50%)}.bal-carousel--full-height{height:100%}.bal-carousel--full-height .bal-carousel__item{height:auto}.bal-carousel__inner--full-height{height:100%}.bal-carousel__inner__container--border{padding-bottom:var(--bal-border-width-normal)}.bal-carousel__inner__container__border{position:absolute;background:var(--bal-carousel-inner-border-background);border-radius:var(--bal-carousel-inner-border-radius);height:var(--bal-border-width-normal);width:100%;bottom:0;-webkit-transform:translate3d(0px, 0px, 0px);transform:translate3d(0px, 0px, 0px)}.bal-carousel__inner__container__border--inverted{background:var(--bal-carousel-inner-border-background-inverted)}.bal-carousel__item{-webkit-box-sizing:border-box;box-sizing:border-box;text-align:center;font-size:var(--bal-text-size-large);min-height:2rem;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-ms-flex-negative:0;flex-shrink:0;width:100%;height:100%;position:relative;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden;round:linear-gradient(90deg, rgba(255, 255, 255, 0), var(--bal-carousel-inner-shadow-right-background-inverted-after) 50%)}.bal-carousel--card .bal-carousel__inner--shadow-left::before,.bal-carousel--card .bal-carousel__inner--shadow-right::after{width:1rem}@media screen and (min-width: 769px),print{.bal-carousel--card .bal-carousel__inner--shadow-left::before,.bal-carousel--card .bal-carousel__inner--shadow-right::after{width:2.5rem}}@media screen and (min-width: 1024px){.bal-carousel--card .bal-carousel__inner--shadow-left::before,.bal-carousel--card .bal-carousel__inner--shadow-right::after{width:3rem}}.bal-carousel--card{margin-left:-1rem;margin-right:-1rem}@media screen and (min-width: 769px),print{.bal-carousel--card{margin-left:-2.5rem;margin-right:-2.5rem}}.bal-carousel--card .bal-carousel__controls{padding-left:1rem;padding-right:1rem}@media screen and (min-width: 769px),print{.bal-carousel--card .bal-carousel__controls{padding-left:2.5rem;padding-right:2.5rem}}.bal-carousel--card .bal-carousel__item{width:100%;padding-top:1rem;padding-bottom:1rem;padding-left:1rem;padding-right:1rem}@media screen and (min-width: 769px),print{.bal-carousel--card .bal-carousel__item{width:100%;padding-top:2.5rem;padding-bottom:2.5rem;padding-left:2.5rem;padding-right:2.5rem}}.bal-carousel--controls-sticky .bal-carousel__controls--tabs{position:-webkit-sticky;position:sticky;top:var(--bal-carousel-sticky-top);z-index:var(--bal-z-index-sticky)}.bal-carousel__controls--tabs .bal-card{padding:0}.bal-carousel__controls--tabs .bal-card-content{padding:.5rem !important;gap:.5rem;display:-ms-flexbox;display:flex}.bal-carousel__controls--tabs .bal-card-content .bal-button{-ms-flex:1;flex:1}.bal-carousel__controls--tabs .bal-card-content .bal-button .button{padding:.5rem !important}.bal-carousel--image .bal-carousel__inner{border-radius:var(--bal-carousel-image-border-radius)}.bal-carousel--image .bal-carousel__inner--is-1by1{padding-top:100%}.bal-carousel--image .bal-carousel__inner--is-16by9{padding-top:56.25%}.bal-carousel--image .bal-carousel__inner--is-3by2{padding-top:66.66%}.bal-carousel--image .bal-carousel__inner--is-4by3{padding-top:75%}.bal-carousel--image .bal-carousel__inner__container{position:absolute;top:0;left:0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:100%}.bal-carousel--image .bal-carousel__item{position:relative;-ms-flex:0 0 100%;flex:0 0 100%}.bal-carousel--image .bal-carousel__item>img{height:100%;width:100%;-o-object-fit:cover;object-fit:cover;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;user-drag:none;user-zoom:fixed}.bal-carousel--product .bal-carousel__inner__container{gap:1rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;padding-top:1rem;padding-bottom:1rem}@media screen and (min-width: 769px),print{.bal-carousel--product .bal-carousel__inner__container{padding-top:1.5rem;padding-bottom:1.5rem}}@media screen and (min-width: 1024px){.bal-carousel--product .bal-carousel__inner__container{padding-top:2rem;padding-bottom:2rem}}.bal-carousel--product .bal-carousel__item{display:-ms-flexbox;display:flex;min-width:10rem;max-width:10rem;height:11rem;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;user-zoom:fixed;user-drag:none}.bal-carousel--product .bal-carousel__item img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;user-zoom:fixed;user-drag:none}.bal-carousel--product .bal-carousel__item__button{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;gap:1rem;border-radius:var(--bal-carousel-product-item-button-border-radius);padding:var(--bal-text-size-x-small);border:none;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;background:var(--bal-carousel-product-item-button-background)}@media (hover: hover)and (pointer: fine){.bal-carousel--product .bal-carousel__item__button:focus-visible:not(:active){-webkit-box-shadow:var(--bal-focus-shadow) !important;box-shadow:var(--bal-focus-shadow) !important}}@media screen and (max-width: 1023px){.bal-carousel--product .bal-carousel__item__button--color-green{background:var(--bal-carousel-product-item-button-background-green)}}@media screen and (min-width: 1024px){.bal-carousel--product .bal-carousel__item__button--color-green:hover{background:var(--bal-carousel-product-item-button-background-green-hover)}.bal-carousel--product .bal-carousel__item__button--color-green:active{background:var(--bal-carousel-product-item-button-background-green-active)}}@media screen and (max-width: 1023px){.bal-carousel--product .bal-carousel__item__button--color-red{background:var(--bal-carousel-product-item-button-background-red)}}@media screen and (min-width: 1024px){.bal-carousel--product .bal-carousel__item__button--color-red:hover{background:var(--bal-carousel-product-item-button-background-red-hover)}.bal-carousel--product .bal-carousel__item__button--color-red:active{background:var(--bal-carousel-product-item-button-background-red-active)}}@media screen and (max-width: 1023px){.bal-carousel--product .bal-carousel__item__button--color-yellow{background:var(--bal-carousel-product-item-button-background-yellow)}}@media screen and (min-width: 1024px){.bal-carousel--product .bal-carousel__item__button--color-yellow:hover{background:var(--bal-carousel-product-item-button-background-yellow-hover)}.bal-carousel--product .bal-carousel__item__button--color-yellow:active{background:var(--bal-carousel-product-item-button-background-yellow-active)}}@media screen and (max-width: 1023px){.bal-carousel--product .bal-carousel__item__button--color-purple{background:var(--bal-carousel-product-item-button-background-purple)}}@media screen and (min-width: 1024px){.bal-carousel--product .bal-carousel__item__button--color-purple:hover{background:var(--bal-carousel-product-item-button-background-purple-hover)}.bal-carousel--product .bal-carousel__item__button--color-purple:active{background:var(--bal-carousel-product-item-button-background-purple-active)}}.bal-carousel--product .bal-carousel__item__button__image{width:5rem;height:5rem;pointer-events:none}.bal-carousel--product .bal-carousel__item__button__label{font-weight:var(--bal-font-weight-bold);color:var(--bal-carousel-product-item-button-label-text-color);font-size:var(--bal-text-size-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;height:3.5rem;overflow:hidden;line-height:1.15rem;word-break:break-word}';var Carousel=function(){function e(e){registerInstance(this,e);this.balChange=createEvent(this,"balChange");this.swiper=new SwiperUtil;this.swiperIsLastSlideVisible=false;this.hasAnimated=false;this.isMobile=balBreakpoints.isMobile;this.language=defaultConfig.language;this.value=0;this.steps=1;this.itemsPerView=1;this.controls="none";this.space="none";this.htmlRole="list";this.controlsOverflow=false;this.inverted=false;this.fullHeight=false;this.aspectRatio="16by9";this.interface="";this.controlsSticky=false;this.scrollY=true;this.border=false;this.mutationObserverActive=true}e.prototype.onValueChange=function(){this.swiper.index=this.value};e.prototype.onStepsChange=function(){this.swiper.steps=this.steps};e.prototype.onItemsPerViewChange=function(){this.swiper.itemsPerView=this.itemsPerView};e.prototype.onControlsChange=function(){this.swiper.controls=this.controls};e.prototype.onSpaceChange=function(){this.swiper.gapSpace=this.space};e.prototype.onInterFaceChange=function(){this.swiper.gapSpace=this.interface==="product"?"normal":this.space};e.prototype.connectedCallback=function(){this.swiper.connectedCallback(this);this.onControlsChange();this.onItemsPerViewChange();this.onStepsChange();this.onSpaceChange();this.onInterFaceChange();this.onValueChange()};e.prototype.disconnectedCallback=function(){this.swiper.disconnectedCallback()};e.prototype.blockVerticalScrolling=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){if(!this.scrollY&&((t=this.el)===null||t===void 0?void 0:t.contains(e.target))){stopEventBubbling(e)}return[2]}))}))};e.prototype.mutationListener=function(){this.swiper.notifyChange()};e.prototype.visibilityListener=function(){this.swiper.notifyChange()};e.prototype.swipeListener=function(e){var t=e.left,r=e.right;if(t){this.next()}else if(r){this.previous()}};e.prototype.breakpointListener=function(e){this.isMobile=e.mobile;this.swiper.notifyChange()};e.prototype.resizeListener=function(){this.swiper.notifyChange()};e.prototype.configChanged=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.language=e.language;return[2]}))}))};e.prototype.previous=function(){return __awaiter(this,arguments,void 0,(function(e){if(e===void 0){e=this.steps}return __generator(this,(function(t){this.swiper.previous(e);return[2]}))}))};e.prototype.next=function(){return __awaiter(this,arguments,void 0,(function(e){if(e===void 0){e=this.steps}return __generator(this,(function(t){this.swiper.next(e);return[2]}))}))};e.prototype.getContainerId=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.swiper.containerId]}))}))};e.prototype.swiperGetAllChildrenElements=function(){return Array.from(this.el.querySelectorAll("bal-carousel-item"))};e.prototype.swiperOnChange=function(e){this.value=e;this.balChange.emit(e)};e.prototype.render=function(){var e=this;var t=BEM.block("carousel");var r=t.element("inner");var a=r.element("container");return h(Host,{key:"561107c8e3c5eb7a80b3e2a8b113ed13f2fdfb5d",class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.swiper.cssSwiper()),t.class()),t.modifier(this.interface).class(this.interface!=="")),t.modifier("full-height").class(this.fullHeight)),t.modifier("controls-sticky").class(this.controlsSticky)),t.modifier("controls-tabs").class(this.controls==="tabs"))},this.controls==="tabs"?h(TabControl,{value:this.value,items:this.swiper.getAllControlItems(),containerId:this.swiper.containerId,onControlChange:function(t){return e.swiper.onControlChange(t.value)}}):"",h("div",{key:"6adb9641efe5f488a940ffac297bcc7b3932c92a",class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.swiper.cssInnerSwiper()),r.class()),r.modifier("is-".concat(this.aspectRatio)).class()),r.modifier("inverted").class(this.inverted)),r.modifier("full-height").class(this.fullHeight)),ref:function(t){return e.swiper.innerEl=t}},h("div",{key:"fb4083afd4a967761c25200e8630f171b02a6c2d",id:this.swiper.containerId,role:this.controls==="tabs"?"":"list",class:Object.assign(Object.assign(Object.assign(Object.assign({},this.swiper.cssSwiperContainer()),a.class()),a.modifier("border").class(this.border)),a.modifier("is-".concat(this.aspectRatio)).class()),ref:function(t){return e.swiper.containerEl=t}},h("slot",{key:"c46d996cc3904bcdc38951f155e3a49f73f284f8"}),this.border?h("div",{id:"".concat(this.swiper.id,"-border"),"aria-hidden":"true",class:Object.assign(Object.assign({},a.element("border").class()),a.element("border").modifier("inverted").class(this.inverted)),ref:function(t){return e.swiper.borderEl=t}}):"")),this.swiper.renderControls())};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{value:["onValueChange"],steps:["onStepsChange"],itemsPerView:["onItemsPerViewChange"],controls:["onControlsChange"],space:["onSpaceChange"],interface:["onInterFaceChange"]}},enumerable:false,configurable:true});return e}();__decorate([ListenToMutation({tags:["bal-carousel-item"],characterData:false}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],Carousel.prototype,"mutationListener",null);__decorate([ListenToVisibility(),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],Carousel.prototype,"visibilityListener",null);__decorate([ListenToSwipe(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],Carousel.prototype,"swipeListener",null);__decorate([ListenToBreakpoints(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],Carousel.prototype,"breakpointListener",null);__decorate([ListenToResize(),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],Carousel.prototype,"resizeListener",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Carousel.prototype,"configChanged",null);Carousel.style=balCarouselCss;var CarouselItem=function(){function e(e){var t=this;registerInstance(this,e);this.balNavigate=createEvent(this,"balNavigate");this.balFocus=createEvent(this,"balFocus");this.balBlur=createEvent(this,"balBlur");this.imageInheritAttributes={};this.isOnLoadEventDone=false;this.containerId="";this.svgContent="";this.label="";this.svg="";this.htmlRole="listitem";this.elementType="button";this.name=undefined;this.value=undefined;this.target="_self";this.generateSvgContent=function(){if(t.svg!==undefined&&t.svg.length>0){t.svgContent=sanitizeSvg(t.svg)}};this.onClick=function(e){if(t.href!==undefined){t.balNavigate.emit(e)}};this.onFocus=function(){t.balFocus.emit()};this.onBlur=function(){t.balBlur.emit()}}e.prototype.svgChanged=function(){this.generateSvgContent()};e.prototype.connectedCallback=function(){this.generateSvgContent()};e.prototype.componentDidLoad=function(){var e=this;rOnLoad((function(){e.isOnLoadEventDone=true}))};e.prototype.componentWillLoad=function(){this.imageInheritAttributes=inheritAttributes(this.el,["alt"]);this.getContainerId()};e.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,waitAfterFramePaint()];case 1:e.sent();if(this.buttonEl){this.buttonEl.focus()}return[2]}}))}))};e.prototype.getContainerId=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:e=this.el.closest("bal-carousel");t=this;return[4,e.getContainerId()];case 1:t.containerId=r.sent();return[2]}}))}))};e.prototype.render=function(){var e=this;var t=BEM.block("carousel");var r=t.element("item");var a=!!this.color&&!!this.label;var o=this.el.closest("bal-carousel");var i=o&&o.controls==="tabs"?"tabpanel":"listitem";var n="".concat(this.containerId,"-").concat(toKebabCase(this.label));if(!a){return h(Host,{id:n,role:i,class:Object.assign({},r.class()),"aria-label":this.label},this.isOnLoadEventDone&&this.src!==undefined?h("img",Object.assign({draggable:false,onDragStart:function(){return false},src:this.src},this.imageInheritAttributes)):"",h("slot",null))}var s=r.element("button");var l=s.element("image");var c=s.element("label");var u=this,b=u.elementType,d=u.download,p=u.href,m=u.rel,_=u.target,g=u.name,f=u.value;var v=this.href===undefined?"button":"a";var w=v==="button"?{type:b,name:g,value:f}:{download:d,href:p,rel:m,target:_};return h(Host,{id:n,role:i,"aria-label":this.label,class:Object.assign({},r.class())},h(v,Object.assign({},w,{class:Object.assign(Object.assign({},s.class()),s.modifier("color-".concat(this.color)).class()),part:"native",onFocus:this.onFocus,onBlur:this.onBlur,onClick:this.onClick,ref:function(t){return e.buttonEl=t}}),this.isOnLoadEventDone&&this.src!==undefined?h("img",Object.assign({class:Object.assign({},l.class()),draggable:false,onDragStart:function(){return false},"aria-hidden":"true",src:this.src},this.imageInheritAttributes)):this.isOnLoadEventDone&&this.svgContent!==undefined?h("div",{class:Object.assign({},l.class()),innerHTML:this.svgContent}):"",this.label!==undefined?h("span",{class:Object.assign({},c.class())},this.label):"",h("slot",null)))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{svg:["svgChanged"]}},enumerable:false,configurable:true});return e}();export{Carousel as bal_carousel,CarouselItem as bal_carousel_item};
1
+ import{__awaiter,__generator}from"tslib";import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{L as ListenToBreakpoints}from"./breakpoints.decorator-CFE2cXqN.js";import{s as stopEventBubbling}from"./form-input-DYvzaBlM.js";import{a as ariaBooleanToString}from"./aria-DBsOHTWj.js";import{t as toKebabCase,S as SwiperUtil}from"./string-Dk4PnSfl.js";import{L as ListenToMutation}from"./mutation.decorator-DhVeNnnY.js";import{L as ListenToSwipe}from"./swipe.decorator-B_Ghrp1o.js";import{L as ListenToResize}from"./resize.decorator-ZKPOJfw5.js";import{b as balBreakpoints}from"./breakpoints.subject-BtghxYYt.js";import{d as defaultConfig}from"./config.default-RE8-gLMQ.js";import{L as ListenToVisibility}from"./visibility.decorator-zTjPC2du.js";import{L as ListenToConfig}from"./config.decorator-3bfyZ-0Y.js";import{s as sanitizeSvg}from"./svg-DhNz-XmR.js";import{i as inheritAttributes}from"./attributes-C4sZQbkT.js";import{l as rOnLoad,a as waitAfterFramePaint}from"./helpers-BNj87EbG.js";import"./keyboard.helpers-BERg8BNc.js";import"./listener-CClDIhvK.js";import"./browser-B1u-Mq75.js";import"./swipe.subject-T0VStuOK.js";import"./device-TtMibDFL.js";import"./tokens.esm-DcKTia-G.js";import"./config.utils-B7jugjyM.js";import"./log-CwssmmaV.js";import"./_commonjsHelpers-BFTU3MAI.js";var TabControl=function(e){var t=e.value,r=e.items,a=e.containerId,o=e.onControlChange;var i=BEM.block("carousel");var n=i.element("controls");return h("div",{class:Object.assign(Object.assign({},n.class()),n.modifier("tabs").class())},h("bal-card",null,h("bal-card-content",{role:"tabs"},r.map((function(e){return h("button",{class:{button:true,"is-fullwidth":true,"is-primary":t===e.value,"is-light":t!==e.value},role:"tab","aria-selected":ariaBooleanToString(t===e.value),"aria-controls":a+"-"+toKebabCase(e.label),key:e.value,onClick:function(){return o(e)}},e.label)})))))};var balCarouselCss=':root{--bal-carousel-inner-border-background:var(--bal-color-border);--bal-carousel-inner-border-background-inverted:var(--bal-color-border-primary-light);--bal-carousel-inner-shadow-left-background-before:var(--bal-color-white);--bal-carousel-inner-shadow-right-background-after:var(--bal-color-white);--bal-carousel-inner-shadow-left-background-inverted-before:var(--bal-color-primary);--bal-carousel-inner-shadow-right-background-inverted-after:var(--bal-color-primary);--bal-carousel-product-item-button-background:var(--bal-color-white);--bal-carousel-product-item-button-background-green:var(--bal-color-green-1);--bal-carousel-product-item-button-background-green-hover:var(--bal-color-green-1);--bal-carousel-product-item-button-background-green-active:var(--bal-color-green-2);--bal-carousel-product-item-button-background-red:var(--bal-color-red-1);--bal-carousel-product-item-button-background-red-hover:var(--bal-color-red-1);--bal-carousel-product-item-button-background-red-active:var(--bal-color-red-2);--bal-carousel-product-item-button-background-yellow:var(--bal-color-yellow-1);--bal-carousel-product-item-button-background-yellow-hover:var(--bal-color-yellow-1);--bal-carousel-product-item-button-background-yellow-active:var(--bal-color-yellow-2);--bal-carousel-product-item-button-background-purple:var(--bal-color-purple-1);--bal-carousel-product-item-button-background-purple-hover:var(--bal-color-purple-1);--bal-carousel-product-item-button-background-purple-active:var(--bal-color-purple-2);--bal-carousel-inner-border-radius:var(--bal-radius-rounded);--bal-carousel-image-border-radius:var(--bal-radius-normal);--bal-carousel-product-item-button-border-radius:var(--bal-radius-large);--bal-carousel-product-item-button-label-text-color:var(--bal-color-text-primary);--bal-carousel-sticky-top:0}.bal-swiper{position:relative;display:block}.bal-swiper__inner{display:block;position:relative;margin-left:auto;margin-right:auto;overflow:clip;list-style:none;padding:0;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-overflow-scrolling:touch}.bal-swiper__inner--items-per-view-auto .bal-carousel__item{width:auto}.bal-swiper__inner--items-per-view-1 .bal-carousel__item{width:100%}.bal-swiper__inner--items-per-view-2 .bal-carousel__item{width:50%}.bal-swiper__inner--items-per-view-3 .bal-carousel__item{width:33.3333%}.bal-swiper__inner--items-per-view-4 .bal-carousel__item{width:25%}.bal-swiper__container{position:relative;max-width:100%;width:100%;height:100%;display:-ms-flexbox;display:flex;-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-transition-duration:0ms;transition-duration:0ms;-webkit-transform:translate3d(0px, 0px, 0px);transform:translate3d(0px, 0px, 0px)}.bal-swiper__container--gap-none{gap:0}.bal-swiper__container--gap-normal{gap:1rem}.bal-swiper__container--gap-medium{gap:1.5rem}.bal-swiper__controls{width:100%}.bal-swiper__controls--dots{position:relative}@media screen and (max-width: 768px){.bal-swiper__controls--large{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:2rem;margin-top:1rem}}@media screen and (min-width: 769px),print{.bal-swiper__controls--large{position:absolute;top:calc(50% - 1.5rem)}.bal-swiper__controls--large .bal-swiper__controls__button{position:absolute;z-index:7}.bal-swiper__controls--large .bal-swiper__controls__button--left{left:0}.bal-swiper__controls--large .bal-swiper__controls__button--right{right:0}}.bal-swiper__controls__button--hidden{display:none !important;visibility:none !important}.bal-swiper__controls--small{position:absolute;top:calc(50% - 1rem)}.bal-swiper__controls--small .bal-swiper__controls__button{position:absolute;z-index:7}.bal-swiper__controls--small .bal-swiper__controls__button--left{left:0}.bal-swiper__controls--small .bal-swiper__controls__button--right{right:0}.bal-swiper__controls--small .bal-swiper__controls__button--hidden{display:none !important;visibility:hidden !important}.bal-swiper__inner--shadow-left::before,.bal-swiper__inner--shadow-right::after{position:absolute;width:3rem;height:100%;top:0}.bal-swiper__inner--shadow-left::before{content:"";left:0;background:-webkit-gradient(linear, left top, right top, color-stop(50%, var(--bal-carousel-inner-shadow-left-background-before)), to(rgba(255, 255, 255, 0)));background:linear-gradient(90deg, var(--bal-carousel-inner-shadow-left-background-before) 50%, rgba(255, 255, 255, 0) 100%)}.bal-swiper__inner--shadow-right::after{content:"";right:0;background:-webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), color-stop(50%, var(--bal-carousel-inner-shadow-right-background-after)));background:linear-gradient(90deg, rgba(255, 255, 255, 0), var(--bal-carousel-inner-shadow-right-background-after) 50%)}.bal-swiper__inner--shadow-left.bal-swiper__inner--inverted::before{background:-webkit-gradient(linear, left top, right top, color-stop(50%, var(--bal-carousel-inner-shadow-left-background-inverted-before)), to(rgba(255, 255, 255, 0)));background:linear-gradient(90deg, var(--bal-carousel-inner-shadow-left-background-inverted-before) 50%, rgba(255, 255, 255, 0) 100%)}.bal-swiper__inner--shadow-right.bal-swiper__inner--inverted::after{background:-webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), color-stop(50%, var(--bal-carousel-inner-shadow-right-background-inverted-after)));background:linear-gradient(90deg, rgba(255, 255, 255, 0), var(--bal-carousel-inner-shadow-right-background-inverted-after) 50%)}.bal-carousel--full-height{height:100%}.bal-carousel--full-height .bal-carousel__item{height:auto}.bal-carousel__inner--full-height{height:100%}.bal-carousel__inner__container--border{padding-bottom:var(--bal-border-width-normal)}.bal-carousel__inner__container__border{position:absolute;background:var(--bal-carousel-inner-border-background);border-radius:var(--bal-carousel-inner-border-radius);height:var(--bal-border-width-normal);width:100%;bottom:0;-webkit-transform:translate3d(0px, 0px, 0px);transform:translate3d(0px, 0px, 0px)}.bal-carousel__inner__container__border--inverted{background:var(--bal-carousel-inner-border-background-inverted)}.bal-carousel__item{-webkit-box-sizing:border-box;box-sizing:border-box;text-align:center;font-size:var(--bal-text-size-large);min-height:2rem;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-ms-flex-negative:0;flex-shrink:0;width:100%;height:100%;position:relative;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden;round:linear-gradient(90deg, rgba(255, 255, 255, 0), var(--bal-carousel-inner-shadow-right-background-inverted-after) 50%)}.bal-carousel--card .bal-carousel__inner--shadow-left::before,.bal-carousel--card .bal-carousel__inner--shadow-right::after{width:1rem}@media screen and (min-width: 769px),print{.bal-carousel--card .bal-carousel__inner--shadow-left::before,.bal-carousel--card .bal-carousel__inner--shadow-right::after{width:2.5rem}}@media screen and (min-width: 1024px){.bal-carousel--card .bal-carousel__inner--shadow-left::before,.bal-carousel--card .bal-carousel__inner--shadow-right::after{width:3rem}}.bal-carousel--card{margin-left:-1rem;margin-right:-1rem}@media screen and (min-width: 769px),print{.bal-carousel--card{margin-left:-2.5rem;margin-right:-2.5rem}}.bal-carousel--card .bal-carousel__controls{padding-left:1rem;padding-right:1rem}@media screen and (min-width: 769px),print{.bal-carousel--card .bal-carousel__controls{padding-left:2.5rem;padding-right:2.5rem}}.bal-carousel--card .bal-carousel__item{width:100%;padding-top:1rem;padding-bottom:1rem;padding-left:1rem;padding-right:1rem}@media screen and (min-width: 769px),print{.bal-carousel--card .bal-carousel__item{width:100%;padding-top:2.5rem;padding-bottom:2.5rem;padding-left:2.5rem;padding-right:2.5rem}}.bal-carousel--controls-sticky .bal-carousel__controls--tabs{position:-webkit-sticky;position:sticky;top:var(--bal-carousel-sticky-top);z-index:var(--bal-z-index-sticky)}.bal-carousel__controls--tabs .bal-card{padding:0}.bal-carousel__controls--tabs .bal-card-content{padding:.5rem !important;gap:.5rem;display:-ms-flexbox;display:flex}.bal-carousel__controls--tabs .bal-card-content .bal-button{-ms-flex:1;flex:1}.bal-carousel__controls--tabs .bal-card-content .bal-button .button{padding:.5rem !important}.bal-carousel--image .bal-carousel__inner{border-radius:var(--bal-carousel-image-border-radius)}.bal-carousel--image .bal-carousel__inner--is-1by1{padding-top:100%}.bal-carousel--image .bal-carousel__inner--is-16by9{padding-top:56.25%}.bal-carousel--image .bal-carousel__inner--is-3by2{padding-top:66.66%}.bal-carousel--image .bal-carousel__inner--is-4by3{padding-top:75%}.bal-carousel--image .bal-carousel__inner__container{position:absolute;top:0;left:0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:100%}.bal-carousel--image .bal-carousel__item{position:relative;-ms-flex:0 0 100%;flex:0 0 100%}.bal-carousel--image .bal-carousel__item>img{height:100%;width:100%;-o-object-fit:cover;object-fit:cover;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;user-drag:none;user-zoom:fixed}.bal-carousel--product .bal-carousel__inner__container{gap:1rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;padding-top:1rem;padding-bottom:1rem}@media screen and (min-width: 769px),print{.bal-carousel--product .bal-carousel__inner__container{padding-top:1.5rem;padding-bottom:1.5rem}}@media screen and (min-width: 1024px){.bal-carousel--product .bal-carousel__inner__container{padding-top:2rem;padding-bottom:2rem}}.bal-carousel--product .bal-carousel__item{display:-ms-flexbox;display:flex;min-width:10rem;max-width:10rem;height:11rem;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;user-zoom:fixed;user-drag:none}.bal-carousel--product .bal-carousel__item img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;user-zoom:fixed;user-drag:none}.bal-carousel--product .bal-carousel__item__button{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;gap:1rem;border-radius:var(--bal-carousel-product-item-button-border-radius);padding:var(--bal-text-size-x-small);border:none;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;background:var(--bal-carousel-product-item-button-background)}@media (hover: hover)and (pointer: fine){.bal-carousel--product .bal-carousel__item__button:focus-visible:not(:active){-webkit-box-shadow:var(--bal-focus-shadow) !important;box-shadow:var(--bal-focus-shadow) !important}}@media screen and (max-width: 1023px){.bal-carousel--product .bal-carousel__item__button--color-green{background:var(--bal-carousel-product-item-button-background-green)}}@media screen and (min-width: 1024px){.bal-carousel--product .bal-carousel__item__button--color-green:hover{background:var(--bal-carousel-product-item-button-background-green-hover)}.bal-carousel--product .bal-carousel__item__button--color-green:active{background:var(--bal-carousel-product-item-button-background-green-active)}}@media screen and (max-width: 1023px){.bal-carousel--product .bal-carousel__item__button--color-red{background:var(--bal-carousel-product-item-button-background-red)}}@media screen and (min-width: 1024px){.bal-carousel--product .bal-carousel__item__button--color-red:hover{background:var(--bal-carousel-product-item-button-background-red-hover)}.bal-carousel--product .bal-carousel__item__button--color-red:active{background:var(--bal-carousel-product-item-button-background-red-active)}}@media screen and (max-width: 1023px){.bal-carousel--product .bal-carousel__item__button--color-yellow{background:var(--bal-carousel-product-item-button-background-yellow)}}@media screen and (min-width: 1024px){.bal-carousel--product .bal-carousel__item__button--color-yellow:hover{background:var(--bal-carousel-product-item-button-background-yellow-hover)}.bal-carousel--product .bal-carousel__item__button--color-yellow:active{background:var(--bal-carousel-product-item-button-background-yellow-active)}}@media screen and (max-width: 1023px){.bal-carousel--product .bal-carousel__item__button--color-purple{background:var(--bal-carousel-product-item-button-background-purple)}}@media screen and (min-width: 1024px){.bal-carousel--product .bal-carousel__item__button--color-purple:hover{background:var(--bal-carousel-product-item-button-background-purple-hover)}.bal-carousel--product .bal-carousel__item__button--color-purple:active{background:var(--bal-carousel-product-item-button-background-purple-active)}}.bal-carousel--product .bal-carousel__item__button__image{width:5rem;height:5rem;pointer-events:none}.bal-carousel--product .bal-carousel__item__button__label{font-weight:var(--bal-font-weight-bold);color:var(--bal-carousel-product-item-button-label-text-color);font-size:var(--bal-text-size-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;height:3.5rem;overflow:hidden;line-height:1.15rem;word-break:break-word}';var Carousel=function(){function e(e){registerInstance(this,e);this.balChange=createEvent(this,"balChange");this.swiper=new SwiperUtil;this.swiperIsLastSlideVisible=false;this.hasAnimated=false;this.isMobile=balBreakpoints.isMobile;this.language=defaultConfig.language;this.value=0;this.steps=1;this.itemsPerView=1;this.controls="none";this.space="none";this.htmlRole="list";this.controlsOverflow=false;this.inverted=false;this.fullHeight=false;this.aspectRatio="16by9";this.interface="";this.controlsSticky=false;this.scrollY=true;this.border=false;this.mutationObserverActive=true}e.prototype.onValueChange=function(){this.swiper.index=this.value};e.prototype.onStepsChange=function(){this.swiper.steps=this.steps};e.prototype.onItemsPerViewChange=function(){this.swiper.itemsPerView=this.itemsPerView};e.prototype.onControlsChange=function(){this.swiper.controls=this.controls};e.prototype.onSpaceChange=function(){this.swiper.gapSpace=this.space};e.prototype.onInterFaceChange=function(){this.swiper.gapSpace=this.interface==="product"?"normal":this.space};e.prototype.connectedCallback=function(){this.swiper.connectedCallback(this);this.onControlsChange();this.onItemsPerViewChange();this.onStepsChange();this.onSpaceChange();this.onInterFaceChange();this.onValueChange()};e.prototype.disconnectedCallback=function(){this.swiper.disconnectedCallback()};e.prototype.blockVerticalScrolling=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){if(!this.scrollY&&((t=this.el)===null||t===void 0?void 0:t.contains(e.target))){stopEventBubbling(e)}return[2]}))}))};e.prototype.mutationListener=function(){this.swiper.notifyChange()};e.prototype.visibilityListener=function(){this.swiper.notifyChange()};e.prototype.swipeListener=function(e){var t=e.left,r=e.right;if(t){this.next()}else if(r){this.previous()}};e.prototype.breakpointListener=function(e){this.isMobile=e.mobile;this.swiper.notifyChange()};e.prototype.resizeListener=function(){this.swiper.notifyChange()};e.prototype.configChanged=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.language=e.language;return[2]}))}))};e.prototype.previous=function(){return __awaiter(this,arguments,void 0,(function(e){if(e===void 0){e=this.steps}return __generator(this,(function(t){this.swiper.previous(e);return[2]}))}))};e.prototype.next=function(){return __awaiter(this,arguments,void 0,(function(e){if(e===void 0){e=this.steps}return __generator(this,(function(t){this.swiper.next(e);return[2]}))}))};e.prototype.getContainerId=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.swiper.containerId]}))}))};e.prototype.swiperGetAllChildrenElements=function(){return Array.from(this.el.querySelectorAll("bal-carousel-item"))};e.prototype.swiperOnChange=function(e){this.value=e;this.balChange.emit(e)};e.prototype.render=function(){var e=this;var t=BEM.block("carousel");var r=t.element("inner");var a=r.element("container");return h(Host,{key:"561107c8e3c5eb7a80b3e2a8b113ed13f2fdfb5d",class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.swiper.cssSwiper()),t.class()),t.modifier(this.interface).class(this.interface!=="")),t.modifier("full-height").class(this.fullHeight)),t.modifier("controls-sticky").class(this.controlsSticky)),t.modifier("controls-tabs").class(this.controls==="tabs"))},this.controls==="tabs"?h(TabControl,{value:this.value,items:this.swiper.getAllControlItems(),containerId:this.swiper.containerId,onControlChange:function(t){return e.swiper.onControlChange(t.value)}}):"",h("div",{key:"6adb9641efe5f488a940ffac297bcc7b3932c92a",class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.swiper.cssInnerSwiper()),r.class()),r.modifier("is-".concat(this.aspectRatio)).class()),r.modifier("inverted").class(this.inverted)),r.modifier("full-height").class(this.fullHeight)),ref:function(t){return e.swiper.innerEl=t}},h("div",{key:"fb4083afd4a967761c25200e8630f171b02a6c2d",id:this.swiper.containerId,role:this.controls==="tabs"?"":"list",class:Object.assign(Object.assign(Object.assign(Object.assign({},this.swiper.cssSwiperContainer()),a.class()),a.modifier("border").class(this.border)),a.modifier("is-".concat(this.aspectRatio)).class()),ref:function(t){return e.swiper.containerEl=t}},h("slot",{key:"c46d996cc3904bcdc38951f155e3a49f73f284f8"}),this.border?h("div",{id:"".concat(this.swiper.id,"-border"),"aria-hidden":"true",class:Object.assign(Object.assign({},a.element("border").class()),a.element("border").modifier("inverted").class(this.inverted)),ref:function(t){return e.swiper.borderEl=t}}):"")),this.swiper.renderControls())};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{value:["onValueChange"],steps:["onStepsChange"],itemsPerView:["onItemsPerViewChange"],controls:["onControlsChange"],space:["onSpaceChange"],interface:["onInterFaceChange"]}},enumerable:false,configurable:true});return e}();__decorate([ListenToMutation({tags:["bal-carousel-item"],characterData:false}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],Carousel.prototype,"mutationListener",null);__decorate([ListenToVisibility(),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],Carousel.prototype,"visibilityListener",null);__decorate([ListenToSwipe(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],Carousel.prototype,"swipeListener",null);__decorate([ListenToBreakpoints(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],Carousel.prototype,"breakpointListener",null);__decorate([ListenToResize(),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],Carousel.prototype,"resizeListener",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Carousel.prototype,"configChanged",null);Carousel.style=balCarouselCss;var CarouselItem=function(){function e(e){var t=this;registerInstance(this,e);this.balNavigate=createEvent(this,"balNavigate");this.balFocus=createEvent(this,"balFocus");this.balBlur=createEvent(this,"balBlur");this.imageInheritAttributes={};this.isOnLoadEventDone=false;this.containerId="";this.svgContent="";this.label="";this.svg="";this.htmlRole="listitem";this.elementType="button";this.name=undefined;this.value=undefined;this.target="_self";this.generateSvgContent=function(){if(t.svg!==undefined&&t.svg.length>0){t.svgContent=sanitizeSvg(t.svg)}};this.onClick=function(e){if(t.href!==undefined){t.balNavigate.emit(e)}};this.onFocus=function(){t.balFocus.emit()};this.onBlur=function(){t.balBlur.emit()}}e.prototype.svgChanged=function(){this.generateSvgContent()};e.prototype.connectedCallback=function(){this.generateSvgContent()};e.prototype.componentDidLoad=function(){var e=this;rOnLoad((function(){e.isOnLoadEventDone=true}))};e.prototype.componentWillLoad=function(){this.imageInheritAttributes=inheritAttributes(this.el,["alt"]);this.getContainerId()};e.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,waitAfterFramePaint()];case 1:e.sent();if(this.buttonEl){this.buttonEl.focus()}return[2]}}))}))};e.prototype.getContainerId=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:e=this.el.closest("bal-carousel");t=this;return[4,e.getContainerId()];case 1:t.containerId=r.sent();return[2]}}))}))};e.prototype.render=function(){var e=this;var t=BEM.block("carousel");var r=t.element("item");var a=!!this.color&&!!this.label;var o=this.el.closest("bal-carousel");var i=o&&o.controls==="tabs"?"tabpanel":"listitem";var n="".concat(this.containerId,"-").concat(toKebabCase(this.label));if(!a){return h(Host,{id:n,role:i,class:Object.assign({},r.class()),"aria-label":this.label},this.isOnLoadEventDone&&this.src!==undefined?h("img",Object.assign({draggable:false,onDragStart:function(){return false},src:this.src},this.imageInheritAttributes)):"",h("slot",null))}var s=r.element("button");var l=s.element("image");var c=s.element("label");var u=this,b=u.elementType,d=u.download,p=u.href,m=u.rel,_=u.target,g=u.name,f=u.value;var v=this.href===undefined?"button":"a";var w=v==="button"?{type:b,name:g,value:f}:{download:d,href:p,rel:m,target:_};return h(Host,{id:n,role:i,"aria-label":this.label,class:Object.assign({},r.class())},h(v,Object.assign({},w,{class:Object.assign(Object.assign({},s.class()),s.modifier("color-".concat(this.color)).class()),part:"native",onFocus:this.onFocus,onBlur:this.onBlur,onClick:this.onClick,ref:function(t){return e.buttonEl=t}}),this.isOnLoadEventDone&&this.src!==undefined?h("img",Object.assign({class:Object.assign({},l.class()),draggable:false,onDragStart:function(){return false},"aria-hidden":"true",src:this.src},this.imageInheritAttributes)):this.isOnLoadEventDone&&this.svgContent!==undefined?h("div",{class:Object.assign({},l.class()),innerHTML:this.svgContent}):"",this.label!==undefined?h("span",{class:Object.assign({},c.class())},this.label):"",h("slot",null)))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{svg:["svgChanged"]}},enumerable:false,configurable:true});return e}();export{Carousel as bal_carousel,CarouselItem as bal_carousel_item};
@@ -1 +1 @@
1
- import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{b as isEscapeKey}from"./index.esm-Btc0yydR.js";import{a as ariaBooleanToString}from"./aria-DBsOHTWj.js";import{i as inheritAttributes}from"./attributes-C4sZQbkT.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{b as balBrowser}from"./browser-B1u-Mq75.js";import{b as balFloatingUi}from"./floating-ui-Bx04QSXP.js";import{F as FOCUS_KEYS}from"./focus-visible-DqCbGYzv.js";import{d as defaultBalAriaForm}from"./form-FCLKfv6B.js";import{s as stopEventBubbling}from"./form-input-DYvzaBlM.js";import{r as rIC,n as debounceEvent,o as addEventListener,p as removeEventListener,b as waitAfterIdleCallback}from"./helpers-BNj87EbG.js";import{L as Logger}from"./log-CwssmmaV.js";import{B as BalDate,i as i18nBalDate}from"./date-W0XtD641.js";import{d as defaultConfig}from"./config.default-RE8-gLMQ.js";import{i as isSpaceKey}from"./keyboard.helpers-BERg8BNc.js";import{L as ListenToConfig}from"./config.decorator-3bfyZ-0Y.js";import"./index-zWZxKBfo.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-B4k_dH6V.js";import"./index-BU7FUSdu.js";import"./index-D6JOtC1P.js";import"./config.utils-B7jugjyM.js";var balDateCss=":root{--bal-date-popup-z-index:var(--bal-z-index-tooltip);--bal-date-popup-shadow:var(--bal-shadow-normal);--bal-date-popup-radius:var(--bal-radius-normal)}:root{--bal-z-index-tooltip:1300}.bal-date{display:block;font-family:var(--bal-font-family-text);width:100%}.bal-date__icon--clickable{cursor:pointer}.bal-date__popup{display:none;width:-webkit-max-content;width:-moz-max-content;width:max-content;position:absolute;top:0;left:0;z-index:var(--bal-date-popup-z-index);-webkit-box-shadow:var(--bal-date-popup-shadow);box-shadow:var(--bal-date-popup-shadow);border-radius:var(--bal-date-popup-radius)}.bal-date__popup--visible{display:block}";var Date=function(){function t(t){var e=this;registerInstance(this,t);this.balInput=createEvent(this,"balInput");this.balChange=createEvent(this,"balChange");this.balWillAnimate=createEvent(this,"balWillAnimate");this.balDidAnimate=createEvent(this,"balDidAnimate");this.balBlur=createEvent(this,"balBlur");this.balFocus=createEvent(this,"balFocus");this.balInputClick=createEvent(this,"balInputClick");this.balIconClick=createEvent(this,"balIconClick");this.inputId="bal-da-".concat(dateIds++);this.inheritedAttributes={};this.isKeyboardMode=false;this.hasFocus=false;this.isExpanded=false;this.language=defaultConfig.language;this.ariaForm=defaultBalAriaForm;this.name=this.inputId;this.invalid=false;this.required=false;this.disabled=false;this.readonly=false;this.freeSolo=false;this.triggerIcon=false;this.closeOnSelect=true;this.autocomplete="off";this.value=undefined;this.allowedDates=undefined;this.allowInvalidValue=false;this.debounce=0;this.autoInvalidOff=false;this.hasConnected=false;this.handleKeydown=function(t){e.isKeyboardMode=FOCUS_KEYS.includes(t.key)};this.handlePointerDown=function(){e.isKeyboardMode=false};this.handleOutsideClick=function(t){if(e.isExpanded){if(!e.el.contains(t.target)){e.isExpanded=false;e.hasFocus=false;rIC((function(){return e.balBlur.emit(t)}))}}};this.handleFocus=function(t){stopEventBubbling(t);e.hasFocus=true;e.balFocus.emit(t.detail)};this.handleBlur=function(t){stopEventBubbling(t);if(!e.isExpanded){e.hasFocus=false;rIC((function(){return e.balBlur.emit(t.detail)}))}};this.onIconClick=function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.triggerIcon)return[3,2];return[4,this.toggle()];case 1:t.sent();return[3,4];case 2:return[4,this.open()];case 3:t.sent();t.label=4;case 4:return[2]}}))}))};this.onInputClick=function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!!this.triggerIcon)return[3,2];return[4,this.open()];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.onCalendarChange=function(t){stopEventBubbling(t);e.value=t.detail;e.balChange.emit(e.value);if(e.closeOnSelect){e.close();e.hasFocus=false;rIC((function(){return e.balBlur.emit()}))}};this.onInputInput=function(t){stopEventBubbling(t);e.balInput.emit(t.detail);if(t.detail){var i=BalDate.fromAnyFormat(t.detail);if(i.isValid){e.calendarValue=i.toISODate()}}};this.onInputChange=function(t){stopEventBubbling(t);e.value=t.detail;e.balChange.emit(e.value)};this.onKeyPress=function(t){return __awaiter(e,[t],void 0,(function(t){var e=t.detail;return __generator(this,(function(t){switch(t.label){case 0:if(!(e&&e.key))return[3,5];if(!this.isExpanded)return[3,3];if(!(e.key==="Tab"||isEscapeKey(e)||isSpaceKey(e)))return[3,2];return[4,this.close()];case 1:t.sent();t.label=2;case 2:return[3,5];case 3:if(!isSpaceKey(e))return[3,5];return[4,this.open()];case 4:t.sent();t.label=5;case 5:return[2]}}))}))}}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(){this.calendarValue=this.value};t.prototype.debounceChanged=function(){this.balChange=debounceEvent(this.balChange,this.debounce)};t.prototype.connectedCallback=function(){if(balBrowser.hasDocument){addEventListener(document,"keydown",this.handleKeydown);addEventListener(document,"touchstart",this.handlePointerDown);addEventListener(document,"mousedown",this.handlePointerDown);addEventListener(document,"click",this.handleOutsideClick)}this.hasConnected=true;this.valueChanged()};t.prototype.disconnectedCallback=function(){if(balBrowser.hasDocument){removeEventListener(document,"keydown",this.handleKeydown);removeEventListener(document,"touchstart",this.handlePointerDown);removeEventListener(document,"mousedown",this.handlePointerDown);removeEventListener(document,"click",this.handleOutsideClick)}};t.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAttributes(this.el,["aria-label","tabindex","title","data-hj-allow"])};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.language=t.language;return[2]}))}))};t.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.expand()]}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.collapse()]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.isExpanded){return[2,this.collapse()]}else{return[2,this.expand()]}return[2]}))}))};t.prototype.select=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){e=BalDate.fromISO(t);if(e.isValid){this.value=e.toISODate();this.calendarValue=this.value}return[2]}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(this.inputEl&&!this.disabled&&!this.readonly))return[3,2];return[4,waitAfterIdleCallback()];case 1:t.sent();this.inputEl.focus();t.label=2;case 2:return[2]}}))}))};t.prototype.setBlur=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:if(!(this.inputEl&&!this.disabled&&!this.readonly))return[3,2];return[4,waitAfterIdleCallback()];case 1:e.sent();(t=this.inputEl)===null||t===void 0?void 0:t.setBlur();e.label=2;case 2:return[2]}}))}))};t.prototype.getInputElement=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){return[2,(t=this.inputEl)===null||t===void 0?void 0:t.getInputElement()]}))}))};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){this.ariaForm=Object.assign({},t);(e=this.inputEl)===null||e===void 0?void 0:e.setAriaForm(t);return[2]}))}))};t.prototype.expand=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(i){switch(i.label){case 0:if(!(this.referenceEl&&this.floatingEl))return[3,2];return[4,balFloatingUi.load()];case 1:t=i.sent();this.balWillAnimate.emit();this.isExpanded=true;this.popupCleanup=t.autoUpdate(this.referenceEl,this.floatingEl,(function(){e.updatePosition(e.referenceEl,e.floatingEl)}));i.label=2;case 2:return[2,this.isExpanded]}}))}))};t.prototype.collapse=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.floatingEl){this.balWillAnimate.emit();this.isExpanded=false;if(this.popupCleanup){this.popupCleanup()}this.balDidAnimate.emit()}return[2,this.isExpanded]}))}))};t.prototype.updatePosition=function(t,e){return __awaiter(this,void 0,void 0,(function(){var i;var n=this;return __generator(this,(function(a){switch(a.label){case 0:return[4,balFloatingUi.load()];case 1:i=a.sent();i.computePosition(t,e,{placement:"bottom-start",middleware:[i.offset(4),i.flip({crossAxis:false})]}).then((function(t){var i=t.x,a=t.y;Object.assign(e.style,{left:"".concat(i,"px"),top:"".concat(a,"px")});n.balDidAnimate.emit()}));return[2]}}))}))};t.prototype.render=function(){var t=this;var e=BEM.block("date");var i=e.element("icon");var n=e.element("popup");return h(Host,{key:"66accfbf681e12eefdc6e61912fe5736f75c4501",id:this.inputId,class:Object.assign({},e.class())},h("bal-input-group",{key:"4e816b701215387a395c6a73da929609302d0c8f",invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,ref:function(e){return t.referenceEl=e}},h("bal-input-date",Object.assign({key:"188d50af76d1625bafb08b2d8ad4d13756bc4468",name:this.name,required:this.required,placeholder:this.placeholder,value:this.value,min:this.min,max:this.max,invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,allowInvalidValue:this.allowInvalidValue,autocomplete:this.autocomplete,onClick:this.onInputClick,onBalInput:this.onInputInput,onBalChange:this.onInputChange,onBalFocus:function(e){return t.handleFocus(e)},onBalBlur:function(e){return t.handleBlur(e)},onBalKeyPress:this.onKeyPress,ref:function(e){return t.inputEl=e}},this.inheritedAttributes)),!this.freeSolo?h("bal-icon",{name:"date",role:"button",tabindex:-1,class:Object.assign(Object.assign({},i.class()),i.modifier("clickable").class(!this.disabled&&!this.readonly)),"is-right":true,color:this.disabled||this.readonly?"grey":this.invalid?"danger":"primary",onClick:this.onIconClick,"aria-label":i18nBalDate[this.language].toggleDatepicker,"aria-haspopup":"true","aria-expanded":ariaBooleanToString(this.isExpanded)}):""),h("div",{key:"8eaee6ea09c2099057a2ad0165d63f70154d4095",role:"dialog",class:Object.assign(Object.assign({},n.class()),n.modifier("visible").class(this.isExpanded)),ref:function(e){return t.floatingEl=e},"aria-hidden":"".concat(this.isExpanded!==true),"aria-presented":"".concat(this.isExpanded===true)},h("bal-date-calendar",{key:"16f6680967612f55e9f8259b780a02e61c830090",value:this.calendarValue,min:this.min,max:this.max,minYearProp:this.minYearProp,maxYearProp:this.maxYearProp,defaultDate:this.defaultDate,allowedDates:this.allowedDates,onBalChange:this.onCalendarChange})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"],debounce:["debounceChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-date"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Date.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Date.prototype,"configChanged",null);var dateIds=0;Date.style=balDateCss;export{Date as bal_date};
1
+ import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{b as isEscapeKey}from"./index.esm-Btc0yydR.js";import{a as ariaBooleanToString}from"./aria-DBsOHTWj.js";import{i as inheritAttributes}from"./attributes-C4sZQbkT.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{b as balBrowser}from"./browser-B1u-Mq75.js";import{b as balFloatingUi}from"./floating-ui-gZ7E41T8.js";import{F as FOCUS_KEYS}from"./focus-visible-DqCbGYzv.js";import{d as defaultBalAriaForm}from"./form-FCLKfv6B.js";import{s as stopEventBubbling}from"./form-input-DYvzaBlM.js";import{r as rIC,n as debounceEvent,o as addEventListener,p as removeEventListener,b as waitAfterIdleCallback}from"./helpers-BNj87EbG.js";import{L as Logger}from"./log-CwssmmaV.js";import{B as BalDate,i as i18nBalDate}from"./date-W0XtD641.js";import{d as defaultConfig}from"./config.default-RE8-gLMQ.js";import{i as isSpaceKey}from"./keyboard.helpers-BERg8BNc.js";import{L as ListenToConfig}from"./config.decorator-3bfyZ-0Y.js";import"./index-zWZxKBfo.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-B4k_dH6V.js";import"./index-BU7FUSdu.js";import"./index-D6JOtC1P.js";import"./config.utils-B7jugjyM.js";var balDateCss=":root{--bal-date-popup-z-index:var(--bal-z-index-tooltip);--bal-date-popup-shadow:var(--bal-shadow-normal);--bal-date-popup-radius:var(--bal-radius-normal)}:root{--bal-z-index-tooltip:1300}.bal-date{display:block;font-family:var(--bal-font-family-text);width:100%}.bal-date__icon--clickable{cursor:pointer}.bal-date__popup{display:none;width:-webkit-max-content;width:-moz-max-content;width:max-content;position:absolute;top:0;left:0;z-index:var(--bal-date-popup-z-index);-webkit-box-shadow:var(--bal-date-popup-shadow);box-shadow:var(--bal-date-popup-shadow);border-radius:var(--bal-date-popup-radius)}.bal-date__popup--visible{display:block}";var Date=function(){function t(t){var e=this;registerInstance(this,t);this.balInput=createEvent(this,"balInput");this.balChange=createEvent(this,"balChange");this.balWillAnimate=createEvent(this,"balWillAnimate");this.balDidAnimate=createEvent(this,"balDidAnimate");this.balBlur=createEvent(this,"balBlur");this.balFocus=createEvent(this,"balFocus");this.balInputClick=createEvent(this,"balInputClick");this.balIconClick=createEvent(this,"balIconClick");this.inputId="bal-da-".concat(dateIds++);this.inheritedAttributes={};this.isKeyboardMode=false;this.hasFocus=false;this.isExpanded=false;this.language=defaultConfig.language;this.ariaForm=defaultBalAriaForm;this.name=this.inputId;this.invalid=false;this.required=false;this.disabled=false;this.readonly=false;this.freeSolo=false;this.triggerIcon=false;this.closeOnSelect=true;this.autocomplete="off";this.value=undefined;this.allowedDates=undefined;this.allowInvalidValue=false;this.debounce=0;this.autoInvalidOff=false;this.hasConnected=false;this.handleKeydown=function(t){e.isKeyboardMode=FOCUS_KEYS.includes(t.key)};this.handlePointerDown=function(){e.isKeyboardMode=false};this.handleOutsideClick=function(t){if(e.isExpanded){if(!e.el.contains(t.target)){e.isExpanded=false;e.hasFocus=false;rIC((function(){return e.balBlur.emit(t)}))}}};this.handleFocus=function(t){stopEventBubbling(t);e.hasFocus=true;e.balFocus.emit(t.detail)};this.handleBlur=function(t){stopEventBubbling(t);if(!e.isExpanded){e.hasFocus=false;rIC((function(){return e.balBlur.emit(t.detail)}))}};this.onIconClick=function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.triggerIcon)return[3,2];return[4,this.toggle()];case 1:t.sent();return[3,4];case 2:return[4,this.open()];case 3:t.sent();t.label=4;case 4:return[2]}}))}))};this.onInputClick=function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!!this.triggerIcon)return[3,2];return[4,this.open()];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.onCalendarChange=function(t){stopEventBubbling(t);e.value=t.detail;e.balChange.emit(e.value);if(e.closeOnSelect){e.close();e.hasFocus=false;rIC((function(){return e.balBlur.emit()}))}};this.onInputInput=function(t){stopEventBubbling(t);e.balInput.emit(t.detail);if(t.detail){var i=BalDate.fromAnyFormat(t.detail);if(i.isValid){e.calendarValue=i.toISODate()}}};this.onInputChange=function(t){stopEventBubbling(t);e.value=t.detail;e.balChange.emit(e.value)};this.onKeyPress=function(t){return __awaiter(e,[t],void 0,(function(t){var e=t.detail;return __generator(this,(function(t){switch(t.label){case 0:if(!(e&&e.key))return[3,5];if(!this.isExpanded)return[3,3];if(!(e.key==="Tab"||isEscapeKey(e)||isSpaceKey(e)))return[3,2];return[4,this.close()];case 1:t.sent();t.label=2;case 2:return[3,5];case 3:if(!isSpaceKey(e))return[3,5];return[4,this.open()];case 4:t.sent();t.label=5;case 5:return[2]}}))}))}}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(){this.calendarValue=this.value};t.prototype.debounceChanged=function(){this.balChange=debounceEvent(this.balChange,this.debounce)};t.prototype.connectedCallback=function(){if(balBrowser.hasDocument){addEventListener(document,"keydown",this.handleKeydown);addEventListener(document,"touchstart",this.handlePointerDown);addEventListener(document,"mousedown",this.handlePointerDown);addEventListener(document,"click",this.handleOutsideClick)}this.hasConnected=true;this.valueChanged()};t.prototype.disconnectedCallback=function(){if(balBrowser.hasDocument){removeEventListener(document,"keydown",this.handleKeydown);removeEventListener(document,"touchstart",this.handlePointerDown);removeEventListener(document,"mousedown",this.handlePointerDown);removeEventListener(document,"click",this.handleOutsideClick)}};t.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAttributes(this.el,["aria-label","tabindex","title","data-hj-allow"])};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.language=t.language;return[2]}))}))};t.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.expand()]}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.collapse()]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.isExpanded){return[2,this.collapse()]}else{return[2,this.expand()]}return[2]}))}))};t.prototype.select=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){e=BalDate.fromISO(t);if(e.isValid){this.value=e.toISODate();this.calendarValue=this.value}return[2]}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(this.inputEl&&!this.disabled&&!this.readonly))return[3,2];return[4,waitAfterIdleCallback()];case 1:t.sent();this.inputEl.focus();t.label=2;case 2:return[2]}}))}))};t.prototype.setBlur=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:if(!(this.inputEl&&!this.disabled&&!this.readonly))return[3,2];return[4,waitAfterIdleCallback()];case 1:e.sent();(t=this.inputEl)===null||t===void 0?void 0:t.setBlur();e.label=2;case 2:return[2]}}))}))};t.prototype.getInputElement=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){return[2,(t=this.inputEl)===null||t===void 0?void 0:t.getInputElement()]}))}))};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){this.ariaForm=Object.assign({},t);(e=this.inputEl)===null||e===void 0?void 0:e.setAriaForm(t);return[2]}))}))};t.prototype.expand=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(i){switch(i.label){case 0:if(!(this.referenceEl&&this.floatingEl))return[3,2];return[4,balFloatingUi.load()];case 1:t=i.sent();this.balWillAnimate.emit();this.isExpanded=true;this.popupCleanup=t.autoUpdate(this.referenceEl,this.floatingEl,(function(){e.updatePosition(e.referenceEl,e.floatingEl)}));i.label=2;case 2:return[2,this.isExpanded]}}))}))};t.prototype.collapse=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.floatingEl){this.balWillAnimate.emit();this.isExpanded=false;if(this.popupCleanup){this.popupCleanup()}this.balDidAnimate.emit()}return[2,this.isExpanded]}))}))};t.prototype.updatePosition=function(t,e){return __awaiter(this,void 0,void 0,(function(){var i;var n=this;return __generator(this,(function(a){switch(a.label){case 0:return[4,balFloatingUi.load()];case 1:i=a.sent();i.computePosition(t,e,{placement:"bottom-start",middleware:[i.offset(4),i.flip({crossAxis:false})]}).then((function(t){var i=t.x,a=t.y;Object.assign(e.style,{left:"".concat(i,"px"),top:"".concat(a,"px")});n.balDidAnimate.emit()}));return[2]}}))}))};t.prototype.render=function(){var t=this;var e=BEM.block("date");var i=e.element("icon");var n=e.element("popup");return h(Host,{key:"66accfbf681e12eefdc6e61912fe5736f75c4501",id:this.inputId,class:Object.assign({},e.class())},h("bal-input-group",{key:"4e816b701215387a395c6a73da929609302d0c8f",invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,ref:function(e){return t.referenceEl=e}},h("bal-input-date",Object.assign({key:"188d50af76d1625bafb08b2d8ad4d13756bc4468",name:this.name,required:this.required,placeholder:this.placeholder,value:this.value,min:this.min,max:this.max,invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,allowInvalidValue:this.allowInvalidValue,autocomplete:this.autocomplete,onClick:this.onInputClick,onBalInput:this.onInputInput,onBalChange:this.onInputChange,onBalFocus:function(e){return t.handleFocus(e)},onBalBlur:function(e){return t.handleBlur(e)},onBalKeyPress:this.onKeyPress,ref:function(e){return t.inputEl=e}},this.inheritedAttributes)),!this.freeSolo?h("bal-icon",{name:"date",role:"button",tabindex:-1,class:Object.assign(Object.assign({},i.class()),i.modifier("clickable").class(!this.disabled&&!this.readonly)),"is-right":true,color:this.disabled||this.readonly?"grey":this.invalid?"danger":"primary",onClick:this.onIconClick,"aria-label":i18nBalDate[this.language].toggleDatepicker,"aria-haspopup":"true","aria-expanded":ariaBooleanToString(this.isExpanded)}):""),h("div",{key:"8eaee6ea09c2099057a2ad0165d63f70154d4095",role:"dialog",class:Object.assign(Object.assign({},n.class()),n.modifier("visible").class(this.isExpanded)),ref:function(e){return t.floatingEl=e},"aria-hidden":"".concat(this.isExpanded!==true),"aria-presented":"".concat(this.isExpanded===true)},h("bal-date-calendar",{key:"16f6680967612f55e9f8259b780a02e61c830090",value:this.calendarValue,min:this.min,max:this.max,minYearProp:this.minYearProp,maxYearProp:this.maxYearProp,defaultDate:this.defaultDate,allowedDates:this.allowedDates,onBalChange:this.onCalendarChange})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"],debounce:["debounceChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-date"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Date.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Date.prototype,"configChanged",null);var dateIds=0;Date.style=balDateCss;export{Date as bal_date};
@@ -1 +1 @@
1
- import{__awaiter,__generator,__spreadArray}from"tslib";import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{i as inheritAttributes}from"./attributes-C4sZQbkT.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{b as balBrowser}from"./browser-B1u-Mq75.js";import{d as defaultBalAriaForm}from"./form-FCLKfv6B.js";import{s as stopEventBubbling}from"./form-input-DYvzaBlM.js";import{r as rIC,a as waitAfterFramePaint,o as addEventListener,p as removeEventListener,b as waitAfterIdleCallback,m as raf}from"./helpers-BNj87EbG.js";import{L as Logger}from"./log-CwssmmaV.js";import{i as isNil}from"./index-zWZxKBfo.js";import{a as areArraysEqual}from"./array-CDfSqLEo.js";import{F as FOCUS_KEYS}from"./focus-visible-DqCbGYzv.js";import{b as balFloatingUi}from"./floating-ui-Bx04QSXP.js";import{D as DropdownOptionUtil}from"./option-BLp4ll3i.js";import{a as ariaBooleanToString}from"./aria-DBsOHTWj.js";import{d as defaultConfig}from"./config.default-RE8-gLMQ.js";import{d as isArrowDownKey,b as isArrowUpKey,a as isEnterKey,j as isEscapeKey,i as isSpaceKey}from"./keyboard.helpers-BERg8BNc.js";import{L as ListenToConfig}from"./config.decorator-3bfyZ-0Y.js";import{B as BalElementStateListener,L as ListenToElementStates}from"./element-states.decorator-B68ANq1p.js";import{i as includes,s as startsWith}from"./utils-C_qktPg7.js";import"./config.utils-B7jugjyM.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-B4k_dH6V.js";import"./listener-CClDIhvK.js";var DropdownAutoFillUtil=function(){function o(){var o=this;this.handleAutoFill=function(t){return __awaiter(o,void 0,void 0,(function(){var o,r;return __generator(this,(function(e){switch(e.label){case 0:stopEventBubbling(t);if(!this.isAutoFillAllowed())return[3,2];this.component.isAutoFilled=true;o=this.component.nativeEl.value;return[4,this.parseAutoFillValueWithOptions(o)];case 1:r=e.sent();if(r===undefined){this.component.isAutoFilled=false;return[2]}if(!areArraysEqual(r,this.component.rawValue)){this.component.valueUtil.updateRawValueBySelection(r,true)}e.label=2;case 2:return[2]}}))}))}}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.isAutoFillAllowed=function(){return!this.component.multiple};o.prototype.parseAutoFillValueWithOptions=function(o){return __awaiter(this,void 0,void 0,(function(){var t,r,e,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,this.component.listEl.getOptions()];case 1:t=i.sent();r=undefined;for(e=0;e<t.length;e++){n=t[e];if(n.value===o||n.label===o){return[2,[n.value]]}}return[2,r]}}))}))};return o}();var i18nBalDropdown={de:{clearable:"Löschen",open:"Öffnen",close:"Schließen"},en:{clearable:"clear",open:"Open",close:"Close"},fr:{clearable:"Effacer",open:"Ouvrir",close:"Fermer"},it:{clearable:"Cancellare",open:"Apri",close:"Chiudi"},nl:{clearable:"Wissen",open:"Open",close:"Sluiten"},es:{clearable:"Limpiar",open:"Abrir",close:"Cerrar"},pl:{clearable:"Wyczyść",open:"Otwórz",close:"Zamknij"},pt:{clearable:"Limpar",open:"Abrir",close:"Fechar"},sv:{clearable:"Rensa",open:"Öppna",close:"Stäng"},fi:{clearable:"Tyhjennä",open:"Avaa",close:"Sulje"}};var DropdownEventsUtil=function(){function o(){var o=this;this.handlePointerDown=function(){o.component.isKeyboardMode=false};this.handleKeydown=function(t){o.component.isKeyboardMode=FOCUS_KEYS.includes(t.key)}}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.handleFocus=function(o){this.component.hasFocus=true;this.component.balFocus.emit(o)};o.prototype.handleBlur=function(o){var t=this;if(!this.component.isExpanded){this.component.hasFocus=false;rIC((function(){return t.component.balBlur.emit(o)}))}};o.prototype.handleClick=function(o){if(!this.component.valueUtil.isDisabled()){if(this.component.chips){var t=o.target;var r=t.closest("bal-close");if(r){return}}if(this.component.clearable){var t=o.target;var e=t.closest(".bal-dropdown__clear");if(e){this.component.valueUtil.updateRawValueBySelection([]);return}}this.component.popupUtil.toggleList()}};o.prototype.handleOutsideClick=function(o){var t=this;var r;if(this.component.isExpanded){if(!this.component.el.contains(o.target)){this.component.isExpanded=false;(r=this.component.listEl)===null||r===void 0?void 0:r.resetFocus();this.component.hasFocus=false;rIC((function(){return t.component.balBlur.emit(o)}))}}};return o}();var DropdownFocusUtil=function(){function o(){}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.focusOptionByLabel=function(o,t){var r=this;if(t===void 0){t={}}this.component.labelToFocus=(this.component.labelToFocus+o).trim();if(this.component.labelToFocus.length>0){clearTimeout(this.keyHitTimeout);this.keyHitTimeout=setTimeout((function(){var o;(o=r.component.listEl)===null||o===void 0?void 0:o.focusByLabel(r.component.labelToFocus,t)}),100);clearTimeout(this.timeout);this.timeout=setTimeout((function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(o){this.component.labelToFocus="";return[2]}))}))}),1e3)}};return o}();var DropdownFormSubmitUtil=function(){function o(){}o.prototype.connectedCallback=function(o){this.component=o;this.component.initialValue=this.component.value};o.prototype.componentDidRender=function(){var o=this;if(this.component.selectEl){var t=this.component.selectEl.querySelectorAll("option");t.forEach((function(t){if(o.component.rawValue.includes(t.value)){t.selected=true}}))}};o.prototype.handle=function(o){var t=this;var r=o.target;if(r===null||r===void 0?void 0:r.contains(this.component.el)){if(this.resetHandlerTimer){clearTimeout(this.resetHandlerTimer)}this.resetHandlerTimer=setTimeout((function(){var o=t.component.valueUtil.parseValueString(t.component.initialValue);t.component.valueUtil.updateRawValueBySelection(o)}),0)}};return o}();var DropdownNativeSelect=function(o){var t=o.name,r=o.httpFormSubmit,e=o.multiple,n=o.required,i=o.disabled,a=o.rawValue,d=o.refSelectEl;var l=BEM.block("dropdown");return r?h("select",{class:Object.assign({},l.element("root").element("select").class()),"aria-hidden":"true",name:t,multiple:e,required:n,disabled:i,tabindex:-1,ref:d},a.map((function(o){return h("option",{key:o,value:o,selected:true},o)}))):""};var DropdownIcon=function(o){var t=o.size,r=o.theme,e=o.icon,n=o.language,i=o.loading,a=o.clearable,d=o.invalid,l=o.filled,s=o.expanded,c=o.disabled;var p=BEM.block("dropdown");if(i){return h("bal-spinner",{class:Object.assign({},p.element("rear").class()),small:true,variation:"circle",color:"white"})}else if(a&&l&&!c){return h("button",{title:i18nBalDropdown[n].clearable,type:"button",tabIndex:-1,class:Object.assign(Object.assign(Object.assign(Object.assign({},p.element("rear").class()),p.element("clear").class()),p.element("clear").modifier("invalid").class(d)),p.element("clear").modifier("theme-purple").class(r==="purple"))},h("bal-icon",{class:Object.assign({},p.element("rear").class()),name:r==="purple"?"close":"close-circle",size:t,color:r==="purple"?"primary":"grey"}))}else{return h("bal-icon",{class:Object.assign({},p.element("rear").class()),name:e,size:t,turn:s,color:c?"grey":d?"danger":"primary"})}};var DropdownInput=function(o){var t=o.inputId,r=o.httpFormSubmit,e=o.ariaForm,n=o.rawValue,i=o.autocomplete,a=o.required,d=o.disabled,l=o.readonly,s=o.placeholder,c=o.expanded,p=o.invalid,u=o.language,b=o.inputLabel,_=o.inheritedAttributes,f=o.refInputEl,v=o.onChange,w=o.onFocus,m=o.onBlur,g=o.onKeyDown;var x=BEM.block("dropdown");var y=function(){return h("input",Object.assign({id:e.controlId||"".concat(t,"-ctrl"),class:Object.assign({},x.element("root").element("input").class()),type:"text",size:1,inputmode:"none",tabindex:"0",autoComplete:i,value:n.join(","),required:a,disabled:d,readonly:l,placeholder:s,title:c?i18nBalDropdown[u].close:i18nBalDropdown[u].open,"aria-label":c?i18nBalDropdown[u].close:i18nBalDropdown[u].open,"aria-owns":"".concat(t,"-menu"),"aria-invalid":ariaBooleanToString(p),"aria-disabled":ariaBooleanToString(d||l),"aria-labelledby":e.labelId,"aria-describedby":e.messageId,"aria-haspopup":"listbox","data-native":true,"data-label":b,"data-value":n.join(","),ref:function(o){return f(o)},onChange:function(o){return v(o)},onFocus:function(o){return w(o)},onBlur:function(o){return m(o)},onKeyDown:function(o){return g(o)}},_))};if(r){return h(y,null)}return h("form",{novalidate:true},h(y,null))};var DropdownPopupUtil=function(){function o(){this.updatePanelPosition=function(o,t,r){return function(){o.computePosition(t,r,{placement:"bottom-start",middleware:[o.flip(),o.shift()]}).then((function(o){var t=o.x,e=o.y;Object.assign(r.style,{left:"".concat(t,"px"),top:"".concat(e,"px")})}))}}}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.toggleList=function(){if(!this.component.valueUtil.isDisabled()){if(this.component.isExpanded){this.collapseList()}else{this.expandList()}}};o.prototype.expandList=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){switch(r.label){case 0:if(!this.component.panelEl)return[3,2];return[4,balFloatingUi.load()];case 1:t=r.sent();this.component.panelCleanup=t.autoUpdate(this.component.el,this.component.panelEl,this.updatePanelPosition(t,this.component.el,this.component.panelEl));r.label=2;case 2:this.component.isExpanded=true;return[4,(o=this.component.listEl)===null||o===void 0?void 0:o.focusSelected()];case 3:r.sent();return[2]}}))}))};o.prototype.collapseList=function(){var o;this.component.isExpanded=false;(o=this.component.listEl)===null||o===void 0?void 0:o.resetFocus();if(this.component.panelCleanup){this.component.panelCleanup()}};return o}();var DropdownValueUtil=function(){function o(){}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.componentDidLoad=function(){var o=this;setTimeout((function(){return o.valueChanged(o.component.value,undefined)}),0)};o.prototype.isDisabled=function(){return this.component.disabled||this.component.readonly};o.prototype.isFilled=function(){return this.component.rawValue&&this.component.rawValue.length>0};o.prototype.valueChanged=function(o,t){var r=typeof o;var e=typeof t;if(r!==e){this.updateRawValueByValueProp(o)}if(r==="string"&&o!==t){this.updateRawValueByValueProp(o)}if(Array.isArray(o)&&Array.isArray(t)&&!areArraysEqual(o,t)){this.updateRawValueByValueProp(o)}};o.prototype.updateRawValueBySelection=function(o,t){if(o===void 0){o=[]}if(t===void 0){t=false}this.component.isAutoFilled=t;this.updateRawValue(o);if(this.component.multiple){this.component.balChange.emit(this.component.rawValue)}else{this.component.balChange.emit(this.component.rawValue[0])}};o.prototype.parseValueString=function(o){if(o===void 0){o=[]}var t=[];if(!isNil(o)&&o!==""){if(Array.isArray(o)){t=__spreadArray([],o.filter((function(o){return!isNil(o)})),true)}else{if(o.split("").includes(",")){t=__spreadArray([],o.split(",").filter((function(o){return o})).map((function(o){return o.trim()})),true)}else{t=[o]}}}return t};o.prototype.updateRawValueByValueProp=function(o){if(o===void 0){o=[]}var t=this.parseValueString(o);this.updateRawValue(t)};o.prototype.updateRawValue=function(){return __awaiter(this,arguments,void 0,(function(o){if(o===void 0){o=[]}return __generator(this,(function(t){switch(t.label){case 0:this.component.rawValue=o;if(!this.component.listEl)return[3,2];return[4,this.component.listEl.updateSelected(this.component.rawValue)];case 1:t.sent();t.label=2;case 2:return[4,this.updateInputContent()];case 3:t.sent();return[2]}}))}))};o.prototype.removeOption=function(o){var t=this.component.rawValue.filter((function(t){return t!==o.value}));this.updateRawValueBySelection(t)};o.prototype.updateInputContent=function(){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(t){switch(t.label){case 0:return[4,waitAfterFramePaint()];case 1:t.sent();if(!this.component.listEl)return[3,3];o=this.component;return[4,this.component.listEl.getSelectedOptions(this.component.rawValue)];case 2:o.choices=t.sent();this.component.inputLabel=this.component.choices.map((function(o){return o.label.trim()})).sort().join(",");t.label=3;case 3:return[2]}}))}))};return o}();var DropdownValue=function(o){var t=o.inlineLabel,r=o.filled,e=o.chips,n=o.placeholder,i=o.choices,a=o.renderChip;var d=BEM.block("dropdown");if(r){if(e){return h("div",{class:Object.assign({},d.element("root").element("content").element("chips").class())},i.map((function(o){return a(o)})))}else{return(t&&"".concat(t,": "))+i.map((function(o){return o.label})).join(", ")}}else{return n}};var balDropdownCss=':root{--bal-dropdown-control-background:var(--bal-color-white);--bal-dropdown-control-background-hover:var(--bal-form-field-control-background-hover);--bal-dropdown-control-background-invalid:var(--bal-form-field-control-danger-background);--bal-dropdown-control-background-disabled:var(--bal-form-field-control-disabled-background);--bal-dropdown-control-input-background:var(--bal-color-grey-1);--bal-dropdown-control-native-input-background:transparent;--bal-dropdown-control-native-input-background-hover:transparent;--bal-dropdown-control-input-inverted-footer-background:transparent;--bal-dropdown-control-input-inverted-footer-background-hover:transparent;--bal-dropdown-control-input-multiple-background:transparent;--bal-dropdown-control-input-multiple-background-read-only-selection:transparent;--bal-dropdown-control-input-option-background:transparent;--bal-dropdown-control-input-option-background-selected:var(--bal-color-primary-1);--bal-dropdown-control-input-option-background-focused:var(--bal-color-grey-3);--bal-dropdown-control-input-option-background-hover:var(--bal-color-grey-3);--bal-dropdown-control-border-radius:var(--bal-form-field-control-radius);--bal-dropdown-popover-border-color:var(--bal-color-grey-2);--bal-dropdown-control-border-color:var(--bal-form-field-control-border-color);--bal-dropdown-control-border-color-focused:var(--bal-color-primary);--bal-dropdown-control-border-color-hover:var(--bal-form-field-control-border-color-hover);--bal-dropdown-control-border-color-invalid:var(--bal-form-field-control-danger-border-color);--bal-dropdown-control-border-color-disabled:var(--bal-form-field-control-disabled-border-color);--bal-dropdown-control-border-color-focus-within:var(--bal-color-primary);--bal-dropdown-option-border-top-color:var(--bal-color-grey-2);--bal-dropdown-popover-empty-text-color:var(--bal-form-field-control-color);--bal-dropdown-control-text-color:var(--bal-form-field-control-color);--bal-dropdown-control-text-color-focused:var(--bal-color-primary);--bal-dropdown-input-text-color-disabled:var(--bal-form-field-label-disabled-color);--bal-dropdown-control-inverted-footer-native-input-text-color:var(--bal-color-text-white);--bal-dropdown-option-content-label-text-color:var(--bal-form-field-control-color)}.bal-dropdown{display:block;position:relative;-ms-flex:1;flex:1;width:100%}.bal-dropdown__root{border-width:.125rem;border-style:solid;border-color:var(--bal-dropdown-control-border-color);border-radius:var(--bal-dropdown-control-border-radius);background:var(--bal-dropdown-control-background);font-weight:var(--bal-font-weight-regular);font-size:var(--bal-text-size-normal);font-family:var(--bal-font-family-text);color:var(--bal-dropdown-control-text-color);outline:none;-webkit-box-shadow:var(--bal-shadow-none);box-shadow:var(--bal-shadow-none);padding-right:1rem;height:auto;min-height:3rem;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:-ms-flexbox;display:flex;width:100%;text-align:left;gap:1rem;padding-left:calc(.75em - var(--bal-border-width-normal));padding-right:calc(.75em - var(--bal-border-width-normal));-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.bal-dropdown__root--autofill{background:#faffbd !important;background:light-dark(rgb(232, 240, 254), rgba(70, 90, 126, 0.4)) !important}.bal-dropdown__root>span{-ms-flex:1;flex:1;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bal-dropdown__root--focused{border-color:var(--bal-dropdown-control-border-color-focused)}.bal-dropdown__root--invalid{border-color:var(--bal-dropdown-control-border-color-invalid);background:var(--bal-dropdown-control-background-invalid)}.bal-dropdown__root--disabled{border-color:var(--bal-dropdown-control-border-color-disabled);background:var(--bal-dropdown-control-background-disabled)}.bal-dropdown__root__content--placeholder{color:var(--bal-form-field-control-placeholder-color)}.bal-dropdown__root__content--disabled{color:var(--bal-dropdown-input-text-color-disabled)}@media (hover: hover)and (pointer: fine){.bal-dropdown__root:not(.bal-dropdown__root--disabled):not(.bal-dropdown__root--invalid):not(.bal-dropdown__root--theme-purple):not(.bal-dropdown__root--theme-purple-expanded):hover{background:var(--bal-dropdown-control-background-hover)}}.bal-dropdown__root__content__chips{--bal-tag-size-small-font-size:var(--bal-text-size-normal);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--bal-space-xx-small);padding-top:var(--bal-space-x-small);padding-bottom:var(--bal-space-x-small)}.bal-dropdown__root__content__chips>bal-tag{z-index:1}.bal-dropdown__root__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:rgba(0,0,0,0);position:absolute;right:var(--bal-border-width-normal);left:var(--bal-border-width-normal);top:var(--bal-border-width-normal);bottom:var(--bal-border-width-normal);opacity:0;padding-left:calc(.75em - var(--bal-border-width-normal));padding-right:calc(.75em - var(--bal-border-width-normal));cursor:pointer}.bal-dropdown__root__input:disabled{cursor:default}.bal-dropdown__root__input:-webkit-autofill{opacity:1}.bal-dropdown__root__input:autofill{opacity:1}.bal-dropdown__root__input:-internal-autofill-selected{opacity:0}.bal-dropdown__root__select{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}.bal-dropdown__root--autofill .bal-dropdown__root__input{opacity:0}.bal-dropdown__list{display:none;visibility:hidden;opacity:0;width:100vw;position:absolute;top:0;left:0;will-change:left,top,opacity;background:var(--bal-color-white);border-radius:var(--bal-radius-normal);-webkit-box-shadow:var(--bal-shadow-normal);box-shadow:var(--bal-shadow-normal);z-index:var(--bal-z-index-popup)}@media screen and (min-width: 769px),print{.bal-dropdown__list{max-width:100vw;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;min-width:100%}}.bal-dropdown__list--expanded{display:block;visibility:visible;opacity:1}.bal-dropdown__native{bottom:0;left:0;position:absolute;opacity:0;pointer-events:none;width:100%}.bal-dropdown__clear{background:rgba(0,0,0,0);border:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer}.bal-dropdown__clear--theme-purple{height:2rem;width:2rem;border-top-right-radius:2px;border-bottom-right-radius:2px;margin-right:-10px}.bal-dropdown__clear--theme-purple::before{content:"";position:absolute;right:32px;background:var(--bal-color-white);width:2px;height:100%}.bal-dropdown__rear{z-index:1}.bal-dropdown__root--size-small{min-height:2rem}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--disabled) .bal-dropdown__root__content--placeholder{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded){border:none;background:var(--bal-color-background-grey-light)}@media (hover: hover)and (pointer: fine){.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover{background:var(--bal-color-purple-1)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__input,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner svg,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner g,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner path,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner circle{fill:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active{background:var(--bal-color-purple-2)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-dropdown__root__input,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner svg,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner g,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner path,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner circle{fill:var(--bal-color-text-primary)}}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded){border:none;background:var(--bal-color-purple-2)}@media (hover: hover)and (pointer: fine){.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover{background:var(--bal-color-purple-3)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__content{color:var(--bal-color-text-primary-pressed)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner svg,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner g,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner path,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner circle{fill:var(--bal-color-text-primary-pressed)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active{background:var(--bal-color-purple-3)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner svg,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner g,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner path,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner circle{fill:var(--bal-color-text-primary)}}.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled),.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active{border:none;background:var(--bal-color-purple-2)}.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-dropdown__root__content,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__content,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-icon__inner svg,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-icon__inner g,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-icon__inner path,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-icon__inner circle,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-icon__inner svg,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-icon__inner g,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-icon__inner path,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-icon__inner circle,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-icon__inner svg,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-icon__inner g,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-icon__inner path,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-icon__inner circle{fill:var(--bal-color-text-primary)}.bal-dropdown__root--focused.bal-dropdown__root--theme-purple:before{content:"";border-width:var(--bal-border-width-normal);border-style:solid;border-color:var(--bal-focus-shadow-end-color);position:absolute;background:rgba(0,0,0,0);border-radius:var(--bal-radius-normal);top:-0.25rem;bottom:-0.25rem;left:-0.25rem;right:-0.25rem}.bal-dropdown__root__content--size-small{font-size:var(--bal-text-size-small);font-weight:var(--bal-font-weight-bold)}.bal-dropdown__clear--theme-purple{height:2rem;width:2rem;border-top-right-radius:2px;border-bottom-right-radius:2px;margin-right:-10px}.bal-dropdown__clear--theme-purple::before{content:"";position:absolute;right:32px;background:var(--bal-color-white);width:2px;height:100%}';var Dropdown=function(){function o(o){var t=this;registerInstance(this,o);this.balChange=createEvent(this,"balChange");this.balFocus=createEvent(this,"balFocus");this.balBlur=createEvent(this,"balBlur");this.inputId="bal-dropdown-".concat(balDropdownIds++);this.inheritedAttributes={};this.initialValue=[];this.nativeOptions=[];this.rawOptions=[];this.choices=[];this.rawValue=[];this.hasFocus=false;this.isExpanded=false;this.isAutoFilled=false;this.isKeyboardMode=false;this.inputLabel="";this.ariaForm=defaultBalAriaForm;this.language=defaultConfig.language;this.region=defaultConfig.region;this.httpFormSubmit=defaultConfig.httpFormSubmit;this.labelToFocus="";this.valueUtil=new DropdownValueUtil;this.eventsUtil=new DropdownEventsUtil;this.popupUtil=new DropdownPopupUtil;this.optionUtil=new DropdownOptionUtil;this.formSubmitUtil=new DropdownFormSubmitUtil;this.focusUtil=new DropdownFocusUtil;this.autoFillUtil=new DropdownAutoFillUtil;this.autocomplete="off";this.name=this.inputId;this.placeholder="";this.inlineLabel="";this.icon="caret-down";this.size="";this.theme="";this.disabled=false;this.readonly=false;this.multiple=false;this.chips=false;this.clearable=false;this.invalid=false;this.required=false;this.loading=false;this.filter="includes";this.contentHeight=262;this.inverted=false;this.options=[];this.value=[];this.hasConnected=false;this.listenToOptionChange=function(o){t.optionUtil.listenToOptionChange(o)};this.listenOnClickOutside=function(o){t.eventsUtil.handleOutsideClick(o)};this.resetHandler=function(o){t.formSubmitUtil.handle(o)};this.handleAutoFill=function(o){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.log("(handleAutoFill)",o,this.nativeEl.value);this.autoFillUtil.handleAutoFill(o);return[2]}))}))};this.handleKeyDown=function(o){var r,e,n,i,a;if(o&&o.key){if(t.isExpanded){if(isArrowDownKey(o)){stopEventBubbling(o);(r=t.listEl)===null||r===void 0?void 0:r.focusNext()}else if(isArrowUpKey(o)){stopEventBubbling(o);(e=t.listEl)===null||e===void 0?void 0:e.focusPrevious()}else if(o.key==="Home"||o.key==="PageUp"){stopEventBubbling(o);(n=t.listEl)===null||n===void 0?void 0:n.focusFirst()}else if(o.key==="End"||o.key==="PageDown"){stopEventBubbling(o);(i=t.listEl)===null||i===void 0?void 0:i.focusLast()}else if(isEnterKey(o)){stopEventBubbling(o);(a=t.listEl)===null||a===void 0?void 0:a.selectByFocus()}else if(o.key==="Tab"||isEscapeKey(o)){t.popupUtil.collapseList()}else if(o.key.length===1){t.focusUtil.focusOptionByLabel(o.key)}}else{if(isEnterKey(o)||isSpaceKey(o)){stopEventBubbling(o);t.popupUtil.expandList()}else if(o.key.length===1){t.focusUtil.focusOptionByLabel(o.key,{select:true})}}}else{if(t.isExpanded){t.popupUtil.collapseList()}}}}o.prototype.createLogger=function(o){this.log=o};o.prototype.optionChanged=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){this.optionUtil.optionChanged();return[2]}))}))};o.prototype.valueChanged=function(o,t){this.valueUtil.valueChanged(o,t)};o.prototype.connectedCallback=function(){if(!this.hasConnected){this.eventsUtil.connectedCallback(this);this.valueUtil.connectedCallback(this);this.popupUtil.connectedCallback(this);this.optionUtil.connectedCallback(this);this.formSubmitUtil.connectedCallback(this);this.focusUtil.connectedCallback(this);this.autoFillUtil.connectedCallback(this)}addEventListener(this.el,"balOptionChange",this.listenToOptionChange);if(balBrowser.hasDocument){addEventListener(document,"keydown",this.eventsUtil.handleKeydown);addEventListener(document,"touchstart",this.eventsUtil.handlePointerDown);addEventListener(document,"mousedown",this.eventsUtil.handlePointerDown);addEventListener(document,"click",this.listenOnClickOutside);addEventListener(document,"reset",this.resetHandler,{capture:true})}this.hasConnected=true};o.prototype.disconnectedCallback=function(){removeEventListener(this.el,"balOptionChange",this.listenToOptionChange);if(balBrowser.hasDocument){removeEventListener(document,"keydown",this.eventsUtil.handleKeydown);removeEventListener(document,"touchstart",this.eventsUtil.handlePointerDown);removeEventListener(document,"mousedown",this.eventsUtil.handlePointerDown);removeEventListener(document,"click",this.listenOnClickOutside);removeEventListener(document,"reset",this.resetHandler,{capture:true})}};o.prototype.componentWillRender=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:this.inheritedAttributes=inheritAttributes(this.el,["tabindex","data-hj-allow"]);return[4,this.optionUtil.componentWillRender()];case 1:o.sent();return[2]}}))}))};o.prototype.componentDidRender=function(){this.formSubmitUtil.componentDidRender()};o.prototype.componentDidLoad=function(){this.valueUtil.componentDidLoad()};o.prototype.configChanged=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.language=o.language;this.region=o.region;this.httpFormSubmit=o.httpFormSubmit;return[2]}))}))};o.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:if(!(this.nativeEl&&!this.valueUtil.isDisabled()))return[3,2];return[4,waitAfterIdleCallback()];case 1:o.sent();this.nativeEl.focus();o.label=2;case 2:return[2]}}))}))};o.prototype.getValue=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,this.rawValue]}))}))};o.prototype.clear=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){this.valueUtil.updateRawValueBySelection([]);return[2]}))}))};o.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:if(!(!this.valueUtil.isDisabled()&&this.panelEl))return[3,2];return[4,this.popupUtil.expandList()];case 1:o.sent();o.label=2;case 2:return[2]}}))}))};o.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:if(!(!this.valueUtil.isDisabled()&&this.panelEl))return[3,2];return[4,this.popupUtil.collapseList()];case 1:o.sent();o.label=2;case 2:return[2]}}))}))};o.prototype.select=function(o){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){t=this.valueUtil.parseValueString(o);this.valueUtil.updateRawValueBySelection(t);return[2]}))}))};o.prototype.setAriaForm=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.ariaForm=Object.assign({},o);return[2]}))}))};o.prototype.render=function(){var o=this;var t=BEM.block("dropdown");var r=this.valueUtil.isFilled();var e=this.size!=="";var n="size-".concat(this.size);var i=this.theme!=="";var a="theme-".concat(this.theme);var d=this.theme==="purple"?this.hasFocus&&this.isKeyboardMode:this.hasFocus;return h(Host,{key:"3fe05ba6190dabe5fb8c297f4809659f7c24aa74",class:Object.assign({},t.class()),tabindex:"-1",id:"".concat(this.inputId)},h("div",{key:"e0b038aa5b7ead381d271c5b7b04fd5bbaa3ea3b",class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t.element("root").class()),t.element("root").modifier("focused").class(d)),t.element("root").modifier("invalid").class(this.invalid)),t.element("root").modifier("disabled").class(this.valueUtil.isDisabled())),t.element("root").modifier("autofill").class(this.isAutoFilled)),t.element("root").modifier(n).class(e)),t.element("root").modifier(a).class(i)),t.element("root").modifier(a+"-filled").class(r&&i)),t.element("root").modifier(a+"-expanded").class(this.isExpanded&&i)),"data-testid":"bal-dropdown-trigger",onClick:function(t){return o.eventsUtil.handleClick(t)}},h("span",{key:"a3499a9e2abcaa3b363385c475c3dcd91ed1a371",class:Object.assign(Object.assign(Object.assign(Object.assign({},t.element("root").element("content").class()),t.element("root").element("content").modifier("disabled").class(this.valueUtil.isDisabled())),t.element("root").element("content").modifier("placeholder").class(!this.valueUtil.isFilled())),t.element("root").element("content").modifier(n).class(e))},h(DropdownValue,{key:"8ffc980c91386038c4ee9b9e6673a25a3609d674",filled:this.valueUtil.isFilled(),inlineLabel:this.inlineLabel,chips:this.chips,placeholder:this.placeholder,choices:this.choices,renderChip:function(t){return h("bal-tag",{key:t.value,"data-testid":"bal-dropdown-chip",size:"small",invalid:o.invalid,disabled:o.disabled||o.readonly,closable:!(o.disabled||o.readonly),onBalCloseClick:function(){return o.valueUtil.removeOption(t)}},t.label)}})),h(DropdownInput,{key:"9a97fc39a821d5dcca32eba522ae29e4aa6eedc0",inputId:this.inputId,httpFormSubmit:this.httpFormSubmit,ariaForm:this.ariaForm,rawValue:this.rawValue,autocomplete:this.autocomplete,required:this.required,disabled:this.disabled,readonly:this.readonly,placeholder:this.placeholder,expanded:this.isExpanded,invalid:this.invalid,language:this.language,inputLabel:this.inputLabel,inheritedAttributes:this.inheritedAttributes,refInputEl:function(t){return o.nativeEl=t},onChange:function(t){return o.handleAutoFill(t)},onFocus:function(t){return o.eventsUtil.handleFocus(t)},onBlur:function(t){return o.eventsUtil.handleBlur(t)},onKeyDown:function(t){return o.handleKeyDown(t)}}),h(DropdownNativeSelect,{key:"2a33a8ac7f336889197137fc741ed8a4a107fceb",name:this.name,httpFormSubmit:this.httpFormSubmit,multiple:this.multiple,required:this.required,disabled:this.valueUtil.isDisabled(),rawValue:this.rawValue,refSelectEl:function(t){return o.selectEl=t}}),h(DropdownIcon,{key:"d0f6958fb47ad7f6d73d4f98482cb2102c344f20",icon:this.icon,size:this.size,theme:this.theme,language:this.language,loading:this.loading,clearable:this.clearable,invalid:this.invalid,expanded:this.isExpanded,filled:r,disabled:this.valueUtil.isDisabled()})),h("div",{key:"29e98d1f54ffb6ee913bd682d6531d45997fc1d0",id:"".concat(this.inputId,"-menu"),class:Object.assign(Object.assign({},t.element("list").class()),t.element("list").modifier("expanded").class(this.isExpanded)),ref:function(t){return o.panelEl=t}},h("bal-option-list",{key:"4e6fa69f9d9859208f83dd7bc86c17fc75d5eb60",multiple:this.multiple,disabled:this.valueUtil.isDisabled(),filter:this.filter,required:this.required,contentHeight:this.contentHeight,ref:function(t){return o.listEl=t}},h("slot",{key:"1c169dc692632671f62410b2dadcbbc10b0fe36a"}),this.optionUtil.hasPropOptions()?this.rawOptions.map((function(o){return h("bal-option",{key:o.value,value:o.value,label:o.label,disabled:o.disabled,multiline:o.multiline,invalid:o.invalid,hidden:o.hidden,selected:o.selected,focused:o.focused},o.label)})):"")))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{options:["optionChanged"],value:["valueChanged"]}},enumerable:false,configurable:true});return o}();__decorate([Logger("bal-dropdown"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Dropdown.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Dropdown.prototype,"configChanged",null);var balDropdownIds=0;Dropdown.style=balDropdownCss;var balOptionCss=":root{--bal-option-padding-x:var(--bal-space-small);--bal-option-min-height:1.5rem;--bal-option-background:var(--bal-color-white);--bal-option-background-hovered:var(--bal-color-grey-3);--bal-option-background-selected:var(--bal-color-primary-1);--bal-option-background-selected-hovered:#dddfeb;--bal-option-background-invalid:var(--bal-color-danger-1);--bal-option-background-invalid-hovered:#fbe0de;--bal-option-border-width:var(--bal-border-width-normal);--bal-option-border-color:var(--bal-color-grey-2);--bal-option-font-family:var(--bal-font-family-text);--bal-option-font-weight:var(--bal-font-weight-regular);--bal-option-line-height:1.125rem;--bal-option-text-hovered:var(--bal-color-text-primary-hovered);--bal-option-text-pressed:var(--bal-color-text-primary-pressed);--bal-option-text-disabled:var(--bal-color-text-grey-light)}.bal-option{font-size:16px;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:block;list-style:none;cursor:pointer;border-bottom-width:var(--bal-option-border-width);border-bottom-color:var(--bal-option-border-color);border-bottom-style:solid;background:var(--bal-option-background);padding-left:var(--bal-option-padding-x);padding-right:var(--bal-option-padding-x);min-height:var(--bal-option-min-height)}.bal-option>bal-stack{min-height:var(--bal-option-min-height)}.bal-option:last-child{border-bottom:none}.bal-option::-moz-focus-inner{border:none}.bal-option--hidden{display:none;visibility:hidden}.bal-option__inner{font-family:var(--bal-option-font-family);font-weight:var(--bal-option-font-weight);line-height:var(--bal-option-line-height);word-break:break-word;white-space:normal;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-ms-flex:1;flex:1}.bal-option__inner--multiline{white-space:normal}.bal-option--focused{background:var(--bal-option-background-hovered)}@media (hover: hover)and (pointer: fine){.bal-option:hover{background:var(--bal-option-background-hovered);color:var(--bal-option-text-hovered)}}.bal-option:active{background:var(--bal-option-background-hovered);color:var(--bal-option-text-pressed)}.bal-option--selected{background:var(--bal-option-background-selected)}@media (hover: hover)and (pointer: fine){.bal-option--selected:hover{background:var(--bal-option-background-selected-hovered)}}.bal-option--selected:active{background:var(--bal-option-background-selected-hovered)}.bal-option--selected .bal-option__inner{font-weight:var(--bal-font-weight-bold)}.bal-option--selected.bal-option--focused{background:var(--bal-option-background-selected-hovered)}.bal-option--selected.bal-option--focused .bal-option__inner{font-weight:var(--bal-font-weight-bold)}.bal-option--invalid{background:var(--bal-option-background-invalid)}@media (hover: hover)and (pointer: fine){.bal-option--invalid:hover{background:var(--bal-option-background-invalid-hovered)}}.bal-option--invalid:active{background:var(--bal-option-background-invalid-hovered)}.bal-option--invalid.bal-option--focused{background:var(--bal-option-background-invalid-hovered)}.bal-option--invalid .bal-option__inner{color:var(--bal-color-text-danger-hovered)}@media (hover: hover)and (pointer: fine){.bal-option--invalid:hover .bal-option__inner{color:var(--bal-color-text-danger-hovered)}}.bal-option--invalid:active .bal-option__inner{color:var(--bal-color-text-danger-pressed)}.bal-option--disabled,.bal-option--disabled.bal-option--focused{background:var(--bal-option-background) !important;color:var(--bal-option-text-disabled) !important;cursor:default !important}.bal-option--disabled:hover,.bal-option--disabled.bal-option--focused:hover{background:var(--bal-option-background) !important}.bal-option{--bal-check-size:1.25rem}";var Option=function(){function o(o){var t=this;registerInstance(this,o);this.balOptionChange=createEvent(this,"balOptionChange");this.balOptionFocus=createEvent(this,"balOptionFocus");this.inputId="bal-option-".concat(balOptionIds++);this.checkbox=false;this.interactionState=BalElementStateListener.DefaultState;this.label="";this.value="";this.disabled=false;this.multiline=false;this.invalid=false;this.selected=false;this.focused=false;this.hidden=false;this.onClick=function(o){var r=t.el.closest("bal-option-list");if(t.disabled||r&&r.disabled){stopEventBubbling(o)}else{if(r&&r.required&&!r.multiple){if(!t.selected){t.select(true)}}else{t.select(!t.selected)}}}}o.prototype.createLogger=function(o){this.log=o};o.prototype.componentWillRender=function(){if(this.el){var o=this.el.closest("bal-option-list");if(o){this.checkbox=!!o.multiple}}};o.prototype.listenToMouseEnter=function(){var o=this,t=o.label,r=o.value,e=o.selected,n=o.disabled,i=o.hidden;if(!i&&!n){this.balOptionFocus.emit({label:t,value:r,selected:e})}};o.prototype.elementStateListener=function(o){this.interactionChildElements.forEach((function(t){t.hovered=o.hovered;t.pressed=o.pressed}))};o.prototype.select=function(){return __awaiter(this,arguments,void 0,(function(o){var t,r,e;if(o===void 0){o=true}return __generator(this,(function(n){this.selected=o;t=this,r=t.label,e=t.value;this.balOptionChange.emit({label:r,value:e,selected:o});return[2]}))}))};Object.defineProperty(o.prototype,"interactionChildElements",{get:function(){return Array.from(this.el.querySelectorAll("bal-check"))},enumerable:false,configurable:true});o.prototype.render=function(){var o=BEM.block("option");return h(Host,{key:"dca805aa021ad35c2ea4153008a8a5ba4f37931c",class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o.class()),o.modifier("checkbox").class(this.checkbox)),o.modifier("focused").class(this.focused)),o.modifier("invalid").class(this.invalid)),o.modifier("selected").class(this.selected)),o.modifier("disabled").class(this.disabled)),o.modifier("hidden").class(this.hidden)),role:"option",id:this.inputId,"data-value":this.value,"data-label":this.label,"aria-label":this.label,"aria-hidden":ariaBooleanToString(this.hidden),"aria-selected":ariaBooleanToString(this.selected),"aria-checked":ariaBooleanToString(this.selected),"aria-disabled":ariaBooleanToString(this.disabled),"aria-invalid":ariaBooleanToString(this.invalid),tabIndex:-1,onClick:this.onClick},h("bal-stack",{key:"cfcf978a82159a6e7ad2dcddccdb40dd6b9f74a4",py:"small",space:"x-small"},this.checkbox?h("bal-check",{checked:this.selected,disabled:this.disabled,invalid:this.invalid,hovered:this.interactionState.hovered,pressed:this.interactionState.pressed,tabindex:-1}):"",h("div",{key:"e92a9c019432d29f6153371daca316c8136c75e9",class:Object.assign(Object.assign({},o.element("inner").class()),o.element("inner").modifier("multiline").class(this.multiline))},h("slot",{key:"639a99194ed6e86787e9eb2b3adc993161d58a07"})),this.selected&&!this.checkbox?h("bal-icon",{name:"check",size:"small",color:this.disabled?"grey":this.invalid?"danger":"primary"}):""))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return o}();__decorate([Logger("bal-option"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Option.prototype,"createLogger",null);__decorate([ListenToElementStates(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],Option.prototype,"elementStateListener",null);var balOptionIds=0;Option.style=balOptionCss;var balOptionListCss=".bal-option-list{display:block;position:relative;width:100%;list-style:none;margin:0;outline:0;max-height:var(--bal-option-list-max-height);border-radius:var(--bal-radius-normal);overflow:hidden auto}";var OptionList=function(){function o(o){registerInstance(this,o);this.inputId="bal-option-list-".concat(balOptionListIds++);this.inheritAttributes={};this.ariaForm=defaultBalAriaForm;this.multiple=false;this.disabled=false;this.required=false;this.focusIndex=-1;this.filter="includes";this.contentHeight=262}o.prototype.createLogger=function(o){this.log=o};o.prototype.contentHeightChanged=function(o){if(o===undefined){this.el.style.removeProperty("--bal-option-list-max-height")}else{this.el.style.setProperty("--bal-option-list-max-height","".concat(o,"px"))}};o.prototype.componentDidLoad=function(){this.contentHeightChanged(this.contentHeight)};o.prototype.componentWillRender=function(){this.inheritAttributes=inheritAttributes(this.el,["aria-multiselectable","aria-labelledby"])};o.prototype.listenToMouseEnter=function(o){var t=this.options;var r=this.getOptionIndex(t,o.detail.value);if(r!==undefined){this.updateFocus(t,r)}};o.prototype.listenToOptionChange=function(o){var t=o.detail;if(!this.multiple){this.options.filter((function(o){return o.value!==t.value})).forEach((function(o){return o.selected=false}))}};o.prototype.focusSelected=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){switch(r.label){case 0:o=this.options;t=this.getSelectedOptionIndex(o);if(!(t>0))return[3,2];this.updateFocus(o,t);return[4,waitAfterFramePaint()];case 1:r.sent();return[2,t];case 2:return[4,this.focusFirst()];case 3:return[2,r.sent()]}}))}))};o.prototype.focusFirst=function(){return __awaiter(this,void 0,void 0,(function(){var o,t,r;return __generator(this,(function(e){switch(e.label){case 0:o=this.options;t=this.getFirstOptionIndex(o);this.updateFocus(o,t);r=o[t];this.updateScrollTopPosition(r);return[4,waitAfterFramePaint()];case 1:e.sent();return[2,t]}}))}))};o.prototype.focusLast=function(){return __awaiter(this,void 0,void 0,(function(){var o,t,r;return __generator(this,(function(e){switch(e.label){case 0:o=this.options;t=this.getLastOptionIndex(o);this.updateFocus(o,t);r=o[t];this.updateScrollBottomPosition(r);return[4,waitAfterFramePaint()];case 1:e.sent();return[2,t]}}))}))};o.prototype.focusNext=function(){return __awaiter(this,void 0,void 0,(function(){var o,t,r;return __generator(this,(function(e){switch(e.label){case 0:o=this.options;t=this.getNextOptionIndex(o);this.updateFocus(o,t);r=o[t];this.updateScrollBottomPosition(r);return[4,waitAfterFramePaint()];case 1:e.sent();return[2,t]}}))}))};o.prototype.focusPrevious=function(){return __awaiter(this,void 0,void 0,(function(){var o,t,r;return __generator(this,(function(e){switch(e.label){case 0:o=this.options;t=this.getPreviousOptionIndex(o);this.updateFocus(o,t);r=o[t];this.updateScrollTopPosition(r);return[4,waitAfterFramePaint()];case 1:e.sent();return[2,t]}}))}))};o.prototype.focusByLabel=function(o,t){return __awaiter(this,void 0,void 0,(function(){var r,e,n;return __generator(this,(function(i){switch(i.label){case 0:r=this.options;e=this.getOptionIndexByLabel(r,o);this.updateFocus(r,e);n=r[e];this.updateScrollTopPosition(n);return[4,waitAfterFramePaint()];case 1:i.sent();if(!t.select)return[3,3];return[4,n.select()];case 2:i.sent();i.label=3;case 3:return[2,e]}}))}))};o.prototype.filterByContent=function(o){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:t=this.allOptions;this.filterOptions(t,o);return[4,waitAfterFramePaint()];case 1:r.sent();return[2,this.focusFirst()]}}))}))};o.prototype.resetHidden=function(){return __awaiter(this,arguments,void 0,(function(o){if(o===void 0){o=false}return __generator(this,(function(t){switch(t.label){case 0:this.options.forEach((function(t){return t.hidden=o}));return[4,waitAfterFramePaint()];case 1:t.sent();this.resetFocus();return[2]}}))}))};o.prototype.resetSelected=function(){return __awaiter(this,arguments,void 0,(function(o){if(o===void 0){o=false}return __generator(this,(function(t){switch(t.label){case 0:this.options.forEach((function(t){return t.selected=o}));return[4,waitAfterFramePaint()];case 1:t.sent();return[2]}}))}))};o.prototype.updateSelected=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:this.options.forEach((function(t){return t.selected=o.includes(t.value)}));return[4,waitAfterFramePaint()];case 1:t.sent();return[2]}}))}))};o.prototype.resetFocus=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){switch(r.label){case 0:o=this.options;t=-1;this.updateFocus(o,t);this.scrollTo(0);return[4,waitAfterFramePaint()];case 1:r.sent();return[2,t]}}))}))};o.prototype.getSelectedValues=function(){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(t){o=this.options;return[2,o.filter((function(o){return o.selected})).map((function(o){return o.value}))]}))}))};o.prototype.getSelectedOptions=function(o){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){t=this.options;if(o&&o.length>0){return[2,t.filter((function(t){return o.includes(t.value)})).map((function(o){return o}))]}return[2,t.filter((function(o){return o.selected})).map((function(o){return o}))]}))}))};o.prototype.getValues=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,this.options.map((function(o){return o.value}))]}))}))};o.prototype.getLabels=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,this.options.map((function(o){return o.label}))]}))}))};o.prototype.getOptions=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,this.options.filter((function(o){return!o.disabled||!o.hidden}))]}))}))};o.prototype.selectByFocus=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){o=this.options;t=o[this.focusIndex];if(t){if(this.multiple){t.select(!t.selected)}else{t.select(true)}}return[2]}))}))};o.prototype.setAriaForm=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.ariaForm=Object.assign({},o);return[2]}))}))};Object.defineProperty(o.prototype,"options",{get:function(){return Array.from(this.el.querySelectorAll("bal-option")).filter((function(o){return!o.hidden}))},enumerable:false,configurable:true});Object.defineProperty(o.prototype,"allOptions",{get:function(){return Array.from(this.el.querySelectorAll("bal-option"))},enumerable:false,configurable:true});o.prototype.filterOptions=function(o,t){var r=[];var e=this.filter==="includes"?includes:startsWith;for(var n=0;n<o.length;n++){var i=o[n];var a=i.textContent||"";if(e(a,t)){r.push(i);i.hidden=false}else{i.hidden=true}}return r};o.prototype.isOptionVisible=function(o){var t=this.el.clientHeight;var r=this.el.scrollTop;var e=r+t;var n=r<=o.offsetTop&&o.offsetTop+o.clientHeight<=e;return n};o.prototype.updateScrollTopPosition=function(o){if(o){var t=this.isOptionVisible(o);if(!t){this.scrollTo(this.getScrollTopForTopPosition(o))}}};o.prototype.updateScrollBottomPosition=function(o){if(o){var t=this.isOptionVisible(o);if(!t){this.scrollTo(this.getScrollTopForBottomPosition(o))}}};o.prototype.getScrollTopForTopPosition=function(o){var t=o.offsetTop;var r=t;if(r<0){return 0}return r};o.prototype.getScrollTopForBottomPosition=function(o){var t=this.el.clientHeight;var r=o.offsetTop+o.clientHeight;var e=r-t;if(e<0){return 0}return e};o.prototype.scrollTo=function(o){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){if(o!==undefined&&o!==null){if(this.focusRaf!==undefined){cancelAnimationFrame(this.focusRaf)}this.focusRaf=raf((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.el.scrollTop=o;return[2]}))}))}))}return[2]}))}))};o.prototype.updateFocus=function(o,t){this.focusIndex=t;for(var r=0;r<o.length;r++){var e=o[r];e.focused=r===t}};o.prototype.getOptionIndex=function(o,t){for(var r=0;r<o.length;r++){var e=o[r];if(e.value===t){return r}}return undefined};o.prototype.getSelectedOptionIndex=function(o){for(var t=0;t<o.length;t++){var r=o[t];if(r.selected&&!r.hidden){return t}}return this.focusIndex};o.prototype.getFirstOptionIndex=function(o){for(var t=0;t<o.length;t++){var r=o[t];if(!r.disabled&&!r.hidden){return t}}return this.focusIndex};o.prototype.getNextOptionIndex=function(o,t){if(t===void 0){t=this.focusIndex}if(t<0){return this.getFirstOptionIndex(o)}var r=this.getLength(o);var e=t;if(t<r){e=t+1;if(o[e].disabled){return this.getNextOptionIndex(o,e)}}return e};o.prototype.getPreviousOptionIndex=function(o,t){if(t===void 0){t=this.focusIndex}var r=this.getFirstOptionIndex(o);if(t<=r){return r}var e=t;e=t-1;if(o[e].disabled){return this.getPreviousOptionIndex(o,e)}return e};o.prototype.getLastOptionIndex=function(o){for(var t=o.length-1;t>=0;t--){var r=o[t];if(!r.disabled){return t}}return this.focusIndex};o.prototype.getOptionIndexByLabel=function(o,t){if(t===undefined||t===""){return this.focusIndex}var r=o.find((function(o){return startsWith(o.label||"",t)}));if(!isNil(r)&&r.id){return o.indexOf(r)}return this.focusIndex};o.prototype.getLength=function(o){var t=o.map((function(o,t){return o.disabled?0:t}));var r=Math.max.apply(Math,t);return r};o.prototype.render=function(){var o=BEM.block("option-list");var t=this.labelledby||this.ariaForm.labelId;return h(Host,{key:"bcb9ee55aefe68beac309225d1127524f327f9da",class:Object.assign({},o.class()),id:this.inputId},h("div",Object.assign({key:"ac14c8a5615c6497569ca0aa8436dda3924babf6",role:"listbox","aria-labelledby":t,"aria-disabled":ariaBooleanToString(this.disabled),class:Object.assign({},o.element("container").class())},this.inheritAttributes),h("slot",{key:"869656387e53fd832b45141cb3b5b89684e61727"})))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{contentHeight:["contentHeightChanged"]}},enumerable:false,configurable:true});return o}();__decorate([Logger("bal-option-list"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],OptionList.prototype,"createLogger",null);var balOptionListIds=0;OptionList.style=balOptionListCss;export{Dropdown as bal_dropdown,Option as bal_option,OptionList as bal_option_list};
1
+ import{__awaiter,__generator,__spreadArray}from"tslib";import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{i as inheritAttributes}from"./attributes-C4sZQbkT.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{b as balBrowser}from"./browser-B1u-Mq75.js";import{d as defaultBalAriaForm}from"./form-FCLKfv6B.js";import{s as stopEventBubbling}from"./form-input-DYvzaBlM.js";import{r as rIC,a as waitAfterFramePaint,o as addEventListener,p as removeEventListener,b as waitAfterIdleCallback,m as raf}from"./helpers-BNj87EbG.js";import{L as Logger}from"./log-CwssmmaV.js";import{i as isNil}from"./index-zWZxKBfo.js";import{a as areArraysEqual}from"./array-CDfSqLEo.js";import{F as FOCUS_KEYS}from"./focus-visible-DqCbGYzv.js";import{b as balFloatingUi}from"./floating-ui-gZ7E41T8.js";import{D as DropdownOptionUtil}from"./option-BLp4ll3i.js";import{a as ariaBooleanToString}from"./aria-DBsOHTWj.js";import{d as defaultConfig}from"./config.default-RE8-gLMQ.js";import{d as isArrowDownKey,b as isArrowUpKey,a as isEnterKey,j as isEscapeKey,i as isSpaceKey}from"./keyboard.helpers-BERg8BNc.js";import{L as ListenToConfig}from"./config.decorator-3bfyZ-0Y.js";import{B as BalElementStateListener,L as ListenToElementStates}from"./element-states.decorator-B68ANq1p.js";import{i as includes,s as startsWith}from"./utils-C_qktPg7.js";import"./config.utils-B7jugjyM.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-B4k_dH6V.js";import"./listener-CClDIhvK.js";var DropdownAutoFillUtil=function(){function o(){var o=this;this.handleAutoFill=function(t){return __awaiter(o,void 0,void 0,(function(){var o,r;return __generator(this,(function(e){switch(e.label){case 0:stopEventBubbling(t);if(!this.isAutoFillAllowed())return[3,2];this.component.isAutoFilled=true;o=this.component.nativeEl.value;return[4,this.parseAutoFillValueWithOptions(o)];case 1:r=e.sent();if(r===undefined){this.component.isAutoFilled=false;return[2]}if(!areArraysEqual(r,this.component.rawValue)){this.component.valueUtil.updateRawValueBySelection(r,true)}e.label=2;case 2:return[2]}}))}))}}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.isAutoFillAllowed=function(){return!this.component.multiple};o.prototype.parseAutoFillValueWithOptions=function(o){return __awaiter(this,void 0,void 0,(function(){var t,r,e,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,this.component.listEl.getOptions()];case 1:t=i.sent();r=undefined;for(e=0;e<t.length;e++){n=t[e];if(n.value===o||n.label===o){return[2,[n.value]]}}return[2,r]}}))}))};return o}();var i18nBalDropdown={de:{clearable:"Löschen",open:"Öffnen",close:"Schließen"},en:{clearable:"clear",open:"Open",close:"Close"},fr:{clearable:"Effacer",open:"Ouvrir",close:"Fermer"},it:{clearable:"Cancellare",open:"Apri",close:"Chiudi"},nl:{clearable:"Wissen",open:"Open",close:"Sluiten"},es:{clearable:"Limpiar",open:"Abrir",close:"Cerrar"},pl:{clearable:"Wyczyść",open:"Otwórz",close:"Zamknij"},pt:{clearable:"Limpar",open:"Abrir",close:"Fechar"},sv:{clearable:"Rensa",open:"Öppna",close:"Stäng"},fi:{clearable:"Tyhjennä",open:"Avaa",close:"Sulje"}};var DropdownEventsUtil=function(){function o(){var o=this;this.handlePointerDown=function(){o.component.isKeyboardMode=false};this.handleKeydown=function(t){o.component.isKeyboardMode=FOCUS_KEYS.includes(t.key)}}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.handleFocus=function(o){this.component.hasFocus=true;this.component.balFocus.emit(o)};o.prototype.handleBlur=function(o){var t=this;if(!this.component.isExpanded){this.component.hasFocus=false;rIC((function(){return t.component.balBlur.emit(o)}))}};o.prototype.handleClick=function(o){if(!this.component.valueUtil.isDisabled()){if(this.component.chips){var t=o.target;var r=t.closest("bal-close");if(r){return}}if(this.component.clearable){var t=o.target;var e=t.closest(".bal-dropdown__clear");if(e){this.component.valueUtil.updateRawValueBySelection([]);return}}this.component.popupUtil.toggleList()}};o.prototype.handleOutsideClick=function(o){var t=this;var r;if(this.component.isExpanded){if(!this.component.el.contains(o.target)){this.component.isExpanded=false;(r=this.component.listEl)===null||r===void 0?void 0:r.resetFocus();this.component.hasFocus=false;rIC((function(){return t.component.balBlur.emit(o)}))}}};return o}();var DropdownFocusUtil=function(){function o(){}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.focusOptionByLabel=function(o,t){var r=this;if(t===void 0){t={}}this.component.labelToFocus=(this.component.labelToFocus+o).trim();if(this.component.labelToFocus.length>0){clearTimeout(this.keyHitTimeout);this.keyHitTimeout=setTimeout((function(){var o;(o=r.component.listEl)===null||o===void 0?void 0:o.focusByLabel(r.component.labelToFocus,t)}),100);clearTimeout(this.timeout);this.timeout=setTimeout((function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(o){this.component.labelToFocus="";return[2]}))}))}),1e3)}};return o}();var DropdownFormSubmitUtil=function(){function o(){}o.prototype.connectedCallback=function(o){this.component=o;this.component.initialValue=this.component.value};o.prototype.componentDidRender=function(){var o=this;if(this.component.selectEl){var t=this.component.selectEl.querySelectorAll("option");t.forEach((function(t){if(o.component.rawValue.includes(t.value)){t.selected=true}}))}};o.prototype.handle=function(o){var t=this;var r=o.target;if(r===null||r===void 0?void 0:r.contains(this.component.el)){if(this.resetHandlerTimer){clearTimeout(this.resetHandlerTimer)}this.resetHandlerTimer=setTimeout((function(){var o=t.component.valueUtil.parseValueString(t.component.initialValue);t.component.valueUtil.updateRawValueBySelection(o)}),0)}};return o}();var DropdownNativeSelect=function(o){var t=o.name,r=o.httpFormSubmit,e=o.multiple,n=o.required,i=o.disabled,a=o.rawValue,d=o.refSelectEl;var l=BEM.block("dropdown");return r?h("select",{class:Object.assign({},l.element("root").element("select").class()),"aria-hidden":"true",name:t,multiple:e,required:n,disabled:i,tabindex:-1,ref:d},a.map((function(o){return h("option",{key:o,value:o,selected:true},o)}))):""};var DropdownIcon=function(o){var t=o.size,r=o.theme,e=o.icon,n=o.language,i=o.loading,a=o.clearable,d=o.invalid,l=o.filled,s=o.expanded,c=o.disabled;var p=BEM.block("dropdown");if(i){return h("bal-spinner",{class:Object.assign({},p.element("rear").class()),small:true,variation:"circle",color:"white"})}else if(a&&l&&!c){return h("button",{title:i18nBalDropdown[n].clearable,type:"button",tabIndex:-1,class:Object.assign(Object.assign(Object.assign(Object.assign({},p.element("rear").class()),p.element("clear").class()),p.element("clear").modifier("invalid").class(d)),p.element("clear").modifier("theme-purple").class(r==="purple"))},h("bal-icon",{class:Object.assign({},p.element("rear").class()),name:r==="purple"?"close":"close-circle",size:t,color:r==="purple"?"primary":"grey"}))}else{return h("bal-icon",{class:Object.assign({},p.element("rear").class()),name:e,size:t,turn:s,color:c?"grey":d?"danger":"primary"})}};var DropdownInput=function(o){var t=o.inputId,r=o.httpFormSubmit,e=o.ariaForm,n=o.rawValue,i=o.autocomplete,a=o.required,d=o.disabled,l=o.readonly,s=o.placeholder,c=o.expanded,p=o.invalid,u=o.language,b=o.inputLabel,_=o.inheritedAttributes,f=o.refInputEl,v=o.onChange,w=o.onFocus,m=o.onBlur,g=o.onKeyDown;var x=BEM.block("dropdown");var y=function(){return h("input",Object.assign({id:e.controlId||"".concat(t,"-ctrl"),class:Object.assign({},x.element("root").element("input").class()),type:"text",size:1,inputmode:"none",tabindex:"0",autoComplete:i,value:n.join(","),required:a,disabled:d,readonly:l,placeholder:s,title:c?i18nBalDropdown[u].close:i18nBalDropdown[u].open,"aria-label":c?i18nBalDropdown[u].close:i18nBalDropdown[u].open,"aria-owns":"".concat(t,"-menu"),"aria-invalid":ariaBooleanToString(p),"aria-disabled":ariaBooleanToString(d||l),"aria-labelledby":e.labelId,"aria-describedby":e.messageId,"aria-haspopup":"listbox","data-native":true,"data-label":b,"data-value":n.join(","),ref:function(o){return f(o)},onChange:function(o){return v(o)},onFocus:function(o){return w(o)},onBlur:function(o){return m(o)},onKeyDown:function(o){return g(o)}},_))};if(r){return h(y,null)}return h("form",{novalidate:true},h(y,null))};var DropdownPopupUtil=function(){function o(){this.updatePanelPosition=function(o,t,r){return function(){o.computePosition(t,r,{placement:"bottom-start",middleware:[o.flip(),o.shift()]}).then((function(o){var t=o.x,e=o.y;Object.assign(r.style,{left:"".concat(t,"px"),top:"".concat(e,"px")})}))}}}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.toggleList=function(){if(!this.component.valueUtil.isDisabled()){if(this.component.isExpanded){this.collapseList()}else{this.expandList()}}};o.prototype.expandList=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){switch(r.label){case 0:if(!this.component.panelEl)return[3,2];return[4,balFloatingUi.load()];case 1:t=r.sent();this.component.panelCleanup=t.autoUpdate(this.component.el,this.component.panelEl,this.updatePanelPosition(t,this.component.el,this.component.panelEl));r.label=2;case 2:this.component.isExpanded=true;return[4,(o=this.component.listEl)===null||o===void 0?void 0:o.focusSelected()];case 3:r.sent();return[2]}}))}))};o.prototype.collapseList=function(){var o;this.component.isExpanded=false;(o=this.component.listEl)===null||o===void 0?void 0:o.resetFocus();if(this.component.panelCleanup){this.component.panelCleanup()}};return o}();var DropdownValueUtil=function(){function o(){}o.prototype.connectedCallback=function(o){this.component=o};o.prototype.componentDidLoad=function(){var o=this;setTimeout((function(){return o.valueChanged(o.component.value,undefined)}),0)};o.prototype.isDisabled=function(){return this.component.disabled||this.component.readonly};o.prototype.isFilled=function(){return this.component.rawValue&&this.component.rawValue.length>0};o.prototype.valueChanged=function(o,t){var r=typeof o;var e=typeof t;if(r!==e){this.updateRawValueByValueProp(o)}if(r==="string"&&o!==t){this.updateRawValueByValueProp(o)}if(Array.isArray(o)&&Array.isArray(t)&&!areArraysEqual(o,t)){this.updateRawValueByValueProp(o)}};o.prototype.updateRawValueBySelection=function(o,t){if(o===void 0){o=[]}if(t===void 0){t=false}this.component.isAutoFilled=t;this.updateRawValue(o);if(this.component.multiple){this.component.balChange.emit(this.component.rawValue)}else{this.component.balChange.emit(this.component.rawValue[0])}};o.prototype.parseValueString=function(o){if(o===void 0){o=[]}var t=[];if(!isNil(o)&&o!==""){if(Array.isArray(o)){t=__spreadArray([],o.filter((function(o){return!isNil(o)})),true)}else{if(o.split("").includes(",")){t=__spreadArray([],o.split(",").filter((function(o){return o})).map((function(o){return o.trim()})),true)}else{t=[o]}}}return t};o.prototype.updateRawValueByValueProp=function(o){if(o===void 0){o=[]}var t=this.parseValueString(o);this.updateRawValue(t)};o.prototype.updateRawValue=function(){return __awaiter(this,arguments,void 0,(function(o){if(o===void 0){o=[]}return __generator(this,(function(t){switch(t.label){case 0:this.component.rawValue=o;if(!this.component.listEl)return[3,2];return[4,this.component.listEl.updateSelected(this.component.rawValue)];case 1:t.sent();t.label=2;case 2:return[4,this.updateInputContent()];case 3:t.sent();return[2]}}))}))};o.prototype.removeOption=function(o){var t=this.component.rawValue.filter((function(t){return t!==o.value}));this.updateRawValueBySelection(t)};o.prototype.updateInputContent=function(){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(t){switch(t.label){case 0:return[4,waitAfterFramePaint()];case 1:t.sent();if(!this.component.listEl)return[3,3];o=this.component;return[4,this.component.listEl.getSelectedOptions(this.component.rawValue)];case 2:o.choices=t.sent();this.component.inputLabel=this.component.choices.map((function(o){return o.label.trim()})).sort().join(",");t.label=3;case 3:return[2]}}))}))};return o}();var DropdownValue=function(o){var t=o.inlineLabel,r=o.filled,e=o.chips,n=o.placeholder,i=o.choices,a=o.renderChip;var d=BEM.block("dropdown");if(r){if(e){return h("div",{class:Object.assign({},d.element("root").element("content").element("chips").class())},i.map((function(o){return a(o)})))}else{return(t&&"".concat(t,": "))+i.map((function(o){return o.label})).join(", ")}}else{return n}};var balDropdownCss=':root{--bal-dropdown-control-background:var(--bal-color-white);--bal-dropdown-control-background-hover:var(--bal-form-field-control-background-hover);--bal-dropdown-control-background-invalid:var(--bal-form-field-control-danger-background);--bal-dropdown-control-background-disabled:var(--bal-form-field-control-disabled-background);--bal-dropdown-control-input-background:var(--bal-color-grey-1);--bal-dropdown-control-native-input-background:transparent;--bal-dropdown-control-native-input-background-hover:transparent;--bal-dropdown-control-input-inverted-footer-background:transparent;--bal-dropdown-control-input-inverted-footer-background-hover:transparent;--bal-dropdown-control-input-multiple-background:transparent;--bal-dropdown-control-input-multiple-background-read-only-selection:transparent;--bal-dropdown-control-input-option-background:transparent;--bal-dropdown-control-input-option-background-selected:var(--bal-color-primary-1);--bal-dropdown-control-input-option-background-focused:var(--bal-color-grey-3);--bal-dropdown-control-input-option-background-hover:var(--bal-color-grey-3);--bal-dropdown-control-border-radius:var(--bal-form-field-control-radius);--bal-dropdown-popover-border-color:var(--bal-color-grey-2);--bal-dropdown-control-border-color:var(--bal-form-field-control-border-color);--bal-dropdown-control-border-color-focused:var(--bal-color-primary);--bal-dropdown-control-border-color-hover:var(--bal-form-field-control-border-color-hover);--bal-dropdown-control-border-color-invalid:var(--bal-form-field-control-danger-border-color);--bal-dropdown-control-border-color-disabled:var(--bal-form-field-control-disabled-border-color);--bal-dropdown-control-border-color-focus-within:var(--bal-color-primary);--bal-dropdown-option-border-top-color:var(--bal-color-grey-2);--bal-dropdown-popover-empty-text-color:var(--bal-form-field-control-color);--bal-dropdown-control-text-color:var(--bal-form-field-control-color);--bal-dropdown-control-text-color-focused:var(--bal-color-primary);--bal-dropdown-input-text-color-disabled:var(--bal-form-field-label-disabled-color);--bal-dropdown-control-inverted-footer-native-input-text-color:var(--bal-color-text-white);--bal-dropdown-option-content-label-text-color:var(--bal-form-field-control-color)}.bal-dropdown{display:block;position:relative;-ms-flex:1;flex:1;width:100%}.bal-dropdown__root{border-width:.125rem;border-style:solid;border-color:var(--bal-dropdown-control-border-color);border-radius:var(--bal-dropdown-control-border-radius);background:var(--bal-dropdown-control-background);font-weight:var(--bal-font-weight-regular);font-size:var(--bal-text-size-normal);font-family:var(--bal-font-family-text);color:var(--bal-dropdown-control-text-color);outline:none;-webkit-box-shadow:var(--bal-shadow-none);box-shadow:var(--bal-shadow-none);padding-right:1rem;height:auto;min-height:3rem;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:-ms-flexbox;display:flex;width:100%;text-align:left;gap:1rem;padding-left:calc(.75em - var(--bal-border-width-normal));padding-right:calc(.75em - var(--bal-border-width-normal));-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.bal-dropdown__root--autofill{background:#faffbd !important;background:light-dark(rgb(232, 240, 254), rgba(70, 90, 126, 0.4)) !important}.bal-dropdown__root>span{-ms-flex:1;flex:1;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bal-dropdown__root--focused{border-color:var(--bal-dropdown-control-border-color-focused)}.bal-dropdown__root--invalid{border-color:var(--bal-dropdown-control-border-color-invalid);background:var(--bal-dropdown-control-background-invalid)}.bal-dropdown__root--disabled{border-color:var(--bal-dropdown-control-border-color-disabled);background:var(--bal-dropdown-control-background-disabled)}.bal-dropdown__root__content--placeholder{color:var(--bal-form-field-control-placeholder-color)}.bal-dropdown__root__content--disabled{color:var(--bal-dropdown-input-text-color-disabled)}@media (hover: hover)and (pointer: fine){.bal-dropdown__root:not(.bal-dropdown__root--disabled):not(.bal-dropdown__root--invalid):not(.bal-dropdown__root--theme-purple):not(.bal-dropdown__root--theme-purple-expanded):hover{background:var(--bal-dropdown-control-background-hover)}}.bal-dropdown__root__content__chips{--bal-tag-size-small-font-size:var(--bal-text-size-normal);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--bal-space-xx-small);padding-top:var(--bal-space-x-small);padding-bottom:var(--bal-space-x-small)}.bal-dropdown__root__content__chips>bal-tag{z-index:1}.bal-dropdown__root__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:rgba(0,0,0,0);position:absolute;right:var(--bal-border-width-normal);left:var(--bal-border-width-normal);top:var(--bal-border-width-normal);bottom:var(--bal-border-width-normal);opacity:0;padding-left:calc(.75em - var(--bal-border-width-normal));padding-right:calc(.75em - var(--bal-border-width-normal));cursor:pointer}.bal-dropdown__root__input:disabled{cursor:default}.bal-dropdown__root__input:-webkit-autofill{opacity:1}.bal-dropdown__root__input:autofill{opacity:1}.bal-dropdown__root__input:-internal-autofill-selected{opacity:0}.bal-dropdown__root__select{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}.bal-dropdown__root--autofill .bal-dropdown__root__input{opacity:0}.bal-dropdown__list{display:none;visibility:hidden;opacity:0;width:100vw;position:absolute;top:0;left:0;will-change:left,top,opacity;background:var(--bal-color-white);border-radius:var(--bal-radius-normal);-webkit-box-shadow:var(--bal-shadow-normal);box-shadow:var(--bal-shadow-normal);z-index:var(--bal-z-index-popup)}@media screen and (min-width: 769px),print{.bal-dropdown__list{max-width:100vw;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;min-width:100%}}.bal-dropdown__list--expanded{display:block;visibility:visible;opacity:1}.bal-dropdown__native{bottom:0;left:0;position:absolute;opacity:0;pointer-events:none;width:100%}.bal-dropdown__clear{background:rgba(0,0,0,0);border:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer}.bal-dropdown__clear--theme-purple{height:2rem;width:2rem;border-top-right-radius:2px;border-bottom-right-radius:2px;margin-right:-10px}.bal-dropdown__clear--theme-purple::before{content:"";position:absolute;right:32px;background:var(--bal-color-white);width:2px;height:100%}.bal-dropdown__rear{z-index:1}.bal-dropdown__root--size-small{min-height:2rem}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--disabled) .bal-dropdown__root__content--placeholder{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded){border:none;background:var(--bal-color-background-grey-light)}@media (hover: hover)and (pointer: fine){.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover{background:var(--bal-color-purple-1)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__input,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner svg,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner g,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner path,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner circle{fill:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active{background:var(--bal-color-purple-2)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-dropdown__root__input,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner svg,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner g,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner path,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner circle{fill:var(--bal-color-text-primary)}}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded){border:none;background:var(--bal-color-purple-2)}@media (hover: hover)and (pointer: fine){.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover{background:var(--bal-color-purple-3)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__content{color:var(--bal-color-text-primary-pressed)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner svg,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner g,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner path,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):hover .bal-icon__inner circle{fill:var(--bal-color-text-primary-pressed)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active{background:var(--bal-color-purple-3)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner svg,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner g,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner path,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled):active .bal-icon__inner circle{fill:var(--bal-color-text-primary)}}.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled),.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active{border:none;background:var(--bal-color-purple-2)}.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-dropdown__root__content,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-dropdown__root__content,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-icon__inner svg,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-icon__inner g,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-icon__inner path,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled) .bal-icon__inner circle,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-icon__inner svg,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-icon__inner g,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-icon__inner path,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover .bal-icon__inner circle,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-icon__inner svg,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-icon__inner g,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-icon__inner path,.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active .bal-icon__inner circle{fill:var(--bal-color-text-primary)}.bal-dropdown__root--focused.bal-dropdown__root--theme-purple:before{content:"";border-width:var(--bal-border-width-normal);border-style:solid;border-color:var(--bal-focus-shadow-end-color);position:absolute;background:rgba(0,0,0,0);border-radius:var(--bal-radius-normal);top:-0.25rem;bottom:-0.25rem;left:-0.25rem;right:-0.25rem}.bal-dropdown__root__content--size-small{font-size:var(--bal-text-size-small);font-weight:var(--bal-font-weight-bold)}.bal-dropdown__clear--theme-purple{height:2rem;width:2rem;border-top-right-radius:2px;border-bottom-right-radius:2px;margin-right:-10px}.bal-dropdown__clear--theme-purple::before{content:"";position:absolute;right:32px;background:var(--bal-color-white);width:2px;height:100%}';var Dropdown=function(){function o(o){var t=this;registerInstance(this,o);this.balChange=createEvent(this,"balChange");this.balFocus=createEvent(this,"balFocus");this.balBlur=createEvent(this,"balBlur");this.inputId="bal-dropdown-".concat(balDropdownIds++);this.inheritedAttributes={};this.initialValue=[];this.nativeOptions=[];this.rawOptions=[];this.choices=[];this.rawValue=[];this.hasFocus=false;this.isExpanded=false;this.isAutoFilled=false;this.isKeyboardMode=false;this.inputLabel="";this.ariaForm=defaultBalAriaForm;this.language=defaultConfig.language;this.region=defaultConfig.region;this.httpFormSubmit=defaultConfig.httpFormSubmit;this.labelToFocus="";this.valueUtil=new DropdownValueUtil;this.eventsUtil=new DropdownEventsUtil;this.popupUtil=new DropdownPopupUtil;this.optionUtil=new DropdownOptionUtil;this.formSubmitUtil=new DropdownFormSubmitUtil;this.focusUtil=new DropdownFocusUtil;this.autoFillUtil=new DropdownAutoFillUtil;this.autocomplete="off";this.name=this.inputId;this.placeholder="";this.inlineLabel="";this.icon="caret-down";this.size="";this.theme="";this.disabled=false;this.readonly=false;this.multiple=false;this.chips=false;this.clearable=false;this.invalid=false;this.required=false;this.loading=false;this.filter="includes";this.contentHeight=262;this.inverted=false;this.options=[];this.value=[];this.hasConnected=false;this.listenToOptionChange=function(o){t.optionUtil.listenToOptionChange(o)};this.listenOnClickOutside=function(o){t.eventsUtil.handleOutsideClick(o)};this.resetHandler=function(o){t.formSubmitUtil.handle(o)};this.handleAutoFill=function(o){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.log("(handleAutoFill)",o,this.nativeEl.value);this.autoFillUtil.handleAutoFill(o);return[2]}))}))};this.handleKeyDown=function(o){var r,e,n,i,a;if(o&&o.key){if(t.isExpanded){if(isArrowDownKey(o)){stopEventBubbling(o);(r=t.listEl)===null||r===void 0?void 0:r.focusNext()}else if(isArrowUpKey(o)){stopEventBubbling(o);(e=t.listEl)===null||e===void 0?void 0:e.focusPrevious()}else if(o.key==="Home"||o.key==="PageUp"){stopEventBubbling(o);(n=t.listEl)===null||n===void 0?void 0:n.focusFirst()}else if(o.key==="End"||o.key==="PageDown"){stopEventBubbling(o);(i=t.listEl)===null||i===void 0?void 0:i.focusLast()}else if(isEnterKey(o)){stopEventBubbling(o);(a=t.listEl)===null||a===void 0?void 0:a.selectByFocus()}else if(o.key==="Tab"||isEscapeKey(o)){t.popupUtil.collapseList()}else if(o.key.length===1){t.focusUtil.focusOptionByLabel(o.key)}}else{if(isEnterKey(o)||isSpaceKey(o)){stopEventBubbling(o);t.popupUtil.expandList()}else if(o.key.length===1){t.focusUtil.focusOptionByLabel(o.key,{select:true})}}}else{if(t.isExpanded){t.popupUtil.collapseList()}}}}o.prototype.createLogger=function(o){this.log=o};o.prototype.optionChanged=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){this.optionUtil.optionChanged();return[2]}))}))};o.prototype.valueChanged=function(o,t){this.valueUtil.valueChanged(o,t)};o.prototype.connectedCallback=function(){if(!this.hasConnected){this.eventsUtil.connectedCallback(this);this.valueUtil.connectedCallback(this);this.popupUtil.connectedCallback(this);this.optionUtil.connectedCallback(this);this.formSubmitUtil.connectedCallback(this);this.focusUtil.connectedCallback(this);this.autoFillUtil.connectedCallback(this)}addEventListener(this.el,"balOptionChange",this.listenToOptionChange);if(balBrowser.hasDocument){addEventListener(document,"keydown",this.eventsUtil.handleKeydown);addEventListener(document,"touchstart",this.eventsUtil.handlePointerDown);addEventListener(document,"mousedown",this.eventsUtil.handlePointerDown);addEventListener(document,"click",this.listenOnClickOutside);addEventListener(document,"reset",this.resetHandler,{capture:true})}this.hasConnected=true};o.prototype.disconnectedCallback=function(){removeEventListener(this.el,"balOptionChange",this.listenToOptionChange);if(balBrowser.hasDocument){removeEventListener(document,"keydown",this.eventsUtil.handleKeydown);removeEventListener(document,"touchstart",this.eventsUtil.handlePointerDown);removeEventListener(document,"mousedown",this.eventsUtil.handlePointerDown);removeEventListener(document,"click",this.listenOnClickOutside);removeEventListener(document,"reset",this.resetHandler,{capture:true})}};o.prototype.componentWillRender=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:this.inheritedAttributes=inheritAttributes(this.el,["tabindex","data-hj-allow"]);return[4,this.optionUtil.componentWillRender()];case 1:o.sent();return[2]}}))}))};o.prototype.componentDidRender=function(){this.formSubmitUtil.componentDidRender()};o.prototype.componentDidLoad=function(){this.valueUtil.componentDidLoad()};o.prototype.configChanged=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.language=o.language;this.region=o.region;this.httpFormSubmit=o.httpFormSubmit;return[2]}))}))};o.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:if(!(this.nativeEl&&!this.valueUtil.isDisabled()))return[3,2];return[4,waitAfterIdleCallback()];case 1:o.sent();this.nativeEl.focus();o.label=2;case 2:return[2]}}))}))};o.prototype.getValue=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,this.rawValue]}))}))};o.prototype.clear=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){this.valueUtil.updateRawValueBySelection([]);return[2]}))}))};o.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:if(!(!this.valueUtil.isDisabled()&&this.panelEl))return[3,2];return[4,this.popupUtil.expandList()];case 1:o.sent();o.label=2;case 2:return[2]}}))}))};o.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:if(!(!this.valueUtil.isDisabled()&&this.panelEl))return[3,2];return[4,this.popupUtil.collapseList()];case 1:o.sent();o.label=2;case 2:return[2]}}))}))};o.prototype.select=function(o){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){t=this.valueUtil.parseValueString(o);this.valueUtil.updateRawValueBySelection(t);return[2]}))}))};o.prototype.setAriaForm=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.ariaForm=Object.assign({},o);return[2]}))}))};o.prototype.render=function(){var o=this;var t=BEM.block("dropdown");var r=this.valueUtil.isFilled();var e=this.size!=="";var n="size-".concat(this.size);var i=this.theme!=="";var a="theme-".concat(this.theme);var d=this.theme==="purple"?this.hasFocus&&this.isKeyboardMode:this.hasFocus;return h(Host,{key:"3fe05ba6190dabe5fb8c297f4809659f7c24aa74",class:Object.assign({},t.class()),tabindex:"-1",id:"".concat(this.inputId)},h("div",{key:"e0b038aa5b7ead381d271c5b7b04fd5bbaa3ea3b",class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t.element("root").class()),t.element("root").modifier("focused").class(d)),t.element("root").modifier("invalid").class(this.invalid)),t.element("root").modifier("disabled").class(this.valueUtil.isDisabled())),t.element("root").modifier("autofill").class(this.isAutoFilled)),t.element("root").modifier(n).class(e)),t.element("root").modifier(a).class(i)),t.element("root").modifier(a+"-filled").class(r&&i)),t.element("root").modifier(a+"-expanded").class(this.isExpanded&&i)),"data-testid":"bal-dropdown-trigger",onClick:function(t){return o.eventsUtil.handleClick(t)}},h("span",{key:"a3499a9e2abcaa3b363385c475c3dcd91ed1a371",class:Object.assign(Object.assign(Object.assign(Object.assign({},t.element("root").element("content").class()),t.element("root").element("content").modifier("disabled").class(this.valueUtil.isDisabled())),t.element("root").element("content").modifier("placeholder").class(!this.valueUtil.isFilled())),t.element("root").element("content").modifier(n).class(e))},h(DropdownValue,{key:"8ffc980c91386038c4ee9b9e6673a25a3609d674",filled:this.valueUtil.isFilled(),inlineLabel:this.inlineLabel,chips:this.chips,placeholder:this.placeholder,choices:this.choices,renderChip:function(t){return h("bal-tag",{key:t.value,"data-testid":"bal-dropdown-chip",size:"small",invalid:o.invalid,disabled:o.disabled||o.readonly,closable:!(o.disabled||o.readonly),onBalCloseClick:function(){return o.valueUtil.removeOption(t)}},t.label)}})),h(DropdownInput,{key:"9a97fc39a821d5dcca32eba522ae29e4aa6eedc0",inputId:this.inputId,httpFormSubmit:this.httpFormSubmit,ariaForm:this.ariaForm,rawValue:this.rawValue,autocomplete:this.autocomplete,required:this.required,disabled:this.disabled,readonly:this.readonly,placeholder:this.placeholder,expanded:this.isExpanded,invalid:this.invalid,language:this.language,inputLabel:this.inputLabel,inheritedAttributes:this.inheritedAttributes,refInputEl:function(t){return o.nativeEl=t},onChange:function(t){return o.handleAutoFill(t)},onFocus:function(t){return o.eventsUtil.handleFocus(t)},onBlur:function(t){return o.eventsUtil.handleBlur(t)},onKeyDown:function(t){return o.handleKeyDown(t)}}),h(DropdownNativeSelect,{key:"2a33a8ac7f336889197137fc741ed8a4a107fceb",name:this.name,httpFormSubmit:this.httpFormSubmit,multiple:this.multiple,required:this.required,disabled:this.valueUtil.isDisabled(),rawValue:this.rawValue,refSelectEl:function(t){return o.selectEl=t}}),h(DropdownIcon,{key:"d0f6958fb47ad7f6d73d4f98482cb2102c344f20",icon:this.icon,size:this.size,theme:this.theme,language:this.language,loading:this.loading,clearable:this.clearable,invalid:this.invalid,expanded:this.isExpanded,filled:r,disabled:this.valueUtil.isDisabled()})),h("div",{key:"29e98d1f54ffb6ee913bd682d6531d45997fc1d0",id:"".concat(this.inputId,"-menu"),class:Object.assign(Object.assign({},t.element("list").class()),t.element("list").modifier("expanded").class(this.isExpanded)),ref:function(t){return o.panelEl=t}},h("bal-option-list",{key:"4e6fa69f9d9859208f83dd7bc86c17fc75d5eb60",multiple:this.multiple,disabled:this.valueUtil.isDisabled(),filter:this.filter,required:this.required,contentHeight:this.contentHeight,ref:function(t){return o.listEl=t}},h("slot",{key:"1c169dc692632671f62410b2dadcbbc10b0fe36a"}),this.optionUtil.hasPropOptions()?this.rawOptions.map((function(o){return h("bal-option",{key:o.value,value:o.value,label:o.label,disabled:o.disabled,multiline:o.multiline,invalid:o.invalid,hidden:o.hidden,selected:o.selected,focused:o.focused},o.label)})):"")))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{options:["optionChanged"],value:["valueChanged"]}},enumerable:false,configurable:true});return o}();__decorate([Logger("bal-dropdown"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Dropdown.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Dropdown.prototype,"configChanged",null);var balDropdownIds=0;Dropdown.style=balDropdownCss;var balOptionCss=":root{--bal-option-padding-x:var(--bal-space-small);--bal-option-min-height:1.5rem;--bal-option-background:var(--bal-color-white);--bal-option-background-hovered:var(--bal-color-grey-3);--bal-option-background-selected:var(--bal-color-primary-1);--bal-option-background-selected-hovered:#dddfeb;--bal-option-background-invalid:var(--bal-color-danger-1);--bal-option-background-invalid-hovered:#fbe0de;--bal-option-border-width:var(--bal-border-width-normal);--bal-option-border-color:var(--bal-color-grey-2);--bal-option-font-family:var(--bal-font-family-text);--bal-option-font-weight:var(--bal-font-weight-regular);--bal-option-line-height:1.125rem;--bal-option-text-hovered:var(--bal-color-text-primary-hovered);--bal-option-text-pressed:var(--bal-color-text-primary-pressed);--bal-option-text-disabled:var(--bal-color-text-grey-light)}.bal-option{font-size:16px;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:block;list-style:none;cursor:pointer;border-bottom-width:var(--bal-option-border-width);border-bottom-color:var(--bal-option-border-color);border-bottom-style:solid;background:var(--bal-option-background);padding-left:var(--bal-option-padding-x);padding-right:var(--bal-option-padding-x);min-height:var(--bal-option-min-height)}.bal-option>bal-stack{min-height:var(--bal-option-min-height)}.bal-option:last-child{border-bottom:none}.bal-option::-moz-focus-inner{border:none}.bal-option--hidden{display:none;visibility:hidden}.bal-option__inner{font-family:var(--bal-option-font-family);font-weight:var(--bal-option-font-weight);line-height:var(--bal-option-line-height);word-break:break-word;white-space:normal;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-ms-flex:1;flex:1}.bal-option__inner--multiline{white-space:normal}.bal-option--focused{background:var(--bal-option-background-hovered)}@media (hover: hover)and (pointer: fine){.bal-option:hover{background:var(--bal-option-background-hovered);color:var(--bal-option-text-hovered)}}.bal-option:active{background:var(--bal-option-background-hovered);color:var(--bal-option-text-pressed)}.bal-option--selected{background:var(--bal-option-background-selected)}@media (hover: hover)and (pointer: fine){.bal-option--selected:hover{background:var(--bal-option-background-selected-hovered)}}.bal-option--selected:active{background:var(--bal-option-background-selected-hovered)}.bal-option--selected .bal-option__inner{font-weight:var(--bal-font-weight-bold)}.bal-option--selected.bal-option--focused{background:var(--bal-option-background-selected-hovered)}.bal-option--selected.bal-option--focused .bal-option__inner{font-weight:var(--bal-font-weight-bold)}.bal-option--invalid{background:var(--bal-option-background-invalid)}@media (hover: hover)and (pointer: fine){.bal-option--invalid:hover{background:var(--bal-option-background-invalid-hovered)}}.bal-option--invalid:active{background:var(--bal-option-background-invalid-hovered)}.bal-option--invalid.bal-option--focused{background:var(--bal-option-background-invalid-hovered)}.bal-option--invalid .bal-option__inner{color:var(--bal-color-text-danger-hovered)}@media (hover: hover)and (pointer: fine){.bal-option--invalid:hover .bal-option__inner{color:var(--bal-color-text-danger-hovered)}}.bal-option--invalid:active .bal-option__inner{color:var(--bal-color-text-danger-pressed)}.bal-option--disabled,.bal-option--disabled.bal-option--focused{background:var(--bal-option-background) !important;color:var(--bal-option-text-disabled) !important;cursor:default !important}.bal-option--disabled:hover,.bal-option--disabled.bal-option--focused:hover{background:var(--bal-option-background) !important}.bal-option{--bal-check-size:1.25rem}";var Option=function(){function o(o){var t=this;registerInstance(this,o);this.balOptionChange=createEvent(this,"balOptionChange");this.balOptionFocus=createEvent(this,"balOptionFocus");this.inputId="bal-option-".concat(balOptionIds++);this.checkbox=false;this.interactionState=BalElementStateListener.DefaultState;this.label="";this.value="";this.disabled=false;this.multiline=false;this.invalid=false;this.selected=false;this.focused=false;this.hidden=false;this.onClick=function(o){var r=t.el.closest("bal-option-list");if(t.disabled||r&&r.disabled){stopEventBubbling(o)}else{if(r&&r.required&&!r.multiple){if(!t.selected){t.select(true)}}else{t.select(!t.selected)}}}}o.prototype.createLogger=function(o){this.log=o};o.prototype.componentWillRender=function(){if(this.el){var o=this.el.closest("bal-option-list");if(o){this.checkbox=!!o.multiple}}};o.prototype.listenToMouseEnter=function(){var o=this,t=o.label,r=o.value,e=o.selected,n=o.disabled,i=o.hidden;if(!i&&!n){this.balOptionFocus.emit({label:t,value:r,selected:e})}};o.prototype.elementStateListener=function(o){this.interactionChildElements.forEach((function(t){t.hovered=o.hovered;t.pressed=o.pressed}))};o.prototype.select=function(){return __awaiter(this,arguments,void 0,(function(o){var t,r,e;if(o===void 0){o=true}return __generator(this,(function(n){this.selected=o;t=this,r=t.label,e=t.value;this.balOptionChange.emit({label:r,value:e,selected:o});return[2]}))}))};Object.defineProperty(o.prototype,"interactionChildElements",{get:function(){return Array.from(this.el.querySelectorAll("bal-check"))},enumerable:false,configurable:true});o.prototype.render=function(){var o=BEM.block("option");return h(Host,{key:"dca805aa021ad35c2ea4153008a8a5ba4f37931c",class:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o.class()),o.modifier("checkbox").class(this.checkbox)),o.modifier("focused").class(this.focused)),o.modifier("invalid").class(this.invalid)),o.modifier("selected").class(this.selected)),o.modifier("disabled").class(this.disabled)),o.modifier("hidden").class(this.hidden)),role:"option",id:this.inputId,"data-value":this.value,"data-label":this.label,"aria-label":this.label,"aria-hidden":ariaBooleanToString(this.hidden),"aria-selected":ariaBooleanToString(this.selected),"aria-checked":ariaBooleanToString(this.selected),"aria-disabled":ariaBooleanToString(this.disabled),"aria-invalid":ariaBooleanToString(this.invalid),tabIndex:-1,onClick:this.onClick},h("bal-stack",{key:"cfcf978a82159a6e7ad2dcddccdb40dd6b9f74a4",py:"small",space:"x-small"},this.checkbox?h("bal-check",{checked:this.selected,disabled:this.disabled,invalid:this.invalid,hovered:this.interactionState.hovered,pressed:this.interactionState.pressed,tabindex:-1}):"",h("div",{key:"e92a9c019432d29f6153371daca316c8136c75e9",class:Object.assign(Object.assign({},o.element("inner").class()),o.element("inner").modifier("multiline").class(this.multiline))},h("slot",{key:"639a99194ed6e86787e9eb2b3adc993161d58a07"})),this.selected&&!this.checkbox?h("bal-icon",{name:"check",size:"small",color:this.disabled?"grey":this.invalid?"danger":"primary"}):""))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return o}();__decorate([Logger("bal-option"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Option.prototype,"createLogger",null);__decorate([ListenToElementStates(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],Option.prototype,"elementStateListener",null);var balOptionIds=0;Option.style=balOptionCss;var balOptionListCss=".bal-option-list{display:block;position:relative;width:100%;list-style:none;margin:0;outline:0;max-height:var(--bal-option-list-max-height);border-radius:var(--bal-radius-normal);overflow:hidden auto}";var OptionList=function(){function o(o){registerInstance(this,o);this.inputId="bal-option-list-".concat(balOptionListIds++);this.inheritAttributes={};this.ariaForm=defaultBalAriaForm;this.multiple=false;this.disabled=false;this.required=false;this.focusIndex=-1;this.filter="includes";this.contentHeight=262}o.prototype.createLogger=function(o){this.log=o};o.prototype.contentHeightChanged=function(o){if(o===undefined){this.el.style.removeProperty("--bal-option-list-max-height")}else{this.el.style.setProperty("--bal-option-list-max-height","".concat(o,"px"))}};o.prototype.componentDidLoad=function(){this.contentHeightChanged(this.contentHeight)};o.prototype.componentWillRender=function(){this.inheritAttributes=inheritAttributes(this.el,["aria-multiselectable","aria-labelledby"])};o.prototype.listenToMouseEnter=function(o){var t=this.options;var r=this.getOptionIndex(t,o.detail.value);if(r!==undefined){this.updateFocus(t,r)}};o.prototype.listenToOptionChange=function(o){var t=o.detail;if(!this.multiple){this.options.filter((function(o){return o.value!==t.value})).forEach((function(o){return o.selected=false}))}};o.prototype.focusSelected=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){switch(r.label){case 0:o=this.options;t=this.getSelectedOptionIndex(o);if(!(t>0))return[3,2];this.updateFocus(o,t);return[4,waitAfterFramePaint()];case 1:r.sent();return[2,t];case 2:return[4,this.focusFirst()];case 3:return[2,r.sent()]}}))}))};o.prototype.focusFirst=function(){return __awaiter(this,void 0,void 0,(function(){var o,t,r;return __generator(this,(function(e){switch(e.label){case 0:o=this.options;t=this.getFirstOptionIndex(o);this.updateFocus(o,t);r=o[t];this.updateScrollTopPosition(r);return[4,waitAfterFramePaint()];case 1:e.sent();return[2,t]}}))}))};o.prototype.focusLast=function(){return __awaiter(this,void 0,void 0,(function(){var o,t,r;return __generator(this,(function(e){switch(e.label){case 0:o=this.options;t=this.getLastOptionIndex(o);this.updateFocus(o,t);r=o[t];this.updateScrollBottomPosition(r);return[4,waitAfterFramePaint()];case 1:e.sent();return[2,t]}}))}))};o.prototype.focusNext=function(){return __awaiter(this,void 0,void 0,(function(){var o,t,r;return __generator(this,(function(e){switch(e.label){case 0:o=this.options;t=this.getNextOptionIndex(o);this.updateFocus(o,t);r=o[t];this.updateScrollBottomPosition(r);return[4,waitAfterFramePaint()];case 1:e.sent();return[2,t]}}))}))};o.prototype.focusPrevious=function(){return __awaiter(this,void 0,void 0,(function(){var o,t,r;return __generator(this,(function(e){switch(e.label){case 0:o=this.options;t=this.getPreviousOptionIndex(o);this.updateFocus(o,t);r=o[t];this.updateScrollTopPosition(r);return[4,waitAfterFramePaint()];case 1:e.sent();return[2,t]}}))}))};o.prototype.focusByLabel=function(o,t){return __awaiter(this,void 0,void 0,(function(){var r,e,n;return __generator(this,(function(i){switch(i.label){case 0:r=this.options;e=this.getOptionIndexByLabel(r,o);this.updateFocus(r,e);n=r[e];this.updateScrollTopPosition(n);return[4,waitAfterFramePaint()];case 1:i.sent();if(!t.select)return[3,3];return[4,n.select()];case 2:i.sent();i.label=3;case 3:return[2,e]}}))}))};o.prototype.filterByContent=function(o){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:t=this.allOptions;this.filterOptions(t,o);return[4,waitAfterFramePaint()];case 1:r.sent();return[2,this.focusFirst()]}}))}))};o.prototype.resetHidden=function(){return __awaiter(this,arguments,void 0,(function(o){if(o===void 0){o=false}return __generator(this,(function(t){switch(t.label){case 0:this.options.forEach((function(t){return t.hidden=o}));return[4,waitAfterFramePaint()];case 1:t.sent();this.resetFocus();return[2]}}))}))};o.prototype.resetSelected=function(){return __awaiter(this,arguments,void 0,(function(o){if(o===void 0){o=false}return __generator(this,(function(t){switch(t.label){case 0:this.options.forEach((function(t){return t.selected=o}));return[4,waitAfterFramePaint()];case 1:t.sent();return[2]}}))}))};o.prototype.updateSelected=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:this.options.forEach((function(t){return t.selected=o.includes(t.value)}));return[4,waitAfterFramePaint()];case 1:t.sent();return[2]}}))}))};o.prototype.resetFocus=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){switch(r.label){case 0:o=this.options;t=-1;this.updateFocus(o,t);this.scrollTo(0);return[4,waitAfterFramePaint()];case 1:r.sent();return[2,t]}}))}))};o.prototype.getSelectedValues=function(){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(t){o=this.options;return[2,o.filter((function(o){return o.selected})).map((function(o){return o.value}))]}))}))};o.prototype.getSelectedOptions=function(o){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){t=this.options;if(o&&o.length>0){return[2,t.filter((function(t){return o.includes(t.value)})).map((function(o){return o}))]}return[2,t.filter((function(o){return o.selected})).map((function(o){return o}))]}))}))};o.prototype.getValues=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,this.options.map((function(o){return o.value}))]}))}))};o.prototype.getLabels=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,this.options.map((function(o){return o.label}))]}))}))};o.prototype.getOptions=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,this.options.filter((function(o){return!o.disabled||!o.hidden}))]}))}))};o.prototype.selectByFocus=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){o=this.options;t=o[this.focusIndex];if(t){if(this.multiple){t.select(!t.selected)}else{t.select(true)}}return[2]}))}))};o.prototype.setAriaForm=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.ariaForm=Object.assign({},o);return[2]}))}))};Object.defineProperty(o.prototype,"options",{get:function(){return Array.from(this.el.querySelectorAll("bal-option")).filter((function(o){return!o.hidden}))},enumerable:false,configurable:true});Object.defineProperty(o.prototype,"allOptions",{get:function(){return Array.from(this.el.querySelectorAll("bal-option"))},enumerable:false,configurable:true});o.prototype.filterOptions=function(o,t){var r=[];var e=this.filter==="includes"?includes:startsWith;for(var n=0;n<o.length;n++){var i=o[n];var a=i.textContent||"";if(e(a,t)){r.push(i);i.hidden=false}else{i.hidden=true}}return r};o.prototype.isOptionVisible=function(o){var t=this.el.clientHeight;var r=this.el.scrollTop;var e=r+t;var n=r<=o.offsetTop&&o.offsetTop+o.clientHeight<=e;return n};o.prototype.updateScrollTopPosition=function(o){if(o){var t=this.isOptionVisible(o);if(!t){this.scrollTo(this.getScrollTopForTopPosition(o))}}};o.prototype.updateScrollBottomPosition=function(o){if(o){var t=this.isOptionVisible(o);if(!t){this.scrollTo(this.getScrollTopForBottomPosition(o))}}};o.prototype.getScrollTopForTopPosition=function(o){var t=o.offsetTop;var r=t;if(r<0){return 0}return r};o.prototype.getScrollTopForBottomPosition=function(o){var t=this.el.clientHeight;var r=o.offsetTop+o.clientHeight;var e=r-t;if(e<0){return 0}return e};o.prototype.scrollTo=function(o){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){if(o!==undefined&&o!==null){if(this.focusRaf!==undefined){cancelAnimationFrame(this.focusRaf)}this.focusRaf=raf((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.el.scrollTop=o;return[2]}))}))}))}return[2]}))}))};o.prototype.updateFocus=function(o,t){this.focusIndex=t;for(var r=0;r<o.length;r++){var e=o[r];e.focused=r===t}};o.prototype.getOptionIndex=function(o,t){for(var r=0;r<o.length;r++){var e=o[r];if(e.value===t){return r}}return undefined};o.prototype.getSelectedOptionIndex=function(o){for(var t=0;t<o.length;t++){var r=o[t];if(r.selected&&!r.hidden){return t}}return this.focusIndex};o.prototype.getFirstOptionIndex=function(o){for(var t=0;t<o.length;t++){var r=o[t];if(!r.disabled&&!r.hidden){return t}}return this.focusIndex};o.prototype.getNextOptionIndex=function(o,t){if(t===void 0){t=this.focusIndex}if(t<0){return this.getFirstOptionIndex(o)}var r=this.getLength(o);var e=t;if(t<r){e=t+1;if(o[e].disabled){return this.getNextOptionIndex(o,e)}}return e};o.prototype.getPreviousOptionIndex=function(o,t){if(t===void 0){t=this.focusIndex}var r=this.getFirstOptionIndex(o);if(t<=r){return r}var e=t;e=t-1;if(o[e].disabled){return this.getPreviousOptionIndex(o,e)}return e};o.prototype.getLastOptionIndex=function(o){for(var t=o.length-1;t>=0;t--){var r=o[t];if(!r.disabled){return t}}return this.focusIndex};o.prototype.getOptionIndexByLabel=function(o,t){if(t===undefined||t===""){return this.focusIndex}var r=o.find((function(o){return startsWith(o.label||"",t)}));if(!isNil(r)&&r.id){return o.indexOf(r)}return this.focusIndex};o.prototype.getLength=function(o){var t=o.map((function(o,t){return o.disabled?0:t}));var r=Math.max.apply(Math,t);return r};o.prototype.render=function(){var o=BEM.block("option-list");var t=this.labelledby||this.ariaForm.labelId;return h(Host,{key:"bcb9ee55aefe68beac309225d1127524f327f9da",class:Object.assign({},o.class()),id:this.inputId},h("div",Object.assign({key:"ac14c8a5615c6497569ca0aa8436dda3924babf6",role:"listbox","aria-labelledby":t,"aria-disabled":ariaBooleanToString(this.disabled),class:Object.assign({},o.element("container").class())},this.inheritAttributes),h("slot",{key:"869656387e53fd832b45141cb3b5b89684e61727"})))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{contentHeight:["contentHeightChanged"]}},enumerable:false,configurable:true});return o}();__decorate([Logger("bal-option-list"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],OptionList.prototype,"createLogger",null);var balOptionListIds=0;OptionList.style=balOptionListCss;export{Dropdown as bal_dropdown,Option as bal_option,OptionList as bal_option_list};
@@ -1 +1 @@
1
- import{__awaiter,__generator,__spreadArray}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{d as defaultBalAriaForm}from"./form-FCLKfv6B.js";import{d as deepReady,a as waitAfterFramePaint}from"./helpers-BNj87EbG.js";import{L as ListenToMutation}from"./mutation.decorator-DhVeNnnY.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{b as balBreakpoints}from"./breakpoints.subject-Iyftu-nV.js";import{L as ListenToBreakpoints}from"./breakpoints.decorator-C-DmFJbn.js";import"./browser-B1u-Mq75.js";import"./config.utils-B7jugjyM.js";import"./listener-CClDIhvK.js";import"./device-TtMibDFL.js";import"./tokens.esm-C9EQ_6RZ.js";var balFieldCss=":root{--bal-field-label-horizontal-width:33.3333%;--bal-field-label-column-gap:.5rem}.bal-field,.bal-field-label,.bal-field-control,.bal-field-message,.bal-field-hint{display:block;position:relative;font-family:var(--bal-font-family-text)}.bal-field-label{display:inline}.bal-field-label~.bal-field-control{margin-top:.25rem}.bal-field-hint{display:inline-block;margin-left:.25rem;height:1rem;width:1rem}.bal-field-hint__hint{position:absolute;top:2px;left:0}.bal-field-message{line-height:var(--bal-line-height-normal)}.bal-field-hidden{display:none !important;visibility:hidden !important}.bal-field-control{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;gap:.5rem}.bal-field-control .bal-input{-ms-flex:1;flex:1}@media screen and (max-width: 768px){.bal-field-control--expanded-on-mobile{-ms-flex-direction:column;flex-direction:column}.bal-field-control--expanded-on-mobile .bal-button,.bal-field-control--expanded-on-mobile .bal-button .button{width:100%}}.bal-field-message{margin-top:0 !important}.bal-field-control+.bal-field-message{min-height:1.375rem;line-height:1.375rem}.bal-field-control:not(:has(+.bal-field-message)){padding-bottom:1.375rem}.bal-field--horizontal{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:var(--bal-field-label-column-gap);-moz-column-gap:var(--bal-field-label-column-gap);column-gap:var(--bal-field-label-column-gap);-ms-flex-align:center;align-items:center}.bal-field--horizontal .bal-field-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-width:var(--bal-field-label-horizontal-width);max-width:var(--bal-field-label-horizontal-width);-ms-flex-pack:end;justify-content:flex-end;text-align:right;margin-bottom:0}.bal-field--horizontal .bal-field-control{-ms-flex:1;flex:1;padding-bottom:0;-ms-flex-item-align:end;align-self:flex-end}.bal-field--horizontal .bal-field-message{-ms-flex-preferred-size:100%;flex-basis:100%;margin-top:0 !important;margin-left:calc(var(--bal-field-label-horizontal-width) + var(--bal-field-label-column-gap))}.bal-field--horizontal .bal-field-hint{margin-left:0}.bal-field--horizontal .bal-field-hint .bal-hint{top:0}.bal-field--horizontal .bal-field-hint~.bal-field-message{margin-left:calc(var(--bal-field-label-horizontal-width) + var(--bal-field-label-column-gap)*2 + 1.125rem)}.bal-field--horizontal .bal-field-label~.bal-field-control{margin-top:0}";var Field=function(){function e(e){var i=this;registerInstance(this,e);this.balFormControlDidLoad=createEvent(this,"balFormControlDidLoad");this.fieldId="bal-field-".concat(FieldIds++);this.formControlElement=["bal-field-control"];this.inputElements=["bal-input","bal-number-input","bal-textarea","bal-select","bal-checkbox","bal-radio","bal-input-group","bal-date","bal-input-date","bal-input-stepper","bal-input-slider","bal-file-upload","bal-dropdown","bal-segment"];this.formElements=__spreadArray(__spreadArray([],this.formControlElement,true),["bal-field-label","bal-field-message"],false);this.required=undefined;this.horizontal=false;this.invalid=undefined;this.valid=false;this.disabled=undefined;this.readonly=undefined;this.loading=undefined;this.isDirectChild=function(e){if(!e){return false}var t=e.parentElement;if(!t){return false}if(t.nodeName.toLowerCase()==="bal-field"&&t!==i.el){return false}if(t===i.el){return true}return i.isDirectChild(t)};this.isVisible=function(e){if(!e){return false}return e.ariaHidden!=="true"};this.findDirectChild=function(e){var t=i.el.querySelector(e);var l=i.isDirectChild(t);if(l){if(i.isVisible(t)){return t}}return undefined};this.findDirectChildren=function(e){return e.map((function(e){return Array.from(i.el.querySelectorAll(e)).filter(i.isDirectChild).filter(i.isVisible)})).flat()};this.mutationObserverActive=true}e.prototype.requiredHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),["bal-field-label"],false),"required")};e.prototype.invalidHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formElements,true),"invalid")};e.prototype.validHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formElements,true),"valid")};e.prototype.disabledHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formElements,true),"disabled")};e.prototype.readonlyHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formElements,true),"readonly")};e.prototype.loadingHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formControlElement,true),"loading")};e.prototype.connectedCallback=function(){this.triggerAllHandlers()};e.prototype.componentWillLoad=function(){this.triggerAllHandlers()};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.syncAriaAttributes()];case 1:e.sent();return[2]}}))}))};e.prototype.syncAriaAttributes=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,t,l,a,n;return __generator(this,(function(r){switch(r.label){case 0:return[4,deepReady(this.el)];case 1:r.sent();return[4,waitAfterFramePaint()];case 2:r.sent();e=this.findDirectChild("bal-field-label bal-label");i=this.findDirectChild("bal-field-message");t=this.findDirectChildren(["bal-field-control bal-input","bal-field-control bal-select","bal-field-control bal-input-date","bal-field-control bal-dropdown","bal-field-control bal-checkbox","bal-field-control bal-radio","bal-field-control bal-segment","bal-field-control bal-segment-item","bal-field-control bal-checkbox-group","bal-field-control bal-radio-group","bal-field-control bal-number-input","bal-field-control bal-time-input","bal-field-control bal-input-slider","bal-field-control bal-input-stepper","bal-field-control bal-textarea","bal-field-control bal-file-upload"]);l=Object.assign({},defaultBalAriaForm);if(e){l.labelId="".concat(this.fieldId,"-lbl")}if(i){l.messageId="".concat(this.fieldId,"-msg")}a=0;r.label=3;case 3:if(!(a<t.length))return[3,10];n=t[a];if(!(a===0))return[3,7];l.controlId="".concat(this.fieldId,"-ctrl");return[4,e===null||e===void 0?void 0:e.setAriaForm(l)];case 4:r.sent();return[4,i===null||i===void 0?void 0:i.setAriaForm(l)];case 5:r.sent();return[4,n===null||n===void 0?void 0:n.setAriaForm(l)];case 6:r.sent();return[3,9];case 7:l.controlId="".concat(this.fieldId,"-ctrl-").concat(a);return[4,n===null||n===void 0?void 0:n.setAriaForm(l)];case 8:r.sent();r.label=9;case 9:a++;return[3,3];case 10:return[2]}}))}))};e.prototype.mutationListener=function(){this.triggerAllHandlers();this.syncAriaAttributes()};e.prototype.triggerAllHandlers=function(){this.requiredHandler();this.invalidHandler();this.validHandler();this.readonlyHandler();this.disabledHandler();this.loadingHandler()};e.prototype.updateProps=function(e,i){var t=this[i];if(t!==undefined){this.notifyComponents(e,(function(e){return e[i]=t}))}};e.prototype.notifyComponents=function(e,i){var t=this.el.querySelectorAll(e.join(", "));t.forEach((function(e){return i(e)}))};e.prototype.render=function(){return h(Host,{key:"ef05b294a516d40c5089d051feeb46715f581bc1",id:this.fieldId,class:{"bal-field":true,field:true,"bal-field--invalid":this.invalid===true,"bal-field--horizontal":this.horizontal===true}},h("slot",{key:"5710d7fd141b21d699004d7982d5d5bb7238cd94"}),h("span",{key:"e1b36343cdcb60960bcdac4d938c946f40041334",class:"bal-field-hidden"}))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{required:["requiredHandler"],invalid:["invalidHandler"],valid:["validHandler"],disabled:["disabledHandler"],readonly:["readonlyHandler"],loading:["loadingHandler"]}},enumerable:false,configurable:true});return e}();__decorate([ListenToMutation({subtree:false,waitAfterFramePrint:true}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],Field.prototype,"mutationListener",null);var FieldIds=0;Field.style=balFieldCss;var FieldControl=function(){function e(e){registerInstance(this,e);this.iconRight="";this.iconLeft="";this.expandedOnMobile=undefined;this.loading=false}Object.defineProperty(e.prototype,"buildIconLeftTemplate",{get:function(){if(this.iconLeft){return h("bal-icon",{name:this.iconLeft,color:"info",class:"is-left",size:"small"})}return""},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"buildIconRightTemplate",{get:function(){if(this.iconRight){return h("bal-icon",{name:this.iconRight,color:"info",class:"is-right",size:"small"})}return""},enumerable:false,configurable:true});e.prototype.render=function(){return h(Host,{key:"f2dbde868506b54d5b5e2fc14b5c29c417d42891",class:{"bal-field-control":true,control:true,"has-icons-left":!!this.iconLeft,"has-icons-right":!!this.iconRight,"is-loading":this.loading,"bal-field-control--expanded-on-mobile":!!this.expandedOnMobile}},h("slot",{key:"274cd16bccefc825d85e4b1222da7c523a1aa937"}),this.buildIconLeftTemplate,this.buildIconRightTemplate)};return e}();var FieldHint=function(){function e(e){registerInstance(this,e);this.hideTitleOnDesktop=false;this.subject="";this.closeLabel="Close";this.small=false;this.isDesktop=balBreakpoints.isDesktop}e.prototype.breakpointListener=function(e){this.isDesktop=e.desktop};e.prototype.render=function(){var e=BEM.block("field-hint");return h(Host,{key:"90dbf0da0a0c7ec498538721135e2fdefc4ac238",class:Object.assign({},e.class())},h("bal-hint",{key:"1976d07de449aa8b2897a375f61953f0c705e4ae",class:Object.assign({},e.element("hint").class()),"data-testid":"bal-field-hint",closeLabel:this.closeLabel,small:this.small},this.subject&&!(this.hideTitleOnDesktop&&this.isDesktop)?h("bal-hint-title",null,this.subject):"",h("bal-hint-text",{key:"ae2b48186e4f4c1adbfe7b3ed57a798a55a4cad0"},h("slot",{key:"e4a33e9e14ab86a15e78321fbd9f7325e0420ec5"}))))};return e}();__decorate([ListenToBreakpoints(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],FieldHint.prototype,"breakpointListener",null);var FieldLabel=function(){function e(e){registerInstance(this,e);this.htmlFor=undefined;this.required=true;this.valid=undefined;this.invalid=undefined;this.disabled=undefined;this.readonly=undefined;this.size="small";this.weight="bold"}e.prototype.componentDidLoad=function(){if(this.element){this.parentBalFieldElement=this.element.closest("bal-field");if(this.parentBalFieldElement){this.parentBalFieldElement.classList.add("has-label")}}};e.prototype.disconnectedCallback=function(){if(this.parentBalFieldElement){this.parentBalFieldElement.classList.remove("has-label")}};e.prototype.render=function(){return h(Host,{key:"6685a5711aba2152b975fe49fe114a9edb400679",class:"bal-field-label"},h("bal-label",{key:"f677ab02ba144832c6304dc99c3e2900079e38b7",multiline:true,size:this.size,htmlFor:this.htmlFor,required:this.required,valid:this.valid,invalid:this.invalid,disabled:this.disabled,readonly:this.readonly,weight:this.weight},h("slot",{key:"687bfc73cab2cf7bef4e3e15b6a9090d5ba29d38"})))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();var FieldMessage=function(){function e(e){registerInstance(this,e);this.ariaForm=defaultBalAriaForm;this.color="";this.invalid=false;this.valid=false;this.disabled=false;this.readonly=false;this.noReservedSpace=false}e.prototype.setAriaForm=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.ariaForm=Object.assign({},e);return[2]}))}))};e.prototype.render=function(){var e;return h(Host,{key:"24a1ad8e6d848841fd1e83428aa14430ed6fe5fc",id:this.ariaForm.messageId,class:(e={"bal-field-message":true,help:true,"is-danger":this.invalid,"is-success":this.valid,"is-disabled":this.disabled||this.readonly},e["is-".concat(this.color)]=!!this.color,e),style:{minHeight:this.noReservedSpace?"0":undefined}},h("slot",{key:"2cb9fb2480527f5b4ae63611f3a424fcc202bc36"}))};return e}();export{Field as bal_field,FieldControl as bal_field_control,FieldHint as bal_field_hint,FieldLabel as bal_field_label,FieldMessage as bal_field_message};
1
+ import{__awaiter,__generator,__spreadArray}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{d as defaultBalAriaForm}from"./form-FCLKfv6B.js";import{d as deepReady,a as waitAfterFramePaint}from"./helpers-BNj87EbG.js";import{L as ListenToMutation}from"./mutation.decorator-DhVeNnnY.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{b as balBreakpoints}from"./breakpoints.subject-BtghxYYt.js";import{L as ListenToBreakpoints}from"./breakpoints.decorator-CFE2cXqN.js";import"./browser-B1u-Mq75.js";import"./config.utils-B7jugjyM.js";import"./listener-CClDIhvK.js";import"./device-TtMibDFL.js";import"./tokens.esm-DcKTia-G.js";var balFieldCss=":root{--bal-field-label-horizontal-width:33.3333%;--bal-field-label-column-gap:.5rem}.bal-field,.bal-field-label,.bal-field-control,.bal-field-message,.bal-field-hint{display:block;position:relative;font-family:var(--bal-font-family-text)}.bal-field-label{display:inline}.bal-field-label~.bal-field-control{margin-top:.25rem}.bal-field-hint{display:inline-block;margin-left:.25rem;height:1rem;width:1rem}.bal-field-hint__hint{position:absolute;top:2px;left:0}.bal-field-message{line-height:var(--bal-line-height-normal)}.bal-field-hidden{display:none !important;visibility:hidden !important}.bal-field-control{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;gap:.5rem}.bal-field-control .bal-input{-ms-flex:1;flex:1}@media screen and (max-width: 768px){.bal-field-control--expanded-on-mobile{-ms-flex-direction:column;flex-direction:column}.bal-field-control--expanded-on-mobile .bal-button,.bal-field-control--expanded-on-mobile .bal-button .button{width:100%}}.bal-field-message{margin-top:0 !important}.bal-field-control+.bal-field-message{min-height:1.375rem;line-height:1.375rem}.bal-field-control:not(:has(+.bal-field-message)){padding-bottom:1.375rem}.bal-field--horizontal{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:var(--bal-field-label-column-gap);-moz-column-gap:var(--bal-field-label-column-gap);column-gap:var(--bal-field-label-column-gap);-ms-flex-align:center;align-items:center}.bal-field--horizontal .bal-field-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-width:var(--bal-field-label-horizontal-width);max-width:var(--bal-field-label-horizontal-width);-ms-flex-pack:end;justify-content:flex-end;text-align:right;margin-bottom:0}.bal-field--horizontal .bal-field-control{-ms-flex:1;flex:1;padding-bottom:0;-ms-flex-item-align:end;align-self:flex-end}.bal-field--horizontal .bal-field-message{-ms-flex-preferred-size:100%;flex-basis:100%;margin-top:0 !important;margin-left:calc(var(--bal-field-label-horizontal-width) + var(--bal-field-label-column-gap))}.bal-field--horizontal .bal-field-hint{margin-left:0}.bal-field--horizontal .bal-field-hint .bal-hint{top:0}.bal-field--horizontal .bal-field-hint~.bal-field-message{margin-left:calc(var(--bal-field-label-horizontal-width) + var(--bal-field-label-column-gap)*2 + 1.125rem)}.bal-field--horizontal .bal-field-label~.bal-field-control{margin-top:0}";var Field=function(){function e(e){var i=this;registerInstance(this,e);this.balFormControlDidLoad=createEvent(this,"balFormControlDidLoad");this.fieldId="bal-field-".concat(FieldIds++);this.formControlElement=["bal-field-control"];this.inputElements=["bal-input","bal-number-input","bal-textarea","bal-select","bal-checkbox","bal-radio","bal-input-group","bal-date","bal-input-date","bal-input-stepper","bal-input-slider","bal-file-upload","bal-dropdown","bal-segment"];this.formElements=__spreadArray(__spreadArray([],this.formControlElement,true),["bal-field-label","bal-field-message"],false);this.required=undefined;this.horizontal=false;this.invalid=undefined;this.valid=false;this.disabled=undefined;this.readonly=undefined;this.loading=undefined;this.isDirectChild=function(e){if(!e){return false}var t=e.parentElement;if(!t){return false}if(t.nodeName.toLowerCase()==="bal-field"&&t!==i.el){return false}if(t===i.el){return true}return i.isDirectChild(t)};this.isVisible=function(e){if(!e){return false}return e.ariaHidden!=="true"};this.findDirectChild=function(e){var t=i.el.querySelector(e);var l=i.isDirectChild(t);if(l){if(i.isVisible(t)){return t}}return undefined};this.findDirectChildren=function(e){return e.map((function(e){return Array.from(i.el.querySelectorAll(e)).filter(i.isDirectChild).filter(i.isVisible)})).flat()};this.mutationObserverActive=true}e.prototype.requiredHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),["bal-field-label"],false),"required")};e.prototype.invalidHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formElements,true),"invalid")};e.prototype.validHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formElements,true),"valid")};e.prototype.disabledHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formElements,true),"disabled")};e.prototype.readonlyHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formElements,true),"readonly")};e.prototype.loadingHandler=function(){this.updateProps(__spreadArray(__spreadArray([],this.inputElements,true),this.formControlElement,true),"loading")};e.prototype.connectedCallback=function(){this.triggerAllHandlers()};e.prototype.componentWillLoad=function(){this.triggerAllHandlers()};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.syncAriaAttributes()];case 1:e.sent();return[2]}}))}))};e.prototype.syncAriaAttributes=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,t,l,a,n;return __generator(this,(function(r){switch(r.label){case 0:return[4,deepReady(this.el)];case 1:r.sent();return[4,waitAfterFramePaint()];case 2:r.sent();e=this.findDirectChild("bal-field-label bal-label");i=this.findDirectChild("bal-field-message");t=this.findDirectChildren(["bal-field-control bal-input","bal-field-control bal-select","bal-field-control bal-input-date","bal-field-control bal-dropdown","bal-field-control bal-checkbox","bal-field-control bal-radio","bal-field-control bal-segment","bal-field-control bal-segment-item","bal-field-control bal-checkbox-group","bal-field-control bal-radio-group","bal-field-control bal-number-input","bal-field-control bal-time-input","bal-field-control bal-input-slider","bal-field-control bal-input-stepper","bal-field-control bal-textarea","bal-field-control bal-file-upload"]);l=Object.assign({},defaultBalAriaForm);if(e){l.labelId="".concat(this.fieldId,"-lbl")}if(i){l.messageId="".concat(this.fieldId,"-msg")}a=0;r.label=3;case 3:if(!(a<t.length))return[3,10];n=t[a];if(!(a===0))return[3,7];l.controlId="".concat(this.fieldId,"-ctrl");return[4,e===null||e===void 0?void 0:e.setAriaForm(l)];case 4:r.sent();return[4,i===null||i===void 0?void 0:i.setAriaForm(l)];case 5:r.sent();return[4,n===null||n===void 0?void 0:n.setAriaForm(l)];case 6:r.sent();return[3,9];case 7:l.controlId="".concat(this.fieldId,"-ctrl-").concat(a);return[4,n===null||n===void 0?void 0:n.setAriaForm(l)];case 8:r.sent();r.label=9;case 9:a++;return[3,3];case 10:return[2]}}))}))};e.prototype.mutationListener=function(){this.triggerAllHandlers();this.syncAriaAttributes()};e.prototype.triggerAllHandlers=function(){this.requiredHandler();this.invalidHandler();this.validHandler();this.readonlyHandler();this.disabledHandler();this.loadingHandler()};e.prototype.updateProps=function(e,i){var t=this[i];if(t!==undefined){this.notifyComponents(e,(function(e){return e[i]=t}))}};e.prototype.notifyComponents=function(e,i){var t=this.el.querySelectorAll(e.join(", "));t.forEach((function(e){return i(e)}))};e.prototype.render=function(){return h(Host,{key:"ef05b294a516d40c5089d051feeb46715f581bc1",id:this.fieldId,class:{"bal-field":true,field:true,"bal-field--invalid":this.invalid===true,"bal-field--horizontal":this.horizontal===true}},h("slot",{key:"5710d7fd141b21d699004d7982d5d5bb7238cd94"}),h("span",{key:"e1b36343cdcb60960bcdac4d938c946f40041334",class:"bal-field-hidden"}))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{required:["requiredHandler"],invalid:["invalidHandler"],valid:["validHandler"],disabled:["disabledHandler"],readonly:["readonlyHandler"],loading:["loadingHandler"]}},enumerable:false,configurable:true});return e}();__decorate([ListenToMutation({subtree:false,waitAfterFramePrint:true}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],Field.prototype,"mutationListener",null);var FieldIds=0;Field.style=balFieldCss;var FieldControl=function(){function e(e){registerInstance(this,e);this.iconRight="";this.iconLeft="";this.expandedOnMobile=undefined;this.loading=false}Object.defineProperty(e.prototype,"buildIconLeftTemplate",{get:function(){if(this.iconLeft){return h("bal-icon",{name:this.iconLeft,color:"info",class:"is-left",size:"small"})}return""},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"buildIconRightTemplate",{get:function(){if(this.iconRight){return h("bal-icon",{name:this.iconRight,color:"info",class:"is-right",size:"small"})}return""},enumerable:false,configurable:true});e.prototype.render=function(){return h(Host,{key:"f2dbde868506b54d5b5e2fc14b5c29c417d42891",class:{"bal-field-control":true,control:true,"has-icons-left":!!this.iconLeft,"has-icons-right":!!this.iconRight,"is-loading":this.loading,"bal-field-control--expanded-on-mobile":!!this.expandedOnMobile}},h("slot",{key:"274cd16bccefc825d85e4b1222da7c523a1aa937"}),this.buildIconLeftTemplate,this.buildIconRightTemplate)};return e}();var FieldHint=function(){function e(e){registerInstance(this,e);this.hideTitleOnDesktop=false;this.subject="";this.closeLabel="Close";this.small=false;this.isDesktop=balBreakpoints.isDesktop}e.prototype.breakpointListener=function(e){this.isDesktop=e.desktop};e.prototype.render=function(){var e=BEM.block("field-hint");return h(Host,{key:"90dbf0da0a0c7ec498538721135e2fdefc4ac238",class:Object.assign({},e.class())},h("bal-hint",{key:"1976d07de449aa8b2897a375f61953f0c705e4ae",class:Object.assign({},e.element("hint").class()),"data-testid":"bal-field-hint",closeLabel:this.closeLabel,small:this.small},this.subject&&!(this.hideTitleOnDesktop&&this.isDesktop)?h("bal-hint-title",null,this.subject):"",h("bal-hint-text",{key:"ae2b48186e4f4c1adbfe7b3ed57a798a55a4cad0"},h("slot",{key:"e4a33e9e14ab86a15e78321fbd9f7325e0420ec5"}))))};return e}();__decorate([ListenToBreakpoints(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],FieldHint.prototype,"breakpointListener",null);var FieldLabel=function(){function e(e){registerInstance(this,e);this.htmlFor=undefined;this.required=true;this.valid=undefined;this.invalid=undefined;this.disabled=undefined;this.readonly=undefined;this.size="small";this.weight="bold"}e.prototype.componentDidLoad=function(){if(this.element){this.parentBalFieldElement=this.element.closest("bal-field");if(this.parentBalFieldElement){this.parentBalFieldElement.classList.add("has-label")}}};e.prototype.disconnectedCallback=function(){if(this.parentBalFieldElement){this.parentBalFieldElement.classList.remove("has-label")}};e.prototype.render=function(){return h(Host,{key:"6685a5711aba2152b975fe49fe114a9edb400679",class:"bal-field-label"},h("bal-label",{key:"f677ab02ba144832c6304dc99c3e2900079e38b7",multiline:true,size:this.size,htmlFor:this.htmlFor,required:this.required,valid:this.valid,invalid:this.invalid,disabled:this.disabled,readonly:this.readonly,weight:this.weight},h("slot",{key:"687bfc73cab2cf7bef4e3e15b6a9090d5ba29d38"})))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();var FieldMessage=function(){function e(e){registerInstance(this,e);this.ariaForm=defaultBalAriaForm;this.color="";this.invalid=false;this.valid=false;this.disabled=false;this.readonly=false;this.noReservedSpace=false}e.prototype.setAriaForm=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.ariaForm=Object.assign({},e);return[2]}))}))};e.prototype.render=function(){var e;return h(Host,{key:"24a1ad8e6d848841fd1e83428aa14430ed6fe5fc",id:this.ariaForm.messageId,class:(e={"bal-field-message":true,help:true,"is-danger":this.invalid,"is-success":this.valid,"is-disabled":this.disabled||this.readonly},e["is-".concat(this.color)]=!!this.color,e),style:{minHeight:this.noReservedSpace?"0":undefined}},h("slot",{key:"2cb9fb2480527f5b4ae63611f3a424fcc202bc36"}))};return e}();export{Field as bal_field,FieldControl as bal_field_control,FieldHint as bal_field_hint,FieldLabel as bal_field_label,FieldMessage as bal_field_message};