From 7220c79b63ba08b90111f4c09caf29af95fc97fb Mon Sep 17 00:00:00 2001 From: Ruslan Garaev Date: Wed, 3 Apr 2024 19:34:20 +0300 Subject: [PATCH] v2.1.0 --- README.md | 2 +- dist/accordion.d.ts | 11 +- dist/accordion.js | 6 +- dist/carousel.d.ts | 29 +- dist/carousel.js | 4 +- dist/collapse.d.ts | 11 +- dist/collapse.js | 6 +- dist/combobox.d.ts | 132 +++ dist/combobox.js | 17 + dist/copy-markup.d.ts | 1 + dist/copy-markup.js | 6 +- dist/dropdown.d.ts | 19 +- dist/dropdown.js | 8 +- dist/index.d.ts | 147 +++- dist/index.js | 70 +- dist/input-number.d.ts | 17 +- dist/input-number.js | 6 +- dist/overlay.d.ts | 43 +- dist/overlay.js | 8 +- dist/pin-input.d.ts | 13 +- dist/pin-input.js | 8 +- dist/preline.d.ts | 147 +++- dist/preline.js | 70 +- dist/remove-element.d.ts | 13 +- dist/remove-element.js | 6 +- dist/scrollspy.d.ts | 7 +- dist/scrollspy.js | 6 +- dist/search-by-json.d.ts | 29 +- dist/select.d.ts | 55 +- dist/select.js | 10 +- dist/stepper.d.ts | 29 +- dist/stepper.js | 6 +- dist/strong-password.d.ts | 29 +- dist/strong-password.js | 10 +- dist/tabs.d.ts | 7 +- dist/tabs.js | 8 +- dist/theme-switch.d.ts | 17 +- dist/theme-switch.js | 4 +- dist/toggle-count.d.ts | 23 +- dist/toggle-count.js | 4 +- dist/toggle-password.d.ts | 17 +- dist/toggle-password.js | 6 +- dist/tooltip.d.ts | 11 +- dist/tooltip.js | 8 +- dts-config.js | 4 +- index.d.ts | 147 +++- index.js | 70 +- package-lock.json | 992 +---------------------- package.json | 5 +- plugin.js | 66 +- preline.d.ts | 147 +++- preline.js | 70 +- src/constants.ts | 8 + src/index.ts | 1 + src/plugins/accordion/index.ts | 2 +- src/plugins/base-plugin/index.ts | 3 +- src/plugins/carousel/index.ts | 2 +- src/plugins/collapse/index.ts | 5 +- src/plugins/combobox/index.ts | 1024 ++++++++++++++++++++++++ src/plugins/combobox/interfaces.ts | 32 + src/plugins/combobox/types.ts | 1 + src/plugins/copy-markup/index.ts | 2 +- src/plugins/dropdown/index.ts | 4 +- src/plugins/input-number/index.ts | 59 +- src/plugins/input-number/interfaces.ts | 2 +- src/plugins/overlay/index.ts | 176 +++- src/plugins/overlay/interfaces.ts | 4 +- src/plugins/pin-input/index.ts | 2 +- src/plugins/remove-element/index.ts | 2 +- src/plugins/scrollspy/index.ts | 2 +- src/plugins/search-by-json/index.ts | 6 +- src/plugins/select/index.ts | 201 +++-- src/plugins/select/interfaces.ts | 6 +- src/plugins/stepper/index.ts | 2 +- src/plugins/strong-password/index.ts | 2 +- src/plugins/tabs/index.ts | 4 +- src/plugins/theme-switch/index.ts | 48 +- src/plugins/toggle-count/index.ts | 2 +- src/plugins/toggle-password/index.ts | 2 +- src/plugins/tooltip/index.ts | 2 +- src/spa/index.ts | 2 + src/static/index.ts | 2 +- src/utils/index.ts | 41 +- webpack.config.js | 2 + 84 files changed, 2694 insertions(+), 1546 deletions(-) create mode 100644 dist/combobox.d.ts create mode 100644 dist/combobox.js create mode 100644 src/plugins/combobox/index.ts create mode 100644 src/plugins/combobox/interfaces.ts create mode 100644 src/plugins/combobox/types.ts diff --git a/README.md b/README.md index 03c4a24..30e85b0 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,6 @@ All brand icons are trademarks of their respective owners. The use of these trad ## A product of Htmlstream -Preline UI is built and maintained by [Htmlstream](https://htmlstream.com) team. Over the last decade at Htmlstream, our journey has involved crafting UI Components and Templates. This process has allowed us to understand and explore a range of strategies for developing versatile UI designs that can adapt to a variety of needs. +Preline UI is built and maintend by [Htmlstream](https://htmlstream.com) team. Over the last decade at Htmlstream, our journey has involved crafting UI Components and Templates. This process has allowed us to understand and explore a range of strategies for developing versatile UI designs that can adapt to a variety of needs. Share your thoughts about Preline on [Twitter](https://twitter.com/prelineUI) or leave supportive review on [ProductHunt](https://www.producthunt.com/products/preline-ui/reviews). diff --git a/dist/accordion.d.ts b/dist/accordion.d.ts index bc7155c..3cfd6c0 100644 --- a/dist/accordion.d.ts +++ b/dist/accordion.d.ts @@ -1,9 +1,5 @@ -export interface IAccordion { - options?: {}; - show(): void; - hide(): void; -} + export interface IBasePlugin { el: E; options?: O; @@ -22,6 +18,11 @@ export interface ICollectionItem { id: string | number; element: T; } +export interface IAccordion { + options?: {}; + show(): void; + hide(): void; +} declare class HSAccordion extends HSBasePlugin<{}> implements IAccordion { private readonly toggle; content: HTMLElement | null; diff --git a/dist/accordion.js b/dist/accordion.js index 044db8b..56425a9 100644 --- a/dist/accordion.js +++ b/dist/accordion.js @@ -1,7 +1,7 @@ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={460:function(t,e,n){ /* * HSAccordion - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,9 +9,9 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(969),c=function(t){function e(e,n,o){var i=t.call(this,e,n,o)||this;return i.toggle=i.el.querySelector(".hs-accordion-toggle")||null,i.content=i.el.querySelector(".hs-accordion-content")||null,i.group=i.el.closest(".hs-accordion-group")||null,i.isAlwaysOpened=i.group.hasAttribute("data-hs-accordion-always-open")||!1,i.toggle&&i.content&&i.init(),i}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsAccordionCollection,this),this.toggle.addEventListener("click",(function(){t.el.classList.contains("active")?t.hide():t.show()}))},e.prototype.show=function(){var t=this;this.group&&!this.isAlwaysOpened&&this.group.querySelector(".hs-accordion.active")&&this.group.querySelector(".hs-accordion.active")!==this.el&&window.$hsAccordionCollection.find((function(e){return e.element.el===t.group.querySelector(".hs-accordion.active")})).element.hide();if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),this.content.style.display="block",this.content.style.height="0",setTimeout((function(){t.content.style.height="".concat(t.content.scrollHeight,"px")})),(0,r.afterTransition)(this.content,(function(){t.content.style.display="block",t.content.style.height="",t.fireEvent("open",t.el),(0,r.dispatch)("open.hs.accordion",t.el,t.el)}))},e.prototype.hide=function(){var t=this;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){t.content.style.height="0"})),(0,r.afterTransition)(this.content,(function(){t.content.style.display="",t.content.style.height="0",t.fireEvent("close",t.el),(0,r.dispatch)("close.hs.accordion",t.el,t.el)}))},e.getInstance=function(t,e){var n=window.$hsAccordionCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.show=function(t){var e=window.$hsAccordionCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&"block"!==e.element.content.style.display&&e.element.show()},e.hide=function(t){var e=window.$hsAccordionCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&"block"===e.element.content.style.display&&e.element.hide()},e.autoInit=function(){window.$hsAccordionCollection||(window.$hsAccordionCollection=[]),document.querySelectorAll(".hs-accordion:not(.--prevent-on-load-init)").forEach((function(t){window.$hsAccordionCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e.on=function(t,e,n){var o=window.$hsAccordionCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));o&&(o.element.events[t]=n)},e}(n(737).default);window.addEventListener("load",(function(){c.autoInit()})),"undefined"!=typeof window&&(window.HSAccordion=c),e.default=c},737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=void 0;e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var r=e.getBoundingClientRect(),c=i?i.getBoundingClientRect():null,s=window.innerHeight,l=c?r.top-c.top:r.top,a=(i?c.bottom:s)-r.bottom,u=t.clientHeight+o;return"bottom"===n?a>=u:"top"===n?l>=u:l>=u||a>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}(460);return n})())); \ No newline at end of file +Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0;e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var r=e.getBoundingClientRect(),c=i?i.getBoundingClientRect():null,s=window.innerHeight,l=c?r.top-c.top:r.top,a=(i?c.bottom:s)-r.bottom,u=t.clientHeight+o;return"bottom"===n?a>=u:"top"===n?l>=u:l>=u||a>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}(460);return n})())); \ No newline at end of file diff --git a/dist/carousel.d.ts b/dist/carousel.d.ts index 70271c8..000cb99 100644 --- a/dist/carousel.d.ts +++ b/dist/carousel.d.ts @@ -1,18 +1,5 @@ -export interface ICarouselOptions { - currentIndex: number; - loadingClasses?: string | string[]; - isAutoPlay?: boolean; - speed?: number; - isInfiniteLoop?: boolean; -} -export interface ICarousel { - options?: ICarouselOptions; - recalculateWidth(): void; - goToPrev(): void; - goToNext(): void; - goTo(i: number): void; -} + export interface IBasePlugin { el: E; options?: O; @@ -31,6 +18,20 @@ export interface ICollectionItem { id: string | number; element: T; } +export interface ICarouselOptions { + currentIndex: number; + loadingClasses?: string | string[]; + isAutoPlay?: boolean; + speed?: number; + isInfiniteLoop?: boolean; +} +export interface ICarousel { + options?: ICarouselOptions; + recalculateWidth(): void; + goToPrev(): void; + goToNext(): void; + goTo(i: number): void; +} declare class HSCarousel extends HSBasePlugin implements ICarousel { private readonly inner; private readonly slides; diff --git a/dist/carousel.js b/dist/carousel.js index 348694e..f2c3ecc 100644 --- a/dist/carousel.js +++ b/dist/carousel.js @@ -1,7 +1,7 @@ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var s=e();for(var i in s)("object"==typeof exports?exports:t)[i]=s[i]}}(self,(()=>(()=>{"use strict";var t={737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,7 +9,7 @@ Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e,s){this.el=t,this.options=e,this.events=s,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var s;t.push({id:(null===(s=null==e?void 0:e.el)||void 0===s?void 0:s.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=s},629:function(t,e,s){ /* * HSCarousel - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream diff --git a/dist/collapse.d.ts b/dist/collapse.d.ts index cc7d675..cbe0311 100644 --- a/dist/collapse.d.ts +++ b/dist/collapse.d.ts @@ -1,9 +1,5 @@ -export interface ICollapse { - options?: {}; - show(): void; - hide(): void; -} + export interface IBasePlugin { el: E; options?: O; @@ -22,6 +18,11 @@ export interface ICollectionItem { id: string | number; element: T; } +export interface ICollapse { + options?: {}; + show(): void; + hide(): void; +} declare class HSCollapse extends HSBasePlugin<{}> implements ICollapse { private readonly contentId; content: HTMLElement | null; diff --git a/dist/collapse.js b/dist/collapse.js index 087f00c..132d821 100644 --- a/dist/collapse.js +++ b/dist/collapse.js @@ -1,7 +1,7 @@ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,9 +9,9 @@ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},652:function(t,e,n){ /* * HSCollapse - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var s=n(969),r=function(t){function e(e,n,o){var i=t.call(this,e,n,o)||this;return i.contentId=i.el.dataset.hsCollapse,i.content=document.querySelector(i.contentId),i.animationInProcess=!1,i.content&&i.init(),i}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsCollapseCollection,this),this.el.addEventListener("click",(function(){t.content.classList.contains("open")?t.hide():t.show()}))},e.prototype.hideAllMegaMenuItems=function(){this.content.querySelectorAll(".hs-mega-menu-content.block").forEach((function(t){t.classList.remove("block"),t.classList.add("hidden")}))},e.prototype.show=function(){var t=this;if(this.animationInProcess||this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.add("open"),this.content.classList.add("open"),this.content.classList.remove("hidden"),this.content.style.height="0",setTimeout((function(){t.content.style.height="".concat(t.content.scrollHeight,"px")})),(0,s.afterTransition)(this.content,(function(){t.content.style.height="",t.fireEvent("open",t.el),(0,s.dispatch)("open.hs.collapse",t.el,t.el),t.animationInProcess=!1}))},e.prototype.hide=function(){var t=this;if(this.animationInProcess||!this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.remove("open"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){t.content.style.height="0"})),this.content.classList.remove("open"),(0,s.afterTransition)(this.content,(function(){t.content.classList.add("hidden"),t.content.style.height="",t.fireEvent("hide",t.el),(0,s.dispatch)("hide.hs.collapse",t.el,t.el),t.animationInProcess=!1})),this.content.querySelectorAll(".hs-mega-menu-content.block").length&&this.hideAllMegaMenuItems()},e.getInstance=function(t,e){void 0===e&&(e=!1);var n=window.$hsCollapseCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.autoInit=function(){window.$hsCollapseCollection||(window.$hsCollapseCollection=[]),document.querySelectorAll(".hs-collapse-toggle:not(.--prevent-on-load-init)").forEach((function(t){window.$hsCollapseCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e.show=function(t){var e=window.$hsCollapseCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.content.classList.contains("hidden")&&e.element.show()},e.hide=function(t){var e=window.$hsCollapseCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&!e.element.content.classList.contains("hidden")&&e.element.hide()},e.on=function(t,e,n){var o=window.$hsCollapseCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));o&&(o.element.events[t]=n)},e}(n(737).default);window.addEventListener("load",(function(){r.autoInit()})),"undefined"!=typeof window&&(window.HSCollapse=r),e.default=r},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=void 0;e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var s=e.getBoundingClientRect(),r=i?i.getBoundingClientRect():null,l=window.innerHeight,c=r?s.top-r.top:s.top,a=(i?r.bottom:l)-s.bottom,u=t.clientHeight+o;return"bottom"===n?a>=u:"top"===n?c>=u:c>=u||a>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],s=0;sthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(o){var i=e[o];if(void 0!==i)return i.exports;var s=e[o]={exports:{}};return t[o].call(s.exports,s,s.exports,n),s.exports}(652);return n})())); \ No newline at end of file +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var s=n(969),r=function(t){function e(e,n,o){var i=t.call(this,e,n,o)||this;return i.contentId=i.el.dataset.hsCollapse,i.content=document.querySelector(i.contentId),i.animationInProcess=!1,i.content&&i.init(),i}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsCollapseCollection,this),this.el.addEventListener("click",(function(){t.content.classList.contains("open")?t.hide():t.show()}))},e.prototype.hideAllMegaMenuItems=function(){this.content.querySelectorAll(".hs-mega-menu-content.block").forEach((function(t){t.classList.remove("block"),t.classList.add("hidden")}))},e.prototype.show=function(){var t=this;if(this.animationInProcess||this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.add("open"),this.content.classList.add("open"),this.content.classList.remove("hidden"),this.content.style.height="0",setTimeout((function(){t.content.style.height="".concat(t.content.scrollHeight,"px"),t.fireEvent("beforeOpen",t.el),(0,s.dispatch)("beforeOpen.hs.collapse",t.el,t.el)})),(0,s.afterTransition)(this.content,(function(){t.content.style.height="",t.fireEvent("open",t.el),(0,s.dispatch)("open.hs.collapse",t.el,t.el),t.animationInProcess=!1}))},e.prototype.hide=function(){var t=this;if(this.animationInProcess||!this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.remove("open"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){t.content.style.height="0"})),this.content.classList.remove("open"),(0,s.afterTransition)(this.content,(function(){t.content.classList.add("hidden"),t.content.style.height="",t.fireEvent("hide",t.el),(0,s.dispatch)("hide.hs.collapse",t.el,t.el),t.animationInProcess=!1})),this.content.querySelectorAll(".hs-mega-menu-content.block").length&&this.hideAllMegaMenuItems()},e.getInstance=function(t,e){void 0===e&&(e=!1);var n=window.$hsCollapseCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.autoInit=function(){window.$hsCollapseCollection||(window.$hsCollapseCollection=[]),document.querySelectorAll(".hs-collapse-toggle:not(.--prevent-on-load-init)").forEach((function(t){window.$hsCollapseCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e.show=function(t){var e=window.$hsCollapseCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.content.classList.contains("hidden")&&e.element.show()},e.hide=function(t){var e=window.$hsCollapseCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&!e.element.content.classList.contains("hidden")&&e.element.hide()},e.on=function(t,e,n){var o=window.$hsCollapseCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));o&&(o.element.events[t]=n)},e}(n(737).default);window.addEventListener("load",(function(){r.autoInit()})),"undefined"!=typeof window&&(window.HSCollapse=r),e.default=r},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0;e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var s=e.getBoundingClientRect(),r=i?i.getBoundingClientRect():null,l=window.innerHeight,c=r?s.top-r.top:s.top,a=(i?r.bottom:l)-s.bottom,u=t.clientHeight+o;return"bottom"===n?a>=u:"top"===n?c>=u:c>=u||a>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],s=0;sthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(o){var i=e[o];if(void 0!==i)return i.exports;var s=e[o]={exports:{}};return t[o].call(s.exports,s,s.exports,n),s.exports}(652);return n})())); \ No newline at end of file diff --git a/dist/combobox.d.ts b/dist/combobox.d.ts new file mode 100644 index 0000000..f76ab43 --- /dev/null +++ b/dist/combobox.d.ts @@ -0,0 +1,132 @@ + + +export interface IBasePlugin { + el: E; + options?: O; + events?: {}; +} +declare class HSBasePlugin implements IBasePlugin { + el: E; + options: O; + events?: any; + constructor(el: E, options: O, events?: any); + createCollection(collection: any[], element: any): void; + fireEvent(evt: string, payload?: any): any; + on(evt: string, cb: Function): void; +} +export interface ICollectionItem { + id: string | number; + element: T; +} +export interface IComboBoxOptions { + gap?: number; + viewport?: string | HTMLElement | null; + preventVisibility?: boolean; + apiUrl?: string | null; + apiDataPart?: string | null; + apiQuery?: string | null; + apiSearchQuery?: string | null; + apiHeaders?: {}; + apiGroupField?: string | null; + outputItemTemplate?: string | null; + outputEmptyTemplate?: string | null; + outputLoaderTemplate?: string | null; + groupingType?: "default" | "tabs" | null; + groupingTitleTemplate?: string | null; + tabsWrapperTemplate?: string | null; + preventSelection?: boolean; + isOpenOnFocus?: boolean; +} +export interface IComboBox { + options?: IComboBoxOptions; + open(): void; + close(): void; + recalculateDirection(): void; +} +declare class HSComboBox extends HSBasePlugin implements IComboBox { + gap: number; + viewport: string | HTMLElement | null; + preventVisibility: boolean; + apiUrl: string | null; + apiDataPart: string | null; + apiQuery: string | null; + apiSearchQuery: string | null; + apiHeaders: {}; + apiGroupField: string | null; + outputItemTemplate: string | null; + outputEmptyTemplate: string | null; + outputLoaderTemplate: string | null; + groupingType: "default" | "tabs" | null; + groupingTitleTemplate: string | null; + tabsWrapperTemplate: string | null; + preventSelection: boolean; + isOpenOnFocus: boolean; + private readonly input; + private readonly output; + private readonly itemsWrapper; + private items; + private tabs; + private readonly toggle; + private outputPlaceholder; + private outputLoader; + private value; + private selected; + private groups; + private selectedGroup; + isOpened: boolean; + isCurrent: boolean; + private animationInProcess; + constructor(el: HTMLElement, options?: IComboBoxOptions); + private init; + private build; + private setResultAndRender; + private buildInput; + private buildItems; + private setResults; + private isItemExists; + private isTextExists; + private isTextExistsAny; + private valuesBySelector; + private buildOutputLoader; + private destroyOutputLoader; + private itemsFromJson; + private jsonItemsRender; + private setGroups; + setCurrent(): void; + private setApiGroups; + private sortItems; + private itemRender; + private plainRender; + private groupTabsRender; + private groupDefaultRender; + private itemsFromHtml; + private buildToggle; + private setSelectedByValue; + private setValue; + private setItemsVisibility; + private hasVisibleItems; + private appendItemsToWrapper; + private buildOutputPlaceholder; + private destroyOutputPlaceholder; + private resultItems; + private setValueAndOpen; + open(val?: string): boolean; + private setValueAndClear; + close(val?: string | null): boolean; + recalculateDirection(): void; + static getInstance(target: HTMLElement | string, isInstance?: boolean): HSComboBox | ICollectionItem; + static autoInit(): void; + static close(target: HTMLElement | string): void; + static closeCurrentlyOpened(evtTarget?: HTMLElement | null): void; + static accessibility(evt: KeyboardEvent): void; + static onEscape(): void; + static onArrow(isArrowUp?: boolean): boolean; + static onStartEnd(isStart?: boolean): boolean; + static onEnter(evt: Event): void; +} + +export { + HSComboBox as default, +}; + +export {}; diff --git a/dist/combobox.js b/dist/combobox.js new file mode 100644 index 0000000..5b8ec54 --- /dev/null +++ b/dist/combobox.js @@ -0,0 +1,17 @@ +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o=e();for(var i in o)("object"==typeof exports?exports:t)[i]=o[i]}}(self,(()=>(()=>{"use strict";var t={190:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BREAKPOINTS=e.COMBO_BOX_ACCESSIBILITY_KEY_SET=e.SELECT_ACCESSIBILITY_KEY_SET=e.TABS_ACCESSIBILITY_KEY_SET=e.OVERLAY_ACCESSIBILITY_KEY_SET=e.DROPDOWN_ACCESSIBILITY_KEY_SET=e.POSITIONS=void 0,e.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},e.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],e.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],e.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],e.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],e.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],e.BREAKPOINTS={sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},737:(t,e)=>{ +/* + * HSBasePlugin + * @version: 2.1.0 + * @author: HTMLStream + * @license: Licensed under MIT (https://preline.co/docs/license.html) + * Copyright 2023 HTMLStream + */ +Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e,o){this.el=t,this.options=e,this.events=o,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var o;t.push({id:(null===(o=null==e?void 0:e.el)||void 0===o?void 0:o.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=o},23:function(t,e,o){ +/* + * HSComboBox + * @version: 2.1.0 + * @author: HTMLStream + * @license: Licensed under MIT (https://preline.co/docs/license.html) + * Copyright 2023 HTMLStream + */ +var i,n=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,o=1,i=arguments.length;o0&&n[n.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!n||l[1]>n[0]&&l[1]\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t',C.outputEmptyTemplate=null!==(h=null==O?void 0:O.outputEmptyTemplate)&&void 0!==h?h:'
Nothing found...
',C.outputLoaderTemplate=null!==(m=null==O?void 0:O.outputLoaderTemplate)&&void 0!==m?m:'
\n\t\t\t\t
\n\t\t\t\t\tLoading...\n\t\t\t\t
\n\t\t\t
',C.groupingType=null!==(f=null==O?void 0:O.groupingType)&&void 0!==f?f:null,C.groupingTitleTemplate=null!==(b=null==O?void 0:O.groupingTitleTemplate)&&void 0!==b?b:"default"===C.groupingType?'
':'',C.tabsWrapperTemplate=null!==(v=null==O?void 0:O.tabsWrapperTemplate)&&void 0!==v?v:'
',C.preventSelection=null!==(y=null==O?void 0:O.preventSelection)&&void 0!==y&&y,C.isOpenOnFocus=null!==(g=null==O?void 0:O.isOpenOnFocus)&&void 0!==g&&g,C.input=null!==(x=C.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==x?x:null,C.output=null!==(E=C.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==E?E:null,C.itemsWrapper=null!==(T=C.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==T?T:null,C.items=null!==(w=Array.from(C.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==w?w:[],C.tabs=[],C.toggle=null!==(S=C.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==S?S:null,C.outputPlaceholder=null,C.selected=C.value=null!==(A=C.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==A?A:"",C.isOpened=!1,C.isCurrent=!1,C.animationInProcess=!1,C.selectedGroup="all",C.init(),C}return n(e,t),e.prototype.init=function(){this.createCollection(window.$hsComboBoxCollection,this),this.build()},e.prototype.build=function(){this.buildInput(),this.groupingType&&this.setGroups(),this.buildItems(),this.preventVisibility&&(this.isOpened=!0,this.recalculateDirection()),this.toggle&&this.buildToggle()},e.prototype.setResultAndRender=function(t){void 0===t&&(t=""),this.setResults(t),this.apiSearchQuery&&this.itemsFromJson()},e.prototype.buildInput=function(){var t=this;this.isOpenOnFocus&&this.input.addEventListener("focus",(function(){t.isOpened||(t.setResultAndRender(),t.open())})),this.input.addEventListener("input",(0,u.debounce)((function(e){t.setResultAndRender(e.target.value),t.isOpened||t.open()})))},e.prototype.buildItems=function(){this.apiUrl?this.itemsFromJson():(this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="",this.itemsFromHtml())},e.prototype.setResults=function(t){this.value=t,this.resultItems(),this.hasVisibleItems()?this.destroyOutputPlaceholder():this.buildOutputPlaceholder()},e.prototype.isItemExists=function(t){return this.items.some((function(e){return Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(e){return e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]}))}))},e.prototype.isTextExists=function(t,e){var o=e.map((function(t){return t.toLowerCase()}));return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(t){return o.includes(t.getAttribute("data-hs-combo-box-search-text").toLowerCase())}))},e.prototype.isTextExistsAny=function(t,e){return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(t){return t.getAttribute("data-hs-combo-box-search-text").toLowerCase().includes(e.toLowerCase())}))},e.prototype.valuesBySelector=function(t){return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).reduce((function(t,e){return a(a([],t,!0),[e.getAttribute("data-hs-combo-box-search-text")],!1)}),[])},e.prototype.buildOutputLoader=function(){if(this.outputLoader)return!1;this.outputLoader=(0,u.htmlToElement)(this.outputLoaderTemplate),this.items.length||this.outputPlaceholder?(this.outputLoader.style.position="absolute",this.outputLoader.style.top="0",this.outputLoader.style.bottom="0",this.outputLoader.style.left="0",this.outputLoader.style.right="0",this.outputLoader.style.zIndex="2"):(this.outputLoader.style.position="",this.outputLoader.style.top="",this.outputLoader.style.bottom="",this.outputLoader.style.left="",this.outputLoader.style.right="",this.outputLoader.style.zIndex="",this.outputLoader.style.height="30px"),this.output.append(this.outputLoader)},e.prototype.destroyOutputLoader=function(){this.outputLoader&&this.outputLoader.remove(),this.outputLoader=null},e.prototype.itemsFromJson=function(){return s(this,void 0,void 0,(function(){var t,e,o,i,n,r=this;return l(this,(function(s){switch(s.label){case 0:this.buildOutputLoader(),s.label=1;case 1:return s.trys.push([1,4,,5]),t="".concat(this.apiQuery),e="".concat(this.apiSearchQuery,"=").concat(this.value.toLowerCase()),o=this.apiUrl,this.apiQuery&&this.apiSearchQuery?o+="?".concat(e,"&").concat(t):this.apiQuery?o+="?".concat(t):this.apiSearchQuery&&(o+="?".concat(e)),[4,fetch(o,this.apiHeaders)];case 2:return[4,s.sent().json()];case 3:return i=s.sent(),this.apiDataPart&&(i=i[this.apiDataPart]),this.apiSearchQuery&&(this.items=[]),this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="","tabs"===this.groupingType?(this.setApiGroups(i),this.groupTabsRender(),this.jsonItemsRender(i)):"default"===this.groupingType?(this.setApiGroups(i),this.groups.forEach((function(t){var e=(0,u.htmlToElement)(r.groupingTitleTemplate);e.setAttribute("data-hs-combo-box-group-title",t.name),e.classList.add("--exclude-accessibility"),e.innerText=t.title;var o=i.filter((function(e){return e[r.apiGroupField]===t.name}));r.itemsWrapper?r.itemsWrapper.append(e):r.output.append(e),r.jsonItemsRender(o)}))):this.jsonItemsRender(i),this.setResults(this.input.value),[3,5];case 4:return n=s.sent(),console.error(n),[3,5];case 5:return this.destroyOutputLoader(),[2]}}))}))},e.prototype.jsonItemsRender=function(t){var e=this;t.forEach((function(t,o){if(e.isItemExists(t))return!1;var i=(0,u.htmlToElement)(e.outputItemTemplate);i.querySelectorAll("[data-hs-combo-box-search-text]").forEach((function(e){var o,i;e.textContent=null!==(o=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==o?o:"",e.setAttribute("data-hs-combo-box-search-text",null!==(i=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==i?i:"")})),i.querySelectorAll("[data-hs-combo-box-output-item-attr]").forEach((function(e){JSON.parse(e.getAttribute("data-hs-combo-box-output-item-attr")).forEach((function(o){e.setAttribute(o.attr,t[o.valueFrom])}))})),i.setAttribute("tabIndex","".concat(o)),"tabs"!==e.groupingType&&"default"!==e.groupingType||i.setAttribute("data-hs-combo-box-output-item",'{"group": {"name": "'.concat(t[e.apiGroupField],'", "title": "').concat(t[e.apiGroupField],'"}}')),e.items=a(a([],e.items,!0),[i],!1),e.preventSelection||i.addEventListener("click",(function(){e.close(i.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text")),e.setSelectedByValue(e.valuesBySelector(i))})),e.appendItemsToWrapper(i)}))},e.prototype.setGroups=function(){var t=[];this.items.forEach((function(e){var o=JSON.parse(e.getAttribute("data-hs-combo-box-output-item")).group;t.some((function(t){return(null==t?void 0:t.name)===o.name}))||t.push(o)})),this.groups=t},e.prototype.setCurrent=function(){window.$hsComboBoxCollection.length&&(window.$hsComboBoxCollection.map((function(t){return t.element.isCurrent=!1})),this.isCurrent=!0)},e.prototype.setApiGroups=function(t){var e=this,o=[];t.forEach((function(t){var i=t[e.apiGroupField];o.some((function(t){return t.name===i}))||o.push({name:i,title:i})})),this.groups=o},e.prototype.sortItems=function(){return this.items.sort((function(t,e){var o=t.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text"),i=e.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text");return oi?1:0}))},e.prototype.itemRender=function(t){var e=this,o=t.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text");this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t),this.preventSelection||t.addEventListener("click",(function(){e.close(o),e.setSelectedByValue(e.valuesBySelector(t))}))},e.prototype.plainRender=function(t){var e=this;t.forEach((function(t){e.itemRender(t)}))},e.prototype.groupTabsRender=function(){var t=this,e=(0,u.htmlToElement)(this.tabsWrapperTemplate),o=(0,u.htmlToElement)('
');e.append(o),this.output.insertBefore(e,this.output.firstChild);var i=(0,u.htmlToElement)(this.groupingTitleTemplate);i.setAttribute("data-hs-combo-box-group-title","all"),i.classList.add("--exclude-accessibility","active"),i.innerText="All",this.tabs=a(a([],this.tabs,!0),[i],!1),o.append(i),i.addEventListener("click",(function(){t.selectedGroup="all";var e=t.tabs.find((function(e){return e.getAttribute("data-hs-combo-box-group-title")===t.selectedGroup}));t.tabs.forEach((function(t){return t.classList.remove("active")})),e.classList.add("active"),t.setItemsVisibility()})),this.groups.forEach((function(e){var i=(0,u.htmlToElement)(t.groupingTitleTemplate);i.setAttribute("data-hs-combo-box-group-title",e.name),i.classList.add("--exclude-accessibility"),i.innerText=e.title,t.tabs=a(a([],t.tabs,!0),[i],!1),o.append(i),i.addEventListener("click",(function(){t.selectedGroup=e.name;var o=t.tabs.find((function(e){return e.getAttribute("data-hs-combo-box-group-title")===t.selectedGroup}));t.tabs.forEach((function(t){return t.classList.remove("active")})),o.classList.add("active"),t.setItemsVisibility()}))}))},e.prototype.groupDefaultRender=function(){var t=this;this.groups.forEach((function(e){var o=(0,u.htmlToElement)(t.groupingTitleTemplate);o.setAttribute("data-hs-combo-box-group-title",e.name),o.classList.add("--exclude-accessibility"),o.innerText=e.title,t.itemsWrapper?t.itemsWrapper.append(o):t.output.append(o);var i=t.sortItems().filter((function(t){return JSON.parse(t.getAttribute("data-hs-combo-box-output-item")).group.name===e.name}));t.plainRender(i)}))},e.prototype.itemsFromHtml=function(){if("default"===this.groupingType)this.groupDefaultRender();else if("tabs"===this.groupingType){var t=this.sortItems();this.groupTabsRender(),this.plainRender(t)}else{t=this.sortItems();this.plainRender(t)}this.setResults(this.input.value)},e.prototype.buildToggle=function(){var t=this;this.toggle.addEventListener("click",(function(){t.isOpened?t.close():t.open(t.toggle.getAttribute("data-hs-combo-box-toggle"))}))},e.prototype.setSelectedByValue=function(t){var e=this;this.items.forEach((function(o){e.isTextExists(o,t)?o.classList.add("selected"):o.classList.remove("selected")}))},e.prototype.setValue=function(t){this.selected=t,this.value=t,this.input.value=t},e.prototype.setItemsVisibility=function(){var t=this;"tabs"===this.groupingType&&"all"!==this.selectedGroup&&this.items.forEach((function(t){t.style.display="none"}));var e="tabs"===this.groupingType?"all"===this.selectedGroup?this.items:this.items.filter((function(e){return JSON.parse(e.getAttribute("data-hs-combo-box-output-item")).group.name===t.selectedGroup})):this.items;"tabs"===this.groupingType&&"all"!==this.selectedGroup&&e.forEach((function(t){t.style.display="block"})),e.forEach((function(e){t.isTextExistsAny(e,t.value)?e.style.display="block":e.style.display="none"})),"default"===this.groupingType&&this.output.querySelectorAll("[data-hs-combo-box-group-title]").forEach((function(e){var o=e.getAttribute("data-hs-combo-box-group-title");t.items.filter((function(t){return JSON.parse(t.getAttribute("data-hs-combo-box-output-item")).group.name===o&&"block"===t.style.display})).length?e.style.display="block":e.style.display="none"}))},e.prototype.hasVisibleItems=function(){return!!this.items.length&&this.items.some((function(t){return"block"===t.style.display}))},e.prototype.appendItemsToWrapper=function(t){this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t)},e.prototype.buildOutputPlaceholder=function(){this.outputPlaceholder||(this.outputPlaceholder=(0,u.htmlToElement)(this.outputEmptyTemplate)),this.appendItemsToWrapper(this.outputPlaceholder)},e.prototype.destroyOutputPlaceholder=function(){this.outputPlaceholder&&this.outputPlaceholder.remove(),this.outputPlaceholder=null},e.prototype.resultItems=function(){if(!this.items.length)return!1;this.setItemsVisibility(),this.setSelectedByValue([this.selected])},e.prototype.setValueAndOpen=function(t){this.value=t,this.items.length&&this.setItemsVisibility()},e.prototype.open=function(t){var e=this;return!this.animationInProcess&&(void 0!==t&&this.setValueAndOpen(t),!this.preventVisibility&&(this.animationInProcess=!0,this.output.style.display="block",this.recalculateDirection(),setTimeout((function(){e.el.classList.add("active"),e.animationInProcess=!1})),void(this.isOpened=!0)))},e.prototype.setValueAndClear=function(t){t?this.setValue(t):this.setValue(this.selected),this.outputPlaceholder&&this.destroyOutputPlaceholder()},e.prototype.close=function(t){var e=this;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t),!1):(this.animationInProcess=!0,this.el.classList.remove("active"),this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom="",(0,u.afterTransition)(this.output,(function(){e.output.style.display="none",e.setValueAndClear(t),e.animationInProcess=!1})),void(this.isOpened=!1)))},e.prototype.recalculateDirection=function(){(0,u.isEnoughSpace)(this.output,this.input,"bottom",this.gap,this.viewport)?(this.output.classList.remove("bottom-full"),this.output.style.marginBottom="",this.output.classList.add("top-full"),this.output.style.marginTop="".concat(this.gap,"px")):(this.output.classList.remove("top-full"),this.output.style.marginTop="",this.output.classList.add("bottom-full"),this.output.style.marginBottom="".concat(this.gap,"px"))},e.getInstance=function(t,e){var o=window.$hsComboBoxCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return o?e?o:o.element:null},e.autoInit=function(){window.$hsComboBoxCollection||(window.$hsComboBoxCollection=[]),document.querySelectorAll("[data-hs-combo-box]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsComboBoxCollection.find((function(e){var o;return(null===(o=null==e?void 0:e.element)||void 0===o?void 0:o.el)===t}))){var o=t.getAttribute("data-hs-combo-box"),i=o?JSON.parse(o):{};new e(t,i)}})),window.$hsComboBoxCollection&&(window.addEventListener("click",(function(t){var o=t.target;e.closeCurrentlyOpened(o)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.close=function(t){var e=window.$hsComboBoxCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.isOpened&&e.element.close()},e.closeCurrentlyOpened=function(t){if(void 0===t&&(t=null),!t.closest("[data-hs-combo-box].active")){var e=window.$hsComboBoxCollection.filter((function(t){return t.element.isOpened}))||null;e&&e.forEach((function(t){t.element.close()}))}},e.getPreparedItems=function(t,e){return void 0===t&&(t=!1),e?(t?Array.from(e.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter((function(t){return"none"!==t.style.display})).reverse():Array.from(e.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter((function(t){return"none"!==t.style.display}))).filter((function(t){return!t.classList.contains("disabled")})):null},e.setHighlighted=function(t,e,o){e.focus(),o.value=e.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text"),t&&t.classList.remove("hs-combo-box-output-item-highlighted"),e.classList.add("hs-combo-box-output-item-highlighted")},e.accessibility=function(t){if(window.$hsComboBoxCollection.find((function(t){return t.element.isOpened}))&&p.COMBO_BOX_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}},e.onEscape=function(){var t=window.$hsComboBoxCollection.find((function(t){return!t.element.preventVisibility&&t.element.isOpened}));t&&(t.element.close(),t.element.input.blur())},e.onArrow=function(t){var o;void 0===t&&(t=!0);var i=window.$hsComboBoxCollection.find((function(t){return t.element.preventVisibility?t.element.isCurrent:t.element.isOpened}));if(i){var n=null!==(o=i.element.itemsWrapper)&&void 0!==o?o:i.element.output;if(!n)return!1;var r,s=e.getPreparedItems(t,n),l=n.querySelector(".hs-combo-box-output-item-highlighted");l||s[0].classList.add("hs-combo-box-output-item-highlighted");var a=s.findIndex((function(t){return t===l}));a+12&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,o,i,n){void 0===o&&(o="auto"),void 0===i&&(i=10),void 0===n&&(n=null);var r=e.getBoundingClientRect(),s=n?n.getBoundingClientRect():null,l=window.innerHeight,a=s?r.top-s.top:r.top,u=(n?s.bottom:l)-r.bottom,c=t.clientHeight+i;return"bottom"===o?u>=c:"top"===o?a>=c:a>=c||u>=c};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var i=function(t){return!!t&&("none"===window.getComputedStyle(t).display||i(t.parentElement))};e.isParentOrElementHidden=i;e.debounce=function(t,e){var i;return void 0===e&&(e=200),function(){for(var n=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var o=function o(i){var n=e[i];if(void 0!==n)return n.exports;var r=e[i]={exports:{}};return t[i].call(r.exports,r,r.exports,o),r.exports}(23);return o})())); \ No newline at end of file diff --git a/dist/copy-markup.d.ts b/dist/copy-markup.d.ts index aa52b6d..d938e3a 100644 --- a/dist/copy-markup.d.ts +++ b/dist/copy-markup.d.ts @@ -1,4 +1,5 @@ + export interface ICopyMarkupOptions { targetSelector: string; wrapperSelector: string; diff --git a/dist/copy-markup.js b/dist/copy-markup.js index 6a6f6f6..7bbebbe 100644 --- a/dist/copy-markup.js +++ b/dist/copy-markup.js @@ -1,7 +1,7 @@ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,9 +9,9 @@ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},413:function(t,e,n){ /* * HSCopyMarkup - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=this.limit)return!1;this.el.hasAttribute("disabled")&&this.el.setAttribute("disabled","");var t=this.target.cloneNode(!0);this.addToItems(t),this.limit&&this.items.length>=this.limit&&this.el.setAttribute("disabled","disabled"),this.fireEvent("copy",t),(0,s.dispatch)("copy.hs.copyMarkup",t,t)},e.prototype.addPredefinedItems=function(){var t=this;Array.from(this.wrapper.children).filter((function(t){return!t.classList.contains("[--ignore-for-count]")})).forEach((function(e){t.addToItems(e)}))},e.prototype.setTarget=function(){var t="string"==typeof this.targetSelector?document.querySelector(this.targetSelector).cloneNode(!0):this.targetSelector.cloneNode(!0);t.removeAttribute("id"),this.target=t},e.prototype.setWrapper=function(){this.wrapper="string"==typeof this.wrapperSelector?document.querySelector(this.wrapperSelector):this.wrapperSelector},e.prototype.addToItems=function(t){var e=this,n=t.querySelector("[data-hs-copy-markup-delete-item]");this.wrapper?this.wrapper.append(t):this.el.before(t),n&&n.addEventListener("click",(function(){return e.delete(t)})),this.items.push(t)},e.prototype.delete=function(t){var e=this.items.indexOf(t);-1!==e&&this.items.splice(e,1),t.remove(),this.fireEvent("delete",t),(0,s.dispatch)("delete.hs.copyMarkup",t,t)},e.getInstance=function(t,e){var n=window.$hsCopyMarkupCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsCopyMarkupCollection||(window.$hsCopyMarkupCollection=[]),document.querySelectorAll("[data-hs-copy-markup]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsCopyMarkupCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-copy-markup"),o=n?JSON.parse(n):{};new e(t,o)}}))},e}(n(737).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=a),e.default=a},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=void 0;e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,a=window.innerHeight,l=s?r.top-s.top:r.top,u=(i?s.bottom:a)-r.bottom,c=t.clientHeight+o;return"bottom"===n?u>=c:"top"===n?l>=c:l>=c||u>=c};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}(413);return n})())); \ No newline at end of file +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=this.limit)return!1;this.el.hasAttribute("disabled")&&this.el.setAttribute("disabled","");var t=this.target.cloneNode(!0);this.addToItems(t),this.limit&&this.items.length>=this.limit&&this.el.setAttribute("disabled","disabled"),this.fireEvent("copy",t),(0,s.dispatch)("copy.hs.copyMarkup",t,t)},e.prototype.addPredefinedItems=function(){var t=this;Array.from(this.wrapper.children).filter((function(t){return!t.classList.contains("[--ignore-for-count]")})).forEach((function(e){t.addToItems(e)}))},e.prototype.setTarget=function(){var t="string"==typeof this.targetSelector?document.querySelector(this.targetSelector).cloneNode(!0):this.targetSelector.cloneNode(!0);t.removeAttribute("id"),this.target=t},e.prototype.setWrapper=function(){this.wrapper="string"==typeof this.wrapperSelector?document.querySelector(this.wrapperSelector):this.wrapperSelector},e.prototype.addToItems=function(t){var e=this,n=t.querySelector("[data-hs-copy-markup-delete-item]");this.wrapper?this.wrapper.append(t):this.el.before(t),n&&n.addEventListener("click",(function(){return e.delete(t)})),this.items.push(t)},e.prototype.delete=function(t){var e=this.items.indexOf(t);-1!==e&&this.items.splice(e,1),t.remove(),this.fireEvent("delete",t),(0,s.dispatch)("delete.hs.copyMarkup",t,t)},e.getInstance=function(t,e){var n=window.$hsCopyMarkupCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsCopyMarkupCollection||(window.$hsCopyMarkupCollection=[]),document.querySelectorAll("[data-hs-copy-markup]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsCopyMarkupCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-copy-markup"),o=n?JSON.parse(n):{};new e(t,o)}}))},e}(n(737).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=a),e.default=a},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0;e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,a=window.innerHeight,l=s?r.top-s.top:r.top,u=(i?s.bottom:a)-r.bottom,c=t.clientHeight+o;return"bottom"===n?u>=c:"top"===n?l>=c:l>=c||u>=c};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}(413);return n})())); \ No newline at end of file diff --git a/dist/dropdown.d.ts b/dist/dropdown.d.ts index 99ad6cc..b9c91c2 100644 --- a/dist/dropdown.d.ts +++ b/dist/dropdown.d.ts @@ -1,13 +1,5 @@ -export interface IDropdown { - options?: {}; - open(): void; - close(isAnimated: boolean): void; - forceClearState(): void; -} -export interface IHTMLElementPopper extends HTMLElement { - _popper: any; -} + export interface IBasePlugin { el: E; options?: O; @@ -26,6 +18,15 @@ export interface ICollectionItem { id: string | number; element: T; } +export interface IDropdown { + options?: {}; + open(): void; + close(isAnimated: boolean): void; + forceClearState(): void; +} +export interface IHTMLElementPopper extends HTMLElement { + _popper: any; +} declare class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> implements IDropdown { private static history; private readonly toggle; diff --git a/dist/dropdown.js b/dist/dropdown.js index 57421b3..35bfa1a 100644 --- a/dist/dropdown.js +++ b/dist/dropdown.js @@ -1,7 +1,7 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,(()=>(()=>{"use strict";var e={492:(e,t,n)=>{n.r(t),n.d(t,{afterMain:()=>x,afterRead:()=>g,afterWrite:()=>C,applyStyles:()=>_,arrow:()=>J,auto:()=>a,basePlacements:()=>l,beforeMain:()=>b,beforeRead:()=>y,beforeWrite:()=>O,bottom:()=>r,clippingParents:()=>u,computeStyles:()=>ne,createPopper:()=>_e,createPopperBase:()=>Te,createPopperLite:()=>je,detectOverflow:()=>we,end:()=>f,eventListeners:()=>re,flip:()=>ge,hide:()=>xe,left:()=>s,main:()=>E,modifierPhases:()=>L,offset:()=>Oe,placements:()=>v,popper:()=>d,popperGenerator:()=>De,popperOffsets:()=>Se,preventOverflow:()=>Ce,read:()=>w,reference:()=>h,right:()=>i,start:()=>c,top:()=>o,variationPlacements:()=>m,viewport:()=>p,write:()=>S});var o="top",r="bottom",i="right",s="left",a="auto",l=[o,r,i,s],c="start",f="end",u="clippingParents",p="viewport",d="popper",h="reference",m=l.reduce((function(e,t){return e.concat([t+"-"+c,t+"-"+f])}),[]),v=[].concat(l,[a]).reduce((function(e,t){return e.concat([t,t+"-"+c,t+"-"+f])}),[]),y="beforeRead",w="read",g="afterRead",b="beforeMain",E="main",x="afterMain",O="beforeWrite",S="write",C="afterWrite",L=[y,w,g,b,E,x,O,S,C];function A(e){return e?(e.nodeName||"").toLowerCase():null}function P(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function I(e){return e instanceof P(e).Element||e instanceof Element}function D(e){return e instanceof P(e).HTMLElement||e instanceof HTMLElement}function T(e){return"undefined"!=typeof ShadowRoot&&(e instanceof P(e).ShadowRoot||e instanceof ShadowRoot)}const _={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},r=t.elements[e];D(r)&&A(r)&&(Object.assign(r.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],r=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});D(o)&&A(o)&&(Object.assign(o.style,i),Object.keys(r).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]};function j(e){return e.split("-")[0]}var M=Math.max,H=Math.min,k=Math.round;function B(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function q(){return!/^((?!chrome|android).)*safari/i.test(B())}function W(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&D(e)&&(r=e.offsetWidth>0&&k(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&k(o.height)/e.offsetHeight||1);var s=(I(e)?P(e):window).visualViewport,a=!q()&&n,l=(o.left+(a&&s?s.offsetLeft:0))/r,c=(o.top+(a&&s?s.offsetTop:0))/i,f=o.width/r,u=o.height/i;return{width:f,height:u,top:c,right:l+f,bottom:c+u,left:l,x:l,y:c}}function R(e){var t=W(e),n=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function Y(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&T(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function $(e){return P(e).getComputedStyle(e)}function V(e){return["table","td","th"].indexOf(A(e))>=0}function K(e){return((I(e)?e.ownerDocument:e.document)||window.document).documentElement}function N(e){return"html"===A(e)?e:e.assignedSlot||e.parentNode||(T(e)?e.host:null)||K(e)}function U(e){return D(e)&&"fixed"!==$(e).position?e.offsetParent:null}function F(e){for(var t=P(e),n=U(e);n&&V(n)&&"static"===$(n).position;)n=U(n);return n&&("html"===A(n)||"body"===A(n)&&"static"===$(n).position)?t:n||function(e){var t=/firefox/i.test(B());if(/Trident/i.test(B())&&D(e)&&"fixed"===$(e).position)return null;var n=N(e);for(T(n)&&(n=n.host);D(n)&&["html","body"].indexOf(A(n))<0;){var o=$(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||t&&"filter"===o.willChange||t&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(e)||t}function z(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function X(e,t,n){return M(e,H(t,n))}function G(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Z(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}const J={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,a=e.name,c=e.options,f=n.elements.arrow,u=n.modifiersData.popperOffsets,p=j(n.placement),d=z(p),h=[s,i].indexOf(p)>=0?"height":"width";if(f&&u){var m=function(e,t){return G("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Z(e,l))}(c.padding,n),v=R(f),y="y"===d?o:s,w="y"===d?r:i,g=n.rects.reference[h]+n.rects.reference[d]-u[d]-n.rects.popper[h],b=u[d]-n.rects.reference[d],E=F(f),x=E?"y"===d?E.clientHeight||0:E.clientWidth||0:0,O=g/2-b/2,S=m[y],C=x-v[h]-m[w],L=x/2-v[h]/2+O,A=X(S,L,C),P=d;n.modifiersData[a]=((t={})[P]=A,t.centerOffset=A-L,t)}},effect:function(e){var t=e.state,n=e.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!=typeof o||(o=t.elements.popper.querySelector(o)))&&Y(t.elements.popper,o)&&(t.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Q(e){return e.split("-")[1]}var ee={top:"auto",right:"auto",bottom:"auto",left:"auto"};function te(e){var t,n=e.popper,a=e.popperRect,l=e.placement,c=e.variation,u=e.offsets,p=e.position,d=e.gpuAcceleration,h=e.adaptive,m=e.roundOffsets,v=e.isFixed,y=u.x,w=void 0===y?0:y,g=u.y,b=void 0===g?0:g,E="function"==typeof m?m({x:w,y:b}):{x:w,y:b};w=E.x,b=E.y;var x=u.hasOwnProperty("x"),O=u.hasOwnProperty("y"),S=s,C=o,L=window;if(h){var A=F(n),I="clientHeight",D="clientWidth";if(A===P(n)&&"static"!==$(A=K(n)).position&&"absolute"===p&&(I="scrollHeight",D="scrollWidth"),l===o||(l===s||l===i)&&c===f)C=r,b-=(v&&A===L&&L.visualViewport?L.visualViewport.height:A[I])-a.height,b*=d?1:-1;if(l===s||(l===o||l===r)&&c===f)S=i,w-=(v&&A===L&&L.visualViewport?L.visualViewport.width:A[D])-a.width,w*=d?1:-1}var T,_=Object.assign({position:p},h&&ee),j=!0===m?function(e,t){var n=e.x,o=e.y,r=t.devicePixelRatio||1;return{x:k(n*r)/r||0,y:k(o*r)/r||0}}({x:w,y:b},P(n)):{x:w,y:b};return w=j.x,b=j.y,d?Object.assign({},_,((T={})[C]=O?"0":"",T[S]=x?"0":"",T.transform=(L.devicePixelRatio||1)<=1?"translate("+w+"px, "+b+"px)":"translate3d("+w+"px, "+b+"px, 0)",T)):Object.assign({},_,((t={})[C]=O?b+"px":"",t[S]=x?w+"px":"",t.transform="",t))}const ne={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,o=n.gpuAcceleration,r=void 0===o||o,i=n.adaptive,s=void 0===i||i,a=n.roundOffsets,l=void 0===a||a,c={placement:j(t.placement),variation:Q(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,te(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,te(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var oe={passive:!0};const re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,o=e.options,r=o.scroll,i=void 0===r||r,s=o.resize,a=void 0===s||s,l=P(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,oe)})),a&&l.addEventListener("resize",n.update,oe),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,oe)})),a&&l.removeEventListener("resize",n.update,oe)}},data:{}};var ie={left:"right",right:"left",bottom:"top",top:"bottom"};function se(e){return e.replace(/left|right|bottom|top/g,(function(e){return ie[e]}))}var ae={start:"end",end:"start"};function le(e){return e.replace(/start|end/g,(function(e){return ae[e]}))}function ce(e){var t=P(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function fe(e){return W(K(e)).left+ce(e).scrollLeft}function ue(e){var t=$(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function pe(e){return["html","body","#document"].indexOf(A(e))>=0?e.ownerDocument.body:D(e)&&ue(e)?e:pe(N(e))}function de(e,t){var n;void 0===t&&(t=[]);var o=pe(e),r=o===(null==(n=e.ownerDocument)?void 0:n.body),i=P(o),s=r?[i].concat(i.visualViewport||[],ue(o)?o:[]):o,a=t.concat(s);return r?a:a.concat(de(N(s)))}function he(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function me(e,t,n){return t===p?he(function(e,t){var n=P(e),o=K(e),r=n.visualViewport,i=o.clientWidth,s=o.clientHeight,a=0,l=0;if(r){i=r.width,s=r.height;var c=q();(c||!c&&"fixed"===t)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:i,height:s,x:a+fe(e),y:l}}(e,n)):I(t)?function(e,t){var n=W(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):he(function(e){var t,n=K(e),o=ce(e),r=null==(t=e.ownerDocument)?void 0:t.body,i=M(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=M(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-o.scrollLeft+fe(e),l=-o.scrollTop;return"rtl"===$(r||n).direction&&(a+=M(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}(K(e)))}function ve(e,t,n,o){var r="clippingParents"===t?function(e){var t=de(N(e)),n=["absolute","fixed"].indexOf($(e).position)>=0&&D(e)?F(e):e;return I(n)?t.filter((function(e){return I(e)&&Y(e,n)&&"body"!==A(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),s=i[0],a=i.reduce((function(t,n){var r=me(e,n,o);return t.top=M(r.top,t.top),t.right=H(r.right,t.right),t.bottom=H(r.bottom,t.bottom),t.left=M(r.left,t.left),t}),me(e,s,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ye(e){var t,n=e.reference,a=e.element,l=e.placement,u=l?j(l):null,p=l?Q(l):null,d=n.x+n.width/2-a.width/2,h=n.y+n.height/2-a.height/2;switch(u){case o:t={x:d,y:n.y-a.height};break;case r:t={x:d,y:n.y+n.height};break;case i:t={x:n.x+n.width,y:h};break;case s:t={x:n.x-a.width,y:h};break;default:t={x:n.x,y:n.y}}var m=u?z(u):null;if(null!=m){var v="y"===m?"height":"width";switch(p){case c:t[m]=t[m]-(n[v]/2-a[v]/2);break;case f:t[m]=t[m]+(n[v]/2-a[v]/2)}}return t}function we(e,t){void 0===t&&(t={});var n=t,s=n.placement,a=void 0===s?e.placement:s,c=n.strategy,f=void 0===c?e.strategy:c,m=n.boundary,v=void 0===m?u:m,y=n.rootBoundary,w=void 0===y?p:y,g=n.elementContext,b=void 0===g?d:g,E=n.altBoundary,x=void 0!==E&&E,O=n.padding,S=void 0===O?0:O,C=G("number"!=typeof S?S:Z(S,l)),L=b===d?h:d,A=e.rects.popper,P=e.elements[x?L:b],D=ve(I(P)?P:P.contextElement||K(e.elements.popper),v,w,f),T=W(e.elements.reference),_=ye({reference:T,element:A,strategy:"absolute",placement:a}),j=he(Object.assign({},A,_)),M=b===d?j:T,H={top:D.top-M.top+C.top,bottom:M.bottom-D.bottom+C.bottom,left:D.left-M.left+C.left,right:M.right-D.right+C.right},k=e.modifiersData.offset;if(b===d&&k){var B=k[a];Object.keys(H).forEach((function(e){var t=[i,r].indexOf(e)>=0?1:-1,n=[o,r].indexOf(e)>=0?"y":"x";H[e]+=B[n]*t}))}return H}const ge={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,f=e.name;if(!t.modifiersData[f]._skip){for(var u=n.mainAxis,p=void 0===u||u,d=n.altAxis,h=void 0===d||d,y=n.fallbackPlacements,w=n.padding,g=n.boundary,b=n.rootBoundary,E=n.altBoundary,x=n.flipVariations,O=void 0===x||x,S=n.allowedAutoPlacements,C=t.options.placement,L=j(C),A=y||(L===C||!O?[se(C)]:function(e){if(j(e)===a)return[];var t=se(e);return[le(e),t,le(t)]}(C)),P=[C].concat(A).reduce((function(e,n){return e.concat(j(n)===a?function(e,t){void 0===t&&(t={});var n=t,o=n.placement,r=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,f=void 0===c?v:c,u=Q(o),p=u?a?m:m.filter((function(e){return Q(e)===u})):l,d=p.filter((function(e){return f.indexOf(e)>=0}));0===d.length&&(d=p);var h=d.reduce((function(t,n){return t[n]=we(e,{placement:n,boundary:r,rootBoundary:i,padding:s})[j(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}(t,{placement:n,boundary:g,rootBoundary:b,padding:w,flipVariations:O,allowedAutoPlacements:S}):n)}),[]),I=t.rects.reference,D=t.rects.popper,T=new Map,_=!0,M=P[0],H=0;H=0,R=W?"width":"height",Y=we(t,{placement:k,boundary:g,rootBoundary:b,altBoundary:E,padding:w}),$=W?q?i:s:q?r:o;I[R]>D[R]&&($=se($));var V=se($),K=[];if(p&&K.push(Y[B]<=0),h&&K.push(Y[$]<=0,Y[V]<=0),K.every((function(e){return e}))){M=k,_=!1;break}T.set(k,K)}if(_)for(var N=function(e){var t=P.find((function(t){var n=T.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return M=t,"break"},U=O?3:1;U>0;U--){if("break"===N(U))break}t.placement!==M&&(t.modifiersData[f]._skip=!0,t.placement=M,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function be(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Ee(e){return[o,i,r,s].some((function(t){return e[t]>=0}))}const xe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,o=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,s=we(t,{elementContext:"reference"}),a=we(t,{altBoundary:!0}),l=be(s,o),c=be(a,r,i),f=Ee(l),u=Ee(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":u})}};const Oe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,a=n.offset,l=void 0===a?[0,0]:a,c=v.reduce((function(e,n){return e[n]=function(e,t,n){var r=j(e),a=[s,o].indexOf(r)>=0?-1:1,l="function"==typeof n?n(Object.assign({},t,{placement:e})):n,c=l[0],f=l[1];return c=c||0,f=(f||0)*a,[s,i].indexOf(r)>=0?{x:f,y:c}:{x:c,y:f}}(n,t.rects,l),e}),{}),f=c[t.placement],u=f.x,p=f.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=p),t.modifiersData[r]=c}};const Se={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ye({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};const Ce={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,a=e.name,l=n.mainAxis,f=void 0===l||l,u=n.altAxis,p=void 0!==u&&u,d=n.boundary,h=n.rootBoundary,m=n.altBoundary,v=n.padding,y=n.tether,w=void 0===y||y,g=n.tetherOffset,b=void 0===g?0:g,E=we(t,{boundary:d,rootBoundary:h,padding:v,altBoundary:m}),x=j(t.placement),O=Q(t.placement),S=!O,C=z(x),L="x"===C?"y":"x",A=t.modifiersData.popperOffsets,P=t.rects.reference,I=t.rects.popper,D="function"==typeof b?b(Object.assign({},t.rects,{placement:t.placement})):b,T="number"==typeof D?{mainAxis:D,altAxis:D}:Object.assign({mainAxis:0,altAxis:0},D),_=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(A){if(f){var B,q="y"===C?o:s,W="y"===C?r:i,Y="y"===C?"height":"width",$=A[C],V=$+E[q],K=$-E[W],N=w?-I[Y]/2:0,U=O===c?P[Y]:I[Y],G=O===c?-I[Y]:-P[Y],Z=t.elements.arrow,J=w&&Z?R(Z):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[q],ne=ee[W],oe=X(0,P[Y],J[Y]),re=S?P[Y]/2-N-oe-te-T.mainAxis:U-oe-te-T.mainAxis,ie=S?-P[Y]/2+N+oe+ne+T.mainAxis:G+oe+ne+T.mainAxis,se=t.elements.arrow&&F(t.elements.arrow),ae=se?"y"===C?se.clientTop||0:se.clientLeft||0:0,le=null!=(B=null==_?void 0:_[C])?B:0,ce=$+ie-le,fe=X(w?H(V,$+re-le-ae):V,$,w?M(K,ce):K);A[C]=fe,k[C]=fe-$}if(p){var ue,pe="x"===C?o:s,de="x"===C?r:i,he=A[L],me="y"===L?"height":"width",ve=he+E[pe],ye=he-E[de],ge=-1!==[o,s].indexOf(x),be=null!=(ue=null==_?void 0:_[L])?ue:0,Ee=ge?ve:he-P[me]-I[me]-be+T.altAxis,xe=ge?he+P[me]+I[me]-be-T.altAxis:ye,Oe=w&&ge?function(e,t,n){var o=X(e,t,n);return o>n?n:o}(Ee,he,xe):X(w?Ee:ve,he,w?xe:ye);A[L]=Oe,k[L]=Oe-he}t.modifiersData[a]=k}},requiresIfExists:["offset"]};function Le(e,t,n){void 0===n&&(n=!1);var o,r,i=D(t),s=D(t)&&function(e){var t=e.getBoundingClientRect(),n=k(t.width)/e.offsetWidth||1,o=k(t.height)/e.offsetHeight||1;return 1!==n||1!==o}(t),a=K(t),l=W(e,s,n),c={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(i||!i&&!n)&&(("body"!==A(t)||ue(a))&&(c=(o=t)!==P(o)&&D(o)?{scrollLeft:(r=o).scrollLeft,scrollTop:r.scrollTop}:ce(o)),D(t)?((f=W(t,!0)).x+=t.clientLeft,f.y+=t.clientTop):a&&(f.x=fe(a))),{x:l.left+c.scrollLeft-f.x,y:l.top+c.scrollTop-f.y,width:l.width,height:l.height}}function Ae(e){var t=new Map,n=new Set,o=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var o=t.get(e);o&&r(o)}})),o.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),o}var Pe={placement:"bottom",modifiers:[],strategy:"absolute"};function Ie(){for(var e=arguments.length,t=new Array(e),n=0;n{Object.defineProperty(t,"__esModule",{value:!0}),t.COMBO_BOX_ACCESSIBILITY_KEY_SET=t.SELECT_ACCESSIBILITY_KEY_SET=t.TABS_ACCESSIBILITY_KEY_SET=t.OVERLAY_ACCESSIBILITY_KEY_SET=t.DROPDOWN_ACCESSIBILITY_KEY_SET=t.POSITIONS=void 0,t.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},t.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],t.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],t.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],t.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],t.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"]},737:(e,t)=>{ +!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,(()=>(()=>{"use strict";var e={492:(e,t,n)=>{n.r(t),n.d(t,{afterMain:()=>x,afterRead:()=>g,afterWrite:()=>C,applyStyles:()=>_,arrow:()=>J,auto:()=>a,basePlacements:()=>l,beforeMain:()=>b,beforeRead:()=>y,beforeWrite:()=>O,bottom:()=>r,clippingParents:()=>u,computeStyles:()=>ne,createPopper:()=>_e,createPopperBase:()=>De,createPopperLite:()=>je,detectOverflow:()=>we,end:()=>f,eventListeners:()=>re,flip:()=>ge,hide:()=>xe,left:()=>s,main:()=>E,modifierPhases:()=>L,offset:()=>Oe,placements:()=>v,popper:()=>d,popperGenerator:()=>Te,popperOffsets:()=>Se,preventOverflow:()=>Ce,read:()=>w,reference:()=>h,right:()=>i,start:()=>c,top:()=>o,variationPlacements:()=>m,viewport:()=>p,write:()=>S});var o="top",r="bottom",i="right",s="left",a="auto",l=[o,r,i,s],c="start",f="end",u="clippingParents",p="viewport",d="popper",h="reference",m=l.reduce((function(e,t){return e.concat([t+"-"+c,t+"-"+f])}),[]),v=[].concat(l,[a]).reduce((function(e,t){return e.concat([t,t+"-"+c,t+"-"+f])}),[]),y="beforeRead",w="read",g="afterRead",b="beforeMain",E="main",x="afterMain",O="beforeWrite",S="write",C="afterWrite",L=[y,w,g,b,E,x,O,S,C];function A(e){return e?(e.nodeName||"").toLowerCase():null}function P(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function I(e){return e instanceof P(e).Element||e instanceof Element}function T(e){return e instanceof P(e).HTMLElement||e instanceof HTMLElement}function D(e){return"undefined"!=typeof ShadowRoot&&(e instanceof P(e).ShadowRoot||e instanceof ShadowRoot)}const _={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},r=t.elements[e];T(r)&&A(r)&&(Object.assign(r.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],r=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});T(o)&&A(o)&&(Object.assign(o.style,i),Object.keys(r).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]};function j(e){return e.split("-")[0]}var M=Math.max,H=Math.min,B=Math.round;function k(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function R(){return!/^((?!chrome|android).)*safari/i.test(k())}function q(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&T(e)&&(r=e.offsetWidth>0&&B(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&B(o.height)/e.offsetHeight||1);var s=(I(e)?P(e):window).visualViewport,a=!R()&&n,l=(o.left+(a&&s?s.offsetLeft:0))/r,c=(o.top+(a&&s?s.offsetTop:0))/i,f=o.width/r,u=o.height/i;return{width:f,height:u,top:c,right:l+f,bottom:c+u,left:l,x:l,y:c}}function W(e){var t=q(e),n=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function Y(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&D(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function $(e){return P(e).getComputedStyle(e)}function V(e){return["table","td","th"].indexOf(A(e))>=0}function N(e){return((I(e)?e.ownerDocument:e.document)||window.document).documentElement}function K(e){return"html"===A(e)?e:e.assignedSlot||e.parentNode||(D(e)?e.host:null)||N(e)}function F(e){return T(e)&&"fixed"!==$(e).position?e.offsetParent:null}function U(e){for(var t=P(e),n=F(e);n&&V(n)&&"static"===$(n).position;)n=F(n);return n&&("html"===A(n)||"body"===A(n)&&"static"===$(n).position)?t:n||function(e){var t=/firefox/i.test(k());if(/Trident/i.test(k())&&T(e)&&"fixed"===$(e).position)return null;var n=K(e);for(D(n)&&(n=n.host);T(n)&&["html","body"].indexOf(A(n))<0;){var o=$(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||t&&"filter"===o.willChange||t&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(e)||t}function z(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function X(e,t,n){return M(e,H(t,n))}function G(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Z(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}const J={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,a=e.name,c=e.options,f=n.elements.arrow,u=n.modifiersData.popperOffsets,p=j(n.placement),d=z(p),h=[s,i].indexOf(p)>=0?"height":"width";if(f&&u){var m=function(e,t){return G("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Z(e,l))}(c.padding,n),v=W(f),y="y"===d?o:s,w="y"===d?r:i,g=n.rects.reference[h]+n.rects.reference[d]-u[d]-n.rects.popper[h],b=u[d]-n.rects.reference[d],E=U(f),x=E?"y"===d?E.clientHeight||0:E.clientWidth||0:0,O=g/2-b/2,S=m[y],C=x-v[h]-m[w],L=x/2-v[h]/2+O,A=X(S,L,C),P=d;n.modifiersData[a]=((t={})[P]=A,t.centerOffset=A-L,t)}},effect:function(e){var t=e.state,n=e.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!=typeof o||(o=t.elements.popper.querySelector(o)))&&Y(t.elements.popper,o)&&(t.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Q(e){return e.split("-")[1]}var ee={top:"auto",right:"auto",bottom:"auto",left:"auto"};function te(e){var t,n=e.popper,a=e.popperRect,l=e.placement,c=e.variation,u=e.offsets,p=e.position,d=e.gpuAcceleration,h=e.adaptive,m=e.roundOffsets,v=e.isFixed,y=u.x,w=void 0===y?0:y,g=u.y,b=void 0===g?0:g,E="function"==typeof m?m({x:w,y:b}):{x:w,y:b};w=E.x,b=E.y;var x=u.hasOwnProperty("x"),O=u.hasOwnProperty("y"),S=s,C=o,L=window;if(h){var A=U(n),I="clientHeight",T="clientWidth";if(A===P(n)&&"static"!==$(A=N(n)).position&&"absolute"===p&&(I="scrollHeight",T="scrollWidth"),l===o||(l===s||l===i)&&c===f)C=r,b-=(v&&A===L&&L.visualViewport?L.visualViewport.height:A[I])-a.height,b*=d?1:-1;if(l===s||(l===o||l===r)&&c===f)S=i,w-=(v&&A===L&&L.visualViewport?L.visualViewport.width:A[T])-a.width,w*=d?1:-1}var D,_=Object.assign({position:p},h&&ee),j=!0===m?function(e,t){var n=e.x,o=e.y,r=t.devicePixelRatio||1;return{x:B(n*r)/r||0,y:B(o*r)/r||0}}({x:w,y:b},P(n)):{x:w,y:b};return w=j.x,b=j.y,d?Object.assign({},_,((D={})[C]=O?"0":"",D[S]=x?"0":"",D.transform=(L.devicePixelRatio||1)<=1?"translate("+w+"px, "+b+"px)":"translate3d("+w+"px, "+b+"px, 0)",D)):Object.assign({},_,((t={})[C]=O?b+"px":"",t[S]=x?w+"px":"",t.transform="",t))}const ne={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,o=n.gpuAcceleration,r=void 0===o||o,i=n.adaptive,s=void 0===i||i,a=n.roundOffsets,l=void 0===a||a,c={placement:j(t.placement),variation:Q(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,te(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,te(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var oe={passive:!0};const re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,o=e.options,r=o.scroll,i=void 0===r||r,s=o.resize,a=void 0===s||s,l=P(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,oe)})),a&&l.addEventListener("resize",n.update,oe),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,oe)})),a&&l.removeEventListener("resize",n.update,oe)}},data:{}};var ie={left:"right",right:"left",bottom:"top",top:"bottom"};function se(e){return e.replace(/left|right|bottom|top/g,(function(e){return ie[e]}))}var ae={start:"end",end:"start"};function le(e){return e.replace(/start|end/g,(function(e){return ae[e]}))}function ce(e){var t=P(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function fe(e){return q(N(e)).left+ce(e).scrollLeft}function ue(e){var t=$(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function pe(e){return["html","body","#document"].indexOf(A(e))>=0?e.ownerDocument.body:T(e)&&ue(e)?e:pe(K(e))}function de(e,t){var n;void 0===t&&(t=[]);var o=pe(e),r=o===(null==(n=e.ownerDocument)?void 0:n.body),i=P(o),s=r?[i].concat(i.visualViewport||[],ue(o)?o:[]):o,a=t.concat(s);return r?a:a.concat(de(K(s)))}function he(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function me(e,t,n){return t===p?he(function(e,t){var n=P(e),o=N(e),r=n.visualViewport,i=o.clientWidth,s=o.clientHeight,a=0,l=0;if(r){i=r.width,s=r.height;var c=R();(c||!c&&"fixed"===t)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:i,height:s,x:a+fe(e),y:l}}(e,n)):I(t)?function(e,t){var n=q(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):he(function(e){var t,n=N(e),o=ce(e),r=null==(t=e.ownerDocument)?void 0:t.body,i=M(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=M(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-o.scrollLeft+fe(e),l=-o.scrollTop;return"rtl"===$(r||n).direction&&(a+=M(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}(N(e)))}function ve(e,t,n,o){var r="clippingParents"===t?function(e){var t=de(K(e)),n=["absolute","fixed"].indexOf($(e).position)>=0&&T(e)?U(e):e;return I(n)?t.filter((function(e){return I(e)&&Y(e,n)&&"body"!==A(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),s=i[0],a=i.reduce((function(t,n){var r=me(e,n,o);return t.top=M(r.top,t.top),t.right=H(r.right,t.right),t.bottom=H(r.bottom,t.bottom),t.left=M(r.left,t.left),t}),me(e,s,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ye(e){var t,n=e.reference,a=e.element,l=e.placement,u=l?j(l):null,p=l?Q(l):null,d=n.x+n.width/2-a.width/2,h=n.y+n.height/2-a.height/2;switch(u){case o:t={x:d,y:n.y-a.height};break;case r:t={x:d,y:n.y+n.height};break;case i:t={x:n.x+n.width,y:h};break;case s:t={x:n.x-a.width,y:h};break;default:t={x:n.x,y:n.y}}var m=u?z(u):null;if(null!=m){var v="y"===m?"height":"width";switch(p){case c:t[m]=t[m]-(n[v]/2-a[v]/2);break;case f:t[m]=t[m]+(n[v]/2-a[v]/2)}}return t}function we(e,t){void 0===t&&(t={});var n=t,s=n.placement,a=void 0===s?e.placement:s,c=n.strategy,f=void 0===c?e.strategy:c,m=n.boundary,v=void 0===m?u:m,y=n.rootBoundary,w=void 0===y?p:y,g=n.elementContext,b=void 0===g?d:g,E=n.altBoundary,x=void 0!==E&&E,O=n.padding,S=void 0===O?0:O,C=G("number"!=typeof S?S:Z(S,l)),L=b===d?h:d,A=e.rects.popper,P=e.elements[x?L:b],T=ve(I(P)?P:P.contextElement||N(e.elements.popper),v,w,f),D=q(e.elements.reference),_=ye({reference:D,element:A,strategy:"absolute",placement:a}),j=he(Object.assign({},A,_)),M=b===d?j:D,H={top:T.top-M.top+C.top,bottom:M.bottom-T.bottom+C.bottom,left:T.left-M.left+C.left,right:M.right-T.right+C.right},B=e.modifiersData.offset;if(b===d&&B){var k=B[a];Object.keys(H).forEach((function(e){var t=[i,r].indexOf(e)>=0?1:-1,n=[o,r].indexOf(e)>=0?"y":"x";H[e]+=k[n]*t}))}return H}const ge={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,f=e.name;if(!t.modifiersData[f]._skip){for(var u=n.mainAxis,p=void 0===u||u,d=n.altAxis,h=void 0===d||d,y=n.fallbackPlacements,w=n.padding,g=n.boundary,b=n.rootBoundary,E=n.altBoundary,x=n.flipVariations,O=void 0===x||x,S=n.allowedAutoPlacements,C=t.options.placement,L=j(C),A=y||(L===C||!O?[se(C)]:function(e){if(j(e)===a)return[];var t=se(e);return[le(e),t,le(t)]}(C)),P=[C].concat(A).reduce((function(e,n){return e.concat(j(n)===a?function(e,t){void 0===t&&(t={});var n=t,o=n.placement,r=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,f=void 0===c?v:c,u=Q(o),p=u?a?m:m.filter((function(e){return Q(e)===u})):l,d=p.filter((function(e){return f.indexOf(e)>=0}));0===d.length&&(d=p);var h=d.reduce((function(t,n){return t[n]=we(e,{placement:n,boundary:r,rootBoundary:i,padding:s})[j(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}(t,{placement:n,boundary:g,rootBoundary:b,padding:w,flipVariations:O,allowedAutoPlacements:S}):n)}),[]),I=t.rects.reference,T=t.rects.popper,D=new Map,_=!0,M=P[0],H=0;H=0,W=q?"width":"height",Y=we(t,{placement:B,boundary:g,rootBoundary:b,altBoundary:E,padding:w}),$=q?R?i:s:R?r:o;I[W]>T[W]&&($=se($));var V=se($),N=[];if(p&&N.push(Y[k]<=0),h&&N.push(Y[$]<=0,Y[V]<=0),N.every((function(e){return e}))){M=B,_=!1;break}D.set(B,N)}if(_)for(var K=function(e){var t=P.find((function(t){var n=D.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return M=t,"break"},F=O?3:1;F>0;F--){if("break"===K(F))break}t.placement!==M&&(t.modifiersData[f]._skip=!0,t.placement=M,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function be(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Ee(e){return[o,i,r,s].some((function(t){return e[t]>=0}))}const xe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,o=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,s=we(t,{elementContext:"reference"}),a=we(t,{altBoundary:!0}),l=be(s,o),c=be(a,r,i),f=Ee(l),u=Ee(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":u})}};const Oe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,a=n.offset,l=void 0===a?[0,0]:a,c=v.reduce((function(e,n){return e[n]=function(e,t,n){var r=j(e),a=[s,o].indexOf(r)>=0?-1:1,l="function"==typeof n?n(Object.assign({},t,{placement:e})):n,c=l[0],f=l[1];return c=c||0,f=(f||0)*a,[s,i].indexOf(r)>=0?{x:f,y:c}:{x:c,y:f}}(n,t.rects,l),e}),{}),f=c[t.placement],u=f.x,p=f.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=p),t.modifiersData[r]=c}};const Se={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ye({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};const Ce={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,a=e.name,l=n.mainAxis,f=void 0===l||l,u=n.altAxis,p=void 0!==u&&u,d=n.boundary,h=n.rootBoundary,m=n.altBoundary,v=n.padding,y=n.tether,w=void 0===y||y,g=n.tetherOffset,b=void 0===g?0:g,E=we(t,{boundary:d,rootBoundary:h,padding:v,altBoundary:m}),x=j(t.placement),O=Q(t.placement),S=!O,C=z(x),L="x"===C?"y":"x",A=t.modifiersData.popperOffsets,P=t.rects.reference,I=t.rects.popper,T="function"==typeof b?b(Object.assign({},t.rects,{placement:t.placement})):b,D="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),_=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,B={x:0,y:0};if(A){if(f){var k,R="y"===C?o:s,q="y"===C?r:i,Y="y"===C?"height":"width",$=A[C],V=$+E[R],N=$-E[q],K=w?-I[Y]/2:0,F=O===c?P[Y]:I[Y],G=O===c?-I[Y]:-P[Y],Z=t.elements.arrow,J=w&&Z?W(Z):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[R],ne=ee[q],oe=X(0,P[Y],J[Y]),re=S?P[Y]/2-K-oe-te-D.mainAxis:F-oe-te-D.mainAxis,ie=S?-P[Y]/2+K+oe+ne+D.mainAxis:G+oe+ne+D.mainAxis,se=t.elements.arrow&&U(t.elements.arrow),ae=se?"y"===C?se.clientTop||0:se.clientLeft||0:0,le=null!=(k=null==_?void 0:_[C])?k:0,ce=$+ie-le,fe=X(w?H(V,$+re-le-ae):V,$,w?M(N,ce):N);A[C]=fe,B[C]=fe-$}if(p){var ue,pe="x"===C?o:s,de="x"===C?r:i,he=A[L],me="y"===L?"height":"width",ve=he+E[pe],ye=he-E[de],ge=-1!==[o,s].indexOf(x),be=null!=(ue=null==_?void 0:_[L])?ue:0,Ee=ge?ve:he-P[me]-I[me]-be+D.altAxis,xe=ge?he+P[me]+I[me]-be-D.altAxis:ye,Oe=w&&ge?function(e,t,n){var o=X(e,t,n);return o>n?n:o}(Ee,he,xe):X(w?Ee:ve,he,w?xe:ye);A[L]=Oe,B[L]=Oe-he}t.modifiersData[a]=B}},requiresIfExists:["offset"]};function Le(e,t,n){void 0===n&&(n=!1);var o,r,i=T(t),s=T(t)&&function(e){var t=e.getBoundingClientRect(),n=B(t.width)/e.offsetWidth||1,o=B(t.height)/e.offsetHeight||1;return 1!==n||1!==o}(t),a=N(t),l=q(e,s,n),c={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(i||!i&&!n)&&(("body"!==A(t)||ue(a))&&(c=(o=t)!==P(o)&&T(o)?{scrollLeft:(r=o).scrollLeft,scrollTop:r.scrollTop}:ce(o)),T(t)?((f=q(t,!0)).x+=t.clientLeft,f.y+=t.clientTop):a&&(f.x=fe(a))),{x:l.left+c.scrollLeft-f.x,y:l.top+c.scrollTop-f.y,width:l.width,height:l.height}}function Ae(e){var t=new Map,n=new Set,o=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var o=t.get(e);o&&r(o)}})),o.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),o}var Pe={placement:"bottom",modifiers:[],strategy:"absolute"};function Ie(){for(var e=arguments.length,t=new Array(e),n=0;n{Object.defineProperty(t,"__esModule",{value:!0}),t.BREAKPOINTS=t.COMBO_BOX_ACCESSIBILITY_KEY_SET=t.SELECT_ACCESSIBILITY_KEY_SET=t.TABS_ACCESSIBILITY_KEY_SET=t.OVERLAY_ACCESSIBILITY_KEY_SET=t.DROPDOWN_ACCESSIBILITY_KEY_SET=t.POSITIONS=void 0,t.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},t.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],t.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],t.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],t.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],t.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],t.BREAKPOINTS={sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},737:(e,t)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,9 +9,9 @@ Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t,n){this.el=e,this.options=t,this.events=n,this.el=e,this.options=t,this.events={}}return e.prototype.createCollection=function(e,t){var n;e.push({id:(null===(n=null==t?void 0:t.el)||void 0===n?void 0:n.id)||e.length+1,element:t})},e.prototype.fireEvent=function(e,t){if(void 0===t&&(t=null),this.events.hasOwnProperty(e))return this.events[e](t)},e.prototype.on=function(e,t){this.events[e]=t},e}();t.default=n},610:function(e,t,n){ /* * HSDropdown - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r .hs-dropdown-toggle")||r.el.children[0],r.menu=r.el.querySelector(":scope > .hs-dropdown-menu"),r.eventMode=(0,s.getClassProperty)(r.el,"--trigger","click"),r.closeMode=(0,s.getClassProperty)(r.el,"--auto-close","true"),r.animationInProcess=!1,r.toggle&&r.menu&&r.init(),r}return r(t,e),t.prototype.init=function(){var e=this;if(this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle.addEventListener("click",(function(){return e.onClickHandler()})),(0,s.isIOS)()||(0,s.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return e.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return e.onMouseLeaveHandler()})))},t.prototype.resizeHandler=function(){this.eventMode=(0,s.getClassProperty)(this.el,"--trigger","click")},t.prototype.onClickHandler=function(){this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?this.close():this.open()},t.prototype.onMouseEnterHandler=function(){if("hover"!==this.eventMode)return!1;this.el._popper&&this.forceClearState(),!this.el.classList.contains("open")&&this.menu.classList.contains("hidden")&&this.open()},t.prototype.onMouseLeaveHandler=function(){if("hover"!==this.eventMode)return!1;this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")&&this.close()},t.prototype.destroyPopper=function(){this.menu.classList.remove("block"),this.menu.classList.add("hidden"),this.menu.style.inset=null,this.menu.style.position=null,this.el&&this.el._popper&&this.el._popper.destroy(),this.animationInProcess=!1},t.prototype.absoluteStrategyModifiers=function(){var e=this;return[{name:"applyStyles",fn:function(t){var n=(window.getComputedStyle(e.el).getPropertyValue("--strategy")||"absolute").replace(" ",""),o=(window.getComputedStyle(e.el).getPropertyValue("--adaptive")||"adaptive").replace(" ","");t.state.elements.popper.style.position=n,t.state.elements.popper.style.transform="adaptive"===o?t.state.styles.popper.transform:null,t.state.elements.popper.style.top=null,t.state.elements.popper.style.bottom=null,t.state.elements.popper.style.left=null,t.state.elements.popper.style.right=null,t.state.elements.popper.style.margin=0}},{name:"computeStyles",options:{adaptive:!1}}]},t.prototype.open=function(){var e=this;if(this.el.classList.contains("open"))return!1;if(this.animationInProcess)return!1;this.animationInProcess=!0;var t=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),n=(window.getComputedStyle(this.el).getPropertyValue("--flip")||"true").replace(" ",""),o=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),r=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ",""));"static"!==o&&(this.el._popper=(0,a.createPopper)(this.el,this.menu,{placement:c.POSITIONS[t]||"bottom-start",strategy:o,modifiers:i(i([],"fixed"!==o?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===n},{name:"offset",options:{offset:[0,r]}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){e.el.classList.add("open"),e.animationInProcess=!1})),this.fireEvent("open",this.el),(0,s.dispatch)("open.hs.dropdown",this.el,this.el)},t.prototype.close=function(e){var t=this;if(void 0===e&&(e=!0),this.animationInProcess||!this.el.classList.contains("open"))return!1;if(this.animationInProcess=!0,e){var n=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,s.afterTransition)(n,(function(){return t.destroyPopper()}))}else this.destroyPopper();this.menu.style.margin=null,this.el.classList.remove("open"),this.fireEvent("close",this.el),(0,s.dispatch)("close.hs.dropdown",this.el,this.el)},t.prototype.forceClearState=function(){this.destroyPopper(),this.menu.style.margin=null,this.el.classList.remove("open")},t.getInstance=function(e,t){var n=window.$hsDropdownCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));return n?t?n:n.element.el:null},t.autoInit=function(){if(window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),document.querySelectorAll(".hs-dropdown:not(.--prevent-on-load-init)").forEach((function(e){window.$hsDropdownCollection.find((function(t){var n;return(null===(n=null==t?void 0:t.element)||void 0===n?void 0:n.el)===e}))||new t(e)})),window.$hsDropdownCollection){document.addEventListener("keydown",(function(e){return t.accessibility(e)})),window.addEventListener("click",(function(e){var n=e.target;t.closeCurrentlyOpened(n)}));var e=window.innerWidth;window.addEventListener("resize",(function(){window.innerWidth!==e&&(e=innerWidth,t.closeCurrentlyOpened(null,!1))}))}},t.open=function(e){var t=window.$hsDropdownCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));t&&t.element.menu.classList.contains("hidden")&&t.element.open()},t.close=function(e){var t=window.$hsDropdownCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));t&&!t.element.menu.classList.contains("hidden")&&t.element.close()},t.accessibility=function(e){this.history=s.menuSearchHistory;var t=window.$hsDropdownCollection.find((function(e){return e.element.el.classList.contains("open")}));if(t&&(c.DROPDOWN_ACCESSIBILITY_KEY_SET.includes(e.code)||4===e.code.length&&e.code[e.code.length-1].match(/^[A-Z]*$/))&&!e.metaKey&&!t.element.menu.querySelector("input:focus"))switch(console.log("Key code:",e.code),e.code){case"Escape":t.element.menu.querySelector(".hs-select.active")||(e.preventDefault(),this.onEscape(e));break;case"Enter":t.element.menu.querySelector(".hs-select button:focus")||t.element.menu.querySelector(".hs-collapse-toggle:focus")||this.onEnter(e);break;case"ArrowUp":e.preventDefault(),this.onArrow();break;case"ArrowDown":e.preventDefault(),this.onArrow(!1);break;case"Home":e.preventDefault(),this.onStartEnd();break;case"End":e.preventDefault(),this.onStartEnd(!1);break;default:e.preventDefault(),this.onFirstLetter(e.key)}},t.onEscape=function(e){var t=e.target.closest(".hs-dropdown.open");if(window.$hsDropdownCollection.find((function(e){return e.element.el===t}))){var n=window.$hsDropdownCollection.find((function(e){return e.element.el===t}));n&&(n.element.close(),n.element.toggle.focus())}else this.closeCurrentlyOpened()},t.onEnter=function(e){var t=e.target.parentElement;if(window.$hsDropdownCollection.find((function(e){return e.element.el===t}))){e.preventDefault();var n=window.$hsDropdownCollection.find((function(e){return e.element.el===t}));n&&n.element.open()}},t.onArrow=function(e){void 0===e&&(e=!0);var t=window.$hsDropdownCollection.find((function(e){return e.element.el.classList.contains("open")}));if(t){var n=t.element.menu;if(!n)return!1;var o=(e?Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])")).reverse():Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])"))).filter((function(e){return!e.classList.contains("disabled")})),r=n.querySelector("a:focus, button:focus"),i=o.findIndex((function(e){return e===r}));i+12&&/MacIntel/.test(navigator.platform)};t.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};t.isEnoughSpace=function(e,t,n,o,r){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===r&&(r=null);var i=t.getBoundingClientRect(),s=r?r.getBoundingClientRect():null,a=window.innerHeight,l=s?i.top-s.top:i.top,c=(r?s.bottom:a)-i.bottom,f=e.clientHeight+o;return"bottom"===n?c>=f:"top"===n?l>=f:l>=f||c>=f};t.isFormElement=function(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement};var o=function(e){return!!e&&("none"===window.getComputedStyle(e).display||o(e.parentElement))};t.isParentOrElementHidden=o;t.debounce=function(e,t){var o;return void 0===t&&(t=200),function(){for(var r=[],i=0;ithis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}return n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(610)})())); \ No newline at end of file +var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r .hs-dropdown-toggle")||r.el.children[0],r.menu=r.el.querySelector(":scope > .hs-dropdown-menu"),r.eventMode=(0,s.getClassProperty)(r.el,"--trigger","click"),r.closeMode=(0,s.getClassProperty)(r.el,"--auto-close","true"),r.animationInProcess=!1,r.toggle&&r.menu&&r.init(),r}return r(t,e),t.prototype.init=function(){var e=this;if(this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle.addEventListener("click",(function(){return e.onClickHandler()})),(0,s.isIOS)()||(0,s.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return e.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return e.onMouseLeaveHandler()})))},t.prototype.resizeHandler=function(){this.eventMode=(0,s.getClassProperty)(this.el,"--trigger","click")},t.prototype.onClickHandler=function(){this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?this.close():this.open()},t.prototype.onMouseEnterHandler=function(){if("hover"!==this.eventMode)return!1;this.el._popper&&this.forceClearState(),!this.el.classList.contains("open")&&this.menu.classList.contains("hidden")&&this.open()},t.prototype.onMouseLeaveHandler=function(){if("hover"!==this.eventMode)return!1;this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")&&this.close()},t.prototype.destroyPopper=function(){this.menu.classList.remove("block"),this.menu.classList.add("hidden"),this.menu.style.inset=null,this.menu.style.position=null,this.el&&this.el._popper&&this.el._popper.destroy(),this.animationInProcess=!1},t.prototype.absoluteStrategyModifiers=function(){var e=this;return[{name:"applyStyles",fn:function(t){var n=(window.getComputedStyle(e.el).getPropertyValue("--strategy")||"absolute").replace(" ",""),o=(window.getComputedStyle(e.el).getPropertyValue("--adaptive")||"adaptive").replace(" ","");t.state.elements.popper.style.position=n,t.state.elements.popper.style.transform="adaptive"===o?t.state.styles.popper.transform:null,t.state.elements.popper.style.top=null,t.state.elements.popper.style.bottom=null,t.state.elements.popper.style.left=null,t.state.elements.popper.style.right=null,t.state.elements.popper.style.margin=0}},{name:"computeStyles",options:{adaptive:!1}}]},t.prototype.open=function(){var e=this;if(this.el.classList.contains("open"))return!1;if(this.animationInProcess)return!1;this.animationInProcess=!0;var t=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),n=(window.getComputedStyle(this.el).getPropertyValue("--flip")||"true").replace(" ",""),o=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),r=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ",""));"static"!==o&&(this.el._popper=(0,a.createPopper)(this.el,this.menu,{placement:c.POSITIONS[t]||"bottom-start",strategy:o,modifiers:i(i([],"fixed"!==o?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===n},{name:"offset",options:{offset:[0,r]}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){e.el.classList.add("open"),e.animationInProcess=!1})),this.fireEvent("open",this.el),(0,s.dispatch)("open.hs.dropdown",this.el,this.el)},t.prototype.close=function(e){var t=this;if(void 0===e&&(e=!0),this.animationInProcess||!this.el.classList.contains("open"))return!1;if(this.animationInProcess=!0,e){var n=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,s.afterTransition)(n,(function(){return t.destroyPopper()}))}else this.destroyPopper();this.menu.style.margin=null,this.el.classList.remove("open"),this.fireEvent("close",this.el),(0,s.dispatch)("close.hs.dropdown",this.el,this.el)},t.prototype.forceClearState=function(){this.destroyPopper(),this.menu.style.margin=null,this.el.classList.remove("open")},t.getInstance=function(e,t){var n=window.$hsDropdownCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));return n?t?n:n.element.el:null},t.autoInit=function(){if(window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),document.querySelectorAll(".hs-dropdown:not(.--prevent-on-load-init)").forEach((function(e){window.$hsDropdownCollection.find((function(t){var n;return(null===(n=null==t?void 0:t.element)||void 0===n?void 0:n.el)===e}))||new t(e)})),window.$hsDropdownCollection){document.addEventListener("keydown",(function(e){return t.accessibility(e)})),window.addEventListener("click",(function(e){var n=e.target;t.closeCurrentlyOpened(n)}));var e=window.innerWidth;window.addEventListener("resize",(function(){window.innerWidth!==e&&(e=innerWidth,t.closeCurrentlyOpened(null,!1))}))}},t.open=function(e){var t=window.$hsDropdownCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));t&&t.element.menu.classList.contains("hidden")&&t.element.open()},t.close=function(e){var t=window.$hsDropdownCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));t&&!t.element.menu.classList.contains("hidden")&&t.element.close()},t.accessibility=function(e){this.history=s.menuSearchHistory;var t=window.$hsDropdownCollection.find((function(e){return e.element.el.classList.contains("open")}));if(t&&(c.DROPDOWN_ACCESSIBILITY_KEY_SET.includes(e.code)||4===e.code.length&&e.code[e.code.length-1].match(/^[A-Z]*$/))&&!e.metaKey&&!t.element.menu.querySelector("input:focus"))switch(e.code){case"Escape":t.element.menu.querySelector(".hs-select.active")||(e.preventDefault(),this.onEscape(e));break;case"Enter":t.element.menu.querySelector(".hs-select button:focus")||t.element.menu.querySelector(".hs-collapse-toggle:focus")||this.onEnter(e);break;case"ArrowUp":e.preventDefault(),this.onArrow();break;case"ArrowDown":e.preventDefault(),this.onArrow(!1);break;case"Home":e.preventDefault(),this.onStartEnd();break;case"End":e.preventDefault(),this.onStartEnd(!1);break;default:e.preventDefault(),this.onFirstLetter(e.key)}},t.onEscape=function(e){var t=e.target.closest(".hs-dropdown.open");if(window.$hsDropdownCollection.find((function(e){return e.element.el===t}))){var n=window.$hsDropdownCollection.find((function(e){return e.element.el===t}));n&&(n.element.close(),n.element.toggle.focus())}else this.closeCurrentlyOpened()},t.onEnter=function(e){var t=e.target.parentElement;if(window.$hsDropdownCollection.find((function(e){return e.element.el===t}))){e.preventDefault();var n=window.$hsDropdownCollection.find((function(e){return e.element.el===t}));n&&n.element.open()}},t.onArrow=function(e){void 0===e&&(e=!0);var t=window.$hsDropdownCollection.find((function(e){return e.element.el.classList.contains("open")}));if(t){var n=t.element.menu;if(!n)return!1;var o=(e?Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])")).reverse():Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])"))).filter((function(e){return!e.classList.contains("disabled")})),r=n.querySelector("a:focus, button:focus"),i=o.findIndex((function(e){return e===r}));i+12&&/MacIntel/.test(navigator.platform)};t.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};t.isEnoughSpace=function(e,t,n,o,r){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===r&&(r=null);var i=t.getBoundingClientRect(),s=r?r.getBoundingClientRect():null,a=window.innerHeight,l=s?i.top-s.top:i.top,c=(r?s.bottom:a)-i.bottom,f=e.clientHeight+o;return"bottom"===n?c>=f:"top"===n?l>=f:l>=f||c>=f};t.isFormElement=function(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement};var o=function(e){return!!e&&("none"===window.getComputedStyle(e).display||o(e.parentElement))};t.isParentOrElementHidden=o;t.debounce=function(e,t){var o;return void 0===t&&(t=200),function(){for(var r=[],i=0;ithis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}return n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(610)})())); \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts index c0821f3..4a5bc11 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -1,4 +1,5 @@ + export interface ICopyMarkupOptions { targetSelector: string; wrapperSelector: string; @@ -131,6 +132,112 @@ export declare class HSCollapse extends HSBasePlugin<{}> implements ICollapse { static hide(target: HTMLElement): void; static on(evt: string, target: HTMLElement, cb: Function): void; } +export interface IComboBoxOptions { + gap?: number; + viewport?: string | HTMLElement | null; + preventVisibility?: boolean; + apiUrl?: string | null; + apiDataPart?: string | null; + apiQuery?: string | null; + apiSearchQuery?: string | null; + apiHeaders?: {}; + apiGroupField?: string | null; + outputItemTemplate?: string | null; + outputEmptyTemplate?: string | null; + outputLoaderTemplate?: string | null; + groupingType?: "default" | "tabs" | null; + groupingTitleTemplate?: string | null; + tabsWrapperTemplate?: string | null; + preventSelection?: boolean; + isOpenOnFocus?: boolean; +} +export interface IComboBox { + options?: IComboBoxOptions; + open(): void; + close(): void; + recalculateDirection(): void; +} +export declare class HSComboBox extends HSBasePlugin implements IComboBox { + gap: number; + viewport: string | HTMLElement | null; + preventVisibility: boolean; + apiUrl: string | null; + apiDataPart: string | null; + apiQuery: string | null; + apiSearchQuery: string | null; + apiHeaders: {}; + apiGroupField: string | null; + outputItemTemplate: string | null; + outputEmptyTemplate: string | null; + outputLoaderTemplate: string | null; + groupingType: "default" | "tabs" | null; + groupingTitleTemplate: string | null; + tabsWrapperTemplate: string | null; + preventSelection: boolean; + isOpenOnFocus: boolean; + private readonly input; + private readonly output; + private readonly itemsWrapper; + private items; + private tabs; + private readonly toggle; + private outputPlaceholder; + private outputLoader; + private value; + private selected; + private groups; + private selectedGroup; + isOpened: boolean; + isCurrent: boolean; + private animationInProcess; + constructor(el: HTMLElement, options?: IComboBoxOptions); + private init; + private build; + private setResultAndRender; + private buildInput; + private buildItems; + private setResults; + private isItemExists; + private isTextExists; + private isTextExistsAny; + private valuesBySelector; + private buildOutputLoader; + private destroyOutputLoader; + private itemsFromJson; + private jsonItemsRender; + private setGroups; + setCurrent(): void; + private setApiGroups; + private sortItems; + private itemRender; + private plainRender; + private groupTabsRender; + private groupDefaultRender; + private itemsFromHtml; + private buildToggle; + private setSelectedByValue; + private setValue; + private setItemsVisibility; + private hasVisibleItems; + private appendItemsToWrapper; + private buildOutputPlaceholder; + private destroyOutputPlaceholder; + private resultItems; + private setValueAndOpen; + open(val?: string): boolean; + private setValueAndClear; + close(val?: string | null): boolean; + recalculateDirection(): void; + static getInstance(target: HTMLElement | string, isInstance?: boolean): HSComboBox | ICollectionItem; + static autoInit(): void; + static close(target: HTMLElement | string): void; + static closeCurrentlyOpened(evtTarget?: HTMLElement | null): void; + static accessibility(evt: KeyboardEvent): void; + static onEscape(): void; + static onArrow(isArrowUp?: boolean): boolean; + static onStartEnd(isStart?: boolean): boolean; + static onEnter(evt: Event): void; +} export interface IDropdown { options?: {}; open(): void; @@ -172,6 +279,9 @@ export declare class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> imp static on(evt: string, target: HTMLElement, cb: Function): void; } export interface IInputNumberOptions { + min?: number; + max?: number; + step?: number; } export interface IInputNumber { options?: IInputNumberOptions; @@ -181,6 +291,9 @@ export declare class HSInputNumber extends HSBasePlugin imp private readonly increment; private readonly decrement; private inputValue; + private readonly minInputValue; + private readonly maxInputValue; + private readonly step; constructor(el: HTMLElement, options?: IInputNumberOptions); private init; private build; @@ -214,10 +327,13 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private autoHide; private readonly overlayId; overlay: HTMLElement | null; - isCloseWhenClickInside: string; - isTabAccessibilityLimited: string; - hasAutofocus: string; - hasAbilityToCloseOnBackdropClick: string; + isCloseWhenClickInside: boolean; + isTabAccessibilityLimited: boolean; + isLayoutAffect: boolean; + hasAutofocus: boolean; + hasAbilityToCloseOnBackdropClick: boolean; + openedBreakpoint: number | null; + autoClose: number | null; constructor(el: HTMLElement, options?: IOverlayOptions, events?: {}); private init; private hideAuto; @@ -226,11 +342,12 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private destroyBackdrop; private focusElement; open(): false | Promise; - close(): Promise; + close(forceClose?: boolean): Promise; static getInstance(target: HTMLElement, isInstance?: boolean): HTMLElement | ICollectionItem; static autoInit(): void; static open(target: HTMLElement): void; static close(target: HTMLElement): void; + static setOpened(breakpoint: number, el: ICollectionItem): void; static accessibility(evt: KeyboardEvent): boolean; static onEscape(target: ICollectionItem): void; static onTab(target: ICollectionItem, focusableElements: HTMLElement[]): boolean; @@ -353,13 +470,14 @@ export interface ISelectOptions { isOpened?: boolean; placeholder?: string; hasSearch?: boolean; + preventSearchFocus?: boolean; mode?: string; viewport?: string; + wrapperClasses?: string; toggleTag?: string; toggleClasses?: string; toggleCountText?: string; toggleCountTextMinItems?: number; - tagsClasses?: string; tagsItemTemplate?: string; tagsItemClasses?: string; tagsInputClasses?: string; @@ -370,6 +488,7 @@ export interface ISelectOptions { bottom?: string; }; dropdownSpace: number; + extraMarkup?: string | string[] | null; searchWrapperTemplate?: string; searchClasses?: string; searchWrapperClasses?: string; @@ -396,16 +515,18 @@ export declare class HSSelect extends HSBasePlugin implements IS value: string | string[] | null; private readonly placeholder; private readonly hasSearch; + private readonly preventSearchFocus; private readonly mode; private readonly viewport; isOpened: boolean | null; isMultiple: boolean | null; isDisabled: boolean | null; + selectedItems: string[]; private readonly toggleTag; private readonly toggleClasses; private readonly toggleCountText; private readonly toggleCountTextMinItems; - private readonly tagsClasses; + private readonly wrapperClasses; private readonly tagsItemTemplate; private readonly tagsItemClasses; private readonly tagsInputClasses; @@ -428,24 +549,25 @@ export declare class HSSelect extends HSBasePlugin implements IS private wrapper; private toggle; private toggleTextWrapper; - private tags; - private tagsItems; private tagsInput; private dropdown; private searchWrapper; private search; private searchNoResult; private selectOptions; + private extraMarkup; private readonly isAddTagOnEnter; + private tagsInputHelper; constructor(el: HTMLElement, options?: ISelectOptions); private init; private build; private buildWrapper; + private buildExtraMarkup; private buildToggle; private setToggleIcon; private setToggleTitle; private buildTags; - private buildTagsItems; + private reassignTagsInputPlaceholder; private buildTagsItem; private getItemByValue; private setTagsItems; @@ -456,6 +578,9 @@ export declare class HSSelect extends HSBasePlugin implements IS private destroyOption; private buildOriginalOption; private destroyOriginalOption; + private buildTagsInputHelper; + private calculateInputWidth; + private adjustInputWidth; private onSelectOption; private addSelectOption; private removeSelectOption; @@ -660,6 +785,8 @@ export declare class HSThemeSwitch extends HSBasePlugin imp constructor(el: HTMLElement, options?: IThemeSwitchOptions); private init; private setResetStyles; + private addSystemThemeObserver; + private removeSystemThemeObserver; setAppearance(theme?: string, isSaveToLocalStorage?: boolean, isSetDispatchEvent?: boolean): void; static getInstance(target: HTMLElement | string): HSThemeSwitch; static autoInit(): void; diff --git a/dist/index.js b/dist/index.js index 3b73d9b..e5a89be 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,7 +1,7 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={492:(t,e,n)=>{n.r(e),n.d(e,{afterMain:()=>S,afterRead:()=>w,afterWrite:()=>x,applyStyles:()=>P,arrow:()=>G,auto:()=>l,basePlacements:()=>a,beforeMain:()=>b,beforeRead:()=>y,beforeWrite:()=>I,bottom:()=>i,clippingParents:()=>d,computeStyles:()=>nt,createPopper:()=>Pt,createPopperBase:()=>kt,createPopperLite:()=>Bt,detectOverflow:()=>gt,end:()=>u,eventListeners:()=>it,flip:()=>wt,hide:()=>St,left:()=>s,main:()=>C,modifierPhases:()=>E,offset:()=>It,placements:()=>m,popper:()=>h,popperGenerator:()=>_t,popperOffsets:()=>Tt,preventOverflow:()=>xt,read:()=>g,reference:()=>f,right:()=>r,start:()=>c,top:()=>o,variationPlacements:()=>v,viewport:()=>p,write:()=>T});var o="top",i="bottom",r="right",s="left",l="auto",a=[o,i,r,s],c="start",u="end",d="clippingParents",p="viewport",h="popper",f="reference",v=a.reduce((function(t,e){return t.concat([e+"-"+c,e+"-"+u])}),[]),m=[].concat(a,[l]).reduce((function(t,e){return t.concat([e,e+"-"+c,e+"-"+u])}),[]),y="beforeRead",g="read",w="afterRead",b="beforeMain",C="main",S="afterMain",I="beforeWrite",T="write",x="afterWrite",E=[y,g,w,b,C,S,I,T,x];function O(t){return t?(t.nodeName||"").toLowerCase():null}function L(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function A(t){return t instanceof L(t).Element||t instanceof Element}function _(t){return t instanceof L(t).HTMLElement||t instanceof HTMLElement}function k(t){return"undefined"!=typeof ShadowRoot&&(t instanceof L(t).ShadowRoot||t instanceof ShadowRoot)}const P={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},o=e.attributes[t]||{},i=e.elements[t];_(i)&&O(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(t){var e=o[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var o=e.elements[t],i=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});_(o)&&O(o)&&(Object.assign(o.style,r),Object.keys(i).forEach((function(t){o.removeAttribute(t)})))}))}},requires:["computeStyles"]};function B(t){return t.split("-")[0]}var q=Math.max,j=Math.min,N=Math.round;function D(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function $(){return!/^((?!chrome|android).)*safari/i.test(D())}function H(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var o=t.getBoundingClientRect(),i=1,r=1;e&&_(t)&&(i=t.offsetWidth>0&&N(o.width)/t.offsetWidth||1,r=t.offsetHeight>0&&N(o.height)/t.offsetHeight||1);var s=(A(t)?L(t):window).visualViewport,l=!$()&&n,a=(o.left+(l&&s?s.offsetLeft:0))/i,c=(o.top+(l&&s?s.offsetTop:0))/r,u=o.width/i,d=o.height/r;return{width:u,height:d,top:c,right:a+u,bottom:c+d,left:a,x:a,y:c}}function M(t){var e=H(t),n=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:o}}function R(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&k(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function W(t){return L(t).getComputedStyle(t)}function V(t){return["table","td","th"].indexOf(O(t))>=0}function F(t){return((A(t)?t.ownerDocument:t.document)||window.document).documentElement}function U(t){return"html"===O(t)?t:t.assignedSlot||t.parentNode||(k(t)?t.host:null)||F(t)}function Y(t){return _(t)&&"fixed"!==W(t).position?t.offsetParent:null}function J(t){for(var e=L(t),n=Y(t);n&&V(n)&&"static"===W(n).position;)n=Y(n);return n&&("html"===O(n)||"body"===O(n)&&"static"===W(n).position)?e:n||function(t){var e=/firefox/i.test(D());if(/Trident/i.test(D())&&_(t)&&"fixed"===W(t).position)return null;var n=U(t);for(k(n)&&(n=n.host);_(n)&&["html","body"].indexOf(O(n))<0;){var o=W(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||e&&"filter"===o.willChange||e&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(t)||e}function K(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function z(t,e,n){return q(t,j(e,n))}function X(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Z(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}const G={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,l=t.name,c=t.options,u=n.elements.arrow,d=n.modifiersData.popperOffsets,p=B(n.placement),h=K(p),f=[s,r].indexOf(p)>=0?"height":"width";if(u&&d){var v=function(t,e){return X("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Z(t,a))}(c.padding,n),m=M(u),y="y"===h?o:s,g="y"===h?i:r,w=n.rects.reference[f]+n.rects.reference[h]-d[h]-n.rects.popper[f],b=d[h]-n.rects.reference[h],C=J(u),S=C?"y"===h?C.clientHeight||0:C.clientWidth||0:0,I=w/2-b/2,T=v[y],x=S-m[f]-v[g],E=S/2-m[f]/2+I,O=z(T,E,x),L=h;n.modifiersData[l]=((e={})[L]=O,e.centerOffset=O-E,e)}},effect:function(t){var e=t.state,n=t.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!=typeof o||(o=e.elements.popper.querySelector(o)))&&R(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Q(t){return t.split("-")[1]}var tt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function et(t){var e,n=t.popper,l=t.popperRect,a=t.placement,c=t.variation,d=t.offsets,p=t.position,h=t.gpuAcceleration,f=t.adaptive,v=t.roundOffsets,m=t.isFixed,y=d.x,g=void 0===y?0:y,w=d.y,b=void 0===w?0:w,C="function"==typeof v?v({x:g,y:b}):{x:g,y:b};g=C.x,b=C.y;var S=d.hasOwnProperty("x"),I=d.hasOwnProperty("y"),T=s,x=o,E=window;if(f){var O=J(n),A="clientHeight",_="clientWidth";if(O===L(n)&&"static"!==W(O=F(n)).position&&"absolute"===p&&(A="scrollHeight",_="scrollWidth"),a===o||(a===s||a===r)&&c===u)x=i,b-=(m&&O===E&&E.visualViewport?E.visualViewport.height:O[A])-l.height,b*=h?1:-1;if(a===s||(a===o||a===i)&&c===u)T=r,g-=(m&&O===E&&E.visualViewport?E.visualViewport.width:O[_])-l.width,g*=h?1:-1}var k,P=Object.assign({position:p},f&&tt),B=!0===v?function(t,e){var n=t.x,o=t.y,i=e.devicePixelRatio||1;return{x:N(n*i)/i||0,y:N(o*i)/i||0}}({x:g,y:b},L(n)):{x:g,y:b};return g=B.x,b=B.y,h?Object.assign({},P,((k={})[x]=I?"0":"",k[T]=S?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",k)):Object.assign({},P,((e={})[x]=I?b+"px":"",e[T]=S?g+"px":"",e.transform="",e))}const nt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,o=n.gpuAcceleration,i=void 0===o||o,r=n.adaptive,s=void 0===r||r,l=n.roundOffsets,a=void 0===l||l,c={placement:B(e.placement),variation:Q(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,et(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,et(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var ot={passive:!0};const it={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,o=t.options,i=o.scroll,r=void 0===i||i,s=o.resize,l=void 0===s||s,a=L(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&c.forEach((function(t){t.addEventListener("scroll",n.update,ot)})),l&&a.addEventListener("resize",n.update,ot),function(){r&&c.forEach((function(t){t.removeEventListener("scroll",n.update,ot)})),l&&a.removeEventListener("resize",n.update,ot)}},data:{}};var rt={left:"right",right:"left",bottom:"top",top:"bottom"};function st(t){return t.replace(/left|right|bottom|top/g,(function(t){return rt[t]}))}var lt={start:"end",end:"start"};function at(t){return t.replace(/start|end/g,(function(t){return lt[t]}))}function ct(t){var e=L(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ut(t){return H(F(t)).left+ct(t).scrollLeft}function dt(t){var e=W(t),n=e.overflow,o=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+o)}function pt(t){return["html","body","#document"].indexOf(O(t))>=0?t.ownerDocument.body:_(t)&&dt(t)?t:pt(U(t))}function ht(t,e){var n;void 0===e&&(e=[]);var o=pt(t),i=o===(null==(n=t.ownerDocument)?void 0:n.body),r=L(o),s=i?[r].concat(r.visualViewport||[],dt(o)?o:[]):o,l=e.concat(s);return i?l:l.concat(ht(U(s)))}function ft(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function vt(t,e,n){return e===p?ft(function(t,e){var n=L(t),o=F(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;var c=$();(c||!c&&"fixed"===e)&&(l=i.offsetLeft,a=i.offsetTop)}return{width:r,height:s,x:l+ut(t),y:a}}(t,n)):A(e)?function(t,e){var n=H(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(e,n):ft(function(t){var e,n=F(t),o=ct(t),i=null==(e=t.ownerDocument)?void 0:e.body,r=q(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=q(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-o.scrollLeft+ut(t),a=-o.scrollTop;return"rtl"===W(i||n).direction&&(l+=q(n.clientWidth,i?i.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}(F(t)))}function mt(t,e,n,o){var i="clippingParents"===e?function(t){var e=ht(U(t)),n=["absolute","fixed"].indexOf(W(t).position)>=0&&_(t)?J(t):t;return A(n)?e.filter((function(t){return A(t)&&R(t,n)&&"body"!==O(t)})):[]}(t):[].concat(e),r=[].concat(i,[n]),s=r[0],l=r.reduce((function(e,n){var i=vt(t,n,o);return e.top=q(i.top,e.top),e.right=j(i.right,e.right),e.bottom=j(i.bottom,e.bottom),e.left=q(i.left,e.left),e}),vt(t,s,o));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function yt(t){var e,n=t.reference,l=t.element,a=t.placement,d=a?B(a):null,p=a?Q(a):null,h=n.x+n.width/2-l.width/2,f=n.y+n.height/2-l.height/2;switch(d){case o:e={x:h,y:n.y-l.height};break;case i:e={x:h,y:n.y+n.height};break;case r:e={x:n.x+n.width,y:f};break;case s:e={x:n.x-l.width,y:f};break;default:e={x:n.x,y:n.y}}var v=d?K(d):null;if(null!=v){var m="y"===v?"height":"width";switch(p){case c:e[v]=e[v]-(n[m]/2-l[m]/2);break;case u:e[v]=e[v]+(n[m]/2-l[m]/2)}}return e}function gt(t,e){void 0===e&&(e={});var n=e,s=n.placement,l=void 0===s?t.placement:s,c=n.strategy,u=void 0===c?t.strategy:c,v=n.boundary,m=void 0===v?d:v,y=n.rootBoundary,g=void 0===y?p:y,w=n.elementContext,b=void 0===w?h:w,C=n.altBoundary,S=void 0!==C&&C,I=n.padding,T=void 0===I?0:I,x=X("number"!=typeof T?T:Z(T,a)),E=b===h?f:h,O=t.rects.popper,L=t.elements[S?E:b],_=mt(A(L)?L:L.contextElement||F(t.elements.popper),m,g,u),k=H(t.elements.reference),P=yt({reference:k,element:O,strategy:"absolute",placement:l}),B=ft(Object.assign({},O,P)),q=b===h?B:k,j={top:_.top-q.top+x.top,bottom:q.bottom-_.bottom+x.bottom,left:_.left-q.left+x.left,right:q.right-_.right+x.right},N=t.modifiersData.offset;if(b===h&&N){var D=N[l];Object.keys(j).forEach((function(t){var e=[r,i].indexOf(t)>=0?1:-1,n=[o,i].indexOf(t)>=0?"y":"x";j[t]+=D[n]*e}))}return j}const wt={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,u=t.name;if(!e.modifiersData[u]._skip){for(var d=n.mainAxis,p=void 0===d||d,h=n.altAxis,f=void 0===h||h,y=n.fallbackPlacements,g=n.padding,w=n.boundary,b=n.rootBoundary,C=n.altBoundary,S=n.flipVariations,I=void 0===S||S,T=n.allowedAutoPlacements,x=e.options.placement,E=B(x),O=y||(E===x||!I?[st(x)]:function(t){if(B(t)===l)return[];var e=st(t);return[at(t),e,at(e)]}(x)),L=[x].concat(O).reduce((function(t,n){return t.concat(B(n)===l?function(t,e){void 0===e&&(e={});var n=e,o=n.placement,i=n.boundary,r=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=void 0===c?m:c,d=Q(o),p=d?l?v:v.filter((function(t){return Q(t)===d})):a,h=p.filter((function(t){return u.indexOf(t)>=0}));0===h.length&&(h=p);var f=h.reduce((function(e,n){return e[n]=gt(t,{placement:n,boundary:i,rootBoundary:r,padding:s})[B(n)],e}),{});return Object.keys(f).sort((function(t,e){return f[t]-f[e]}))}(e,{placement:n,boundary:w,rootBoundary:b,padding:g,flipVariations:I,allowedAutoPlacements:T}):n)}),[]),A=e.rects.reference,_=e.rects.popper,k=new Map,P=!0,q=L[0],j=0;j=0,M=H?"width":"height",R=gt(e,{placement:N,boundary:w,rootBoundary:b,altBoundary:C,padding:g}),W=H?$?r:s:$?i:o;A[M]>_[M]&&(W=st(W));var V=st(W),F=[];if(p&&F.push(R[D]<=0),f&&F.push(R[W]<=0,R[V]<=0),F.every((function(t){return t}))){q=N,P=!1;break}k.set(N,F)}if(P)for(var U=function(t){var e=L.find((function(e){var n=k.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return q=e,"break"},Y=I?3:1;Y>0;Y--){if("break"===U(Y))break}e.placement!==q&&(e.modifiersData[u]._skip=!0,e.placement=q,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function bt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Ct(t){return[o,r,i,s].some((function(e){return t[e]>=0}))}const St={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,o=e.rects.reference,i=e.rects.popper,r=e.modifiersData.preventOverflow,s=gt(e,{elementContext:"reference"}),l=gt(e,{altBoundary:!0}),a=bt(s,o),c=bt(l,i,r),u=Ct(a),d=Ct(c);e.modifiersData[n]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};const It={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,i=t.name,l=n.offset,a=void 0===l?[0,0]:l,c=m.reduce((function(t,n){return t[n]=function(t,e,n){var i=B(t),l=[s,o].indexOf(i)>=0?-1:1,a="function"==typeof n?n(Object.assign({},e,{placement:t})):n,c=a[0],u=a[1];return c=c||0,u=(u||0)*l,[s,r].indexOf(i)>=0?{x:u,y:c}:{x:c,y:u}}(n,e.rects,a),t}),{}),u=c[e.placement],d=u.x,p=u.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=d,e.modifiersData.popperOffsets.y+=p),e.modifiersData[i]=c}};const Tt={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=yt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}};const xt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,l=t.name,a=n.mainAxis,u=void 0===a||a,d=n.altAxis,p=void 0!==d&&d,h=n.boundary,f=n.rootBoundary,v=n.altBoundary,m=n.padding,y=n.tether,g=void 0===y||y,w=n.tetherOffset,b=void 0===w?0:w,C=gt(e,{boundary:h,rootBoundary:f,padding:m,altBoundary:v}),S=B(e.placement),I=Q(e.placement),T=!I,x=K(S),E="x"===x?"y":"x",O=e.modifiersData.popperOffsets,L=e.rects.reference,A=e.rects.popper,_="function"==typeof b?b(Object.assign({},e.rects,{placement:e.placement})):b,k="number"==typeof _?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,N={x:0,y:0};if(O){if(u){var D,$="y"===x?o:s,H="y"===x?i:r,R="y"===x?"height":"width",W=O[x],V=W+C[$],F=W-C[H],U=g?-A[R]/2:0,Y=I===c?L[R]:A[R],X=I===c?-A[R]:-L[R],Z=e.elements.arrow,G=g&&Z?M(Z):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[$],nt=tt[H],ot=z(0,L[R],G[R]),it=T?L[R]/2-U-ot-et-k.mainAxis:Y-ot-et-k.mainAxis,rt=T?-L[R]/2+U+ot+nt+k.mainAxis:X+ot+nt+k.mainAxis,st=e.elements.arrow&&J(e.elements.arrow),lt=st?"y"===x?st.clientTop||0:st.clientLeft||0:0,at=null!=(D=null==P?void 0:P[x])?D:0,ct=W+rt-at,ut=z(g?j(V,W+it-at-lt):V,W,g?q(F,ct):F);O[x]=ut,N[x]=ut-W}if(p){var dt,pt="x"===x?o:s,ht="x"===x?i:r,ft=O[E],vt="y"===E?"height":"width",mt=ft+C[pt],yt=ft-C[ht],wt=-1!==[o,s].indexOf(S),bt=null!=(dt=null==P?void 0:P[E])?dt:0,Ct=wt?mt:ft-L[vt]-A[vt]-bt+k.altAxis,St=wt?ft+L[vt]+A[vt]-bt-k.altAxis:yt,It=g&&wt?function(t,e,n){var o=z(t,e,n);return o>n?n:o}(Ct,ft,St):z(g?Ct:mt,ft,g?St:yt);O[E]=It,N[E]=It-ft}e.modifiersData[l]=N}},requiresIfExists:["offset"]};function Et(t,e,n){void 0===n&&(n=!1);var o,i,r=_(e),s=_(e)&&function(t){var e=t.getBoundingClientRect(),n=N(e.width)/t.offsetWidth||1,o=N(e.height)/t.offsetHeight||1;return 1!==n||1!==o}(e),l=F(e),a=H(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==O(e)||dt(l))&&(c=(o=e)!==L(o)&&_(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:ct(o)),_(e)?((u=H(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):l&&(u.x=ut(l))),{x:a.left+c.scrollLeft-u.x,y:a.top+c.scrollTop-u.y,width:a.width,height:a.height}}function Ot(t){var e=new Map,n=new Set,o=[];function i(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var o=e.get(t);o&&i(o)}})),o.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||i(t)})),o}var Lt={placement:"bottom",modifiers:[],strategy:"absolute"};function At(){for(var t=arguments.length,e=new Array(t),n=0;n{Object.defineProperty(e,"__esModule",{value:!0}),e.COMBO_BOX_ACCESSIBILITY_KEY_SET=e.SELECT_ACCESSIBILITY_KEY_SET=e.TABS_ACCESSIBILITY_KEY_SET=e.OVERLAY_ACCESSIBILITY_KEY_SET=e.DROPDOWN_ACCESSIBILITY_KEY_SET=e.POSITIONS=void 0,e.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},e.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],e.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],e.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],e.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],e.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"]},460:function(t,e,n){ +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={492:(t,e,n)=>{n.r(e),n.d(e,{afterMain:()=>S,afterRead:()=>w,afterWrite:()=>T,applyStyles:()=>P,arrow:()=>Q,auto:()=>l,basePlacements:()=>a,beforeMain:()=>b,beforeRead:()=>y,beforeWrite:()=>x,bottom:()=>i,clippingParents:()=>d,computeStyles:()=>nt,createPopper:()=>Pt,createPopperBase:()=>_t,createPopperLite:()=>Bt,detectOverflow:()=>gt,end:()=>u,eventListeners:()=>it,flip:()=>wt,hide:()=>St,left:()=>s,main:()=>C,modifierPhases:()=>E,offset:()=>xt,placements:()=>v,popper:()=>h,popperGenerator:()=>kt,popperOffsets:()=>It,preventOverflow:()=>Tt,read:()=>g,reference:()=>f,right:()=>r,start:()=>c,top:()=>o,variationPlacements:()=>m,viewport:()=>p,write:()=>I});var o="top",i="bottom",r="right",s="left",l="auto",a=[o,i,r,s],c="start",u="end",d="clippingParents",p="viewport",h="popper",f="reference",m=a.reduce((function(t,e){return t.concat([e+"-"+c,e+"-"+u])}),[]),v=[].concat(a,[l]).reduce((function(t,e){return t.concat([e,e+"-"+c,e+"-"+u])}),[]),y="beforeRead",g="read",w="afterRead",b="beforeMain",C="main",S="afterMain",x="beforeWrite",I="write",T="afterWrite",E=[y,g,w,b,C,S,x,I,T];function O(t){return t?(t.nodeName||"").toLowerCase():null}function L(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function A(t){return t instanceof L(t).Element||t instanceof Element}function k(t){return t instanceof L(t).HTMLElement||t instanceof HTMLElement}function _(t){return"undefined"!=typeof ShadowRoot&&(t instanceof L(t).ShadowRoot||t instanceof ShadowRoot)}const P={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},o=e.attributes[t]||{},i=e.elements[t];k(i)&&O(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(t){var e=o[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var o=e.elements[t],i=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});k(o)&&O(o)&&(Object.assign(o.style,r),Object.keys(i).forEach((function(t){o.removeAttribute(t)})))}))}},requires:["computeStyles"]};function B(t){return t.split("-")[0]}var q=Math.max,N=Math.min,j=Math.round;function $(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function D(){return!/^((?!chrome|android).)*safari/i.test($())}function H(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var o=t.getBoundingClientRect(),i=1,r=1;e&&k(t)&&(i=t.offsetWidth>0&&j(o.width)/t.offsetWidth||1,r=t.offsetHeight>0&&j(o.height)/t.offsetHeight||1);var s=(A(t)?L(t):window).visualViewport,l=!D()&&n,a=(o.left+(l&&s?s.offsetLeft:0))/i,c=(o.top+(l&&s?s.offsetTop:0))/r,u=o.width/i,d=o.height/r;return{width:u,height:d,top:c,right:a+u,bottom:c+d,left:a,x:a,y:c}}function M(t){var e=H(t),n=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:o}}function R(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&_(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function W(t){return L(t).getComputedStyle(t)}function V(t){return["table","td","th"].indexOf(O(t))>=0}function F(t){return((A(t)?t.ownerDocument:t.document)||window.document).documentElement}function U(t){return"html"===O(t)?t:t.assignedSlot||t.parentNode||(_(t)?t.host:null)||F(t)}function J(t){return k(t)&&"fixed"!==W(t).position?t.offsetParent:null}function Y(t){for(var e=L(t),n=J(t);n&&V(n)&&"static"===W(n).position;)n=J(n);return n&&("html"===O(n)||"body"===O(n)&&"static"===W(n).position)?e:n||function(t){var e=/firefox/i.test($());if(/Trident/i.test($())&&k(t)&&"fixed"===W(t).position)return null;var n=U(t);for(_(n)&&(n=n.host);k(n)&&["html","body"].indexOf(O(n))<0;){var o=W(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||e&&"filter"===o.willChange||e&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(t)||e}function K(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function G(t,e,n){return q(t,N(e,n))}function z(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function X(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}const Q={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,l=t.name,c=t.options,u=n.elements.arrow,d=n.modifiersData.popperOffsets,p=B(n.placement),h=K(p),f=[s,r].indexOf(p)>=0?"height":"width";if(u&&d){var m=function(t,e){return z("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:X(t,a))}(c.padding,n),v=M(u),y="y"===h?o:s,g="y"===h?i:r,w=n.rects.reference[f]+n.rects.reference[h]-d[h]-n.rects.popper[f],b=d[h]-n.rects.reference[h],C=Y(u),S=C?"y"===h?C.clientHeight||0:C.clientWidth||0:0,x=w/2-b/2,I=m[y],T=S-v[f]-m[g],E=S/2-v[f]/2+x,O=G(I,E,T),L=h;n.modifiersData[l]=((e={})[L]=O,e.centerOffset=O-E,e)}},effect:function(t){var e=t.state,n=t.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!=typeof o||(o=e.elements.popper.querySelector(o)))&&R(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Z(t){return t.split("-")[1]}var tt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function et(t){var e,n=t.popper,l=t.popperRect,a=t.placement,c=t.variation,d=t.offsets,p=t.position,h=t.gpuAcceleration,f=t.adaptive,m=t.roundOffsets,v=t.isFixed,y=d.x,g=void 0===y?0:y,w=d.y,b=void 0===w?0:w,C="function"==typeof m?m({x:g,y:b}):{x:g,y:b};g=C.x,b=C.y;var S=d.hasOwnProperty("x"),x=d.hasOwnProperty("y"),I=s,T=o,E=window;if(f){var O=Y(n),A="clientHeight",k="clientWidth";if(O===L(n)&&"static"!==W(O=F(n)).position&&"absolute"===p&&(A="scrollHeight",k="scrollWidth"),a===o||(a===s||a===r)&&c===u)T=i,b-=(v&&O===E&&E.visualViewport?E.visualViewport.height:O[A])-l.height,b*=h?1:-1;if(a===s||(a===o||a===i)&&c===u)I=r,g-=(v&&O===E&&E.visualViewport?E.visualViewport.width:O[k])-l.width,g*=h?1:-1}var _,P=Object.assign({position:p},f&&tt),B=!0===m?function(t,e){var n=t.x,o=t.y,i=e.devicePixelRatio||1;return{x:j(n*i)/i||0,y:j(o*i)/i||0}}({x:g,y:b},L(n)):{x:g,y:b};return g=B.x,b=B.y,h?Object.assign({},P,((_={})[T]=x?"0":"",_[I]=S?"0":"",_.transform=(E.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",_)):Object.assign({},P,((e={})[T]=x?b+"px":"",e[I]=S?g+"px":"",e.transform="",e))}const nt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,o=n.gpuAcceleration,i=void 0===o||o,r=n.adaptive,s=void 0===r||r,l=n.roundOffsets,a=void 0===l||l,c={placement:B(e.placement),variation:Z(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,et(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,et(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var ot={passive:!0};const it={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,o=t.options,i=o.scroll,r=void 0===i||i,s=o.resize,l=void 0===s||s,a=L(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&c.forEach((function(t){t.addEventListener("scroll",n.update,ot)})),l&&a.addEventListener("resize",n.update,ot),function(){r&&c.forEach((function(t){t.removeEventListener("scroll",n.update,ot)})),l&&a.removeEventListener("resize",n.update,ot)}},data:{}};var rt={left:"right",right:"left",bottom:"top",top:"bottom"};function st(t){return t.replace(/left|right|bottom|top/g,(function(t){return rt[t]}))}var lt={start:"end",end:"start"};function at(t){return t.replace(/start|end/g,(function(t){return lt[t]}))}function ct(t){var e=L(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ut(t){return H(F(t)).left+ct(t).scrollLeft}function dt(t){var e=W(t),n=e.overflow,o=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+o)}function pt(t){return["html","body","#document"].indexOf(O(t))>=0?t.ownerDocument.body:k(t)&&dt(t)?t:pt(U(t))}function ht(t,e){var n;void 0===e&&(e=[]);var o=pt(t),i=o===(null==(n=t.ownerDocument)?void 0:n.body),r=L(o),s=i?[r].concat(r.visualViewport||[],dt(o)?o:[]):o,l=e.concat(s);return i?l:l.concat(ht(U(s)))}function ft(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mt(t,e,n){return e===p?ft(function(t,e){var n=L(t),o=F(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;var c=D();(c||!c&&"fixed"===e)&&(l=i.offsetLeft,a=i.offsetTop)}return{width:r,height:s,x:l+ut(t),y:a}}(t,n)):A(e)?function(t,e){var n=H(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(e,n):ft(function(t){var e,n=F(t),o=ct(t),i=null==(e=t.ownerDocument)?void 0:e.body,r=q(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=q(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-o.scrollLeft+ut(t),a=-o.scrollTop;return"rtl"===W(i||n).direction&&(l+=q(n.clientWidth,i?i.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}(F(t)))}function vt(t,e,n,o){var i="clippingParents"===e?function(t){var e=ht(U(t)),n=["absolute","fixed"].indexOf(W(t).position)>=0&&k(t)?Y(t):t;return A(n)?e.filter((function(t){return A(t)&&R(t,n)&&"body"!==O(t)})):[]}(t):[].concat(e),r=[].concat(i,[n]),s=r[0],l=r.reduce((function(e,n){var i=mt(t,n,o);return e.top=q(i.top,e.top),e.right=N(i.right,e.right),e.bottom=N(i.bottom,e.bottom),e.left=q(i.left,e.left),e}),mt(t,s,o));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function yt(t){var e,n=t.reference,l=t.element,a=t.placement,d=a?B(a):null,p=a?Z(a):null,h=n.x+n.width/2-l.width/2,f=n.y+n.height/2-l.height/2;switch(d){case o:e={x:h,y:n.y-l.height};break;case i:e={x:h,y:n.y+n.height};break;case r:e={x:n.x+n.width,y:f};break;case s:e={x:n.x-l.width,y:f};break;default:e={x:n.x,y:n.y}}var m=d?K(d):null;if(null!=m){var v="y"===m?"height":"width";switch(p){case c:e[m]=e[m]-(n[v]/2-l[v]/2);break;case u:e[m]=e[m]+(n[v]/2-l[v]/2)}}return e}function gt(t,e){void 0===e&&(e={});var n=e,s=n.placement,l=void 0===s?t.placement:s,c=n.strategy,u=void 0===c?t.strategy:c,m=n.boundary,v=void 0===m?d:m,y=n.rootBoundary,g=void 0===y?p:y,w=n.elementContext,b=void 0===w?h:w,C=n.altBoundary,S=void 0!==C&&C,x=n.padding,I=void 0===x?0:x,T=z("number"!=typeof I?I:X(I,a)),E=b===h?f:h,O=t.rects.popper,L=t.elements[S?E:b],k=vt(A(L)?L:L.contextElement||F(t.elements.popper),v,g,u),_=H(t.elements.reference),P=yt({reference:_,element:O,strategy:"absolute",placement:l}),B=ft(Object.assign({},O,P)),q=b===h?B:_,N={top:k.top-q.top+T.top,bottom:q.bottom-k.bottom+T.bottom,left:k.left-q.left+T.left,right:q.right-k.right+T.right},j=t.modifiersData.offset;if(b===h&&j){var $=j[l];Object.keys(N).forEach((function(t){var e=[r,i].indexOf(t)>=0?1:-1,n=[o,i].indexOf(t)>=0?"y":"x";N[t]+=$[n]*e}))}return N}const wt={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,u=t.name;if(!e.modifiersData[u]._skip){for(var d=n.mainAxis,p=void 0===d||d,h=n.altAxis,f=void 0===h||h,y=n.fallbackPlacements,g=n.padding,w=n.boundary,b=n.rootBoundary,C=n.altBoundary,S=n.flipVariations,x=void 0===S||S,I=n.allowedAutoPlacements,T=e.options.placement,E=B(T),O=y||(E===T||!x?[st(T)]:function(t){if(B(t)===l)return[];var e=st(t);return[at(t),e,at(e)]}(T)),L=[T].concat(O).reduce((function(t,n){return t.concat(B(n)===l?function(t,e){void 0===e&&(e={});var n=e,o=n.placement,i=n.boundary,r=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=void 0===c?v:c,d=Z(o),p=d?l?m:m.filter((function(t){return Z(t)===d})):a,h=p.filter((function(t){return u.indexOf(t)>=0}));0===h.length&&(h=p);var f=h.reduce((function(e,n){return e[n]=gt(t,{placement:n,boundary:i,rootBoundary:r,padding:s})[B(n)],e}),{});return Object.keys(f).sort((function(t,e){return f[t]-f[e]}))}(e,{placement:n,boundary:w,rootBoundary:b,padding:g,flipVariations:x,allowedAutoPlacements:I}):n)}),[]),A=e.rects.reference,k=e.rects.popper,_=new Map,P=!0,q=L[0],N=0;N=0,M=H?"width":"height",R=gt(e,{placement:j,boundary:w,rootBoundary:b,altBoundary:C,padding:g}),W=H?D?r:s:D?i:o;A[M]>k[M]&&(W=st(W));var V=st(W),F=[];if(p&&F.push(R[$]<=0),f&&F.push(R[W]<=0,R[V]<=0),F.every((function(t){return t}))){q=j,P=!1;break}_.set(j,F)}if(P)for(var U=function(t){var e=L.find((function(e){var n=_.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return q=e,"break"},J=x?3:1;J>0;J--){if("break"===U(J))break}e.placement!==q&&(e.modifiersData[u]._skip=!0,e.placement=q,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function bt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Ct(t){return[o,r,i,s].some((function(e){return t[e]>=0}))}const St={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,o=e.rects.reference,i=e.rects.popper,r=e.modifiersData.preventOverflow,s=gt(e,{elementContext:"reference"}),l=gt(e,{altBoundary:!0}),a=bt(s,o),c=bt(l,i,r),u=Ct(a),d=Ct(c);e.modifiersData[n]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};const xt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,i=t.name,l=n.offset,a=void 0===l?[0,0]:l,c=v.reduce((function(t,n){return t[n]=function(t,e,n){var i=B(t),l=[s,o].indexOf(i)>=0?-1:1,a="function"==typeof n?n(Object.assign({},e,{placement:t})):n,c=a[0],u=a[1];return c=c||0,u=(u||0)*l,[s,r].indexOf(i)>=0?{x:u,y:c}:{x:c,y:u}}(n,e.rects,a),t}),{}),u=c[e.placement],d=u.x,p=u.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=d,e.modifiersData.popperOffsets.y+=p),e.modifiersData[i]=c}};const It={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=yt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}};const Tt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,l=t.name,a=n.mainAxis,u=void 0===a||a,d=n.altAxis,p=void 0!==d&&d,h=n.boundary,f=n.rootBoundary,m=n.altBoundary,v=n.padding,y=n.tether,g=void 0===y||y,w=n.tetherOffset,b=void 0===w?0:w,C=gt(e,{boundary:h,rootBoundary:f,padding:v,altBoundary:m}),S=B(e.placement),x=Z(e.placement),I=!x,T=K(S),E="x"===T?"y":"x",O=e.modifiersData.popperOffsets,L=e.rects.reference,A=e.rects.popper,k="function"==typeof b?b(Object.assign({},e.rects,{placement:e.placement})):b,_="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,j={x:0,y:0};if(O){if(u){var $,D="y"===T?o:s,H="y"===T?i:r,R="y"===T?"height":"width",W=O[T],V=W+C[D],F=W-C[H],U=g?-A[R]/2:0,J=x===c?L[R]:A[R],z=x===c?-A[R]:-L[R],X=e.elements.arrow,Q=g&&X?M(X):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[D],nt=tt[H],ot=G(0,L[R],Q[R]),it=I?L[R]/2-U-ot-et-_.mainAxis:J-ot-et-_.mainAxis,rt=I?-L[R]/2+U+ot+nt+_.mainAxis:z+ot+nt+_.mainAxis,st=e.elements.arrow&&Y(e.elements.arrow),lt=st?"y"===T?st.clientTop||0:st.clientLeft||0:0,at=null!=($=null==P?void 0:P[T])?$:0,ct=W+rt-at,ut=G(g?N(V,W+it-at-lt):V,W,g?q(F,ct):F);O[T]=ut,j[T]=ut-W}if(p){var dt,pt="x"===T?o:s,ht="x"===T?i:r,ft=O[E],mt="y"===E?"height":"width",vt=ft+C[pt],yt=ft-C[ht],wt=-1!==[o,s].indexOf(S),bt=null!=(dt=null==P?void 0:P[E])?dt:0,Ct=wt?vt:ft-L[mt]-A[mt]-bt+_.altAxis,St=wt?ft+L[mt]+A[mt]-bt-_.altAxis:yt,xt=g&&wt?function(t,e,n){var o=G(t,e,n);return o>n?n:o}(Ct,ft,St):G(g?Ct:vt,ft,g?St:yt);O[E]=xt,j[E]=xt-ft}e.modifiersData[l]=j}},requiresIfExists:["offset"]};function Et(t,e,n){void 0===n&&(n=!1);var o,i,r=k(e),s=k(e)&&function(t){var e=t.getBoundingClientRect(),n=j(e.width)/t.offsetWidth||1,o=j(e.height)/t.offsetHeight||1;return 1!==n||1!==o}(e),l=F(e),a=H(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==O(e)||dt(l))&&(c=(o=e)!==L(o)&&k(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:ct(o)),k(e)?((u=H(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):l&&(u.x=ut(l))),{x:a.left+c.scrollLeft-u.x,y:a.top+c.scrollTop-u.y,width:a.width,height:a.height}}function Ot(t){var e=new Map,n=new Set,o=[];function i(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var o=e.get(t);o&&i(o)}})),o.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||i(t)})),o}var Lt={placement:"bottom",modifiers:[],strategy:"absolute"};function At(){for(var t=arguments.length,e=new Array(t),n=0;n{Object.defineProperty(e,"__esModule",{value:!0}),e.BREAKPOINTS=e.COMBO_BOX_ACCESSIBILITY_KEY_SET=e.SELECT_ACCESSIBILITY_KEY_SET=e.TABS_ACCESSIBILITY_KEY_SET=e.OVERLAY_ACCESSIBILITY_KEY_SET=e.DROPDOWN_ACCESSIBILITY_KEY_SET=e.POSITIONS=void 0,e.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},e.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],e.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],e.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],e.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],e.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],e.BREAKPOINTS={sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},460:function(t,e,n){ /* * HSAccordion - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,7 +9,7 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(969),s=function(t){function e(e,n,o){var i=t.call(this,e,n,o)||this;return i.toggle=i.el.querySelector(".hs-accordion-toggle")||null,i.content=i.el.querySelector(".hs-accordion-content")||null,i.group=i.el.closest(".hs-accordion-group")||null,i.isAlwaysOpened=i.group.hasAttribute("data-hs-accordion-always-open")||!1,i.toggle&&i.content&&i.init(),i}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsAccordionCollection,this),this.toggle.addEventListener("click",(function(){t.el.classList.contains("active")?t.hide():t.show()}))},e.prototype.show=function(){var t=this;this.group&&!this.isAlwaysOpened&&this.group.querySelector(".hs-accordion.active")&&this.group.querySelector(".hs-accordion.active")!==this.el&&window.$hsAccordionCollection.find((function(e){return e.element.el===t.group.querySelector(".hs-accordion.active")})).element.hide();if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),this.content.style.display="block",this.content.style.height="0",setTimeout((function(){t.content.style.height="".concat(t.content.scrollHeight,"px")})),(0,r.afterTransition)(this.content,(function(){t.content.style.display="block",t.content.style.height="",t.fireEvent("open",t.el),(0,r.dispatch)("open.hs.accordion",t.el,t.el)}))},e.prototype.hide=function(){var t=this;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){t.content.style.height="0"})),(0,r.afterTransition)(this.content,(function(){t.content.style.display="",t.content.style.height="0",t.fireEvent("close",t.el),(0,r.dispatch)("close.hs.accordion",t.el,t.el)}))},e.getInstance=function(t,e){var n=window.$hsAccordionCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.show=function(t){var e=window.$hsAccordionCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&"block"!==e.element.content.style.display&&e.element.show()},e.hide=function(t){var e=window.$hsAccordionCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&"block"===e.element.content.style.display&&e.element.hide()},e.autoInit=function(){window.$hsAccordionCollection||(window.$hsAccordionCollection=[]),document.querySelectorAll(".hs-accordion:not(.--prevent-on-load-init)").forEach((function(t){window.$hsAccordionCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e.on=function(t,e,n){var o=window.$hsAccordionCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));o&&(o.element.events[t]=n)},e}(n(737).default);window.addEventListener("load",(function(){s.autoInit()})),"undefined"!=typeof window&&(window.HSAccordion=s),e.default=s},737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -17,7 +17,7 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},629:function(t,e,n){ /* * HSCarousel - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -25,15 +25,23 @@ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n *")||null,l.sliderWidth=l.inner.parentElement.clientWidth,l.touchX={start:0,end:0},l.init(),l}return i(e,t),e.prototype.init=function(){var t,e,n=this;this.createCollection(window.$hsCarouselCollection,this),this.inner&&(this.calculateWidth(),this.loadingClassesRemove&&("string"==typeof this.loadingClassesRemove?this.inner.classList.remove(this.loadingClassesRemove):(t=this.inner.classList).remove.apply(t,this.loadingClassesRemove)),this.loadingClassesAdd&&("string"==typeof this.loadingClassesAdd?this.inner.classList.add(this.loadingClassesAdd):(e=this.inner.classList).add.apply(e,this.loadingClassesAdd))),this.prev&&this.prev.addEventListener("click",(function(){n.goToPrev(),n.isAutoPlay&&(n.resetTimer(),n.setTimer())})),this.next&&this.next.addEventListener("click",(function(){n.goToNext(),n.isAutoPlay&&(n.resetTimer(),n.setTimer())})),this.dots&&this.dots.forEach((function(t,e){return t.addEventListener("click",(function(){n.goTo(e),n.isAutoPlay&&(n.resetTimer(),n.setTimer())}))})),this.slides.length&&(this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass(),this.isAutoPlay&&this.autoPlay()),this.inner&&this.afterLoadingClassesAdd&&setTimeout((function(){var t;"string"==typeof n.afterLoadingClassesAdd?n.inner.classList.add(n.afterLoadingClassesAdd):(t=n.inner.classList).add.apply(t,n.afterLoadingClassesAdd)})),this.el.classList.add("init"),this.el.addEventListener("touchstart",(function(t){n.touchX.start=t.changedTouches[0].screenX})),this.el.addEventListener("touchend",(function(t){n.touchX.end=t.changedTouches[0].screenX,n.detectDirection()})),this.observeResize()},e.prototype.observeResize=function(){var t=this;new ResizeObserver((function(){return t.recalculateWidth()})).observe(document.querySelector("body"))},e.prototype.calculateWidth=function(){var t=this;this.inner.style.width="".concat(this.sliderWidth*this.slides.length,"px"),this.inner.style.transform="translate(-".concat(this.currentIndex*this.sliderWidth,"px, 0px)"),this.slides.forEach((function(e){e.style.width="".concat(t.sliderWidth,"px")}))},e.prototype.addCurrentClass=function(){var t=this;this.slides.forEach((function(e,n){n===t.currentIndex?e.classList.add("active"):e.classList.remove("active")})),this.dots&&this.dots.forEach((function(e,n){n===t.currentIndex?e.classList.add("active"):e.classList.remove("active")}))},e.prototype.addDisabledClass=function(){if(!this.prev||!this.next)return!1;0===this.currentIndex?(this.next.classList.remove("disabled"),this.prev.classList.add("disabled")):this.currentIndex===this.slides.length-1?(this.prev.classList.remove("disabled"),this.next.classList.add("disabled")):(this.prev.classList.remove("disabled"),this.next.classList.remove("disabled"))},e.prototype.autoPlay=function(){this.setTimer()},e.prototype.setTimer=function(){var t=this;this.timer=setInterval((function(){t.currentIndex===t.slides.length-1?t.goTo(0):t.goToNext()}),this.speed)},e.prototype.resetTimer=function(){clearInterval(this.timer)},e.prototype.detectDirection=function(){var t=this.touchX,e=t.start,n=t.end;ne&&this.goToPrev()},e.prototype.recalculateWidth=function(){this.sliderWidth=this.inner.parentElement.clientWidth,this.calculateWidth()},e.prototype.goToPrev=function(){0===this.currentIndex&&this.isInfiniteLoop?(this.currentIndex=this.slides.length-1,this.inner.style.transform="translate(-".concat(this.currentIndex*this.sliderWidth,"px, 0px)"),this.addCurrentClass()):0!==this.currentIndex&&(this.currentIndex-=1,this.inner.style.transform="translate(-".concat(this.currentIndex*this.sliderWidth,"px, 0px)"),this.addCurrentClass(),this.addDisabledClass())},e.prototype.goToNext=function(){this.currentIndex===this.slides.length-1&&this.isInfiniteLoop?(this.currentIndex=0,this.inner.style.transform="translate(-".concat(this.currentIndex*this.sliderWidth,"px, 0px)"),this.addCurrentClass()):this.currentIndex0&&i[i.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t',E.outputEmptyTemplate=null!==(h=null==A?void 0:A.outputEmptyTemplate)&&void 0!==h?h:'
Nothing found...
',E.outputLoaderTemplate=null!==(f=null==A?void 0:A.outputLoaderTemplate)&&void 0!==f?f:'
\n\t\t\t\t
\n\t\t\t\t\tLoading...\n\t\t\t\t
\n\t\t\t
',E.groupingType=null!==(m=null==A?void 0:A.groupingType)&&void 0!==m?m:null,E.groupingTitleTemplate=null!==(v=null==A?void 0:A.groupingTitleTemplate)&&void 0!==v?v:"default"===E.groupingType?'
':'',E.tabsWrapperTemplate=null!==(y=null==A?void 0:A.tabsWrapperTemplate)&&void 0!==y?y:'
',E.preventSelection=null!==(g=null==A?void 0:A.preventSelection)&&void 0!==g&&g,E.isOpenOnFocus=null!==(w=null==A?void 0:A.isOpenOnFocus)&&void 0!==w&&w,E.input=null!==(b=E.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==b?b:null,E.output=null!==(C=E.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==C?C:null,E.itemsWrapper=null!==(S=E.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==S?S:null,E.items=null!==(x=Array.from(E.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==x?x:[],E.tabs=[],E.toggle=null!==(I=E.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==I?I:null,E.outputPlaceholder=null,E.selected=E.value=null!==(T=E.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==T?T:"",E.isOpened=!1,E.isCurrent=!1,E.animationInProcess=!1,E.selectedGroup="all",E.init(),E}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsComboBoxCollection,this),this.build()},e.prototype.build=function(){this.buildInput(),this.groupingType&&this.setGroups(),this.buildItems(),this.preventVisibility&&(this.isOpened=!0,this.recalculateDirection()),this.toggle&&this.buildToggle()},e.prototype.setResultAndRender=function(t){void 0===t&&(t=""),this.setResults(t),this.apiSearchQuery&&this.itemsFromJson()},e.prototype.buildInput=function(){var t=this;this.isOpenOnFocus&&this.input.addEventListener("focus",(function(){t.isOpened||(t.setResultAndRender(),t.open())})),this.input.addEventListener("input",(0,c.debounce)((function(e){t.setResultAndRender(e.target.value),t.isOpened||t.open()})))},e.prototype.buildItems=function(){this.apiUrl?this.itemsFromJson():(this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="",this.itemsFromHtml())},e.prototype.setResults=function(t){this.value=t,this.resultItems(),this.hasVisibleItems()?this.destroyOutputPlaceholder():this.buildOutputPlaceholder()},e.prototype.isItemExists=function(t){return this.items.some((function(e){return Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(e){return e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]}))}))},e.prototype.isTextExists=function(t,e){var n=e.map((function(t){return t.toLowerCase()}));return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(t){return n.includes(t.getAttribute("data-hs-combo-box-search-text").toLowerCase())}))},e.prototype.isTextExistsAny=function(t,e){return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(t){return t.getAttribute("data-hs-combo-box-search-text").toLowerCase().includes(e.toLowerCase())}))},e.prototype.valuesBySelector=function(t){return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).reduce((function(t,e){return a(a([],t,!0),[e.getAttribute("data-hs-combo-box-search-text")],!1)}),[])},e.prototype.buildOutputLoader=function(){if(this.outputLoader)return!1;this.outputLoader=(0,c.htmlToElement)(this.outputLoaderTemplate),this.items.length||this.outputPlaceholder?(this.outputLoader.style.position="absolute",this.outputLoader.style.top="0",this.outputLoader.style.bottom="0",this.outputLoader.style.left="0",this.outputLoader.style.right="0",this.outputLoader.style.zIndex="2"):(this.outputLoader.style.position="",this.outputLoader.style.top="",this.outputLoader.style.bottom="",this.outputLoader.style.left="",this.outputLoader.style.right="",this.outputLoader.style.zIndex="",this.outputLoader.style.height="30px"),this.output.append(this.outputLoader)},e.prototype.destroyOutputLoader=function(){this.outputLoader&&this.outputLoader.remove(),this.outputLoader=null},e.prototype.itemsFromJson=function(){return s(this,void 0,void 0,(function(){var t,e,n,o,i,r=this;return l(this,(function(s){switch(s.label){case 0:this.buildOutputLoader(),s.label=1;case 1:return s.trys.push([1,4,,5]),t="".concat(this.apiQuery),e="".concat(this.apiSearchQuery,"=").concat(this.value.toLowerCase()),n=this.apiUrl,this.apiQuery&&this.apiSearchQuery?n+="?".concat(e,"&").concat(t):this.apiQuery?n+="?".concat(t):this.apiSearchQuery&&(n+="?".concat(e)),[4,fetch(n,this.apiHeaders)];case 2:return[4,s.sent().json()];case 3:return o=s.sent(),this.apiDataPart&&(o=o[this.apiDataPart]),this.apiSearchQuery&&(this.items=[]),this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="","tabs"===this.groupingType?(this.setApiGroups(o),this.groupTabsRender(),this.jsonItemsRender(o)):"default"===this.groupingType?(this.setApiGroups(o),this.groups.forEach((function(t){var e=(0,c.htmlToElement)(r.groupingTitleTemplate);e.setAttribute("data-hs-combo-box-group-title",t.name),e.classList.add("--exclude-accessibility"),e.innerText=t.title;var n=o.filter((function(e){return e[r.apiGroupField]===t.name}));r.itemsWrapper?r.itemsWrapper.append(e):r.output.append(e),r.jsonItemsRender(n)}))):this.jsonItemsRender(o),this.setResults(this.input.value),[3,5];case 4:return i=s.sent(),console.error(i),[3,5];case 5:return this.destroyOutputLoader(),[2]}}))}))},e.prototype.jsonItemsRender=function(t){var e=this;t.forEach((function(t,n){if(e.isItemExists(t))return!1;var o=(0,c.htmlToElement)(e.outputItemTemplate);o.querySelectorAll("[data-hs-combo-box-search-text]").forEach((function(e){var n,o;e.textContent=null!==(n=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==n?n:"",e.setAttribute("data-hs-combo-box-search-text",null!==(o=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==o?o:"")})),o.querySelectorAll("[data-hs-combo-box-output-item-attr]").forEach((function(e){JSON.parse(e.getAttribute("data-hs-combo-box-output-item-attr")).forEach((function(n){e.setAttribute(n.attr,t[n.valueFrom])}))})),o.setAttribute("tabIndex","".concat(n)),"tabs"!==e.groupingType&&"default"!==e.groupingType||o.setAttribute("data-hs-combo-box-output-item",'{"group": {"name": "'.concat(t[e.apiGroupField],'", "title": "').concat(t[e.apiGroupField],'"}}')),e.items=a(a([],e.items,!0),[o],!1),e.preventSelection||o.addEventListener("click",(function(){e.close(o.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text")),e.setSelectedByValue(e.valuesBySelector(o))})),e.appendItemsToWrapper(o)}))},e.prototype.setGroups=function(){var t=[];this.items.forEach((function(e){var n=JSON.parse(e.getAttribute("data-hs-combo-box-output-item")).group;t.some((function(t){return(null==t?void 0:t.name)===n.name}))||t.push(n)})),this.groups=t},e.prototype.setCurrent=function(){window.$hsComboBoxCollection.length&&(window.$hsComboBoxCollection.map((function(t){return t.element.isCurrent=!1})),this.isCurrent=!0)},e.prototype.setApiGroups=function(t){var e=this,n=[];t.forEach((function(t){var o=t[e.apiGroupField];n.some((function(t){return t.name===o}))||n.push({name:o,title:o})})),this.groups=n},e.prototype.sortItems=function(){return this.items.sort((function(t,e){var n=t.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text"),o=e.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text");return no?1:0}))},e.prototype.itemRender=function(t){var e=this,n=t.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text");this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t),this.preventSelection||t.addEventListener("click",(function(){e.close(n),e.setSelectedByValue(e.valuesBySelector(t))}))},e.prototype.plainRender=function(t){var e=this;t.forEach((function(t){e.itemRender(t)}))},e.prototype.groupTabsRender=function(){var t=this,e=(0,c.htmlToElement)(this.tabsWrapperTemplate),n=(0,c.htmlToElement)('
');e.append(n),this.output.insertBefore(e,this.output.firstChild);var o=(0,c.htmlToElement)(this.groupingTitleTemplate);o.setAttribute("data-hs-combo-box-group-title","all"),o.classList.add("--exclude-accessibility","active"),o.innerText="All",this.tabs=a(a([],this.tabs,!0),[o],!1),n.append(o),o.addEventListener("click",(function(){t.selectedGroup="all";var e=t.tabs.find((function(e){return e.getAttribute("data-hs-combo-box-group-title")===t.selectedGroup}));t.tabs.forEach((function(t){return t.classList.remove("active")})),e.classList.add("active"),t.setItemsVisibility()})),this.groups.forEach((function(e){var o=(0,c.htmlToElement)(t.groupingTitleTemplate);o.setAttribute("data-hs-combo-box-group-title",e.name),o.classList.add("--exclude-accessibility"),o.innerText=e.title,t.tabs=a(a([],t.tabs,!0),[o],!1),n.append(o),o.addEventListener("click",(function(){t.selectedGroup=e.name;var n=t.tabs.find((function(e){return e.getAttribute("data-hs-combo-box-group-title")===t.selectedGroup}));t.tabs.forEach((function(t){return t.classList.remove("active")})),n.classList.add("active"),t.setItemsVisibility()}))}))},e.prototype.groupDefaultRender=function(){var t=this;this.groups.forEach((function(e){var n=(0,c.htmlToElement)(t.groupingTitleTemplate);n.setAttribute("data-hs-combo-box-group-title",e.name),n.classList.add("--exclude-accessibility"),n.innerText=e.title,t.itemsWrapper?t.itemsWrapper.append(n):t.output.append(n);var o=t.sortItems().filter((function(t){return JSON.parse(t.getAttribute("data-hs-combo-box-output-item")).group.name===e.name}));t.plainRender(o)}))},e.prototype.itemsFromHtml=function(){if("default"===this.groupingType)this.groupDefaultRender();else if("tabs"===this.groupingType){var t=this.sortItems();this.groupTabsRender(),this.plainRender(t)}else{t=this.sortItems();this.plainRender(t)}this.setResults(this.input.value)},e.prototype.buildToggle=function(){var t=this;this.toggle.addEventListener("click",(function(){t.isOpened?t.close():t.open(t.toggle.getAttribute("data-hs-combo-box-toggle"))}))},e.prototype.setSelectedByValue=function(t){var e=this;this.items.forEach((function(n){e.isTextExists(n,t)?n.classList.add("selected"):n.classList.remove("selected")}))},e.prototype.setValue=function(t){this.selected=t,this.value=t,this.input.value=t},e.prototype.setItemsVisibility=function(){var t=this;"tabs"===this.groupingType&&"all"!==this.selectedGroup&&this.items.forEach((function(t){t.style.display="none"}));var e="tabs"===this.groupingType?"all"===this.selectedGroup?this.items:this.items.filter((function(e){return JSON.parse(e.getAttribute("data-hs-combo-box-output-item")).group.name===t.selectedGroup})):this.items;"tabs"===this.groupingType&&"all"!==this.selectedGroup&&e.forEach((function(t){t.style.display="block"})),e.forEach((function(e){t.isTextExistsAny(e,t.value)?e.style.display="block":e.style.display="none"})),"default"===this.groupingType&&this.output.querySelectorAll("[data-hs-combo-box-group-title]").forEach((function(e){var n=e.getAttribute("data-hs-combo-box-group-title");t.items.filter((function(t){return JSON.parse(t.getAttribute("data-hs-combo-box-output-item")).group.name===n&&"block"===t.style.display})).length?e.style.display="block":e.style.display="none"}))},e.prototype.hasVisibleItems=function(){return!!this.items.length&&this.items.some((function(t){return"block"===t.style.display}))},e.prototype.appendItemsToWrapper=function(t){this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t)},e.prototype.buildOutputPlaceholder=function(){this.outputPlaceholder||(this.outputPlaceholder=(0,c.htmlToElement)(this.outputEmptyTemplate)),this.appendItemsToWrapper(this.outputPlaceholder)},e.prototype.destroyOutputPlaceholder=function(){this.outputPlaceholder&&this.outputPlaceholder.remove(),this.outputPlaceholder=null},e.prototype.resultItems=function(){if(!this.items.length)return!1;this.setItemsVisibility(),this.setSelectedByValue([this.selected])},e.prototype.setValueAndOpen=function(t){this.value=t,this.items.length&&this.setItemsVisibility()},e.prototype.open=function(t){var e=this;return!this.animationInProcess&&(void 0!==t&&this.setValueAndOpen(t),!this.preventVisibility&&(this.animationInProcess=!0,this.output.style.display="block",this.recalculateDirection(),setTimeout((function(){e.el.classList.add("active"),e.animationInProcess=!1})),void(this.isOpened=!0)))},e.prototype.setValueAndClear=function(t){t?this.setValue(t):this.setValue(this.selected),this.outputPlaceholder&&this.destroyOutputPlaceholder()},e.prototype.close=function(t){var e=this;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t),!1):(this.animationInProcess=!0,this.el.classList.remove("active"),this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom="",(0,c.afterTransition)(this.output,(function(){e.output.style.display="none",e.setValueAndClear(t),e.animationInProcess=!1})),void(this.isOpened=!1)))},e.prototype.recalculateDirection=function(){(0,c.isEnoughSpace)(this.output,this.input,"bottom",this.gap,this.viewport)?(this.output.classList.remove("bottom-full"),this.output.style.marginBottom="",this.output.classList.add("top-full"),this.output.style.marginTop="".concat(this.gap,"px")):(this.output.classList.remove("top-full"),this.output.style.marginTop="",this.output.classList.add("bottom-full"),this.output.style.marginBottom="".concat(this.gap,"px"))},e.getInstance=function(t,e){var n=window.$hsComboBoxCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsComboBoxCollection||(window.$hsComboBoxCollection=[]),document.querySelectorAll("[data-hs-combo-box]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsComboBoxCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-combo-box"),o=n?JSON.parse(n):{};new e(t,o)}})),window.$hsComboBoxCollection&&(window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.close=function(t){var e=window.$hsComboBoxCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.isOpened&&e.element.close()},e.closeCurrentlyOpened=function(t){if(void 0===t&&(t=null),!t.closest("[data-hs-combo-box].active")){var e=window.$hsComboBoxCollection.filter((function(t){return t.element.isOpened}))||null;e&&e.forEach((function(t){t.element.close()}))}},e.getPreparedItems=function(t,e){return void 0===t&&(t=!1),e?(t?Array.from(e.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter((function(t){return"none"!==t.style.display})).reverse():Array.from(e.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter((function(t){return"none"!==t.style.display}))).filter((function(t){return!t.classList.contains("disabled")})):null},e.setHighlighted=function(t,e,n){e.focus(),n.value=e.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text"),t&&t.classList.remove("hs-combo-box-output-item-highlighted"),e.classList.add("hs-combo-box-output-item-highlighted")},e.accessibility=function(t){if(window.$hsComboBoxCollection.find((function(t){return t.element.isOpened}))&&d.COMBO_BOX_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}},e.onEscape=function(){var t=window.$hsComboBoxCollection.find((function(t){return!t.element.preventVisibility&&t.element.isOpened}));t&&(t.element.close(),t.element.input.blur())},e.onArrow=function(t){var n;void 0===t&&(t=!0);var o=window.$hsComboBoxCollection.find((function(t){return t.element.preventVisibility?t.element.isCurrent:t.element.isOpened}));if(o){var i=null!==(n=o.element.itemsWrapper)&&void 0!==n?n:o.element.output;if(!i)return!1;var r,s=e.getPreparedItems(t,i),l=i.querySelector(".hs-combo-box-output-item-highlighted");l||s[0].classList.add("hs-combo-box-output-item-highlighted");var a=s.findIndex((function(t){return t===l}));a+1=this.limit)return!1;this.el.hasAttribute("disabled")&&this.el.setAttribute("disabled","");var t=this.target.cloneNode(!0);this.addToItems(t),this.limit&&this.items.length>=this.limit&&this.el.setAttribute("disabled","disabled"),this.fireEvent("copy",t),(0,s.dispatch)("copy.hs.copyMarkup",t,t)},e.prototype.addPredefinedItems=function(){var t=this;Array.from(this.wrapper.children).filter((function(t){return!t.classList.contains("[--ignore-for-count]")})).forEach((function(e){t.addToItems(e)}))},e.prototype.setTarget=function(){var t="string"==typeof this.targetSelector?document.querySelector(this.targetSelector).cloneNode(!0):this.targetSelector.cloneNode(!0);t.removeAttribute("id"),this.target=t},e.prototype.setWrapper=function(){this.wrapper="string"==typeof this.wrapperSelector?document.querySelector(this.wrapperSelector):this.wrapperSelector},e.prototype.addToItems=function(t){var e=this,n=t.querySelector("[data-hs-copy-markup-delete-item]");this.wrapper?this.wrapper.append(t):this.el.before(t),n&&n.addEventListener("click",(function(){return e.delete(t)})),this.items.push(t)},e.prototype.delete=function(t){var e=this.items.indexOf(t);-1!==e&&this.items.splice(e,1),t.remove(),this.fireEvent("delete",t),(0,s.dispatch)("delete.hs.copyMarkup",t,t)},e.getInstance=function(t,e){var n=window.$hsCopyMarkupCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsCopyMarkupCollection||(window.$hsCopyMarkupCollection=[]),document.querySelectorAll("[data-hs-copy-markup]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsCopyMarkupCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-copy-markup"),o=n?JSON.parse(n):{};new e(t,o)}}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=l),e.default=l},610:function(t,e,n){ /* * HSDropdown - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i .hs-dropdown-toggle")||i.el.children[0],i.menu=i.el.querySelector(":scope > .hs-dropdown-menu"),i.eventMode=(0,s.getClassProperty)(i.el,"--trigger","click"),i.closeMode=(0,s.getClassProperty)(i.el,"--auto-close","true"),i.animationInProcess=!1,i.toggle&&i.menu&&i.init(),i}return i(e,t),e.prototype.init=function(){var t=this;if(this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle.addEventListener("click",(function(){return t.onClickHandler()})),(0,s.isIOS)()||(0,s.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return t.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return t.onMouseLeaveHandler()})))},e.prototype.resizeHandler=function(){this.eventMode=(0,s.getClassProperty)(this.el,"--trigger","click")},e.prototype.onClickHandler=function(){this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?this.close():this.open()},e.prototype.onMouseEnterHandler=function(){if("hover"!==this.eventMode)return!1;this.el._popper&&this.forceClearState(),!this.el.classList.contains("open")&&this.menu.classList.contains("hidden")&&this.open()},e.prototype.onMouseLeaveHandler=function(){if("hover"!==this.eventMode)return!1;this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")&&this.close()},e.prototype.destroyPopper=function(){this.menu.classList.remove("block"),this.menu.classList.add("hidden"),this.menu.style.inset=null,this.menu.style.position=null,this.el&&this.el._popper&&this.el._popper.destroy(),this.animationInProcess=!1},e.prototype.absoluteStrategyModifiers=function(){var t=this;return[{name:"applyStyles",fn:function(e){var n=(window.getComputedStyle(t.el).getPropertyValue("--strategy")||"absolute").replace(" ",""),o=(window.getComputedStyle(t.el).getPropertyValue("--adaptive")||"adaptive").replace(" ","");e.state.elements.popper.style.position=n,e.state.elements.popper.style.transform="adaptive"===o?e.state.styles.popper.transform:null,e.state.elements.popper.style.top=null,e.state.elements.popper.style.bottom=null,e.state.elements.popper.style.left=null,e.state.elements.popper.style.right=null,e.state.elements.popper.style.margin=0}},{name:"computeStyles",options:{adaptive:!1}}]},e.prototype.open=function(){var t=this;if(this.el.classList.contains("open"))return!1;if(this.animationInProcess)return!1;this.animationInProcess=!0;var e=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),n=(window.getComputedStyle(this.el).getPropertyValue("--flip")||"true").replace(" ",""),o=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),i=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ",""));"static"!==o&&(this.el._popper=(0,l.createPopper)(this.el,this.menu,{placement:c.POSITIONS[e]||"bottom-start",strategy:o,modifiers:r(r([],"fixed"!==o?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===n},{name:"offset",options:{offset:[0,i]}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){t.el.classList.add("open"),t.animationInProcess=!1})),this.fireEvent("open",this.el),(0,s.dispatch)("open.hs.dropdown",this.el,this.el)},e.prototype.close=function(t){var e=this;if(void 0===t&&(t=!0),this.animationInProcess||!this.el.classList.contains("open"))return!1;if(this.animationInProcess=!0,t){var n=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,s.afterTransition)(n,(function(){return e.destroyPopper()}))}else this.destroyPopper();this.menu.style.margin=null,this.el.classList.remove("open"),this.fireEvent("close",this.el),(0,s.dispatch)("close.hs.dropdown",this.el,this.el)},e.prototype.forceClearState=function(){this.destroyPopper(),this.menu.style.margin=null,this.el.classList.remove("open")},e.getInstance=function(t,e){var n=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.autoInit=function(){if(window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),document.querySelectorAll(".hs-dropdown:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDropdownCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)})),window.$hsDropdownCollection){document.addEventListener("keydown",(function(t){return e.accessibility(t)})),window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)}));var t=window.innerWidth;window.addEventListener("resize",(function(){window.innerWidth!==t&&(t=innerWidth,e.closeCurrentlyOpened(null,!1))}))}},e.open=function(t){var e=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.menu.classList.contains("hidden")&&e.element.open()},e.close=function(t){var e=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&!e.element.menu.classList.contains("hidden")&&e.element.close()},e.accessibility=function(t){this.history=s.menuSearchHistory;var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e&&(c.DROPDOWN_ACCESSIBILITY_KEY_SET.includes(t.code)||4===t.code.length&&t.code[t.code.length-1].match(/^[A-Z]*$/))&&!t.metaKey&&!e.element.menu.querySelector("input:focus"))switch(console.log("Key code:",t.code),t.code){case"Escape":e.element.menu.querySelector(".hs-select.active")||(t.preventDefault(),this.onEscape(t));break;case"Enter":e.element.menu.querySelector(".hs-select button:focus")||e.element.menu.querySelector(".hs-collapse-toggle:focus")||this.onEnter(t);break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;default:t.preventDefault(),this.onFirstLetter(t.key)}},e.onEscape=function(t){var e=t.target.closest(".hs-dropdown.open");if(window.$hsDropdownCollection.find((function(t){return t.element.el===e}))){var n=window.$hsDropdownCollection.find((function(t){return t.element.el===e}));n&&(n.element.close(),n.element.toggle.focus())}else this.closeCurrentlyOpened()},e.onEnter=function(t){var e=t.target.parentElement;if(window.$hsDropdownCollection.find((function(t){return t.element.el===e}))){t.preventDefault();var n=window.$hsDropdownCollection.find((function(t){return t.element.el===e}));n&&n.element.open()}},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e){var n=e.element.menu;if(!n)return!1;var o=(t?Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])")).reverse():Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector("a:focus, button:focus"),r=o.findIndex((function(t){return t===i}));r+1 .hs-dropdown-toggle")||i.el.children[0],i.menu=i.el.querySelector(":scope > .hs-dropdown-menu"),i.eventMode=(0,s.getClassProperty)(i.el,"--trigger","click"),i.closeMode=(0,s.getClassProperty)(i.el,"--auto-close","true"),i.animationInProcess=!1,i.toggle&&i.menu&&i.init(),i}return i(e,t),e.prototype.init=function(){var t=this;if(this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle.addEventListener("click",(function(){return t.onClickHandler()})),(0,s.isIOS)()||(0,s.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return t.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return t.onMouseLeaveHandler()})))},e.prototype.resizeHandler=function(){this.eventMode=(0,s.getClassProperty)(this.el,"--trigger","click")},e.prototype.onClickHandler=function(){this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?this.close():this.open()},e.prototype.onMouseEnterHandler=function(){if("hover"!==this.eventMode)return!1;this.el._popper&&this.forceClearState(),!this.el.classList.contains("open")&&this.menu.classList.contains("hidden")&&this.open()},e.prototype.onMouseLeaveHandler=function(){if("hover"!==this.eventMode)return!1;this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")&&this.close()},e.prototype.destroyPopper=function(){this.menu.classList.remove("block"),this.menu.classList.add("hidden"),this.menu.style.inset=null,this.menu.style.position=null,this.el&&this.el._popper&&this.el._popper.destroy(),this.animationInProcess=!1},e.prototype.absoluteStrategyModifiers=function(){var t=this;return[{name:"applyStyles",fn:function(e){var n=(window.getComputedStyle(t.el).getPropertyValue("--strategy")||"absolute").replace(" ",""),o=(window.getComputedStyle(t.el).getPropertyValue("--adaptive")||"adaptive").replace(" ","");e.state.elements.popper.style.position=n,e.state.elements.popper.style.transform="adaptive"===o?e.state.styles.popper.transform:null,e.state.elements.popper.style.top=null,e.state.elements.popper.style.bottom=null,e.state.elements.popper.style.left=null,e.state.elements.popper.style.right=null,e.state.elements.popper.style.margin=0}},{name:"computeStyles",options:{adaptive:!1}}]},e.prototype.open=function(){var t=this;if(this.el.classList.contains("open"))return!1;if(this.animationInProcess)return!1;this.animationInProcess=!0;var e=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),n=(window.getComputedStyle(this.el).getPropertyValue("--flip")||"true").replace(" ",""),o=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),i=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ",""));"static"!==o&&(this.el._popper=(0,l.createPopper)(this.el,this.menu,{placement:c.POSITIONS[e]||"bottom-start",strategy:o,modifiers:r(r([],"fixed"!==o?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===n},{name:"offset",options:{offset:[0,i]}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){t.el.classList.add("open"),t.animationInProcess=!1})),this.fireEvent("open",this.el),(0,s.dispatch)("open.hs.dropdown",this.el,this.el)},e.prototype.close=function(t){var e=this;if(void 0===t&&(t=!0),this.animationInProcess||!this.el.classList.contains("open"))return!1;if(this.animationInProcess=!0,t){var n=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,s.afterTransition)(n,(function(){return e.destroyPopper()}))}else this.destroyPopper();this.menu.style.margin=null,this.el.classList.remove("open"),this.fireEvent("close",this.el),(0,s.dispatch)("close.hs.dropdown",this.el,this.el)},e.prototype.forceClearState=function(){this.destroyPopper(),this.menu.style.margin=null,this.el.classList.remove("open")},e.getInstance=function(t,e){var n=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.autoInit=function(){if(window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),document.querySelectorAll(".hs-dropdown:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDropdownCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)})),window.$hsDropdownCollection){document.addEventListener("keydown",(function(t){return e.accessibility(t)})),window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)}));var t=window.innerWidth;window.addEventListener("resize",(function(){window.innerWidth!==t&&(t=innerWidth,e.closeCurrentlyOpened(null,!1))}))}},e.open=function(t){var e=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.menu.classList.contains("hidden")&&e.element.open()},e.close=function(t){var e=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&!e.element.menu.classList.contains("hidden")&&e.element.close()},e.accessibility=function(t){this.history=s.menuSearchHistory;var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e&&(c.DROPDOWN_ACCESSIBILITY_KEY_SET.includes(t.code)||4===t.code.length&&t.code[t.code.length-1].match(/^[A-Z]*$/))&&!t.metaKey&&!e.element.menu.querySelector("input:focus"))switch(t.code){case"Escape":e.element.menu.querySelector(".hs-select.active")||(t.preventDefault(),this.onEscape(t));break;case"Enter":e.element.menu.querySelector(".hs-select button:focus")||e.element.menu.querySelector(".hs-collapse-toggle:focus")||this.onEnter(t);break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;default:t.preventDefault(),this.onFirstLetter(t.key)}},e.onEscape=function(t){var e=t.target.closest(".hs-dropdown.open");if(window.$hsDropdownCollection.find((function(t){return t.element.el===e}))){var n=window.$hsDropdownCollection.find((function(t){return t.element.el===e}));n&&(n.element.close(),n.element.toggle.focus())}else this.closeCurrentlyOpened()},e.onEnter=function(t){var e=t.target.parentElement;if(window.$hsDropdownCollection.find((function(t){return t.element.el===e}))){t.preventDefault();var n=window.$hsDropdownCollection.find((function(t){return t.element.el===e}));n&&n.element.open()}},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e){var n=e.element.menu;if(!n)return!1;var o=(t?Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])")).reverse():Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector("a:focus, button:focus"),r=o.findIndex((function(t){return t===i}));r+10?l.step:1,o.init(),o}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsInputNumberCollection,this),this.input&&this.increment&&this.build()},e.prototype.build=function(){this.input&&this.buildInput(),this.increment&&this.buildIncrement(),this.decrement&&this.buildDecrement(),this.inputValue<=0&&0===this.minInputValue&&(this.inputValue=0,this.input.value="0"),(this.inputValue<=0||this.minInputValue<0)&&this.changeValue(),this.input.hasAttribute("disabled")&&this.disableButtons()},e.prototype.buildInput=function(){var t=this;this.input.addEventListener("input",(function(){return t.changeValue()}))},e.prototype.buildIncrement=function(){var t=this;this.increment.addEventListener("click",(function(){t.changeValue("increment")}))},e.prototype.buildDecrement=function(){var t=this;this.decrement.addEventListener("click",(function(){t.changeValue("decrement")}))},e.prototype.changeValue=function(t){var e,n;void 0===t&&(t="none");var o={inputValue:this.inputValue},i=null!==(e=this.minInputValue)&&void 0!==e?e:Number.MIN_SAFE_INTEGER,r=null!==(n=this.maxInputValue)&&void 0!==n?n:Number.MAX_SAFE_INTEGER;switch(this.inputValue=isNaN(this.inputValue)?0:this.inputValue,t){case"increment":var l=this.inputValue+this.step;this.inputValue=l>=i&&l<=r?l:r,this.input.value=this.inputValue.toString();break;case"decrement":var a=this.inputValue-this.step;this.inputValue=a>=i&&a<=r?a:i,this.input.value=this.inputValue.toString();break;default:var c=isNaN(parseInt(this.input.value))?0:parseInt(this.input.value);this.inputValue=c>=r?r:c<=i?i:c,this.inputValue<=i&&(this.input.value=this.inputValue.toString())}o.inputValue=this.inputValue,this.inputValue===i?(this.el.classList.add("disabled"),this.decrement&&this.disableButtons("decrement")):(this.el.classList.remove("disabled"),this.decrement&&this.enableButtons("decrement")),this.inputValue===r?(this.el.classList.add("disabled"),this.increment&&this.disableButtons("increment")):(this.el.classList.remove("disabled"),this.increment&&this.enableButtons("increment")),this.fireEvent("change",o),(0,s.dispatch)("change.hs.inputNumber",this.el,o)},e.prototype.disableButtons=function(t){void 0===t&&(t="all"),"all"===t?("BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.setAttribute("disabled","disabled"),"BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.setAttribute("disabled","disabled")):"increment"===t?"BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.setAttribute("disabled","disabled"):"decrement"===t&&("BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.setAttribute("disabled","disabled"))},e.prototype.enableButtons=function(t){void 0===t&&(t="all"),"all"===t?("BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.removeAttribute("disabled"),"BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.removeAttribute("disabled")):"increment"===t?"BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.removeAttribute("disabled"):"decrement"===t&&("BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.removeAttribute("disabled"))},e.getInstance=function(t,e){var n=window.$hsInputNumberCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsInputNumberCollection||(window.$hsInputNumberCollection=[]),document.querySelectorAll("[data-hs-input-number]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsInputNumberCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=l),e.default=l},770:function(t,e,n){ /* * HSOverlay - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n-1?e[(o+1)%e.length].focus():e[0].focus()},e.on=function(t,e,n){var o=window.$hsOverlayCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)||t.element.overlay===("string"==typeof e?document.querySelector(e):e)}));o&&(o.element.events[t]=n)},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSOverlay=l),e.default=l},659:function(t,e,n){ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=t?(document.body.classList.add("hs-overlay-body-open"),e.element.overlay.classList.add("opened")):e.element.close(!0)},e.accessibility=function(t){var e,n,o=window.$hsOverlayCollection.filter((function(t){return t.element.overlay.classList.contains("open")})),i=o[o.length-1],r=null===(n=null===(e=null==i?void 0:i.element)||void 0===e?void 0:e.overlay)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),l=[];(null==r?void 0:r.length)&&r.forEach((function(t){(0,s.isParentOrElementHidden)(t)||l.push(t)}));var a=i&&!t.metaKey;if(a&&!i.element.isTabAccessibilityLimited&&"Tab"===t.code)return!1;a&&l.length&&"Tab"===t.code&&(t.preventDefault(),this.onTab(i,l)),a&&"Escape"===t.code&&(t.preventDefault(),this.onEscape(i))},e.onEscape=function(t){t&&t.element.hasAbilityToCloseOnBackdropClick&&t.element.close()},e.onTab=function(t,e){if(!e.length)return!1;var n=t.element.overlay.querySelector(":focus"),o=Array.from(e).indexOf(n);o>-1?e[(o+1)%e.length].focus():e[0].focus()},e.on=function(t,e,n){var o=window.$hsOverlayCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)||t.element.overlay===("string"==typeof e?document.querySelector(e):e)}));o&&(o.element.events[t]=n)},e}(n(737).default);window.addEventListener("load",(function(){a.autoInit()})),window.addEventListener("resize",(function(){!function(){if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((function(t){return t.element.autoClose})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.autoClose})).forEach((function(t){document.body.clientWidth>=t.element.autoClose&&t.element.close(!0)}))}(),function(){if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((function(t){return t.element.openedBreakpoint})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.openedBreakpoint})).forEach((function(t){a.setOpened(t.element.openedBreakpoint,t)}))}()})),"undefined"!=typeof window&&(window.HSOverlay=a),e.default=a},659:function(t,e,n){ /* * HSPinInput - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -73,7 +81,7 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&this.items[e-1].focus()},e.prototype.onKeydown=function(t,e){"Backspace"===t.key&&e>0&&(""===this.items[e].value?(this.items[e-1].value="",this.items[e-1].focus()):this.items[e].value=""),this.setCurrentValue(),this.toggleCompleted()},e.prototype.onFocusIn=function(t){this.items[t].setAttribute("placeholder","")},e.prototype.onFocusOut=function(t){this.items[t].setAttribute("placeholder",this.placeholders[t])},e.prototype.onPaste=function(t){var e=this;t.preventDefault(),this.items.forEach((function(n){document.activeElement===n&&e.autoFillAll(t.clipboardData.getData("text"))}))},e.getInstance=function(t,e){var n=window.$hsPinInputCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsPinInputCollection||(window.$hsPinInputCollection=[]),document.querySelectorAll("[data-hs-pin-input]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsPinInputCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=l),e.default=l},139:function(t,e,n){ /* * HSRemoveElement - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -81,7 +89,7 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0){if(this.activeSection===e)return!1;this.links.forEach((function(t){t.classList.remove("active")}));var a=this.el.querySelector('[href="#'.concat(e.getAttribute("id"),'"]'));if(a){a.classList.add("active");var c=a.closest("[data-hs-scrollspy-group]");if(c){var u=c.querySelector("[href]");u&&u.classList.add("active")}}this.activeSection=e}},e.prototype.scrollTo=function(t){var e=t.getAttribute("href"),n=document.querySelector(e),o=parseInt((0,r.getClassProperty)(this.el,"--scrollspy-offset","0")),i=parseInt((0,r.getClassProperty)(n,"--scrollspy-offset"))||o,s=this.scrollable===document?0:this.scrollable.offsetTop,l=n.offsetTop-i-s,a=this.scrollable===document?window:this.scrollable,c=function(){window.history.replaceState(null,null,t.getAttribute("href")),"scrollTo"in a&&a.scrollTo({top:l,left:0,behavior:"smooth"})},u=this.fireEvent("beforeScroll",this.el);(0,r.dispatch)("beforeScroll.hs.scrollspy",this.el,this.el),u instanceof Promise?u.then((function(){return c()})):c()},e.getInstance=function(t,e){void 0===e&&(e=!1);var n=window.$hsScrollspyCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.autoInit=function(){window.$hsScrollspyCollection||(window.$hsScrollspyCollection=[]),document.querySelectorAll("[data-hs-scrollspy]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsScrollspyCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){s.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=s),e.default=s},961:function(t,e,n){ /* * HSTogglePassword - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&i[i.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]",o.dropdownClasses=l.dropdownClasses||"absolute top-full z-[1] w-full bg-white border border-gray-200 rounded-md hidden mt-2",o.dropdownItemTemplate=l.dropdownItemTemplate||"
",o.dropdownItemTemplatesByType=l.dropdownItemTemplatesByType||null,o.dropdownItemClasses=l.dropdownItemClasses||"py-2 px-4 w-full cursor-pointer text-sm hover:bg-gray-300 hover:text-black",o.highlightedTextTagName=l.highlightedTextTagName||"u",o.highlightedTextClasses=l.highlightedTextClasses||"bg-green-200",o.jsonUrl&&o.fetchData().then((function(){return o.init()})),o}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsSearchByJsonCollection,this),this.buildDropdown(),this.el.addEventListener("input",(0,a.debounce)((function(e){t.val=e.target.value,t.val.length>t.minChars?t.searchData(t.val):t.result=[],t.result.length?t.dropdown.classList.remove("hidden"):t.dropdown.classList.add("hidden"),t.buildItems(),console.log("result:",t.result)})))},e.prototype.fetchData=function(){return s(this,void 0,void 0,(function(){var t=this;return l(this,(function(e){switch(e.label){case 0:return[4,fetch(this.jsonUrl).then((function(t){return t.json()})).then((function(e){return t.json=e}))];case 1:return e.sent(),[2]}}))}))},e.prototype.searchData=function(t){this.result=this.json.filter((function(e){var n=t.toLowerCase(),o=e.title.toLowerCase(),i=e.description.toLowerCase();return o.includes(n)||i.includes(n)}))},e.prototype.buildDropdown=function(){this.dropdown=(0,a.htmlToElement)(this.dropdownTemplate),this.dropdownClasses&&(0,a.classToClassList)(this.dropdownClasses,this.dropdown),this.el.after(this.dropdown)},e.prototype.buildItems=function(){var t=this;this.dropdown.innerHTML="",this.result.forEach((function(e){var n=(0,a.htmlToElement)(''));n.append(t.itemTemplate(e)),t.dropdown.append(n)}))},e.prototype.itemTemplate=function(t){var e=new RegExp(this.val,"gi"),n=t.title.replace(e,"<".concat(this.highlightedTextTagName,' class="inline-block ').concat(this.highlightedTextClasses,'">').concat(this.val,"")),o=t.description.replace(e,"<".concat(this.highlightedTextTagName,' class="inline-block ').concat(this.highlightedTextClasses,'">').concat(this.val,"")),i=this.dropdownItemTemplatesByType?this.dropdownItemTemplatesByType.find((function(e){return e.type===t.type})):null,r=i?(0,a.htmlToElement)(i.markup):(0,a.htmlToElement)(this.dropdownItemTemplate);this.dropdownItemClasses&&(0,a.classToClassList)(this.dropdownItemClasses,r);var s=r.querySelector("[data-title]");s?s.append((0,a.htmlToElement)("".concat(n,""))):r.append((0,a.htmlToElement)("".concat(n,"")));var l=r.querySelector("[data-description]");if(l)l.append((0,a.htmlToElement)("".concat(o,"")));else if(!i){var c=(0,a.htmlToElement)("
");r.append(c),r.append((0,a.htmlToElement)("".concat(o,"")))}return r},e.getInstance=function(t){var e=window.$hsSearchByJsonCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return e?e.element:null},e.autoInit=function(){window.$hsSearchByJsonCollection||(window.$hsSearchByJsonCollection=[]),document.querySelectorAll("[data-hs-search-by-json]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsSearchByJsonCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){c.autoInit()})),"undefined"!=typeof window&&(window.HSSearchByJson=c),e.default=c},233:function(t,e,n){ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&i[i.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]",o.dropdownClasses=l.dropdownClasses||"absolute top-full z-[1] w-full bg-white border border-gray-200 rounded-md hidden mt-2",o.dropdownItemTemplate=l.dropdownItemTemplate||"
",o.dropdownItemTemplatesByType=l.dropdownItemTemplatesByType||null,o.dropdownItemClasses=l.dropdownItemClasses||"py-2 px-4 w-full cursor-pointer text-sm hover:bg-gray-300 hover:text-black",o.highlightedTextTagName=l.highlightedTextTagName||"u",o.highlightedTextClasses=l.highlightedTextClasses||"bg-green-200",o.jsonUrl&&o.fetchData().then((function(){return o.init()})),o}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsSearchByJsonCollection,this),this.buildDropdown(),this.el.addEventListener("input",(0,a.debounce)((function(e){t.val=e.target.value,t.val.length>t.minChars?t.searchData(t.val):t.result=[],t.result.length?t.dropdown.classList.remove("hidden"):t.dropdown.classList.add("hidden"),t.buildItems()})))},e.prototype.fetchData=function(){return s(this,void 0,void 0,(function(){var t=this;return l(this,(function(e){switch(e.label){case 0:return[4,fetch(this.jsonUrl).then((function(t){return t.json()})).then((function(e){return t.json=e}))];case 1:return e.sent(),[2]}}))}))},e.prototype.searchData=function(t){this.result=this.json.filter((function(e){var n=t.toLowerCase(),o=e.title.toLowerCase(),i=e.description.toLowerCase();return o.includes(n)||i.includes(n)}))},e.prototype.buildDropdown=function(){this.dropdown=(0,a.htmlToElement)(this.dropdownTemplate),this.dropdownClasses&&(0,a.classToClassList)(this.dropdownClasses,this.dropdown),this.el.after(this.dropdown)},e.prototype.buildItems=function(){var t=this;this.dropdown.innerHTML="",this.result.forEach((function(e){var n=(0,a.htmlToElement)(''));n.append(t.itemTemplate(e)),t.dropdown.append(n)}))},e.prototype.itemTemplate=function(t){var e=new RegExp(this.val,"gi"),n=t.title.replace(e,"<".concat(this.highlightedTextTagName,' class="inline-block ').concat(this.highlightedTextClasses,'">').concat(this.val,"")),o=t.description.replace(e,"<".concat(this.highlightedTextTagName,' class="inline-block ').concat(this.highlightedTextClasses,'">').concat(this.val,"")),i=this.dropdownItemTemplatesByType?this.dropdownItemTemplatesByType.find((function(e){return e.type===t.type})):null,r=i?(0,a.htmlToElement)(i.markup):(0,a.htmlToElement)(this.dropdownItemTemplate);this.dropdownItemClasses&&(0,a.classToClassList)(this.dropdownItemClasses,r);var s=r.querySelector("[data-title]");s?s.append((0,a.htmlToElement)("".concat(n,""))):r.append((0,a.htmlToElement)("".concat(n,"")));var l=r.querySelector("[data-description]");if(l)l.append((0,a.htmlToElement)("".concat(o,"")));else if(!i){var c=(0,a.htmlToElement)("
");r.append(c),r.append((0,a.htmlToElement)("".concat(o,"")))}return r},e.getInstance=function(t){var e=window.$hsSearchByJsonCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return e?e.element:null},e.autoInit=function(){window.$hsSearchByJsonCollection||(window.$hsSearchByJsonCollection=[]),document.querySelectorAll("[data-hs-search-by-json]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsSearchByJsonCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){c.autoInit()})),"undefined"!=typeof window&&(window.HSSearchByJson=c),e.default=c},233:function(t,e,n){ /* * HSSelect - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n"),e=this.toggle.querySelector("[data-icon]"),n=this.toggle.querySelector("[data-title]"),!this.isMultiple&&e&&this.setToggleIcon(),!this.isMultiple&&n&&this.setToggleTitle(),this.isMultiple?this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder:this.toggleTextWrapper.innerHTML=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder,n||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,l.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),this.toggle.addEventListener("click",(function(){if(o.isDisabled)return!1;o.isOpened?o.close():o.open()}))},e.prototype.setToggleIcon=function(){var t,e,n=this.toggle.querySelector("[data-icon]");if(n.innerHTML="",n){var o=(0,l.htmlToElement)((null===(e=null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.options)||void 0===e?void 0:e.icon)||"");n.append(o),o?n.classList.remove("hidden"):n.classList.add("hidden")}},e.prototype.setToggleTitle=function(){var t,e=this.toggle.querySelector("[data-title]");if(e.classList.add("truncate"),e.innerHTML="",e){var n=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder;e.innerHTML=n,this.toggle.append(e)}},e.prototype.buildTags=function(){this.tags=document.createElement("div"),this.tags.classList.add("flex"),this.tagsClasses&&(0,l.classToClassList)(this.tagsClasses,this.tags),this.buildTagsInput(),this.buildTagsItems(),this.setTagsItems(),this.wrapper&&this.wrapper.append(this.tags)},e.prototype.buildTagsItems=function(){this.tagsItems=document.createElement("div"),this.tagsItems.classList.add("flex","flex-wrap","flex-0","items-center"),this.setTagsItems(),this.tags.append(this.tagsItems)},e.prototype.buildTagsItem=function(t){var e,n,o,i,r,s,a,c=this,u=this.getItemByValue(t),d=document.createElement("div");if(this.tagsItemClasses&&(0,l.classToClassList)(this.tagsItemClasses,d),this.tagsItemTemplate&&(i=(0,l.htmlToElement)(this.tagsItemTemplate),d.append(i)),null===(e=null==u?void 0:u.options)||void 0===e?void 0:e.icon){var p=(0,l.htmlToElement)(null===(n=null==u?void 0:u.options)||void 0===n?void 0:n.icon);(a=i?i.querySelector("[data-icon]"):document.createElement("span")).append(p),i||d.append(a)}i&&i.querySelector("[data-icon]")&&!(null===(o=null==u?void 0:u.options)||void 0===o?void 0:o.icon)&&i.querySelector("[data-icon]").classList.add("hidden"),(r=i?i.querySelector("[data-title]"):document.createElement("span")).textContent=u.title||"",i||d.append(r),i?s=i.querySelector("[data-remove]"):((s=document.createElement("span")).textContent="X",d.append(s)),s.addEventListener("click",(function(){c.value=c.value.filter((function(e){return e!==t})),c.unselectMultipleItems(),c.setTagsItems(),c.selectMultipleItems()})),this.tagsItems.append(d)},e.prototype.getItemByValue=function(t){return this.selectOptions.find((function(e){return e.val===t}))},e.prototype.setTagsItems=function(){var t=this;this.tagsItems.innerHTML="",this.value&&(this.value.forEach((function(e){t.buildTagsItem(e)})),this.tagsInput.readOnly=!0),this.value.length||(this.tagsInput.placeholder=this.placeholder,this.tagsInput.readOnly=!1)},e.prototype.buildTagsInput=function(){var t=this;this.tagsInput=document.createElement("input"),this.tagsInput.placeholder=this.placeholder,this.tagsInputClasses&&(0,l.classToClassList)(this.tagsInputClasses,this.tagsInput),this.tagsInput.addEventListener("focus",(function(){return t.open()})),this.tagsInput.addEventListener("input",(0,l.debounce)((function(e){return t.searchOptions(e.target.value)}))),this.tagsInput.addEventListener("keydown",(function(e){if("Enter"===e.key&&t.isAddTagOnEnter){var n=e.target.value;if(t.selectOptions.find((function(t){return t.val===n})))return!1;t.addSelectOption(n,n),t.buildOption(n,n),t.dropdown.querySelector('[data-value="'.concat(n,'"]')).click(),t.resetTagsInputField(),t.close()}})),this.tags.append(this.tagsInput)},e.prototype.buildDropdown=function(){var t=this;this.dropdown=(0,l.htmlToElement)(this.dropdownTag||"
"),this.dropdown.classList.add("absolute","top-full"),this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,l.classToClassList)(this.dropdownClasses,this.dropdown),this.wrapper&&this.wrapper.append(this.dropdown),this.dropdown&&this.hasSearch&&this.buildSearch(),this.selectOptions&&this.selectOptions.forEach((function(e,n){return t.buildOption(e.title,e.val,e.options,"".concat(n))}))},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,l.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,l.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]"),this.search=(0,l.htmlToElement)(''),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,l.classToClassList)(this.searchClasses,this.search),this.search.addEventListener("input",(0,l.debounce)((function(t){return e.searchOptions(t.target.value)}))),t?t.append(this.search):this.searchWrapper.append(this.search),this.dropdown.append(this.searchWrapper)},e.prototype.buildOption=function(t,e,n,o){var i=this;void 0===o&&(o="1");var r=null,s=(0,l.htmlToElement)(this.optionTag||"
");if(s.setAttribute("data-value",e),s.setAttribute("data-title-value",t),s.setAttribute("tabIndex",o),s.classList.add("cursor-pointer"),this.optionTemplate&&(r=(0,l.htmlToElement)(this.optionTemplate),s.append(r)),r?r.querySelector("[data-title]").textContent=t||"":s.textContent=t||"",n){if(n.icon){var a=(0,l.htmlToElement)(n.icon);if(a.classList.add("mw-full"),r)r.querySelector("[data-icon]").append(a);else{var c=(0,l.htmlToElement)("
");this.iconClasses&&(0,l.classToClassList)(this.iconClasses,c),c.append(a),s.append(c)}}if(n.description)if(r)r.querySelector("[data-description]").append(n.description);else{var u=(0,l.htmlToElement)("
");u.textContent=n.description,this.descriptionClasses&&(0,l.classToClassList)(this.descriptionClasses,u),s.append(u)}}r&&r.querySelector("[data-icon]")&&!n&&!(null==n?void 0:n.icon)&&r.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&s.classList.add("selected"),s.addEventListener("click",(function(){return i.onSelectOption(e)})),this.optionClasses&&(0,l.classToClassList)(this.optionClasses,s),this.dropdown&&this.dropdown.append(s)},e.prototype.destroyOption=function(t){var e=this.dropdown.querySelector('[data-value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.buildOriginalOption=function(t,e,n){var o=(0,l.htmlToElement)("");o.setAttribute("value",e),o.setAttribute("data-hs-select-option",JSON.stringify(n)),o.innerText=t,this.el.append(o)},e.prototype.destroyOriginalOption=function(t){var e=this.el.querySelector('[value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.onSelectOption=function(t){this.clearSelections(),this.isMultiple?(this.value=this.value.includes(t)?Array.from(this.value).filter((function(e){return e!==t})):s(s([],Array.from(this.value),!0),[t],!1),this.selectMultipleItems(),this.setNewValue()):(this.value=t,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),(0,l.dispatch)("change.hs.select",this.el,this.value),"tags"===this.mode&&this.resetTagsInputField(),this.isMultiple||(this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.close()),this.value.length||"tags"!==this.mode||(this.tagsInput.placeholder=this.placeholder)},e.prototype.addSelectOption=function(t,e,n){this.selectOptions=s(s([],this.selectOptions,!0),[{title:t,val:e,options:n}],!1)},e.prototype.removeSelectOption=function(t){if(!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t}))},e.prototype.resetTagsInputField=function(){this.tagsInput.value="",this.tagsInput.placeholder="",this.searchOptions("")},e.prototype.clearSelections=function(){Array.from(this.dropdown.children).forEach((function(t){t.classList.contains("selected")&&t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){t.selected&&(t.selected=!1)}))},e.prototype.setNewValue=function(){"tags"===this.mode?this.setTagsItems():this.value.length?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.stringFromValue=function(){var t=this,e=[];return this.selectOptions.forEach((function(n){t.isMultiple?t.value.includes(n.val)&&e.push(n.title):t.value===n.val&&e.push(n.title)})),this.toggleCountText&&""!==this.toggleCountText&&e.length>=this.toggleCountTextMinItems?"".concat(e.length," ").concat(this.toggleCountText):e.join(", ")},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0,Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")})).classList.add("selected")},e.prototype.selectMultipleItems=function(){var t=this;Array.from(this.dropdown.children).filter((function(e){return t.value.includes(e.getAttribute("data-value"))})).forEach((function(t){return t.classList.add("selected")})),Array.from(this.el.children).filter((function(e){return t.value.includes(e.value)})).forEach((function(t){return t.selected=!0}))},e.prototype.unselectMultipleItems=function(){Array.from(this.dropdown.children).forEach((function(t){return t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){return t.selected=!1}))},e.prototype.searchOptions=function(t){this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,l.htmlToElement)(""),this.searchNoResult.innerText=this.searchNoResultText,(0,l.classToClassList)(this.searchNoResultClasses,this.searchNoResult);var e=this.dropdown.querySelectorAll("[data-value]"),n=!1;e.forEach((function(e){e.getAttribute("data-title-value").toLowerCase().includes(t.toLowerCase())?(e.classList.remove("hidden"),n=!0):e.classList.add("hidden")})),n||this.dropdown.append(this.searchNoResult)},e.prototype.eraseToggleIcon=function(){var t=this.toggle.querySelector("[data-icon]");t&&(t.innerHTML=null,t.classList.add("hidden"))},e.prototype.eraseToggleTitle=function(){var t=this.toggle.querySelector("[data-title]");t?t.innerHTML=this.placeholder:this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.destroy=function(){var t=this.el.parentElement.parentElement;this.el.classList.remove("hidden"),this.el.style.display="",t.prepend(this.el),t.querySelector(".hs-select").remove(),this.wrapper=null},e.prototype.open=function(){var t=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){t.wrapper.classList.add("active"),t.dropdown.classList.add("opened"),t.hasSearch&&t.search.focus(),t.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,n,o=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,l.afterTransition)(this.dropdown,(function(){o.dropdown.classList.add("hidden"),o.hasSearch&&(o.search.value="",o.search.dispatchEvent(new Event("input",{bubbles:!0})),o.search.blur()),o.animationInProcess=!1})),null===(n=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===n||n.classList.remove("hs-select-option-highlighted"),this.isOpened=!1},e.prototype.addOption=function(t){var e=this,n="".concat(this.selectOptions.length),o=function(t){var o=t.title,i=t.val,r=t.options;!!e.selectOptions.some((function(t){return t.val===i}))||(e.addSelectOption(o,i,r),e.buildOption(o,i,r,n),e.buildOriginalOption(o,i,r))};Array.isArray(t)?t.forEach((function(t){o(t)})):o(t)},e.prototype.removeOption=function(t){var e=this,n=function(t){!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t),e.destroyOption(t),e.destroyOriginalOption(t),e.value===t&&(e.value=null,e.eraseToggleTitle(),e.eraseToggleIcon()))};Array.isArray(t)?t.forEach((function(t){n(t)})):n(t)},e.prototype.recalculateDirection=function(){var t,e,n,o;(0,l.isEnoughSpace)(this.dropdown,this.toggle||this.tagsInput,"bottom",this.dropdownSpace,this.viewport)?(this.dropdown.classList.remove("bottom-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="",this.dropdown.classList.add("top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.add(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="".concat(this.dropdownSpace,"px")):(this.dropdown.classList.remove("top-full"),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.classList.add("bottom-full"),(null===(o=this.dropdownDirectionClasses)||void 0===o?void 0:o.bottom)&&this.dropdown.classList.add(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="".concat(this.dropdownSpace,"px"))},e.getInstance=function(t,e){var n=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsSelectCollection||(window.$hsSelectCollection=[]),document.querySelectorAll("[data-hs-select]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsSelectCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-select"),o=n?JSON.parse(n):{};new e(t,o)}})),window.$hsSelectCollection&&(window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.close=function(t){var e=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.isOpened&&e.element.close()},e.closeCurrentlyOpened=function(t){if(void 0===t&&(t=null),!t.closest(".hs-select.active")){var e=window.$hsSelectCollection.filter((function(t){return t.element.isOpened}))||null;e&&e.forEach((function(t){t.element.close()}))}},e.accessibility=function(t){var e=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));if(e&&c.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(console.log(e),console.log("Key code:",t.code),t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Tab":t.preventDefault(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}},e.onEscape=function(){var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.close()},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));if(e){var n=e.element.dropdown;if(!n)return!1;var o=(t?Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var r=o.findIndex((function(t){return t===i}));r+1 *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var r=o.findIndex((function(t){return t===i}));if(!(r+1 *:not(.hidden)")):Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");o.length&&(o[0].focus(),i&&i.classList.remove("hs-select-option-highlighted"),o[0].classList.add("hs-select-option-highlighted"))}},e.onEnter=function(t){var e=t.target.previousSibling;if(window.$hsSelectCollection.find((function(t){return t.element.el===e}))){var n=window.$hsSelectCollection.find((function(t){return t.element.isOpened})),o=window.$hsSelectCollection.find((function(t){return t.element.el===e}));n.element.close(),o.element.open()}else{(o=window.$hsSelectCollection.find((function(t){return t.element.isOpened})))&&o.element.onSelectOption(t.target.dataset.value||"")}},e}(a.default);window.addEventListener("load",(function(){u.autoInit()})),document.addEventListener("scroll",(function(){if(!window.$hsSelectCollection)return!1;var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSSelect=u),e.default=u},957:function(t,e,n){ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n"),e=this.toggle.querySelector("[data-icon]"),n=this.toggle.querySelector("[data-title]"),!this.isMultiple&&e&&this.setToggleIcon(),!this.isMultiple&&n&&this.setToggleTitle(),this.isMultiple?this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder:this.toggleTextWrapper.innerHTML=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder,n||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,l.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),this.toggle.addEventListener("click",(function(){if(o.isDisabled)return!1;o.isOpened?o.close():o.open()}))},e.prototype.setToggleIcon=function(){var t,e,n=this.toggle.querySelector("[data-icon]");if(n.innerHTML="",n){var o=(0,l.htmlToElement)((null===(e=null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.options)||void 0===e?void 0:e.icon)||"");n.append(o),o?n.classList.remove("hidden"):n.classList.add("hidden")}},e.prototype.setToggleTitle=function(){var t,e=this.toggle.querySelector("[data-title]");if(e.classList.add("truncate"),e.innerHTML="",e){var n=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder;e.innerHTML=n,this.toggle.append(e)}},e.prototype.buildTags=function(){this.buildTagsInput(),this.setTagsItems()},e.prototype.reassignTagsInputPlaceholder=function(t){this.tagsInput.placeholder=t,this.tagsInputHelper.innerHTML=t,this.calculateInputWidth()},e.prototype.buildTagsItem=function(t){var e,n,o,i,r,s,a,c=this,u=this.getItemByValue(t),d=document.createElement("div");if(d.setAttribute("data-tag-value",t),this.tagsItemClasses&&(0,l.classToClassList)(this.tagsItemClasses,d),this.tagsItemTemplate&&(i=(0,l.htmlToElement)(this.tagsItemTemplate),d.append(i)),null===(e=null==u?void 0:u.options)||void 0===e?void 0:e.icon){var p=(0,l.htmlToElement)(null===(n=null==u?void 0:u.options)||void 0===n?void 0:n.icon);(a=i?i.querySelector("[data-icon]"):document.createElement("span")).append(p),i||d.append(a)}i&&i.querySelector("[data-icon]")&&!(null===(o=null==u?void 0:u.options)||void 0===o?void 0:o.icon)&&i.querySelector("[data-icon]").classList.add("hidden"),(r=i?i.querySelector("[data-title]"):document.createElement("span")).textContent=u.title||"",i||d.append(r),i?s=i.querySelector("[data-remove]"):((s=document.createElement("span")).textContent="X",d.append(s)),s.addEventListener("click",(function(){c.value=c.value.filter((function(e){return e!==t})),c.selectedItems=c.selectedItems.filter((function(e){return e!==t})),c.value.length||c.reassignTagsInputPlaceholder(c.placeholder),c.unselectMultipleItems(),c.selectMultipleItems(),d.remove()})),this.wrapper.append(d)},e.prototype.getItemByValue=function(t){return this.selectOptions.find((function(e){return e.val===t}))},e.prototype.setTagsItems=function(){var t=this;this.value&&this.value.forEach((function(e){t.selectedItems.includes(e)||t.buildTagsItem(e),t.selectedItems=t.selectedItems.includes(e)?t.selectedItems:s(s([],t.selectedItems,!0),[e],!1)}))},e.prototype.buildTagsInput=function(){var t=this;this.tagsInput=document.createElement("input"),this.tagsInputClasses&&(0,l.classToClassList)(this.tagsInputClasses,this.tagsInput),this.tagsInput.addEventListener("focus",(function(){return t.open()})),this.tagsInput.addEventListener("input",(function(){return t.calculateInputWidth()})),this.tagsInput.addEventListener("input",(0,l.debounce)((function(e){return t.searchOptions(e.target.value)}))),this.tagsInput.addEventListener("keydown",(function(e){if("Enter"===e.key&&t.isAddTagOnEnter){var n=e.target.value;if(t.selectOptions.find((function(t){return t.val===n})))return!1;t.addSelectOption(n,n),t.buildOption(n,n),t.dropdown.querySelector('[data-value="'.concat(n,'"]')).click(),t.resetTagsInputField()}})),this.wrapper.append(this.tagsInput),setTimeout((function(){t.adjustInputWidth(),t.reassignTagsInputPlaceholder(t.value.length?"":t.placeholder)}))},e.prototype.buildDropdown=function(){var t=this;this.dropdown=(0,l.htmlToElement)(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),this.dropdown.classList.add("absolute","top-full"),this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,l.classToClassList)(this.dropdownClasses,this.dropdown),this.wrapper&&this.wrapper.append(this.dropdown),this.dropdown&&this.hasSearch&&this.buildSearch(),this.selectOptions&&this.selectOptions.forEach((function(e,n){return t.buildOption(e.title,e.val,e.options,"".concat(n))}))},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,l.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,l.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]"),this.search=(0,l.htmlToElement)(''),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,l.classToClassList)(this.searchClasses,this.search),this.search.addEventListener("input",(0,l.debounce)((function(t){return e.searchOptions(t.target.value)}))),t?t.append(this.search):this.searchWrapper.append(this.search),this.dropdown.append(this.searchWrapper)},e.prototype.buildOption=function(t,e,n,o){var i=this;void 0===o&&(o="1");var r=null,s=(0,l.htmlToElement)(this.optionTag||"
");if(s.setAttribute("data-value",e),s.setAttribute("data-title-value",t),s.setAttribute("tabIndex",o),s.classList.add("cursor-pointer"),this.optionTemplate&&(r=(0,l.htmlToElement)(this.optionTemplate),s.append(r)),r?r.querySelector("[data-title]").textContent=t||"":s.textContent=t||"",n){if(n.icon){var a=(0,l.htmlToElement)(n.icon);if(a.classList.add("mw-full"),r)r.querySelector("[data-icon]").append(a);else{var c=(0,l.htmlToElement)("
");this.iconClasses&&(0,l.classToClassList)(this.iconClasses,c),c.append(a),s.append(c)}}if(n.description)if(r)r.querySelector("[data-description]").append(n.description);else{var u=(0,l.htmlToElement)("
");u.textContent=n.description,this.descriptionClasses&&(0,l.classToClassList)(this.descriptionClasses,u),s.append(u)}}r&&r.querySelector("[data-icon]")&&!n&&!(null==n?void 0:n.icon)&&r.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&s.classList.add("selected"),s.addEventListener("click",(function(){return i.onSelectOption(e)})),this.optionClasses&&(0,l.classToClassList)(this.optionClasses,s),this.dropdown&&this.dropdown.append(s)},e.prototype.destroyOption=function(t){var e=this.dropdown.querySelector('[data-value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.buildOriginalOption=function(t,e,n){var o=(0,l.htmlToElement)("");o.setAttribute("value",e),o.setAttribute("data-hs-select-option",JSON.stringify(n)),o.innerText=t,this.el.append(o)},e.prototype.destroyOriginalOption=function(t){var e=this.el.querySelector('[value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.buildTagsInputHelper=function(){this.tagsInputHelper=document.createElement("span"),this.tagsInputHelper.style.fontSize=window.getComputedStyle(this.tagsInput).fontSize,this.tagsInputHelper.style.fontFamily=window.getComputedStyle(this.tagsInput).fontFamily,this.tagsInputHelper.style.fontWeight=window.getComputedStyle(this.tagsInput).fontWeight,this.tagsInputHelper.style.letterSpacing=window.getComputedStyle(this.tagsInput).letterSpacing,this.tagsInputHelper.style.visibility="hidden",this.tagsInputHelper.style.whiteSpace="pre",this.tagsInputHelper.style.position="absolute",this.wrapper.appendChild(this.tagsInputHelper)},e.prototype.calculateInputWidth=function(){this.tagsInputHelper.textContent=this.tagsInput.value||this.tagsInput.placeholder;var t=parseInt(window.getComputedStyle(this.tagsInput).paddingLeft)+parseInt(window.getComputedStyle(this.tagsInput).paddingRight),e=parseInt(window.getComputedStyle(this.tagsInput).borderLeftWidth)+parseInt(window.getComputedStyle(this.tagsInput).borderRightWidth),n=this.tagsInputHelper.offsetWidth+t+e,o=this.wrapper.offsetWidth-(parseInt(window.getComputedStyle(this.wrapper).paddingLeft)+parseInt(window.getComputedStyle(this.wrapper).paddingRight));this.tagsInput.style.width="".concat(Math.min(n,o)+2,"px")},e.prototype.adjustInputWidth=function(){this.buildTagsInputHelper(),this.calculateInputWidth()},e.prototype.onSelectOption=function(t){var e=this;if(this.clearSelections(),this.isMultiple?(this.value=this.value.includes(t)?Array.from(this.value).filter((function(e){return e!==t})):s(s([],Array.from(this.value),!0),[t],!1),this.selectMultipleItems(),this.setNewValue()):(this.value=t,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),(0,l.dispatch)("change.hs.select",this.el,this.value),"tags"===this.mode){var n=this.selectedItems.filter((function(t){return!e.value.includes(t)}));n.length&&n.forEach((function(t){e.selectedItems=e.selectedItems.filter((function(e){return e!==t})),e.wrapper.querySelector('[data-tag-value="'.concat(t,'"]')).remove()})),this.resetTagsInputField()}this.isMultiple||(this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.close()),this.value.length||"tags"!==this.mode||this.reassignTagsInputPlaceholder(this.placeholder),this.isOpened&&"tags"===this.mode&&this.tagsInput&&this.tagsInput.focus()},e.prototype.addSelectOption=function(t,e,n){this.selectOptions=s(s([],this.selectOptions,!0),[{title:t,val:e,options:n}],!1)},e.prototype.removeSelectOption=function(t){if(!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t}))},e.prototype.resetTagsInputField=function(){this.tagsInput.value="",this.reassignTagsInputPlaceholder(""),this.searchOptions("")},e.prototype.clearSelections=function(){Array.from(this.dropdown.children).forEach((function(t){t.classList.contains("selected")&&t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){t.selected&&(t.selected=!1)}))},e.prototype.setNewValue=function(){"tags"===this.mode?this.setTagsItems():this.value.length?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.stringFromValue=function(){var t=this,e=[];return this.selectOptions.forEach((function(n){t.isMultiple?t.value.includes(n.val)&&e.push(n.title):t.value===n.val&&e.push(n.title)})),this.toggleCountText&&""!==this.toggleCountText&&e.length>=this.toggleCountTextMinItems?"".concat(e.length," ").concat(this.toggleCountText):e.join(", ")},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0,Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")})).classList.add("selected")},e.prototype.selectMultipleItems=function(){var t=this;Array.from(this.dropdown.children).filter((function(e){return t.value.includes(e.getAttribute("data-value"))})).forEach((function(t){return t.classList.add("selected")})),Array.from(this.el.children).filter((function(e){return t.value.includes(e.value)})).forEach((function(t){return t.selected=!0}))},e.prototype.unselectMultipleItems=function(){Array.from(this.dropdown.children).forEach((function(t){return t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){return t.selected=!1}))},e.prototype.searchOptions=function(t){this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,l.htmlToElement)(""),this.searchNoResult.innerText=this.searchNoResultText,(0,l.classToClassList)(this.searchNoResultClasses,this.searchNoResult);var e=this.dropdown.querySelectorAll("[data-value]"),n=!1;e.forEach((function(e){e.getAttribute("data-title-value").toLocaleLowerCase().includes(t.toLocaleLowerCase())?(e.classList.remove("hidden"),n=!0):e.classList.add("hidden")})),n||this.dropdown.append(this.searchNoResult)},e.prototype.eraseToggleIcon=function(){var t=this.toggle.querySelector("[data-icon]");t&&(t.innerHTML=null,t.classList.add("hidden"))},e.prototype.eraseToggleTitle=function(){var t=this.toggle.querySelector("[data-title]");t?t.innerHTML=this.placeholder:this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.destroy=function(){var t=this.el.parentElement.parentElement;this.el.classList.remove("hidden"),this.el.style.display="",t.prepend(this.el),t.querySelector(".hs-select").remove(),this.wrapper=null},e.prototype.open=function(){var t=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){t.wrapper.classList.add("active"),t.dropdown.classList.add("opened"),t.hasSearch&&!t.preventSearchFocus&&t.search.focus(),t.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,n,o=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,l.afterTransition)(this.dropdown,(function(){o.dropdown.classList.add("hidden"),o.hasSearch&&(o.search.value="",o.search.dispatchEvent(new Event("input",{bubbles:!0})),o.search.blur()),o.animationInProcess=!1})),null===(n=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===n||n.classList.remove("hs-select-option-highlighted"),this.isOpened=!1},e.prototype.addOption=function(t){var e=this,n="".concat(this.selectOptions.length),o=function(t){var o=t.title,i=t.val,r=t.options;!!e.selectOptions.some((function(t){return t.val===i}))||(e.addSelectOption(o,i,r),e.buildOption(o,i,r,n),e.buildOriginalOption(o,i,r))};Array.isArray(t)?t.forEach((function(t){o(t)})):o(t)},e.prototype.removeOption=function(t){var e=this,n=function(t){!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t),e.destroyOption(t),e.destroyOriginalOption(t),e.value===t&&(e.value=null,e.eraseToggleTitle(),e.eraseToggleIcon()))};Array.isArray(t)?t.forEach((function(t){n(t)})):n(t)},e.prototype.recalculateDirection=function(){var t,e,n,o;(0,l.isEnoughSpace)(this.dropdown,this.toggle||this.tagsInput,"bottom",this.dropdownSpace,this.viewport)?(this.dropdown.classList.remove("bottom-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="",this.dropdown.classList.add("top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.add(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="".concat(this.dropdownSpace,"px")):(this.dropdown.classList.remove("top-full"),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.classList.add("bottom-full"),(null===(o=this.dropdownDirectionClasses)||void 0===o?void 0:o.bottom)&&this.dropdown.classList.add(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="".concat(this.dropdownSpace,"px"))},e.getInstance=function(t,e){var n=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsSelectCollection||(window.$hsSelectCollection=[]),document.querySelectorAll("[data-hs-select]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsSelectCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-select"),o=n?JSON.parse(n):{};new e(t,o)}})),window.$hsSelectCollection&&(window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.close=function(t){var e=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.isOpened&&e.element.close()},e.closeCurrentlyOpened=function(t){if(void 0===t&&(t=null),!t.closest(".hs-select.active")){var e=window.$hsSelectCollection.filter((function(t){return t.element.isOpened}))||null;e&&e.forEach((function(t){t.element.close()}))}},e.accessibility=function(t){if(window.$hsSelectCollection.find((function(t){return t.element.isOpened}))&&c.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Tab":t.preventDefault(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}},e.onEscape=function(){var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.close()},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));if(e){var n=e.element.dropdown;if(!n)return!1;var o=(t?Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var r=o.findIndex((function(t){return t===i}));r+1 *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var r=o.findIndex((function(t){return t===i}));if(!(r+1 *:not(.hidden)")):Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");o.length&&(o[0].focus(),i&&i.classList.remove("hs-select-option-highlighted"),o[0].classList.add("hs-select-option-highlighted"))}},e.onEnter=function(t){var e=t.target.previousSibling;if(window.$hsSelectCollection.find((function(t){return t.element.el===e}))){var n=window.$hsSelectCollection.find((function(t){return t.element.isOpened})),o=window.$hsSelectCollection.find((function(t){return t.element.el===e}));n.element.close(),o.element.open()}else{(o=window.$hsSelectCollection.find((function(t){return t.element.isOpened})))&&o.element.onSelectOption(t.target.dataset.value||"")}},e}(a.default);window.addEventListener("load",(function(){u.autoInit()})),document.addEventListener("scroll",(function(){if(!window.$hsSelectCollection)return!1;var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSSelect=u),e.default=u},957:function(t,e,n){ /* * HSStepper - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;nt.totalSteps&&(t.totalSteps=n)}))},e.prototype.buildNav=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-nav-item]").forEach((function(e){return t.addNavItem(e)})),this.navItems.forEach((function(e){return t.buildNavItem(e)}))},e.prototype.buildNavItem=function(t){var e=this,n=t.index,o=t.isDisabled,i=t.el;n===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||o)&&i.addEventListener("click",(function(){return e.handleNavItemClick(t)}))},e.prototype.addNavItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-nav-item")),n=e.index,o=e.isFinal,i=void 0!==o&&o,r=e.isCompleted,s=void 0!==r&&r,l=e.isSkip,a=void 0!==l&&l,c=e.isOptional,u=void 0!==c&&c,d=e.isDisabled,p=void 0!==d&&d,h=e.isProcessed,f=void 0!==h&&h,v=e.hasError,m=void 0!==v&&v;s&&t.classList.add("success"),a&&t.classList.add("skipped"),p&&("BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")),m&&t.classList.add("error"),this.navItems.push({index:n,isFinal:i,isCompleted:s,isSkip:a,isOptional:u,isDisabled:p,isProcessed:f,hasError:m,el:t})},e.prototype.setCurrentNavItem=function(){var t=this;this.navItems.forEach((function(e){var n=e.index,o=e.el;n===t.currentIndex?t.setCurrentNavItemActions(o):t.unsetCurrentNavItemActions(o)}))},e.prototype.setCurrentNavItemActions=function(t){t.classList.add("active"),this.fireEvent("active",this.currentIndex),(0,s.dispatch)("active.hs.stepper",this.el,this.currentIndex)},e.prototype.getNavItem=function(t){return void 0===t&&(t=this.currentIndex),this.navItems.find((function(e){return e.index===t}))},e.prototype.setProcessedNavItemActions=function(t){t.isProcessed=!0,t.el.classList.add("processed")},e.prototype.setErrorNavItemActions=function(t){t.hasError=!0,t.el.classList.add("error")},e.prototype.unsetCurrentNavItemActions=function(t){t.classList.remove("active")},e.prototype.handleNavItemClick=function(t){var e=t.index;this.currentIndex=e,this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep()},e.prototype.buildContent=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-content-item]").forEach((function(e){return t.addContentItem(e)})),this.navItems.forEach((function(e){return t.buildContentItem(e)}))},e.prototype.buildContentItem=function(t){t.index===this.currentIndex&&this.setCurrentContentItem()},e.prototype.addContentItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-content-item")),n=e.index,o=e.isFinal,i=void 0!==o&&o,r=e.isCompleted,s=void 0!==r&&r,l=e.isSkip,a=void 0!==l&&l;s&&t.classList.add("success"),a&&t.classList.add("skipped"),this.contentItems.push({index:n,isFinal:i,isCompleted:s,isSkip:a,el:t})},e.prototype.setCurrentContentItem=function(){var t=this;if(this.isCompleted){var e=this.contentItems.find((function(t){return t.isFinal})),n=this.contentItems.filter((function(t){return!t.isFinal}));return e.el.style.display="",n.forEach((function(t){return t.el.style.display="none"})),!1}this.contentItems.forEach((function(e){var n=e.index,o=e.el;n===t.currentIndex?t.setCurrentContentItemActions(o):t.unsetCurrentContentItemActions(o)}))},e.prototype.hideAllContentItems=function(){this.contentItems.forEach((function(t){return t.el.style.display="none"}))},e.prototype.setCurrentContentItemActions=function(t){t.style.display=""},e.prototype.unsetCurrentContentItemActions=function(t){t.style.display="none"},e.prototype.disableAll=function(){var t=this.getNavItem(this.currentIndex);t.hasError=!1,t.isCompleted=!1,t.isDisabled=!1,t.el.classList.remove("error","success"),this.disableButtons()},e.prototype.disableNavItemActions=function(t){t.isDisabled=!0,t.el.classList.add("disabled")},e.prototype.enableNavItemActions=function(t){t.isDisabled=!1,t.el.classList.remove("disabled")},e.prototype.buildButtons=function(){this.backBtn=this.el.querySelector("[data-hs-stepper-back-btn]"),this.nextBtn=this.el.querySelector("[data-hs-stepper-next-btn]"),this.skipBtn=this.el.querySelector("[data-hs-stepper-skip-btn]"),this.completeStepBtn=this.el.querySelector("[data-hs-stepper-complete-step-btn]"),this.finishBtn=this.el.querySelector("[data-hs-stepper-finish-btn]"),this.resetBtn=this.el.querySelector("[data-hs-stepper-reset-btn]"),this.buildBackButton(),this.buildNextButton(),this.buildSkipButton(),this.buildCompleteStepButton(),this.buildFinishButton(),this.buildResetButton()},e.prototype.buildBackButton=function(){var t=this;this.backBtn&&(this.checkForTheFirstStep(),this.backBtn.addEventListener("click",(function(){if(t.handleBackButtonClick(),"linear"===t.mode){var e=t.navItems.find((function(e){return e.index===t.currentIndex})),n=t.contentItems.find((function(e){return e.index===t.currentIndex}));if(!e||!n)return;e.isCompleted&&(e.isCompleted=!1,e.isSkip=!1,e.el.classList.remove("success","skipped")),n.isCompleted&&(n.isCompleted=!1,n.isSkip=!1,n.el.classList.remove("success","skipped")),"linear"===t.mode&&t.currentIndex!==t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display=""),t.completeStepBtn&&(t.completeStepBtn.style.display="")),t.showSkipButton(),t.showFinishButton(),t.showCompleteStepButton()}})))},e.prototype.handleBackButtonClick=function(){1!==this.currentIndex&&("linear"===this.mode&&this.removeOptionalClasses(),this.currentIndex--,"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.fireEvent("back",this.currentIndex),(0,s.dispatch)("back.hs.stepper",this.el,this.currentIndex))},e.prototype.checkForTheFirstStep=function(){1===this.currentIndex?this.setToDisabled(this.backBtn):this.setToNonDisabled(this.backBtn)},e.prototype.setToDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")},e.prototype.setToNonDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled"),t.classList.remove("disabled")},e.prototype.buildNextButton=function(){var t=this;this.nextBtn&&this.nextBtn.addEventListener("click",(function(){var e;if(t.fireEvent("beforeNext",t.currentIndex),(0,s.dispatch)("beforeNext.hs.stepper",t.el,t.currentIndex),null===(e=t.getNavItem(t.currentIndex))||void 0===e?void 0:e.isProcessed)return t.disableAll(),!1;t.goToNext()}))},e.prototype.unsetProcessedNavItemActions=function(t){t.isProcessed=!1,t.el.classList.remove("processed")},e.prototype.handleNextButtonClick=function(t){if(void 0===t&&(t=!0),t)this.currentIndex===this.totalSteps?this.currentIndex=1:this.currentIndex++;else{var e=this.getUncompletedSteps();if(1===e.length){var n=e[0].index;this.currentIndex=n}else{if(this.currentIndex===this.totalSteps)return;this.currentIndex++}}"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton(),this.showFinishButton(),this.showCompleteStepButton(),this.fireEvent("next",this.currentIndex),(0,s.dispatch)("next.hs.stepper",this.el,this.currentIndex)},e.prototype.removeOptionalClasses=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=this.contentItems.find((function(e){return e.index===t.currentIndex}));e.isSkip=!1,e.hasError=!1,e.isDisabled=!1,n.isSkip=!1,e.el.classList.remove("skipped","success","error"),n.el.classList.remove("skipped","success","error")},e.prototype.buildSkipButton=function(){var t=this;this.skipBtn&&(this.showSkipButton(),this.skipBtn.addEventListener("click",(function(){t.handleSkipButtonClick(),"linear"===t.mode&&t.currentIndex===t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display="none"),t.completeStepBtn&&(t.completeStepBtn.style.display="none"),t.finishBtn&&(t.finishBtn.style.display=""))})))},e.prototype.setSkipItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),o=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&o&&(this.setSkipItemActions(n),this.setSkipItemActions(o))},e.prototype.setSkipItemActions=function(t){t.isSkip=!0,t.el.classList.add("skipped")},e.prototype.showSkipButton=function(){var t=this;if(this.skipBtn){var e=this.navItems.find((function(e){return e.index===t.currentIndex})).isOptional;this.skipBtn.style.display=e?"":"none"}},e.prototype.handleSkipButtonClick=function(){this.setSkipItem(),this.handleNextButtonClick(),this.fireEvent("skip",this.currentIndex),(0,s.dispatch)("skip.hs.stepper",this.el,this.currentIndex)},e.prototype.buildCompleteStepButton=function(){var t=this;this.completeStepBtn&&(this.completeStepBtnDefaultText=this.completeStepBtn.innerText,this.completeStepBtn.addEventListener("click",(function(){return t.handleCompleteStepButtonClick()})))},e.prototype.changeTextAndDisableCompleteButtonIfStepCompleted=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=JSON.parse(this.completeStepBtn.getAttribute("data-hs-stepper-complete-step-btn")).completedText;e&&(e.isCompleted?(this.completeStepBtn.innerText=n||this.completeStepBtnDefaultText,this.completeStepBtn.setAttribute("disabled","disabled"),this.completeStepBtn.classList.add("disabled")):(this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")))},e.prototype.setCompleteItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),o=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&o&&(this.setCompleteItemActions(n),this.setCompleteItemActions(o))},e.prototype.setCompleteItemActions=function(t){t.isCompleted=!0,t.el.classList.add("success")},e.prototype.showCompleteStepButton=function(){this.completeStepBtn&&(1===this.getUncompletedSteps().length?this.completeStepBtn.style.display="none":this.completeStepBtn.style.display="")},e.prototype.handleCompleteStepButtonClick=function(){this.setCompleteItem(),this.fireEvent("complete",this.currentIndex),(0,s.dispatch)("complete.hs.stepper",this.el,this.currentIndex),this.handleNextButtonClick(!1),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton()},e.prototype.buildFinishButton=function(){var t=this;this.finishBtn&&(this.isCompleted&&this.setCompleted(),this.finishBtn.addEventListener("click",(function(){return t.handleFinishButtonClick()})))},e.prototype.setCompleted=function(){this.el.classList.add("completed")},e.prototype.unsetCompleted=function(){this.el.classList.remove("completed")},e.prototype.showFinishButton=function(){this.finishBtn&&(1===this.getUncompletedSteps().length?this.finishBtn.style.display="":this.finishBtn.style.display="none")},e.prototype.handleFinishButtonClick=function(){var t=this,e=this.getUncompletedSteps(),n=this.getUncompletedSteps(!0),o=this.contentItems.find((function(t){return t.isFinal})).el;e.length&&e.forEach((function(e){var n=e.index;return t.setCompleteItem(n)})),this.currentIndex=this.totalSteps,this.setCurrentNavItem(),this.hideAllContentItems();var i=this.navItems.find((function(e){return e.index===t.currentIndex}));(i?i.el:null).classList.remove("active"),o.style.display="block",this.backBtn&&(this.backBtn.style.display="none"),this.nextBtn&&(this.nextBtn.style.display="none"),this.skipBtn&&(this.skipBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"),this.finishBtn&&(this.finishBtn.style.display="none"),this.resetBtn&&(this.resetBtn.style.display=""),n.length<=1&&(this.isCompleted=!0,this.setCompleted()),this.fireEvent("finish",this.currentIndex),(0,s.dispatch)("finish.hs.stepper",this.el,this.currentIndex)},e.prototype.buildResetButton=function(){var t=this;this.resetBtn&&this.resetBtn.addEventListener("click",(function(){return t.handleResetButtonClick()}))},e.prototype.handleResetButtonClick=function(){var t=this;this.backBtn&&(this.backBtn.style.display=""),this.nextBtn&&(this.nextBtn.style.display=""),this.completeStepBtn&&(this.completeStepBtn.style.display="",this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")),this.resetBtn&&(this.resetBtn.style.display="none"),this.navItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentNavItemActions(n),n.classList.remove("success","skipped")})),this.contentItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentContentItemActions(n),n.classList.remove("success","skipped")})),this.currentIndex=1,this.setCurrentNavItem(),this.setCurrentContentItem(),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.unsetCompleted(),this.isCompleted=!1,this.fireEvent("reset",this.currentIndex),(0,s.dispatch)("reset.hs.stepper",this.el,this.currentIndex)},e.prototype.setProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.setProcessedNavItemActions(e)},e.prototype.unsetProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.unsetProcessedNavItemActions(e)},e.prototype.goToNext=function(){"linear"===this.mode&&this.setCompleteItem(),this.handleNextButtonClick("linear"!==this.mode),"linear"===this.mode&&this.currentIndex===this.totalSteps&&(this.nextBtn&&(this.nextBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"))},e.prototype.disableButtons=function(){this.backBtn&&this.setToDisabled(this.backBtn),this.nextBtn&&this.setToDisabled(this.nextBtn)},e.prototype.enableButtons=function(){this.backBtn&&this.setToNonDisabled(this.backBtn),this.nextBtn&&this.setToNonDisabled(this.nextBtn)},e.prototype.setErrorNavItem=function(t){var e=this.getNavItem(t);e&&this.setErrorNavItemActions(e)},e.getInstance=function(t,e){var n=window.$hsStepperCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsStepperCollection||(window.$hsStepperCollection=[]),document.querySelectorAll("[data-hs-stepper]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsStepperCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=l),e.default=l},983:function(t,e,n){ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;nt.totalSteps&&(t.totalSteps=n)}))},e.prototype.buildNav=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-nav-item]").forEach((function(e){return t.addNavItem(e)})),this.navItems.forEach((function(e){return t.buildNavItem(e)}))},e.prototype.buildNavItem=function(t){var e=this,n=t.index,o=t.isDisabled,i=t.el;n===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||o)&&i.addEventListener("click",(function(){return e.handleNavItemClick(t)}))},e.prototype.addNavItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-nav-item")),n=e.index,o=e.isFinal,i=void 0!==o&&o,r=e.isCompleted,s=void 0!==r&&r,l=e.isSkip,a=void 0!==l&&l,c=e.isOptional,u=void 0!==c&&c,d=e.isDisabled,p=void 0!==d&&d,h=e.isProcessed,f=void 0!==h&&h,m=e.hasError,v=void 0!==m&&m;s&&t.classList.add("success"),a&&t.classList.add("skipped"),p&&("BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")),v&&t.classList.add("error"),this.navItems.push({index:n,isFinal:i,isCompleted:s,isSkip:a,isOptional:u,isDisabled:p,isProcessed:f,hasError:v,el:t})},e.prototype.setCurrentNavItem=function(){var t=this;this.navItems.forEach((function(e){var n=e.index,o=e.el;n===t.currentIndex?t.setCurrentNavItemActions(o):t.unsetCurrentNavItemActions(o)}))},e.prototype.setCurrentNavItemActions=function(t){t.classList.add("active"),this.fireEvent("active",this.currentIndex),(0,s.dispatch)("active.hs.stepper",this.el,this.currentIndex)},e.prototype.getNavItem=function(t){return void 0===t&&(t=this.currentIndex),this.navItems.find((function(e){return e.index===t}))},e.prototype.setProcessedNavItemActions=function(t){t.isProcessed=!0,t.el.classList.add("processed")},e.prototype.setErrorNavItemActions=function(t){t.hasError=!0,t.el.classList.add("error")},e.prototype.unsetCurrentNavItemActions=function(t){t.classList.remove("active")},e.prototype.handleNavItemClick=function(t){var e=t.index;this.currentIndex=e,this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep()},e.prototype.buildContent=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-content-item]").forEach((function(e){return t.addContentItem(e)})),this.navItems.forEach((function(e){return t.buildContentItem(e)}))},e.prototype.buildContentItem=function(t){t.index===this.currentIndex&&this.setCurrentContentItem()},e.prototype.addContentItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-content-item")),n=e.index,o=e.isFinal,i=void 0!==o&&o,r=e.isCompleted,s=void 0!==r&&r,l=e.isSkip,a=void 0!==l&&l;s&&t.classList.add("success"),a&&t.classList.add("skipped"),this.contentItems.push({index:n,isFinal:i,isCompleted:s,isSkip:a,el:t})},e.prototype.setCurrentContentItem=function(){var t=this;if(this.isCompleted){var e=this.contentItems.find((function(t){return t.isFinal})),n=this.contentItems.filter((function(t){return!t.isFinal}));return e.el.style.display="",n.forEach((function(t){return t.el.style.display="none"})),!1}this.contentItems.forEach((function(e){var n=e.index,o=e.el;n===t.currentIndex?t.setCurrentContentItemActions(o):t.unsetCurrentContentItemActions(o)}))},e.prototype.hideAllContentItems=function(){this.contentItems.forEach((function(t){return t.el.style.display="none"}))},e.prototype.setCurrentContentItemActions=function(t){t.style.display=""},e.prototype.unsetCurrentContentItemActions=function(t){t.style.display="none"},e.prototype.disableAll=function(){var t=this.getNavItem(this.currentIndex);t.hasError=!1,t.isCompleted=!1,t.isDisabled=!1,t.el.classList.remove("error","success"),this.disableButtons()},e.prototype.disableNavItemActions=function(t){t.isDisabled=!0,t.el.classList.add("disabled")},e.prototype.enableNavItemActions=function(t){t.isDisabled=!1,t.el.classList.remove("disabled")},e.prototype.buildButtons=function(){this.backBtn=this.el.querySelector("[data-hs-stepper-back-btn]"),this.nextBtn=this.el.querySelector("[data-hs-stepper-next-btn]"),this.skipBtn=this.el.querySelector("[data-hs-stepper-skip-btn]"),this.completeStepBtn=this.el.querySelector("[data-hs-stepper-complete-step-btn]"),this.finishBtn=this.el.querySelector("[data-hs-stepper-finish-btn]"),this.resetBtn=this.el.querySelector("[data-hs-stepper-reset-btn]"),this.buildBackButton(),this.buildNextButton(),this.buildSkipButton(),this.buildCompleteStepButton(),this.buildFinishButton(),this.buildResetButton()},e.prototype.buildBackButton=function(){var t=this;this.backBtn&&(this.checkForTheFirstStep(),this.backBtn.addEventListener("click",(function(){if(t.handleBackButtonClick(),"linear"===t.mode){var e=t.navItems.find((function(e){return e.index===t.currentIndex})),n=t.contentItems.find((function(e){return e.index===t.currentIndex}));if(!e||!n)return;e.isCompleted&&(e.isCompleted=!1,e.isSkip=!1,e.el.classList.remove("success","skipped")),n.isCompleted&&(n.isCompleted=!1,n.isSkip=!1,n.el.classList.remove("success","skipped")),"linear"===t.mode&&t.currentIndex!==t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display=""),t.completeStepBtn&&(t.completeStepBtn.style.display="")),t.showSkipButton(),t.showFinishButton(),t.showCompleteStepButton()}})))},e.prototype.handleBackButtonClick=function(){1!==this.currentIndex&&("linear"===this.mode&&this.removeOptionalClasses(),this.currentIndex--,"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.fireEvent("back",this.currentIndex),(0,s.dispatch)("back.hs.stepper",this.el,this.currentIndex))},e.prototype.checkForTheFirstStep=function(){1===this.currentIndex?this.setToDisabled(this.backBtn):this.setToNonDisabled(this.backBtn)},e.prototype.setToDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")},e.prototype.setToNonDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled"),t.classList.remove("disabled")},e.prototype.buildNextButton=function(){var t=this;this.nextBtn&&this.nextBtn.addEventListener("click",(function(){var e;if(t.fireEvent("beforeNext",t.currentIndex),(0,s.dispatch)("beforeNext.hs.stepper",t.el,t.currentIndex),null===(e=t.getNavItem(t.currentIndex))||void 0===e?void 0:e.isProcessed)return t.disableAll(),!1;t.goToNext()}))},e.prototype.unsetProcessedNavItemActions=function(t){t.isProcessed=!1,t.el.classList.remove("processed")},e.prototype.handleNextButtonClick=function(t){if(void 0===t&&(t=!0),t)this.currentIndex===this.totalSteps?this.currentIndex=1:this.currentIndex++;else{var e=this.getUncompletedSteps();if(1===e.length){var n=e[0].index;this.currentIndex=n}else{if(this.currentIndex===this.totalSteps)return;this.currentIndex++}}"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton(),this.showFinishButton(),this.showCompleteStepButton(),this.fireEvent("next",this.currentIndex),(0,s.dispatch)("next.hs.stepper",this.el,this.currentIndex)},e.prototype.removeOptionalClasses=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=this.contentItems.find((function(e){return e.index===t.currentIndex}));e.isSkip=!1,e.hasError=!1,e.isDisabled=!1,n.isSkip=!1,e.el.classList.remove("skipped","success","error"),n.el.classList.remove("skipped","success","error")},e.prototype.buildSkipButton=function(){var t=this;this.skipBtn&&(this.showSkipButton(),this.skipBtn.addEventListener("click",(function(){t.handleSkipButtonClick(),"linear"===t.mode&&t.currentIndex===t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display="none"),t.completeStepBtn&&(t.completeStepBtn.style.display="none"),t.finishBtn&&(t.finishBtn.style.display=""))})))},e.prototype.setSkipItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),o=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&o&&(this.setSkipItemActions(n),this.setSkipItemActions(o))},e.prototype.setSkipItemActions=function(t){t.isSkip=!0,t.el.classList.add("skipped")},e.prototype.showSkipButton=function(){var t=this;if(this.skipBtn){var e=this.navItems.find((function(e){return e.index===t.currentIndex})).isOptional;this.skipBtn.style.display=e?"":"none"}},e.prototype.handleSkipButtonClick=function(){this.setSkipItem(),this.handleNextButtonClick(),this.fireEvent("skip",this.currentIndex),(0,s.dispatch)("skip.hs.stepper",this.el,this.currentIndex)},e.prototype.buildCompleteStepButton=function(){var t=this;this.completeStepBtn&&(this.completeStepBtnDefaultText=this.completeStepBtn.innerText,this.completeStepBtn.addEventListener("click",(function(){return t.handleCompleteStepButtonClick()})))},e.prototype.changeTextAndDisableCompleteButtonIfStepCompleted=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=JSON.parse(this.completeStepBtn.getAttribute("data-hs-stepper-complete-step-btn")).completedText;e&&(e.isCompleted?(this.completeStepBtn.innerText=n||this.completeStepBtnDefaultText,this.completeStepBtn.setAttribute("disabled","disabled"),this.completeStepBtn.classList.add("disabled")):(this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")))},e.prototype.setCompleteItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),o=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&o&&(this.setCompleteItemActions(n),this.setCompleteItemActions(o))},e.prototype.setCompleteItemActions=function(t){t.isCompleted=!0,t.el.classList.add("success")},e.prototype.showCompleteStepButton=function(){this.completeStepBtn&&(1===this.getUncompletedSteps().length?this.completeStepBtn.style.display="none":this.completeStepBtn.style.display="")},e.prototype.handleCompleteStepButtonClick=function(){this.setCompleteItem(),this.fireEvent("complete",this.currentIndex),(0,s.dispatch)("complete.hs.stepper",this.el,this.currentIndex),this.handleNextButtonClick(!1),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton()},e.prototype.buildFinishButton=function(){var t=this;this.finishBtn&&(this.isCompleted&&this.setCompleted(),this.finishBtn.addEventListener("click",(function(){return t.handleFinishButtonClick()})))},e.prototype.setCompleted=function(){this.el.classList.add("completed")},e.prototype.unsetCompleted=function(){this.el.classList.remove("completed")},e.prototype.showFinishButton=function(){this.finishBtn&&(1===this.getUncompletedSteps().length?this.finishBtn.style.display="":this.finishBtn.style.display="none")},e.prototype.handleFinishButtonClick=function(){var t=this,e=this.getUncompletedSteps(),n=this.getUncompletedSteps(!0),o=this.contentItems.find((function(t){return t.isFinal})).el;e.length&&e.forEach((function(e){var n=e.index;return t.setCompleteItem(n)})),this.currentIndex=this.totalSteps,this.setCurrentNavItem(),this.hideAllContentItems();var i=this.navItems.find((function(e){return e.index===t.currentIndex}));(i?i.el:null).classList.remove("active"),o.style.display="block",this.backBtn&&(this.backBtn.style.display="none"),this.nextBtn&&(this.nextBtn.style.display="none"),this.skipBtn&&(this.skipBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"),this.finishBtn&&(this.finishBtn.style.display="none"),this.resetBtn&&(this.resetBtn.style.display=""),n.length<=1&&(this.isCompleted=!0,this.setCompleted()),this.fireEvent("finish",this.currentIndex),(0,s.dispatch)("finish.hs.stepper",this.el,this.currentIndex)},e.prototype.buildResetButton=function(){var t=this;this.resetBtn&&this.resetBtn.addEventListener("click",(function(){return t.handleResetButtonClick()}))},e.prototype.handleResetButtonClick=function(){var t=this;this.backBtn&&(this.backBtn.style.display=""),this.nextBtn&&(this.nextBtn.style.display=""),this.completeStepBtn&&(this.completeStepBtn.style.display="",this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")),this.resetBtn&&(this.resetBtn.style.display="none"),this.navItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentNavItemActions(n),n.classList.remove("success","skipped")})),this.contentItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentContentItemActions(n),n.classList.remove("success","skipped")})),this.currentIndex=1,this.setCurrentNavItem(),this.setCurrentContentItem(),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.unsetCompleted(),this.isCompleted=!1,this.fireEvent("reset",this.currentIndex),(0,s.dispatch)("reset.hs.stepper",this.el,this.currentIndex)},e.prototype.setProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.setProcessedNavItemActions(e)},e.prototype.unsetProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.unsetProcessedNavItemActions(e)},e.prototype.goToNext=function(){"linear"===this.mode&&this.setCompleteItem(),this.handleNextButtonClick("linear"!==this.mode),"linear"===this.mode&&this.currentIndex===this.totalSteps&&(this.nextBtn&&(this.nextBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"))},e.prototype.disableButtons=function(){this.backBtn&&this.setToDisabled(this.backBtn),this.nextBtn&&this.setToDisabled(this.nextBtn)},e.prototype.enableButtons=function(){this.backBtn&&this.setToNonDisabled(this.backBtn),this.nextBtn&&this.setToNonDisabled(this.nextBtn)},e.prototype.setErrorNavItem=function(t){var e=this.getNavItem(t);e&&this.setErrorNavItemActions(e)},e.getInstance=function(t,e){var n=window.$hsStepperCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsStepperCollection||(window.$hsStepperCollection=[]),document.querySelectorAll("[data-hs-stepper]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsStepperCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=l),e.default=l},983:function(t,e,n){ /* * HSStrongPassword - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -121,15 +129,15 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n?@[\\\\\\]^_`{|}~",o.target&&o.init(),o}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsStrongPasswordCollection,this),this.availableChecks.length&&this.build()},e.prototype.build=function(){var t=this;this.buildStrips(),this.hints&&this.buildHints(),this.setStrength(this.target.value),this.target.addEventListener("input",(function(e){t.setStrength(e.target.value)}))},e.prototype.buildStrips=function(){if(this.el.innerHTML="",this.stripClasses)for(var t=0;t");(0,s.classToClassList)(this.stripClasses,e),this.el.append(e)}},e.prototype.buildHints=function(){var t=this;this.weakness=this.hints.querySelector("[data-hs-strong-password-hints-weakness-text]")||null,this.rules=Array.from(this.hints.querySelectorAll("[data-hs-strong-password-hints-rule-text]"))||null,this.rules.forEach((function(e){var n,o=e.getAttribute("data-hs-strong-password-hints-rule-text");(null===(n=t.checksExclude)||void 0===n?void 0:n.includes(o))&&e.remove()})),this.weakness&&this.buildWeakness(),this.rules&&this.buildRules(),"popover"===this.mode&&(this.target.addEventListener("focus",(function(){t.isOpened=!0,t.hints.classList.remove("hidden"),t.hints.classList.add("block"),t.recalculateDirection()})),this.target.addEventListener("blur",(function(){t.isOpened=!1,t.hints.classList.remove("block","bottom-full","top-full"),t.hints.classList.add("hidden"),t.hints.style.marginTop="",t.hints.style.marginBottom=""})))},e.prototype.buildWeakness=function(){var t=this;this.checkStrength(this.target.value),this.setWeaknessText(),this.target.addEventListener("input",(function(){return setTimeout((function(){return t.setWeaknessText()}))}))},e.prototype.buildRules=function(){var t=this;this.setRulesText(),this.target.addEventListener("input",(function(){return setTimeout((function(){return t.setRulesText()}))}))},e.prototype.setWeaknessText=function(){var t=this.weakness.getAttribute("data-hs-strong-password-hints-weakness-text"),e=JSON.parse(t);this.weakness.textContent=e[this.strength]},e.prototype.setRulesText=function(){var t=this;this.rules.forEach((function(e){var n=e.getAttribute("data-hs-strong-password-hints-rule-text");t.checkIfPassed(e,t.passedRules.has(n))}))},e.prototype.togglePopover=function(){var t=this.el.querySelector(".popover");t&&t.classList.toggle("show")},e.prototype.checkStrength=function(t){var e=new Set,n={lowercase:/[a-z]+/,uppercase:/[A-Z]+/,numbers:/[0-9]+/,"special-characters":new RegExp("[".concat(this.specialCharactersSet,"]"))},o=0;return this.availableChecks.includes("lowercase")&&t.match(n.lowercase)&&(o+=1,e.add("lowercase")),this.availableChecks.includes("uppercase")&&t.match(n.uppercase)&&(o+=1,e.add("uppercase")),this.availableChecks.includes("numbers")&&t.match(n.numbers)&&(o+=1,e.add("numbers")),this.availableChecks.includes("special-characters")&&t.match(n["special-characters"])&&(o+=1,e.add("special-characters")),this.availableChecks.includes("min-length")&&t.length>=this.minLength&&(o+=1,e.add("min-length")),t.length||(o=0),o===this.availableChecks.length?this.el.classList.add("accepted"):this.el.classList.remove("accepted"),this.strength=o,this.passedRules=e,{strength:this.strength,rules:this.passedRules}},e.prototype.checkIfPassed=function(t,e){void 0===e&&(e=!1);var n=t.querySelector("[data-check]"),o=t.querySelector("[data-uncheck]");e?(t.classList.add("active"),n.classList.remove("hidden"),o.classList.add("hidden")):(t.classList.remove("active"),n.classList.add("hidden"),o.classList.remove("hidden"))},e.prototype.setStrength=function(t){var e=this.checkStrength(t),n=e.strength,o={strength:n,rules:e.rules};this.hideStrips(n),this.fireEvent("change",o),(0,s.dispatch)("change.hs.strongPassword",this.el,o)},e.prototype.hideStrips=function(t){Array.from(this.el.children).forEach((function(e,n){n1&&!!o.el.closest("[data-hs-toggle-password-group]"),o.target&&o.init(),o}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsTogglePasswordCollection,this),this.isShown?this.show():this.hide(),this.el.addEventListener(this.eventType,(function(){t.isShown?t.hide():t.show(),t.fireEvent("toggle",t.target),(0,s.dispatch)("toggle.hs.toggle-select",t.el,t.target)}))},e.prototype.getMultipleToggles=function(){var t=this.el.closest("[data-hs-toggle-password-group]").querySelectorAll("[data-hs-toggle-password]"),n=[];return t.forEach((function(t){n.push(e.getInstance(t))})),n},e.prototype.show=function(){this.isMultiple?(this.getMultipleToggles().forEach((function(t){return!!t&&(t.isShown=!0)})),this.el.closest("[data-hs-toggle-password-group]").classList.add("active")):(this.isShown=!0,this.el.classList.add("active"));this.target.forEach((function(t){t.type="text"}))},e.prototype.hide=function(){this.isMultiple?(this.getMultipleToggles().forEach((function(t){return!!t&&(t.isShown=!1)})),this.el.closest("[data-hs-toggle-password-group]").classList.remove("active")):(this.isShown=!1,this.el.classList.remove("active"));this.target.forEach((function(t){t.type="password"}))},e.getInstance=function(t,e){var n=window.$hsTogglePasswordCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsTogglePasswordCollection||(window.$hsTogglePasswordCollection=[]),document.querySelectorAll("[data-hs-toggle-password]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsTogglePasswordCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=l),e.default=l},679:function(t,e,n){ /* * HSTooltip - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n{Object.defineProperty(e,"__esModule",{value:!0}),e.COLLECTIONS=void 0;var o=n(413),i=n(460),r=n(629),s=n(652),l=n(610),a=n(371),c=n(770),u=n(659),d=n(139),p=n(591),h=n(233),f=n(957),v=n(983),m=n(949),y=n(87),g=n(366),w=n(679);e.COLLECTIONS=[{key:"copy-markup",fn:o.default},{key:"accordion",fn:i.default},{key:"carousel",fn:r.default},{key:"collapse",fn:s.default},{key:"dropdown",fn:l.default},{key:"input-number",fn:a.default},{key:"overlay",fn:c.default},{key:"pin-input",fn:u.default},{key:"remove-element",fn:d.default},{key:"scrollspy",fn:p.default},{key:"select",fn:h.default},{key:"stepper",fn:f.default},{key:"strong-password",fn:v.default},{key:"tabs",fn:m.default},{key:"toggle-count",fn:y.default},{key:"toggle-password",fn:g.default},{key:"tooltip",fn:w.default}]},313:(t,e,n)=>{ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n{Object.defineProperty(e,"__esModule",{value:!0}),e.COLLECTIONS=void 0;var o=n(413),i=n(460),r=n(629),s=n(652),l=n(23),a=n(610),c=n(371),u=n(770),d=n(659),p=n(139),h=n(591),f=n(233),m=n(957),v=n(983),y=n(949),g=n(87),w=n(366),b=n(679);e.COLLECTIONS=[{key:"copy-markup",fn:o.default},{key:"accordion",fn:i.default},{key:"carousel",fn:r.default},{key:"collapse",fn:s.default},{key:"combobox",fn:l.default},{key:"dropdown",fn:a.default},{key:"input-number",fn:c.default},{key:"overlay",fn:u.default},{key:"pin-input",fn:d.default},{key:"remove-element",fn:p.default},{key:"scrollspy",fn:h.default},{key:"select",fn:f.default},{key:"stepper",fn:m.default},{key:"strong-password",fn:v.default},{key:"tabs",fn:y.default},{key:"toggle-count",fn:g.default},{key:"toggle-password",fn:w.default},{key:"tooltip",fn:b.default}]},313:(t,e,n)=>{ /* * HSStaticMethods - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -Object.defineProperty(e,"__esModule",{value:!0});var o=n(969),i=n(362),r={getClassProperty:o.getClassProperty,afterTransition:o.afterTransition,autoInit:function(t){void 0===t&&(t="all"),"all"===t?i.COLLECTIONS.forEach((function(t){var e=t.fn;null==e||e.autoInit()})):i.COLLECTIONS.forEach((function(e){var n=e.key,o=e.fn;t.includes(n)&&(null==o||o.autoInit())}))}};"undefined"!=typeof window&&(window.HSStaticMethods=r),e.default=r},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=void 0;e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,l=window.innerHeight,a=s?r.top-s.top:r.top,c=(i?s.bottom:l)-r.bottom,u=t.clientHeight+o;return"bottom"===n?c>=u:"top"===n?a>=u:a>=u||c>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.HSStaticMethods=t.HSTooltip=t.HSTogglePassword=t.HSToggleCount=t.HSThemeSwitch=t.HSTabs=t.HSStrongPassword=t.HSStepper=t.HSSelect=t.HSScrollspy=t.HSSearchByJson=t.HSRemoveElement=t.HSPinInput=t.HSOverlay=t.HSInputNumber=t.HSDropdown=t.HSCollapse=t.HSCarousel=t.HSAccordion=t.HSCopyMarkup=void 0;var e=n(413);Object.defineProperty(t,"HSCopyMarkup",{enumerable:!0,get:function(){return e.default}});var i=n(460);Object.defineProperty(t,"HSAccordion",{enumerable:!0,get:function(){return i.default}});var r=n(629);Object.defineProperty(t,"HSCarousel",{enumerable:!0,get:function(){return r.default}});var s=n(652);Object.defineProperty(t,"HSCollapse",{enumerable:!0,get:function(){return s.default}});var l=n(610);Object.defineProperty(t,"HSDropdown",{enumerable:!0,get:function(){return l.default}});var a=n(371);Object.defineProperty(t,"HSInputNumber",{enumerable:!0,get:function(){return a.default}});var c=n(770);Object.defineProperty(t,"HSOverlay",{enumerable:!0,get:function(){return c.default}});var u=n(659);Object.defineProperty(t,"HSPinInput",{enumerable:!0,get:function(){return u.default}});var d=n(139);Object.defineProperty(t,"HSRemoveElement",{enumerable:!0,get:function(){return d.default}});var p=n(961);Object.defineProperty(t,"HSSearchByJson",{enumerable:!0,get:function(){return p.default}});var h=n(591);Object.defineProperty(t,"HSScrollspy",{enumerable:!0,get:function(){return h.default}});var f=n(233);Object.defineProperty(t,"HSSelect",{enumerable:!0,get:function(){return f.default}});var v=n(957);Object.defineProperty(t,"HSStepper",{enumerable:!0,get:function(){return v.default}});var m=n(983);Object.defineProperty(t,"HSStrongPassword",{enumerable:!0,get:function(){return m.default}});var y=n(949);Object.defineProperty(t,"HSTabs",{enumerable:!0,get:function(){return y.default}});var g=n(557);Object.defineProperty(t,"HSThemeSwitch",{enumerable:!0,get:function(){return g.default}});var w=n(87);Object.defineProperty(t,"HSToggleCount",{enumerable:!0,get:function(){return w.default}});var b=n(366);Object.defineProperty(t,"HSTogglePassword",{enumerable:!0,get:function(){return b.default}});var C=n(679);Object.defineProperty(t,"HSTooltip",{enumerable:!0,get:function(){return C.default}});var S=n(313);Object.defineProperty(t,"HSStaticMethods",{enumerable:!0,get:function(){return S.default}})})(),o})())); \ No newline at end of file +Object.defineProperty(e,"__esModule",{value:!0});var o=n(969),i=n(362),r={getClassProperty:o.getClassProperty,afterTransition:o.afterTransition,autoInit:function(t){void 0===t&&(t="all"),"all"===t?i.COLLECTIONS.forEach((function(t){var e=t.fn;null==e||e.autoInit()})):i.COLLECTIONS.forEach((function(e){var n=e.key,o=e.fn;t.includes(n)&&(null==o||o.autoInit())}))}};"undefined"!=typeof window&&(window.HSStaticMethods=r),e.default=r},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0;e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,l=window.innerHeight,a=s?r.top-s.top:r.top,c=(i?s.bottom:l)-r.bottom,u=t.clientHeight+o;return"bottom"===n?c>=u:"top"===n?a>=u:a>=u||c>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.HSStaticMethods=t.HSTooltip=t.HSTogglePassword=t.HSToggleCount=t.HSThemeSwitch=t.HSTabs=t.HSStrongPassword=t.HSStepper=t.HSSelect=t.HSScrollspy=t.HSSearchByJson=t.HSRemoveElement=t.HSPinInput=t.HSOverlay=t.HSInputNumber=t.HSDropdown=t.HSComboBox=t.HSCollapse=t.HSCarousel=t.HSAccordion=t.HSCopyMarkup=void 0;var e=n(413);Object.defineProperty(t,"HSCopyMarkup",{enumerable:!0,get:function(){return e.default}});var i=n(460);Object.defineProperty(t,"HSAccordion",{enumerable:!0,get:function(){return i.default}});var r=n(629);Object.defineProperty(t,"HSCarousel",{enumerable:!0,get:function(){return r.default}});var s=n(652);Object.defineProperty(t,"HSCollapse",{enumerable:!0,get:function(){return s.default}});var l=n(23);Object.defineProperty(t,"HSComboBox",{enumerable:!0,get:function(){return l.default}});var a=n(610);Object.defineProperty(t,"HSDropdown",{enumerable:!0,get:function(){return a.default}});var c=n(371);Object.defineProperty(t,"HSInputNumber",{enumerable:!0,get:function(){return c.default}});var u=n(770);Object.defineProperty(t,"HSOverlay",{enumerable:!0,get:function(){return u.default}});var d=n(659);Object.defineProperty(t,"HSPinInput",{enumerable:!0,get:function(){return d.default}});var p=n(139);Object.defineProperty(t,"HSRemoveElement",{enumerable:!0,get:function(){return p.default}});var h=n(961);Object.defineProperty(t,"HSSearchByJson",{enumerable:!0,get:function(){return h.default}});var f=n(591);Object.defineProperty(t,"HSScrollspy",{enumerable:!0,get:function(){return f.default}});var m=n(233);Object.defineProperty(t,"HSSelect",{enumerable:!0,get:function(){return m.default}});var v=n(957);Object.defineProperty(t,"HSStepper",{enumerable:!0,get:function(){return v.default}});var y=n(983);Object.defineProperty(t,"HSStrongPassword",{enumerable:!0,get:function(){return y.default}});var g=n(949);Object.defineProperty(t,"HSTabs",{enumerable:!0,get:function(){return g.default}});var w=n(557);Object.defineProperty(t,"HSThemeSwitch",{enumerable:!0,get:function(){return w.default}});var b=n(87);Object.defineProperty(t,"HSToggleCount",{enumerable:!0,get:function(){return b.default}});var C=n(366);Object.defineProperty(t,"HSTogglePassword",{enumerable:!0,get:function(){return C.default}});var S=n(679);Object.defineProperty(t,"HSTooltip",{enumerable:!0,get:function(){return S.default}});var x=n(313);Object.defineProperty(t,"HSStaticMethods",{enumerable:!0,get:function(){return x.default}})})(),o})())); \ No newline at end of file diff --git a/dist/input-number.d.ts b/dist/input-number.d.ts index 23e80af..adaf4e0 100644 --- a/dist/input-number.d.ts +++ b/dist/input-number.d.ts @@ -1,9 +1,5 @@ -export interface IInputNumberOptions { -} -export interface IInputNumber { - options?: IInputNumberOptions; -} + export interface IBasePlugin { el: E; options?: O; @@ -18,11 +14,22 @@ declare class HSBasePlugin implements IBasePlugin { fireEvent(evt: string, payload?: any): any; on(evt: string, cb: Function): void; } +export interface IInputNumberOptions { + min?: number; + max?: number; + step?: number; +} +export interface IInputNumber { + options?: IInputNumberOptions; +} declare class HSInputNumber extends HSBasePlugin implements IInputNumber { private readonly input; private readonly increment; private readonly decrement; private inputValue; + private readonly minInputValue; + private readonly maxInputValue; + private readonly step; constructor(el: HTMLElement, options?: IInputNumberOptions); private init; private build; diff --git a/dist/input-number.js b/dist/input-number.js index 4d0d997..c0629be 100644 --- a/dist/input-number.js +++ b/dist/input-number.js @@ -1,7 +1,7 @@ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(self,(()=>(()=>{"use strict";var t={737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,9 +9,9 @@ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},371:function(t,e,n){ /* * HSInputNumber - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var i,o=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(969),s=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i.input=i.el.querySelector("[data-hs-input-number-input]")||null,i.increment=i.el.querySelector("[data-hs-input-number-increment]")||null,i.decrement=i.el.querySelector("[data-hs-input-number-decrement]")||null,i.inputValue=i.input?parseInt(i.input.value):0,i.init(),i}return o(e,t),e.prototype.init=function(){this.createCollection(window.$hsInputNumberCollection,this),this.input&&this.increment&&this.build()},e.prototype.build=function(){this.input&&this.buildInput(),this.increment&&this.buildIncrement(),this.decrement&&this.buildDecrement(),this.inputValue<=0&&(this.inputValue=0,this.input.value="0",this.changeValue()),this.input.hasAttribute("disabled")&&this.disableButtons()},e.prototype.buildInput=function(){var t=this;this.input.addEventListener("input",(function(){return t.changeValue()}))},e.prototype.buildIncrement=function(){var t=this;this.increment.addEventListener("click",(function(){t.changeValue("increment")}))},e.prototype.buildDecrement=function(){var t=this;this.decrement.addEventListener("click",(function(){t.changeValue("decrement")}))},e.prototype.changeValue=function(t){void 0===t&&(t="none");var e={inputValue:this.inputValue};switch(t){case"increment":this.inputValue+=1,this.input.value=this.inputValue.toString();break;case"decrement":this.inputValue-=this.inputValue<=0?0:1,this.input.value=this.inputValue.toString();break;default:this.inputValue=parseInt(this.input.value)<=0?0:parseInt(this.input.value),this.inputValue<=0&&(this.input.value=this.inputValue.toString())}e.inputValue=this.inputValue,0===this.inputValue?(this.el.classList.add("disabled"),this.decrement&&this.disableButtons("decrement")):(this.el.classList.remove("disabled"),this.decrement&&this.enableButtons("decrement")),this.fireEvent("change",e),(0,r.dispatch)("change.hs.inputNumber",this.el,e)},e.prototype.disableButtons=function(t){void 0===t&&(t="all"),"all"===t?("BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.setAttribute("disabled","disabled"),"BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.setAttribute("disabled","disabled")):"increment"===t?"BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.setAttribute("disabled","disabled"):"decrement"===t&&("BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.setAttribute("disabled","disabled"))},e.prototype.enableButtons=function(t){void 0===t&&(t="all"),"all"===t?("BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.removeAttribute("disabled"),"BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.removeAttribute("disabled")):"increment"===t?"BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.removeAttribute("disabled"):"decrement"===t&&("BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.removeAttribute("disabled"))},e.getInstance=function(t,e){var n=window.$hsInputNumberCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsInputNumberCollection||(window.$hsInputNumberCollection=[]),document.querySelectorAll("[data-hs-input-number]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsInputNumberCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){s.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=s),e.default=s},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=void 0;e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var i="";return t.classList.forEach((function(t){t.includes(e)&&(i=t)})),i.match(/:(.*)]/)?i.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,i,o){void 0===n&&(n="auto"),void 0===i&&(i=10),void 0===o&&(o=null);var r=e.getBoundingClientRect(),s=o?o.getBoundingClientRect():null,u=window.innerHeight,a=s?r.top-s.top:r.top,l=(o?s.bottom:u)-r.bottom,c=t.clientHeight+i;return"bottom"===n?l>=c:"top"===n?a>=c:a>=c||l>=c};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var i=function(t){return!!t&&("none"===window.getComputedStyle(t).display||i(t.parentElement))};e.isParentOrElementHidden=i;e.debounce=function(t,e){var i;return void 0===e&&(e=200),function(){for(var o=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(i){var o=e[i];if(void 0!==o)return o.exports;var r=e[i]={exports:{}};return t[i].call(r.exports,r,r.exports,n),r.exports}(371);return n})())); \ No newline at end of file +var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0?a.step:1,i.init(),i}return r(e,t),e.prototype.init=function(){this.createCollection(window.$hsInputNumberCollection,this),this.input&&this.increment&&this.build()},e.prototype.build=function(){this.input&&this.buildInput(),this.increment&&this.buildIncrement(),this.decrement&&this.buildDecrement(),this.inputValue<=0&&0===this.minInputValue&&(this.inputValue=0,this.input.value="0"),(this.inputValue<=0||this.minInputValue<0)&&this.changeValue(),this.input.hasAttribute("disabled")&&this.disableButtons()},e.prototype.buildInput=function(){var t=this;this.input.addEventListener("input",(function(){return t.changeValue()}))},e.prototype.buildIncrement=function(){var t=this;this.increment.addEventListener("click",(function(){t.changeValue("increment")}))},e.prototype.buildDecrement=function(){var t=this;this.decrement.addEventListener("click",(function(){t.changeValue("decrement")}))},e.prototype.changeValue=function(t){var e,n;void 0===t&&(t="none");var i={inputValue:this.inputValue},r=null!==(e=this.minInputValue)&&void 0!==e?e:Number.MIN_SAFE_INTEGER,s=null!==(n=this.maxInputValue)&&void 0!==n?n:Number.MAX_SAFE_INTEGER;switch(this.inputValue=isNaN(this.inputValue)?0:this.inputValue,t){case"increment":var a=this.inputValue+this.step;this.inputValue=a>=r&&a<=s?a:s,this.input.value=this.inputValue.toString();break;case"decrement":var u=this.inputValue-this.step;this.inputValue=u>=r&&u<=s?u:r,this.input.value=this.inputValue.toString();break;default:var l=isNaN(parseInt(this.input.value))?0:parseInt(this.input.value);this.inputValue=l>=s?s:l<=r?r:l,this.inputValue<=r&&(this.input.value=this.inputValue.toString())}i.inputValue=this.inputValue,this.inputValue===r?(this.el.classList.add("disabled"),this.decrement&&this.disableButtons("decrement")):(this.el.classList.remove("disabled"),this.decrement&&this.enableButtons("decrement")),this.inputValue===s?(this.el.classList.add("disabled"),this.increment&&this.disableButtons("increment")):(this.el.classList.remove("disabled"),this.increment&&this.enableButtons("increment")),this.fireEvent("change",i),(0,o.dispatch)("change.hs.inputNumber",this.el,i)},e.prototype.disableButtons=function(t){void 0===t&&(t="all"),"all"===t?("BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.setAttribute("disabled","disabled"),"BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.setAttribute("disabled","disabled")):"increment"===t?"BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.setAttribute("disabled","disabled"):"decrement"===t&&("BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.setAttribute("disabled","disabled"))},e.prototype.enableButtons=function(t){void 0===t&&(t="all"),"all"===t?("BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.removeAttribute("disabled"),"BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.removeAttribute("disabled")):"increment"===t?"BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.removeAttribute("disabled"):"decrement"===t&&("BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.removeAttribute("disabled"))},e.getInstance=function(t,e){var n=window.$hsInputNumberCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsInputNumberCollection||(window.$hsInputNumberCollection=[]),document.querySelectorAll("[data-hs-input-number]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsInputNumberCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=a),e.default=a},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0;e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var i="";return t.classList.forEach((function(t){t.includes(e)&&(i=t)})),i.match(/:(.*)]/)?i.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,i,r){void 0===n&&(n="auto"),void 0===i&&(i=10),void 0===r&&(r=null);var s=e.getBoundingClientRect(),o=r?r.getBoundingClientRect():null,a=window.innerHeight,u=o?s.top-o.top:s.top,l=(r?o.bottom:a)-s.bottom,c=t.clientHeight+i;return"bottom"===n?l>=c:"top"===n?u>=c:u>=c||l>=c};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var i=function(t){return!!t&&("none"===window.getComputedStyle(t).display||i(t.parentElement))};e.isParentOrElementHidden=i;e.debounce=function(t,e){var i;return void 0===e&&(e=200),function(){for(var r=[],s=0;sthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(i){var r=e[i];if(void 0!==r)return r.exports;var s=e[i]={exports:{}};return t[i].call(s.exports,s,s.exports,n),s.exports}(371);return n})())); \ No newline at end of file diff --git a/dist/overlay.d.ts b/dist/overlay.d.ts index 8c3199f..8acf40d 100644 --- a/dist/overlay.d.ts +++ b/dist/overlay.d.ts @@ -1,18 +1,5 @@ -export interface IOverlayOptions { - hiddenClass?: string | null; - isClosePrev?: boolean; - backdropClasses?: string | null; -} -export interface IOverlay { - options?: IOverlayOptions; - open(): void; - close(): void; -} -export interface ICollectionItem { - id: string | number; - element: T; -} + export interface IBasePlugin { el: E; options?: O; @@ -27,6 +14,20 @@ declare class HSBasePlugin implements IBasePlugin { fireEvent(evt: string, payload?: any): any; on(evt: string, cb: Function): void; } +export interface ICollectionItem { + id: string | number; + element: T; +} +export interface IOverlayOptions { + hiddenClass?: string | null; + isClosePrev?: boolean; + backdropClasses?: string | null; +} +export interface IOverlay { + options?: IOverlayOptions; + open(): void; + close(): void; +} declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private readonly hiddenClass; private readonly isClosePrev; @@ -35,10 +36,13 @@ declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private autoHide; private readonly overlayId; overlay: HTMLElement | null; - isCloseWhenClickInside: string; - isTabAccessibilityLimited: string; - hasAutofocus: string; - hasAbilityToCloseOnBackdropClick: string; + isCloseWhenClickInside: boolean; + isTabAccessibilityLimited: boolean; + isLayoutAffect: boolean; + hasAutofocus: boolean; + hasAbilityToCloseOnBackdropClick: boolean; + openedBreakpoint: number | null; + autoClose: number | null; constructor(el: HTMLElement, options?: IOverlayOptions, events?: {}); private init; private hideAuto; @@ -47,11 +51,12 @@ declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private destroyBackdrop; private focusElement; open(): false | Promise; - close(): Promise; + close(forceClose?: boolean): Promise; static getInstance(target: HTMLElement, isInstance?: boolean): HTMLElement | ICollectionItem; static autoInit(): void; static open(target: HTMLElement): void; static close(target: HTMLElement): void; + static setOpened(breakpoint: number, el: ICollectionItem): void; static accessibility(evt: KeyboardEvent): boolean; static onEscape(target: ICollectionItem): void; static onTab(target: ICollectionItem, focusableElements: HTMLElement[]): boolean; diff --git a/dist/overlay.js b/dist/overlay.js index c725c71..b9303eb 100644 --- a/dist/overlay.js +++ b/dist/overlay.js @@ -1,7 +1,7 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(self,(()=>(()=>{"use strict";var e={737:(e,t)=>{ +!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(self,(()=>(()=>{"use strict";var e={190:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BREAKPOINTS=t.COMBO_BOX_ACCESSIBILITY_KEY_SET=t.SELECT_ACCESSIBILITY_KEY_SET=t.TABS_ACCESSIBILITY_KEY_SET=t.OVERLAY_ACCESSIBILITY_KEY_SET=t.DROPDOWN_ACCESSIBILITY_KEY_SET=t.POSITIONS=void 0,t.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},t.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],t.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],t.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],t.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],t.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],t.BREAKPOINTS={sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},737:(e,t)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,9 +9,9 @@ Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t,o){this.el=e,this.options=t,this.events=o,this.el=e,this.options=t,this.events={}}return e.prototype.createCollection=function(e,t){var o;e.push({id:(null===(o=null==t?void 0:t.el)||void 0===o?void 0:o.id)||e.length+1,element:t})},e.prototype.fireEvent=function(e,t){if(void 0===t&&(t=null),this.events.hasOwnProperty(e))return this.events[e](t)},e.prototype.on=function(e,t){this.events[e]=t},e}();t.default=o},770:function(e,t,o){ /* * HSOverlay - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,o=1,n=arguments.length;o-1?t[(n+1)%t.length].focus():t[0].focus()},t.on=function(e,t,o){var n=window.$hsOverlayCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)||e.element.overlay===("string"==typeof t?document.querySelector(t):t)}));n&&(n.element.events[e]=o)},t}(o(737).default);window.addEventListener("load",(function(){s.autoInit()})),"undefined"!=typeof window&&(window.HSOverlay=s),t.default=s},969:function(e,t){var o=this;Object.defineProperty(t,"__esModule",{value:!0}),t.menuSearchHistory=t.classToClassList=t.htmlToElement=t.afterTransition=t.dispatch=t.debounce=t.isFormElement=t.isParentOrElementHidden=t.isEnoughSpace=t.isIpadOS=t.isIOS=t.getClassPropertyAlt=t.getClassProperty=void 0;t.getClassProperty=function(e,t,o){return void 0===o&&(o=""),(window.getComputedStyle(e).getPropertyValue(t)||o).replace(" ","")};t.getClassPropertyAlt=function(e,t,o){void 0===o&&(o="");var n="";return e.classList.forEach((function(e){e.includes(t)&&(n=e)})),n.match(/:(.*)]/)?n.match(/:(.*)]/)[1]:o};t.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};t.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};t.isEnoughSpace=function(e,t,o,n,i){void 0===o&&(o="auto"),void 0===n&&(n=10),void 0===i&&(i=null);var r=t.getBoundingClientRect(),l=i?i.getBoundingClientRect():null,s=window.innerHeight,a=l?r.top-l.top:r.top,c=(i?l.bottom:s)-r.bottom,u=e.clientHeight+n;return"bottom"===o?c>=u:"top"===o?a>=u:a>=u||c>=u};t.isFormElement=function(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement};var n=function(e){return!!e&&("none"===window.getComputedStyle(e).display||n(e.parentElement))};t.isParentOrElementHidden=n;t.debounce=function(e,t){var n;return void 0===t&&(t=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},t={};var o=function o(n){var i=t[n];if(void 0!==i)return i.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,o),r.exports}(770);return o})())); \ No newline at end of file +var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,o=1,n=arguments.length;o=e?(document.body.classList.add("hs-overlay-body-open"),t.element.overlay.classList.add("opened")):t.element.close(!0)},t.accessibility=function(e){var t,o,n=window.$hsOverlayCollection.filter((function(e){return e.element.overlay.classList.contains("open")})),r=n[n.length-1],i=null===(o=null===(t=null==r?void 0:r.element)||void 0===t?void 0:t.overlay)||void 0===o?void 0:o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),a=[];(null==i?void 0:i.length)&&i.forEach((function(e){(0,l.isParentOrElementHidden)(e)||a.push(e)}));var s=r&&!e.metaKey;if(s&&!r.element.isTabAccessibilityLimited&&"Tab"===e.code)return!1;s&&a.length&&"Tab"===e.code&&(e.preventDefault(),this.onTab(r,a)),s&&"Escape"===e.code&&(e.preventDefault(),this.onEscape(r))},t.onEscape=function(e){e&&e.element.hasAbilityToCloseOnBackdropClick&&e.element.close()},t.onTab=function(e,t){if(!t.length)return!1;var o=e.element.overlay.querySelector(":focus"),n=Array.from(t).indexOf(o);n>-1?t[(n+1)%t.length].focus():t[0].focus()},t.on=function(e,t,o){var n=window.$hsOverlayCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)||e.element.overlay===("string"==typeof t?document.querySelector(t):t)}));n&&(n.element.events[e]=o)},t}(o(737).default);window.addEventListener("load",(function(){s.autoInit()})),window.addEventListener("resize",(function(){!function(){if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((function(e){return e.element.autoClose})))return!1;window.$hsOverlayCollection.filter((function(e){return e.element.autoClose})).forEach((function(e){document.body.clientWidth>=e.element.autoClose&&e.element.close(!0)}))}(),function(){if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((function(e){return e.element.openedBreakpoint})))return!1;window.$hsOverlayCollection.filter((function(e){return e.element.openedBreakpoint})).forEach((function(e){s.setOpened(e.element.openedBreakpoint,e)}))}()})),"undefined"!=typeof window&&(window.HSOverlay=s),t.default=s},969:function(e,t){var o=this;Object.defineProperty(t,"__esModule",{value:!0}),t.menuSearchHistory=t.classToClassList=t.htmlToElement=t.afterTransition=t.dispatch=t.debounce=t.isFormElement=t.isParentOrElementHidden=t.isEnoughSpace=t.isIpadOS=t.isIOS=t.getClassPropertyAlt=t.getClassProperty=t.stringToBoolean=void 0;t.stringToBoolean=function(e){return"true"===e};t.getClassProperty=function(e,t,o){return void 0===o&&(o=""),(window.getComputedStyle(e).getPropertyValue(t)||o).replace(" ","")};t.getClassPropertyAlt=function(e,t,o){void 0===o&&(o="");var n="";return e.classList.forEach((function(e){e.includes(t)&&(n=e)})),n.match(/:(.*)]/)?n.match(/:(.*)]/)[1]:o};t.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};t.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};t.isEnoughSpace=function(e,t,o,n,r){void 0===o&&(o="auto"),void 0===n&&(n=10),void 0===r&&(r=null);var i=t.getBoundingClientRect(),l=r?r.getBoundingClientRect():null,a=window.innerHeight,s=l?i.top-l.top:i.top,c=(r?l.bottom:a)-i.bottom,u=e.clientHeight+n;return"bottom"===o?c>=u:"top"===o?s>=u:s>=u||c>=u};t.isFormElement=function(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement};var n=function(e){return!!e&&("none"===window.getComputedStyle(e).display||n(e.parentElement))};t.isParentOrElementHidden=n;t.debounce=function(e,t){var n;return void 0===t&&(t=200),function(){for(var r=[],i=0;ithis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},t={};var o=function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,o),i.exports}(770);return o})())); \ No newline at end of file diff --git a/dist/pin-input.d.ts b/dist/pin-input.d.ts index 7a66d41..0add57c 100644 --- a/dist/pin-input.d.ts +++ b/dist/pin-input.d.ts @@ -1,10 +1,5 @@ -export interface IPinInputOptions { - availableCharsRE?: RegExp; -} -export interface IPinInput { - options?: IPinInputOptions; -} + export interface IBasePlugin { el: E; options?: O; @@ -23,6 +18,12 @@ export interface ICollectionItem { id: string | number; element: T; } +export interface IPinInputOptions { + availableCharsRE?: RegExp; +} +export interface IPinInput { + options?: IPinInputOptions; +} declare class HSPinInput extends HSBasePlugin implements IPinInput { private items; private currentItem; diff --git a/dist/pin-input.js b/dist/pin-input.js index 81d69f2..4d97499 100644 --- a/dist/pin-input.js +++ b/dist/pin-input.js @@ -1,7 +1,7 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(self,(()=>(()=>{"use strict";var t={737:(t,e)=>{ +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,9 +9,9 @@ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},659:function(t,e,n){ /* * HSPinInput - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var i,o=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0&&this.items[e-1].focus()},e.prototype.onKeydown=function(t,e){"Backspace"===t.key&&e>0&&(""===this.items[e].value?(this.items[e-1].value="",this.items[e-1].focus()):this.items[e].value=""),this.setCurrentValue(),this.toggleCompleted()},e.prototype.onFocusIn=function(t){this.items[t].setAttribute("placeholder","")},e.prototype.onFocusOut=function(t){this.items[t].setAttribute("placeholder",this.placeholders[t])},e.prototype.onPaste=function(t){var e=this;t.preventDefault(),this.items.forEach((function(n){document.activeElement===n&&e.autoFillAll(t.clipboardData.getData("text"))}))},e.getInstance=function(t,e){var n=window.$hsPinInputCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsPinInputCollection||(window.$hsPinInputCollection=[]),document.querySelectorAll("[data-hs-pin-input]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsPinInputCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){u.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=u),e.default=u},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=void 0;e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var i="";return t.classList.forEach((function(t){t.includes(e)&&(i=t)})),i.match(/:(.*)]/)?i.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,i,o){void 0===n&&(n="auto"),void 0===i&&(i=10),void 0===o&&(o=null);var r=e.getBoundingClientRect(),s=o?o.getBoundingClientRect():null,u=window.innerHeight,a=s?r.top-s.top:r.top,l=(o?s.bottom:u)-r.bottom,c=t.clientHeight+i;return"bottom"===n?l>=c:"top"===n?a>=c:a>=c||l>=c};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var i=function(t){return!!t&&("none"===window.getComputedStyle(t).display||i(t.parentElement))};e.isParentOrElementHidden=i;e.debounce=function(t,e){var i;return void 0===e&&(e=200),function(){for(var o=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(i){var o=e[i];if(void 0!==o)return o.exports;var r=e[i]={exports:{}};return t[i].call(r.exports,r,r.exports,n),r.exports}(659);return n})())); \ No newline at end of file +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&this.items[e-1].focus()},e.prototype.onKeydown=function(t,e){"Backspace"===t.key&&e>0&&(""===this.items[e].value?(this.items[e-1].value="",this.items[e-1].focus()):this.items[e].value=""),this.setCurrentValue(),this.toggleCompleted()},e.prototype.onFocusIn=function(t){this.items[t].setAttribute("placeholder","")},e.prototype.onFocusOut=function(t){this.items[t].setAttribute("placeholder",this.placeholders[t])},e.prototype.onPaste=function(t){var e=this;t.preventDefault(),this.items.forEach((function(n){document.activeElement===n&&e.autoFillAll(t.clipboardData.getData("text"))}))},e.getInstance=function(t,e){var n=window.$hsPinInputCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsPinInputCollection||(window.$hsPinInputCollection=[]),document.querySelectorAll("[data-hs-pin-input]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsPinInputCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){u.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=u),e.default=u},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0;e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,u=window.innerHeight,a=s?r.top-s.top:r.top,l=(i?s.bottom:u)-r.bottom,c=t.clientHeight+o;return"bottom"===n?l>=c:"top"===n?a>=c:a>=c||l>=c};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}(659);return n})())); \ No newline at end of file diff --git a/dist/preline.d.ts b/dist/preline.d.ts index c0821f3..4a5bc11 100644 --- a/dist/preline.d.ts +++ b/dist/preline.d.ts @@ -1,4 +1,5 @@ + export interface ICopyMarkupOptions { targetSelector: string; wrapperSelector: string; @@ -131,6 +132,112 @@ export declare class HSCollapse extends HSBasePlugin<{}> implements ICollapse { static hide(target: HTMLElement): void; static on(evt: string, target: HTMLElement, cb: Function): void; } +export interface IComboBoxOptions { + gap?: number; + viewport?: string | HTMLElement | null; + preventVisibility?: boolean; + apiUrl?: string | null; + apiDataPart?: string | null; + apiQuery?: string | null; + apiSearchQuery?: string | null; + apiHeaders?: {}; + apiGroupField?: string | null; + outputItemTemplate?: string | null; + outputEmptyTemplate?: string | null; + outputLoaderTemplate?: string | null; + groupingType?: "default" | "tabs" | null; + groupingTitleTemplate?: string | null; + tabsWrapperTemplate?: string | null; + preventSelection?: boolean; + isOpenOnFocus?: boolean; +} +export interface IComboBox { + options?: IComboBoxOptions; + open(): void; + close(): void; + recalculateDirection(): void; +} +export declare class HSComboBox extends HSBasePlugin implements IComboBox { + gap: number; + viewport: string | HTMLElement | null; + preventVisibility: boolean; + apiUrl: string | null; + apiDataPart: string | null; + apiQuery: string | null; + apiSearchQuery: string | null; + apiHeaders: {}; + apiGroupField: string | null; + outputItemTemplate: string | null; + outputEmptyTemplate: string | null; + outputLoaderTemplate: string | null; + groupingType: "default" | "tabs" | null; + groupingTitleTemplate: string | null; + tabsWrapperTemplate: string | null; + preventSelection: boolean; + isOpenOnFocus: boolean; + private readonly input; + private readonly output; + private readonly itemsWrapper; + private items; + private tabs; + private readonly toggle; + private outputPlaceholder; + private outputLoader; + private value; + private selected; + private groups; + private selectedGroup; + isOpened: boolean; + isCurrent: boolean; + private animationInProcess; + constructor(el: HTMLElement, options?: IComboBoxOptions); + private init; + private build; + private setResultAndRender; + private buildInput; + private buildItems; + private setResults; + private isItemExists; + private isTextExists; + private isTextExistsAny; + private valuesBySelector; + private buildOutputLoader; + private destroyOutputLoader; + private itemsFromJson; + private jsonItemsRender; + private setGroups; + setCurrent(): void; + private setApiGroups; + private sortItems; + private itemRender; + private plainRender; + private groupTabsRender; + private groupDefaultRender; + private itemsFromHtml; + private buildToggle; + private setSelectedByValue; + private setValue; + private setItemsVisibility; + private hasVisibleItems; + private appendItemsToWrapper; + private buildOutputPlaceholder; + private destroyOutputPlaceholder; + private resultItems; + private setValueAndOpen; + open(val?: string): boolean; + private setValueAndClear; + close(val?: string | null): boolean; + recalculateDirection(): void; + static getInstance(target: HTMLElement | string, isInstance?: boolean): HSComboBox | ICollectionItem; + static autoInit(): void; + static close(target: HTMLElement | string): void; + static closeCurrentlyOpened(evtTarget?: HTMLElement | null): void; + static accessibility(evt: KeyboardEvent): void; + static onEscape(): void; + static onArrow(isArrowUp?: boolean): boolean; + static onStartEnd(isStart?: boolean): boolean; + static onEnter(evt: Event): void; +} export interface IDropdown { options?: {}; open(): void; @@ -172,6 +279,9 @@ export declare class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> imp static on(evt: string, target: HTMLElement, cb: Function): void; } export interface IInputNumberOptions { + min?: number; + max?: number; + step?: number; } export interface IInputNumber { options?: IInputNumberOptions; @@ -181,6 +291,9 @@ export declare class HSInputNumber extends HSBasePlugin imp private readonly increment; private readonly decrement; private inputValue; + private readonly minInputValue; + private readonly maxInputValue; + private readonly step; constructor(el: HTMLElement, options?: IInputNumberOptions); private init; private build; @@ -214,10 +327,13 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private autoHide; private readonly overlayId; overlay: HTMLElement | null; - isCloseWhenClickInside: string; - isTabAccessibilityLimited: string; - hasAutofocus: string; - hasAbilityToCloseOnBackdropClick: string; + isCloseWhenClickInside: boolean; + isTabAccessibilityLimited: boolean; + isLayoutAffect: boolean; + hasAutofocus: boolean; + hasAbilityToCloseOnBackdropClick: boolean; + openedBreakpoint: number | null; + autoClose: number | null; constructor(el: HTMLElement, options?: IOverlayOptions, events?: {}); private init; private hideAuto; @@ -226,11 +342,12 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private destroyBackdrop; private focusElement; open(): false | Promise; - close(): Promise; + close(forceClose?: boolean): Promise; static getInstance(target: HTMLElement, isInstance?: boolean): HTMLElement | ICollectionItem; static autoInit(): void; static open(target: HTMLElement): void; static close(target: HTMLElement): void; + static setOpened(breakpoint: number, el: ICollectionItem): void; static accessibility(evt: KeyboardEvent): boolean; static onEscape(target: ICollectionItem): void; static onTab(target: ICollectionItem, focusableElements: HTMLElement[]): boolean; @@ -353,13 +470,14 @@ export interface ISelectOptions { isOpened?: boolean; placeholder?: string; hasSearch?: boolean; + preventSearchFocus?: boolean; mode?: string; viewport?: string; + wrapperClasses?: string; toggleTag?: string; toggleClasses?: string; toggleCountText?: string; toggleCountTextMinItems?: number; - tagsClasses?: string; tagsItemTemplate?: string; tagsItemClasses?: string; tagsInputClasses?: string; @@ -370,6 +488,7 @@ export interface ISelectOptions { bottom?: string; }; dropdownSpace: number; + extraMarkup?: string | string[] | null; searchWrapperTemplate?: string; searchClasses?: string; searchWrapperClasses?: string; @@ -396,16 +515,18 @@ export declare class HSSelect extends HSBasePlugin implements IS value: string | string[] | null; private readonly placeholder; private readonly hasSearch; + private readonly preventSearchFocus; private readonly mode; private readonly viewport; isOpened: boolean | null; isMultiple: boolean | null; isDisabled: boolean | null; + selectedItems: string[]; private readonly toggleTag; private readonly toggleClasses; private readonly toggleCountText; private readonly toggleCountTextMinItems; - private readonly tagsClasses; + private readonly wrapperClasses; private readonly tagsItemTemplate; private readonly tagsItemClasses; private readonly tagsInputClasses; @@ -428,24 +549,25 @@ export declare class HSSelect extends HSBasePlugin implements IS private wrapper; private toggle; private toggleTextWrapper; - private tags; - private tagsItems; private tagsInput; private dropdown; private searchWrapper; private search; private searchNoResult; private selectOptions; + private extraMarkup; private readonly isAddTagOnEnter; + private tagsInputHelper; constructor(el: HTMLElement, options?: ISelectOptions); private init; private build; private buildWrapper; + private buildExtraMarkup; private buildToggle; private setToggleIcon; private setToggleTitle; private buildTags; - private buildTagsItems; + private reassignTagsInputPlaceholder; private buildTagsItem; private getItemByValue; private setTagsItems; @@ -456,6 +578,9 @@ export declare class HSSelect extends HSBasePlugin implements IS private destroyOption; private buildOriginalOption; private destroyOriginalOption; + private buildTagsInputHelper; + private calculateInputWidth; + private adjustInputWidth; private onSelectOption; private addSelectOption; private removeSelectOption; @@ -660,6 +785,8 @@ export declare class HSThemeSwitch extends HSBasePlugin imp constructor(el: HTMLElement, options?: IThemeSwitchOptions); private init; private setResetStyles; + private addSystemThemeObserver; + private removeSystemThemeObserver; setAppearance(theme?: string, isSaveToLocalStorage?: boolean, isSetDispatchEvent?: boolean): void; static getInstance(target: HTMLElement | string): HSThemeSwitch; static autoInit(): void; diff --git a/dist/preline.js b/dist/preline.js index 3b73d9b..e5a89be 100644 --- a/dist/preline.js +++ b/dist/preline.js @@ -1,7 +1,7 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={492:(t,e,n)=>{n.r(e),n.d(e,{afterMain:()=>S,afterRead:()=>w,afterWrite:()=>x,applyStyles:()=>P,arrow:()=>G,auto:()=>l,basePlacements:()=>a,beforeMain:()=>b,beforeRead:()=>y,beforeWrite:()=>I,bottom:()=>i,clippingParents:()=>d,computeStyles:()=>nt,createPopper:()=>Pt,createPopperBase:()=>kt,createPopperLite:()=>Bt,detectOverflow:()=>gt,end:()=>u,eventListeners:()=>it,flip:()=>wt,hide:()=>St,left:()=>s,main:()=>C,modifierPhases:()=>E,offset:()=>It,placements:()=>m,popper:()=>h,popperGenerator:()=>_t,popperOffsets:()=>Tt,preventOverflow:()=>xt,read:()=>g,reference:()=>f,right:()=>r,start:()=>c,top:()=>o,variationPlacements:()=>v,viewport:()=>p,write:()=>T});var o="top",i="bottom",r="right",s="left",l="auto",a=[o,i,r,s],c="start",u="end",d="clippingParents",p="viewport",h="popper",f="reference",v=a.reduce((function(t,e){return t.concat([e+"-"+c,e+"-"+u])}),[]),m=[].concat(a,[l]).reduce((function(t,e){return t.concat([e,e+"-"+c,e+"-"+u])}),[]),y="beforeRead",g="read",w="afterRead",b="beforeMain",C="main",S="afterMain",I="beforeWrite",T="write",x="afterWrite",E=[y,g,w,b,C,S,I,T,x];function O(t){return t?(t.nodeName||"").toLowerCase():null}function L(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function A(t){return t instanceof L(t).Element||t instanceof Element}function _(t){return t instanceof L(t).HTMLElement||t instanceof HTMLElement}function k(t){return"undefined"!=typeof ShadowRoot&&(t instanceof L(t).ShadowRoot||t instanceof ShadowRoot)}const P={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},o=e.attributes[t]||{},i=e.elements[t];_(i)&&O(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(t){var e=o[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var o=e.elements[t],i=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});_(o)&&O(o)&&(Object.assign(o.style,r),Object.keys(i).forEach((function(t){o.removeAttribute(t)})))}))}},requires:["computeStyles"]};function B(t){return t.split("-")[0]}var q=Math.max,j=Math.min,N=Math.round;function D(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function $(){return!/^((?!chrome|android).)*safari/i.test(D())}function H(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var o=t.getBoundingClientRect(),i=1,r=1;e&&_(t)&&(i=t.offsetWidth>0&&N(o.width)/t.offsetWidth||1,r=t.offsetHeight>0&&N(o.height)/t.offsetHeight||1);var s=(A(t)?L(t):window).visualViewport,l=!$()&&n,a=(o.left+(l&&s?s.offsetLeft:0))/i,c=(o.top+(l&&s?s.offsetTop:0))/r,u=o.width/i,d=o.height/r;return{width:u,height:d,top:c,right:a+u,bottom:c+d,left:a,x:a,y:c}}function M(t){var e=H(t),n=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:o}}function R(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&k(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function W(t){return L(t).getComputedStyle(t)}function V(t){return["table","td","th"].indexOf(O(t))>=0}function F(t){return((A(t)?t.ownerDocument:t.document)||window.document).documentElement}function U(t){return"html"===O(t)?t:t.assignedSlot||t.parentNode||(k(t)?t.host:null)||F(t)}function Y(t){return _(t)&&"fixed"!==W(t).position?t.offsetParent:null}function J(t){for(var e=L(t),n=Y(t);n&&V(n)&&"static"===W(n).position;)n=Y(n);return n&&("html"===O(n)||"body"===O(n)&&"static"===W(n).position)?e:n||function(t){var e=/firefox/i.test(D());if(/Trident/i.test(D())&&_(t)&&"fixed"===W(t).position)return null;var n=U(t);for(k(n)&&(n=n.host);_(n)&&["html","body"].indexOf(O(n))<0;){var o=W(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||e&&"filter"===o.willChange||e&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(t)||e}function K(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function z(t,e,n){return q(t,j(e,n))}function X(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Z(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}const G={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,l=t.name,c=t.options,u=n.elements.arrow,d=n.modifiersData.popperOffsets,p=B(n.placement),h=K(p),f=[s,r].indexOf(p)>=0?"height":"width";if(u&&d){var v=function(t,e){return X("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Z(t,a))}(c.padding,n),m=M(u),y="y"===h?o:s,g="y"===h?i:r,w=n.rects.reference[f]+n.rects.reference[h]-d[h]-n.rects.popper[f],b=d[h]-n.rects.reference[h],C=J(u),S=C?"y"===h?C.clientHeight||0:C.clientWidth||0:0,I=w/2-b/2,T=v[y],x=S-m[f]-v[g],E=S/2-m[f]/2+I,O=z(T,E,x),L=h;n.modifiersData[l]=((e={})[L]=O,e.centerOffset=O-E,e)}},effect:function(t){var e=t.state,n=t.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!=typeof o||(o=e.elements.popper.querySelector(o)))&&R(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Q(t){return t.split("-")[1]}var tt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function et(t){var e,n=t.popper,l=t.popperRect,a=t.placement,c=t.variation,d=t.offsets,p=t.position,h=t.gpuAcceleration,f=t.adaptive,v=t.roundOffsets,m=t.isFixed,y=d.x,g=void 0===y?0:y,w=d.y,b=void 0===w?0:w,C="function"==typeof v?v({x:g,y:b}):{x:g,y:b};g=C.x,b=C.y;var S=d.hasOwnProperty("x"),I=d.hasOwnProperty("y"),T=s,x=o,E=window;if(f){var O=J(n),A="clientHeight",_="clientWidth";if(O===L(n)&&"static"!==W(O=F(n)).position&&"absolute"===p&&(A="scrollHeight",_="scrollWidth"),a===o||(a===s||a===r)&&c===u)x=i,b-=(m&&O===E&&E.visualViewport?E.visualViewport.height:O[A])-l.height,b*=h?1:-1;if(a===s||(a===o||a===i)&&c===u)T=r,g-=(m&&O===E&&E.visualViewport?E.visualViewport.width:O[_])-l.width,g*=h?1:-1}var k,P=Object.assign({position:p},f&&tt),B=!0===v?function(t,e){var n=t.x,o=t.y,i=e.devicePixelRatio||1;return{x:N(n*i)/i||0,y:N(o*i)/i||0}}({x:g,y:b},L(n)):{x:g,y:b};return g=B.x,b=B.y,h?Object.assign({},P,((k={})[x]=I?"0":"",k[T]=S?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",k)):Object.assign({},P,((e={})[x]=I?b+"px":"",e[T]=S?g+"px":"",e.transform="",e))}const nt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,o=n.gpuAcceleration,i=void 0===o||o,r=n.adaptive,s=void 0===r||r,l=n.roundOffsets,a=void 0===l||l,c={placement:B(e.placement),variation:Q(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,et(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,et(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var ot={passive:!0};const it={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,o=t.options,i=o.scroll,r=void 0===i||i,s=o.resize,l=void 0===s||s,a=L(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&c.forEach((function(t){t.addEventListener("scroll",n.update,ot)})),l&&a.addEventListener("resize",n.update,ot),function(){r&&c.forEach((function(t){t.removeEventListener("scroll",n.update,ot)})),l&&a.removeEventListener("resize",n.update,ot)}},data:{}};var rt={left:"right",right:"left",bottom:"top",top:"bottom"};function st(t){return t.replace(/left|right|bottom|top/g,(function(t){return rt[t]}))}var lt={start:"end",end:"start"};function at(t){return t.replace(/start|end/g,(function(t){return lt[t]}))}function ct(t){var e=L(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ut(t){return H(F(t)).left+ct(t).scrollLeft}function dt(t){var e=W(t),n=e.overflow,o=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+o)}function pt(t){return["html","body","#document"].indexOf(O(t))>=0?t.ownerDocument.body:_(t)&&dt(t)?t:pt(U(t))}function ht(t,e){var n;void 0===e&&(e=[]);var o=pt(t),i=o===(null==(n=t.ownerDocument)?void 0:n.body),r=L(o),s=i?[r].concat(r.visualViewport||[],dt(o)?o:[]):o,l=e.concat(s);return i?l:l.concat(ht(U(s)))}function ft(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function vt(t,e,n){return e===p?ft(function(t,e){var n=L(t),o=F(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;var c=$();(c||!c&&"fixed"===e)&&(l=i.offsetLeft,a=i.offsetTop)}return{width:r,height:s,x:l+ut(t),y:a}}(t,n)):A(e)?function(t,e){var n=H(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(e,n):ft(function(t){var e,n=F(t),o=ct(t),i=null==(e=t.ownerDocument)?void 0:e.body,r=q(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=q(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-o.scrollLeft+ut(t),a=-o.scrollTop;return"rtl"===W(i||n).direction&&(l+=q(n.clientWidth,i?i.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}(F(t)))}function mt(t,e,n,o){var i="clippingParents"===e?function(t){var e=ht(U(t)),n=["absolute","fixed"].indexOf(W(t).position)>=0&&_(t)?J(t):t;return A(n)?e.filter((function(t){return A(t)&&R(t,n)&&"body"!==O(t)})):[]}(t):[].concat(e),r=[].concat(i,[n]),s=r[0],l=r.reduce((function(e,n){var i=vt(t,n,o);return e.top=q(i.top,e.top),e.right=j(i.right,e.right),e.bottom=j(i.bottom,e.bottom),e.left=q(i.left,e.left),e}),vt(t,s,o));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function yt(t){var e,n=t.reference,l=t.element,a=t.placement,d=a?B(a):null,p=a?Q(a):null,h=n.x+n.width/2-l.width/2,f=n.y+n.height/2-l.height/2;switch(d){case o:e={x:h,y:n.y-l.height};break;case i:e={x:h,y:n.y+n.height};break;case r:e={x:n.x+n.width,y:f};break;case s:e={x:n.x-l.width,y:f};break;default:e={x:n.x,y:n.y}}var v=d?K(d):null;if(null!=v){var m="y"===v?"height":"width";switch(p){case c:e[v]=e[v]-(n[m]/2-l[m]/2);break;case u:e[v]=e[v]+(n[m]/2-l[m]/2)}}return e}function gt(t,e){void 0===e&&(e={});var n=e,s=n.placement,l=void 0===s?t.placement:s,c=n.strategy,u=void 0===c?t.strategy:c,v=n.boundary,m=void 0===v?d:v,y=n.rootBoundary,g=void 0===y?p:y,w=n.elementContext,b=void 0===w?h:w,C=n.altBoundary,S=void 0!==C&&C,I=n.padding,T=void 0===I?0:I,x=X("number"!=typeof T?T:Z(T,a)),E=b===h?f:h,O=t.rects.popper,L=t.elements[S?E:b],_=mt(A(L)?L:L.contextElement||F(t.elements.popper),m,g,u),k=H(t.elements.reference),P=yt({reference:k,element:O,strategy:"absolute",placement:l}),B=ft(Object.assign({},O,P)),q=b===h?B:k,j={top:_.top-q.top+x.top,bottom:q.bottom-_.bottom+x.bottom,left:_.left-q.left+x.left,right:q.right-_.right+x.right},N=t.modifiersData.offset;if(b===h&&N){var D=N[l];Object.keys(j).forEach((function(t){var e=[r,i].indexOf(t)>=0?1:-1,n=[o,i].indexOf(t)>=0?"y":"x";j[t]+=D[n]*e}))}return j}const wt={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,u=t.name;if(!e.modifiersData[u]._skip){for(var d=n.mainAxis,p=void 0===d||d,h=n.altAxis,f=void 0===h||h,y=n.fallbackPlacements,g=n.padding,w=n.boundary,b=n.rootBoundary,C=n.altBoundary,S=n.flipVariations,I=void 0===S||S,T=n.allowedAutoPlacements,x=e.options.placement,E=B(x),O=y||(E===x||!I?[st(x)]:function(t){if(B(t)===l)return[];var e=st(t);return[at(t),e,at(e)]}(x)),L=[x].concat(O).reduce((function(t,n){return t.concat(B(n)===l?function(t,e){void 0===e&&(e={});var n=e,o=n.placement,i=n.boundary,r=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=void 0===c?m:c,d=Q(o),p=d?l?v:v.filter((function(t){return Q(t)===d})):a,h=p.filter((function(t){return u.indexOf(t)>=0}));0===h.length&&(h=p);var f=h.reduce((function(e,n){return e[n]=gt(t,{placement:n,boundary:i,rootBoundary:r,padding:s})[B(n)],e}),{});return Object.keys(f).sort((function(t,e){return f[t]-f[e]}))}(e,{placement:n,boundary:w,rootBoundary:b,padding:g,flipVariations:I,allowedAutoPlacements:T}):n)}),[]),A=e.rects.reference,_=e.rects.popper,k=new Map,P=!0,q=L[0],j=0;j=0,M=H?"width":"height",R=gt(e,{placement:N,boundary:w,rootBoundary:b,altBoundary:C,padding:g}),W=H?$?r:s:$?i:o;A[M]>_[M]&&(W=st(W));var V=st(W),F=[];if(p&&F.push(R[D]<=0),f&&F.push(R[W]<=0,R[V]<=0),F.every((function(t){return t}))){q=N,P=!1;break}k.set(N,F)}if(P)for(var U=function(t){var e=L.find((function(e){var n=k.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return q=e,"break"},Y=I?3:1;Y>0;Y--){if("break"===U(Y))break}e.placement!==q&&(e.modifiersData[u]._skip=!0,e.placement=q,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function bt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Ct(t){return[o,r,i,s].some((function(e){return t[e]>=0}))}const St={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,o=e.rects.reference,i=e.rects.popper,r=e.modifiersData.preventOverflow,s=gt(e,{elementContext:"reference"}),l=gt(e,{altBoundary:!0}),a=bt(s,o),c=bt(l,i,r),u=Ct(a),d=Ct(c);e.modifiersData[n]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};const It={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,i=t.name,l=n.offset,a=void 0===l?[0,0]:l,c=m.reduce((function(t,n){return t[n]=function(t,e,n){var i=B(t),l=[s,o].indexOf(i)>=0?-1:1,a="function"==typeof n?n(Object.assign({},e,{placement:t})):n,c=a[0],u=a[1];return c=c||0,u=(u||0)*l,[s,r].indexOf(i)>=0?{x:u,y:c}:{x:c,y:u}}(n,e.rects,a),t}),{}),u=c[e.placement],d=u.x,p=u.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=d,e.modifiersData.popperOffsets.y+=p),e.modifiersData[i]=c}};const Tt={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=yt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}};const xt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,l=t.name,a=n.mainAxis,u=void 0===a||a,d=n.altAxis,p=void 0!==d&&d,h=n.boundary,f=n.rootBoundary,v=n.altBoundary,m=n.padding,y=n.tether,g=void 0===y||y,w=n.tetherOffset,b=void 0===w?0:w,C=gt(e,{boundary:h,rootBoundary:f,padding:m,altBoundary:v}),S=B(e.placement),I=Q(e.placement),T=!I,x=K(S),E="x"===x?"y":"x",O=e.modifiersData.popperOffsets,L=e.rects.reference,A=e.rects.popper,_="function"==typeof b?b(Object.assign({},e.rects,{placement:e.placement})):b,k="number"==typeof _?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,N={x:0,y:0};if(O){if(u){var D,$="y"===x?o:s,H="y"===x?i:r,R="y"===x?"height":"width",W=O[x],V=W+C[$],F=W-C[H],U=g?-A[R]/2:0,Y=I===c?L[R]:A[R],X=I===c?-A[R]:-L[R],Z=e.elements.arrow,G=g&&Z?M(Z):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[$],nt=tt[H],ot=z(0,L[R],G[R]),it=T?L[R]/2-U-ot-et-k.mainAxis:Y-ot-et-k.mainAxis,rt=T?-L[R]/2+U+ot+nt+k.mainAxis:X+ot+nt+k.mainAxis,st=e.elements.arrow&&J(e.elements.arrow),lt=st?"y"===x?st.clientTop||0:st.clientLeft||0:0,at=null!=(D=null==P?void 0:P[x])?D:0,ct=W+rt-at,ut=z(g?j(V,W+it-at-lt):V,W,g?q(F,ct):F);O[x]=ut,N[x]=ut-W}if(p){var dt,pt="x"===x?o:s,ht="x"===x?i:r,ft=O[E],vt="y"===E?"height":"width",mt=ft+C[pt],yt=ft-C[ht],wt=-1!==[o,s].indexOf(S),bt=null!=(dt=null==P?void 0:P[E])?dt:0,Ct=wt?mt:ft-L[vt]-A[vt]-bt+k.altAxis,St=wt?ft+L[vt]+A[vt]-bt-k.altAxis:yt,It=g&&wt?function(t,e,n){var o=z(t,e,n);return o>n?n:o}(Ct,ft,St):z(g?Ct:mt,ft,g?St:yt);O[E]=It,N[E]=It-ft}e.modifiersData[l]=N}},requiresIfExists:["offset"]};function Et(t,e,n){void 0===n&&(n=!1);var o,i,r=_(e),s=_(e)&&function(t){var e=t.getBoundingClientRect(),n=N(e.width)/t.offsetWidth||1,o=N(e.height)/t.offsetHeight||1;return 1!==n||1!==o}(e),l=F(e),a=H(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==O(e)||dt(l))&&(c=(o=e)!==L(o)&&_(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:ct(o)),_(e)?((u=H(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):l&&(u.x=ut(l))),{x:a.left+c.scrollLeft-u.x,y:a.top+c.scrollTop-u.y,width:a.width,height:a.height}}function Ot(t){var e=new Map,n=new Set,o=[];function i(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var o=e.get(t);o&&i(o)}})),o.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||i(t)})),o}var Lt={placement:"bottom",modifiers:[],strategy:"absolute"};function At(){for(var t=arguments.length,e=new Array(t),n=0;n{Object.defineProperty(e,"__esModule",{value:!0}),e.COMBO_BOX_ACCESSIBILITY_KEY_SET=e.SELECT_ACCESSIBILITY_KEY_SET=e.TABS_ACCESSIBILITY_KEY_SET=e.OVERLAY_ACCESSIBILITY_KEY_SET=e.DROPDOWN_ACCESSIBILITY_KEY_SET=e.POSITIONS=void 0,e.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},e.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],e.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],e.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],e.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],e.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"]},460:function(t,e,n){ +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={492:(t,e,n)=>{n.r(e),n.d(e,{afterMain:()=>S,afterRead:()=>w,afterWrite:()=>T,applyStyles:()=>P,arrow:()=>Q,auto:()=>l,basePlacements:()=>a,beforeMain:()=>b,beforeRead:()=>y,beforeWrite:()=>x,bottom:()=>i,clippingParents:()=>d,computeStyles:()=>nt,createPopper:()=>Pt,createPopperBase:()=>_t,createPopperLite:()=>Bt,detectOverflow:()=>gt,end:()=>u,eventListeners:()=>it,flip:()=>wt,hide:()=>St,left:()=>s,main:()=>C,modifierPhases:()=>E,offset:()=>xt,placements:()=>v,popper:()=>h,popperGenerator:()=>kt,popperOffsets:()=>It,preventOverflow:()=>Tt,read:()=>g,reference:()=>f,right:()=>r,start:()=>c,top:()=>o,variationPlacements:()=>m,viewport:()=>p,write:()=>I});var o="top",i="bottom",r="right",s="left",l="auto",a=[o,i,r,s],c="start",u="end",d="clippingParents",p="viewport",h="popper",f="reference",m=a.reduce((function(t,e){return t.concat([e+"-"+c,e+"-"+u])}),[]),v=[].concat(a,[l]).reduce((function(t,e){return t.concat([e,e+"-"+c,e+"-"+u])}),[]),y="beforeRead",g="read",w="afterRead",b="beforeMain",C="main",S="afterMain",x="beforeWrite",I="write",T="afterWrite",E=[y,g,w,b,C,S,x,I,T];function O(t){return t?(t.nodeName||"").toLowerCase():null}function L(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function A(t){return t instanceof L(t).Element||t instanceof Element}function k(t){return t instanceof L(t).HTMLElement||t instanceof HTMLElement}function _(t){return"undefined"!=typeof ShadowRoot&&(t instanceof L(t).ShadowRoot||t instanceof ShadowRoot)}const P={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},o=e.attributes[t]||{},i=e.elements[t];k(i)&&O(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(t){var e=o[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var o=e.elements[t],i=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});k(o)&&O(o)&&(Object.assign(o.style,r),Object.keys(i).forEach((function(t){o.removeAttribute(t)})))}))}},requires:["computeStyles"]};function B(t){return t.split("-")[0]}var q=Math.max,N=Math.min,j=Math.round;function $(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function D(){return!/^((?!chrome|android).)*safari/i.test($())}function H(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var o=t.getBoundingClientRect(),i=1,r=1;e&&k(t)&&(i=t.offsetWidth>0&&j(o.width)/t.offsetWidth||1,r=t.offsetHeight>0&&j(o.height)/t.offsetHeight||1);var s=(A(t)?L(t):window).visualViewport,l=!D()&&n,a=(o.left+(l&&s?s.offsetLeft:0))/i,c=(o.top+(l&&s?s.offsetTop:0))/r,u=o.width/i,d=o.height/r;return{width:u,height:d,top:c,right:a+u,bottom:c+d,left:a,x:a,y:c}}function M(t){var e=H(t),n=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:o}}function R(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&_(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function W(t){return L(t).getComputedStyle(t)}function V(t){return["table","td","th"].indexOf(O(t))>=0}function F(t){return((A(t)?t.ownerDocument:t.document)||window.document).documentElement}function U(t){return"html"===O(t)?t:t.assignedSlot||t.parentNode||(_(t)?t.host:null)||F(t)}function J(t){return k(t)&&"fixed"!==W(t).position?t.offsetParent:null}function Y(t){for(var e=L(t),n=J(t);n&&V(n)&&"static"===W(n).position;)n=J(n);return n&&("html"===O(n)||"body"===O(n)&&"static"===W(n).position)?e:n||function(t){var e=/firefox/i.test($());if(/Trident/i.test($())&&k(t)&&"fixed"===W(t).position)return null;var n=U(t);for(_(n)&&(n=n.host);k(n)&&["html","body"].indexOf(O(n))<0;){var o=W(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||e&&"filter"===o.willChange||e&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(t)||e}function K(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function G(t,e,n){return q(t,N(e,n))}function z(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function X(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}const Q={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,l=t.name,c=t.options,u=n.elements.arrow,d=n.modifiersData.popperOffsets,p=B(n.placement),h=K(p),f=[s,r].indexOf(p)>=0?"height":"width";if(u&&d){var m=function(t,e){return z("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:X(t,a))}(c.padding,n),v=M(u),y="y"===h?o:s,g="y"===h?i:r,w=n.rects.reference[f]+n.rects.reference[h]-d[h]-n.rects.popper[f],b=d[h]-n.rects.reference[h],C=Y(u),S=C?"y"===h?C.clientHeight||0:C.clientWidth||0:0,x=w/2-b/2,I=m[y],T=S-v[f]-m[g],E=S/2-v[f]/2+x,O=G(I,E,T),L=h;n.modifiersData[l]=((e={})[L]=O,e.centerOffset=O-E,e)}},effect:function(t){var e=t.state,n=t.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!=typeof o||(o=e.elements.popper.querySelector(o)))&&R(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Z(t){return t.split("-")[1]}var tt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function et(t){var e,n=t.popper,l=t.popperRect,a=t.placement,c=t.variation,d=t.offsets,p=t.position,h=t.gpuAcceleration,f=t.adaptive,m=t.roundOffsets,v=t.isFixed,y=d.x,g=void 0===y?0:y,w=d.y,b=void 0===w?0:w,C="function"==typeof m?m({x:g,y:b}):{x:g,y:b};g=C.x,b=C.y;var S=d.hasOwnProperty("x"),x=d.hasOwnProperty("y"),I=s,T=o,E=window;if(f){var O=Y(n),A="clientHeight",k="clientWidth";if(O===L(n)&&"static"!==W(O=F(n)).position&&"absolute"===p&&(A="scrollHeight",k="scrollWidth"),a===o||(a===s||a===r)&&c===u)T=i,b-=(v&&O===E&&E.visualViewport?E.visualViewport.height:O[A])-l.height,b*=h?1:-1;if(a===s||(a===o||a===i)&&c===u)I=r,g-=(v&&O===E&&E.visualViewport?E.visualViewport.width:O[k])-l.width,g*=h?1:-1}var _,P=Object.assign({position:p},f&&tt),B=!0===m?function(t,e){var n=t.x,o=t.y,i=e.devicePixelRatio||1;return{x:j(n*i)/i||0,y:j(o*i)/i||0}}({x:g,y:b},L(n)):{x:g,y:b};return g=B.x,b=B.y,h?Object.assign({},P,((_={})[T]=x?"0":"",_[I]=S?"0":"",_.transform=(E.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",_)):Object.assign({},P,((e={})[T]=x?b+"px":"",e[I]=S?g+"px":"",e.transform="",e))}const nt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,o=n.gpuAcceleration,i=void 0===o||o,r=n.adaptive,s=void 0===r||r,l=n.roundOffsets,a=void 0===l||l,c={placement:B(e.placement),variation:Z(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,et(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,et(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var ot={passive:!0};const it={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,o=t.options,i=o.scroll,r=void 0===i||i,s=o.resize,l=void 0===s||s,a=L(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&c.forEach((function(t){t.addEventListener("scroll",n.update,ot)})),l&&a.addEventListener("resize",n.update,ot),function(){r&&c.forEach((function(t){t.removeEventListener("scroll",n.update,ot)})),l&&a.removeEventListener("resize",n.update,ot)}},data:{}};var rt={left:"right",right:"left",bottom:"top",top:"bottom"};function st(t){return t.replace(/left|right|bottom|top/g,(function(t){return rt[t]}))}var lt={start:"end",end:"start"};function at(t){return t.replace(/start|end/g,(function(t){return lt[t]}))}function ct(t){var e=L(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ut(t){return H(F(t)).left+ct(t).scrollLeft}function dt(t){var e=W(t),n=e.overflow,o=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+o)}function pt(t){return["html","body","#document"].indexOf(O(t))>=0?t.ownerDocument.body:k(t)&&dt(t)?t:pt(U(t))}function ht(t,e){var n;void 0===e&&(e=[]);var o=pt(t),i=o===(null==(n=t.ownerDocument)?void 0:n.body),r=L(o),s=i?[r].concat(r.visualViewport||[],dt(o)?o:[]):o,l=e.concat(s);return i?l:l.concat(ht(U(s)))}function ft(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mt(t,e,n){return e===p?ft(function(t,e){var n=L(t),o=F(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;var c=D();(c||!c&&"fixed"===e)&&(l=i.offsetLeft,a=i.offsetTop)}return{width:r,height:s,x:l+ut(t),y:a}}(t,n)):A(e)?function(t,e){var n=H(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(e,n):ft(function(t){var e,n=F(t),o=ct(t),i=null==(e=t.ownerDocument)?void 0:e.body,r=q(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=q(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-o.scrollLeft+ut(t),a=-o.scrollTop;return"rtl"===W(i||n).direction&&(l+=q(n.clientWidth,i?i.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}(F(t)))}function vt(t,e,n,o){var i="clippingParents"===e?function(t){var e=ht(U(t)),n=["absolute","fixed"].indexOf(W(t).position)>=0&&k(t)?Y(t):t;return A(n)?e.filter((function(t){return A(t)&&R(t,n)&&"body"!==O(t)})):[]}(t):[].concat(e),r=[].concat(i,[n]),s=r[0],l=r.reduce((function(e,n){var i=mt(t,n,o);return e.top=q(i.top,e.top),e.right=N(i.right,e.right),e.bottom=N(i.bottom,e.bottom),e.left=q(i.left,e.left),e}),mt(t,s,o));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function yt(t){var e,n=t.reference,l=t.element,a=t.placement,d=a?B(a):null,p=a?Z(a):null,h=n.x+n.width/2-l.width/2,f=n.y+n.height/2-l.height/2;switch(d){case o:e={x:h,y:n.y-l.height};break;case i:e={x:h,y:n.y+n.height};break;case r:e={x:n.x+n.width,y:f};break;case s:e={x:n.x-l.width,y:f};break;default:e={x:n.x,y:n.y}}var m=d?K(d):null;if(null!=m){var v="y"===m?"height":"width";switch(p){case c:e[m]=e[m]-(n[v]/2-l[v]/2);break;case u:e[m]=e[m]+(n[v]/2-l[v]/2)}}return e}function gt(t,e){void 0===e&&(e={});var n=e,s=n.placement,l=void 0===s?t.placement:s,c=n.strategy,u=void 0===c?t.strategy:c,m=n.boundary,v=void 0===m?d:m,y=n.rootBoundary,g=void 0===y?p:y,w=n.elementContext,b=void 0===w?h:w,C=n.altBoundary,S=void 0!==C&&C,x=n.padding,I=void 0===x?0:x,T=z("number"!=typeof I?I:X(I,a)),E=b===h?f:h,O=t.rects.popper,L=t.elements[S?E:b],k=vt(A(L)?L:L.contextElement||F(t.elements.popper),v,g,u),_=H(t.elements.reference),P=yt({reference:_,element:O,strategy:"absolute",placement:l}),B=ft(Object.assign({},O,P)),q=b===h?B:_,N={top:k.top-q.top+T.top,bottom:q.bottom-k.bottom+T.bottom,left:k.left-q.left+T.left,right:q.right-k.right+T.right},j=t.modifiersData.offset;if(b===h&&j){var $=j[l];Object.keys(N).forEach((function(t){var e=[r,i].indexOf(t)>=0?1:-1,n=[o,i].indexOf(t)>=0?"y":"x";N[t]+=$[n]*e}))}return N}const wt={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,u=t.name;if(!e.modifiersData[u]._skip){for(var d=n.mainAxis,p=void 0===d||d,h=n.altAxis,f=void 0===h||h,y=n.fallbackPlacements,g=n.padding,w=n.boundary,b=n.rootBoundary,C=n.altBoundary,S=n.flipVariations,x=void 0===S||S,I=n.allowedAutoPlacements,T=e.options.placement,E=B(T),O=y||(E===T||!x?[st(T)]:function(t){if(B(t)===l)return[];var e=st(t);return[at(t),e,at(e)]}(T)),L=[T].concat(O).reduce((function(t,n){return t.concat(B(n)===l?function(t,e){void 0===e&&(e={});var n=e,o=n.placement,i=n.boundary,r=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=void 0===c?v:c,d=Z(o),p=d?l?m:m.filter((function(t){return Z(t)===d})):a,h=p.filter((function(t){return u.indexOf(t)>=0}));0===h.length&&(h=p);var f=h.reduce((function(e,n){return e[n]=gt(t,{placement:n,boundary:i,rootBoundary:r,padding:s})[B(n)],e}),{});return Object.keys(f).sort((function(t,e){return f[t]-f[e]}))}(e,{placement:n,boundary:w,rootBoundary:b,padding:g,flipVariations:x,allowedAutoPlacements:I}):n)}),[]),A=e.rects.reference,k=e.rects.popper,_=new Map,P=!0,q=L[0],N=0;N=0,M=H?"width":"height",R=gt(e,{placement:j,boundary:w,rootBoundary:b,altBoundary:C,padding:g}),W=H?D?r:s:D?i:o;A[M]>k[M]&&(W=st(W));var V=st(W),F=[];if(p&&F.push(R[$]<=0),f&&F.push(R[W]<=0,R[V]<=0),F.every((function(t){return t}))){q=j,P=!1;break}_.set(j,F)}if(P)for(var U=function(t){var e=L.find((function(e){var n=_.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return q=e,"break"},J=x?3:1;J>0;J--){if("break"===U(J))break}e.placement!==q&&(e.modifiersData[u]._skip=!0,e.placement=q,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function bt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Ct(t){return[o,r,i,s].some((function(e){return t[e]>=0}))}const St={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,o=e.rects.reference,i=e.rects.popper,r=e.modifiersData.preventOverflow,s=gt(e,{elementContext:"reference"}),l=gt(e,{altBoundary:!0}),a=bt(s,o),c=bt(l,i,r),u=Ct(a),d=Ct(c);e.modifiersData[n]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};const xt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,i=t.name,l=n.offset,a=void 0===l?[0,0]:l,c=v.reduce((function(t,n){return t[n]=function(t,e,n){var i=B(t),l=[s,o].indexOf(i)>=0?-1:1,a="function"==typeof n?n(Object.assign({},e,{placement:t})):n,c=a[0],u=a[1];return c=c||0,u=(u||0)*l,[s,r].indexOf(i)>=0?{x:u,y:c}:{x:c,y:u}}(n,e.rects,a),t}),{}),u=c[e.placement],d=u.x,p=u.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=d,e.modifiersData.popperOffsets.y+=p),e.modifiersData[i]=c}};const It={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=yt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}};const Tt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,l=t.name,a=n.mainAxis,u=void 0===a||a,d=n.altAxis,p=void 0!==d&&d,h=n.boundary,f=n.rootBoundary,m=n.altBoundary,v=n.padding,y=n.tether,g=void 0===y||y,w=n.tetherOffset,b=void 0===w?0:w,C=gt(e,{boundary:h,rootBoundary:f,padding:v,altBoundary:m}),S=B(e.placement),x=Z(e.placement),I=!x,T=K(S),E="x"===T?"y":"x",O=e.modifiersData.popperOffsets,L=e.rects.reference,A=e.rects.popper,k="function"==typeof b?b(Object.assign({},e.rects,{placement:e.placement})):b,_="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,j={x:0,y:0};if(O){if(u){var $,D="y"===T?o:s,H="y"===T?i:r,R="y"===T?"height":"width",W=O[T],V=W+C[D],F=W-C[H],U=g?-A[R]/2:0,J=x===c?L[R]:A[R],z=x===c?-A[R]:-L[R],X=e.elements.arrow,Q=g&&X?M(X):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[D],nt=tt[H],ot=G(0,L[R],Q[R]),it=I?L[R]/2-U-ot-et-_.mainAxis:J-ot-et-_.mainAxis,rt=I?-L[R]/2+U+ot+nt+_.mainAxis:z+ot+nt+_.mainAxis,st=e.elements.arrow&&Y(e.elements.arrow),lt=st?"y"===T?st.clientTop||0:st.clientLeft||0:0,at=null!=($=null==P?void 0:P[T])?$:0,ct=W+rt-at,ut=G(g?N(V,W+it-at-lt):V,W,g?q(F,ct):F);O[T]=ut,j[T]=ut-W}if(p){var dt,pt="x"===T?o:s,ht="x"===T?i:r,ft=O[E],mt="y"===E?"height":"width",vt=ft+C[pt],yt=ft-C[ht],wt=-1!==[o,s].indexOf(S),bt=null!=(dt=null==P?void 0:P[E])?dt:0,Ct=wt?vt:ft-L[mt]-A[mt]-bt+_.altAxis,St=wt?ft+L[mt]+A[mt]-bt-_.altAxis:yt,xt=g&&wt?function(t,e,n){var o=G(t,e,n);return o>n?n:o}(Ct,ft,St):G(g?Ct:vt,ft,g?St:yt);O[E]=xt,j[E]=xt-ft}e.modifiersData[l]=j}},requiresIfExists:["offset"]};function Et(t,e,n){void 0===n&&(n=!1);var o,i,r=k(e),s=k(e)&&function(t){var e=t.getBoundingClientRect(),n=j(e.width)/t.offsetWidth||1,o=j(e.height)/t.offsetHeight||1;return 1!==n||1!==o}(e),l=F(e),a=H(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==O(e)||dt(l))&&(c=(o=e)!==L(o)&&k(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:ct(o)),k(e)?((u=H(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):l&&(u.x=ut(l))),{x:a.left+c.scrollLeft-u.x,y:a.top+c.scrollTop-u.y,width:a.width,height:a.height}}function Ot(t){var e=new Map,n=new Set,o=[];function i(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var o=e.get(t);o&&i(o)}})),o.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||i(t)})),o}var Lt={placement:"bottom",modifiers:[],strategy:"absolute"};function At(){for(var t=arguments.length,e=new Array(t),n=0;n{Object.defineProperty(e,"__esModule",{value:!0}),e.BREAKPOINTS=e.COMBO_BOX_ACCESSIBILITY_KEY_SET=e.SELECT_ACCESSIBILITY_KEY_SET=e.TABS_ACCESSIBILITY_KEY_SET=e.OVERLAY_ACCESSIBILITY_KEY_SET=e.DROPDOWN_ACCESSIBILITY_KEY_SET=e.POSITIONS=void 0,e.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},e.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],e.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],e.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],e.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],e.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],e.BREAKPOINTS={sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},460:function(t,e,n){ /* * HSAccordion - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,7 +9,7 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(969),s=function(t){function e(e,n,o){var i=t.call(this,e,n,o)||this;return i.toggle=i.el.querySelector(".hs-accordion-toggle")||null,i.content=i.el.querySelector(".hs-accordion-content")||null,i.group=i.el.closest(".hs-accordion-group")||null,i.isAlwaysOpened=i.group.hasAttribute("data-hs-accordion-always-open")||!1,i.toggle&&i.content&&i.init(),i}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsAccordionCollection,this),this.toggle.addEventListener("click",(function(){t.el.classList.contains("active")?t.hide():t.show()}))},e.prototype.show=function(){var t=this;this.group&&!this.isAlwaysOpened&&this.group.querySelector(".hs-accordion.active")&&this.group.querySelector(".hs-accordion.active")!==this.el&&window.$hsAccordionCollection.find((function(e){return e.element.el===t.group.querySelector(".hs-accordion.active")})).element.hide();if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),this.content.style.display="block",this.content.style.height="0",setTimeout((function(){t.content.style.height="".concat(t.content.scrollHeight,"px")})),(0,r.afterTransition)(this.content,(function(){t.content.style.display="block",t.content.style.height="",t.fireEvent("open",t.el),(0,r.dispatch)("open.hs.accordion",t.el,t.el)}))},e.prototype.hide=function(){var t=this;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){t.content.style.height="0"})),(0,r.afterTransition)(this.content,(function(){t.content.style.display="",t.content.style.height="0",t.fireEvent("close",t.el),(0,r.dispatch)("close.hs.accordion",t.el,t.el)}))},e.getInstance=function(t,e){var n=window.$hsAccordionCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.show=function(t){var e=window.$hsAccordionCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&"block"!==e.element.content.style.display&&e.element.show()},e.hide=function(t){var e=window.$hsAccordionCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&"block"===e.element.content.style.display&&e.element.hide()},e.autoInit=function(){window.$hsAccordionCollection||(window.$hsAccordionCollection=[]),document.querySelectorAll(".hs-accordion:not(.--prevent-on-load-init)").forEach((function(t){window.$hsAccordionCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e.on=function(t,e,n){var o=window.$hsAccordionCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));o&&(o.element.events[t]=n)},e}(n(737).default);window.addEventListener("load",(function(){s.autoInit()})),"undefined"!=typeof window&&(window.HSAccordion=s),e.default=s},737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -17,7 +17,7 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},629:function(t,e,n){ /* * HSCarousel - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -25,15 +25,23 @@ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n *")||null,l.sliderWidth=l.inner.parentElement.clientWidth,l.touchX={start:0,end:0},l.init(),l}return i(e,t),e.prototype.init=function(){var t,e,n=this;this.createCollection(window.$hsCarouselCollection,this),this.inner&&(this.calculateWidth(),this.loadingClassesRemove&&("string"==typeof this.loadingClassesRemove?this.inner.classList.remove(this.loadingClassesRemove):(t=this.inner.classList).remove.apply(t,this.loadingClassesRemove)),this.loadingClassesAdd&&("string"==typeof this.loadingClassesAdd?this.inner.classList.add(this.loadingClassesAdd):(e=this.inner.classList).add.apply(e,this.loadingClassesAdd))),this.prev&&this.prev.addEventListener("click",(function(){n.goToPrev(),n.isAutoPlay&&(n.resetTimer(),n.setTimer())})),this.next&&this.next.addEventListener("click",(function(){n.goToNext(),n.isAutoPlay&&(n.resetTimer(),n.setTimer())})),this.dots&&this.dots.forEach((function(t,e){return t.addEventListener("click",(function(){n.goTo(e),n.isAutoPlay&&(n.resetTimer(),n.setTimer())}))})),this.slides.length&&(this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass(),this.isAutoPlay&&this.autoPlay()),this.inner&&this.afterLoadingClassesAdd&&setTimeout((function(){var t;"string"==typeof n.afterLoadingClassesAdd?n.inner.classList.add(n.afterLoadingClassesAdd):(t=n.inner.classList).add.apply(t,n.afterLoadingClassesAdd)})),this.el.classList.add("init"),this.el.addEventListener("touchstart",(function(t){n.touchX.start=t.changedTouches[0].screenX})),this.el.addEventListener("touchend",(function(t){n.touchX.end=t.changedTouches[0].screenX,n.detectDirection()})),this.observeResize()},e.prototype.observeResize=function(){var t=this;new ResizeObserver((function(){return t.recalculateWidth()})).observe(document.querySelector("body"))},e.prototype.calculateWidth=function(){var t=this;this.inner.style.width="".concat(this.sliderWidth*this.slides.length,"px"),this.inner.style.transform="translate(-".concat(this.currentIndex*this.sliderWidth,"px, 0px)"),this.slides.forEach((function(e){e.style.width="".concat(t.sliderWidth,"px")}))},e.prototype.addCurrentClass=function(){var t=this;this.slides.forEach((function(e,n){n===t.currentIndex?e.classList.add("active"):e.classList.remove("active")})),this.dots&&this.dots.forEach((function(e,n){n===t.currentIndex?e.classList.add("active"):e.classList.remove("active")}))},e.prototype.addDisabledClass=function(){if(!this.prev||!this.next)return!1;0===this.currentIndex?(this.next.classList.remove("disabled"),this.prev.classList.add("disabled")):this.currentIndex===this.slides.length-1?(this.prev.classList.remove("disabled"),this.next.classList.add("disabled")):(this.prev.classList.remove("disabled"),this.next.classList.remove("disabled"))},e.prototype.autoPlay=function(){this.setTimer()},e.prototype.setTimer=function(){var t=this;this.timer=setInterval((function(){t.currentIndex===t.slides.length-1?t.goTo(0):t.goToNext()}),this.speed)},e.prototype.resetTimer=function(){clearInterval(this.timer)},e.prototype.detectDirection=function(){var t=this.touchX,e=t.start,n=t.end;ne&&this.goToPrev()},e.prototype.recalculateWidth=function(){this.sliderWidth=this.inner.parentElement.clientWidth,this.calculateWidth()},e.prototype.goToPrev=function(){0===this.currentIndex&&this.isInfiniteLoop?(this.currentIndex=this.slides.length-1,this.inner.style.transform="translate(-".concat(this.currentIndex*this.sliderWidth,"px, 0px)"),this.addCurrentClass()):0!==this.currentIndex&&(this.currentIndex-=1,this.inner.style.transform="translate(-".concat(this.currentIndex*this.sliderWidth,"px, 0px)"),this.addCurrentClass(),this.addDisabledClass())},e.prototype.goToNext=function(){this.currentIndex===this.slides.length-1&&this.isInfiniteLoop?(this.currentIndex=0,this.inner.style.transform="translate(-".concat(this.currentIndex*this.sliderWidth,"px, 0px)"),this.addCurrentClass()):this.currentIndex0&&i[i.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t',E.outputEmptyTemplate=null!==(h=null==A?void 0:A.outputEmptyTemplate)&&void 0!==h?h:'
Nothing found...
',E.outputLoaderTemplate=null!==(f=null==A?void 0:A.outputLoaderTemplate)&&void 0!==f?f:'
\n\t\t\t\t
\n\t\t\t\t\tLoading...\n\t\t\t\t
\n\t\t\t
',E.groupingType=null!==(m=null==A?void 0:A.groupingType)&&void 0!==m?m:null,E.groupingTitleTemplate=null!==(v=null==A?void 0:A.groupingTitleTemplate)&&void 0!==v?v:"default"===E.groupingType?'
':'',E.tabsWrapperTemplate=null!==(y=null==A?void 0:A.tabsWrapperTemplate)&&void 0!==y?y:'
',E.preventSelection=null!==(g=null==A?void 0:A.preventSelection)&&void 0!==g&&g,E.isOpenOnFocus=null!==(w=null==A?void 0:A.isOpenOnFocus)&&void 0!==w&&w,E.input=null!==(b=E.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==b?b:null,E.output=null!==(C=E.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==C?C:null,E.itemsWrapper=null!==(S=E.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==S?S:null,E.items=null!==(x=Array.from(E.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==x?x:[],E.tabs=[],E.toggle=null!==(I=E.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==I?I:null,E.outputPlaceholder=null,E.selected=E.value=null!==(T=E.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==T?T:"",E.isOpened=!1,E.isCurrent=!1,E.animationInProcess=!1,E.selectedGroup="all",E.init(),E}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsComboBoxCollection,this),this.build()},e.prototype.build=function(){this.buildInput(),this.groupingType&&this.setGroups(),this.buildItems(),this.preventVisibility&&(this.isOpened=!0,this.recalculateDirection()),this.toggle&&this.buildToggle()},e.prototype.setResultAndRender=function(t){void 0===t&&(t=""),this.setResults(t),this.apiSearchQuery&&this.itemsFromJson()},e.prototype.buildInput=function(){var t=this;this.isOpenOnFocus&&this.input.addEventListener("focus",(function(){t.isOpened||(t.setResultAndRender(),t.open())})),this.input.addEventListener("input",(0,c.debounce)((function(e){t.setResultAndRender(e.target.value),t.isOpened||t.open()})))},e.prototype.buildItems=function(){this.apiUrl?this.itemsFromJson():(this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="",this.itemsFromHtml())},e.prototype.setResults=function(t){this.value=t,this.resultItems(),this.hasVisibleItems()?this.destroyOutputPlaceholder():this.buildOutputPlaceholder()},e.prototype.isItemExists=function(t){return this.items.some((function(e){return Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(e){return e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]}))}))},e.prototype.isTextExists=function(t,e){var n=e.map((function(t){return t.toLowerCase()}));return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(t){return n.includes(t.getAttribute("data-hs-combo-box-search-text").toLowerCase())}))},e.prototype.isTextExistsAny=function(t,e){return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(t){return t.getAttribute("data-hs-combo-box-search-text").toLowerCase().includes(e.toLowerCase())}))},e.prototype.valuesBySelector=function(t){return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).reduce((function(t,e){return a(a([],t,!0),[e.getAttribute("data-hs-combo-box-search-text")],!1)}),[])},e.prototype.buildOutputLoader=function(){if(this.outputLoader)return!1;this.outputLoader=(0,c.htmlToElement)(this.outputLoaderTemplate),this.items.length||this.outputPlaceholder?(this.outputLoader.style.position="absolute",this.outputLoader.style.top="0",this.outputLoader.style.bottom="0",this.outputLoader.style.left="0",this.outputLoader.style.right="0",this.outputLoader.style.zIndex="2"):(this.outputLoader.style.position="",this.outputLoader.style.top="",this.outputLoader.style.bottom="",this.outputLoader.style.left="",this.outputLoader.style.right="",this.outputLoader.style.zIndex="",this.outputLoader.style.height="30px"),this.output.append(this.outputLoader)},e.prototype.destroyOutputLoader=function(){this.outputLoader&&this.outputLoader.remove(),this.outputLoader=null},e.prototype.itemsFromJson=function(){return s(this,void 0,void 0,(function(){var t,e,n,o,i,r=this;return l(this,(function(s){switch(s.label){case 0:this.buildOutputLoader(),s.label=1;case 1:return s.trys.push([1,4,,5]),t="".concat(this.apiQuery),e="".concat(this.apiSearchQuery,"=").concat(this.value.toLowerCase()),n=this.apiUrl,this.apiQuery&&this.apiSearchQuery?n+="?".concat(e,"&").concat(t):this.apiQuery?n+="?".concat(t):this.apiSearchQuery&&(n+="?".concat(e)),[4,fetch(n,this.apiHeaders)];case 2:return[4,s.sent().json()];case 3:return o=s.sent(),this.apiDataPart&&(o=o[this.apiDataPart]),this.apiSearchQuery&&(this.items=[]),this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="","tabs"===this.groupingType?(this.setApiGroups(o),this.groupTabsRender(),this.jsonItemsRender(o)):"default"===this.groupingType?(this.setApiGroups(o),this.groups.forEach((function(t){var e=(0,c.htmlToElement)(r.groupingTitleTemplate);e.setAttribute("data-hs-combo-box-group-title",t.name),e.classList.add("--exclude-accessibility"),e.innerText=t.title;var n=o.filter((function(e){return e[r.apiGroupField]===t.name}));r.itemsWrapper?r.itemsWrapper.append(e):r.output.append(e),r.jsonItemsRender(n)}))):this.jsonItemsRender(o),this.setResults(this.input.value),[3,5];case 4:return i=s.sent(),console.error(i),[3,5];case 5:return this.destroyOutputLoader(),[2]}}))}))},e.prototype.jsonItemsRender=function(t){var e=this;t.forEach((function(t,n){if(e.isItemExists(t))return!1;var o=(0,c.htmlToElement)(e.outputItemTemplate);o.querySelectorAll("[data-hs-combo-box-search-text]").forEach((function(e){var n,o;e.textContent=null!==(n=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==n?n:"",e.setAttribute("data-hs-combo-box-search-text",null!==(o=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==o?o:"")})),o.querySelectorAll("[data-hs-combo-box-output-item-attr]").forEach((function(e){JSON.parse(e.getAttribute("data-hs-combo-box-output-item-attr")).forEach((function(n){e.setAttribute(n.attr,t[n.valueFrom])}))})),o.setAttribute("tabIndex","".concat(n)),"tabs"!==e.groupingType&&"default"!==e.groupingType||o.setAttribute("data-hs-combo-box-output-item",'{"group": {"name": "'.concat(t[e.apiGroupField],'", "title": "').concat(t[e.apiGroupField],'"}}')),e.items=a(a([],e.items,!0),[o],!1),e.preventSelection||o.addEventListener("click",(function(){e.close(o.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text")),e.setSelectedByValue(e.valuesBySelector(o))})),e.appendItemsToWrapper(o)}))},e.prototype.setGroups=function(){var t=[];this.items.forEach((function(e){var n=JSON.parse(e.getAttribute("data-hs-combo-box-output-item")).group;t.some((function(t){return(null==t?void 0:t.name)===n.name}))||t.push(n)})),this.groups=t},e.prototype.setCurrent=function(){window.$hsComboBoxCollection.length&&(window.$hsComboBoxCollection.map((function(t){return t.element.isCurrent=!1})),this.isCurrent=!0)},e.prototype.setApiGroups=function(t){var e=this,n=[];t.forEach((function(t){var o=t[e.apiGroupField];n.some((function(t){return t.name===o}))||n.push({name:o,title:o})})),this.groups=n},e.prototype.sortItems=function(){return this.items.sort((function(t,e){var n=t.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text"),o=e.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text");return no?1:0}))},e.prototype.itemRender=function(t){var e=this,n=t.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text");this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t),this.preventSelection||t.addEventListener("click",(function(){e.close(n),e.setSelectedByValue(e.valuesBySelector(t))}))},e.prototype.plainRender=function(t){var e=this;t.forEach((function(t){e.itemRender(t)}))},e.prototype.groupTabsRender=function(){var t=this,e=(0,c.htmlToElement)(this.tabsWrapperTemplate),n=(0,c.htmlToElement)('
');e.append(n),this.output.insertBefore(e,this.output.firstChild);var o=(0,c.htmlToElement)(this.groupingTitleTemplate);o.setAttribute("data-hs-combo-box-group-title","all"),o.classList.add("--exclude-accessibility","active"),o.innerText="All",this.tabs=a(a([],this.tabs,!0),[o],!1),n.append(o),o.addEventListener("click",(function(){t.selectedGroup="all";var e=t.tabs.find((function(e){return e.getAttribute("data-hs-combo-box-group-title")===t.selectedGroup}));t.tabs.forEach((function(t){return t.classList.remove("active")})),e.classList.add("active"),t.setItemsVisibility()})),this.groups.forEach((function(e){var o=(0,c.htmlToElement)(t.groupingTitleTemplate);o.setAttribute("data-hs-combo-box-group-title",e.name),o.classList.add("--exclude-accessibility"),o.innerText=e.title,t.tabs=a(a([],t.tabs,!0),[o],!1),n.append(o),o.addEventListener("click",(function(){t.selectedGroup=e.name;var n=t.tabs.find((function(e){return e.getAttribute("data-hs-combo-box-group-title")===t.selectedGroup}));t.tabs.forEach((function(t){return t.classList.remove("active")})),n.classList.add("active"),t.setItemsVisibility()}))}))},e.prototype.groupDefaultRender=function(){var t=this;this.groups.forEach((function(e){var n=(0,c.htmlToElement)(t.groupingTitleTemplate);n.setAttribute("data-hs-combo-box-group-title",e.name),n.classList.add("--exclude-accessibility"),n.innerText=e.title,t.itemsWrapper?t.itemsWrapper.append(n):t.output.append(n);var o=t.sortItems().filter((function(t){return JSON.parse(t.getAttribute("data-hs-combo-box-output-item")).group.name===e.name}));t.plainRender(o)}))},e.prototype.itemsFromHtml=function(){if("default"===this.groupingType)this.groupDefaultRender();else if("tabs"===this.groupingType){var t=this.sortItems();this.groupTabsRender(),this.plainRender(t)}else{t=this.sortItems();this.plainRender(t)}this.setResults(this.input.value)},e.prototype.buildToggle=function(){var t=this;this.toggle.addEventListener("click",(function(){t.isOpened?t.close():t.open(t.toggle.getAttribute("data-hs-combo-box-toggle"))}))},e.prototype.setSelectedByValue=function(t){var e=this;this.items.forEach((function(n){e.isTextExists(n,t)?n.classList.add("selected"):n.classList.remove("selected")}))},e.prototype.setValue=function(t){this.selected=t,this.value=t,this.input.value=t},e.prototype.setItemsVisibility=function(){var t=this;"tabs"===this.groupingType&&"all"!==this.selectedGroup&&this.items.forEach((function(t){t.style.display="none"}));var e="tabs"===this.groupingType?"all"===this.selectedGroup?this.items:this.items.filter((function(e){return JSON.parse(e.getAttribute("data-hs-combo-box-output-item")).group.name===t.selectedGroup})):this.items;"tabs"===this.groupingType&&"all"!==this.selectedGroup&&e.forEach((function(t){t.style.display="block"})),e.forEach((function(e){t.isTextExistsAny(e,t.value)?e.style.display="block":e.style.display="none"})),"default"===this.groupingType&&this.output.querySelectorAll("[data-hs-combo-box-group-title]").forEach((function(e){var n=e.getAttribute("data-hs-combo-box-group-title");t.items.filter((function(t){return JSON.parse(t.getAttribute("data-hs-combo-box-output-item")).group.name===n&&"block"===t.style.display})).length?e.style.display="block":e.style.display="none"}))},e.prototype.hasVisibleItems=function(){return!!this.items.length&&this.items.some((function(t){return"block"===t.style.display}))},e.prototype.appendItemsToWrapper=function(t){this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t)},e.prototype.buildOutputPlaceholder=function(){this.outputPlaceholder||(this.outputPlaceholder=(0,c.htmlToElement)(this.outputEmptyTemplate)),this.appendItemsToWrapper(this.outputPlaceholder)},e.prototype.destroyOutputPlaceholder=function(){this.outputPlaceholder&&this.outputPlaceholder.remove(),this.outputPlaceholder=null},e.prototype.resultItems=function(){if(!this.items.length)return!1;this.setItemsVisibility(),this.setSelectedByValue([this.selected])},e.prototype.setValueAndOpen=function(t){this.value=t,this.items.length&&this.setItemsVisibility()},e.prototype.open=function(t){var e=this;return!this.animationInProcess&&(void 0!==t&&this.setValueAndOpen(t),!this.preventVisibility&&(this.animationInProcess=!0,this.output.style.display="block",this.recalculateDirection(),setTimeout((function(){e.el.classList.add("active"),e.animationInProcess=!1})),void(this.isOpened=!0)))},e.prototype.setValueAndClear=function(t){t?this.setValue(t):this.setValue(this.selected),this.outputPlaceholder&&this.destroyOutputPlaceholder()},e.prototype.close=function(t){var e=this;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t),!1):(this.animationInProcess=!0,this.el.classList.remove("active"),this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom="",(0,c.afterTransition)(this.output,(function(){e.output.style.display="none",e.setValueAndClear(t),e.animationInProcess=!1})),void(this.isOpened=!1)))},e.prototype.recalculateDirection=function(){(0,c.isEnoughSpace)(this.output,this.input,"bottom",this.gap,this.viewport)?(this.output.classList.remove("bottom-full"),this.output.style.marginBottom="",this.output.classList.add("top-full"),this.output.style.marginTop="".concat(this.gap,"px")):(this.output.classList.remove("top-full"),this.output.style.marginTop="",this.output.classList.add("bottom-full"),this.output.style.marginBottom="".concat(this.gap,"px"))},e.getInstance=function(t,e){var n=window.$hsComboBoxCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsComboBoxCollection||(window.$hsComboBoxCollection=[]),document.querySelectorAll("[data-hs-combo-box]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsComboBoxCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-combo-box"),o=n?JSON.parse(n):{};new e(t,o)}})),window.$hsComboBoxCollection&&(window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.close=function(t){var e=window.$hsComboBoxCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.isOpened&&e.element.close()},e.closeCurrentlyOpened=function(t){if(void 0===t&&(t=null),!t.closest("[data-hs-combo-box].active")){var e=window.$hsComboBoxCollection.filter((function(t){return t.element.isOpened}))||null;e&&e.forEach((function(t){t.element.close()}))}},e.getPreparedItems=function(t,e){return void 0===t&&(t=!1),e?(t?Array.from(e.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter((function(t){return"none"!==t.style.display})).reverse():Array.from(e.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter((function(t){return"none"!==t.style.display}))).filter((function(t){return!t.classList.contains("disabled")})):null},e.setHighlighted=function(t,e,n){e.focus(),n.value=e.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text"),t&&t.classList.remove("hs-combo-box-output-item-highlighted"),e.classList.add("hs-combo-box-output-item-highlighted")},e.accessibility=function(t){if(window.$hsComboBoxCollection.find((function(t){return t.element.isOpened}))&&d.COMBO_BOX_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}},e.onEscape=function(){var t=window.$hsComboBoxCollection.find((function(t){return!t.element.preventVisibility&&t.element.isOpened}));t&&(t.element.close(),t.element.input.blur())},e.onArrow=function(t){var n;void 0===t&&(t=!0);var o=window.$hsComboBoxCollection.find((function(t){return t.element.preventVisibility?t.element.isCurrent:t.element.isOpened}));if(o){var i=null!==(n=o.element.itemsWrapper)&&void 0!==n?n:o.element.output;if(!i)return!1;var r,s=e.getPreparedItems(t,i),l=i.querySelector(".hs-combo-box-output-item-highlighted");l||s[0].classList.add("hs-combo-box-output-item-highlighted");var a=s.findIndex((function(t){return t===l}));a+1=this.limit)return!1;this.el.hasAttribute("disabled")&&this.el.setAttribute("disabled","");var t=this.target.cloneNode(!0);this.addToItems(t),this.limit&&this.items.length>=this.limit&&this.el.setAttribute("disabled","disabled"),this.fireEvent("copy",t),(0,s.dispatch)("copy.hs.copyMarkup",t,t)},e.prototype.addPredefinedItems=function(){var t=this;Array.from(this.wrapper.children).filter((function(t){return!t.classList.contains("[--ignore-for-count]")})).forEach((function(e){t.addToItems(e)}))},e.prototype.setTarget=function(){var t="string"==typeof this.targetSelector?document.querySelector(this.targetSelector).cloneNode(!0):this.targetSelector.cloneNode(!0);t.removeAttribute("id"),this.target=t},e.prototype.setWrapper=function(){this.wrapper="string"==typeof this.wrapperSelector?document.querySelector(this.wrapperSelector):this.wrapperSelector},e.prototype.addToItems=function(t){var e=this,n=t.querySelector("[data-hs-copy-markup-delete-item]");this.wrapper?this.wrapper.append(t):this.el.before(t),n&&n.addEventListener("click",(function(){return e.delete(t)})),this.items.push(t)},e.prototype.delete=function(t){var e=this.items.indexOf(t);-1!==e&&this.items.splice(e,1),t.remove(),this.fireEvent("delete",t),(0,s.dispatch)("delete.hs.copyMarkup",t,t)},e.getInstance=function(t,e){var n=window.$hsCopyMarkupCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsCopyMarkupCollection||(window.$hsCopyMarkupCollection=[]),document.querySelectorAll("[data-hs-copy-markup]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsCopyMarkupCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-copy-markup"),o=n?JSON.parse(n):{};new e(t,o)}}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=l),e.default=l},610:function(t,e,n){ /* * HSDropdown - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i .hs-dropdown-toggle")||i.el.children[0],i.menu=i.el.querySelector(":scope > .hs-dropdown-menu"),i.eventMode=(0,s.getClassProperty)(i.el,"--trigger","click"),i.closeMode=(0,s.getClassProperty)(i.el,"--auto-close","true"),i.animationInProcess=!1,i.toggle&&i.menu&&i.init(),i}return i(e,t),e.prototype.init=function(){var t=this;if(this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle.addEventListener("click",(function(){return t.onClickHandler()})),(0,s.isIOS)()||(0,s.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return t.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return t.onMouseLeaveHandler()})))},e.prototype.resizeHandler=function(){this.eventMode=(0,s.getClassProperty)(this.el,"--trigger","click")},e.prototype.onClickHandler=function(){this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?this.close():this.open()},e.prototype.onMouseEnterHandler=function(){if("hover"!==this.eventMode)return!1;this.el._popper&&this.forceClearState(),!this.el.classList.contains("open")&&this.menu.classList.contains("hidden")&&this.open()},e.prototype.onMouseLeaveHandler=function(){if("hover"!==this.eventMode)return!1;this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")&&this.close()},e.prototype.destroyPopper=function(){this.menu.classList.remove("block"),this.menu.classList.add("hidden"),this.menu.style.inset=null,this.menu.style.position=null,this.el&&this.el._popper&&this.el._popper.destroy(),this.animationInProcess=!1},e.prototype.absoluteStrategyModifiers=function(){var t=this;return[{name:"applyStyles",fn:function(e){var n=(window.getComputedStyle(t.el).getPropertyValue("--strategy")||"absolute").replace(" ",""),o=(window.getComputedStyle(t.el).getPropertyValue("--adaptive")||"adaptive").replace(" ","");e.state.elements.popper.style.position=n,e.state.elements.popper.style.transform="adaptive"===o?e.state.styles.popper.transform:null,e.state.elements.popper.style.top=null,e.state.elements.popper.style.bottom=null,e.state.elements.popper.style.left=null,e.state.elements.popper.style.right=null,e.state.elements.popper.style.margin=0}},{name:"computeStyles",options:{adaptive:!1}}]},e.prototype.open=function(){var t=this;if(this.el.classList.contains("open"))return!1;if(this.animationInProcess)return!1;this.animationInProcess=!0;var e=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),n=(window.getComputedStyle(this.el).getPropertyValue("--flip")||"true").replace(" ",""),o=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),i=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ",""));"static"!==o&&(this.el._popper=(0,l.createPopper)(this.el,this.menu,{placement:c.POSITIONS[e]||"bottom-start",strategy:o,modifiers:r(r([],"fixed"!==o?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===n},{name:"offset",options:{offset:[0,i]}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){t.el.classList.add("open"),t.animationInProcess=!1})),this.fireEvent("open",this.el),(0,s.dispatch)("open.hs.dropdown",this.el,this.el)},e.prototype.close=function(t){var e=this;if(void 0===t&&(t=!0),this.animationInProcess||!this.el.classList.contains("open"))return!1;if(this.animationInProcess=!0,t){var n=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,s.afterTransition)(n,(function(){return e.destroyPopper()}))}else this.destroyPopper();this.menu.style.margin=null,this.el.classList.remove("open"),this.fireEvent("close",this.el),(0,s.dispatch)("close.hs.dropdown",this.el,this.el)},e.prototype.forceClearState=function(){this.destroyPopper(),this.menu.style.margin=null,this.el.classList.remove("open")},e.getInstance=function(t,e){var n=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.autoInit=function(){if(window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),document.querySelectorAll(".hs-dropdown:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDropdownCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)})),window.$hsDropdownCollection){document.addEventListener("keydown",(function(t){return e.accessibility(t)})),window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)}));var t=window.innerWidth;window.addEventListener("resize",(function(){window.innerWidth!==t&&(t=innerWidth,e.closeCurrentlyOpened(null,!1))}))}},e.open=function(t){var e=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.menu.classList.contains("hidden")&&e.element.open()},e.close=function(t){var e=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&!e.element.menu.classList.contains("hidden")&&e.element.close()},e.accessibility=function(t){this.history=s.menuSearchHistory;var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e&&(c.DROPDOWN_ACCESSIBILITY_KEY_SET.includes(t.code)||4===t.code.length&&t.code[t.code.length-1].match(/^[A-Z]*$/))&&!t.metaKey&&!e.element.menu.querySelector("input:focus"))switch(console.log("Key code:",t.code),t.code){case"Escape":e.element.menu.querySelector(".hs-select.active")||(t.preventDefault(),this.onEscape(t));break;case"Enter":e.element.menu.querySelector(".hs-select button:focus")||e.element.menu.querySelector(".hs-collapse-toggle:focus")||this.onEnter(t);break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;default:t.preventDefault(),this.onFirstLetter(t.key)}},e.onEscape=function(t){var e=t.target.closest(".hs-dropdown.open");if(window.$hsDropdownCollection.find((function(t){return t.element.el===e}))){var n=window.$hsDropdownCollection.find((function(t){return t.element.el===e}));n&&(n.element.close(),n.element.toggle.focus())}else this.closeCurrentlyOpened()},e.onEnter=function(t){var e=t.target.parentElement;if(window.$hsDropdownCollection.find((function(t){return t.element.el===e}))){t.preventDefault();var n=window.$hsDropdownCollection.find((function(t){return t.element.el===e}));n&&n.element.open()}},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e){var n=e.element.menu;if(!n)return!1;var o=(t?Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])")).reverse():Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector("a:focus, button:focus"),r=o.findIndex((function(t){return t===i}));r+1 .hs-dropdown-toggle")||i.el.children[0],i.menu=i.el.querySelector(":scope > .hs-dropdown-menu"),i.eventMode=(0,s.getClassProperty)(i.el,"--trigger","click"),i.closeMode=(0,s.getClassProperty)(i.el,"--auto-close","true"),i.animationInProcess=!1,i.toggle&&i.menu&&i.init(),i}return i(e,t),e.prototype.init=function(){var t=this;if(this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle.addEventListener("click",(function(){return t.onClickHandler()})),(0,s.isIOS)()||(0,s.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return t.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return t.onMouseLeaveHandler()})))},e.prototype.resizeHandler=function(){this.eventMode=(0,s.getClassProperty)(this.el,"--trigger","click")},e.prototype.onClickHandler=function(){this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?this.close():this.open()},e.prototype.onMouseEnterHandler=function(){if("hover"!==this.eventMode)return!1;this.el._popper&&this.forceClearState(),!this.el.classList.contains("open")&&this.menu.classList.contains("hidden")&&this.open()},e.prototype.onMouseLeaveHandler=function(){if("hover"!==this.eventMode)return!1;this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")&&this.close()},e.prototype.destroyPopper=function(){this.menu.classList.remove("block"),this.menu.classList.add("hidden"),this.menu.style.inset=null,this.menu.style.position=null,this.el&&this.el._popper&&this.el._popper.destroy(),this.animationInProcess=!1},e.prototype.absoluteStrategyModifiers=function(){var t=this;return[{name:"applyStyles",fn:function(e){var n=(window.getComputedStyle(t.el).getPropertyValue("--strategy")||"absolute").replace(" ",""),o=(window.getComputedStyle(t.el).getPropertyValue("--adaptive")||"adaptive").replace(" ","");e.state.elements.popper.style.position=n,e.state.elements.popper.style.transform="adaptive"===o?e.state.styles.popper.transform:null,e.state.elements.popper.style.top=null,e.state.elements.popper.style.bottom=null,e.state.elements.popper.style.left=null,e.state.elements.popper.style.right=null,e.state.elements.popper.style.margin=0}},{name:"computeStyles",options:{adaptive:!1}}]},e.prototype.open=function(){var t=this;if(this.el.classList.contains("open"))return!1;if(this.animationInProcess)return!1;this.animationInProcess=!0;var e=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),n=(window.getComputedStyle(this.el).getPropertyValue("--flip")||"true").replace(" ",""),o=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),i=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ",""));"static"!==o&&(this.el._popper=(0,l.createPopper)(this.el,this.menu,{placement:c.POSITIONS[e]||"bottom-start",strategy:o,modifiers:r(r([],"fixed"!==o?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===n},{name:"offset",options:{offset:[0,i]}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){t.el.classList.add("open"),t.animationInProcess=!1})),this.fireEvent("open",this.el),(0,s.dispatch)("open.hs.dropdown",this.el,this.el)},e.prototype.close=function(t){var e=this;if(void 0===t&&(t=!0),this.animationInProcess||!this.el.classList.contains("open"))return!1;if(this.animationInProcess=!0,t){var n=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,s.afterTransition)(n,(function(){return e.destroyPopper()}))}else this.destroyPopper();this.menu.style.margin=null,this.el.classList.remove("open"),this.fireEvent("close",this.el),(0,s.dispatch)("close.hs.dropdown",this.el,this.el)},e.prototype.forceClearState=function(){this.destroyPopper(),this.menu.style.margin=null,this.el.classList.remove("open")},e.getInstance=function(t,e){var n=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.autoInit=function(){if(window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),document.querySelectorAll(".hs-dropdown:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDropdownCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)})),window.$hsDropdownCollection){document.addEventListener("keydown",(function(t){return e.accessibility(t)})),window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)}));var t=window.innerWidth;window.addEventListener("resize",(function(){window.innerWidth!==t&&(t=innerWidth,e.closeCurrentlyOpened(null,!1))}))}},e.open=function(t){var e=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.menu.classList.contains("hidden")&&e.element.open()},e.close=function(t){var e=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&!e.element.menu.classList.contains("hidden")&&e.element.close()},e.accessibility=function(t){this.history=s.menuSearchHistory;var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e&&(c.DROPDOWN_ACCESSIBILITY_KEY_SET.includes(t.code)||4===t.code.length&&t.code[t.code.length-1].match(/^[A-Z]*$/))&&!t.metaKey&&!e.element.menu.querySelector("input:focus"))switch(t.code){case"Escape":e.element.menu.querySelector(".hs-select.active")||(t.preventDefault(),this.onEscape(t));break;case"Enter":e.element.menu.querySelector(".hs-select button:focus")||e.element.menu.querySelector(".hs-collapse-toggle:focus")||this.onEnter(t);break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;default:t.preventDefault(),this.onFirstLetter(t.key)}},e.onEscape=function(t){var e=t.target.closest(".hs-dropdown.open");if(window.$hsDropdownCollection.find((function(t){return t.element.el===e}))){var n=window.$hsDropdownCollection.find((function(t){return t.element.el===e}));n&&(n.element.close(),n.element.toggle.focus())}else this.closeCurrentlyOpened()},e.onEnter=function(t){var e=t.target.parentElement;if(window.$hsDropdownCollection.find((function(t){return t.element.el===e}))){t.preventDefault();var n=window.$hsDropdownCollection.find((function(t){return t.element.el===e}));n&&n.element.open()}},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e){var n=e.element.menu;if(!n)return!1;var o=(t?Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])")).reverse():Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector("a:focus, button:focus"),r=o.findIndex((function(t){return t===i}));r+10?l.step:1,o.init(),o}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsInputNumberCollection,this),this.input&&this.increment&&this.build()},e.prototype.build=function(){this.input&&this.buildInput(),this.increment&&this.buildIncrement(),this.decrement&&this.buildDecrement(),this.inputValue<=0&&0===this.minInputValue&&(this.inputValue=0,this.input.value="0"),(this.inputValue<=0||this.minInputValue<0)&&this.changeValue(),this.input.hasAttribute("disabled")&&this.disableButtons()},e.prototype.buildInput=function(){var t=this;this.input.addEventListener("input",(function(){return t.changeValue()}))},e.prototype.buildIncrement=function(){var t=this;this.increment.addEventListener("click",(function(){t.changeValue("increment")}))},e.prototype.buildDecrement=function(){var t=this;this.decrement.addEventListener("click",(function(){t.changeValue("decrement")}))},e.prototype.changeValue=function(t){var e,n;void 0===t&&(t="none");var o={inputValue:this.inputValue},i=null!==(e=this.minInputValue)&&void 0!==e?e:Number.MIN_SAFE_INTEGER,r=null!==(n=this.maxInputValue)&&void 0!==n?n:Number.MAX_SAFE_INTEGER;switch(this.inputValue=isNaN(this.inputValue)?0:this.inputValue,t){case"increment":var l=this.inputValue+this.step;this.inputValue=l>=i&&l<=r?l:r,this.input.value=this.inputValue.toString();break;case"decrement":var a=this.inputValue-this.step;this.inputValue=a>=i&&a<=r?a:i,this.input.value=this.inputValue.toString();break;default:var c=isNaN(parseInt(this.input.value))?0:parseInt(this.input.value);this.inputValue=c>=r?r:c<=i?i:c,this.inputValue<=i&&(this.input.value=this.inputValue.toString())}o.inputValue=this.inputValue,this.inputValue===i?(this.el.classList.add("disabled"),this.decrement&&this.disableButtons("decrement")):(this.el.classList.remove("disabled"),this.decrement&&this.enableButtons("decrement")),this.inputValue===r?(this.el.classList.add("disabled"),this.increment&&this.disableButtons("increment")):(this.el.classList.remove("disabled"),this.increment&&this.enableButtons("increment")),this.fireEvent("change",o),(0,s.dispatch)("change.hs.inputNumber",this.el,o)},e.prototype.disableButtons=function(t){void 0===t&&(t="all"),"all"===t?("BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.setAttribute("disabled","disabled"),"BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.setAttribute("disabled","disabled")):"increment"===t?"BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.setAttribute("disabled","disabled"):"decrement"===t&&("BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.setAttribute("disabled","disabled"))},e.prototype.enableButtons=function(t){void 0===t&&(t="all"),"all"===t?("BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.removeAttribute("disabled"),"BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.removeAttribute("disabled")):"increment"===t?"BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.removeAttribute("disabled"):"decrement"===t&&("BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.removeAttribute("disabled"))},e.getInstance=function(t,e){var n=window.$hsInputNumberCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsInputNumberCollection||(window.$hsInputNumberCollection=[]),document.querySelectorAll("[data-hs-input-number]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsInputNumberCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=l),e.default=l},770:function(t,e,n){ /* * HSOverlay - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n-1?e[(o+1)%e.length].focus():e[0].focus()},e.on=function(t,e,n){var o=window.$hsOverlayCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)||t.element.overlay===("string"==typeof e?document.querySelector(e):e)}));o&&(o.element.events[t]=n)},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSOverlay=l),e.default=l},659:function(t,e,n){ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=t?(document.body.classList.add("hs-overlay-body-open"),e.element.overlay.classList.add("opened")):e.element.close(!0)},e.accessibility=function(t){var e,n,o=window.$hsOverlayCollection.filter((function(t){return t.element.overlay.classList.contains("open")})),i=o[o.length-1],r=null===(n=null===(e=null==i?void 0:i.element)||void 0===e?void 0:e.overlay)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),l=[];(null==r?void 0:r.length)&&r.forEach((function(t){(0,s.isParentOrElementHidden)(t)||l.push(t)}));var a=i&&!t.metaKey;if(a&&!i.element.isTabAccessibilityLimited&&"Tab"===t.code)return!1;a&&l.length&&"Tab"===t.code&&(t.preventDefault(),this.onTab(i,l)),a&&"Escape"===t.code&&(t.preventDefault(),this.onEscape(i))},e.onEscape=function(t){t&&t.element.hasAbilityToCloseOnBackdropClick&&t.element.close()},e.onTab=function(t,e){if(!e.length)return!1;var n=t.element.overlay.querySelector(":focus"),o=Array.from(e).indexOf(n);o>-1?e[(o+1)%e.length].focus():e[0].focus()},e.on=function(t,e,n){var o=window.$hsOverlayCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)||t.element.overlay===("string"==typeof e?document.querySelector(e):e)}));o&&(o.element.events[t]=n)},e}(n(737).default);window.addEventListener("load",(function(){a.autoInit()})),window.addEventListener("resize",(function(){!function(){if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((function(t){return t.element.autoClose})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.autoClose})).forEach((function(t){document.body.clientWidth>=t.element.autoClose&&t.element.close(!0)}))}(),function(){if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((function(t){return t.element.openedBreakpoint})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.openedBreakpoint})).forEach((function(t){a.setOpened(t.element.openedBreakpoint,t)}))}()})),"undefined"!=typeof window&&(window.HSOverlay=a),e.default=a},659:function(t,e,n){ /* * HSPinInput - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -73,7 +81,7 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&this.items[e-1].focus()},e.prototype.onKeydown=function(t,e){"Backspace"===t.key&&e>0&&(""===this.items[e].value?(this.items[e-1].value="",this.items[e-1].focus()):this.items[e].value=""),this.setCurrentValue(),this.toggleCompleted()},e.prototype.onFocusIn=function(t){this.items[t].setAttribute("placeholder","")},e.prototype.onFocusOut=function(t){this.items[t].setAttribute("placeholder",this.placeholders[t])},e.prototype.onPaste=function(t){var e=this;t.preventDefault(),this.items.forEach((function(n){document.activeElement===n&&e.autoFillAll(t.clipboardData.getData("text"))}))},e.getInstance=function(t,e){var n=window.$hsPinInputCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsPinInputCollection||(window.$hsPinInputCollection=[]),document.querySelectorAll("[data-hs-pin-input]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsPinInputCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=l),e.default=l},139:function(t,e,n){ /* * HSRemoveElement - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -81,7 +89,7 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0){if(this.activeSection===e)return!1;this.links.forEach((function(t){t.classList.remove("active")}));var a=this.el.querySelector('[href="#'.concat(e.getAttribute("id"),'"]'));if(a){a.classList.add("active");var c=a.closest("[data-hs-scrollspy-group]");if(c){var u=c.querySelector("[href]");u&&u.classList.add("active")}}this.activeSection=e}},e.prototype.scrollTo=function(t){var e=t.getAttribute("href"),n=document.querySelector(e),o=parseInt((0,r.getClassProperty)(this.el,"--scrollspy-offset","0")),i=parseInt((0,r.getClassProperty)(n,"--scrollspy-offset"))||o,s=this.scrollable===document?0:this.scrollable.offsetTop,l=n.offsetTop-i-s,a=this.scrollable===document?window:this.scrollable,c=function(){window.history.replaceState(null,null,t.getAttribute("href")),"scrollTo"in a&&a.scrollTo({top:l,left:0,behavior:"smooth"})},u=this.fireEvent("beforeScroll",this.el);(0,r.dispatch)("beforeScroll.hs.scrollspy",this.el,this.el),u instanceof Promise?u.then((function(){return c()})):c()},e.getInstance=function(t,e){void 0===e&&(e=!1);var n=window.$hsScrollspyCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.autoInit=function(){window.$hsScrollspyCollection||(window.$hsScrollspyCollection=[]),document.querySelectorAll("[data-hs-scrollspy]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsScrollspyCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){s.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=s),e.default=s},961:function(t,e,n){ /* * HSTogglePassword - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&i[i.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]",o.dropdownClasses=l.dropdownClasses||"absolute top-full z-[1] w-full bg-white border border-gray-200 rounded-md hidden mt-2",o.dropdownItemTemplate=l.dropdownItemTemplate||"
",o.dropdownItemTemplatesByType=l.dropdownItemTemplatesByType||null,o.dropdownItemClasses=l.dropdownItemClasses||"py-2 px-4 w-full cursor-pointer text-sm hover:bg-gray-300 hover:text-black",o.highlightedTextTagName=l.highlightedTextTagName||"u",o.highlightedTextClasses=l.highlightedTextClasses||"bg-green-200",o.jsonUrl&&o.fetchData().then((function(){return o.init()})),o}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsSearchByJsonCollection,this),this.buildDropdown(),this.el.addEventListener("input",(0,a.debounce)((function(e){t.val=e.target.value,t.val.length>t.minChars?t.searchData(t.val):t.result=[],t.result.length?t.dropdown.classList.remove("hidden"):t.dropdown.classList.add("hidden"),t.buildItems(),console.log("result:",t.result)})))},e.prototype.fetchData=function(){return s(this,void 0,void 0,(function(){var t=this;return l(this,(function(e){switch(e.label){case 0:return[4,fetch(this.jsonUrl).then((function(t){return t.json()})).then((function(e){return t.json=e}))];case 1:return e.sent(),[2]}}))}))},e.prototype.searchData=function(t){this.result=this.json.filter((function(e){var n=t.toLowerCase(),o=e.title.toLowerCase(),i=e.description.toLowerCase();return o.includes(n)||i.includes(n)}))},e.prototype.buildDropdown=function(){this.dropdown=(0,a.htmlToElement)(this.dropdownTemplate),this.dropdownClasses&&(0,a.classToClassList)(this.dropdownClasses,this.dropdown),this.el.after(this.dropdown)},e.prototype.buildItems=function(){var t=this;this.dropdown.innerHTML="",this.result.forEach((function(e){var n=(0,a.htmlToElement)(''));n.append(t.itemTemplate(e)),t.dropdown.append(n)}))},e.prototype.itemTemplate=function(t){var e=new RegExp(this.val,"gi"),n=t.title.replace(e,"<".concat(this.highlightedTextTagName,' class="inline-block ').concat(this.highlightedTextClasses,'">').concat(this.val,"")),o=t.description.replace(e,"<".concat(this.highlightedTextTagName,' class="inline-block ').concat(this.highlightedTextClasses,'">').concat(this.val,"")),i=this.dropdownItemTemplatesByType?this.dropdownItemTemplatesByType.find((function(e){return e.type===t.type})):null,r=i?(0,a.htmlToElement)(i.markup):(0,a.htmlToElement)(this.dropdownItemTemplate);this.dropdownItemClasses&&(0,a.classToClassList)(this.dropdownItemClasses,r);var s=r.querySelector("[data-title]");s?s.append((0,a.htmlToElement)("".concat(n,""))):r.append((0,a.htmlToElement)("".concat(n,"")));var l=r.querySelector("[data-description]");if(l)l.append((0,a.htmlToElement)("".concat(o,"")));else if(!i){var c=(0,a.htmlToElement)("
");r.append(c),r.append((0,a.htmlToElement)("".concat(o,"")))}return r},e.getInstance=function(t){var e=window.$hsSearchByJsonCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return e?e.element:null},e.autoInit=function(){window.$hsSearchByJsonCollection||(window.$hsSearchByJsonCollection=[]),document.querySelectorAll("[data-hs-search-by-json]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsSearchByJsonCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){c.autoInit()})),"undefined"!=typeof window&&(window.HSSearchByJson=c),e.default=c},233:function(t,e,n){ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&i[i.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]",o.dropdownClasses=l.dropdownClasses||"absolute top-full z-[1] w-full bg-white border border-gray-200 rounded-md hidden mt-2",o.dropdownItemTemplate=l.dropdownItemTemplate||"
",o.dropdownItemTemplatesByType=l.dropdownItemTemplatesByType||null,o.dropdownItemClasses=l.dropdownItemClasses||"py-2 px-4 w-full cursor-pointer text-sm hover:bg-gray-300 hover:text-black",o.highlightedTextTagName=l.highlightedTextTagName||"u",o.highlightedTextClasses=l.highlightedTextClasses||"bg-green-200",o.jsonUrl&&o.fetchData().then((function(){return o.init()})),o}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsSearchByJsonCollection,this),this.buildDropdown(),this.el.addEventListener("input",(0,a.debounce)((function(e){t.val=e.target.value,t.val.length>t.minChars?t.searchData(t.val):t.result=[],t.result.length?t.dropdown.classList.remove("hidden"):t.dropdown.classList.add("hidden"),t.buildItems()})))},e.prototype.fetchData=function(){return s(this,void 0,void 0,(function(){var t=this;return l(this,(function(e){switch(e.label){case 0:return[4,fetch(this.jsonUrl).then((function(t){return t.json()})).then((function(e){return t.json=e}))];case 1:return e.sent(),[2]}}))}))},e.prototype.searchData=function(t){this.result=this.json.filter((function(e){var n=t.toLowerCase(),o=e.title.toLowerCase(),i=e.description.toLowerCase();return o.includes(n)||i.includes(n)}))},e.prototype.buildDropdown=function(){this.dropdown=(0,a.htmlToElement)(this.dropdownTemplate),this.dropdownClasses&&(0,a.classToClassList)(this.dropdownClasses,this.dropdown),this.el.after(this.dropdown)},e.prototype.buildItems=function(){var t=this;this.dropdown.innerHTML="",this.result.forEach((function(e){var n=(0,a.htmlToElement)(''));n.append(t.itemTemplate(e)),t.dropdown.append(n)}))},e.prototype.itemTemplate=function(t){var e=new RegExp(this.val,"gi"),n=t.title.replace(e,"<".concat(this.highlightedTextTagName,' class="inline-block ').concat(this.highlightedTextClasses,'">').concat(this.val,"")),o=t.description.replace(e,"<".concat(this.highlightedTextTagName,' class="inline-block ').concat(this.highlightedTextClasses,'">').concat(this.val,"")),i=this.dropdownItemTemplatesByType?this.dropdownItemTemplatesByType.find((function(e){return e.type===t.type})):null,r=i?(0,a.htmlToElement)(i.markup):(0,a.htmlToElement)(this.dropdownItemTemplate);this.dropdownItemClasses&&(0,a.classToClassList)(this.dropdownItemClasses,r);var s=r.querySelector("[data-title]");s?s.append((0,a.htmlToElement)("".concat(n,""))):r.append((0,a.htmlToElement)("".concat(n,"")));var l=r.querySelector("[data-description]");if(l)l.append((0,a.htmlToElement)("".concat(o,"")));else if(!i){var c=(0,a.htmlToElement)("
");r.append(c),r.append((0,a.htmlToElement)("".concat(o,"")))}return r},e.getInstance=function(t){var e=window.$hsSearchByJsonCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return e?e.element:null},e.autoInit=function(){window.$hsSearchByJsonCollection||(window.$hsSearchByJsonCollection=[]),document.querySelectorAll("[data-hs-search-by-json]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsSearchByJsonCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){c.autoInit()})),"undefined"!=typeof window&&(window.HSSearchByJson=c),e.default=c},233:function(t,e,n){ /* * HSSelect - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n"),e=this.toggle.querySelector("[data-icon]"),n=this.toggle.querySelector("[data-title]"),!this.isMultiple&&e&&this.setToggleIcon(),!this.isMultiple&&n&&this.setToggleTitle(),this.isMultiple?this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder:this.toggleTextWrapper.innerHTML=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder,n||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,l.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),this.toggle.addEventListener("click",(function(){if(o.isDisabled)return!1;o.isOpened?o.close():o.open()}))},e.prototype.setToggleIcon=function(){var t,e,n=this.toggle.querySelector("[data-icon]");if(n.innerHTML="",n){var o=(0,l.htmlToElement)((null===(e=null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.options)||void 0===e?void 0:e.icon)||"");n.append(o),o?n.classList.remove("hidden"):n.classList.add("hidden")}},e.prototype.setToggleTitle=function(){var t,e=this.toggle.querySelector("[data-title]");if(e.classList.add("truncate"),e.innerHTML="",e){var n=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder;e.innerHTML=n,this.toggle.append(e)}},e.prototype.buildTags=function(){this.tags=document.createElement("div"),this.tags.classList.add("flex"),this.tagsClasses&&(0,l.classToClassList)(this.tagsClasses,this.tags),this.buildTagsInput(),this.buildTagsItems(),this.setTagsItems(),this.wrapper&&this.wrapper.append(this.tags)},e.prototype.buildTagsItems=function(){this.tagsItems=document.createElement("div"),this.tagsItems.classList.add("flex","flex-wrap","flex-0","items-center"),this.setTagsItems(),this.tags.append(this.tagsItems)},e.prototype.buildTagsItem=function(t){var e,n,o,i,r,s,a,c=this,u=this.getItemByValue(t),d=document.createElement("div");if(this.tagsItemClasses&&(0,l.classToClassList)(this.tagsItemClasses,d),this.tagsItemTemplate&&(i=(0,l.htmlToElement)(this.tagsItemTemplate),d.append(i)),null===(e=null==u?void 0:u.options)||void 0===e?void 0:e.icon){var p=(0,l.htmlToElement)(null===(n=null==u?void 0:u.options)||void 0===n?void 0:n.icon);(a=i?i.querySelector("[data-icon]"):document.createElement("span")).append(p),i||d.append(a)}i&&i.querySelector("[data-icon]")&&!(null===(o=null==u?void 0:u.options)||void 0===o?void 0:o.icon)&&i.querySelector("[data-icon]").classList.add("hidden"),(r=i?i.querySelector("[data-title]"):document.createElement("span")).textContent=u.title||"",i||d.append(r),i?s=i.querySelector("[data-remove]"):((s=document.createElement("span")).textContent="X",d.append(s)),s.addEventListener("click",(function(){c.value=c.value.filter((function(e){return e!==t})),c.unselectMultipleItems(),c.setTagsItems(),c.selectMultipleItems()})),this.tagsItems.append(d)},e.prototype.getItemByValue=function(t){return this.selectOptions.find((function(e){return e.val===t}))},e.prototype.setTagsItems=function(){var t=this;this.tagsItems.innerHTML="",this.value&&(this.value.forEach((function(e){t.buildTagsItem(e)})),this.tagsInput.readOnly=!0),this.value.length||(this.tagsInput.placeholder=this.placeholder,this.tagsInput.readOnly=!1)},e.prototype.buildTagsInput=function(){var t=this;this.tagsInput=document.createElement("input"),this.tagsInput.placeholder=this.placeholder,this.tagsInputClasses&&(0,l.classToClassList)(this.tagsInputClasses,this.tagsInput),this.tagsInput.addEventListener("focus",(function(){return t.open()})),this.tagsInput.addEventListener("input",(0,l.debounce)((function(e){return t.searchOptions(e.target.value)}))),this.tagsInput.addEventListener("keydown",(function(e){if("Enter"===e.key&&t.isAddTagOnEnter){var n=e.target.value;if(t.selectOptions.find((function(t){return t.val===n})))return!1;t.addSelectOption(n,n),t.buildOption(n,n),t.dropdown.querySelector('[data-value="'.concat(n,'"]')).click(),t.resetTagsInputField(),t.close()}})),this.tags.append(this.tagsInput)},e.prototype.buildDropdown=function(){var t=this;this.dropdown=(0,l.htmlToElement)(this.dropdownTag||"
"),this.dropdown.classList.add("absolute","top-full"),this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,l.classToClassList)(this.dropdownClasses,this.dropdown),this.wrapper&&this.wrapper.append(this.dropdown),this.dropdown&&this.hasSearch&&this.buildSearch(),this.selectOptions&&this.selectOptions.forEach((function(e,n){return t.buildOption(e.title,e.val,e.options,"".concat(n))}))},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,l.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,l.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]"),this.search=(0,l.htmlToElement)(''),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,l.classToClassList)(this.searchClasses,this.search),this.search.addEventListener("input",(0,l.debounce)((function(t){return e.searchOptions(t.target.value)}))),t?t.append(this.search):this.searchWrapper.append(this.search),this.dropdown.append(this.searchWrapper)},e.prototype.buildOption=function(t,e,n,o){var i=this;void 0===o&&(o="1");var r=null,s=(0,l.htmlToElement)(this.optionTag||"
");if(s.setAttribute("data-value",e),s.setAttribute("data-title-value",t),s.setAttribute("tabIndex",o),s.classList.add("cursor-pointer"),this.optionTemplate&&(r=(0,l.htmlToElement)(this.optionTemplate),s.append(r)),r?r.querySelector("[data-title]").textContent=t||"":s.textContent=t||"",n){if(n.icon){var a=(0,l.htmlToElement)(n.icon);if(a.classList.add("mw-full"),r)r.querySelector("[data-icon]").append(a);else{var c=(0,l.htmlToElement)("
");this.iconClasses&&(0,l.classToClassList)(this.iconClasses,c),c.append(a),s.append(c)}}if(n.description)if(r)r.querySelector("[data-description]").append(n.description);else{var u=(0,l.htmlToElement)("
");u.textContent=n.description,this.descriptionClasses&&(0,l.classToClassList)(this.descriptionClasses,u),s.append(u)}}r&&r.querySelector("[data-icon]")&&!n&&!(null==n?void 0:n.icon)&&r.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&s.classList.add("selected"),s.addEventListener("click",(function(){return i.onSelectOption(e)})),this.optionClasses&&(0,l.classToClassList)(this.optionClasses,s),this.dropdown&&this.dropdown.append(s)},e.prototype.destroyOption=function(t){var e=this.dropdown.querySelector('[data-value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.buildOriginalOption=function(t,e,n){var o=(0,l.htmlToElement)("");o.setAttribute("value",e),o.setAttribute("data-hs-select-option",JSON.stringify(n)),o.innerText=t,this.el.append(o)},e.prototype.destroyOriginalOption=function(t){var e=this.el.querySelector('[value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.onSelectOption=function(t){this.clearSelections(),this.isMultiple?(this.value=this.value.includes(t)?Array.from(this.value).filter((function(e){return e!==t})):s(s([],Array.from(this.value),!0),[t],!1),this.selectMultipleItems(),this.setNewValue()):(this.value=t,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),(0,l.dispatch)("change.hs.select",this.el,this.value),"tags"===this.mode&&this.resetTagsInputField(),this.isMultiple||(this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.close()),this.value.length||"tags"!==this.mode||(this.tagsInput.placeholder=this.placeholder)},e.prototype.addSelectOption=function(t,e,n){this.selectOptions=s(s([],this.selectOptions,!0),[{title:t,val:e,options:n}],!1)},e.prototype.removeSelectOption=function(t){if(!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t}))},e.prototype.resetTagsInputField=function(){this.tagsInput.value="",this.tagsInput.placeholder="",this.searchOptions("")},e.prototype.clearSelections=function(){Array.from(this.dropdown.children).forEach((function(t){t.classList.contains("selected")&&t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){t.selected&&(t.selected=!1)}))},e.prototype.setNewValue=function(){"tags"===this.mode?this.setTagsItems():this.value.length?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.stringFromValue=function(){var t=this,e=[];return this.selectOptions.forEach((function(n){t.isMultiple?t.value.includes(n.val)&&e.push(n.title):t.value===n.val&&e.push(n.title)})),this.toggleCountText&&""!==this.toggleCountText&&e.length>=this.toggleCountTextMinItems?"".concat(e.length," ").concat(this.toggleCountText):e.join(", ")},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0,Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")})).classList.add("selected")},e.prototype.selectMultipleItems=function(){var t=this;Array.from(this.dropdown.children).filter((function(e){return t.value.includes(e.getAttribute("data-value"))})).forEach((function(t){return t.classList.add("selected")})),Array.from(this.el.children).filter((function(e){return t.value.includes(e.value)})).forEach((function(t){return t.selected=!0}))},e.prototype.unselectMultipleItems=function(){Array.from(this.dropdown.children).forEach((function(t){return t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){return t.selected=!1}))},e.prototype.searchOptions=function(t){this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,l.htmlToElement)(""),this.searchNoResult.innerText=this.searchNoResultText,(0,l.classToClassList)(this.searchNoResultClasses,this.searchNoResult);var e=this.dropdown.querySelectorAll("[data-value]"),n=!1;e.forEach((function(e){e.getAttribute("data-title-value").toLowerCase().includes(t.toLowerCase())?(e.classList.remove("hidden"),n=!0):e.classList.add("hidden")})),n||this.dropdown.append(this.searchNoResult)},e.prototype.eraseToggleIcon=function(){var t=this.toggle.querySelector("[data-icon]");t&&(t.innerHTML=null,t.classList.add("hidden"))},e.prototype.eraseToggleTitle=function(){var t=this.toggle.querySelector("[data-title]");t?t.innerHTML=this.placeholder:this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.destroy=function(){var t=this.el.parentElement.parentElement;this.el.classList.remove("hidden"),this.el.style.display="",t.prepend(this.el),t.querySelector(".hs-select").remove(),this.wrapper=null},e.prototype.open=function(){var t=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){t.wrapper.classList.add("active"),t.dropdown.classList.add("opened"),t.hasSearch&&t.search.focus(),t.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,n,o=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,l.afterTransition)(this.dropdown,(function(){o.dropdown.classList.add("hidden"),o.hasSearch&&(o.search.value="",o.search.dispatchEvent(new Event("input",{bubbles:!0})),o.search.blur()),o.animationInProcess=!1})),null===(n=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===n||n.classList.remove("hs-select-option-highlighted"),this.isOpened=!1},e.prototype.addOption=function(t){var e=this,n="".concat(this.selectOptions.length),o=function(t){var o=t.title,i=t.val,r=t.options;!!e.selectOptions.some((function(t){return t.val===i}))||(e.addSelectOption(o,i,r),e.buildOption(o,i,r,n),e.buildOriginalOption(o,i,r))};Array.isArray(t)?t.forEach((function(t){o(t)})):o(t)},e.prototype.removeOption=function(t){var e=this,n=function(t){!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t),e.destroyOption(t),e.destroyOriginalOption(t),e.value===t&&(e.value=null,e.eraseToggleTitle(),e.eraseToggleIcon()))};Array.isArray(t)?t.forEach((function(t){n(t)})):n(t)},e.prototype.recalculateDirection=function(){var t,e,n,o;(0,l.isEnoughSpace)(this.dropdown,this.toggle||this.tagsInput,"bottom",this.dropdownSpace,this.viewport)?(this.dropdown.classList.remove("bottom-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="",this.dropdown.classList.add("top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.add(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="".concat(this.dropdownSpace,"px")):(this.dropdown.classList.remove("top-full"),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.classList.add("bottom-full"),(null===(o=this.dropdownDirectionClasses)||void 0===o?void 0:o.bottom)&&this.dropdown.classList.add(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="".concat(this.dropdownSpace,"px"))},e.getInstance=function(t,e){var n=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsSelectCollection||(window.$hsSelectCollection=[]),document.querySelectorAll("[data-hs-select]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsSelectCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-select"),o=n?JSON.parse(n):{};new e(t,o)}})),window.$hsSelectCollection&&(window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.close=function(t){var e=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.isOpened&&e.element.close()},e.closeCurrentlyOpened=function(t){if(void 0===t&&(t=null),!t.closest(".hs-select.active")){var e=window.$hsSelectCollection.filter((function(t){return t.element.isOpened}))||null;e&&e.forEach((function(t){t.element.close()}))}},e.accessibility=function(t){var e=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));if(e&&c.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(console.log(e),console.log("Key code:",t.code),t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Tab":t.preventDefault(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}},e.onEscape=function(){var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.close()},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));if(e){var n=e.element.dropdown;if(!n)return!1;var o=(t?Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var r=o.findIndex((function(t){return t===i}));r+1 *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var r=o.findIndex((function(t){return t===i}));if(!(r+1 *:not(.hidden)")):Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");o.length&&(o[0].focus(),i&&i.classList.remove("hs-select-option-highlighted"),o[0].classList.add("hs-select-option-highlighted"))}},e.onEnter=function(t){var e=t.target.previousSibling;if(window.$hsSelectCollection.find((function(t){return t.element.el===e}))){var n=window.$hsSelectCollection.find((function(t){return t.element.isOpened})),o=window.$hsSelectCollection.find((function(t){return t.element.el===e}));n.element.close(),o.element.open()}else{(o=window.$hsSelectCollection.find((function(t){return t.element.isOpened})))&&o.element.onSelectOption(t.target.dataset.value||"")}},e}(a.default);window.addEventListener("load",(function(){u.autoInit()})),document.addEventListener("scroll",(function(){if(!window.$hsSelectCollection)return!1;var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSSelect=u),e.default=u},957:function(t,e,n){ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n"),e=this.toggle.querySelector("[data-icon]"),n=this.toggle.querySelector("[data-title]"),!this.isMultiple&&e&&this.setToggleIcon(),!this.isMultiple&&n&&this.setToggleTitle(),this.isMultiple?this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder:this.toggleTextWrapper.innerHTML=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder,n||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,l.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),this.toggle.addEventListener("click",(function(){if(o.isDisabled)return!1;o.isOpened?o.close():o.open()}))},e.prototype.setToggleIcon=function(){var t,e,n=this.toggle.querySelector("[data-icon]");if(n.innerHTML="",n){var o=(0,l.htmlToElement)((null===(e=null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.options)||void 0===e?void 0:e.icon)||"");n.append(o),o?n.classList.remove("hidden"):n.classList.add("hidden")}},e.prototype.setToggleTitle=function(){var t,e=this.toggle.querySelector("[data-title]");if(e.classList.add("truncate"),e.innerHTML="",e){var n=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder;e.innerHTML=n,this.toggle.append(e)}},e.prototype.buildTags=function(){this.buildTagsInput(),this.setTagsItems()},e.prototype.reassignTagsInputPlaceholder=function(t){this.tagsInput.placeholder=t,this.tagsInputHelper.innerHTML=t,this.calculateInputWidth()},e.prototype.buildTagsItem=function(t){var e,n,o,i,r,s,a,c=this,u=this.getItemByValue(t),d=document.createElement("div");if(d.setAttribute("data-tag-value",t),this.tagsItemClasses&&(0,l.classToClassList)(this.tagsItemClasses,d),this.tagsItemTemplate&&(i=(0,l.htmlToElement)(this.tagsItemTemplate),d.append(i)),null===(e=null==u?void 0:u.options)||void 0===e?void 0:e.icon){var p=(0,l.htmlToElement)(null===(n=null==u?void 0:u.options)||void 0===n?void 0:n.icon);(a=i?i.querySelector("[data-icon]"):document.createElement("span")).append(p),i||d.append(a)}i&&i.querySelector("[data-icon]")&&!(null===(o=null==u?void 0:u.options)||void 0===o?void 0:o.icon)&&i.querySelector("[data-icon]").classList.add("hidden"),(r=i?i.querySelector("[data-title]"):document.createElement("span")).textContent=u.title||"",i||d.append(r),i?s=i.querySelector("[data-remove]"):((s=document.createElement("span")).textContent="X",d.append(s)),s.addEventListener("click",(function(){c.value=c.value.filter((function(e){return e!==t})),c.selectedItems=c.selectedItems.filter((function(e){return e!==t})),c.value.length||c.reassignTagsInputPlaceholder(c.placeholder),c.unselectMultipleItems(),c.selectMultipleItems(),d.remove()})),this.wrapper.append(d)},e.prototype.getItemByValue=function(t){return this.selectOptions.find((function(e){return e.val===t}))},e.prototype.setTagsItems=function(){var t=this;this.value&&this.value.forEach((function(e){t.selectedItems.includes(e)||t.buildTagsItem(e),t.selectedItems=t.selectedItems.includes(e)?t.selectedItems:s(s([],t.selectedItems,!0),[e],!1)}))},e.prototype.buildTagsInput=function(){var t=this;this.tagsInput=document.createElement("input"),this.tagsInputClasses&&(0,l.classToClassList)(this.tagsInputClasses,this.tagsInput),this.tagsInput.addEventListener("focus",(function(){return t.open()})),this.tagsInput.addEventListener("input",(function(){return t.calculateInputWidth()})),this.tagsInput.addEventListener("input",(0,l.debounce)((function(e){return t.searchOptions(e.target.value)}))),this.tagsInput.addEventListener("keydown",(function(e){if("Enter"===e.key&&t.isAddTagOnEnter){var n=e.target.value;if(t.selectOptions.find((function(t){return t.val===n})))return!1;t.addSelectOption(n,n),t.buildOption(n,n),t.dropdown.querySelector('[data-value="'.concat(n,'"]')).click(),t.resetTagsInputField()}})),this.wrapper.append(this.tagsInput),setTimeout((function(){t.adjustInputWidth(),t.reassignTagsInputPlaceholder(t.value.length?"":t.placeholder)}))},e.prototype.buildDropdown=function(){var t=this;this.dropdown=(0,l.htmlToElement)(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),this.dropdown.classList.add("absolute","top-full"),this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,l.classToClassList)(this.dropdownClasses,this.dropdown),this.wrapper&&this.wrapper.append(this.dropdown),this.dropdown&&this.hasSearch&&this.buildSearch(),this.selectOptions&&this.selectOptions.forEach((function(e,n){return t.buildOption(e.title,e.val,e.options,"".concat(n))}))},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,l.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,l.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]"),this.search=(0,l.htmlToElement)(''),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,l.classToClassList)(this.searchClasses,this.search),this.search.addEventListener("input",(0,l.debounce)((function(t){return e.searchOptions(t.target.value)}))),t?t.append(this.search):this.searchWrapper.append(this.search),this.dropdown.append(this.searchWrapper)},e.prototype.buildOption=function(t,e,n,o){var i=this;void 0===o&&(o="1");var r=null,s=(0,l.htmlToElement)(this.optionTag||"
");if(s.setAttribute("data-value",e),s.setAttribute("data-title-value",t),s.setAttribute("tabIndex",o),s.classList.add("cursor-pointer"),this.optionTemplate&&(r=(0,l.htmlToElement)(this.optionTemplate),s.append(r)),r?r.querySelector("[data-title]").textContent=t||"":s.textContent=t||"",n){if(n.icon){var a=(0,l.htmlToElement)(n.icon);if(a.classList.add("mw-full"),r)r.querySelector("[data-icon]").append(a);else{var c=(0,l.htmlToElement)("
");this.iconClasses&&(0,l.classToClassList)(this.iconClasses,c),c.append(a),s.append(c)}}if(n.description)if(r)r.querySelector("[data-description]").append(n.description);else{var u=(0,l.htmlToElement)("
");u.textContent=n.description,this.descriptionClasses&&(0,l.classToClassList)(this.descriptionClasses,u),s.append(u)}}r&&r.querySelector("[data-icon]")&&!n&&!(null==n?void 0:n.icon)&&r.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&s.classList.add("selected"),s.addEventListener("click",(function(){return i.onSelectOption(e)})),this.optionClasses&&(0,l.classToClassList)(this.optionClasses,s),this.dropdown&&this.dropdown.append(s)},e.prototype.destroyOption=function(t){var e=this.dropdown.querySelector('[data-value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.buildOriginalOption=function(t,e,n){var o=(0,l.htmlToElement)("");o.setAttribute("value",e),o.setAttribute("data-hs-select-option",JSON.stringify(n)),o.innerText=t,this.el.append(o)},e.prototype.destroyOriginalOption=function(t){var e=this.el.querySelector('[value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.buildTagsInputHelper=function(){this.tagsInputHelper=document.createElement("span"),this.tagsInputHelper.style.fontSize=window.getComputedStyle(this.tagsInput).fontSize,this.tagsInputHelper.style.fontFamily=window.getComputedStyle(this.tagsInput).fontFamily,this.tagsInputHelper.style.fontWeight=window.getComputedStyle(this.tagsInput).fontWeight,this.tagsInputHelper.style.letterSpacing=window.getComputedStyle(this.tagsInput).letterSpacing,this.tagsInputHelper.style.visibility="hidden",this.tagsInputHelper.style.whiteSpace="pre",this.tagsInputHelper.style.position="absolute",this.wrapper.appendChild(this.tagsInputHelper)},e.prototype.calculateInputWidth=function(){this.tagsInputHelper.textContent=this.tagsInput.value||this.tagsInput.placeholder;var t=parseInt(window.getComputedStyle(this.tagsInput).paddingLeft)+parseInt(window.getComputedStyle(this.tagsInput).paddingRight),e=parseInt(window.getComputedStyle(this.tagsInput).borderLeftWidth)+parseInt(window.getComputedStyle(this.tagsInput).borderRightWidth),n=this.tagsInputHelper.offsetWidth+t+e,o=this.wrapper.offsetWidth-(parseInt(window.getComputedStyle(this.wrapper).paddingLeft)+parseInt(window.getComputedStyle(this.wrapper).paddingRight));this.tagsInput.style.width="".concat(Math.min(n,o)+2,"px")},e.prototype.adjustInputWidth=function(){this.buildTagsInputHelper(),this.calculateInputWidth()},e.prototype.onSelectOption=function(t){var e=this;if(this.clearSelections(),this.isMultiple?(this.value=this.value.includes(t)?Array.from(this.value).filter((function(e){return e!==t})):s(s([],Array.from(this.value),!0),[t],!1),this.selectMultipleItems(),this.setNewValue()):(this.value=t,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),(0,l.dispatch)("change.hs.select",this.el,this.value),"tags"===this.mode){var n=this.selectedItems.filter((function(t){return!e.value.includes(t)}));n.length&&n.forEach((function(t){e.selectedItems=e.selectedItems.filter((function(e){return e!==t})),e.wrapper.querySelector('[data-tag-value="'.concat(t,'"]')).remove()})),this.resetTagsInputField()}this.isMultiple||(this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.close()),this.value.length||"tags"!==this.mode||this.reassignTagsInputPlaceholder(this.placeholder),this.isOpened&&"tags"===this.mode&&this.tagsInput&&this.tagsInput.focus()},e.prototype.addSelectOption=function(t,e,n){this.selectOptions=s(s([],this.selectOptions,!0),[{title:t,val:e,options:n}],!1)},e.prototype.removeSelectOption=function(t){if(!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t}))},e.prototype.resetTagsInputField=function(){this.tagsInput.value="",this.reassignTagsInputPlaceholder(""),this.searchOptions("")},e.prototype.clearSelections=function(){Array.from(this.dropdown.children).forEach((function(t){t.classList.contains("selected")&&t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){t.selected&&(t.selected=!1)}))},e.prototype.setNewValue=function(){"tags"===this.mode?this.setTagsItems():this.value.length?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.stringFromValue=function(){var t=this,e=[];return this.selectOptions.forEach((function(n){t.isMultiple?t.value.includes(n.val)&&e.push(n.title):t.value===n.val&&e.push(n.title)})),this.toggleCountText&&""!==this.toggleCountText&&e.length>=this.toggleCountTextMinItems?"".concat(e.length," ").concat(this.toggleCountText):e.join(", ")},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0,Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")})).classList.add("selected")},e.prototype.selectMultipleItems=function(){var t=this;Array.from(this.dropdown.children).filter((function(e){return t.value.includes(e.getAttribute("data-value"))})).forEach((function(t){return t.classList.add("selected")})),Array.from(this.el.children).filter((function(e){return t.value.includes(e.value)})).forEach((function(t){return t.selected=!0}))},e.prototype.unselectMultipleItems=function(){Array.from(this.dropdown.children).forEach((function(t){return t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){return t.selected=!1}))},e.prototype.searchOptions=function(t){this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,l.htmlToElement)(""),this.searchNoResult.innerText=this.searchNoResultText,(0,l.classToClassList)(this.searchNoResultClasses,this.searchNoResult);var e=this.dropdown.querySelectorAll("[data-value]"),n=!1;e.forEach((function(e){e.getAttribute("data-title-value").toLocaleLowerCase().includes(t.toLocaleLowerCase())?(e.classList.remove("hidden"),n=!0):e.classList.add("hidden")})),n||this.dropdown.append(this.searchNoResult)},e.prototype.eraseToggleIcon=function(){var t=this.toggle.querySelector("[data-icon]");t&&(t.innerHTML=null,t.classList.add("hidden"))},e.prototype.eraseToggleTitle=function(){var t=this.toggle.querySelector("[data-title]");t?t.innerHTML=this.placeholder:this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.destroy=function(){var t=this.el.parentElement.parentElement;this.el.classList.remove("hidden"),this.el.style.display="",t.prepend(this.el),t.querySelector(".hs-select").remove(),this.wrapper=null},e.prototype.open=function(){var t=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){t.wrapper.classList.add("active"),t.dropdown.classList.add("opened"),t.hasSearch&&!t.preventSearchFocus&&t.search.focus(),t.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,n,o=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,l.afterTransition)(this.dropdown,(function(){o.dropdown.classList.add("hidden"),o.hasSearch&&(o.search.value="",o.search.dispatchEvent(new Event("input",{bubbles:!0})),o.search.blur()),o.animationInProcess=!1})),null===(n=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===n||n.classList.remove("hs-select-option-highlighted"),this.isOpened=!1},e.prototype.addOption=function(t){var e=this,n="".concat(this.selectOptions.length),o=function(t){var o=t.title,i=t.val,r=t.options;!!e.selectOptions.some((function(t){return t.val===i}))||(e.addSelectOption(o,i,r),e.buildOption(o,i,r,n),e.buildOriginalOption(o,i,r))};Array.isArray(t)?t.forEach((function(t){o(t)})):o(t)},e.prototype.removeOption=function(t){var e=this,n=function(t){!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t),e.destroyOption(t),e.destroyOriginalOption(t),e.value===t&&(e.value=null,e.eraseToggleTitle(),e.eraseToggleIcon()))};Array.isArray(t)?t.forEach((function(t){n(t)})):n(t)},e.prototype.recalculateDirection=function(){var t,e,n,o;(0,l.isEnoughSpace)(this.dropdown,this.toggle||this.tagsInput,"bottom",this.dropdownSpace,this.viewport)?(this.dropdown.classList.remove("bottom-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="",this.dropdown.classList.add("top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.add(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="".concat(this.dropdownSpace,"px")):(this.dropdown.classList.remove("top-full"),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.classList.add("bottom-full"),(null===(o=this.dropdownDirectionClasses)||void 0===o?void 0:o.bottom)&&this.dropdown.classList.add(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="".concat(this.dropdownSpace,"px"))},e.getInstance=function(t,e){var n=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsSelectCollection||(window.$hsSelectCollection=[]),document.querySelectorAll("[data-hs-select]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsSelectCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-select"),o=n?JSON.parse(n):{};new e(t,o)}})),window.$hsSelectCollection&&(window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.close=function(t){var e=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.isOpened&&e.element.close()},e.closeCurrentlyOpened=function(t){if(void 0===t&&(t=null),!t.closest(".hs-select.active")){var e=window.$hsSelectCollection.filter((function(t){return t.element.isOpened}))||null;e&&e.forEach((function(t){t.element.close()}))}},e.accessibility=function(t){if(window.$hsSelectCollection.find((function(t){return t.element.isOpened}))&&c.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Tab":t.preventDefault(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}},e.onEscape=function(){var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.close()},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));if(e){var n=e.element.dropdown;if(!n)return!1;var o=(t?Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var r=o.findIndex((function(t){return t===i}));r+1 *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var r=o.findIndex((function(t){return t===i}));if(!(r+1 *:not(.hidden)")):Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");o.length&&(o[0].focus(),i&&i.classList.remove("hs-select-option-highlighted"),o[0].classList.add("hs-select-option-highlighted"))}},e.onEnter=function(t){var e=t.target.previousSibling;if(window.$hsSelectCollection.find((function(t){return t.element.el===e}))){var n=window.$hsSelectCollection.find((function(t){return t.element.isOpened})),o=window.$hsSelectCollection.find((function(t){return t.element.el===e}));n.element.close(),o.element.open()}else{(o=window.$hsSelectCollection.find((function(t){return t.element.isOpened})))&&o.element.onSelectOption(t.target.dataset.value||"")}},e}(a.default);window.addEventListener("load",(function(){u.autoInit()})),document.addEventListener("scroll",(function(){if(!window.$hsSelectCollection)return!1;var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSSelect=u),e.default=u},957:function(t,e,n){ /* * HSStepper - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;nt.totalSteps&&(t.totalSteps=n)}))},e.prototype.buildNav=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-nav-item]").forEach((function(e){return t.addNavItem(e)})),this.navItems.forEach((function(e){return t.buildNavItem(e)}))},e.prototype.buildNavItem=function(t){var e=this,n=t.index,o=t.isDisabled,i=t.el;n===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||o)&&i.addEventListener("click",(function(){return e.handleNavItemClick(t)}))},e.prototype.addNavItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-nav-item")),n=e.index,o=e.isFinal,i=void 0!==o&&o,r=e.isCompleted,s=void 0!==r&&r,l=e.isSkip,a=void 0!==l&&l,c=e.isOptional,u=void 0!==c&&c,d=e.isDisabled,p=void 0!==d&&d,h=e.isProcessed,f=void 0!==h&&h,v=e.hasError,m=void 0!==v&&v;s&&t.classList.add("success"),a&&t.classList.add("skipped"),p&&("BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")),m&&t.classList.add("error"),this.navItems.push({index:n,isFinal:i,isCompleted:s,isSkip:a,isOptional:u,isDisabled:p,isProcessed:f,hasError:m,el:t})},e.prototype.setCurrentNavItem=function(){var t=this;this.navItems.forEach((function(e){var n=e.index,o=e.el;n===t.currentIndex?t.setCurrentNavItemActions(o):t.unsetCurrentNavItemActions(o)}))},e.prototype.setCurrentNavItemActions=function(t){t.classList.add("active"),this.fireEvent("active",this.currentIndex),(0,s.dispatch)("active.hs.stepper",this.el,this.currentIndex)},e.prototype.getNavItem=function(t){return void 0===t&&(t=this.currentIndex),this.navItems.find((function(e){return e.index===t}))},e.prototype.setProcessedNavItemActions=function(t){t.isProcessed=!0,t.el.classList.add("processed")},e.prototype.setErrorNavItemActions=function(t){t.hasError=!0,t.el.classList.add("error")},e.prototype.unsetCurrentNavItemActions=function(t){t.classList.remove("active")},e.prototype.handleNavItemClick=function(t){var e=t.index;this.currentIndex=e,this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep()},e.prototype.buildContent=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-content-item]").forEach((function(e){return t.addContentItem(e)})),this.navItems.forEach((function(e){return t.buildContentItem(e)}))},e.prototype.buildContentItem=function(t){t.index===this.currentIndex&&this.setCurrentContentItem()},e.prototype.addContentItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-content-item")),n=e.index,o=e.isFinal,i=void 0!==o&&o,r=e.isCompleted,s=void 0!==r&&r,l=e.isSkip,a=void 0!==l&&l;s&&t.classList.add("success"),a&&t.classList.add("skipped"),this.contentItems.push({index:n,isFinal:i,isCompleted:s,isSkip:a,el:t})},e.prototype.setCurrentContentItem=function(){var t=this;if(this.isCompleted){var e=this.contentItems.find((function(t){return t.isFinal})),n=this.contentItems.filter((function(t){return!t.isFinal}));return e.el.style.display="",n.forEach((function(t){return t.el.style.display="none"})),!1}this.contentItems.forEach((function(e){var n=e.index,o=e.el;n===t.currentIndex?t.setCurrentContentItemActions(o):t.unsetCurrentContentItemActions(o)}))},e.prototype.hideAllContentItems=function(){this.contentItems.forEach((function(t){return t.el.style.display="none"}))},e.prototype.setCurrentContentItemActions=function(t){t.style.display=""},e.prototype.unsetCurrentContentItemActions=function(t){t.style.display="none"},e.prototype.disableAll=function(){var t=this.getNavItem(this.currentIndex);t.hasError=!1,t.isCompleted=!1,t.isDisabled=!1,t.el.classList.remove("error","success"),this.disableButtons()},e.prototype.disableNavItemActions=function(t){t.isDisabled=!0,t.el.classList.add("disabled")},e.prototype.enableNavItemActions=function(t){t.isDisabled=!1,t.el.classList.remove("disabled")},e.prototype.buildButtons=function(){this.backBtn=this.el.querySelector("[data-hs-stepper-back-btn]"),this.nextBtn=this.el.querySelector("[data-hs-stepper-next-btn]"),this.skipBtn=this.el.querySelector("[data-hs-stepper-skip-btn]"),this.completeStepBtn=this.el.querySelector("[data-hs-stepper-complete-step-btn]"),this.finishBtn=this.el.querySelector("[data-hs-stepper-finish-btn]"),this.resetBtn=this.el.querySelector("[data-hs-stepper-reset-btn]"),this.buildBackButton(),this.buildNextButton(),this.buildSkipButton(),this.buildCompleteStepButton(),this.buildFinishButton(),this.buildResetButton()},e.prototype.buildBackButton=function(){var t=this;this.backBtn&&(this.checkForTheFirstStep(),this.backBtn.addEventListener("click",(function(){if(t.handleBackButtonClick(),"linear"===t.mode){var e=t.navItems.find((function(e){return e.index===t.currentIndex})),n=t.contentItems.find((function(e){return e.index===t.currentIndex}));if(!e||!n)return;e.isCompleted&&(e.isCompleted=!1,e.isSkip=!1,e.el.classList.remove("success","skipped")),n.isCompleted&&(n.isCompleted=!1,n.isSkip=!1,n.el.classList.remove("success","skipped")),"linear"===t.mode&&t.currentIndex!==t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display=""),t.completeStepBtn&&(t.completeStepBtn.style.display="")),t.showSkipButton(),t.showFinishButton(),t.showCompleteStepButton()}})))},e.prototype.handleBackButtonClick=function(){1!==this.currentIndex&&("linear"===this.mode&&this.removeOptionalClasses(),this.currentIndex--,"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.fireEvent("back",this.currentIndex),(0,s.dispatch)("back.hs.stepper",this.el,this.currentIndex))},e.prototype.checkForTheFirstStep=function(){1===this.currentIndex?this.setToDisabled(this.backBtn):this.setToNonDisabled(this.backBtn)},e.prototype.setToDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")},e.prototype.setToNonDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled"),t.classList.remove("disabled")},e.prototype.buildNextButton=function(){var t=this;this.nextBtn&&this.nextBtn.addEventListener("click",(function(){var e;if(t.fireEvent("beforeNext",t.currentIndex),(0,s.dispatch)("beforeNext.hs.stepper",t.el,t.currentIndex),null===(e=t.getNavItem(t.currentIndex))||void 0===e?void 0:e.isProcessed)return t.disableAll(),!1;t.goToNext()}))},e.prototype.unsetProcessedNavItemActions=function(t){t.isProcessed=!1,t.el.classList.remove("processed")},e.prototype.handleNextButtonClick=function(t){if(void 0===t&&(t=!0),t)this.currentIndex===this.totalSteps?this.currentIndex=1:this.currentIndex++;else{var e=this.getUncompletedSteps();if(1===e.length){var n=e[0].index;this.currentIndex=n}else{if(this.currentIndex===this.totalSteps)return;this.currentIndex++}}"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton(),this.showFinishButton(),this.showCompleteStepButton(),this.fireEvent("next",this.currentIndex),(0,s.dispatch)("next.hs.stepper",this.el,this.currentIndex)},e.prototype.removeOptionalClasses=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=this.contentItems.find((function(e){return e.index===t.currentIndex}));e.isSkip=!1,e.hasError=!1,e.isDisabled=!1,n.isSkip=!1,e.el.classList.remove("skipped","success","error"),n.el.classList.remove("skipped","success","error")},e.prototype.buildSkipButton=function(){var t=this;this.skipBtn&&(this.showSkipButton(),this.skipBtn.addEventListener("click",(function(){t.handleSkipButtonClick(),"linear"===t.mode&&t.currentIndex===t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display="none"),t.completeStepBtn&&(t.completeStepBtn.style.display="none"),t.finishBtn&&(t.finishBtn.style.display=""))})))},e.prototype.setSkipItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),o=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&o&&(this.setSkipItemActions(n),this.setSkipItemActions(o))},e.prototype.setSkipItemActions=function(t){t.isSkip=!0,t.el.classList.add("skipped")},e.prototype.showSkipButton=function(){var t=this;if(this.skipBtn){var e=this.navItems.find((function(e){return e.index===t.currentIndex})).isOptional;this.skipBtn.style.display=e?"":"none"}},e.prototype.handleSkipButtonClick=function(){this.setSkipItem(),this.handleNextButtonClick(),this.fireEvent("skip",this.currentIndex),(0,s.dispatch)("skip.hs.stepper",this.el,this.currentIndex)},e.prototype.buildCompleteStepButton=function(){var t=this;this.completeStepBtn&&(this.completeStepBtnDefaultText=this.completeStepBtn.innerText,this.completeStepBtn.addEventListener("click",(function(){return t.handleCompleteStepButtonClick()})))},e.prototype.changeTextAndDisableCompleteButtonIfStepCompleted=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=JSON.parse(this.completeStepBtn.getAttribute("data-hs-stepper-complete-step-btn")).completedText;e&&(e.isCompleted?(this.completeStepBtn.innerText=n||this.completeStepBtnDefaultText,this.completeStepBtn.setAttribute("disabled","disabled"),this.completeStepBtn.classList.add("disabled")):(this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")))},e.prototype.setCompleteItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),o=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&o&&(this.setCompleteItemActions(n),this.setCompleteItemActions(o))},e.prototype.setCompleteItemActions=function(t){t.isCompleted=!0,t.el.classList.add("success")},e.prototype.showCompleteStepButton=function(){this.completeStepBtn&&(1===this.getUncompletedSteps().length?this.completeStepBtn.style.display="none":this.completeStepBtn.style.display="")},e.prototype.handleCompleteStepButtonClick=function(){this.setCompleteItem(),this.fireEvent("complete",this.currentIndex),(0,s.dispatch)("complete.hs.stepper",this.el,this.currentIndex),this.handleNextButtonClick(!1),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton()},e.prototype.buildFinishButton=function(){var t=this;this.finishBtn&&(this.isCompleted&&this.setCompleted(),this.finishBtn.addEventListener("click",(function(){return t.handleFinishButtonClick()})))},e.prototype.setCompleted=function(){this.el.classList.add("completed")},e.prototype.unsetCompleted=function(){this.el.classList.remove("completed")},e.prototype.showFinishButton=function(){this.finishBtn&&(1===this.getUncompletedSteps().length?this.finishBtn.style.display="":this.finishBtn.style.display="none")},e.prototype.handleFinishButtonClick=function(){var t=this,e=this.getUncompletedSteps(),n=this.getUncompletedSteps(!0),o=this.contentItems.find((function(t){return t.isFinal})).el;e.length&&e.forEach((function(e){var n=e.index;return t.setCompleteItem(n)})),this.currentIndex=this.totalSteps,this.setCurrentNavItem(),this.hideAllContentItems();var i=this.navItems.find((function(e){return e.index===t.currentIndex}));(i?i.el:null).classList.remove("active"),o.style.display="block",this.backBtn&&(this.backBtn.style.display="none"),this.nextBtn&&(this.nextBtn.style.display="none"),this.skipBtn&&(this.skipBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"),this.finishBtn&&(this.finishBtn.style.display="none"),this.resetBtn&&(this.resetBtn.style.display=""),n.length<=1&&(this.isCompleted=!0,this.setCompleted()),this.fireEvent("finish",this.currentIndex),(0,s.dispatch)("finish.hs.stepper",this.el,this.currentIndex)},e.prototype.buildResetButton=function(){var t=this;this.resetBtn&&this.resetBtn.addEventListener("click",(function(){return t.handleResetButtonClick()}))},e.prototype.handleResetButtonClick=function(){var t=this;this.backBtn&&(this.backBtn.style.display=""),this.nextBtn&&(this.nextBtn.style.display=""),this.completeStepBtn&&(this.completeStepBtn.style.display="",this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")),this.resetBtn&&(this.resetBtn.style.display="none"),this.navItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentNavItemActions(n),n.classList.remove("success","skipped")})),this.contentItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentContentItemActions(n),n.classList.remove("success","skipped")})),this.currentIndex=1,this.setCurrentNavItem(),this.setCurrentContentItem(),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.unsetCompleted(),this.isCompleted=!1,this.fireEvent("reset",this.currentIndex),(0,s.dispatch)("reset.hs.stepper",this.el,this.currentIndex)},e.prototype.setProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.setProcessedNavItemActions(e)},e.prototype.unsetProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.unsetProcessedNavItemActions(e)},e.prototype.goToNext=function(){"linear"===this.mode&&this.setCompleteItem(),this.handleNextButtonClick("linear"!==this.mode),"linear"===this.mode&&this.currentIndex===this.totalSteps&&(this.nextBtn&&(this.nextBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"))},e.prototype.disableButtons=function(){this.backBtn&&this.setToDisabled(this.backBtn),this.nextBtn&&this.setToDisabled(this.nextBtn)},e.prototype.enableButtons=function(){this.backBtn&&this.setToNonDisabled(this.backBtn),this.nextBtn&&this.setToNonDisabled(this.nextBtn)},e.prototype.setErrorNavItem=function(t){var e=this.getNavItem(t);e&&this.setErrorNavItemActions(e)},e.getInstance=function(t,e){var n=window.$hsStepperCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsStepperCollection||(window.$hsStepperCollection=[]),document.querySelectorAll("[data-hs-stepper]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsStepperCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=l),e.default=l},983:function(t,e,n){ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;nt.totalSteps&&(t.totalSteps=n)}))},e.prototype.buildNav=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-nav-item]").forEach((function(e){return t.addNavItem(e)})),this.navItems.forEach((function(e){return t.buildNavItem(e)}))},e.prototype.buildNavItem=function(t){var e=this,n=t.index,o=t.isDisabled,i=t.el;n===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||o)&&i.addEventListener("click",(function(){return e.handleNavItemClick(t)}))},e.prototype.addNavItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-nav-item")),n=e.index,o=e.isFinal,i=void 0!==o&&o,r=e.isCompleted,s=void 0!==r&&r,l=e.isSkip,a=void 0!==l&&l,c=e.isOptional,u=void 0!==c&&c,d=e.isDisabled,p=void 0!==d&&d,h=e.isProcessed,f=void 0!==h&&h,m=e.hasError,v=void 0!==m&&m;s&&t.classList.add("success"),a&&t.classList.add("skipped"),p&&("BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")),v&&t.classList.add("error"),this.navItems.push({index:n,isFinal:i,isCompleted:s,isSkip:a,isOptional:u,isDisabled:p,isProcessed:f,hasError:v,el:t})},e.prototype.setCurrentNavItem=function(){var t=this;this.navItems.forEach((function(e){var n=e.index,o=e.el;n===t.currentIndex?t.setCurrentNavItemActions(o):t.unsetCurrentNavItemActions(o)}))},e.prototype.setCurrentNavItemActions=function(t){t.classList.add("active"),this.fireEvent("active",this.currentIndex),(0,s.dispatch)("active.hs.stepper",this.el,this.currentIndex)},e.prototype.getNavItem=function(t){return void 0===t&&(t=this.currentIndex),this.navItems.find((function(e){return e.index===t}))},e.prototype.setProcessedNavItemActions=function(t){t.isProcessed=!0,t.el.classList.add("processed")},e.prototype.setErrorNavItemActions=function(t){t.hasError=!0,t.el.classList.add("error")},e.prototype.unsetCurrentNavItemActions=function(t){t.classList.remove("active")},e.prototype.handleNavItemClick=function(t){var e=t.index;this.currentIndex=e,this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep()},e.prototype.buildContent=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-content-item]").forEach((function(e){return t.addContentItem(e)})),this.navItems.forEach((function(e){return t.buildContentItem(e)}))},e.prototype.buildContentItem=function(t){t.index===this.currentIndex&&this.setCurrentContentItem()},e.prototype.addContentItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-content-item")),n=e.index,o=e.isFinal,i=void 0!==o&&o,r=e.isCompleted,s=void 0!==r&&r,l=e.isSkip,a=void 0!==l&&l;s&&t.classList.add("success"),a&&t.classList.add("skipped"),this.contentItems.push({index:n,isFinal:i,isCompleted:s,isSkip:a,el:t})},e.prototype.setCurrentContentItem=function(){var t=this;if(this.isCompleted){var e=this.contentItems.find((function(t){return t.isFinal})),n=this.contentItems.filter((function(t){return!t.isFinal}));return e.el.style.display="",n.forEach((function(t){return t.el.style.display="none"})),!1}this.contentItems.forEach((function(e){var n=e.index,o=e.el;n===t.currentIndex?t.setCurrentContentItemActions(o):t.unsetCurrentContentItemActions(o)}))},e.prototype.hideAllContentItems=function(){this.contentItems.forEach((function(t){return t.el.style.display="none"}))},e.prototype.setCurrentContentItemActions=function(t){t.style.display=""},e.prototype.unsetCurrentContentItemActions=function(t){t.style.display="none"},e.prototype.disableAll=function(){var t=this.getNavItem(this.currentIndex);t.hasError=!1,t.isCompleted=!1,t.isDisabled=!1,t.el.classList.remove("error","success"),this.disableButtons()},e.prototype.disableNavItemActions=function(t){t.isDisabled=!0,t.el.classList.add("disabled")},e.prototype.enableNavItemActions=function(t){t.isDisabled=!1,t.el.classList.remove("disabled")},e.prototype.buildButtons=function(){this.backBtn=this.el.querySelector("[data-hs-stepper-back-btn]"),this.nextBtn=this.el.querySelector("[data-hs-stepper-next-btn]"),this.skipBtn=this.el.querySelector("[data-hs-stepper-skip-btn]"),this.completeStepBtn=this.el.querySelector("[data-hs-stepper-complete-step-btn]"),this.finishBtn=this.el.querySelector("[data-hs-stepper-finish-btn]"),this.resetBtn=this.el.querySelector("[data-hs-stepper-reset-btn]"),this.buildBackButton(),this.buildNextButton(),this.buildSkipButton(),this.buildCompleteStepButton(),this.buildFinishButton(),this.buildResetButton()},e.prototype.buildBackButton=function(){var t=this;this.backBtn&&(this.checkForTheFirstStep(),this.backBtn.addEventListener("click",(function(){if(t.handleBackButtonClick(),"linear"===t.mode){var e=t.navItems.find((function(e){return e.index===t.currentIndex})),n=t.contentItems.find((function(e){return e.index===t.currentIndex}));if(!e||!n)return;e.isCompleted&&(e.isCompleted=!1,e.isSkip=!1,e.el.classList.remove("success","skipped")),n.isCompleted&&(n.isCompleted=!1,n.isSkip=!1,n.el.classList.remove("success","skipped")),"linear"===t.mode&&t.currentIndex!==t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display=""),t.completeStepBtn&&(t.completeStepBtn.style.display="")),t.showSkipButton(),t.showFinishButton(),t.showCompleteStepButton()}})))},e.prototype.handleBackButtonClick=function(){1!==this.currentIndex&&("linear"===this.mode&&this.removeOptionalClasses(),this.currentIndex--,"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.fireEvent("back",this.currentIndex),(0,s.dispatch)("back.hs.stepper",this.el,this.currentIndex))},e.prototype.checkForTheFirstStep=function(){1===this.currentIndex?this.setToDisabled(this.backBtn):this.setToNonDisabled(this.backBtn)},e.prototype.setToDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")},e.prototype.setToNonDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled"),t.classList.remove("disabled")},e.prototype.buildNextButton=function(){var t=this;this.nextBtn&&this.nextBtn.addEventListener("click",(function(){var e;if(t.fireEvent("beforeNext",t.currentIndex),(0,s.dispatch)("beforeNext.hs.stepper",t.el,t.currentIndex),null===(e=t.getNavItem(t.currentIndex))||void 0===e?void 0:e.isProcessed)return t.disableAll(),!1;t.goToNext()}))},e.prototype.unsetProcessedNavItemActions=function(t){t.isProcessed=!1,t.el.classList.remove("processed")},e.prototype.handleNextButtonClick=function(t){if(void 0===t&&(t=!0),t)this.currentIndex===this.totalSteps?this.currentIndex=1:this.currentIndex++;else{var e=this.getUncompletedSteps();if(1===e.length){var n=e[0].index;this.currentIndex=n}else{if(this.currentIndex===this.totalSteps)return;this.currentIndex++}}"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton(),this.showFinishButton(),this.showCompleteStepButton(),this.fireEvent("next",this.currentIndex),(0,s.dispatch)("next.hs.stepper",this.el,this.currentIndex)},e.prototype.removeOptionalClasses=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=this.contentItems.find((function(e){return e.index===t.currentIndex}));e.isSkip=!1,e.hasError=!1,e.isDisabled=!1,n.isSkip=!1,e.el.classList.remove("skipped","success","error"),n.el.classList.remove("skipped","success","error")},e.prototype.buildSkipButton=function(){var t=this;this.skipBtn&&(this.showSkipButton(),this.skipBtn.addEventListener("click",(function(){t.handleSkipButtonClick(),"linear"===t.mode&&t.currentIndex===t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display="none"),t.completeStepBtn&&(t.completeStepBtn.style.display="none"),t.finishBtn&&(t.finishBtn.style.display=""))})))},e.prototype.setSkipItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),o=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&o&&(this.setSkipItemActions(n),this.setSkipItemActions(o))},e.prototype.setSkipItemActions=function(t){t.isSkip=!0,t.el.classList.add("skipped")},e.prototype.showSkipButton=function(){var t=this;if(this.skipBtn){var e=this.navItems.find((function(e){return e.index===t.currentIndex})).isOptional;this.skipBtn.style.display=e?"":"none"}},e.prototype.handleSkipButtonClick=function(){this.setSkipItem(),this.handleNextButtonClick(),this.fireEvent("skip",this.currentIndex),(0,s.dispatch)("skip.hs.stepper",this.el,this.currentIndex)},e.prototype.buildCompleteStepButton=function(){var t=this;this.completeStepBtn&&(this.completeStepBtnDefaultText=this.completeStepBtn.innerText,this.completeStepBtn.addEventListener("click",(function(){return t.handleCompleteStepButtonClick()})))},e.prototype.changeTextAndDisableCompleteButtonIfStepCompleted=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=JSON.parse(this.completeStepBtn.getAttribute("data-hs-stepper-complete-step-btn")).completedText;e&&(e.isCompleted?(this.completeStepBtn.innerText=n||this.completeStepBtnDefaultText,this.completeStepBtn.setAttribute("disabled","disabled"),this.completeStepBtn.classList.add("disabled")):(this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")))},e.prototype.setCompleteItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),o=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&o&&(this.setCompleteItemActions(n),this.setCompleteItemActions(o))},e.prototype.setCompleteItemActions=function(t){t.isCompleted=!0,t.el.classList.add("success")},e.prototype.showCompleteStepButton=function(){this.completeStepBtn&&(1===this.getUncompletedSteps().length?this.completeStepBtn.style.display="none":this.completeStepBtn.style.display="")},e.prototype.handleCompleteStepButtonClick=function(){this.setCompleteItem(),this.fireEvent("complete",this.currentIndex),(0,s.dispatch)("complete.hs.stepper",this.el,this.currentIndex),this.handleNextButtonClick(!1),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton()},e.prototype.buildFinishButton=function(){var t=this;this.finishBtn&&(this.isCompleted&&this.setCompleted(),this.finishBtn.addEventListener("click",(function(){return t.handleFinishButtonClick()})))},e.prototype.setCompleted=function(){this.el.classList.add("completed")},e.prototype.unsetCompleted=function(){this.el.classList.remove("completed")},e.prototype.showFinishButton=function(){this.finishBtn&&(1===this.getUncompletedSteps().length?this.finishBtn.style.display="":this.finishBtn.style.display="none")},e.prototype.handleFinishButtonClick=function(){var t=this,e=this.getUncompletedSteps(),n=this.getUncompletedSteps(!0),o=this.contentItems.find((function(t){return t.isFinal})).el;e.length&&e.forEach((function(e){var n=e.index;return t.setCompleteItem(n)})),this.currentIndex=this.totalSteps,this.setCurrentNavItem(),this.hideAllContentItems();var i=this.navItems.find((function(e){return e.index===t.currentIndex}));(i?i.el:null).classList.remove("active"),o.style.display="block",this.backBtn&&(this.backBtn.style.display="none"),this.nextBtn&&(this.nextBtn.style.display="none"),this.skipBtn&&(this.skipBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"),this.finishBtn&&(this.finishBtn.style.display="none"),this.resetBtn&&(this.resetBtn.style.display=""),n.length<=1&&(this.isCompleted=!0,this.setCompleted()),this.fireEvent("finish",this.currentIndex),(0,s.dispatch)("finish.hs.stepper",this.el,this.currentIndex)},e.prototype.buildResetButton=function(){var t=this;this.resetBtn&&this.resetBtn.addEventListener("click",(function(){return t.handleResetButtonClick()}))},e.prototype.handleResetButtonClick=function(){var t=this;this.backBtn&&(this.backBtn.style.display=""),this.nextBtn&&(this.nextBtn.style.display=""),this.completeStepBtn&&(this.completeStepBtn.style.display="",this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")),this.resetBtn&&(this.resetBtn.style.display="none"),this.navItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentNavItemActions(n),n.classList.remove("success","skipped")})),this.contentItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentContentItemActions(n),n.classList.remove("success","skipped")})),this.currentIndex=1,this.setCurrentNavItem(),this.setCurrentContentItem(),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.unsetCompleted(),this.isCompleted=!1,this.fireEvent("reset",this.currentIndex),(0,s.dispatch)("reset.hs.stepper",this.el,this.currentIndex)},e.prototype.setProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.setProcessedNavItemActions(e)},e.prototype.unsetProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.unsetProcessedNavItemActions(e)},e.prototype.goToNext=function(){"linear"===this.mode&&this.setCompleteItem(),this.handleNextButtonClick("linear"!==this.mode),"linear"===this.mode&&this.currentIndex===this.totalSteps&&(this.nextBtn&&(this.nextBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"))},e.prototype.disableButtons=function(){this.backBtn&&this.setToDisabled(this.backBtn),this.nextBtn&&this.setToDisabled(this.nextBtn)},e.prototype.enableButtons=function(){this.backBtn&&this.setToNonDisabled(this.backBtn),this.nextBtn&&this.setToNonDisabled(this.nextBtn)},e.prototype.setErrorNavItem=function(t){var e=this.getNavItem(t);e&&this.setErrorNavItemActions(e)},e.getInstance=function(t,e){var n=window.$hsStepperCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsStepperCollection||(window.$hsStepperCollection=[]),document.querySelectorAll("[data-hs-stepper]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsStepperCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=l),e.default=l},983:function(t,e,n){ /* * HSStrongPassword - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -121,15 +129,15 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n?@[\\\\\\]^_`{|}~",o.target&&o.init(),o}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsStrongPasswordCollection,this),this.availableChecks.length&&this.build()},e.prototype.build=function(){var t=this;this.buildStrips(),this.hints&&this.buildHints(),this.setStrength(this.target.value),this.target.addEventListener("input",(function(e){t.setStrength(e.target.value)}))},e.prototype.buildStrips=function(){if(this.el.innerHTML="",this.stripClasses)for(var t=0;t");(0,s.classToClassList)(this.stripClasses,e),this.el.append(e)}},e.prototype.buildHints=function(){var t=this;this.weakness=this.hints.querySelector("[data-hs-strong-password-hints-weakness-text]")||null,this.rules=Array.from(this.hints.querySelectorAll("[data-hs-strong-password-hints-rule-text]"))||null,this.rules.forEach((function(e){var n,o=e.getAttribute("data-hs-strong-password-hints-rule-text");(null===(n=t.checksExclude)||void 0===n?void 0:n.includes(o))&&e.remove()})),this.weakness&&this.buildWeakness(),this.rules&&this.buildRules(),"popover"===this.mode&&(this.target.addEventListener("focus",(function(){t.isOpened=!0,t.hints.classList.remove("hidden"),t.hints.classList.add("block"),t.recalculateDirection()})),this.target.addEventListener("blur",(function(){t.isOpened=!1,t.hints.classList.remove("block","bottom-full","top-full"),t.hints.classList.add("hidden"),t.hints.style.marginTop="",t.hints.style.marginBottom=""})))},e.prototype.buildWeakness=function(){var t=this;this.checkStrength(this.target.value),this.setWeaknessText(),this.target.addEventListener("input",(function(){return setTimeout((function(){return t.setWeaknessText()}))}))},e.prototype.buildRules=function(){var t=this;this.setRulesText(),this.target.addEventListener("input",(function(){return setTimeout((function(){return t.setRulesText()}))}))},e.prototype.setWeaknessText=function(){var t=this.weakness.getAttribute("data-hs-strong-password-hints-weakness-text"),e=JSON.parse(t);this.weakness.textContent=e[this.strength]},e.prototype.setRulesText=function(){var t=this;this.rules.forEach((function(e){var n=e.getAttribute("data-hs-strong-password-hints-rule-text");t.checkIfPassed(e,t.passedRules.has(n))}))},e.prototype.togglePopover=function(){var t=this.el.querySelector(".popover");t&&t.classList.toggle("show")},e.prototype.checkStrength=function(t){var e=new Set,n={lowercase:/[a-z]+/,uppercase:/[A-Z]+/,numbers:/[0-9]+/,"special-characters":new RegExp("[".concat(this.specialCharactersSet,"]"))},o=0;return this.availableChecks.includes("lowercase")&&t.match(n.lowercase)&&(o+=1,e.add("lowercase")),this.availableChecks.includes("uppercase")&&t.match(n.uppercase)&&(o+=1,e.add("uppercase")),this.availableChecks.includes("numbers")&&t.match(n.numbers)&&(o+=1,e.add("numbers")),this.availableChecks.includes("special-characters")&&t.match(n["special-characters"])&&(o+=1,e.add("special-characters")),this.availableChecks.includes("min-length")&&t.length>=this.minLength&&(o+=1,e.add("min-length")),t.length||(o=0),o===this.availableChecks.length?this.el.classList.add("accepted"):this.el.classList.remove("accepted"),this.strength=o,this.passedRules=e,{strength:this.strength,rules:this.passedRules}},e.prototype.checkIfPassed=function(t,e){void 0===e&&(e=!1);var n=t.querySelector("[data-check]"),o=t.querySelector("[data-uncheck]");e?(t.classList.add("active"),n.classList.remove("hidden"),o.classList.add("hidden")):(t.classList.remove("active"),n.classList.add("hidden"),o.classList.remove("hidden"))},e.prototype.setStrength=function(t){var e=this.checkStrength(t),n=e.strength,o={strength:n,rules:e.rules};this.hideStrips(n),this.fireEvent("change",o),(0,s.dispatch)("change.hs.strongPassword",this.el,o)},e.prototype.hideStrips=function(t){Array.from(this.el.children).forEach((function(e,n){n1&&!!o.el.closest("[data-hs-toggle-password-group]"),o.target&&o.init(),o}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsTogglePasswordCollection,this),this.isShown?this.show():this.hide(),this.el.addEventListener(this.eventType,(function(){t.isShown?t.hide():t.show(),t.fireEvent("toggle",t.target),(0,s.dispatch)("toggle.hs.toggle-select",t.el,t.target)}))},e.prototype.getMultipleToggles=function(){var t=this.el.closest("[data-hs-toggle-password-group]").querySelectorAll("[data-hs-toggle-password]"),n=[];return t.forEach((function(t){n.push(e.getInstance(t))})),n},e.prototype.show=function(){this.isMultiple?(this.getMultipleToggles().forEach((function(t){return!!t&&(t.isShown=!0)})),this.el.closest("[data-hs-toggle-password-group]").classList.add("active")):(this.isShown=!0,this.el.classList.add("active"));this.target.forEach((function(t){t.type="text"}))},e.prototype.hide=function(){this.isMultiple?(this.getMultipleToggles().forEach((function(t){return!!t&&(t.isShown=!1)})),this.el.closest("[data-hs-toggle-password-group]").classList.remove("active")):(this.isShown=!1,this.el.classList.remove("active"));this.target.forEach((function(t){t.type="password"}))},e.getInstance=function(t,e){var n=window.$hsTogglePasswordCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsTogglePasswordCollection||(window.$hsTogglePasswordCollection=[]),document.querySelectorAll("[data-hs-toggle-password]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsTogglePasswordCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=l),e.default=l},679:function(t,e,n){ /* * HSTooltip - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n{Object.defineProperty(e,"__esModule",{value:!0}),e.COLLECTIONS=void 0;var o=n(413),i=n(460),r=n(629),s=n(652),l=n(610),a=n(371),c=n(770),u=n(659),d=n(139),p=n(591),h=n(233),f=n(957),v=n(983),m=n(949),y=n(87),g=n(366),w=n(679);e.COLLECTIONS=[{key:"copy-markup",fn:o.default},{key:"accordion",fn:i.default},{key:"carousel",fn:r.default},{key:"collapse",fn:s.default},{key:"dropdown",fn:l.default},{key:"input-number",fn:a.default},{key:"overlay",fn:c.default},{key:"pin-input",fn:u.default},{key:"remove-element",fn:d.default},{key:"scrollspy",fn:p.default},{key:"select",fn:h.default},{key:"stepper",fn:f.default},{key:"strong-password",fn:v.default},{key:"tabs",fn:m.default},{key:"toggle-count",fn:y.default},{key:"toggle-password",fn:g.default},{key:"tooltip",fn:w.default}]},313:(t,e,n)=>{ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n{Object.defineProperty(e,"__esModule",{value:!0}),e.COLLECTIONS=void 0;var o=n(413),i=n(460),r=n(629),s=n(652),l=n(23),a=n(610),c=n(371),u=n(770),d=n(659),p=n(139),h=n(591),f=n(233),m=n(957),v=n(983),y=n(949),g=n(87),w=n(366),b=n(679);e.COLLECTIONS=[{key:"copy-markup",fn:o.default},{key:"accordion",fn:i.default},{key:"carousel",fn:r.default},{key:"collapse",fn:s.default},{key:"combobox",fn:l.default},{key:"dropdown",fn:a.default},{key:"input-number",fn:c.default},{key:"overlay",fn:u.default},{key:"pin-input",fn:d.default},{key:"remove-element",fn:p.default},{key:"scrollspy",fn:h.default},{key:"select",fn:f.default},{key:"stepper",fn:m.default},{key:"strong-password",fn:v.default},{key:"tabs",fn:y.default},{key:"toggle-count",fn:g.default},{key:"toggle-password",fn:w.default},{key:"tooltip",fn:b.default}]},313:(t,e,n)=>{ /* * HSStaticMethods - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -Object.defineProperty(e,"__esModule",{value:!0});var o=n(969),i=n(362),r={getClassProperty:o.getClassProperty,afterTransition:o.afterTransition,autoInit:function(t){void 0===t&&(t="all"),"all"===t?i.COLLECTIONS.forEach((function(t){var e=t.fn;null==e||e.autoInit()})):i.COLLECTIONS.forEach((function(e){var n=e.key,o=e.fn;t.includes(n)&&(null==o||o.autoInit())}))}};"undefined"!=typeof window&&(window.HSStaticMethods=r),e.default=r},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=void 0;e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,l=window.innerHeight,a=s?r.top-s.top:r.top,c=(i?s.bottom:l)-r.bottom,u=t.clientHeight+o;return"bottom"===n?c>=u:"top"===n?a>=u:a>=u||c>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.HSStaticMethods=t.HSTooltip=t.HSTogglePassword=t.HSToggleCount=t.HSThemeSwitch=t.HSTabs=t.HSStrongPassword=t.HSStepper=t.HSSelect=t.HSScrollspy=t.HSSearchByJson=t.HSRemoveElement=t.HSPinInput=t.HSOverlay=t.HSInputNumber=t.HSDropdown=t.HSCollapse=t.HSCarousel=t.HSAccordion=t.HSCopyMarkup=void 0;var e=n(413);Object.defineProperty(t,"HSCopyMarkup",{enumerable:!0,get:function(){return e.default}});var i=n(460);Object.defineProperty(t,"HSAccordion",{enumerable:!0,get:function(){return i.default}});var r=n(629);Object.defineProperty(t,"HSCarousel",{enumerable:!0,get:function(){return r.default}});var s=n(652);Object.defineProperty(t,"HSCollapse",{enumerable:!0,get:function(){return s.default}});var l=n(610);Object.defineProperty(t,"HSDropdown",{enumerable:!0,get:function(){return l.default}});var a=n(371);Object.defineProperty(t,"HSInputNumber",{enumerable:!0,get:function(){return a.default}});var c=n(770);Object.defineProperty(t,"HSOverlay",{enumerable:!0,get:function(){return c.default}});var u=n(659);Object.defineProperty(t,"HSPinInput",{enumerable:!0,get:function(){return u.default}});var d=n(139);Object.defineProperty(t,"HSRemoveElement",{enumerable:!0,get:function(){return d.default}});var p=n(961);Object.defineProperty(t,"HSSearchByJson",{enumerable:!0,get:function(){return p.default}});var h=n(591);Object.defineProperty(t,"HSScrollspy",{enumerable:!0,get:function(){return h.default}});var f=n(233);Object.defineProperty(t,"HSSelect",{enumerable:!0,get:function(){return f.default}});var v=n(957);Object.defineProperty(t,"HSStepper",{enumerable:!0,get:function(){return v.default}});var m=n(983);Object.defineProperty(t,"HSStrongPassword",{enumerable:!0,get:function(){return m.default}});var y=n(949);Object.defineProperty(t,"HSTabs",{enumerable:!0,get:function(){return y.default}});var g=n(557);Object.defineProperty(t,"HSThemeSwitch",{enumerable:!0,get:function(){return g.default}});var w=n(87);Object.defineProperty(t,"HSToggleCount",{enumerable:!0,get:function(){return w.default}});var b=n(366);Object.defineProperty(t,"HSTogglePassword",{enumerable:!0,get:function(){return b.default}});var C=n(679);Object.defineProperty(t,"HSTooltip",{enumerable:!0,get:function(){return C.default}});var S=n(313);Object.defineProperty(t,"HSStaticMethods",{enumerable:!0,get:function(){return S.default}})})(),o})())); \ No newline at end of file +Object.defineProperty(e,"__esModule",{value:!0});var o=n(969),i=n(362),r={getClassProperty:o.getClassProperty,afterTransition:o.afterTransition,autoInit:function(t){void 0===t&&(t="all"),"all"===t?i.COLLECTIONS.forEach((function(t){var e=t.fn;null==e||e.autoInit()})):i.COLLECTIONS.forEach((function(e){var n=e.key,o=e.fn;t.includes(n)&&(null==o||o.autoInit())}))}};"undefined"!=typeof window&&(window.HSStaticMethods=r),e.default=r},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0;e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,l=window.innerHeight,a=s?r.top-s.top:r.top,c=(i?s.bottom:l)-r.bottom,u=t.clientHeight+o;return"bottom"===n?c>=u:"top"===n?a>=u:a>=u||c>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.HSStaticMethods=t.HSTooltip=t.HSTogglePassword=t.HSToggleCount=t.HSThemeSwitch=t.HSTabs=t.HSStrongPassword=t.HSStepper=t.HSSelect=t.HSScrollspy=t.HSSearchByJson=t.HSRemoveElement=t.HSPinInput=t.HSOverlay=t.HSInputNumber=t.HSDropdown=t.HSComboBox=t.HSCollapse=t.HSCarousel=t.HSAccordion=t.HSCopyMarkup=void 0;var e=n(413);Object.defineProperty(t,"HSCopyMarkup",{enumerable:!0,get:function(){return e.default}});var i=n(460);Object.defineProperty(t,"HSAccordion",{enumerable:!0,get:function(){return i.default}});var r=n(629);Object.defineProperty(t,"HSCarousel",{enumerable:!0,get:function(){return r.default}});var s=n(652);Object.defineProperty(t,"HSCollapse",{enumerable:!0,get:function(){return s.default}});var l=n(23);Object.defineProperty(t,"HSComboBox",{enumerable:!0,get:function(){return l.default}});var a=n(610);Object.defineProperty(t,"HSDropdown",{enumerable:!0,get:function(){return a.default}});var c=n(371);Object.defineProperty(t,"HSInputNumber",{enumerable:!0,get:function(){return c.default}});var u=n(770);Object.defineProperty(t,"HSOverlay",{enumerable:!0,get:function(){return u.default}});var d=n(659);Object.defineProperty(t,"HSPinInput",{enumerable:!0,get:function(){return d.default}});var p=n(139);Object.defineProperty(t,"HSRemoveElement",{enumerable:!0,get:function(){return p.default}});var h=n(961);Object.defineProperty(t,"HSSearchByJson",{enumerable:!0,get:function(){return h.default}});var f=n(591);Object.defineProperty(t,"HSScrollspy",{enumerable:!0,get:function(){return f.default}});var m=n(233);Object.defineProperty(t,"HSSelect",{enumerable:!0,get:function(){return m.default}});var v=n(957);Object.defineProperty(t,"HSStepper",{enumerable:!0,get:function(){return v.default}});var y=n(983);Object.defineProperty(t,"HSStrongPassword",{enumerable:!0,get:function(){return y.default}});var g=n(949);Object.defineProperty(t,"HSTabs",{enumerable:!0,get:function(){return g.default}});var w=n(557);Object.defineProperty(t,"HSThemeSwitch",{enumerable:!0,get:function(){return w.default}});var b=n(87);Object.defineProperty(t,"HSToggleCount",{enumerable:!0,get:function(){return b.default}});var C=n(366);Object.defineProperty(t,"HSTogglePassword",{enumerable:!0,get:function(){return C.default}});var S=n(679);Object.defineProperty(t,"HSTooltip",{enumerable:!0,get:function(){return S.default}});var x=n(313);Object.defineProperty(t,"HSStaticMethods",{enumerable:!0,get:function(){return x.default}})})(),o})())); \ No newline at end of file diff --git a/dist/remove-element.d.ts b/dist/remove-element.d.ts index a84337d..33978b6 100644 --- a/dist/remove-element.d.ts +++ b/dist/remove-element.d.ts @@ -1,10 +1,5 @@ -export interface IRemoveElementOptions { - removeTargetAnimationClass: string; -} -export interface IRemoveElement { - options?: IRemoveElementOptions; -} + export interface IBasePlugin { el: E; options?: O; @@ -19,6 +14,12 @@ declare class HSBasePlugin implements IBasePlugin { fireEvent(evt: string, payload?: any): any; on(evt: string, cb: Function): void; } +export interface IRemoveElementOptions { + removeTargetAnimationClass: string; +} +export interface IRemoveElement { + options?: IRemoveElementOptions; +} declare class HSRemoveElement extends HSBasePlugin implements IRemoveElement { private readonly removeTargetId; private readonly removeTarget; diff --git a/dist/remove-element.js b/dist/remove-element.js index dc879c3..91ef3c2 100644 --- a/dist/remove-element.js +++ b/dist/remove-element.js @@ -1,7 +1,7 @@ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,9 +9,9 @@ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},139:function(t,e,n){ /* * HSRemoveElement - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,a=window.innerHeight,l=s?r.top-s.top:r.top,u=(i?s.bottom:a)-r.bottom,c=t.clientHeight+o;return"bottom"===n?u>=c:"top"===n?l>=c:l>=c||u>=c};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}(139);return n})())); \ No newline at end of file +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,a=window.innerHeight,l=s?r.top-s.top:r.top,u=(i?s.bottom:a)-r.bottom,c=t.clientHeight+o;return"bottom"===n?u>=c:"top"===n?l>=c:l>=c||u>=c};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}(139);return n})())); \ No newline at end of file diff --git a/dist/scrollspy.d.ts b/dist/scrollspy.d.ts index fff25fd..c4d2651 100644 --- a/dist/scrollspy.d.ts +++ b/dist/scrollspy.d.ts @@ -1,7 +1,5 @@ -export interface IScrollspy { - options?: {}; -} + export interface IBasePlugin { el: E; options?: O; @@ -20,6 +18,9 @@ export interface ICollectionItem { id: string | number; element: T; } +export interface IScrollspy { + options?: {}; +} declare class HSScrollspy extends HSBasePlugin<{}> implements IScrollspy { private activeSection; private readonly contentId; diff --git a/dist/scrollspy.js b/dist/scrollspy.js index 3b6b6ab..53c163c 100644 --- a/dist/scrollspy.js +++ b/dist/scrollspy.js @@ -1,7 +1,7 @@ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,9 +9,9 @@ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},591:function(t,e,n){ /* * HSScrollspy - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(969),l=function(t){function e(e,n){void 0===n&&(n={});var o=t.call(this,e,n)||this;return o.activeSection=null,o.contentId=o.el.getAttribute("data-hs-scrollspy"),o.content=document.querySelector(o.contentId),o.links=o.el.querySelectorAll("[href]"),o.sections=[],o.scrollableId=o.el.getAttribute("data-hs-scrollspy-scrollable-parent"),o.scrollable=o.scrollableId?document.querySelector(o.scrollableId):document,o.init(),o}return r(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsScrollspyCollection,this),this.links.forEach((function(e){t.sections.push(t.scrollable.querySelector(e.getAttribute("href")))})),Array.from(this.sections).forEach((function(e){if(!e.getAttribute("id"))return!1;t.scrollable.addEventListener("scroll",(function(n){return t.update(n,e)}))})),this.links.forEach((function(e){e.addEventListener("click",(function(n){if(n.preventDefault(),"javascript:;"===e.getAttribute("href"))return!1;t.scrollTo(e)}))}))},e.prototype.update=function(t,e){var n=parseInt((0,i.getClassProperty)(this.el,"--scrollspy-offset","0")),o=parseInt((0,i.getClassProperty)(e,"--scrollspy-offset"))||n,r=t.target===document?0:parseInt(String(t.target.getBoundingClientRect().top)),l=parseInt(String(e.getBoundingClientRect().top))-o-r,s=e.offsetHeight;if(l<=0&&l+s>0){if(this.activeSection===e)return!1;this.links.forEach((function(t){t.classList.remove("active")}));var c=this.el.querySelector('[href="#'.concat(e.getAttribute("id"),'"]'));if(c){c.classList.add("active");var a=c.closest("[data-hs-scrollspy-group]");if(a){var u=a.querySelector("[href]");u&&u.classList.add("active")}}this.activeSection=e}},e.prototype.scrollTo=function(t){var e=t.getAttribute("href"),n=document.querySelector(e),o=parseInt((0,i.getClassProperty)(this.el,"--scrollspy-offset","0")),r=parseInt((0,i.getClassProperty)(n,"--scrollspy-offset"))||o,l=this.scrollable===document?0:this.scrollable.offsetTop,s=n.offsetTop-r-l,c=this.scrollable===document?window:this.scrollable,a=function(){window.history.replaceState(null,null,t.getAttribute("href")),"scrollTo"in c&&c.scrollTo({top:s,left:0,behavior:"smooth"})},u=this.fireEvent("beforeScroll",this.el);(0,i.dispatch)("beforeScroll.hs.scrollspy",this.el,this.el),u instanceof Promise?u.then((function(){return a()})):a()},e.getInstance=function(t,e){void 0===e&&(e=!1);var n=window.$hsScrollspyCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.autoInit=function(){window.$hsScrollspyCollection||(window.$hsScrollspyCollection=[]),document.querySelectorAll("[data-hs-scrollspy]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsScrollspyCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=l),e.default=l},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=void 0;e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,r){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===r&&(r=null);var i=e.getBoundingClientRect(),l=r?r.getBoundingClientRect():null,s=window.innerHeight,c=l?i.top-l.top:i.top,a=(r?l.bottom:s)-i.bottom,u=t.clientHeight+o;return"bottom"===n?a>=u:"top"===n?c>=u:c>=u||a>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var r=[],i=0;ithis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(o){var r=e[o];if(void 0!==r)return r.exports;var i=e[o]={exports:{}};return t[o].call(i.exports,i,i.exports,n),i.exports}(591);return n})())); \ No newline at end of file +var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(969),s=function(t){function e(e,n){void 0===n&&(n={});var o=t.call(this,e,n)||this;return o.activeSection=null,o.contentId=o.el.getAttribute("data-hs-scrollspy"),o.content=document.querySelector(o.contentId),o.links=o.el.querySelectorAll("[href]"),o.sections=[],o.scrollableId=o.el.getAttribute("data-hs-scrollspy-scrollable-parent"),o.scrollable=o.scrollableId?document.querySelector(o.scrollableId):document,o.init(),o}return r(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsScrollspyCollection,this),this.links.forEach((function(e){t.sections.push(t.scrollable.querySelector(e.getAttribute("href")))})),Array.from(this.sections).forEach((function(e){if(!e.getAttribute("id"))return!1;t.scrollable.addEventListener("scroll",(function(n){return t.update(n,e)}))})),this.links.forEach((function(e){e.addEventListener("click",(function(n){if(n.preventDefault(),"javascript:;"===e.getAttribute("href"))return!1;t.scrollTo(e)}))}))},e.prototype.update=function(t,e){var n=parseInt((0,i.getClassProperty)(this.el,"--scrollspy-offset","0")),o=parseInt((0,i.getClassProperty)(e,"--scrollspy-offset"))||n,r=t.target===document?0:parseInt(String(t.target.getBoundingClientRect().top)),s=parseInt(String(e.getBoundingClientRect().top))-o-r,l=e.offsetHeight;if(s<=0&&s+l>0){if(this.activeSection===e)return!1;this.links.forEach((function(t){t.classList.remove("active")}));var c=this.el.querySelector('[href="#'.concat(e.getAttribute("id"),'"]'));if(c){c.classList.add("active");var a=c.closest("[data-hs-scrollspy-group]");if(a){var u=a.querySelector("[href]");u&&u.classList.add("active")}}this.activeSection=e}},e.prototype.scrollTo=function(t){var e=t.getAttribute("href"),n=document.querySelector(e),o=parseInt((0,i.getClassProperty)(this.el,"--scrollspy-offset","0")),r=parseInt((0,i.getClassProperty)(n,"--scrollspy-offset"))||o,s=this.scrollable===document?0:this.scrollable.offsetTop,l=n.offsetTop-r-s,c=this.scrollable===document?window:this.scrollable,a=function(){window.history.replaceState(null,null,t.getAttribute("href")),"scrollTo"in c&&c.scrollTo({top:l,left:0,behavior:"smooth"})},u=this.fireEvent("beforeScroll",this.el);(0,i.dispatch)("beforeScroll.hs.scrollspy",this.el,this.el),u instanceof Promise?u.then((function(){return a()})):a()},e.getInstance=function(t,e){void 0===e&&(e=!1);var n=window.$hsScrollspyCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.autoInit=function(){window.$hsScrollspyCollection||(window.$hsScrollspyCollection=[]),document.querySelectorAll("[data-hs-scrollspy]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsScrollspyCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){s.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=s),e.default=s},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0;e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,r){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===r&&(r=null);var i=e.getBoundingClientRect(),s=r?r.getBoundingClientRect():null,l=window.innerHeight,c=s?i.top-s.top:i.top,a=(r?s.bottom:l)-i.bottom,u=t.clientHeight+o;return"bottom"===n?a>=u:"top"===n?c>=u:c>=u||a>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var r=[],i=0;ithis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(o){var r=e[o];if(void 0!==r)return r.exports;var i=e[o]={exports:{}};return t[o].call(i.exports,i,i.exports,n),i.exports}(591);return n})())); \ No newline at end of file diff --git a/dist/search-by-json.d.ts b/dist/search-by-json.d.ts index 67a2253..41261eb 100644 --- a/dist/search-by-json.d.ts +++ b/dist/search-by-json.d.ts @@ -1,4 +1,19 @@ + +export interface IBasePlugin { + el: E; + options?: O; + events?: {}; +} +declare class HSBasePlugin implements IBasePlugin { + el: E; + options: O; + events?: any; + constructor(el: E, options: O, events?: any); + createCollection(collection: any[], element: any): void; + fireEvent(evt: string, payload?: any): any; + on(evt: string, cb: Function): void; +} export interface ISearchItemTemplate { type: string; markup: string; @@ -17,20 +32,6 @@ export interface ISearchByJsonOptions { export interface ISearchByJson { options?: ISearchByJsonOptions; } -export interface IBasePlugin { - el: E; - options?: O; - events?: {}; -} -declare class HSBasePlugin implements IBasePlugin { - el: E; - options: O; - events?: any; - constructor(el: E, options: O, events?: any); - createCollection(collection: any[], element: any): void; - fireEvent(evt: string, payload?: any): any; - on(evt: string, cb: Function): void; -} declare class HSSearchByJson extends HSBasePlugin implements ISearchByJson { private readonly jsonUrl; private readonly minChars; diff --git a/dist/select.d.ts b/dist/select.d.ts index 7dbc595..0c466af 100644 --- a/dist/select.d.ts +++ b/dist/select.d.ts @@ -1,4 +1,23 @@ + +export interface IBasePlugin { + el: E; + options?: O; + events?: {}; +} +declare class HSBasePlugin implements IBasePlugin { + el: E; + options: O; + events?: any; + constructor(el: E, options: O, events?: any); + createCollection(collection: any[], element: any): void; + fireEvent(evt: string, payload?: any): any; + on(evt: string, cb: Function): void; +} +export interface ICollectionItem { + id: string | number; + element: T; +} export interface ISingleOptionOptions { description: string; icon: string; @@ -13,13 +32,14 @@ export interface ISelectOptions { isOpened?: boolean; placeholder?: string; hasSearch?: boolean; + preventSearchFocus?: boolean; mode?: string; viewport?: string; + wrapperClasses?: string; toggleTag?: string; toggleClasses?: string; toggleCountText?: string; toggleCountTextMinItems?: number; - tagsClasses?: string; tagsItemTemplate?: string; tagsItemClasses?: string; tagsInputClasses?: string; @@ -30,6 +50,7 @@ export interface ISelectOptions { bottom?: string; }; dropdownSpace: number; + extraMarkup?: string | string[] | null; searchWrapperTemplate?: string; searchClasses?: string; searchWrapperClasses?: string; @@ -52,38 +73,22 @@ export interface ISelect { removeOption(values: string | string[]): void; recalculateDirection(): void; } -export interface IBasePlugin { - el: E; - options?: O; - events?: {}; -} -declare class HSBasePlugin implements IBasePlugin { - el: E; - options: O; - events?: any; - constructor(el: E, options: O, events?: any); - createCollection(collection: any[], element: any): void; - fireEvent(evt: string, payload?: any): any; - on(evt: string, cb: Function): void; -} -export interface ICollectionItem { - id: string | number; - element: T; -} declare class HSSelect extends HSBasePlugin implements ISelect { value: string | string[] | null; private readonly placeholder; private readonly hasSearch; + private readonly preventSearchFocus; private readonly mode; private readonly viewport; isOpened: boolean | null; isMultiple: boolean | null; isDisabled: boolean | null; + selectedItems: string[]; private readonly toggleTag; private readonly toggleClasses; private readonly toggleCountText; private readonly toggleCountTextMinItems; - private readonly tagsClasses; + private readonly wrapperClasses; private readonly tagsItemTemplate; private readonly tagsItemClasses; private readonly tagsInputClasses; @@ -106,24 +111,25 @@ declare class HSSelect extends HSBasePlugin implements ISelect { private wrapper; private toggle; private toggleTextWrapper; - private tags; - private tagsItems; private tagsInput; private dropdown; private searchWrapper; private search; private searchNoResult; private selectOptions; + private extraMarkup; private readonly isAddTagOnEnter; + private tagsInputHelper; constructor(el: HTMLElement, options?: ISelectOptions); private init; private build; private buildWrapper; + private buildExtraMarkup; private buildToggle; private setToggleIcon; private setToggleTitle; private buildTags; - private buildTagsItems; + private reassignTagsInputPlaceholder; private buildTagsItem; private getItemByValue; private setTagsItems; @@ -134,6 +140,9 @@ declare class HSSelect extends HSBasePlugin implements ISelect { private destroyOption; private buildOriginalOption; private destroyOriginalOption; + private buildTagsInputHelper; + private calculateInputWidth; + private adjustInputWidth; private onSelectOption; private addSelectOption; private removeSelectOption; diff --git a/dist/select.js b/dist/select.js index a41f44b..72aae8d 100644 --- a/dist/select.js +++ b/dist/select.js @@ -1,17 +1,17 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var s=e();for(var o in s)("object"==typeof exports?exports:t)[o]=s[o]}}(self,(()=>(()=>{"use strict";var t={190:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.COMBO_BOX_ACCESSIBILITY_KEY_SET=e.SELECT_ACCESSIBILITY_KEY_SET=e.TABS_ACCESSIBILITY_KEY_SET=e.OVERLAY_ACCESSIBILITY_KEY_SET=e.DROPDOWN_ACCESSIBILITY_KEY_SET=e.POSITIONS=void 0,e.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},e.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],e.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],e.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],e.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],e.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"]},737:(t,e)=>{ +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var s in n)("object"==typeof exports?exports:t)[s]=n[s]}}(self,(()=>(()=>{"use strict";var t={190:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BREAKPOINTS=e.COMBO_BOX_ACCESSIBILITY_KEY_SET=e.SELECT_ACCESSIBILITY_KEY_SET=e.TABS_ACCESSIBILITY_KEY_SET=e.OVERLAY_ACCESSIBILITY_KEY_SET=e.DROPDOWN_ACCESSIBILITY_KEY_SET=e.POSITIONS=void 0,e.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},e.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],e.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],e.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],e.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],e.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],e.BREAKPOINTS={sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e,s){this.el=t,this.options=e,this.events=s,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var s;t.push({id:(null===(s=null==e?void 0:e.el)||void 0===s?void 0:s.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=s},233:function(t,e,s){ +Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},233:function(t,e,n){ /* * HSSelect - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function s(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(s.prototype=e.prototype,new s)}),n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,s=1,o=arguments.length;s"),e=this.toggle.querySelector("[data-icon]"),s=this.toggle.querySelector("[data-title]"),!this.isMultiple&&e&&this.setToggleIcon(),!this.isMultiple&&s&&this.setToggleTitle(),this.isMultiple?this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder:this.toggleTextWrapper.innerHTML=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder,s||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,r.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),this.toggle.addEventListener("click",(function(){if(o.isDisabled)return!1;o.isOpened?o.close():o.open()}))},e.prototype.setToggleIcon=function(){var t,e,s=this.toggle.querySelector("[data-icon]");if(s.innerHTML="",s){var o=(0,r.htmlToElement)((null===(e=null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.options)||void 0===e?void 0:e.icon)||"");s.append(o),o?s.classList.remove("hidden"):s.classList.add("hidden")}},e.prototype.setToggleTitle=function(){var t,e=this.toggle.querySelector("[data-title]");if(e.classList.add("truncate"),e.innerHTML="",e){var s=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder;e.innerHTML=s,this.toggle.append(e)}},e.prototype.buildTags=function(){this.tags=document.createElement("div"),this.tags.classList.add("flex"),this.tagsClasses&&(0,r.classToClassList)(this.tagsClasses,this.tags),this.buildTagsInput(),this.buildTagsItems(),this.setTagsItems(),this.wrapper&&this.wrapper.append(this.tags)},e.prototype.buildTagsItems=function(){this.tagsItems=document.createElement("div"),this.tagsItems.classList.add("flex","flex-wrap","flex-0","items-center"),this.setTagsItems(),this.tags.append(this.tagsItems)},e.prototype.buildTagsItem=function(t){var e,s,o,i,n,l,a,d=this,c=this.getItemByValue(t),u=document.createElement("div");if(this.tagsItemClasses&&(0,r.classToClassList)(this.tagsItemClasses,u),this.tagsItemTemplate&&(i=(0,r.htmlToElement)(this.tagsItemTemplate),u.append(i)),null===(e=null==c?void 0:c.options)||void 0===e?void 0:e.icon){var p=(0,r.htmlToElement)(null===(s=null==c?void 0:c.options)||void 0===s?void 0:s.icon);(a=i?i.querySelector("[data-icon]"):document.createElement("span")).append(p),i||u.append(a)}i&&i.querySelector("[data-icon]")&&!(null===(o=null==c?void 0:c.options)||void 0===o?void 0:o.icon)&&i.querySelector("[data-icon]").classList.add("hidden"),(n=i?i.querySelector("[data-title]"):document.createElement("span")).textContent=c.title||"",i||u.append(n),i?l=i.querySelector("[data-remove]"):((l=document.createElement("span")).textContent="X",u.append(l)),l.addEventListener("click",(function(){d.value=d.value.filter((function(e){return e!==t})),d.unselectMultipleItems(),d.setTagsItems(),d.selectMultipleItems()})),this.tagsItems.append(u)},e.prototype.getItemByValue=function(t){return this.selectOptions.find((function(e){return e.val===t}))},e.prototype.setTagsItems=function(){var t=this;this.tagsItems.innerHTML="",this.value&&(this.value.forEach((function(e){t.buildTagsItem(e)})),this.tagsInput.readOnly=!0),this.value.length||(this.tagsInput.placeholder=this.placeholder,this.tagsInput.readOnly=!1)},e.prototype.buildTagsInput=function(){var t=this;this.tagsInput=document.createElement("input"),this.tagsInput.placeholder=this.placeholder,this.tagsInputClasses&&(0,r.classToClassList)(this.tagsInputClasses,this.tagsInput),this.tagsInput.addEventListener("focus",(function(){return t.open()})),this.tagsInput.addEventListener("input",(0,r.debounce)((function(e){return t.searchOptions(e.target.value)}))),this.tagsInput.addEventListener("keydown",(function(e){if("Enter"===e.key&&t.isAddTagOnEnter){var s=e.target.value;if(t.selectOptions.find((function(t){return t.val===s})))return!1;t.addSelectOption(s,s),t.buildOption(s,s),t.dropdown.querySelector('[data-value="'.concat(s,'"]')).click(),t.resetTagsInputField(),t.close()}})),this.tags.append(this.tagsInput)},e.prototype.buildDropdown=function(){var t=this;this.dropdown=(0,r.htmlToElement)(this.dropdownTag||"
"),this.dropdown.classList.add("absolute","top-full"),this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,r.classToClassList)(this.dropdownClasses,this.dropdown),this.wrapper&&this.wrapper.append(this.dropdown),this.dropdown&&this.hasSearch&&this.buildSearch(),this.selectOptions&&this.selectOptions.forEach((function(e,s){return t.buildOption(e.title,e.val,e.options,"".concat(s))}))},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,r.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,r.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]"),this.search=(0,r.htmlToElement)(''),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,r.classToClassList)(this.searchClasses,this.search),this.search.addEventListener("input",(0,r.debounce)((function(t){return e.searchOptions(t.target.value)}))),t?t.append(this.search):this.searchWrapper.append(this.search),this.dropdown.append(this.searchWrapper)},e.prototype.buildOption=function(t,e,s,o){var i=this;void 0===o&&(o="1");var n=null,l=(0,r.htmlToElement)(this.optionTag||"
");if(l.setAttribute("data-value",e),l.setAttribute("data-title-value",t),l.setAttribute("tabIndex",o),l.classList.add("cursor-pointer"),this.optionTemplate&&(n=(0,r.htmlToElement)(this.optionTemplate),l.append(n)),n?n.querySelector("[data-title]").textContent=t||"":l.textContent=t||"",s){if(s.icon){var a=(0,r.htmlToElement)(s.icon);if(a.classList.add("mw-full"),n)n.querySelector("[data-icon]").append(a);else{var d=(0,r.htmlToElement)("
");this.iconClasses&&(0,r.classToClassList)(this.iconClasses,d),d.append(a),l.append(d)}}if(s.description)if(n)n.querySelector("[data-description]").append(s.description);else{var c=(0,r.htmlToElement)("
");c.textContent=s.description,this.descriptionClasses&&(0,r.classToClassList)(this.descriptionClasses,c),l.append(c)}}n&&n.querySelector("[data-icon]")&&!s&&!(null==s?void 0:s.icon)&&n.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&l.classList.add("selected"),l.addEventListener("click",(function(){return i.onSelectOption(e)})),this.optionClasses&&(0,r.classToClassList)(this.optionClasses,l),this.dropdown&&this.dropdown.append(l)},e.prototype.destroyOption=function(t){var e=this.dropdown.querySelector('[data-value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.buildOriginalOption=function(t,e,s){var o=(0,r.htmlToElement)("");o.setAttribute("value",e),o.setAttribute("data-hs-select-option",JSON.stringify(s)),o.innerText=t,this.el.append(o)},e.prototype.destroyOriginalOption=function(t){var e=this.el.querySelector('[value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.onSelectOption=function(t){this.clearSelections(),this.isMultiple?(this.value=this.value.includes(t)?Array.from(this.value).filter((function(e){return e!==t})):l(l([],Array.from(this.value),!0),[t],!1),this.selectMultipleItems(),this.setNewValue()):(this.value=t,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),(0,r.dispatch)("change.hs.select",this.el,this.value),"tags"===this.mode&&this.resetTagsInputField(),this.isMultiple||(this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.close()),this.value.length||"tags"!==this.mode||(this.tagsInput.placeholder=this.placeholder)},e.prototype.addSelectOption=function(t,e,s){this.selectOptions=l(l([],this.selectOptions,!0),[{title:t,val:e,options:s}],!1)},e.prototype.removeSelectOption=function(t){if(!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t}))},e.prototype.resetTagsInputField=function(){this.tagsInput.value="",this.tagsInput.placeholder="",this.searchOptions("")},e.prototype.clearSelections=function(){Array.from(this.dropdown.children).forEach((function(t){t.classList.contains("selected")&&t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){t.selected&&(t.selected=!1)}))},e.prototype.setNewValue=function(){"tags"===this.mode?this.setTagsItems():this.value.length?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.stringFromValue=function(){var t=this,e=[];return this.selectOptions.forEach((function(s){t.isMultiple?t.value.includes(s.val)&&e.push(s.title):t.value===s.val&&e.push(s.title)})),this.toggleCountText&&""!==this.toggleCountText&&e.length>=this.toggleCountTextMinItems?"".concat(e.length," ").concat(this.toggleCountText):e.join(", ")},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0,Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")})).classList.add("selected")},e.prototype.selectMultipleItems=function(){var t=this;Array.from(this.dropdown.children).filter((function(e){return t.value.includes(e.getAttribute("data-value"))})).forEach((function(t){return t.classList.add("selected")})),Array.from(this.el.children).filter((function(e){return t.value.includes(e.value)})).forEach((function(t){return t.selected=!0}))},e.prototype.unselectMultipleItems=function(){Array.from(this.dropdown.children).forEach((function(t){return t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){return t.selected=!1}))},e.prototype.searchOptions=function(t){this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,r.htmlToElement)(""),this.searchNoResult.innerText=this.searchNoResultText,(0,r.classToClassList)(this.searchNoResultClasses,this.searchNoResult);var e=this.dropdown.querySelectorAll("[data-value]"),s=!1;e.forEach((function(e){e.getAttribute("data-title-value").toLowerCase().includes(t.toLowerCase())?(e.classList.remove("hidden"),s=!0):e.classList.add("hidden")})),s||this.dropdown.append(this.searchNoResult)},e.prototype.eraseToggleIcon=function(){var t=this.toggle.querySelector("[data-icon]");t&&(t.innerHTML=null,t.classList.add("hidden"))},e.prototype.eraseToggleTitle=function(){var t=this.toggle.querySelector("[data-title]");t?t.innerHTML=this.placeholder:this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.destroy=function(){var t=this.el.parentElement.parentElement;this.el.classList.remove("hidden"),this.el.style.display="",t.prepend(this.el),t.querySelector(".hs-select").remove(),this.wrapper=null},e.prototype.open=function(){var t=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){t.wrapper.classList.add("active"),t.dropdown.classList.add("opened"),t.hasSearch&&t.search.focus(),t.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,s,o=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,r.afterTransition)(this.dropdown,(function(){o.dropdown.classList.add("hidden"),o.hasSearch&&(o.search.value="",o.search.dispatchEvent(new Event("input",{bubbles:!0})),o.search.blur()),o.animationInProcess=!1})),null===(s=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===s||s.classList.remove("hs-select-option-highlighted"),this.isOpened=!1},e.prototype.addOption=function(t){var e=this,s="".concat(this.selectOptions.length),o=function(t){var o=t.title,i=t.val,n=t.options;!!e.selectOptions.some((function(t){return t.val===i}))||(e.addSelectOption(o,i,n),e.buildOption(o,i,n,s),e.buildOriginalOption(o,i,n))};Array.isArray(t)?t.forEach((function(t){o(t)})):o(t)},e.prototype.removeOption=function(t){var e=this,s=function(t){!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t),e.destroyOption(t),e.destroyOriginalOption(t),e.value===t&&(e.value=null,e.eraseToggleTitle(),e.eraseToggleIcon()))};Array.isArray(t)?t.forEach((function(t){s(t)})):s(t)},e.prototype.recalculateDirection=function(){var t,e,s,o;(0,r.isEnoughSpace)(this.dropdown,this.toggle||this.tagsInput,"bottom",this.dropdownSpace,this.viewport)?(this.dropdown.classList.remove("bottom-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="",this.dropdown.classList.add("top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.add(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="".concat(this.dropdownSpace,"px")):(this.dropdown.classList.remove("top-full"),(null===(s=this.dropdownDirectionClasses)||void 0===s?void 0:s.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.classList.add("bottom-full"),(null===(o=this.dropdownDirectionClasses)||void 0===o?void 0:o.bottom)&&this.dropdown.classList.add(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="".concat(this.dropdownSpace,"px"))},e.getInstance=function(t,e){var s=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return s?e?s:s.element:null},e.autoInit=function(){window.$hsSelectCollection||(window.$hsSelectCollection=[]),document.querySelectorAll("[data-hs-select]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsSelectCollection.find((function(e){var s;return(null===(s=null==e?void 0:e.element)||void 0===s?void 0:s.el)===t}))){var s=t.getAttribute("data-hs-select"),o=s?JSON.parse(s):{};new e(t,o)}})),window.$hsSelectCollection&&(window.addEventListener("click",(function(t){var s=t.target;e.closeCurrentlyOpened(s)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.close=function(t){var e=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.isOpened&&e.element.close()},e.closeCurrentlyOpened=function(t){if(void 0===t&&(t=null),!t.closest(".hs-select.active")){var e=window.$hsSelectCollection.filter((function(t){return t.element.isOpened}))||null;e&&e.forEach((function(t){t.element.close()}))}},e.accessibility=function(t){var e=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));if(e&&d.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(console.log(e),console.log("Key code:",t.code),t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Tab":t.preventDefault(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}},e.onEscape=function(){var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.close()},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));if(e){var s=e.element.dropdown;if(!s)return!1;var o=(t?Array.from(s.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(s.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=s.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var n=o.findIndex((function(t){return t===i}));n+1 *:not(.hidden)")).reverse():Array.from(s.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=s.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var n=o.findIndex((function(t){return t===i}));if(!(n+1 *:not(.hidden)")):Array.from(s.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((function(t){return!t.classList.contains("disabled")})),i=s.querySelector(".hs-select-option-highlighted");o.length&&(o[0].focus(),i&&i.classList.remove("hs-select-option-highlighted"),o[0].classList.add("hs-select-option-highlighted"))}},e.onEnter=function(t){var e=t.target.previousSibling;if(window.$hsSelectCollection.find((function(t){return t.element.el===e}))){var s=window.$hsSelectCollection.find((function(t){return t.element.isOpened})),o=window.$hsSelectCollection.find((function(t){return t.element.el===e}));s.element.close(),o.element.open()}else{(o=window.$hsSelectCollection.find((function(t){return t.element.isOpened})))&&o.element.onSelectOption(t.target.dataset.value||"")}},e}(a.default);window.addEventListener("load",(function(){c.autoInit()})),document.addEventListener("scroll",(function(){if(!window.$hsSelectCollection)return!1;var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSSelect=c),e.default=c},969:function(t,e){var s=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=void 0;e.getClassProperty=function(t,e,s){return void 0===s&&(s=""),(window.getComputedStyle(t).getPropertyValue(e)||s).replace(" ","")};e.getClassPropertyAlt=function(t,e,s){void 0===s&&(s="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:s};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,s,o,i){void 0===s&&(s="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var n=e.getBoundingClientRect(),l=i?i.getBoundingClientRect():null,r=window.innerHeight,a=l?n.top-l.top:n.top,d=(i?l.bottom:r)-n.bottom,c=t.clientHeight+o;return"bottom"===s?d>=c:"top"===s?a>=c:a>=c||d>=c};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],n=0;nthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var s=function s(o){var i=e[o];if(void 0!==i)return i.exports;var n=e[o]={exports:{}};return t[o].call(n.exports,n,n.exports,s),n.exports}(233);return s})())); \ No newline at end of file +var s,i=this&&this.__extends||(s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},s(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,s=arguments.length;n"),e=this.toggle.querySelector("[data-icon]"),n=this.toggle.querySelector("[data-title]"),!this.isMultiple&&e&&this.setToggleIcon(),!this.isMultiple&&n&&this.setToggleTitle(),this.isMultiple?this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder:this.toggleTextWrapper.innerHTML=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder,n||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,r.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),this.toggle.addEventListener("click",(function(){if(s.isDisabled)return!1;s.isOpened?s.close():s.open()}))},e.prototype.setToggleIcon=function(){var t,e,n=this.toggle.querySelector("[data-icon]");if(n.innerHTML="",n){var s=(0,r.htmlToElement)((null===(e=null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.options)||void 0===e?void 0:e.icon)||"");n.append(s),s?n.classList.remove("hidden"):n.classList.add("hidden")}},e.prototype.setToggleTitle=function(){var t,e=this.toggle.querySelector("[data-title]");if(e.classList.add("truncate"),e.innerHTML="",e){var n=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder;e.innerHTML=n,this.toggle.append(e)}},e.prototype.buildTags=function(){this.buildTagsInput(),this.setTagsItems()},e.prototype.reassignTagsInputPlaceholder=function(t){this.tagsInput.placeholder=t,this.tagsInputHelper.innerHTML=t,this.calculateInputWidth()},e.prototype.buildTagsItem=function(t){var e,n,s,i,o,l,a,d=this,c=this.getItemByValue(t),u=document.createElement("div");if(u.setAttribute("data-tag-value",t),this.tagsItemClasses&&(0,r.classToClassList)(this.tagsItemClasses,u),this.tagsItemTemplate&&(i=(0,r.htmlToElement)(this.tagsItemTemplate),u.append(i)),null===(e=null==c?void 0:c.options)||void 0===e?void 0:e.icon){var p=(0,r.htmlToElement)(null===(n=null==c?void 0:c.options)||void 0===n?void 0:n.icon);(a=i?i.querySelector("[data-icon]"):document.createElement("span")).append(p),i||u.append(a)}i&&i.querySelector("[data-icon]")&&!(null===(s=null==c?void 0:c.options)||void 0===s?void 0:s.icon)&&i.querySelector("[data-icon]").classList.add("hidden"),(o=i?i.querySelector("[data-title]"):document.createElement("span")).textContent=c.title||"",i||u.append(o),i?l=i.querySelector("[data-remove]"):((l=document.createElement("span")).textContent="X",u.append(l)),l.addEventListener("click",(function(){d.value=d.value.filter((function(e){return e!==t})),d.selectedItems=d.selectedItems.filter((function(e){return e!==t})),d.value.length||d.reassignTagsInputPlaceholder(d.placeholder),d.unselectMultipleItems(),d.selectMultipleItems(),u.remove()})),this.wrapper.append(u)},e.prototype.getItemByValue=function(t){return this.selectOptions.find((function(e){return e.val===t}))},e.prototype.setTagsItems=function(){var t=this;this.value&&this.value.forEach((function(e){t.selectedItems.includes(e)||t.buildTagsItem(e),t.selectedItems=t.selectedItems.includes(e)?t.selectedItems:l(l([],t.selectedItems,!0),[e],!1)}))},e.prototype.buildTagsInput=function(){var t=this;this.tagsInput=document.createElement("input"),this.tagsInputClasses&&(0,r.classToClassList)(this.tagsInputClasses,this.tagsInput),this.tagsInput.addEventListener("focus",(function(){return t.open()})),this.tagsInput.addEventListener("input",(function(){return t.calculateInputWidth()})),this.tagsInput.addEventListener("input",(0,r.debounce)((function(e){return t.searchOptions(e.target.value)}))),this.tagsInput.addEventListener("keydown",(function(e){if("Enter"===e.key&&t.isAddTagOnEnter){var n=e.target.value;if(t.selectOptions.find((function(t){return t.val===n})))return!1;t.addSelectOption(n,n),t.buildOption(n,n),t.dropdown.querySelector('[data-value="'.concat(n,'"]')).click(),t.resetTagsInputField()}})),this.wrapper.append(this.tagsInput),setTimeout((function(){t.adjustInputWidth(),t.reassignTagsInputPlaceholder(t.value.length?"":t.placeholder)}))},e.prototype.buildDropdown=function(){var t=this;this.dropdown=(0,r.htmlToElement)(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),this.dropdown.classList.add("absolute","top-full"),this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,r.classToClassList)(this.dropdownClasses,this.dropdown),this.wrapper&&this.wrapper.append(this.dropdown),this.dropdown&&this.hasSearch&&this.buildSearch(),this.selectOptions&&this.selectOptions.forEach((function(e,n){return t.buildOption(e.title,e.val,e.options,"".concat(n))}))},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,r.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,r.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]"),this.search=(0,r.htmlToElement)(''),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,r.classToClassList)(this.searchClasses,this.search),this.search.addEventListener("input",(0,r.debounce)((function(t){return e.searchOptions(t.target.value)}))),t?t.append(this.search):this.searchWrapper.append(this.search),this.dropdown.append(this.searchWrapper)},e.prototype.buildOption=function(t,e,n,s){var i=this;void 0===s&&(s="1");var o=null,l=(0,r.htmlToElement)(this.optionTag||"
");if(l.setAttribute("data-value",e),l.setAttribute("data-title-value",t),l.setAttribute("tabIndex",s),l.classList.add("cursor-pointer"),this.optionTemplate&&(o=(0,r.htmlToElement)(this.optionTemplate),l.append(o)),o?o.querySelector("[data-title]").textContent=t||"":l.textContent=t||"",n){if(n.icon){var a=(0,r.htmlToElement)(n.icon);if(a.classList.add("mw-full"),o)o.querySelector("[data-icon]").append(a);else{var d=(0,r.htmlToElement)("
");this.iconClasses&&(0,r.classToClassList)(this.iconClasses,d),d.append(a),l.append(d)}}if(n.description)if(o)o.querySelector("[data-description]").append(n.description);else{var c=(0,r.htmlToElement)("
");c.textContent=n.description,this.descriptionClasses&&(0,r.classToClassList)(this.descriptionClasses,c),l.append(c)}}o&&o.querySelector("[data-icon]")&&!n&&!(null==n?void 0:n.icon)&&o.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&l.classList.add("selected"),l.addEventListener("click",(function(){return i.onSelectOption(e)})),this.optionClasses&&(0,r.classToClassList)(this.optionClasses,l),this.dropdown&&this.dropdown.append(l)},e.prototype.destroyOption=function(t){var e=this.dropdown.querySelector('[data-value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.buildOriginalOption=function(t,e,n){var s=(0,r.htmlToElement)("");s.setAttribute("value",e),s.setAttribute("data-hs-select-option",JSON.stringify(n)),s.innerText=t,this.el.append(s)},e.prototype.destroyOriginalOption=function(t){var e=this.el.querySelector('[value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.buildTagsInputHelper=function(){this.tagsInputHelper=document.createElement("span"),this.tagsInputHelper.style.fontSize=window.getComputedStyle(this.tagsInput).fontSize,this.tagsInputHelper.style.fontFamily=window.getComputedStyle(this.tagsInput).fontFamily,this.tagsInputHelper.style.fontWeight=window.getComputedStyle(this.tagsInput).fontWeight,this.tagsInputHelper.style.letterSpacing=window.getComputedStyle(this.tagsInput).letterSpacing,this.tagsInputHelper.style.visibility="hidden",this.tagsInputHelper.style.whiteSpace="pre",this.tagsInputHelper.style.position="absolute",this.wrapper.appendChild(this.tagsInputHelper)},e.prototype.calculateInputWidth=function(){this.tagsInputHelper.textContent=this.tagsInput.value||this.tagsInput.placeholder;var t=parseInt(window.getComputedStyle(this.tagsInput).paddingLeft)+parseInt(window.getComputedStyle(this.tagsInput).paddingRight),e=parseInt(window.getComputedStyle(this.tagsInput).borderLeftWidth)+parseInt(window.getComputedStyle(this.tagsInput).borderRightWidth),n=this.tagsInputHelper.offsetWidth+t+e,s=this.wrapper.offsetWidth-(parseInt(window.getComputedStyle(this.wrapper).paddingLeft)+parseInt(window.getComputedStyle(this.wrapper).paddingRight));this.tagsInput.style.width="".concat(Math.min(n,s)+2,"px")},e.prototype.adjustInputWidth=function(){this.buildTagsInputHelper(),this.calculateInputWidth()},e.prototype.onSelectOption=function(t){var e=this;if(this.clearSelections(),this.isMultiple?(this.value=this.value.includes(t)?Array.from(this.value).filter((function(e){return e!==t})):l(l([],Array.from(this.value),!0),[t],!1),this.selectMultipleItems(),this.setNewValue()):(this.value=t,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),(0,r.dispatch)("change.hs.select",this.el,this.value),"tags"===this.mode){var n=this.selectedItems.filter((function(t){return!e.value.includes(t)}));n.length&&n.forEach((function(t){e.selectedItems=e.selectedItems.filter((function(e){return e!==t})),e.wrapper.querySelector('[data-tag-value="'.concat(t,'"]')).remove()})),this.resetTagsInputField()}this.isMultiple||(this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.close()),this.value.length||"tags"!==this.mode||this.reassignTagsInputPlaceholder(this.placeholder),this.isOpened&&"tags"===this.mode&&this.tagsInput&&this.tagsInput.focus()},e.prototype.addSelectOption=function(t,e,n){this.selectOptions=l(l([],this.selectOptions,!0),[{title:t,val:e,options:n}],!1)},e.prototype.removeSelectOption=function(t){if(!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t}))},e.prototype.resetTagsInputField=function(){this.tagsInput.value="",this.reassignTagsInputPlaceholder(""),this.searchOptions("")},e.prototype.clearSelections=function(){Array.from(this.dropdown.children).forEach((function(t){t.classList.contains("selected")&&t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){t.selected&&(t.selected=!1)}))},e.prototype.setNewValue=function(){"tags"===this.mode?this.setTagsItems():this.value.length?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.stringFromValue=function(){var t=this,e=[];return this.selectOptions.forEach((function(n){t.isMultiple?t.value.includes(n.val)&&e.push(n.title):t.value===n.val&&e.push(n.title)})),this.toggleCountText&&""!==this.toggleCountText&&e.length>=this.toggleCountTextMinItems?"".concat(e.length," ").concat(this.toggleCountText):e.join(", ")},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0,Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")})).classList.add("selected")},e.prototype.selectMultipleItems=function(){var t=this;Array.from(this.dropdown.children).filter((function(e){return t.value.includes(e.getAttribute("data-value"))})).forEach((function(t){return t.classList.add("selected")})),Array.from(this.el.children).filter((function(e){return t.value.includes(e.value)})).forEach((function(t){return t.selected=!0}))},e.prototype.unselectMultipleItems=function(){Array.from(this.dropdown.children).forEach((function(t){return t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){return t.selected=!1}))},e.prototype.searchOptions=function(t){this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,r.htmlToElement)(""),this.searchNoResult.innerText=this.searchNoResultText,(0,r.classToClassList)(this.searchNoResultClasses,this.searchNoResult);var e=this.dropdown.querySelectorAll("[data-value]"),n=!1;e.forEach((function(e){e.getAttribute("data-title-value").toLocaleLowerCase().includes(t.toLocaleLowerCase())?(e.classList.remove("hidden"),n=!0):e.classList.add("hidden")})),n||this.dropdown.append(this.searchNoResult)},e.prototype.eraseToggleIcon=function(){var t=this.toggle.querySelector("[data-icon]");t&&(t.innerHTML=null,t.classList.add("hidden"))},e.prototype.eraseToggleTitle=function(){var t=this.toggle.querySelector("[data-title]");t?t.innerHTML=this.placeholder:this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.destroy=function(){var t=this.el.parentElement.parentElement;this.el.classList.remove("hidden"),this.el.style.display="",t.prepend(this.el),t.querySelector(".hs-select").remove(),this.wrapper=null},e.prototype.open=function(){var t=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){t.wrapper.classList.add("active"),t.dropdown.classList.add("opened"),t.hasSearch&&!t.preventSearchFocus&&t.search.focus(),t.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,n,s=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,r.afterTransition)(this.dropdown,(function(){s.dropdown.classList.add("hidden"),s.hasSearch&&(s.search.value="",s.search.dispatchEvent(new Event("input",{bubbles:!0})),s.search.blur()),s.animationInProcess=!1})),null===(n=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===n||n.classList.remove("hs-select-option-highlighted"),this.isOpened=!1},e.prototype.addOption=function(t){var e=this,n="".concat(this.selectOptions.length),s=function(t){var s=t.title,i=t.val,o=t.options;!!e.selectOptions.some((function(t){return t.val===i}))||(e.addSelectOption(s,i,o),e.buildOption(s,i,o,n),e.buildOriginalOption(s,i,o))};Array.isArray(t)?t.forEach((function(t){s(t)})):s(t)},e.prototype.removeOption=function(t){var e=this,n=function(t){!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t),e.destroyOption(t),e.destroyOriginalOption(t),e.value===t&&(e.value=null,e.eraseToggleTitle(),e.eraseToggleIcon()))};Array.isArray(t)?t.forEach((function(t){n(t)})):n(t)},e.prototype.recalculateDirection=function(){var t,e,n,s;(0,r.isEnoughSpace)(this.dropdown,this.toggle||this.tagsInput,"bottom",this.dropdownSpace,this.viewport)?(this.dropdown.classList.remove("bottom-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="",this.dropdown.classList.add("top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.add(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="".concat(this.dropdownSpace,"px")):(this.dropdown.classList.remove("top-full"),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.classList.add("bottom-full"),(null===(s=this.dropdownDirectionClasses)||void 0===s?void 0:s.bottom)&&this.dropdown.classList.add(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="".concat(this.dropdownSpace,"px"))},e.getInstance=function(t,e){var n=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsSelectCollection||(window.$hsSelectCollection=[]),document.querySelectorAll("[data-hs-select]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsSelectCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-select"),s=n?JSON.parse(n):{};new e(t,s)}})),window.$hsSelectCollection&&(window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.close=function(t){var e=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.isOpened&&e.element.close()},e.closeCurrentlyOpened=function(t){if(void 0===t&&(t=null),!t.closest(".hs-select.active")){var e=window.$hsSelectCollection.filter((function(t){return t.element.isOpened}))||null;e&&e.forEach((function(t){t.element.close()}))}},e.accessibility=function(t){if(window.$hsSelectCollection.find((function(t){return t.element.isOpened}))&&d.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Tab":t.preventDefault(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}},e.onEscape=function(){var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.close()},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));if(e){var n=e.element.dropdown;if(!n)return!1;var s=(t?Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||s[0].classList.add("hs-select-option-highlighted");var o=s.findIndex((function(t){return t===i}));o+1 *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||s[0].classList.add("hs-select-option-highlighted");var o=s.findIndex((function(t){return t===i}));if(!(o+1 *:not(.hidden)")):Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");s.length&&(s[0].focus(),i&&i.classList.remove("hs-select-option-highlighted"),s[0].classList.add("hs-select-option-highlighted"))}},e.onEnter=function(t){var e=t.target.previousSibling;if(window.$hsSelectCollection.find((function(t){return t.element.el===e}))){var n=window.$hsSelectCollection.find((function(t){return t.element.isOpened})),s=window.$hsSelectCollection.find((function(t){return t.element.el===e}));n.element.close(),s.element.open()}else{(s=window.$hsSelectCollection.find((function(t){return t.element.isOpened})))&&s.element.onSelectOption(t.target.dataset.value||"")}},e}(a.default);window.addEventListener("load",(function(){c.autoInit()})),document.addEventListener("scroll",(function(){if(!window.$hsSelectCollection)return!1;var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSSelect=c),e.default=c},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0;e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var s="";return t.classList.forEach((function(t){t.includes(e)&&(s=t)})),s.match(/:(.*)]/)?s.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,s,i){void 0===n&&(n="auto"),void 0===s&&(s=10),void 0===i&&(i=null);var o=e.getBoundingClientRect(),l=i?i.getBoundingClientRect():null,r=window.innerHeight,a=l?o.top-l.top:o.top,d=(i?l.bottom:r)-o.bottom,c=t.clientHeight+s;return"bottom"===n?d>=c:"top"===n?a>=c:a>=c||d>=c};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var s=function(t){return!!t&&("none"===window.getComputedStyle(t).display||s(t.parentElement))};e.isParentOrElementHidden=s;e.debounce=function(t,e){var s;return void 0===e&&(e=200),function(){for(var i=[],o=0;othis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(s){var i=e[s];if(void 0!==i)return i.exports;var o=e[s]={exports:{}};return t[s].call(o.exports,o,o.exports,n),o.exports}(233);return n})())); \ No newline at end of file diff --git a/dist/stepper.d.ts b/dist/stepper.d.ts index d08db76..2e51e29 100644 --- a/dist/stepper.d.ts +++ b/dist/stepper.d.ts @@ -1,18 +1,5 @@ -export interface IStepperOptions { - currentIndex?: number; - isCompleted?: boolean; - mode?: string; -} -export interface IStepper { - options?: IStepperOptions; - setProcessedNavItem(n?: number): void; - unsetProcessedNavItem(n?: number): void; - goToNext(): void; - disableButtons(): void; - enableButtons(): void; - setErrorNavItem(n?: number): void; -} + export interface IBasePlugin { el: E; options?: O; @@ -31,6 +18,20 @@ export interface ICollectionItem { id: string | number; element: T; } +export interface IStepperOptions { + currentIndex?: number; + isCompleted?: boolean; + mode?: string; +} +export interface IStepper { + options?: IStepperOptions; + setProcessedNavItem(n?: number): void; + unsetProcessedNavItem(n?: number): void; + goToNext(): void; + disableButtons(): void; + enableButtons(): void; + setErrorNavItem(n?: number): void; +} declare class HSStepper extends HSBasePlugin<{}> implements IStepper { private currentIndex; private readonly mode; diff --git a/dist/stepper.js b/dist/stepper.js index 6c21335..68abf8e 100644 --- a/dist/stepper.js +++ b/dist/stepper.js @@ -1,7 +1,7 @@ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(self,(()=>(()=>{"use strict";var t={737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,9 +9,9 @@ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},957:function(t,e,n){ /* * HSStepper - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var i,s=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,i=arguments.length;nt.totalSteps&&(t.totalSteps=n)}))},e.prototype.buildNav=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-nav-item]").forEach((function(e){return t.addNavItem(e)})),this.navItems.forEach((function(e){return t.buildNavItem(e)}))},e.prototype.buildNavItem=function(t){var e=this,n=t.index,i=t.isDisabled,s=t.el;n===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||i)&&s.addEventListener("click",(function(){return e.handleNavItemClick(t)}))},e.prototype.addNavItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-nav-item")),n=e.index,i=e.isFinal,s=void 0!==i&&i,o=e.isCompleted,r=void 0!==o&&o,l=e.isSkip,p=void 0!==l&&l,a=e.isOptional,c=void 0!==a&&a,d=e.isDisabled,h=void 0!==d&&d,u=e.isProcessed,m=void 0!==u&&u,f=e.hasError,v=void 0!==f&&f;r&&t.classList.add("success"),p&&t.classList.add("skipped"),h&&("BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")),v&&t.classList.add("error"),this.navItems.push({index:n,isFinal:s,isCompleted:r,isSkip:p,isOptional:c,isDisabled:h,isProcessed:m,hasError:v,el:t})},e.prototype.setCurrentNavItem=function(){var t=this;this.navItems.forEach((function(e){var n=e.index,i=e.el;n===t.currentIndex?t.setCurrentNavItemActions(i):t.unsetCurrentNavItemActions(i)}))},e.prototype.setCurrentNavItemActions=function(t){t.classList.add("active"),this.fireEvent("active",this.currentIndex),(0,r.dispatch)("active.hs.stepper",this.el,this.currentIndex)},e.prototype.getNavItem=function(t){return void 0===t&&(t=this.currentIndex),this.navItems.find((function(e){return e.index===t}))},e.prototype.setProcessedNavItemActions=function(t){t.isProcessed=!0,t.el.classList.add("processed")},e.prototype.setErrorNavItemActions=function(t){t.hasError=!0,t.el.classList.add("error")},e.prototype.unsetCurrentNavItemActions=function(t){t.classList.remove("active")},e.prototype.handleNavItemClick=function(t){var e=t.index;this.currentIndex=e,this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep()},e.prototype.buildContent=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-content-item]").forEach((function(e){return t.addContentItem(e)})),this.navItems.forEach((function(e){return t.buildContentItem(e)}))},e.prototype.buildContentItem=function(t){t.index===this.currentIndex&&this.setCurrentContentItem()},e.prototype.addContentItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-content-item")),n=e.index,i=e.isFinal,s=void 0!==i&&i,o=e.isCompleted,r=void 0!==o&&o,l=e.isSkip,p=void 0!==l&&l;r&&t.classList.add("success"),p&&t.classList.add("skipped"),this.contentItems.push({index:n,isFinal:s,isCompleted:r,isSkip:p,el:t})},e.prototype.setCurrentContentItem=function(){var t=this;if(this.isCompleted){var e=this.contentItems.find((function(t){return t.isFinal})),n=this.contentItems.filter((function(t){return!t.isFinal}));return e.el.style.display="",n.forEach((function(t){return t.el.style.display="none"})),!1}this.contentItems.forEach((function(e){var n=e.index,i=e.el;n===t.currentIndex?t.setCurrentContentItemActions(i):t.unsetCurrentContentItemActions(i)}))},e.prototype.hideAllContentItems=function(){this.contentItems.forEach((function(t){return t.el.style.display="none"}))},e.prototype.setCurrentContentItemActions=function(t){t.style.display=""},e.prototype.unsetCurrentContentItemActions=function(t){t.style.display="none"},e.prototype.disableAll=function(){var t=this.getNavItem(this.currentIndex);t.hasError=!1,t.isCompleted=!1,t.isDisabled=!1,t.el.classList.remove("error","success"),this.disableButtons()},e.prototype.disableNavItemActions=function(t){t.isDisabled=!0,t.el.classList.add("disabled")},e.prototype.enableNavItemActions=function(t){t.isDisabled=!1,t.el.classList.remove("disabled")},e.prototype.buildButtons=function(){this.backBtn=this.el.querySelector("[data-hs-stepper-back-btn]"),this.nextBtn=this.el.querySelector("[data-hs-stepper-next-btn]"),this.skipBtn=this.el.querySelector("[data-hs-stepper-skip-btn]"),this.completeStepBtn=this.el.querySelector("[data-hs-stepper-complete-step-btn]"),this.finishBtn=this.el.querySelector("[data-hs-stepper-finish-btn]"),this.resetBtn=this.el.querySelector("[data-hs-stepper-reset-btn]"),this.buildBackButton(),this.buildNextButton(),this.buildSkipButton(),this.buildCompleteStepButton(),this.buildFinishButton(),this.buildResetButton()},e.prototype.buildBackButton=function(){var t=this;this.backBtn&&(this.checkForTheFirstStep(),this.backBtn.addEventListener("click",(function(){if(t.handleBackButtonClick(),"linear"===t.mode){var e=t.navItems.find((function(e){return e.index===t.currentIndex})),n=t.contentItems.find((function(e){return e.index===t.currentIndex}));if(!e||!n)return;e.isCompleted&&(e.isCompleted=!1,e.isSkip=!1,e.el.classList.remove("success","skipped")),n.isCompleted&&(n.isCompleted=!1,n.isSkip=!1,n.el.classList.remove("success","skipped")),"linear"===t.mode&&t.currentIndex!==t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display=""),t.completeStepBtn&&(t.completeStepBtn.style.display="")),t.showSkipButton(),t.showFinishButton(),t.showCompleteStepButton()}})))},e.prototype.handleBackButtonClick=function(){1!==this.currentIndex&&("linear"===this.mode&&this.removeOptionalClasses(),this.currentIndex--,"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.fireEvent("back",this.currentIndex),(0,r.dispatch)("back.hs.stepper",this.el,this.currentIndex))},e.prototype.checkForTheFirstStep=function(){1===this.currentIndex?this.setToDisabled(this.backBtn):this.setToNonDisabled(this.backBtn)},e.prototype.setToDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")},e.prototype.setToNonDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled"),t.classList.remove("disabled")},e.prototype.buildNextButton=function(){var t=this;this.nextBtn&&this.nextBtn.addEventListener("click",(function(){var e;if(t.fireEvent("beforeNext",t.currentIndex),(0,r.dispatch)("beforeNext.hs.stepper",t.el,t.currentIndex),null===(e=t.getNavItem(t.currentIndex))||void 0===e?void 0:e.isProcessed)return t.disableAll(),!1;t.goToNext()}))},e.prototype.unsetProcessedNavItemActions=function(t){t.isProcessed=!1,t.el.classList.remove("processed")},e.prototype.handleNextButtonClick=function(t){if(void 0===t&&(t=!0),t)this.currentIndex===this.totalSteps?this.currentIndex=1:this.currentIndex++;else{var e=this.getUncompletedSteps();if(1===e.length){var n=e[0].index;this.currentIndex=n}else{if(this.currentIndex===this.totalSteps)return;this.currentIndex++}}"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton(),this.showFinishButton(),this.showCompleteStepButton(),this.fireEvent("next",this.currentIndex),(0,r.dispatch)("next.hs.stepper",this.el,this.currentIndex)},e.prototype.removeOptionalClasses=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=this.contentItems.find((function(e){return e.index===t.currentIndex}));e.isSkip=!1,e.hasError=!1,e.isDisabled=!1,n.isSkip=!1,e.el.classList.remove("skipped","success","error"),n.el.classList.remove("skipped","success","error")},e.prototype.buildSkipButton=function(){var t=this;this.skipBtn&&(this.showSkipButton(),this.skipBtn.addEventListener("click",(function(){t.handleSkipButtonClick(),"linear"===t.mode&&t.currentIndex===t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display="none"),t.completeStepBtn&&(t.completeStepBtn.style.display="none"),t.finishBtn&&(t.finishBtn.style.display=""))})))},e.prototype.setSkipItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),i=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&i&&(this.setSkipItemActions(n),this.setSkipItemActions(i))},e.prototype.setSkipItemActions=function(t){t.isSkip=!0,t.el.classList.add("skipped")},e.prototype.showSkipButton=function(){var t=this;if(this.skipBtn){var e=this.navItems.find((function(e){return e.index===t.currentIndex})).isOptional;this.skipBtn.style.display=e?"":"none"}},e.prototype.handleSkipButtonClick=function(){this.setSkipItem(),this.handleNextButtonClick(),this.fireEvent("skip",this.currentIndex),(0,r.dispatch)("skip.hs.stepper",this.el,this.currentIndex)},e.prototype.buildCompleteStepButton=function(){var t=this;this.completeStepBtn&&(this.completeStepBtnDefaultText=this.completeStepBtn.innerText,this.completeStepBtn.addEventListener("click",(function(){return t.handleCompleteStepButtonClick()})))},e.prototype.changeTextAndDisableCompleteButtonIfStepCompleted=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=JSON.parse(this.completeStepBtn.getAttribute("data-hs-stepper-complete-step-btn")).completedText;e&&(e.isCompleted?(this.completeStepBtn.innerText=n||this.completeStepBtnDefaultText,this.completeStepBtn.setAttribute("disabled","disabled"),this.completeStepBtn.classList.add("disabled")):(this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")))},e.prototype.setCompleteItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),i=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&i&&(this.setCompleteItemActions(n),this.setCompleteItemActions(i))},e.prototype.setCompleteItemActions=function(t){t.isCompleted=!0,t.el.classList.add("success")},e.prototype.showCompleteStepButton=function(){this.completeStepBtn&&(1===this.getUncompletedSteps().length?this.completeStepBtn.style.display="none":this.completeStepBtn.style.display="")},e.prototype.handleCompleteStepButtonClick=function(){this.setCompleteItem(),this.fireEvent("complete",this.currentIndex),(0,r.dispatch)("complete.hs.stepper",this.el,this.currentIndex),this.handleNextButtonClick(!1),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton()},e.prototype.buildFinishButton=function(){var t=this;this.finishBtn&&(this.isCompleted&&this.setCompleted(),this.finishBtn.addEventListener("click",(function(){return t.handleFinishButtonClick()})))},e.prototype.setCompleted=function(){this.el.classList.add("completed")},e.prototype.unsetCompleted=function(){this.el.classList.remove("completed")},e.prototype.showFinishButton=function(){this.finishBtn&&(1===this.getUncompletedSteps().length?this.finishBtn.style.display="":this.finishBtn.style.display="none")},e.prototype.handleFinishButtonClick=function(){var t=this,e=this.getUncompletedSteps(),n=this.getUncompletedSteps(!0),i=this.contentItems.find((function(t){return t.isFinal})).el;e.length&&e.forEach((function(e){var n=e.index;return t.setCompleteItem(n)})),this.currentIndex=this.totalSteps,this.setCurrentNavItem(),this.hideAllContentItems();var s=this.navItems.find((function(e){return e.index===t.currentIndex}));(s?s.el:null).classList.remove("active"),i.style.display="block",this.backBtn&&(this.backBtn.style.display="none"),this.nextBtn&&(this.nextBtn.style.display="none"),this.skipBtn&&(this.skipBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"),this.finishBtn&&(this.finishBtn.style.display="none"),this.resetBtn&&(this.resetBtn.style.display=""),n.length<=1&&(this.isCompleted=!0,this.setCompleted()),this.fireEvent("finish",this.currentIndex),(0,r.dispatch)("finish.hs.stepper",this.el,this.currentIndex)},e.prototype.buildResetButton=function(){var t=this;this.resetBtn&&this.resetBtn.addEventListener("click",(function(){return t.handleResetButtonClick()}))},e.prototype.handleResetButtonClick=function(){var t=this;this.backBtn&&(this.backBtn.style.display=""),this.nextBtn&&(this.nextBtn.style.display=""),this.completeStepBtn&&(this.completeStepBtn.style.display="",this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")),this.resetBtn&&(this.resetBtn.style.display="none"),this.navItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentNavItemActions(n),n.classList.remove("success","skipped")})),this.contentItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentContentItemActions(n),n.classList.remove("success","skipped")})),this.currentIndex=1,this.setCurrentNavItem(),this.setCurrentContentItem(),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.unsetCompleted(),this.isCompleted=!1,this.fireEvent("reset",this.currentIndex),(0,r.dispatch)("reset.hs.stepper",this.el,this.currentIndex)},e.prototype.setProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.setProcessedNavItemActions(e)},e.prototype.unsetProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.unsetProcessedNavItemActions(e)},e.prototype.goToNext=function(){"linear"===this.mode&&this.setCompleteItem(),this.handleNextButtonClick("linear"!==this.mode),"linear"===this.mode&&this.currentIndex===this.totalSteps&&(this.nextBtn&&(this.nextBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"))},e.prototype.disableButtons=function(){this.backBtn&&this.setToDisabled(this.backBtn),this.nextBtn&&this.setToDisabled(this.nextBtn)},e.prototype.enableButtons=function(){this.backBtn&&this.setToNonDisabled(this.backBtn),this.nextBtn&&this.setToNonDisabled(this.nextBtn)},e.prototype.setErrorNavItem=function(t){var e=this.getNavItem(t);e&&this.setErrorNavItemActions(e)},e.getInstance=function(t,e){var n=window.$hsStepperCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsStepperCollection||(window.$hsStepperCollection=[]),document.querySelectorAll("[data-hs-stepper]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsStepperCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=l),e.default=l},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=void 0;e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var i="";return t.classList.forEach((function(t){t.includes(e)&&(i=t)})),i.match(/:(.*)]/)?i.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,i,s){void 0===n&&(n="auto"),void 0===i&&(i=10),void 0===s&&(s=null);var o=e.getBoundingClientRect(),r=s?s.getBoundingClientRect():null,l=window.innerHeight,p=r?o.top-r.top:o.top,a=(s?r.bottom:l)-o.bottom,c=t.clientHeight+i;return"bottom"===n?a>=c:"top"===n?p>=c:p>=c||a>=c};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var i=function(t){return!!t&&("none"===window.getComputedStyle(t).display||i(t.parentElement))};e.isParentOrElementHidden=i;e.debounce=function(t,e){var i;return void 0===e&&(e=200),function(){for(var s=[],o=0;othis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(i){var s=e[i];if(void 0!==s)return s.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}(957);return n})())); \ No newline at end of file +var i,s=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,i=arguments.length;nt.totalSteps&&(t.totalSteps=n)}))},e.prototype.buildNav=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-nav-item]").forEach((function(e){return t.addNavItem(e)})),this.navItems.forEach((function(e){return t.buildNavItem(e)}))},e.prototype.buildNavItem=function(t){var e=this,n=t.index,i=t.isDisabled,s=t.el;n===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||i)&&s.addEventListener("click",(function(){return e.handleNavItemClick(t)}))},e.prototype.addNavItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-nav-item")),n=e.index,i=e.isFinal,s=void 0!==i&&i,o=e.isCompleted,r=void 0!==o&&o,l=e.isSkip,a=void 0!==l&&l,p=e.isOptional,c=void 0!==p&&p,d=e.isDisabled,u=void 0!==d&&d,h=e.isProcessed,m=void 0!==h&&h,f=e.hasError,v=void 0!==f&&f;r&&t.classList.add("success"),a&&t.classList.add("skipped"),u&&("BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")),v&&t.classList.add("error"),this.navItems.push({index:n,isFinal:s,isCompleted:r,isSkip:a,isOptional:c,isDisabled:u,isProcessed:m,hasError:v,el:t})},e.prototype.setCurrentNavItem=function(){var t=this;this.navItems.forEach((function(e){var n=e.index,i=e.el;n===t.currentIndex?t.setCurrentNavItemActions(i):t.unsetCurrentNavItemActions(i)}))},e.prototype.setCurrentNavItemActions=function(t){t.classList.add("active"),this.fireEvent("active",this.currentIndex),(0,r.dispatch)("active.hs.stepper",this.el,this.currentIndex)},e.prototype.getNavItem=function(t){return void 0===t&&(t=this.currentIndex),this.navItems.find((function(e){return e.index===t}))},e.prototype.setProcessedNavItemActions=function(t){t.isProcessed=!0,t.el.classList.add("processed")},e.prototype.setErrorNavItemActions=function(t){t.hasError=!0,t.el.classList.add("error")},e.prototype.unsetCurrentNavItemActions=function(t){t.classList.remove("active")},e.prototype.handleNavItemClick=function(t){var e=t.index;this.currentIndex=e,this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep()},e.prototype.buildContent=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-content-item]").forEach((function(e){return t.addContentItem(e)})),this.navItems.forEach((function(e){return t.buildContentItem(e)}))},e.prototype.buildContentItem=function(t){t.index===this.currentIndex&&this.setCurrentContentItem()},e.prototype.addContentItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-content-item")),n=e.index,i=e.isFinal,s=void 0!==i&&i,o=e.isCompleted,r=void 0!==o&&o,l=e.isSkip,a=void 0!==l&&l;r&&t.classList.add("success"),a&&t.classList.add("skipped"),this.contentItems.push({index:n,isFinal:s,isCompleted:r,isSkip:a,el:t})},e.prototype.setCurrentContentItem=function(){var t=this;if(this.isCompleted){var e=this.contentItems.find((function(t){return t.isFinal})),n=this.contentItems.filter((function(t){return!t.isFinal}));return e.el.style.display="",n.forEach((function(t){return t.el.style.display="none"})),!1}this.contentItems.forEach((function(e){var n=e.index,i=e.el;n===t.currentIndex?t.setCurrentContentItemActions(i):t.unsetCurrentContentItemActions(i)}))},e.prototype.hideAllContentItems=function(){this.contentItems.forEach((function(t){return t.el.style.display="none"}))},e.prototype.setCurrentContentItemActions=function(t){t.style.display=""},e.prototype.unsetCurrentContentItemActions=function(t){t.style.display="none"},e.prototype.disableAll=function(){var t=this.getNavItem(this.currentIndex);t.hasError=!1,t.isCompleted=!1,t.isDisabled=!1,t.el.classList.remove("error","success"),this.disableButtons()},e.prototype.disableNavItemActions=function(t){t.isDisabled=!0,t.el.classList.add("disabled")},e.prototype.enableNavItemActions=function(t){t.isDisabled=!1,t.el.classList.remove("disabled")},e.prototype.buildButtons=function(){this.backBtn=this.el.querySelector("[data-hs-stepper-back-btn]"),this.nextBtn=this.el.querySelector("[data-hs-stepper-next-btn]"),this.skipBtn=this.el.querySelector("[data-hs-stepper-skip-btn]"),this.completeStepBtn=this.el.querySelector("[data-hs-stepper-complete-step-btn]"),this.finishBtn=this.el.querySelector("[data-hs-stepper-finish-btn]"),this.resetBtn=this.el.querySelector("[data-hs-stepper-reset-btn]"),this.buildBackButton(),this.buildNextButton(),this.buildSkipButton(),this.buildCompleteStepButton(),this.buildFinishButton(),this.buildResetButton()},e.prototype.buildBackButton=function(){var t=this;this.backBtn&&(this.checkForTheFirstStep(),this.backBtn.addEventListener("click",(function(){if(t.handleBackButtonClick(),"linear"===t.mode){var e=t.navItems.find((function(e){return e.index===t.currentIndex})),n=t.contentItems.find((function(e){return e.index===t.currentIndex}));if(!e||!n)return;e.isCompleted&&(e.isCompleted=!1,e.isSkip=!1,e.el.classList.remove("success","skipped")),n.isCompleted&&(n.isCompleted=!1,n.isSkip=!1,n.el.classList.remove("success","skipped")),"linear"===t.mode&&t.currentIndex!==t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display=""),t.completeStepBtn&&(t.completeStepBtn.style.display="")),t.showSkipButton(),t.showFinishButton(),t.showCompleteStepButton()}})))},e.prototype.handleBackButtonClick=function(){1!==this.currentIndex&&("linear"===this.mode&&this.removeOptionalClasses(),this.currentIndex--,"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.fireEvent("back",this.currentIndex),(0,r.dispatch)("back.hs.stepper",this.el,this.currentIndex))},e.prototype.checkForTheFirstStep=function(){1===this.currentIndex?this.setToDisabled(this.backBtn):this.setToNonDisabled(this.backBtn)},e.prototype.setToDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")},e.prototype.setToNonDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled"),t.classList.remove("disabled")},e.prototype.buildNextButton=function(){var t=this;this.nextBtn&&this.nextBtn.addEventListener("click",(function(){var e;if(t.fireEvent("beforeNext",t.currentIndex),(0,r.dispatch)("beforeNext.hs.stepper",t.el,t.currentIndex),null===(e=t.getNavItem(t.currentIndex))||void 0===e?void 0:e.isProcessed)return t.disableAll(),!1;t.goToNext()}))},e.prototype.unsetProcessedNavItemActions=function(t){t.isProcessed=!1,t.el.classList.remove("processed")},e.prototype.handleNextButtonClick=function(t){if(void 0===t&&(t=!0),t)this.currentIndex===this.totalSteps?this.currentIndex=1:this.currentIndex++;else{var e=this.getUncompletedSteps();if(1===e.length){var n=e[0].index;this.currentIndex=n}else{if(this.currentIndex===this.totalSteps)return;this.currentIndex++}}"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton(),this.showFinishButton(),this.showCompleteStepButton(),this.fireEvent("next",this.currentIndex),(0,r.dispatch)("next.hs.stepper",this.el,this.currentIndex)},e.prototype.removeOptionalClasses=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=this.contentItems.find((function(e){return e.index===t.currentIndex}));e.isSkip=!1,e.hasError=!1,e.isDisabled=!1,n.isSkip=!1,e.el.classList.remove("skipped","success","error"),n.el.classList.remove("skipped","success","error")},e.prototype.buildSkipButton=function(){var t=this;this.skipBtn&&(this.showSkipButton(),this.skipBtn.addEventListener("click",(function(){t.handleSkipButtonClick(),"linear"===t.mode&&t.currentIndex===t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display="none"),t.completeStepBtn&&(t.completeStepBtn.style.display="none"),t.finishBtn&&(t.finishBtn.style.display=""))})))},e.prototype.setSkipItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),i=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&i&&(this.setSkipItemActions(n),this.setSkipItemActions(i))},e.prototype.setSkipItemActions=function(t){t.isSkip=!0,t.el.classList.add("skipped")},e.prototype.showSkipButton=function(){var t=this;if(this.skipBtn){var e=this.navItems.find((function(e){return e.index===t.currentIndex})).isOptional;this.skipBtn.style.display=e?"":"none"}},e.prototype.handleSkipButtonClick=function(){this.setSkipItem(),this.handleNextButtonClick(),this.fireEvent("skip",this.currentIndex),(0,r.dispatch)("skip.hs.stepper",this.el,this.currentIndex)},e.prototype.buildCompleteStepButton=function(){var t=this;this.completeStepBtn&&(this.completeStepBtnDefaultText=this.completeStepBtn.innerText,this.completeStepBtn.addEventListener("click",(function(){return t.handleCompleteStepButtonClick()})))},e.prototype.changeTextAndDisableCompleteButtonIfStepCompleted=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=JSON.parse(this.completeStepBtn.getAttribute("data-hs-stepper-complete-step-btn")).completedText;e&&(e.isCompleted?(this.completeStepBtn.innerText=n||this.completeStepBtnDefaultText,this.completeStepBtn.setAttribute("disabled","disabled"),this.completeStepBtn.classList.add("disabled")):(this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")))},e.prototype.setCompleteItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),i=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&i&&(this.setCompleteItemActions(n),this.setCompleteItemActions(i))},e.prototype.setCompleteItemActions=function(t){t.isCompleted=!0,t.el.classList.add("success")},e.prototype.showCompleteStepButton=function(){this.completeStepBtn&&(1===this.getUncompletedSteps().length?this.completeStepBtn.style.display="none":this.completeStepBtn.style.display="")},e.prototype.handleCompleteStepButtonClick=function(){this.setCompleteItem(),this.fireEvent("complete",this.currentIndex),(0,r.dispatch)("complete.hs.stepper",this.el,this.currentIndex),this.handleNextButtonClick(!1),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton()},e.prototype.buildFinishButton=function(){var t=this;this.finishBtn&&(this.isCompleted&&this.setCompleted(),this.finishBtn.addEventListener("click",(function(){return t.handleFinishButtonClick()})))},e.prototype.setCompleted=function(){this.el.classList.add("completed")},e.prototype.unsetCompleted=function(){this.el.classList.remove("completed")},e.prototype.showFinishButton=function(){this.finishBtn&&(1===this.getUncompletedSteps().length?this.finishBtn.style.display="":this.finishBtn.style.display="none")},e.prototype.handleFinishButtonClick=function(){var t=this,e=this.getUncompletedSteps(),n=this.getUncompletedSteps(!0),i=this.contentItems.find((function(t){return t.isFinal})).el;e.length&&e.forEach((function(e){var n=e.index;return t.setCompleteItem(n)})),this.currentIndex=this.totalSteps,this.setCurrentNavItem(),this.hideAllContentItems();var s=this.navItems.find((function(e){return e.index===t.currentIndex}));(s?s.el:null).classList.remove("active"),i.style.display="block",this.backBtn&&(this.backBtn.style.display="none"),this.nextBtn&&(this.nextBtn.style.display="none"),this.skipBtn&&(this.skipBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"),this.finishBtn&&(this.finishBtn.style.display="none"),this.resetBtn&&(this.resetBtn.style.display=""),n.length<=1&&(this.isCompleted=!0,this.setCompleted()),this.fireEvent("finish",this.currentIndex),(0,r.dispatch)("finish.hs.stepper",this.el,this.currentIndex)},e.prototype.buildResetButton=function(){var t=this;this.resetBtn&&this.resetBtn.addEventListener("click",(function(){return t.handleResetButtonClick()}))},e.prototype.handleResetButtonClick=function(){var t=this;this.backBtn&&(this.backBtn.style.display=""),this.nextBtn&&(this.nextBtn.style.display=""),this.completeStepBtn&&(this.completeStepBtn.style.display="",this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")),this.resetBtn&&(this.resetBtn.style.display="none"),this.navItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentNavItemActions(n),n.classList.remove("success","skipped")})),this.contentItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentContentItemActions(n),n.classList.remove("success","skipped")})),this.currentIndex=1,this.setCurrentNavItem(),this.setCurrentContentItem(),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.unsetCompleted(),this.isCompleted=!1,this.fireEvent("reset",this.currentIndex),(0,r.dispatch)("reset.hs.stepper",this.el,this.currentIndex)},e.prototype.setProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.setProcessedNavItemActions(e)},e.prototype.unsetProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.unsetProcessedNavItemActions(e)},e.prototype.goToNext=function(){"linear"===this.mode&&this.setCompleteItem(),this.handleNextButtonClick("linear"!==this.mode),"linear"===this.mode&&this.currentIndex===this.totalSteps&&(this.nextBtn&&(this.nextBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"))},e.prototype.disableButtons=function(){this.backBtn&&this.setToDisabled(this.backBtn),this.nextBtn&&this.setToDisabled(this.nextBtn)},e.prototype.enableButtons=function(){this.backBtn&&this.setToNonDisabled(this.backBtn),this.nextBtn&&this.setToNonDisabled(this.nextBtn)},e.prototype.setErrorNavItem=function(t){var e=this.getNavItem(t);e&&this.setErrorNavItemActions(e)},e.getInstance=function(t,e){var n=window.$hsStepperCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsStepperCollection||(window.$hsStepperCollection=[]),document.querySelectorAll("[data-hs-stepper]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsStepperCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=l),e.default=l},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0;e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var i="";return t.classList.forEach((function(t){t.includes(e)&&(i=t)})),i.match(/:(.*)]/)?i.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,i,s){void 0===n&&(n="auto"),void 0===i&&(i=10),void 0===s&&(s=null);var o=e.getBoundingClientRect(),r=s?s.getBoundingClientRect():null,l=window.innerHeight,a=r?o.top-r.top:o.top,p=(s?r.bottom:l)-o.bottom,c=t.clientHeight+i;return"bottom"===n?p>=c:"top"===n?a>=c:a>=c||p>=c};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var i=function(t){return!!t&&("none"===window.getComputedStyle(t).display||i(t.parentElement))};e.isParentOrElementHidden=i;e.debounce=function(t,e){var i;return void 0===e&&(e=200),function(){for(var s=[],o=0;othis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(i){var s=e[i];if(void 0!==s)return s.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}(957);return n})())); \ No newline at end of file diff --git a/dist/strong-password.d.ts b/dist/strong-password.d.ts index 949e17a..d73fcdc 100644 --- a/dist/strong-password.d.ts +++ b/dist/strong-password.d.ts @@ -1,18 +1,5 @@ -export interface IStrongPasswordOptions { - target: string | HTMLInputElement; - hints?: string; - stripClasses?: string; - minLength?: number; - mode?: string; - popoverSpace?: number; - checksExclude?: string[]; - specialCharactersSet?: string; -} -export interface IStrongPassword { - options?: IStrongPasswordOptions; - recalculateDirection(): void; -} + export interface IBasePlugin { el: E; options?: O; @@ -27,6 +14,20 @@ declare class HSBasePlugin implements IBasePlugin { fireEvent(evt: string, payload?: any): any; on(evt: string, cb: Function): void; } +export interface IStrongPasswordOptions { + target: string | HTMLInputElement; + hints?: string; + stripClasses?: string; + minLength?: number; + mode?: string; + popoverSpace?: number; + checksExclude?: string[]; + specialCharactersSet?: string; +} +export interface IStrongPassword { + options?: IStrongPasswordOptions; + recalculateDirection(): void; +} declare class HSStrongPassword extends HSBasePlugin implements IStrongPassword { private readonly target; private readonly hints; diff --git a/dist/strong-password.js b/dist/strong-password.js index c1f516b..40b0902 100644 --- a/dist/strong-password.js +++ b/dist/strong-password.js @@ -1,17 +1,17 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var s=e();for(var n in s)("object"==typeof exports?exports:t)[n]=s[n]}}(self,(()=>(()=>{"use strict";var t={737:(t,e)=>{ +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var s in n)("object"==typeof exports?exports:t)[s]=n[s]}}(self,(()=>(()=>{"use strict";var t={737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e,s){this.el=t,this.options=e,this.events=s,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var s;t.push({id:(null===(s=null==e?void 0:e.el)||void 0===s?void 0:s.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=s},983:function(t,e,s){ +Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},983:function(t,e,n){ /* * HSStrongPassword - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function s(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(s.prototype=e.prototype,new s)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,s=1,n=arguments.length;s?@[\\\\\\]^_`{|}~",n.target&&n.init(),n}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsStrongPasswordCollection,this),this.availableChecks.length&&this.build()},e.prototype.build=function(){var t=this;this.buildStrips(),this.hints&&this.buildHints(),this.setStrength(this.target.value),this.target.addEventListener("input",(function(e){t.setStrength(e.target.value)}))},e.prototype.buildStrips=function(){if(this.el.innerHTML="",this.stripClasses)for(var t=0;t");(0,r.classToClassList)(this.stripClasses,e),this.el.append(e)}},e.prototype.buildHints=function(){var t=this;this.weakness=this.hints.querySelector("[data-hs-strong-password-hints-weakness-text]")||null,this.rules=Array.from(this.hints.querySelectorAll("[data-hs-strong-password-hints-rule-text]"))||null,this.rules.forEach((function(e){var s,n=e.getAttribute("data-hs-strong-password-hints-rule-text");(null===(s=t.checksExclude)||void 0===s?void 0:s.includes(n))&&e.remove()})),this.weakness&&this.buildWeakness(),this.rules&&this.buildRules(),"popover"===this.mode&&(this.target.addEventListener("focus",(function(){t.isOpened=!0,t.hints.classList.remove("hidden"),t.hints.classList.add("block"),t.recalculateDirection()})),this.target.addEventListener("blur",(function(){t.isOpened=!1,t.hints.classList.remove("block","bottom-full","top-full"),t.hints.classList.add("hidden"),t.hints.style.marginTop="",t.hints.style.marginBottom=""})))},e.prototype.buildWeakness=function(){var t=this;this.checkStrength(this.target.value),this.setWeaknessText(),this.target.addEventListener("input",(function(){return setTimeout((function(){return t.setWeaknessText()}))}))},e.prototype.buildRules=function(){var t=this;this.setRulesText(),this.target.addEventListener("input",(function(){return setTimeout((function(){return t.setRulesText()}))}))},e.prototype.setWeaknessText=function(){var t=this.weakness.getAttribute("data-hs-strong-password-hints-weakness-text"),e=JSON.parse(t);this.weakness.textContent=e[this.strength]},e.prototype.setRulesText=function(){var t=this;this.rules.forEach((function(e){var s=e.getAttribute("data-hs-strong-password-hints-rule-text");t.checkIfPassed(e,t.passedRules.has(s))}))},e.prototype.togglePopover=function(){var t=this.el.querySelector(".popover");t&&t.classList.toggle("show")},e.prototype.checkStrength=function(t){var e=new Set,s={lowercase:/[a-z]+/,uppercase:/[A-Z]+/,numbers:/[0-9]+/,"special-characters":new RegExp("[".concat(this.specialCharactersSet,"]"))},n=0;return this.availableChecks.includes("lowercase")&&t.match(s.lowercase)&&(n+=1,e.add("lowercase")),this.availableChecks.includes("uppercase")&&t.match(s.uppercase)&&(n+=1,e.add("uppercase")),this.availableChecks.includes("numbers")&&t.match(s.numbers)&&(n+=1,e.add("numbers")),this.availableChecks.includes("special-characters")&&t.match(s["special-characters"])&&(n+=1,e.add("special-characters")),this.availableChecks.includes("min-length")&&t.length>=this.minLength&&(n+=1,e.add("min-length")),t.length||(n=0),n===this.availableChecks.length?this.el.classList.add("accepted"):this.el.classList.remove("accepted"),this.strength=n,this.passedRules=e,{strength:this.strength,rules:this.passedRules}},e.prototype.checkIfPassed=function(t,e){void 0===e&&(e=!1);var s=t.querySelector("[data-check]"),n=t.querySelector("[data-uncheck]");e?(t.classList.add("active"),s.classList.remove("hidden"),n.classList.add("hidden")):(t.classList.remove("active"),s.classList.add("hidden"),n.classList.remove("hidden"))},e.prototype.setStrength=function(t){var e=this.checkStrength(t),s=e.strength,n={strength:s,rules:e.rules};this.hideStrips(s),this.fireEvent("change",n),(0,r.dispatch)("change.hs.strongPassword",this.el,n)},e.prototype.hideStrips=function(t){Array.from(this.el.children).forEach((function(e,s){s2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,s,n,i){void 0===s&&(s="auto"),void 0===n&&(n=10),void 0===i&&(i=null);var o=e.getBoundingClientRect(),r=i?i.getBoundingClientRect():null,a=window.innerHeight,l=r?o.top-r.top:o.top,c=(i?r.bottom:a)-o.bottom,u=t.clientHeight+n;return"bottom"===s?c>=u:"top"===s?l>=u:l>=u||c>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var n=function(t){return!!t&&("none"===window.getComputedStyle(t).display||n(t.parentElement))};e.isParentOrElementHidden=n;e.debounce=function(t,e){var n;return void 0===e&&(e=200),function(){for(var i=[],o=0;othis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var s=function s(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,s),o.exports}(983);return s})())); \ No newline at end of file +var s,i=this&&this.__extends||(s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},s(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,s=arguments.length;n?@[\\\\\\]^_`{|}~",s.target&&s.init(),s}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsStrongPasswordCollection,this),this.availableChecks.length&&this.build()},e.prototype.build=function(){var t=this;this.buildStrips(),this.hints&&this.buildHints(),this.setStrength(this.target.value),this.target.addEventListener("input",(function(e){t.setStrength(e.target.value)}))},e.prototype.buildStrips=function(){if(this.el.innerHTML="",this.stripClasses)for(var t=0;t");(0,r.classToClassList)(this.stripClasses,e),this.el.append(e)}},e.prototype.buildHints=function(){var t=this;this.weakness=this.hints.querySelector("[data-hs-strong-password-hints-weakness-text]")||null,this.rules=Array.from(this.hints.querySelectorAll("[data-hs-strong-password-hints-rule-text]"))||null,this.rules.forEach((function(e){var n,s=e.getAttribute("data-hs-strong-password-hints-rule-text");(null===(n=t.checksExclude)||void 0===n?void 0:n.includes(s))&&e.remove()})),this.weakness&&this.buildWeakness(),this.rules&&this.buildRules(),"popover"===this.mode&&(this.target.addEventListener("focus",(function(){t.isOpened=!0,t.hints.classList.remove("hidden"),t.hints.classList.add("block"),t.recalculateDirection()})),this.target.addEventListener("blur",(function(){t.isOpened=!1,t.hints.classList.remove("block","bottom-full","top-full"),t.hints.classList.add("hidden"),t.hints.style.marginTop="",t.hints.style.marginBottom=""})))},e.prototype.buildWeakness=function(){var t=this;this.checkStrength(this.target.value),this.setWeaknessText(),this.target.addEventListener("input",(function(){return setTimeout((function(){return t.setWeaknessText()}))}))},e.prototype.buildRules=function(){var t=this;this.setRulesText(),this.target.addEventListener("input",(function(){return setTimeout((function(){return t.setRulesText()}))}))},e.prototype.setWeaknessText=function(){var t=this.weakness.getAttribute("data-hs-strong-password-hints-weakness-text"),e=JSON.parse(t);this.weakness.textContent=e[this.strength]},e.prototype.setRulesText=function(){var t=this;this.rules.forEach((function(e){var n=e.getAttribute("data-hs-strong-password-hints-rule-text");t.checkIfPassed(e,t.passedRules.has(n))}))},e.prototype.togglePopover=function(){var t=this.el.querySelector(".popover");t&&t.classList.toggle("show")},e.prototype.checkStrength=function(t){var e=new Set,n={lowercase:/[a-z]+/,uppercase:/[A-Z]+/,numbers:/[0-9]+/,"special-characters":new RegExp("[".concat(this.specialCharactersSet,"]"))},s=0;return this.availableChecks.includes("lowercase")&&t.match(n.lowercase)&&(s+=1,e.add("lowercase")),this.availableChecks.includes("uppercase")&&t.match(n.uppercase)&&(s+=1,e.add("uppercase")),this.availableChecks.includes("numbers")&&t.match(n.numbers)&&(s+=1,e.add("numbers")),this.availableChecks.includes("special-characters")&&t.match(n["special-characters"])&&(s+=1,e.add("special-characters")),this.availableChecks.includes("min-length")&&t.length>=this.minLength&&(s+=1,e.add("min-length")),t.length||(s=0),s===this.availableChecks.length?this.el.classList.add("accepted"):this.el.classList.remove("accepted"),this.strength=s,this.passedRules=e,{strength:this.strength,rules:this.passedRules}},e.prototype.checkIfPassed=function(t,e){void 0===e&&(e=!1);var n=t.querySelector("[data-check]"),s=t.querySelector("[data-uncheck]");e?(t.classList.add("active"),n.classList.remove("hidden"),s.classList.add("hidden")):(t.classList.remove("active"),n.classList.add("hidden"),s.classList.remove("hidden"))},e.prototype.setStrength=function(t){var e=this.checkStrength(t),n=e.strength,s={strength:n,rules:e.rules};this.hideStrips(n),this.fireEvent("change",s),(0,r.dispatch)("change.hs.strongPassword",this.el,s)},e.prototype.hideStrips=function(t){Array.from(this.el.children).forEach((function(e,n){n2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,s,i){void 0===n&&(n="auto"),void 0===s&&(s=10),void 0===i&&(i=null);var o=e.getBoundingClientRect(),r=i?i.getBoundingClientRect():null,a=window.innerHeight,l=r?o.top-r.top:o.top,c=(i?r.bottom:a)-o.bottom,u=t.clientHeight+s;return"bottom"===n?c>=u:"top"===n?l>=u:l>=u||c>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var s=function(t){return!!t&&("none"===window.getComputedStyle(t).display||s(t.parentElement))};e.isParentOrElementHidden=s;e.debounce=function(t,e){var s;return void 0===e&&(e=200),function(){for(var i=[],o=0;othis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(s){var i=e[s];if(void 0!==i)return i.exports;var o=e[s]={exports:{}};return t[s].call(o.exports,o,o.exports,n),o.exports}(983);return n})())); \ No newline at end of file diff --git a/dist/tabs.d.ts b/dist/tabs.d.ts index f3a8b0f..ab3aecb 100644 --- a/dist/tabs.d.ts +++ b/dist/tabs.d.ts @@ -1,7 +1,5 @@ -export interface ITabs { - options?: {}; -} + export interface IBasePlugin { el: E; options?: O; @@ -20,6 +18,9 @@ export interface ICollectionItem { id: string | number; element: T; } +export interface ITabs { + options?: {}; +} declare class HSTabs extends HSBasePlugin<{}> implements ITabs { toggles: NodeListOf | null; private readonly extraToggleId; diff --git a/dist/tabs.js b/dist/tabs.js index 55c305f..9dd9f5d 100644 --- a/dist/tabs.js +++ b/dist/tabs.js @@ -1,7 +1,7 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={190:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.COMBO_BOX_ACCESSIBILITY_KEY_SET=e.SELECT_ACCESSIBILITY_KEY_SET=e.TABS_ACCESSIBILITY_KEY_SET=e.OVERLAY_ACCESSIBILITY_KEY_SET=e.DROPDOWN_ACCESSIBILITY_KEY_SET=e.POSITIONS=void 0,e.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},e.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],e.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],e.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],e.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],e.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"]},737:(t,e)=>{ +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={190:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BREAKPOINTS=e.COMBO_BOX_ACCESSIBILITY_KEY_SET=e.SELECT_ACCESSIBILITY_KEY_SET=e.TABS_ACCESSIBILITY_KEY_SET=e.OVERLAY_ACCESSIBILITY_KEY_SET=e.DROPDOWN_ACCESSIBILITY_KEY_SET=e.POSITIONS=void 0,e.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},e.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],e.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],e.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],e.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],e.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],e.BREAKPOINTS={sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,9 +9,9 @@ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},949:function(t,e,n){ /* * HSTabs - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(969),s=n(737),a=n(190),c=function(t){function e(e,n,o){var r=t.call(this,e,n,o)||this;return r.toggles=r.el.querySelectorAll("[data-hs-tab]"),r.extraToggleId=r.el.getAttribute("hs-data-tab-select"),r.extraToggle=document.querySelector(r.extraToggleId),r.current=Array.from(r.toggles).find((function(t){return t.classList.contains("active")})),r.currentContentId=r.current.getAttribute("data-hs-tab"),r.currentContent=document.querySelector(r.currentContentId),r.prev=null,r.prevContentId=null,r.prevContent=null,r.init(),r}return r(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsTabsCollection,this),this.toggles.forEach((function(e){e.addEventListener("click",(function(){return t.open(e)}))})),this.extraToggle&&this.extraToggle.addEventListener("change",(function(e){return t.change(e)}))},e.prototype.open=function(t){this.prev=this.current,this.prevContentId=this.currentContentId,this.prevContent=this.currentContent,this.current=t,this.currentContentId=this.current.getAttribute("data-hs-tab"),this.currentContent=document.querySelector(this.currentContentId),this.prev.classList.remove("active"),this.prevContent.classList.add("hidden"),this.current.classList.add("active"),this.currentContent.classList.remove("hidden"),this.fireEvent("change",{el:t,prev:this.prevContentId,current:this.currentContentId}),(0,i.dispatch)("change.hs.tab",t,{el:t,prev:this.prevContentId,current:this.currentContentId})},e.prototype.change=function(t){var e=document.querySelector('[data-hs-tab="'.concat(t.target.value,'"]'));e&&e.click()},e.getInstance=function(t,e){var n=window.$hsTabsCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsTabsCollection||(window.$hsTabsCollection=[]),document.querySelectorAll('[role="tablist"]:not(select):not(.--prevent-on-load-init)').forEach((function(t){window.$hsTabsCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)})),window.$hsTabsCollection&&document.addEventListener("keydown",(function(t){return e.accessibility(t)}))},e.open=function(t){var e=window.$hsTabsCollection.find((function(e){return Array.from(e.element.toggles).includes("string"==typeof t?document.querySelector(t):t)})),n=Array.from(e.element.toggles).find((function(e){return e===("string"==typeof t?document.querySelector(t):t)}));n&&!n.classList.contains("active")&&e.element.open(n)},e.accessibility=function(t){var e=document.querySelector("[data-hs-tab]:focus");if(e&&a.TABS_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey){var n=e.closest('[role="tablist"]').getAttribute("data-hs-tabs-vertical");switch(t.preventDefault(),console.log("Key code:",t.code),t.code){case"true"===n?"ArrowUp":"ArrowLeft":this.onArrow();break;case"true"===n?"ArrowDown":"ArrowRight":this.onArrow(!1);break;case"Home":this.onStartEnd();break;case"End":this.onStartEnd(!1)}}},e.onArrow=function(t){void 0===t&&(t=!0);var e=document.querySelector("[data-hs-tab]:focus").closest('[role="tablist"]'),n=window.$hsTabsCollection.find((function(t){return t.element.el===e}));if(n){var o=t?Array.from(n.element.toggles).reverse():Array.from(n.element.toggles),r=o.find((function(t){return document.activeElement===t})),i=o.findIndex((function(t){return t===r}));o[i=i+12&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,r){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===r&&(r=null);var i=e.getBoundingClientRect(),s=r?r.getBoundingClientRect():null,a=window.innerHeight,c=s?i.top-s.top:i.top,l=(r?s.bottom:a)-i.bottom,u=t.clientHeight+o;return"bottom"===n?l>=u:"top"===n?c>=u:c>=u||l>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var r=[],i=0;ithis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(o){var r=e[o];if(void 0!==r)return r.exports;var i=e[o]={exports:{}};return t[o].call(i.exports,i,i.exports,n),i.exports}(949);return n})())); \ No newline at end of file +var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(969),s=n(737),a=n(190),c=function(t){function e(e,n,o){var r=t.call(this,e,n,o)||this;return r.toggles=r.el.querySelectorAll("[data-hs-tab]"),r.extraToggleId=r.el.getAttribute("hs-data-tab-select"),r.extraToggle=document.querySelector(r.extraToggleId),r.current=Array.from(r.toggles).find((function(t){return t.classList.contains("active")})),r.currentContentId=r.current.getAttribute("data-hs-tab"),r.currentContent=document.querySelector(r.currentContentId),r.prev=null,r.prevContentId=null,r.prevContent=null,r.init(),r}return r(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsTabsCollection,this),this.toggles.forEach((function(e){e.addEventListener("click",(function(){return t.open(e)}))})),this.extraToggle&&this.extraToggle.addEventListener("change",(function(e){return t.change(e)}))},e.prototype.open=function(t){this.prev=this.current,this.prevContentId=this.currentContentId,this.prevContent=this.currentContent,this.current=t,this.currentContentId=this.current.getAttribute("data-hs-tab"),this.currentContent=document.querySelector(this.currentContentId),this.prev.classList.remove("active"),this.prevContent.classList.add("hidden"),this.current.classList.add("active"),this.currentContent.classList.remove("hidden"),this.fireEvent("change",{el:t,prev:this.prevContentId,current:this.currentContentId}),(0,i.dispatch)("change.hs.tab",t,{el:t,prev:this.prevContentId,current:this.currentContentId})},e.prototype.change=function(t){var e=document.querySelector('[data-hs-tab="'.concat(t.target.value,'"]'));e&&e.click()},e.getInstance=function(t,e){var n=window.$hsTabsCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsTabsCollection||(window.$hsTabsCollection=[]),document.querySelectorAll('[role="tablist"]:not(select):not(.--prevent-on-load-init)').forEach((function(t){window.$hsTabsCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)})),window.$hsTabsCollection&&document.addEventListener("keydown",(function(t){return e.accessibility(t)}))},e.open=function(t){var e=window.$hsTabsCollection.find((function(e){return Array.from(e.element.toggles).includes("string"==typeof t?document.querySelector(t):t)})),n=Array.from(e.element.toggles).find((function(e){return e===("string"==typeof t?document.querySelector(t):t)}));n&&!n.classList.contains("active")&&e.element.open(n)},e.accessibility=function(t){var e=document.querySelector("[data-hs-tab]:focus");if(e&&a.TABS_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey){var n=e.closest('[role="tablist"]').getAttribute("data-hs-tabs-vertical");switch(t.preventDefault(),t.code){case"true"===n?"ArrowUp":"ArrowLeft":this.onArrow();break;case"true"===n?"ArrowDown":"ArrowRight":this.onArrow(!1);break;case"Home":this.onStartEnd();break;case"End":this.onStartEnd(!1)}}},e.onArrow=function(t){void 0===t&&(t=!0);var e=document.querySelector("[data-hs-tab]:focus").closest('[role="tablist"]'),n=window.$hsTabsCollection.find((function(t){return t.element.el===e}));if(n){var o=t?Array.from(n.element.toggles).reverse():Array.from(n.element.toggles),r=o.find((function(t){return document.activeElement===t})),i=o.findIndex((function(t){return t===r}));o[i=i+12&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,r){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===r&&(r=null);var i=e.getBoundingClientRect(),s=r?r.getBoundingClientRect():null,a=window.innerHeight,c=s?i.top-s.top:i.top,l=(r?s.bottom:a)-i.bottom,u=t.clientHeight+o;return"bottom"===n?l>=u:"top"===n?c>=u:c>=u||l>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var r=[],i=0;ithis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(o){var r=e[o];if(void 0!==r)return r.exports;var i=e[o]={exports:{}};return t[o].call(i.exports,i,i.exports,n),i.exports}(949);return n})())); \ No newline at end of file diff --git a/dist/theme-switch.d.ts b/dist/theme-switch.d.ts index 577b1f7..eb60882 100644 --- a/dist/theme-switch.d.ts +++ b/dist/theme-switch.d.ts @@ -1,11 +1,5 @@ -export interface IThemeSwitchOptions { - theme?: "dark" | "light" | "default"; -} -export interface IThemeSwitch { - options?: IThemeSwitchOptions; - setAppearance(theme: string, isSaveToLocalStorage: boolean, isSetDispatchEvent: boolean): void; -} + export interface IBasePlugin { el: E; options?: O; @@ -20,12 +14,21 @@ declare class HSBasePlugin implements IBasePlugin { fireEvent(evt: string, payload?: any): any; on(evt: string, cb: Function): void; } +export interface IThemeSwitchOptions { + theme?: "dark" | "light" | "default"; +} +export interface IThemeSwitch { + options?: IThemeSwitchOptions; + setAppearance(theme: string, isSaveToLocalStorage: boolean, isSetDispatchEvent: boolean): void; +} declare class HSThemeSwitch extends HSBasePlugin implements IThemeSwitch { theme: string; private readonly themeSet; constructor(el: HTMLElement, options?: IThemeSwitchOptions); private init; private setResetStyles; + private addSystemThemeObserver; + private removeSystemThemeObserver; setAppearance(theme?: string, isSaveToLocalStorage?: boolean, isSetDispatchEvent?: boolean): void; static getInstance(target: HTMLElement | string): HSThemeSwitch; static autoInit(): void; diff --git a/dist/theme-switch.js b/dist/theme-switch.js index 8c54115..d784d70 100644 --- a/dist/theme-switch.js +++ b/dist/theme-switch.js @@ -1,9 +1,9 @@ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,(()=>(()=>{"use strict";var e={737:(e,t)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t,n){this.el=e,this.options=t,this.events=n,this.el=e,this.options=t,this.events={}}return e.prototype.createCollection=function(e,t){var n;e.push({id:(null===(n=null==t?void 0:t.el)||void 0===n?void 0:n.id)||e.length+1,element:t})},e.prototype.fireEvent=function(e,t){if(void 0===t&&(t=null),this.events.hasOwnProperty(e))return this.events[e](t)},e.prototype.on=function(e,t){this.events[e]=t},e}();t.default=n},557:function(e,t,n){var o,i=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n { el: E; options?: O; @@ -28,6 +18,17 @@ export interface ICollectionItem { id: string | number; element: T; } +export interface IToggleCountOptions { + target: string | HTMLInputElement; + min: number; + max: number; + duration: number; +} +export interface IToggleCount { + options?: IToggleCountOptions; + countUp(): void; + countDown(): void; +} declare class HSToggleCount extends HSBasePlugin implements IToggleCount { private readonly target; private readonly min; diff --git a/dist/toggle-count.js b/dist/toggle-count.js index feabb06..2a9b2c5 100644 --- a/dist/toggle-count.js +++ b/dist/toggle-count.js @@ -1,7 +1,7 @@ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,7 +9,7 @@ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},87:function(t,e,n){ /* * HSToggleCount - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream diff --git a/dist/toggle-password.d.ts b/dist/toggle-password.d.ts index 8af282d..e50ce22 100644 --- a/dist/toggle-password.d.ts +++ b/dist/toggle-password.d.ts @@ -1,12 +1,5 @@ -export interface ITogglePasswordOptions { - target: string | string[] | HTMLInputElement | HTMLInputElement[]; -} -export interface ITogglePassword { - options?: ITogglePasswordOptions; - show(): void; - hide(): void; -} + export interface IBasePlugin { el: E; options?: O; @@ -25,6 +18,14 @@ export interface ICollectionItem { id: string | number; element: T; } +export interface ITogglePasswordOptions { + target: string | string[] | HTMLInputElement | HTMLInputElement[]; +} +export interface ITogglePassword { + options?: ITogglePasswordOptions; + show(): void; + hide(): void; +} declare class HSTogglePassword extends HSBasePlugin implements ITogglePassword { private readonly target; private isShown; diff --git a/dist/toggle-password.js b/dist/toggle-password.js index 6933f7f..325abe0 100644 --- a/dist/toggle-password.js +++ b/dist/toggle-password.js @@ -1,7 +1,7 @@ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,9 +9,9 @@ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},366:function(t,e,n){ /* * HSTogglePassword - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n1&&!!o.el.closest("[data-hs-toggle-password-group]"),o.target&&o.init(),o}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsTogglePasswordCollection,this),this.isShown?this.show():this.hide(),this.el.addEventListener(this.eventType,(function(){t.isShown?t.hide():t.show(),t.fireEvent("toggle",t.target),(0,s.dispatch)("toggle.hs.toggle-select",t.el,t.target)}))},e.prototype.getMultipleToggles=function(){var t=this.el.closest("[data-hs-toggle-password-group]").querySelectorAll("[data-hs-toggle-password]"),n=[];return t.forEach((function(t){n.push(e.getInstance(t))})),n},e.prototype.show=function(){this.isMultiple?(this.getMultipleToggles().forEach((function(t){return!!t&&(t.isShown=!0)})),this.el.closest("[data-hs-toggle-password-group]").classList.add("active")):(this.isShown=!0,this.el.classList.add("active"));this.target.forEach((function(t){t.type="text"}))},e.prototype.hide=function(){this.isMultiple?(this.getMultipleToggles().forEach((function(t){return!!t&&(t.isShown=!1)})),this.el.closest("[data-hs-toggle-password-group]").classList.remove("active")):(this.isShown=!1,this.el.classList.remove("active"));this.target.forEach((function(t){t.type="password"}))},e.getInstance=function(t,e){var n=window.$hsTogglePasswordCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsTogglePasswordCollection||(window.$hsTogglePasswordCollection=[]),document.querySelectorAll("[data-hs-toggle-password]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsTogglePasswordCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=l),e.default=l},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=void 0;e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,l=window.innerHeight,a=s?r.top-s.top:r.top,u=(i?s.bottom:l)-r.bottom,c=t.clientHeight+o;return"bottom"===n?u>=c:"top"===n?a>=c:a>=c||u>=c};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}(366);return n})())); \ No newline at end of file +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n1&&!!o.el.closest("[data-hs-toggle-password-group]"),o.target&&o.init(),o}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsTogglePasswordCollection,this),this.isShown?this.show():this.hide(),this.el.addEventListener(this.eventType,(function(){t.isShown?t.hide():t.show(),t.fireEvent("toggle",t.target),(0,s.dispatch)("toggle.hs.toggle-select",t.el,t.target)}))},e.prototype.getMultipleToggles=function(){var t=this.el.closest("[data-hs-toggle-password-group]").querySelectorAll("[data-hs-toggle-password]"),n=[];return t.forEach((function(t){n.push(e.getInstance(t))})),n},e.prototype.show=function(){this.isMultiple?(this.getMultipleToggles().forEach((function(t){return!!t&&(t.isShown=!0)})),this.el.closest("[data-hs-toggle-password-group]").classList.add("active")):(this.isShown=!0,this.el.classList.add("active"));this.target.forEach((function(t){t.type="text"}))},e.prototype.hide=function(){this.isMultiple?(this.getMultipleToggles().forEach((function(t){return!!t&&(t.isShown=!1)})),this.el.closest("[data-hs-toggle-password-group]").classList.remove("active")):(this.isShown=!1,this.el.classList.remove("active"));this.target.forEach((function(t){t.type="password"}))},e.getInstance=function(t,e){var n=window.$hsTogglePasswordCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsTogglePasswordCollection||(window.$hsTogglePasswordCollection=[]),document.querySelectorAll("[data-hs-toggle-password]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsTogglePasswordCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=a),e.default=a},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0;e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,a=window.innerHeight,l=s?r.top-s.top:r.top,u=(i?s.bottom:a)-r.bottom,c=t.clientHeight+o;return"bottom"===n?u>=c:"top"===n?l>=c:l>=c||u>=c};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}(366);return n})())); \ No newline at end of file diff --git a/dist/tooltip.d.ts b/dist/tooltip.d.ts index 4f325a5..1cd0cdf 100644 --- a/dist/tooltip.d.ts +++ b/dist/tooltip.d.ts @@ -1,9 +1,5 @@ -export interface ITooltip { - options?: {}; - show(): void; - hide(): void; -} + export interface IBasePlugin { el: E; options?: O; @@ -22,6 +18,11 @@ export interface ICollectionItem { id: string | number; element: T; } +export interface ITooltip { + options?: {}; + show(): void; + hide(): void; +} declare class HSTooltip extends HSBasePlugin<{}> implements ITooltip { private readonly toggle; content: HTMLElement | null; diff --git a/dist/tooltip.js b/dist/tooltip.js index adcf10b..c77a0ef 100644 --- a/dist/tooltip.js +++ b/dist/tooltip.js @@ -1,7 +1,7 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,(()=>(()=>{"use strict";var e={492:(e,t,n)=>{n.r(t),n.d(t,{afterMain:()=>O,afterRead:()=>b,afterWrite:()=>T,applyStyles:()=>j,arrow:()=>Q,auto:()=>s,basePlacements:()=>f,beforeMain:()=>w,beforeRead:()=>g,beforeWrite:()=>E,bottom:()=>r,clippingParents:()=>p,computeStyles:()=>ne,createPopper:()=>je,createPopperBase:()=>_e,createPopperLite:()=>Me,detectOverflow:()=>ye,end:()=>l,eventListeners:()=>re,flip:()=>be,hide:()=>Oe,left:()=>a,main:()=>x,modifierPhases:()=>L,offset:()=>Ee,placements:()=>v,popper:()=>d,popperGenerator:()=>Ie,popperOffsets:()=>Se,preventOverflow:()=>Te,read:()=>y,reference:()=>h,right:()=>i,start:()=>c,top:()=>o,variationPlacements:()=>m,viewport:()=>u,write:()=>S});var o="top",r="bottom",i="right",a="left",s="auto",f=[o,r,i,a],c="start",l="end",p="clippingParents",u="viewport",d="popper",h="reference",m=f.reduce((function(e,t){return e.concat([t+"-"+c,t+"-"+l])}),[]),v=[].concat(f,[s]).reduce((function(e,t){return e.concat([t,t+"-"+c,t+"-"+l])}),[]),g="beforeRead",y="read",b="afterRead",w="beforeMain",x="main",O="afterMain",E="beforeWrite",S="write",T="afterWrite",L=[g,y,b,w,x,O,E,S,T];function P(e){return e?(e.nodeName||"").toLowerCase():null}function A(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function C(e){return e instanceof A(e).Element||e instanceof Element}function I(e){return e instanceof A(e).HTMLElement||e instanceof HTMLElement}function _(e){return"undefined"!=typeof ShadowRoot&&(e instanceof A(e).ShadowRoot||e instanceof ShadowRoot)}const j={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},r=t.elements[e];I(r)&&P(r)&&(Object.assign(r.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],r=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});I(o)&&P(o)&&(Object.assign(o.style,i),Object.keys(r).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]};function M(e){return e.split("-")[0]}var D=Math.max,B=Math.min,H=Math.round;function k(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function R(){return!/^((?!chrome|android).)*safari/i.test(k())}function W(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&I(e)&&(r=e.offsetWidth>0&&H(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&H(o.height)/e.offsetHeight||1);var a=(C(e)?A(e):window).visualViewport,s=!R()&&n,f=(o.left+(s&&a?a.offsetLeft:0))/r,c=(o.top+(s&&a?a.offsetTop:0))/i,l=o.width/r,p=o.height/i;return{width:l,height:p,top:c,right:f+l,bottom:c+p,left:f,x:f,y:c}}function Y(e){var t=W(e),n=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function q(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&_(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function V(e){return A(e).getComputedStyle(e)}function N(e){return["table","td","th"].indexOf(P(e))>=0}function K(e){return((C(e)?e.ownerDocument:e.document)||window.document).documentElement}function U(e){return"html"===P(e)?e:e.assignedSlot||e.parentNode||(_(e)?e.host:null)||K(e)}function $(e){return I(e)&&"fixed"!==V(e).position?e.offsetParent:null}function F(e){for(var t=A(e),n=$(e);n&&N(n)&&"static"===V(n).position;)n=$(n);return n&&("html"===P(n)||"body"===P(n)&&"static"===V(n).position)?t:n||function(e){var t=/firefox/i.test(k());if(/Trident/i.test(k())&&I(e)&&"fixed"===V(e).position)return null;var n=U(e);for(_(n)&&(n=n.host);I(n)&&["html","body"].indexOf(P(n))<0;){var o=V(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||t&&"filter"===o.willChange||t&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(e)||t}function X(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function z(e,t,n){return D(e,B(t,n))}function G(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function J(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}const Q={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,s=e.name,c=e.options,l=n.elements.arrow,p=n.modifiersData.popperOffsets,u=M(n.placement),d=X(u),h=[a,i].indexOf(u)>=0?"height":"width";if(l&&p){var m=function(e,t){return G("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:J(e,f))}(c.padding,n),v=Y(l),g="y"===d?o:a,y="y"===d?r:i,b=n.rects.reference[h]+n.rects.reference[d]-p[d]-n.rects.popper[h],w=p[d]-n.rects.reference[d],x=F(l),O=x?"y"===d?x.clientHeight||0:x.clientWidth||0:0,E=b/2-w/2,S=m[g],T=O-v[h]-m[y],L=O/2-v[h]/2+E,P=z(S,L,T),A=d;n.modifiersData[s]=((t={})[A]=P,t.centerOffset=P-L,t)}},effect:function(e){var t=e.state,n=e.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!=typeof o||(o=t.elements.popper.querySelector(o)))&&q(t.elements.popper,o)&&(t.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Z(e){return e.split("-")[1]}var ee={top:"auto",right:"auto",bottom:"auto",left:"auto"};function te(e){var t,n=e.popper,s=e.popperRect,f=e.placement,c=e.variation,p=e.offsets,u=e.position,d=e.gpuAcceleration,h=e.adaptive,m=e.roundOffsets,v=e.isFixed,g=p.x,y=void 0===g?0:g,b=p.y,w=void 0===b?0:b,x="function"==typeof m?m({x:y,y:w}):{x:y,y:w};y=x.x,w=x.y;var O=p.hasOwnProperty("x"),E=p.hasOwnProperty("y"),S=a,T=o,L=window;if(h){var P=F(n),C="clientHeight",I="clientWidth";if(P===A(n)&&"static"!==V(P=K(n)).position&&"absolute"===u&&(C="scrollHeight",I="scrollWidth"),f===o||(f===a||f===i)&&c===l)T=r,w-=(v&&P===L&&L.visualViewport?L.visualViewport.height:P[C])-s.height,w*=d?1:-1;if(f===a||(f===o||f===r)&&c===l)S=i,y-=(v&&P===L&&L.visualViewport?L.visualViewport.width:P[I])-s.width,y*=d?1:-1}var _,j=Object.assign({position:u},h&&ee),M=!0===m?function(e,t){var n=e.x,o=e.y,r=t.devicePixelRatio||1;return{x:H(n*r)/r||0,y:H(o*r)/r||0}}({x:y,y:w},A(n)):{x:y,y:w};return y=M.x,w=M.y,d?Object.assign({},j,((_={})[T]=E?"0":"",_[S]=O?"0":"",_.transform=(L.devicePixelRatio||1)<=1?"translate("+y+"px, "+w+"px)":"translate3d("+y+"px, "+w+"px, 0)",_)):Object.assign({},j,((t={})[T]=E?w+"px":"",t[S]=O?y+"px":"",t.transform="",t))}const ne={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,o=n.gpuAcceleration,r=void 0===o||o,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,f=void 0===s||s,c={placement:M(t.placement),variation:Z(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,te(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:f})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,te(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var oe={passive:!0};const re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,o=e.options,r=o.scroll,i=void 0===r||r,a=o.resize,s=void 0===a||a,f=A(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,oe)})),s&&f.addEventListener("resize",n.update,oe),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,oe)})),s&&f.removeEventListener("resize",n.update,oe)}},data:{}};var ie={left:"right",right:"left",bottom:"top",top:"bottom"};function ae(e){return e.replace(/left|right|bottom|top/g,(function(e){return ie[e]}))}var se={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return se[e]}))}function ce(e){var t=A(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function le(e){return W(K(e)).left+ce(e).scrollLeft}function pe(e){var t=V(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function ue(e){return["html","body","#document"].indexOf(P(e))>=0?e.ownerDocument.body:I(e)&&pe(e)?e:ue(U(e))}function de(e,t){var n;void 0===t&&(t=[]);var o=ue(e),r=o===(null==(n=e.ownerDocument)?void 0:n.body),i=A(o),a=r?[i].concat(i.visualViewport||[],pe(o)?o:[]):o,s=t.concat(a);return r?s:s.concat(de(U(a)))}function he(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function me(e,t,n){return t===u?he(function(e,t){var n=A(e),o=K(e),r=n.visualViewport,i=o.clientWidth,a=o.clientHeight,s=0,f=0;if(r){i=r.width,a=r.height;var c=R();(c||!c&&"fixed"===t)&&(s=r.offsetLeft,f=r.offsetTop)}return{width:i,height:a,x:s+le(e),y:f}}(e,n)):C(t)?function(e,t){var n=W(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):he(function(e){var t,n=K(e),o=ce(e),r=null==(t=e.ownerDocument)?void 0:t.body,i=D(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=D(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-o.scrollLeft+le(e),f=-o.scrollTop;return"rtl"===V(r||n).direction&&(s+=D(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:s,y:f}}(K(e)))}function ve(e,t,n,o){var r="clippingParents"===t?function(e){var t=de(U(e)),n=["absolute","fixed"].indexOf(V(e).position)>=0&&I(e)?F(e):e;return C(n)?t.filter((function(e){return C(e)&&q(e,n)&&"body"!==P(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),a=i[0],s=i.reduce((function(t,n){var r=me(e,n,o);return t.top=D(r.top,t.top),t.right=B(r.right,t.right),t.bottom=B(r.bottom,t.bottom),t.left=D(r.left,t.left),t}),me(e,a,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function ge(e){var t,n=e.reference,s=e.element,f=e.placement,p=f?M(f):null,u=f?Z(f):null,d=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2;switch(p){case o:t={x:d,y:n.y-s.height};break;case r:t={x:d,y:n.y+n.height};break;case i:t={x:n.x+n.width,y:h};break;case a:t={x:n.x-s.width,y:h};break;default:t={x:n.x,y:n.y}}var m=p?X(p):null;if(null!=m){var v="y"===m?"height":"width";switch(u){case c:t[m]=t[m]-(n[v]/2-s[v]/2);break;case l:t[m]=t[m]+(n[v]/2-s[v]/2)}}return t}function ye(e,t){void 0===t&&(t={});var n=t,a=n.placement,s=void 0===a?e.placement:a,c=n.strategy,l=void 0===c?e.strategy:c,m=n.boundary,v=void 0===m?p:m,g=n.rootBoundary,y=void 0===g?u:g,b=n.elementContext,w=void 0===b?d:b,x=n.altBoundary,O=void 0!==x&&x,E=n.padding,S=void 0===E?0:E,T=G("number"!=typeof S?S:J(S,f)),L=w===d?h:d,P=e.rects.popper,A=e.elements[O?L:w],I=ve(C(A)?A:A.contextElement||K(e.elements.popper),v,y,l),_=W(e.elements.reference),j=ge({reference:_,element:P,strategy:"absolute",placement:s}),M=he(Object.assign({},P,j)),D=w===d?M:_,B={top:I.top-D.top+T.top,bottom:D.bottom-I.bottom+T.bottom,left:I.left-D.left+T.left,right:D.right-I.right+T.right},H=e.modifiersData.offset;if(w===d&&H){var k=H[s];Object.keys(B).forEach((function(e){var t=[i,r].indexOf(e)>=0?1:-1,n=[o,r].indexOf(e)>=0?"y":"x";B[e]+=k[n]*t}))}return B}const be={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var p=n.mainAxis,u=void 0===p||p,d=n.altAxis,h=void 0===d||d,g=n.fallbackPlacements,y=n.padding,b=n.boundary,w=n.rootBoundary,x=n.altBoundary,O=n.flipVariations,E=void 0===O||O,S=n.allowedAutoPlacements,T=t.options.placement,L=M(T),P=g||(L===T||!E?[ae(T)]:function(e){if(M(e)===s)return[];var t=ae(e);return[fe(e),t,fe(t)]}(T)),A=[T].concat(P).reduce((function(e,n){return e.concat(M(n)===s?function(e,t){void 0===t&&(t={});var n=t,o=n.placement,r=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?v:c,p=Z(o),u=p?s?m:m.filter((function(e){return Z(e)===p})):f,d=u.filter((function(e){return l.indexOf(e)>=0}));0===d.length&&(d=u);var h=d.reduce((function(t,n){return t[n]=ye(e,{placement:n,boundary:r,rootBoundary:i,padding:a})[M(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}(t,{placement:n,boundary:b,rootBoundary:w,padding:y,flipVariations:E,allowedAutoPlacements:S}):n)}),[]),C=t.rects.reference,I=t.rects.popper,_=new Map,j=!0,D=A[0],B=0;B=0,Y=W?"width":"height",q=ye(t,{placement:H,boundary:b,rootBoundary:w,altBoundary:x,padding:y}),V=W?R?i:a:R?r:o;C[Y]>I[Y]&&(V=ae(V));var N=ae(V),K=[];if(u&&K.push(q[k]<=0),h&&K.push(q[V]<=0,q[N]<=0),K.every((function(e){return e}))){D=H,j=!1;break}_.set(H,K)}if(j)for(var U=function(e){var t=A.find((function(t){var n=_.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return D=t,"break"},$=E?3:1;$>0;$--){if("break"===U($))break}t.placement!==D&&(t.modifiersData[l]._skip=!0,t.placement=D,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function we(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function xe(e){return[o,i,r,a].some((function(t){return e[t]>=0}))}const Oe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,o=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,a=ye(t,{elementContext:"reference"}),s=ye(t,{altBoundary:!0}),f=we(a,o),c=we(s,r,i),l=xe(f),p=xe(c);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":p})}};const Ee={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,s=n.offset,f=void 0===s?[0,0]:s,c=v.reduce((function(e,n){return e[n]=function(e,t,n){var r=M(e),s=[a,o].indexOf(r)>=0?-1:1,f="function"==typeof n?n(Object.assign({},t,{placement:e})):n,c=f[0],l=f[1];return c=c||0,l=(l||0)*s,[a,i].indexOf(r)>=0?{x:l,y:c}:{x:c,y:l}}(n,t.rects,f),e}),{}),l=c[t.placement],p=l.x,u=l.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=p,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=c}};const Se={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ge({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};const Te={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,s=e.name,f=n.mainAxis,l=void 0===f||f,p=n.altAxis,u=void 0!==p&&p,d=n.boundary,h=n.rootBoundary,m=n.altBoundary,v=n.padding,g=n.tether,y=void 0===g||g,b=n.tetherOffset,w=void 0===b?0:b,x=ye(t,{boundary:d,rootBoundary:h,padding:v,altBoundary:m}),O=M(t.placement),E=Z(t.placement),S=!E,T=X(O),L="x"===T?"y":"x",P=t.modifiersData.popperOffsets,A=t.rects.reference,C=t.rects.popper,I="function"==typeof w?w(Object.assign({},t.rects,{placement:t.placement})):w,_="number"==typeof I?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,H={x:0,y:0};if(P){if(l){var k,R="y"===T?o:a,W="y"===T?r:i,q="y"===T?"height":"width",V=P[T],N=V+x[R],K=V-x[W],U=y?-C[q]/2:0,$=E===c?A[q]:C[q],G=E===c?-C[q]:-A[q],J=t.elements.arrow,Q=y&&J?Y(J):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[R],ne=ee[W],oe=z(0,A[q],Q[q]),re=S?A[q]/2-U-oe-te-_.mainAxis:$-oe-te-_.mainAxis,ie=S?-A[q]/2+U+oe+ne+_.mainAxis:G+oe+ne+_.mainAxis,ae=t.elements.arrow&&F(t.elements.arrow),se=ae?"y"===T?ae.clientTop||0:ae.clientLeft||0:0,fe=null!=(k=null==j?void 0:j[T])?k:0,ce=V+ie-fe,le=z(y?B(N,V+re-fe-se):N,V,y?D(K,ce):K);P[T]=le,H[T]=le-V}if(u){var pe,ue="x"===T?o:a,de="x"===T?r:i,he=P[L],me="y"===L?"height":"width",ve=he+x[ue],ge=he-x[de],be=-1!==[o,a].indexOf(O),we=null!=(pe=null==j?void 0:j[L])?pe:0,xe=be?ve:he-A[me]-C[me]-we+_.altAxis,Oe=be?he+A[me]+C[me]-we-_.altAxis:ge,Ee=y&&be?function(e,t,n){var o=z(e,t,n);return o>n?n:o}(xe,he,Oe):z(y?xe:ve,he,y?Oe:ge);P[L]=Ee,H[L]=Ee-he}t.modifiersData[s]=H}},requiresIfExists:["offset"]};function Le(e,t,n){void 0===n&&(n=!1);var o,r,i=I(t),a=I(t)&&function(e){var t=e.getBoundingClientRect(),n=H(t.width)/e.offsetWidth||1,o=H(t.height)/e.offsetHeight||1;return 1!==n||1!==o}(t),s=K(t),f=W(e,a,n),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&(("body"!==P(t)||pe(s))&&(c=(o=t)!==A(o)&&I(o)?{scrollLeft:(r=o).scrollLeft,scrollTop:r.scrollTop}:ce(o)),I(t)?((l=W(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=le(s))),{x:f.left+c.scrollLeft-l.x,y:f.top+c.scrollTop-l.y,width:f.width,height:f.height}}function Pe(e){var t=new Map,n=new Set,o=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var o=t.get(e);o&&r(o)}})),o.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),o}var Ae={placement:"bottom",modifiers:[],strategy:"absolute"};function Ce(){for(var e=arguments.length,t=new Array(e),n=0;n{Object.defineProperty(t,"__esModule",{value:!0}),t.COMBO_BOX_ACCESSIBILITY_KEY_SET=t.SELECT_ACCESSIBILITY_KEY_SET=t.TABS_ACCESSIBILITY_KEY_SET=t.OVERLAY_ACCESSIBILITY_KEY_SET=t.DROPDOWN_ACCESSIBILITY_KEY_SET=t.POSITIONS=void 0,t.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},t.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],t.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],t.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],t.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],t.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"]},737:(e,t)=>{ +!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,(()=>(()=>{"use strict";var e={492:(e,t,n)=>{n.r(t),n.d(t,{afterMain:()=>O,afterRead:()=>b,afterWrite:()=>T,applyStyles:()=>j,arrow:()=>Q,auto:()=>s,basePlacements:()=>c,beforeMain:()=>w,beforeRead:()=>g,beforeWrite:()=>E,bottom:()=>r,clippingParents:()=>p,computeStyles:()=>ne,createPopper:()=>je,createPopperBase:()=>_e,createPopperLite:()=>Me,detectOverflow:()=>ye,end:()=>l,eventListeners:()=>re,flip:()=>be,hide:()=>Oe,left:()=>a,main:()=>x,modifierPhases:()=>P,offset:()=>Ee,placements:()=>v,popper:()=>d,popperGenerator:()=>Ie,popperOffsets:()=>Se,preventOverflow:()=>Te,read:()=>y,reference:()=>h,right:()=>i,start:()=>f,top:()=>o,variationPlacements:()=>m,viewport:()=>u,write:()=>S});var o="top",r="bottom",i="right",a="left",s="auto",c=[o,r,i,a],f="start",l="end",p="clippingParents",u="viewport",d="popper",h="reference",m=c.reduce((function(e,t){return e.concat([t+"-"+f,t+"-"+l])}),[]),v=[].concat(c,[s]).reduce((function(e,t){return e.concat([t,t+"-"+f,t+"-"+l])}),[]),g="beforeRead",y="read",b="afterRead",w="beforeMain",x="main",O="afterMain",E="beforeWrite",S="write",T="afterWrite",P=[g,y,b,w,x,O,E,S,T];function L(e){return e?(e.nodeName||"").toLowerCase():null}function A(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function C(e){return e instanceof A(e).Element||e instanceof Element}function I(e){return e instanceof A(e).HTMLElement||e instanceof HTMLElement}function _(e){return"undefined"!=typeof ShadowRoot&&(e instanceof A(e).ShadowRoot||e instanceof ShadowRoot)}const j={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},r=t.elements[e];I(r)&&L(r)&&(Object.assign(r.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],r=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});I(o)&&L(o)&&(Object.assign(o.style,i),Object.keys(r).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]};function M(e){return e.split("-")[0]}var B=Math.max,D=Math.min,H=Math.round;function k(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function R(){return!/^((?!chrome|android).)*safari/i.test(k())}function W(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&I(e)&&(r=e.offsetWidth>0&&H(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&H(o.height)/e.offsetHeight||1);var a=(C(e)?A(e):window).visualViewport,s=!R()&&n,c=(o.left+(s&&a?a.offsetLeft:0))/r,f=(o.top+(s&&a?a.offsetTop:0))/i,l=o.width/r,p=o.height/i;return{width:l,height:p,top:f,right:c+l,bottom:f+p,left:c,x:c,y:f}}function Y(e){var t=W(e),n=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function q(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&_(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function V(e){return A(e).getComputedStyle(e)}function N(e){return["table","td","th"].indexOf(L(e))>=0}function K(e){return((C(e)?e.ownerDocument:e.document)||window.document).documentElement}function U(e){return"html"===L(e)?e:e.assignedSlot||e.parentNode||(_(e)?e.host:null)||K(e)}function $(e){return I(e)&&"fixed"!==V(e).position?e.offsetParent:null}function F(e){for(var t=A(e),n=$(e);n&&N(n)&&"static"===V(n).position;)n=$(n);return n&&("html"===L(n)||"body"===L(n)&&"static"===V(n).position)?t:n||function(e){var t=/firefox/i.test(k());if(/Trident/i.test(k())&&I(e)&&"fixed"===V(e).position)return null;var n=U(e);for(_(n)&&(n=n.host);I(n)&&["html","body"].indexOf(L(n))<0;){var o=V(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||t&&"filter"===o.willChange||t&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(e)||t}function X(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function z(e,t,n){return B(e,D(t,n))}function G(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function J(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}const Q={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,s=e.name,f=e.options,l=n.elements.arrow,p=n.modifiersData.popperOffsets,u=M(n.placement),d=X(u),h=[a,i].indexOf(u)>=0?"height":"width";if(l&&p){var m=function(e,t){return G("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:J(e,c))}(f.padding,n),v=Y(l),g="y"===d?o:a,y="y"===d?r:i,b=n.rects.reference[h]+n.rects.reference[d]-p[d]-n.rects.popper[h],w=p[d]-n.rects.reference[d],x=F(l),O=x?"y"===d?x.clientHeight||0:x.clientWidth||0:0,E=b/2-w/2,S=m[g],T=O-v[h]-m[y],P=O/2-v[h]/2+E,L=z(S,P,T),A=d;n.modifiersData[s]=((t={})[A]=L,t.centerOffset=L-P,t)}},effect:function(e){var t=e.state,n=e.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!=typeof o||(o=t.elements.popper.querySelector(o)))&&q(t.elements.popper,o)&&(t.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Z(e){return e.split("-")[1]}var ee={top:"auto",right:"auto",bottom:"auto",left:"auto"};function te(e){var t,n=e.popper,s=e.popperRect,c=e.placement,f=e.variation,p=e.offsets,u=e.position,d=e.gpuAcceleration,h=e.adaptive,m=e.roundOffsets,v=e.isFixed,g=p.x,y=void 0===g?0:g,b=p.y,w=void 0===b?0:b,x="function"==typeof m?m({x:y,y:w}):{x:y,y:w};y=x.x,w=x.y;var O=p.hasOwnProperty("x"),E=p.hasOwnProperty("y"),S=a,T=o,P=window;if(h){var L=F(n),C="clientHeight",I="clientWidth";if(L===A(n)&&"static"!==V(L=K(n)).position&&"absolute"===u&&(C="scrollHeight",I="scrollWidth"),c===o||(c===a||c===i)&&f===l)T=r,w-=(v&&L===P&&P.visualViewport?P.visualViewport.height:L[C])-s.height,w*=d?1:-1;if(c===a||(c===o||c===r)&&f===l)S=i,y-=(v&&L===P&&P.visualViewport?P.visualViewport.width:L[I])-s.width,y*=d?1:-1}var _,j=Object.assign({position:u},h&&ee),M=!0===m?function(e,t){var n=e.x,o=e.y,r=t.devicePixelRatio||1;return{x:H(n*r)/r||0,y:H(o*r)/r||0}}({x:y,y:w},A(n)):{x:y,y:w};return y=M.x,w=M.y,d?Object.assign({},j,((_={})[T]=E?"0":"",_[S]=O?"0":"",_.transform=(P.devicePixelRatio||1)<=1?"translate("+y+"px, "+w+"px)":"translate3d("+y+"px, "+w+"px, 0)",_)):Object.assign({},j,((t={})[T]=E?w+"px":"",t[S]=O?y+"px":"",t.transform="",t))}const ne={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,o=n.gpuAcceleration,r=void 0===o||o,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,c=void 0===s||s,f={placement:M(t.placement),variation:Z(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,te(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,te(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var oe={passive:!0};const re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,o=e.options,r=o.scroll,i=void 0===r||r,a=o.resize,s=void 0===a||a,c=A(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&f.forEach((function(e){e.addEventListener("scroll",n.update,oe)})),s&&c.addEventListener("resize",n.update,oe),function(){i&&f.forEach((function(e){e.removeEventListener("scroll",n.update,oe)})),s&&c.removeEventListener("resize",n.update,oe)}},data:{}};var ie={left:"right",right:"left",bottom:"top",top:"bottom"};function ae(e){return e.replace(/left|right|bottom|top/g,(function(e){return ie[e]}))}var se={start:"end",end:"start"};function ce(e){return e.replace(/start|end/g,(function(e){return se[e]}))}function fe(e){var t=A(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function le(e){return W(K(e)).left+fe(e).scrollLeft}function pe(e){var t=V(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function ue(e){return["html","body","#document"].indexOf(L(e))>=0?e.ownerDocument.body:I(e)&&pe(e)?e:ue(U(e))}function de(e,t){var n;void 0===t&&(t=[]);var o=ue(e),r=o===(null==(n=e.ownerDocument)?void 0:n.body),i=A(o),a=r?[i].concat(i.visualViewport||[],pe(o)?o:[]):o,s=t.concat(a);return r?s:s.concat(de(U(a)))}function he(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function me(e,t,n){return t===u?he(function(e,t){var n=A(e),o=K(e),r=n.visualViewport,i=o.clientWidth,a=o.clientHeight,s=0,c=0;if(r){i=r.width,a=r.height;var f=R();(f||!f&&"fixed"===t)&&(s=r.offsetLeft,c=r.offsetTop)}return{width:i,height:a,x:s+le(e),y:c}}(e,n)):C(t)?function(e,t){var n=W(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):he(function(e){var t,n=K(e),o=fe(e),r=null==(t=e.ownerDocument)?void 0:t.body,i=B(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=B(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-o.scrollLeft+le(e),c=-o.scrollTop;return"rtl"===V(r||n).direction&&(s+=B(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:s,y:c}}(K(e)))}function ve(e,t,n,o){var r="clippingParents"===t?function(e){var t=de(U(e)),n=["absolute","fixed"].indexOf(V(e).position)>=0&&I(e)?F(e):e;return C(n)?t.filter((function(e){return C(e)&&q(e,n)&&"body"!==L(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),a=i[0],s=i.reduce((function(t,n){var r=me(e,n,o);return t.top=B(r.top,t.top),t.right=D(r.right,t.right),t.bottom=D(r.bottom,t.bottom),t.left=B(r.left,t.left),t}),me(e,a,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function ge(e){var t,n=e.reference,s=e.element,c=e.placement,p=c?M(c):null,u=c?Z(c):null,d=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2;switch(p){case o:t={x:d,y:n.y-s.height};break;case r:t={x:d,y:n.y+n.height};break;case i:t={x:n.x+n.width,y:h};break;case a:t={x:n.x-s.width,y:h};break;default:t={x:n.x,y:n.y}}var m=p?X(p):null;if(null!=m){var v="y"===m?"height":"width";switch(u){case f:t[m]=t[m]-(n[v]/2-s[v]/2);break;case l:t[m]=t[m]+(n[v]/2-s[v]/2)}}return t}function ye(e,t){void 0===t&&(t={});var n=t,a=n.placement,s=void 0===a?e.placement:a,f=n.strategy,l=void 0===f?e.strategy:f,m=n.boundary,v=void 0===m?p:m,g=n.rootBoundary,y=void 0===g?u:g,b=n.elementContext,w=void 0===b?d:b,x=n.altBoundary,O=void 0!==x&&x,E=n.padding,S=void 0===E?0:E,T=G("number"!=typeof S?S:J(S,c)),P=w===d?h:d,L=e.rects.popper,A=e.elements[O?P:w],I=ve(C(A)?A:A.contextElement||K(e.elements.popper),v,y,l),_=W(e.elements.reference),j=ge({reference:_,element:L,strategy:"absolute",placement:s}),M=he(Object.assign({},L,j)),B=w===d?M:_,D={top:I.top-B.top+T.top,bottom:B.bottom-I.bottom+T.bottom,left:I.left-B.left+T.left,right:B.right-I.right+T.right},H=e.modifiersData.offset;if(w===d&&H){var k=H[s];Object.keys(D).forEach((function(e){var t=[i,r].indexOf(e)>=0?1:-1,n=[o,r].indexOf(e)>=0?"y":"x";D[e]+=k[n]*t}))}return D}const be={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var p=n.mainAxis,u=void 0===p||p,d=n.altAxis,h=void 0===d||d,g=n.fallbackPlacements,y=n.padding,b=n.boundary,w=n.rootBoundary,x=n.altBoundary,O=n.flipVariations,E=void 0===O||O,S=n.allowedAutoPlacements,T=t.options.placement,P=M(T),L=g||(P===T||!E?[ae(T)]:function(e){if(M(e)===s)return[];var t=ae(e);return[ce(e),t,ce(t)]}(T)),A=[T].concat(L).reduce((function(e,n){return e.concat(M(n)===s?function(e,t){void 0===t&&(t={});var n=t,o=n.placement,r=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,f=n.allowedAutoPlacements,l=void 0===f?v:f,p=Z(o),u=p?s?m:m.filter((function(e){return Z(e)===p})):c,d=u.filter((function(e){return l.indexOf(e)>=0}));0===d.length&&(d=u);var h=d.reduce((function(t,n){return t[n]=ye(e,{placement:n,boundary:r,rootBoundary:i,padding:a})[M(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}(t,{placement:n,boundary:b,rootBoundary:w,padding:y,flipVariations:E,allowedAutoPlacements:S}):n)}),[]),C=t.rects.reference,I=t.rects.popper,_=new Map,j=!0,B=A[0],D=0;D=0,Y=W?"width":"height",q=ye(t,{placement:H,boundary:b,rootBoundary:w,altBoundary:x,padding:y}),V=W?R?i:a:R?r:o;C[Y]>I[Y]&&(V=ae(V));var N=ae(V),K=[];if(u&&K.push(q[k]<=0),h&&K.push(q[V]<=0,q[N]<=0),K.every((function(e){return e}))){B=H,j=!1;break}_.set(H,K)}if(j)for(var U=function(e){var t=A.find((function(t){var n=_.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return B=t,"break"},$=E?3:1;$>0;$--){if("break"===U($))break}t.placement!==B&&(t.modifiersData[l]._skip=!0,t.placement=B,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function we(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function xe(e){return[o,i,r,a].some((function(t){return e[t]>=0}))}const Oe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,o=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,a=ye(t,{elementContext:"reference"}),s=ye(t,{altBoundary:!0}),c=we(a,o),f=we(s,r,i),l=xe(c),p=xe(f);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:f,isReferenceHidden:l,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":p})}};const Ee={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,s=n.offset,c=void 0===s?[0,0]:s,f=v.reduce((function(e,n){return e[n]=function(e,t,n){var r=M(e),s=[a,o].indexOf(r)>=0?-1:1,c="function"==typeof n?n(Object.assign({},t,{placement:e})):n,f=c[0],l=c[1];return f=f||0,l=(l||0)*s,[a,i].indexOf(r)>=0?{x:l,y:f}:{x:f,y:l}}(n,t.rects,c),e}),{}),l=f[t.placement],p=l.x,u=l.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=p,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=f}};const Se={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ge({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};const Te={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,s=e.name,c=n.mainAxis,l=void 0===c||c,p=n.altAxis,u=void 0!==p&&p,d=n.boundary,h=n.rootBoundary,m=n.altBoundary,v=n.padding,g=n.tether,y=void 0===g||g,b=n.tetherOffset,w=void 0===b?0:b,x=ye(t,{boundary:d,rootBoundary:h,padding:v,altBoundary:m}),O=M(t.placement),E=Z(t.placement),S=!E,T=X(O),P="x"===T?"y":"x",L=t.modifiersData.popperOffsets,A=t.rects.reference,C=t.rects.popper,I="function"==typeof w?w(Object.assign({},t.rects,{placement:t.placement})):w,_="number"==typeof I?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,H={x:0,y:0};if(L){if(l){var k,R="y"===T?o:a,W="y"===T?r:i,q="y"===T?"height":"width",V=L[T],N=V+x[R],K=V-x[W],U=y?-C[q]/2:0,$=E===f?A[q]:C[q],G=E===f?-C[q]:-A[q],J=t.elements.arrow,Q=y&&J?Y(J):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[R],ne=ee[W],oe=z(0,A[q],Q[q]),re=S?A[q]/2-U-oe-te-_.mainAxis:$-oe-te-_.mainAxis,ie=S?-A[q]/2+U+oe+ne+_.mainAxis:G+oe+ne+_.mainAxis,ae=t.elements.arrow&&F(t.elements.arrow),se=ae?"y"===T?ae.clientTop||0:ae.clientLeft||0:0,ce=null!=(k=null==j?void 0:j[T])?k:0,fe=V+ie-ce,le=z(y?D(N,V+re-ce-se):N,V,y?B(K,fe):K);L[T]=le,H[T]=le-V}if(u){var pe,ue="x"===T?o:a,de="x"===T?r:i,he=L[P],me="y"===P?"height":"width",ve=he+x[ue],ge=he-x[de],be=-1!==[o,a].indexOf(O),we=null!=(pe=null==j?void 0:j[P])?pe:0,xe=be?ve:he-A[me]-C[me]-we+_.altAxis,Oe=be?he+A[me]+C[me]-we-_.altAxis:ge,Ee=y&&be?function(e,t,n){var o=z(e,t,n);return o>n?n:o}(xe,he,Oe):z(y?xe:ve,he,y?Oe:ge);L[P]=Ee,H[P]=Ee-he}t.modifiersData[s]=H}},requiresIfExists:["offset"]};function Pe(e,t,n){void 0===n&&(n=!1);var o,r,i=I(t),a=I(t)&&function(e){var t=e.getBoundingClientRect(),n=H(t.width)/e.offsetWidth||1,o=H(t.height)/e.offsetHeight||1;return 1!==n||1!==o}(t),s=K(t),c=W(e,a,n),f={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&(("body"!==L(t)||pe(s))&&(f=(o=t)!==A(o)&&I(o)?{scrollLeft:(r=o).scrollLeft,scrollTop:r.scrollTop}:fe(o)),I(t)?((l=W(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=le(s))),{x:c.left+f.scrollLeft-l.x,y:c.top+f.scrollTop-l.y,width:c.width,height:c.height}}function Le(e){var t=new Map,n=new Set,o=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var o=t.get(e);o&&r(o)}})),o.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),o}var Ae={placement:"bottom",modifiers:[],strategy:"absolute"};function Ce(){for(var e=arguments.length,t=new Array(e),n=0;n{Object.defineProperty(t,"__esModule",{value:!0}),t.BREAKPOINTS=t.COMBO_BOX_ACCESSIBILITY_KEY_SET=t.SELECT_ACCESSIBILITY_KEY_SET=t.TABS_ACCESSIBILITY_KEY_SET=t.OVERLAY_ACCESSIBILITY_KEY_SET=t.DROPDOWN_ACCESSIBILITY_KEY_SET=t.POSITIONS=void 0,t.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},t.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],t.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],t.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],t.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],t.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],t.BREAKPOINTS={sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},737:(e,t)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,9 +9,9 @@ Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t,n){this.el=e,this.options=t,this.events=n,this.el=e,this.options=t,this.events={}}return e.prototype.createCollection=function(e,t){var n;e.push({id:(null===(n=null==t?void 0:t.el)||void 0===n?void 0:n.id)||e.length+1,element:t})},e.prototype.fireEvent=function(e,t){if(void 0===t&&(t=null),this.events.hasOwnProperty(e))return this.events[e](t)},e.prototype.on=function(e,t){this.events[e]=t},e}();t.default=n},679:function(e,t,n){ /* * HSTooltip - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n2&&/MacIntel/.test(navigator.platform)};t.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};t.isEnoughSpace=function(e,t,n,o,r){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===r&&(r=null);var i=t.getBoundingClientRect(),a=r?r.getBoundingClientRect():null,s=window.innerHeight,f=a?i.top-a.top:i.top,c=(r?a.bottom:s)-i.bottom,l=e.clientHeight+o;return"bottom"===n?c>=l:"top"===n?f>=l:f>=l||c>=l};t.isFormElement=function(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement};var o=function(e){return!!e&&("none"===window.getComputedStyle(e).display||o(e.parentElement))};t.isParentOrElementHidden=o;t.debounce=function(e,t){var o;return void 0===t&&(t=200),function(){for(var r=[],i=0;ithis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}return n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(679)})())); \ No newline at end of file +var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n2&&/MacIntel/.test(navigator.platform)};t.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};t.isEnoughSpace=function(e,t,n,o,r){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===r&&(r=null);var i=t.getBoundingClientRect(),a=r?r.getBoundingClientRect():null,s=window.innerHeight,c=a?i.top-a.top:i.top,f=(r?a.bottom:s)-i.bottom,l=e.clientHeight+o;return"bottom"===n?f>=l:"top"===n?c>=l:c>=l||f>=l};t.isFormElement=function(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement};var o=function(e){return!!e&&("none"===window.getComputedStyle(e).display||o(e.parentElement))};t.isParentOrElementHidden=o;t.debounce=function(e,t){var o;return void 0===t&&(t=200),function(){for(var r=[],i=0;ithis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}return n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(679)})())); \ No newline at end of file diff --git a/dts-config.js b/dts-config.js index cff3ad7..93919e1 100644 --- a/dts-config.js +++ b/dts-config.js @@ -4,9 +4,7 @@ const pluginsDir = './src/plugins'; const distDir = './dist'; const excludePlugins = ['base-plugin']; -const outputConfig = { - noBanner: true, -}; +const outputConfig = { noBanner: true }; const config = { compilationOptions: { diff --git a/index.d.ts b/index.d.ts index c0821f3..4a5bc11 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,5 @@ + export interface ICopyMarkupOptions { targetSelector: string; wrapperSelector: string; @@ -131,6 +132,112 @@ export declare class HSCollapse extends HSBasePlugin<{}> implements ICollapse { static hide(target: HTMLElement): void; static on(evt: string, target: HTMLElement, cb: Function): void; } +export interface IComboBoxOptions { + gap?: number; + viewport?: string | HTMLElement | null; + preventVisibility?: boolean; + apiUrl?: string | null; + apiDataPart?: string | null; + apiQuery?: string | null; + apiSearchQuery?: string | null; + apiHeaders?: {}; + apiGroupField?: string | null; + outputItemTemplate?: string | null; + outputEmptyTemplate?: string | null; + outputLoaderTemplate?: string | null; + groupingType?: "default" | "tabs" | null; + groupingTitleTemplate?: string | null; + tabsWrapperTemplate?: string | null; + preventSelection?: boolean; + isOpenOnFocus?: boolean; +} +export interface IComboBox { + options?: IComboBoxOptions; + open(): void; + close(): void; + recalculateDirection(): void; +} +export declare class HSComboBox extends HSBasePlugin implements IComboBox { + gap: number; + viewport: string | HTMLElement | null; + preventVisibility: boolean; + apiUrl: string | null; + apiDataPart: string | null; + apiQuery: string | null; + apiSearchQuery: string | null; + apiHeaders: {}; + apiGroupField: string | null; + outputItemTemplate: string | null; + outputEmptyTemplate: string | null; + outputLoaderTemplate: string | null; + groupingType: "default" | "tabs" | null; + groupingTitleTemplate: string | null; + tabsWrapperTemplate: string | null; + preventSelection: boolean; + isOpenOnFocus: boolean; + private readonly input; + private readonly output; + private readonly itemsWrapper; + private items; + private tabs; + private readonly toggle; + private outputPlaceholder; + private outputLoader; + private value; + private selected; + private groups; + private selectedGroup; + isOpened: boolean; + isCurrent: boolean; + private animationInProcess; + constructor(el: HTMLElement, options?: IComboBoxOptions); + private init; + private build; + private setResultAndRender; + private buildInput; + private buildItems; + private setResults; + private isItemExists; + private isTextExists; + private isTextExistsAny; + private valuesBySelector; + private buildOutputLoader; + private destroyOutputLoader; + private itemsFromJson; + private jsonItemsRender; + private setGroups; + setCurrent(): void; + private setApiGroups; + private sortItems; + private itemRender; + private plainRender; + private groupTabsRender; + private groupDefaultRender; + private itemsFromHtml; + private buildToggle; + private setSelectedByValue; + private setValue; + private setItemsVisibility; + private hasVisibleItems; + private appendItemsToWrapper; + private buildOutputPlaceholder; + private destroyOutputPlaceholder; + private resultItems; + private setValueAndOpen; + open(val?: string): boolean; + private setValueAndClear; + close(val?: string | null): boolean; + recalculateDirection(): void; + static getInstance(target: HTMLElement | string, isInstance?: boolean): HSComboBox | ICollectionItem; + static autoInit(): void; + static close(target: HTMLElement | string): void; + static closeCurrentlyOpened(evtTarget?: HTMLElement | null): void; + static accessibility(evt: KeyboardEvent): void; + static onEscape(): void; + static onArrow(isArrowUp?: boolean): boolean; + static onStartEnd(isStart?: boolean): boolean; + static onEnter(evt: Event): void; +} export interface IDropdown { options?: {}; open(): void; @@ -172,6 +279,9 @@ export declare class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> imp static on(evt: string, target: HTMLElement, cb: Function): void; } export interface IInputNumberOptions { + min?: number; + max?: number; + step?: number; } export interface IInputNumber { options?: IInputNumberOptions; @@ -181,6 +291,9 @@ export declare class HSInputNumber extends HSBasePlugin imp private readonly increment; private readonly decrement; private inputValue; + private readonly minInputValue; + private readonly maxInputValue; + private readonly step; constructor(el: HTMLElement, options?: IInputNumberOptions); private init; private build; @@ -214,10 +327,13 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private autoHide; private readonly overlayId; overlay: HTMLElement | null; - isCloseWhenClickInside: string; - isTabAccessibilityLimited: string; - hasAutofocus: string; - hasAbilityToCloseOnBackdropClick: string; + isCloseWhenClickInside: boolean; + isTabAccessibilityLimited: boolean; + isLayoutAffect: boolean; + hasAutofocus: boolean; + hasAbilityToCloseOnBackdropClick: boolean; + openedBreakpoint: number | null; + autoClose: number | null; constructor(el: HTMLElement, options?: IOverlayOptions, events?: {}); private init; private hideAuto; @@ -226,11 +342,12 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private destroyBackdrop; private focusElement; open(): false | Promise; - close(): Promise; + close(forceClose?: boolean): Promise; static getInstance(target: HTMLElement, isInstance?: boolean): HTMLElement | ICollectionItem; static autoInit(): void; static open(target: HTMLElement): void; static close(target: HTMLElement): void; + static setOpened(breakpoint: number, el: ICollectionItem): void; static accessibility(evt: KeyboardEvent): boolean; static onEscape(target: ICollectionItem): void; static onTab(target: ICollectionItem, focusableElements: HTMLElement[]): boolean; @@ -353,13 +470,14 @@ export interface ISelectOptions { isOpened?: boolean; placeholder?: string; hasSearch?: boolean; + preventSearchFocus?: boolean; mode?: string; viewport?: string; + wrapperClasses?: string; toggleTag?: string; toggleClasses?: string; toggleCountText?: string; toggleCountTextMinItems?: number; - tagsClasses?: string; tagsItemTemplate?: string; tagsItemClasses?: string; tagsInputClasses?: string; @@ -370,6 +488,7 @@ export interface ISelectOptions { bottom?: string; }; dropdownSpace: number; + extraMarkup?: string | string[] | null; searchWrapperTemplate?: string; searchClasses?: string; searchWrapperClasses?: string; @@ -396,16 +515,18 @@ export declare class HSSelect extends HSBasePlugin implements IS value: string | string[] | null; private readonly placeholder; private readonly hasSearch; + private readonly preventSearchFocus; private readonly mode; private readonly viewport; isOpened: boolean | null; isMultiple: boolean | null; isDisabled: boolean | null; + selectedItems: string[]; private readonly toggleTag; private readonly toggleClasses; private readonly toggleCountText; private readonly toggleCountTextMinItems; - private readonly tagsClasses; + private readonly wrapperClasses; private readonly tagsItemTemplate; private readonly tagsItemClasses; private readonly tagsInputClasses; @@ -428,24 +549,25 @@ export declare class HSSelect extends HSBasePlugin implements IS private wrapper; private toggle; private toggleTextWrapper; - private tags; - private tagsItems; private tagsInput; private dropdown; private searchWrapper; private search; private searchNoResult; private selectOptions; + private extraMarkup; private readonly isAddTagOnEnter; + private tagsInputHelper; constructor(el: HTMLElement, options?: ISelectOptions); private init; private build; private buildWrapper; + private buildExtraMarkup; private buildToggle; private setToggleIcon; private setToggleTitle; private buildTags; - private buildTagsItems; + private reassignTagsInputPlaceholder; private buildTagsItem; private getItemByValue; private setTagsItems; @@ -456,6 +578,9 @@ export declare class HSSelect extends HSBasePlugin implements IS private destroyOption; private buildOriginalOption; private destroyOriginalOption; + private buildTagsInputHelper; + private calculateInputWidth; + private adjustInputWidth; private onSelectOption; private addSelectOption; private removeSelectOption; @@ -660,6 +785,8 @@ export declare class HSThemeSwitch extends HSBasePlugin imp constructor(el: HTMLElement, options?: IThemeSwitchOptions); private init; private setResetStyles; + private addSystemThemeObserver; + private removeSystemThemeObserver; setAppearance(theme?: string, isSaveToLocalStorage?: boolean, isSetDispatchEvent?: boolean): void; static getInstance(target: HTMLElement | string): HSThemeSwitch; static autoInit(): void; diff --git a/index.js b/index.js index 3b73d9b..e5a89be 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={492:(t,e,n)=>{n.r(e),n.d(e,{afterMain:()=>S,afterRead:()=>w,afterWrite:()=>x,applyStyles:()=>P,arrow:()=>G,auto:()=>l,basePlacements:()=>a,beforeMain:()=>b,beforeRead:()=>y,beforeWrite:()=>I,bottom:()=>i,clippingParents:()=>d,computeStyles:()=>nt,createPopper:()=>Pt,createPopperBase:()=>kt,createPopperLite:()=>Bt,detectOverflow:()=>gt,end:()=>u,eventListeners:()=>it,flip:()=>wt,hide:()=>St,left:()=>s,main:()=>C,modifierPhases:()=>E,offset:()=>It,placements:()=>m,popper:()=>h,popperGenerator:()=>_t,popperOffsets:()=>Tt,preventOverflow:()=>xt,read:()=>g,reference:()=>f,right:()=>r,start:()=>c,top:()=>o,variationPlacements:()=>v,viewport:()=>p,write:()=>T});var o="top",i="bottom",r="right",s="left",l="auto",a=[o,i,r,s],c="start",u="end",d="clippingParents",p="viewport",h="popper",f="reference",v=a.reduce((function(t,e){return t.concat([e+"-"+c,e+"-"+u])}),[]),m=[].concat(a,[l]).reduce((function(t,e){return t.concat([e,e+"-"+c,e+"-"+u])}),[]),y="beforeRead",g="read",w="afterRead",b="beforeMain",C="main",S="afterMain",I="beforeWrite",T="write",x="afterWrite",E=[y,g,w,b,C,S,I,T,x];function O(t){return t?(t.nodeName||"").toLowerCase():null}function L(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function A(t){return t instanceof L(t).Element||t instanceof Element}function _(t){return t instanceof L(t).HTMLElement||t instanceof HTMLElement}function k(t){return"undefined"!=typeof ShadowRoot&&(t instanceof L(t).ShadowRoot||t instanceof ShadowRoot)}const P={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},o=e.attributes[t]||{},i=e.elements[t];_(i)&&O(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(t){var e=o[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var o=e.elements[t],i=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});_(o)&&O(o)&&(Object.assign(o.style,r),Object.keys(i).forEach((function(t){o.removeAttribute(t)})))}))}},requires:["computeStyles"]};function B(t){return t.split("-")[0]}var q=Math.max,j=Math.min,N=Math.round;function D(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function $(){return!/^((?!chrome|android).)*safari/i.test(D())}function H(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var o=t.getBoundingClientRect(),i=1,r=1;e&&_(t)&&(i=t.offsetWidth>0&&N(o.width)/t.offsetWidth||1,r=t.offsetHeight>0&&N(o.height)/t.offsetHeight||1);var s=(A(t)?L(t):window).visualViewport,l=!$()&&n,a=(o.left+(l&&s?s.offsetLeft:0))/i,c=(o.top+(l&&s?s.offsetTop:0))/r,u=o.width/i,d=o.height/r;return{width:u,height:d,top:c,right:a+u,bottom:c+d,left:a,x:a,y:c}}function M(t){var e=H(t),n=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:o}}function R(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&k(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function W(t){return L(t).getComputedStyle(t)}function V(t){return["table","td","th"].indexOf(O(t))>=0}function F(t){return((A(t)?t.ownerDocument:t.document)||window.document).documentElement}function U(t){return"html"===O(t)?t:t.assignedSlot||t.parentNode||(k(t)?t.host:null)||F(t)}function Y(t){return _(t)&&"fixed"!==W(t).position?t.offsetParent:null}function J(t){for(var e=L(t),n=Y(t);n&&V(n)&&"static"===W(n).position;)n=Y(n);return n&&("html"===O(n)||"body"===O(n)&&"static"===W(n).position)?e:n||function(t){var e=/firefox/i.test(D());if(/Trident/i.test(D())&&_(t)&&"fixed"===W(t).position)return null;var n=U(t);for(k(n)&&(n=n.host);_(n)&&["html","body"].indexOf(O(n))<0;){var o=W(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||e&&"filter"===o.willChange||e&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(t)||e}function K(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function z(t,e,n){return q(t,j(e,n))}function X(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Z(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}const G={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,l=t.name,c=t.options,u=n.elements.arrow,d=n.modifiersData.popperOffsets,p=B(n.placement),h=K(p),f=[s,r].indexOf(p)>=0?"height":"width";if(u&&d){var v=function(t,e){return X("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Z(t,a))}(c.padding,n),m=M(u),y="y"===h?o:s,g="y"===h?i:r,w=n.rects.reference[f]+n.rects.reference[h]-d[h]-n.rects.popper[f],b=d[h]-n.rects.reference[h],C=J(u),S=C?"y"===h?C.clientHeight||0:C.clientWidth||0:0,I=w/2-b/2,T=v[y],x=S-m[f]-v[g],E=S/2-m[f]/2+I,O=z(T,E,x),L=h;n.modifiersData[l]=((e={})[L]=O,e.centerOffset=O-E,e)}},effect:function(t){var e=t.state,n=t.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!=typeof o||(o=e.elements.popper.querySelector(o)))&&R(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Q(t){return t.split("-")[1]}var tt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function et(t){var e,n=t.popper,l=t.popperRect,a=t.placement,c=t.variation,d=t.offsets,p=t.position,h=t.gpuAcceleration,f=t.adaptive,v=t.roundOffsets,m=t.isFixed,y=d.x,g=void 0===y?0:y,w=d.y,b=void 0===w?0:w,C="function"==typeof v?v({x:g,y:b}):{x:g,y:b};g=C.x,b=C.y;var S=d.hasOwnProperty("x"),I=d.hasOwnProperty("y"),T=s,x=o,E=window;if(f){var O=J(n),A="clientHeight",_="clientWidth";if(O===L(n)&&"static"!==W(O=F(n)).position&&"absolute"===p&&(A="scrollHeight",_="scrollWidth"),a===o||(a===s||a===r)&&c===u)x=i,b-=(m&&O===E&&E.visualViewport?E.visualViewport.height:O[A])-l.height,b*=h?1:-1;if(a===s||(a===o||a===i)&&c===u)T=r,g-=(m&&O===E&&E.visualViewport?E.visualViewport.width:O[_])-l.width,g*=h?1:-1}var k,P=Object.assign({position:p},f&&tt),B=!0===v?function(t,e){var n=t.x,o=t.y,i=e.devicePixelRatio||1;return{x:N(n*i)/i||0,y:N(o*i)/i||0}}({x:g,y:b},L(n)):{x:g,y:b};return g=B.x,b=B.y,h?Object.assign({},P,((k={})[x]=I?"0":"",k[T]=S?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",k)):Object.assign({},P,((e={})[x]=I?b+"px":"",e[T]=S?g+"px":"",e.transform="",e))}const nt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,o=n.gpuAcceleration,i=void 0===o||o,r=n.adaptive,s=void 0===r||r,l=n.roundOffsets,a=void 0===l||l,c={placement:B(e.placement),variation:Q(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,et(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,et(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var ot={passive:!0};const it={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,o=t.options,i=o.scroll,r=void 0===i||i,s=o.resize,l=void 0===s||s,a=L(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&c.forEach((function(t){t.addEventListener("scroll",n.update,ot)})),l&&a.addEventListener("resize",n.update,ot),function(){r&&c.forEach((function(t){t.removeEventListener("scroll",n.update,ot)})),l&&a.removeEventListener("resize",n.update,ot)}},data:{}};var rt={left:"right",right:"left",bottom:"top",top:"bottom"};function st(t){return t.replace(/left|right|bottom|top/g,(function(t){return rt[t]}))}var lt={start:"end",end:"start"};function at(t){return t.replace(/start|end/g,(function(t){return lt[t]}))}function ct(t){var e=L(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ut(t){return H(F(t)).left+ct(t).scrollLeft}function dt(t){var e=W(t),n=e.overflow,o=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+o)}function pt(t){return["html","body","#document"].indexOf(O(t))>=0?t.ownerDocument.body:_(t)&&dt(t)?t:pt(U(t))}function ht(t,e){var n;void 0===e&&(e=[]);var o=pt(t),i=o===(null==(n=t.ownerDocument)?void 0:n.body),r=L(o),s=i?[r].concat(r.visualViewport||[],dt(o)?o:[]):o,l=e.concat(s);return i?l:l.concat(ht(U(s)))}function ft(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function vt(t,e,n){return e===p?ft(function(t,e){var n=L(t),o=F(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;var c=$();(c||!c&&"fixed"===e)&&(l=i.offsetLeft,a=i.offsetTop)}return{width:r,height:s,x:l+ut(t),y:a}}(t,n)):A(e)?function(t,e){var n=H(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(e,n):ft(function(t){var e,n=F(t),o=ct(t),i=null==(e=t.ownerDocument)?void 0:e.body,r=q(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=q(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-o.scrollLeft+ut(t),a=-o.scrollTop;return"rtl"===W(i||n).direction&&(l+=q(n.clientWidth,i?i.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}(F(t)))}function mt(t,e,n,o){var i="clippingParents"===e?function(t){var e=ht(U(t)),n=["absolute","fixed"].indexOf(W(t).position)>=0&&_(t)?J(t):t;return A(n)?e.filter((function(t){return A(t)&&R(t,n)&&"body"!==O(t)})):[]}(t):[].concat(e),r=[].concat(i,[n]),s=r[0],l=r.reduce((function(e,n){var i=vt(t,n,o);return e.top=q(i.top,e.top),e.right=j(i.right,e.right),e.bottom=j(i.bottom,e.bottom),e.left=q(i.left,e.left),e}),vt(t,s,o));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function yt(t){var e,n=t.reference,l=t.element,a=t.placement,d=a?B(a):null,p=a?Q(a):null,h=n.x+n.width/2-l.width/2,f=n.y+n.height/2-l.height/2;switch(d){case o:e={x:h,y:n.y-l.height};break;case i:e={x:h,y:n.y+n.height};break;case r:e={x:n.x+n.width,y:f};break;case s:e={x:n.x-l.width,y:f};break;default:e={x:n.x,y:n.y}}var v=d?K(d):null;if(null!=v){var m="y"===v?"height":"width";switch(p){case c:e[v]=e[v]-(n[m]/2-l[m]/2);break;case u:e[v]=e[v]+(n[m]/2-l[m]/2)}}return e}function gt(t,e){void 0===e&&(e={});var n=e,s=n.placement,l=void 0===s?t.placement:s,c=n.strategy,u=void 0===c?t.strategy:c,v=n.boundary,m=void 0===v?d:v,y=n.rootBoundary,g=void 0===y?p:y,w=n.elementContext,b=void 0===w?h:w,C=n.altBoundary,S=void 0!==C&&C,I=n.padding,T=void 0===I?0:I,x=X("number"!=typeof T?T:Z(T,a)),E=b===h?f:h,O=t.rects.popper,L=t.elements[S?E:b],_=mt(A(L)?L:L.contextElement||F(t.elements.popper),m,g,u),k=H(t.elements.reference),P=yt({reference:k,element:O,strategy:"absolute",placement:l}),B=ft(Object.assign({},O,P)),q=b===h?B:k,j={top:_.top-q.top+x.top,bottom:q.bottom-_.bottom+x.bottom,left:_.left-q.left+x.left,right:q.right-_.right+x.right},N=t.modifiersData.offset;if(b===h&&N){var D=N[l];Object.keys(j).forEach((function(t){var e=[r,i].indexOf(t)>=0?1:-1,n=[o,i].indexOf(t)>=0?"y":"x";j[t]+=D[n]*e}))}return j}const wt={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,u=t.name;if(!e.modifiersData[u]._skip){for(var d=n.mainAxis,p=void 0===d||d,h=n.altAxis,f=void 0===h||h,y=n.fallbackPlacements,g=n.padding,w=n.boundary,b=n.rootBoundary,C=n.altBoundary,S=n.flipVariations,I=void 0===S||S,T=n.allowedAutoPlacements,x=e.options.placement,E=B(x),O=y||(E===x||!I?[st(x)]:function(t){if(B(t)===l)return[];var e=st(t);return[at(t),e,at(e)]}(x)),L=[x].concat(O).reduce((function(t,n){return t.concat(B(n)===l?function(t,e){void 0===e&&(e={});var n=e,o=n.placement,i=n.boundary,r=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=void 0===c?m:c,d=Q(o),p=d?l?v:v.filter((function(t){return Q(t)===d})):a,h=p.filter((function(t){return u.indexOf(t)>=0}));0===h.length&&(h=p);var f=h.reduce((function(e,n){return e[n]=gt(t,{placement:n,boundary:i,rootBoundary:r,padding:s})[B(n)],e}),{});return Object.keys(f).sort((function(t,e){return f[t]-f[e]}))}(e,{placement:n,boundary:w,rootBoundary:b,padding:g,flipVariations:I,allowedAutoPlacements:T}):n)}),[]),A=e.rects.reference,_=e.rects.popper,k=new Map,P=!0,q=L[0],j=0;j=0,M=H?"width":"height",R=gt(e,{placement:N,boundary:w,rootBoundary:b,altBoundary:C,padding:g}),W=H?$?r:s:$?i:o;A[M]>_[M]&&(W=st(W));var V=st(W),F=[];if(p&&F.push(R[D]<=0),f&&F.push(R[W]<=0,R[V]<=0),F.every((function(t){return t}))){q=N,P=!1;break}k.set(N,F)}if(P)for(var U=function(t){var e=L.find((function(e){var n=k.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return q=e,"break"},Y=I?3:1;Y>0;Y--){if("break"===U(Y))break}e.placement!==q&&(e.modifiersData[u]._skip=!0,e.placement=q,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function bt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Ct(t){return[o,r,i,s].some((function(e){return t[e]>=0}))}const St={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,o=e.rects.reference,i=e.rects.popper,r=e.modifiersData.preventOverflow,s=gt(e,{elementContext:"reference"}),l=gt(e,{altBoundary:!0}),a=bt(s,o),c=bt(l,i,r),u=Ct(a),d=Ct(c);e.modifiersData[n]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};const It={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,i=t.name,l=n.offset,a=void 0===l?[0,0]:l,c=m.reduce((function(t,n){return t[n]=function(t,e,n){var i=B(t),l=[s,o].indexOf(i)>=0?-1:1,a="function"==typeof n?n(Object.assign({},e,{placement:t})):n,c=a[0],u=a[1];return c=c||0,u=(u||0)*l,[s,r].indexOf(i)>=0?{x:u,y:c}:{x:c,y:u}}(n,e.rects,a),t}),{}),u=c[e.placement],d=u.x,p=u.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=d,e.modifiersData.popperOffsets.y+=p),e.modifiersData[i]=c}};const Tt={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=yt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}};const xt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,l=t.name,a=n.mainAxis,u=void 0===a||a,d=n.altAxis,p=void 0!==d&&d,h=n.boundary,f=n.rootBoundary,v=n.altBoundary,m=n.padding,y=n.tether,g=void 0===y||y,w=n.tetherOffset,b=void 0===w?0:w,C=gt(e,{boundary:h,rootBoundary:f,padding:m,altBoundary:v}),S=B(e.placement),I=Q(e.placement),T=!I,x=K(S),E="x"===x?"y":"x",O=e.modifiersData.popperOffsets,L=e.rects.reference,A=e.rects.popper,_="function"==typeof b?b(Object.assign({},e.rects,{placement:e.placement})):b,k="number"==typeof _?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,N={x:0,y:0};if(O){if(u){var D,$="y"===x?o:s,H="y"===x?i:r,R="y"===x?"height":"width",W=O[x],V=W+C[$],F=W-C[H],U=g?-A[R]/2:0,Y=I===c?L[R]:A[R],X=I===c?-A[R]:-L[R],Z=e.elements.arrow,G=g&&Z?M(Z):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[$],nt=tt[H],ot=z(0,L[R],G[R]),it=T?L[R]/2-U-ot-et-k.mainAxis:Y-ot-et-k.mainAxis,rt=T?-L[R]/2+U+ot+nt+k.mainAxis:X+ot+nt+k.mainAxis,st=e.elements.arrow&&J(e.elements.arrow),lt=st?"y"===x?st.clientTop||0:st.clientLeft||0:0,at=null!=(D=null==P?void 0:P[x])?D:0,ct=W+rt-at,ut=z(g?j(V,W+it-at-lt):V,W,g?q(F,ct):F);O[x]=ut,N[x]=ut-W}if(p){var dt,pt="x"===x?o:s,ht="x"===x?i:r,ft=O[E],vt="y"===E?"height":"width",mt=ft+C[pt],yt=ft-C[ht],wt=-1!==[o,s].indexOf(S),bt=null!=(dt=null==P?void 0:P[E])?dt:0,Ct=wt?mt:ft-L[vt]-A[vt]-bt+k.altAxis,St=wt?ft+L[vt]+A[vt]-bt-k.altAxis:yt,It=g&&wt?function(t,e,n){var o=z(t,e,n);return o>n?n:o}(Ct,ft,St):z(g?Ct:mt,ft,g?St:yt);O[E]=It,N[E]=It-ft}e.modifiersData[l]=N}},requiresIfExists:["offset"]};function Et(t,e,n){void 0===n&&(n=!1);var o,i,r=_(e),s=_(e)&&function(t){var e=t.getBoundingClientRect(),n=N(e.width)/t.offsetWidth||1,o=N(e.height)/t.offsetHeight||1;return 1!==n||1!==o}(e),l=F(e),a=H(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==O(e)||dt(l))&&(c=(o=e)!==L(o)&&_(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:ct(o)),_(e)?((u=H(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):l&&(u.x=ut(l))),{x:a.left+c.scrollLeft-u.x,y:a.top+c.scrollTop-u.y,width:a.width,height:a.height}}function Ot(t){var e=new Map,n=new Set,o=[];function i(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var o=e.get(t);o&&i(o)}})),o.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||i(t)})),o}var Lt={placement:"bottom",modifiers:[],strategy:"absolute"};function At(){for(var t=arguments.length,e=new Array(t),n=0;n{Object.defineProperty(e,"__esModule",{value:!0}),e.COMBO_BOX_ACCESSIBILITY_KEY_SET=e.SELECT_ACCESSIBILITY_KEY_SET=e.TABS_ACCESSIBILITY_KEY_SET=e.OVERLAY_ACCESSIBILITY_KEY_SET=e.DROPDOWN_ACCESSIBILITY_KEY_SET=e.POSITIONS=void 0,e.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},e.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],e.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],e.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],e.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],e.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"]},460:function(t,e,n){ +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={492:(t,e,n)=>{n.r(e),n.d(e,{afterMain:()=>S,afterRead:()=>w,afterWrite:()=>T,applyStyles:()=>P,arrow:()=>Q,auto:()=>l,basePlacements:()=>a,beforeMain:()=>b,beforeRead:()=>y,beforeWrite:()=>x,bottom:()=>i,clippingParents:()=>d,computeStyles:()=>nt,createPopper:()=>Pt,createPopperBase:()=>_t,createPopperLite:()=>Bt,detectOverflow:()=>gt,end:()=>u,eventListeners:()=>it,flip:()=>wt,hide:()=>St,left:()=>s,main:()=>C,modifierPhases:()=>E,offset:()=>xt,placements:()=>v,popper:()=>h,popperGenerator:()=>kt,popperOffsets:()=>It,preventOverflow:()=>Tt,read:()=>g,reference:()=>f,right:()=>r,start:()=>c,top:()=>o,variationPlacements:()=>m,viewport:()=>p,write:()=>I});var o="top",i="bottom",r="right",s="left",l="auto",a=[o,i,r,s],c="start",u="end",d="clippingParents",p="viewport",h="popper",f="reference",m=a.reduce((function(t,e){return t.concat([e+"-"+c,e+"-"+u])}),[]),v=[].concat(a,[l]).reduce((function(t,e){return t.concat([e,e+"-"+c,e+"-"+u])}),[]),y="beforeRead",g="read",w="afterRead",b="beforeMain",C="main",S="afterMain",x="beforeWrite",I="write",T="afterWrite",E=[y,g,w,b,C,S,x,I,T];function O(t){return t?(t.nodeName||"").toLowerCase():null}function L(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function A(t){return t instanceof L(t).Element||t instanceof Element}function k(t){return t instanceof L(t).HTMLElement||t instanceof HTMLElement}function _(t){return"undefined"!=typeof ShadowRoot&&(t instanceof L(t).ShadowRoot||t instanceof ShadowRoot)}const P={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},o=e.attributes[t]||{},i=e.elements[t];k(i)&&O(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(t){var e=o[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var o=e.elements[t],i=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});k(o)&&O(o)&&(Object.assign(o.style,r),Object.keys(i).forEach((function(t){o.removeAttribute(t)})))}))}},requires:["computeStyles"]};function B(t){return t.split("-")[0]}var q=Math.max,N=Math.min,j=Math.round;function $(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function D(){return!/^((?!chrome|android).)*safari/i.test($())}function H(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var o=t.getBoundingClientRect(),i=1,r=1;e&&k(t)&&(i=t.offsetWidth>0&&j(o.width)/t.offsetWidth||1,r=t.offsetHeight>0&&j(o.height)/t.offsetHeight||1);var s=(A(t)?L(t):window).visualViewport,l=!D()&&n,a=(o.left+(l&&s?s.offsetLeft:0))/i,c=(o.top+(l&&s?s.offsetTop:0))/r,u=o.width/i,d=o.height/r;return{width:u,height:d,top:c,right:a+u,bottom:c+d,left:a,x:a,y:c}}function M(t){var e=H(t),n=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:o}}function R(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&_(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function W(t){return L(t).getComputedStyle(t)}function V(t){return["table","td","th"].indexOf(O(t))>=0}function F(t){return((A(t)?t.ownerDocument:t.document)||window.document).documentElement}function U(t){return"html"===O(t)?t:t.assignedSlot||t.parentNode||(_(t)?t.host:null)||F(t)}function J(t){return k(t)&&"fixed"!==W(t).position?t.offsetParent:null}function Y(t){for(var e=L(t),n=J(t);n&&V(n)&&"static"===W(n).position;)n=J(n);return n&&("html"===O(n)||"body"===O(n)&&"static"===W(n).position)?e:n||function(t){var e=/firefox/i.test($());if(/Trident/i.test($())&&k(t)&&"fixed"===W(t).position)return null;var n=U(t);for(_(n)&&(n=n.host);k(n)&&["html","body"].indexOf(O(n))<0;){var o=W(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||e&&"filter"===o.willChange||e&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(t)||e}function K(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function G(t,e,n){return q(t,N(e,n))}function z(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function X(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}const Q={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,l=t.name,c=t.options,u=n.elements.arrow,d=n.modifiersData.popperOffsets,p=B(n.placement),h=K(p),f=[s,r].indexOf(p)>=0?"height":"width";if(u&&d){var m=function(t,e){return z("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:X(t,a))}(c.padding,n),v=M(u),y="y"===h?o:s,g="y"===h?i:r,w=n.rects.reference[f]+n.rects.reference[h]-d[h]-n.rects.popper[f],b=d[h]-n.rects.reference[h],C=Y(u),S=C?"y"===h?C.clientHeight||0:C.clientWidth||0:0,x=w/2-b/2,I=m[y],T=S-v[f]-m[g],E=S/2-v[f]/2+x,O=G(I,E,T),L=h;n.modifiersData[l]=((e={})[L]=O,e.centerOffset=O-E,e)}},effect:function(t){var e=t.state,n=t.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!=typeof o||(o=e.elements.popper.querySelector(o)))&&R(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Z(t){return t.split("-")[1]}var tt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function et(t){var e,n=t.popper,l=t.popperRect,a=t.placement,c=t.variation,d=t.offsets,p=t.position,h=t.gpuAcceleration,f=t.adaptive,m=t.roundOffsets,v=t.isFixed,y=d.x,g=void 0===y?0:y,w=d.y,b=void 0===w?0:w,C="function"==typeof m?m({x:g,y:b}):{x:g,y:b};g=C.x,b=C.y;var S=d.hasOwnProperty("x"),x=d.hasOwnProperty("y"),I=s,T=o,E=window;if(f){var O=Y(n),A="clientHeight",k="clientWidth";if(O===L(n)&&"static"!==W(O=F(n)).position&&"absolute"===p&&(A="scrollHeight",k="scrollWidth"),a===o||(a===s||a===r)&&c===u)T=i,b-=(v&&O===E&&E.visualViewport?E.visualViewport.height:O[A])-l.height,b*=h?1:-1;if(a===s||(a===o||a===i)&&c===u)I=r,g-=(v&&O===E&&E.visualViewport?E.visualViewport.width:O[k])-l.width,g*=h?1:-1}var _,P=Object.assign({position:p},f&&tt),B=!0===m?function(t,e){var n=t.x,o=t.y,i=e.devicePixelRatio||1;return{x:j(n*i)/i||0,y:j(o*i)/i||0}}({x:g,y:b},L(n)):{x:g,y:b};return g=B.x,b=B.y,h?Object.assign({},P,((_={})[T]=x?"0":"",_[I]=S?"0":"",_.transform=(E.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",_)):Object.assign({},P,((e={})[T]=x?b+"px":"",e[I]=S?g+"px":"",e.transform="",e))}const nt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,o=n.gpuAcceleration,i=void 0===o||o,r=n.adaptive,s=void 0===r||r,l=n.roundOffsets,a=void 0===l||l,c={placement:B(e.placement),variation:Z(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,et(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,et(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var ot={passive:!0};const it={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,o=t.options,i=o.scroll,r=void 0===i||i,s=o.resize,l=void 0===s||s,a=L(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&c.forEach((function(t){t.addEventListener("scroll",n.update,ot)})),l&&a.addEventListener("resize",n.update,ot),function(){r&&c.forEach((function(t){t.removeEventListener("scroll",n.update,ot)})),l&&a.removeEventListener("resize",n.update,ot)}},data:{}};var rt={left:"right",right:"left",bottom:"top",top:"bottom"};function st(t){return t.replace(/left|right|bottom|top/g,(function(t){return rt[t]}))}var lt={start:"end",end:"start"};function at(t){return t.replace(/start|end/g,(function(t){return lt[t]}))}function ct(t){var e=L(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ut(t){return H(F(t)).left+ct(t).scrollLeft}function dt(t){var e=W(t),n=e.overflow,o=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+o)}function pt(t){return["html","body","#document"].indexOf(O(t))>=0?t.ownerDocument.body:k(t)&&dt(t)?t:pt(U(t))}function ht(t,e){var n;void 0===e&&(e=[]);var o=pt(t),i=o===(null==(n=t.ownerDocument)?void 0:n.body),r=L(o),s=i?[r].concat(r.visualViewport||[],dt(o)?o:[]):o,l=e.concat(s);return i?l:l.concat(ht(U(s)))}function ft(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mt(t,e,n){return e===p?ft(function(t,e){var n=L(t),o=F(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;var c=D();(c||!c&&"fixed"===e)&&(l=i.offsetLeft,a=i.offsetTop)}return{width:r,height:s,x:l+ut(t),y:a}}(t,n)):A(e)?function(t,e){var n=H(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(e,n):ft(function(t){var e,n=F(t),o=ct(t),i=null==(e=t.ownerDocument)?void 0:e.body,r=q(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=q(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-o.scrollLeft+ut(t),a=-o.scrollTop;return"rtl"===W(i||n).direction&&(l+=q(n.clientWidth,i?i.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}(F(t)))}function vt(t,e,n,o){var i="clippingParents"===e?function(t){var e=ht(U(t)),n=["absolute","fixed"].indexOf(W(t).position)>=0&&k(t)?Y(t):t;return A(n)?e.filter((function(t){return A(t)&&R(t,n)&&"body"!==O(t)})):[]}(t):[].concat(e),r=[].concat(i,[n]),s=r[0],l=r.reduce((function(e,n){var i=mt(t,n,o);return e.top=q(i.top,e.top),e.right=N(i.right,e.right),e.bottom=N(i.bottom,e.bottom),e.left=q(i.left,e.left),e}),mt(t,s,o));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function yt(t){var e,n=t.reference,l=t.element,a=t.placement,d=a?B(a):null,p=a?Z(a):null,h=n.x+n.width/2-l.width/2,f=n.y+n.height/2-l.height/2;switch(d){case o:e={x:h,y:n.y-l.height};break;case i:e={x:h,y:n.y+n.height};break;case r:e={x:n.x+n.width,y:f};break;case s:e={x:n.x-l.width,y:f};break;default:e={x:n.x,y:n.y}}var m=d?K(d):null;if(null!=m){var v="y"===m?"height":"width";switch(p){case c:e[m]=e[m]-(n[v]/2-l[v]/2);break;case u:e[m]=e[m]+(n[v]/2-l[v]/2)}}return e}function gt(t,e){void 0===e&&(e={});var n=e,s=n.placement,l=void 0===s?t.placement:s,c=n.strategy,u=void 0===c?t.strategy:c,m=n.boundary,v=void 0===m?d:m,y=n.rootBoundary,g=void 0===y?p:y,w=n.elementContext,b=void 0===w?h:w,C=n.altBoundary,S=void 0!==C&&C,x=n.padding,I=void 0===x?0:x,T=z("number"!=typeof I?I:X(I,a)),E=b===h?f:h,O=t.rects.popper,L=t.elements[S?E:b],k=vt(A(L)?L:L.contextElement||F(t.elements.popper),v,g,u),_=H(t.elements.reference),P=yt({reference:_,element:O,strategy:"absolute",placement:l}),B=ft(Object.assign({},O,P)),q=b===h?B:_,N={top:k.top-q.top+T.top,bottom:q.bottom-k.bottom+T.bottom,left:k.left-q.left+T.left,right:q.right-k.right+T.right},j=t.modifiersData.offset;if(b===h&&j){var $=j[l];Object.keys(N).forEach((function(t){var e=[r,i].indexOf(t)>=0?1:-1,n=[o,i].indexOf(t)>=0?"y":"x";N[t]+=$[n]*e}))}return N}const wt={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,u=t.name;if(!e.modifiersData[u]._skip){for(var d=n.mainAxis,p=void 0===d||d,h=n.altAxis,f=void 0===h||h,y=n.fallbackPlacements,g=n.padding,w=n.boundary,b=n.rootBoundary,C=n.altBoundary,S=n.flipVariations,x=void 0===S||S,I=n.allowedAutoPlacements,T=e.options.placement,E=B(T),O=y||(E===T||!x?[st(T)]:function(t){if(B(t)===l)return[];var e=st(t);return[at(t),e,at(e)]}(T)),L=[T].concat(O).reduce((function(t,n){return t.concat(B(n)===l?function(t,e){void 0===e&&(e={});var n=e,o=n.placement,i=n.boundary,r=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=void 0===c?v:c,d=Z(o),p=d?l?m:m.filter((function(t){return Z(t)===d})):a,h=p.filter((function(t){return u.indexOf(t)>=0}));0===h.length&&(h=p);var f=h.reduce((function(e,n){return e[n]=gt(t,{placement:n,boundary:i,rootBoundary:r,padding:s})[B(n)],e}),{});return Object.keys(f).sort((function(t,e){return f[t]-f[e]}))}(e,{placement:n,boundary:w,rootBoundary:b,padding:g,flipVariations:x,allowedAutoPlacements:I}):n)}),[]),A=e.rects.reference,k=e.rects.popper,_=new Map,P=!0,q=L[0],N=0;N=0,M=H?"width":"height",R=gt(e,{placement:j,boundary:w,rootBoundary:b,altBoundary:C,padding:g}),W=H?D?r:s:D?i:o;A[M]>k[M]&&(W=st(W));var V=st(W),F=[];if(p&&F.push(R[$]<=0),f&&F.push(R[W]<=0,R[V]<=0),F.every((function(t){return t}))){q=j,P=!1;break}_.set(j,F)}if(P)for(var U=function(t){var e=L.find((function(e){var n=_.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return q=e,"break"},J=x?3:1;J>0;J--){if("break"===U(J))break}e.placement!==q&&(e.modifiersData[u]._skip=!0,e.placement=q,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function bt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Ct(t){return[o,r,i,s].some((function(e){return t[e]>=0}))}const St={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,o=e.rects.reference,i=e.rects.popper,r=e.modifiersData.preventOverflow,s=gt(e,{elementContext:"reference"}),l=gt(e,{altBoundary:!0}),a=bt(s,o),c=bt(l,i,r),u=Ct(a),d=Ct(c);e.modifiersData[n]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};const xt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,i=t.name,l=n.offset,a=void 0===l?[0,0]:l,c=v.reduce((function(t,n){return t[n]=function(t,e,n){var i=B(t),l=[s,o].indexOf(i)>=0?-1:1,a="function"==typeof n?n(Object.assign({},e,{placement:t})):n,c=a[0],u=a[1];return c=c||0,u=(u||0)*l,[s,r].indexOf(i)>=0?{x:u,y:c}:{x:c,y:u}}(n,e.rects,a),t}),{}),u=c[e.placement],d=u.x,p=u.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=d,e.modifiersData.popperOffsets.y+=p),e.modifiersData[i]=c}};const It={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=yt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}};const Tt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,l=t.name,a=n.mainAxis,u=void 0===a||a,d=n.altAxis,p=void 0!==d&&d,h=n.boundary,f=n.rootBoundary,m=n.altBoundary,v=n.padding,y=n.tether,g=void 0===y||y,w=n.tetherOffset,b=void 0===w?0:w,C=gt(e,{boundary:h,rootBoundary:f,padding:v,altBoundary:m}),S=B(e.placement),x=Z(e.placement),I=!x,T=K(S),E="x"===T?"y":"x",O=e.modifiersData.popperOffsets,L=e.rects.reference,A=e.rects.popper,k="function"==typeof b?b(Object.assign({},e.rects,{placement:e.placement})):b,_="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,j={x:0,y:0};if(O){if(u){var $,D="y"===T?o:s,H="y"===T?i:r,R="y"===T?"height":"width",W=O[T],V=W+C[D],F=W-C[H],U=g?-A[R]/2:0,J=x===c?L[R]:A[R],z=x===c?-A[R]:-L[R],X=e.elements.arrow,Q=g&&X?M(X):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[D],nt=tt[H],ot=G(0,L[R],Q[R]),it=I?L[R]/2-U-ot-et-_.mainAxis:J-ot-et-_.mainAxis,rt=I?-L[R]/2+U+ot+nt+_.mainAxis:z+ot+nt+_.mainAxis,st=e.elements.arrow&&Y(e.elements.arrow),lt=st?"y"===T?st.clientTop||0:st.clientLeft||0:0,at=null!=($=null==P?void 0:P[T])?$:0,ct=W+rt-at,ut=G(g?N(V,W+it-at-lt):V,W,g?q(F,ct):F);O[T]=ut,j[T]=ut-W}if(p){var dt,pt="x"===T?o:s,ht="x"===T?i:r,ft=O[E],mt="y"===E?"height":"width",vt=ft+C[pt],yt=ft-C[ht],wt=-1!==[o,s].indexOf(S),bt=null!=(dt=null==P?void 0:P[E])?dt:0,Ct=wt?vt:ft-L[mt]-A[mt]-bt+_.altAxis,St=wt?ft+L[mt]+A[mt]-bt-_.altAxis:yt,xt=g&&wt?function(t,e,n){var o=G(t,e,n);return o>n?n:o}(Ct,ft,St):G(g?Ct:vt,ft,g?St:yt);O[E]=xt,j[E]=xt-ft}e.modifiersData[l]=j}},requiresIfExists:["offset"]};function Et(t,e,n){void 0===n&&(n=!1);var o,i,r=k(e),s=k(e)&&function(t){var e=t.getBoundingClientRect(),n=j(e.width)/t.offsetWidth||1,o=j(e.height)/t.offsetHeight||1;return 1!==n||1!==o}(e),l=F(e),a=H(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==O(e)||dt(l))&&(c=(o=e)!==L(o)&&k(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:ct(o)),k(e)?((u=H(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):l&&(u.x=ut(l))),{x:a.left+c.scrollLeft-u.x,y:a.top+c.scrollTop-u.y,width:a.width,height:a.height}}function Ot(t){var e=new Map,n=new Set,o=[];function i(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var o=e.get(t);o&&i(o)}})),o.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||i(t)})),o}var Lt={placement:"bottom",modifiers:[],strategy:"absolute"};function At(){for(var t=arguments.length,e=new Array(t),n=0;n{Object.defineProperty(e,"__esModule",{value:!0}),e.BREAKPOINTS=e.COMBO_BOX_ACCESSIBILITY_KEY_SET=e.SELECT_ACCESSIBILITY_KEY_SET=e.TABS_ACCESSIBILITY_KEY_SET=e.OVERLAY_ACCESSIBILITY_KEY_SET=e.DROPDOWN_ACCESSIBILITY_KEY_SET=e.POSITIONS=void 0,e.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},e.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],e.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],e.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],e.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],e.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],e.BREAKPOINTS={sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},460:function(t,e,n){ /* * HSAccordion - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,7 +9,7 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(969),s=function(t){function e(e,n,o){var i=t.call(this,e,n,o)||this;return i.toggle=i.el.querySelector(".hs-accordion-toggle")||null,i.content=i.el.querySelector(".hs-accordion-content")||null,i.group=i.el.closest(".hs-accordion-group")||null,i.isAlwaysOpened=i.group.hasAttribute("data-hs-accordion-always-open")||!1,i.toggle&&i.content&&i.init(),i}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsAccordionCollection,this),this.toggle.addEventListener("click",(function(){t.el.classList.contains("active")?t.hide():t.show()}))},e.prototype.show=function(){var t=this;this.group&&!this.isAlwaysOpened&&this.group.querySelector(".hs-accordion.active")&&this.group.querySelector(".hs-accordion.active")!==this.el&&window.$hsAccordionCollection.find((function(e){return e.element.el===t.group.querySelector(".hs-accordion.active")})).element.hide();if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),this.content.style.display="block",this.content.style.height="0",setTimeout((function(){t.content.style.height="".concat(t.content.scrollHeight,"px")})),(0,r.afterTransition)(this.content,(function(){t.content.style.display="block",t.content.style.height="",t.fireEvent("open",t.el),(0,r.dispatch)("open.hs.accordion",t.el,t.el)}))},e.prototype.hide=function(){var t=this;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){t.content.style.height="0"})),(0,r.afterTransition)(this.content,(function(){t.content.style.display="",t.content.style.height="0",t.fireEvent("close",t.el),(0,r.dispatch)("close.hs.accordion",t.el,t.el)}))},e.getInstance=function(t,e){var n=window.$hsAccordionCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.show=function(t){var e=window.$hsAccordionCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&"block"!==e.element.content.style.display&&e.element.show()},e.hide=function(t){var e=window.$hsAccordionCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&"block"===e.element.content.style.display&&e.element.hide()},e.autoInit=function(){window.$hsAccordionCollection||(window.$hsAccordionCollection=[]),document.querySelectorAll(".hs-accordion:not(.--prevent-on-load-init)").forEach((function(t){window.$hsAccordionCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e.on=function(t,e,n){var o=window.$hsAccordionCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));o&&(o.element.events[t]=n)},e}(n(737).default);window.addEventListener("load",(function(){s.autoInit()})),"undefined"!=typeof window&&(window.HSAccordion=s),e.default=s},737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -17,7 +17,7 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},629:function(t,e,n){ /* * HSCarousel - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -25,15 +25,23 @@ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n *")||null,l.sliderWidth=l.inner.parentElement.clientWidth,l.touchX={start:0,end:0},l.init(),l}return i(e,t),e.prototype.init=function(){var t,e,n=this;this.createCollection(window.$hsCarouselCollection,this),this.inner&&(this.calculateWidth(),this.loadingClassesRemove&&("string"==typeof this.loadingClassesRemove?this.inner.classList.remove(this.loadingClassesRemove):(t=this.inner.classList).remove.apply(t,this.loadingClassesRemove)),this.loadingClassesAdd&&("string"==typeof this.loadingClassesAdd?this.inner.classList.add(this.loadingClassesAdd):(e=this.inner.classList).add.apply(e,this.loadingClassesAdd))),this.prev&&this.prev.addEventListener("click",(function(){n.goToPrev(),n.isAutoPlay&&(n.resetTimer(),n.setTimer())})),this.next&&this.next.addEventListener("click",(function(){n.goToNext(),n.isAutoPlay&&(n.resetTimer(),n.setTimer())})),this.dots&&this.dots.forEach((function(t,e){return t.addEventListener("click",(function(){n.goTo(e),n.isAutoPlay&&(n.resetTimer(),n.setTimer())}))})),this.slides.length&&(this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass(),this.isAutoPlay&&this.autoPlay()),this.inner&&this.afterLoadingClassesAdd&&setTimeout((function(){var t;"string"==typeof n.afterLoadingClassesAdd?n.inner.classList.add(n.afterLoadingClassesAdd):(t=n.inner.classList).add.apply(t,n.afterLoadingClassesAdd)})),this.el.classList.add("init"),this.el.addEventListener("touchstart",(function(t){n.touchX.start=t.changedTouches[0].screenX})),this.el.addEventListener("touchend",(function(t){n.touchX.end=t.changedTouches[0].screenX,n.detectDirection()})),this.observeResize()},e.prototype.observeResize=function(){var t=this;new ResizeObserver((function(){return t.recalculateWidth()})).observe(document.querySelector("body"))},e.prototype.calculateWidth=function(){var t=this;this.inner.style.width="".concat(this.sliderWidth*this.slides.length,"px"),this.inner.style.transform="translate(-".concat(this.currentIndex*this.sliderWidth,"px, 0px)"),this.slides.forEach((function(e){e.style.width="".concat(t.sliderWidth,"px")}))},e.prototype.addCurrentClass=function(){var t=this;this.slides.forEach((function(e,n){n===t.currentIndex?e.classList.add("active"):e.classList.remove("active")})),this.dots&&this.dots.forEach((function(e,n){n===t.currentIndex?e.classList.add("active"):e.classList.remove("active")}))},e.prototype.addDisabledClass=function(){if(!this.prev||!this.next)return!1;0===this.currentIndex?(this.next.classList.remove("disabled"),this.prev.classList.add("disabled")):this.currentIndex===this.slides.length-1?(this.prev.classList.remove("disabled"),this.next.classList.add("disabled")):(this.prev.classList.remove("disabled"),this.next.classList.remove("disabled"))},e.prototype.autoPlay=function(){this.setTimer()},e.prototype.setTimer=function(){var t=this;this.timer=setInterval((function(){t.currentIndex===t.slides.length-1?t.goTo(0):t.goToNext()}),this.speed)},e.prototype.resetTimer=function(){clearInterval(this.timer)},e.prototype.detectDirection=function(){var t=this.touchX,e=t.start,n=t.end;ne&&this.goToPrev()},e.prototype.recalculateWidth=function(){this.sliderWidth=this.inner.parentElement.clientWidth,this.calculateWidth()},e.prototype.goToPrev=function(){0===this.currentIndex&&this.isInfiniteLoop?(this.currentIndex=this.slides.length-1,this.inner.style.transform="translate(-".concat(this.currentIndex*this.sliderWidth,"px, 0px)"),this.addCurrentClass()):0!==this.currentIndex&&(this.currentIndex-=1,this.inner.style.transform="translate(-".concat(this.currentIndex*this.sliderWidth,"px, 0px)"),this.addCurrentClass(),this.addDisabledClass())},e.prototype.goToNext=function(){this.currentIndex===this.slides.length-1&&this.isInfiniteLoop?(this.currentIndex=0,this.inner.style.transform="translate(-".concat(this.currentIndex*this.sliderWidth,"px, 0px)"),this.addCurrentClass()):this.currentIndex0&&i[i.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t',E.outputEmptyTemplate=null!==(h=null==A?void 0:A.outputEmptyTemplate)&&void 0!==h?h:'
Nothing found...
',E.outputLoaderTemplate=null!==(f=null==A?void 0:A.outputLoaderTemplate)&&void 0!==f?f:'
\n\t\t\t\t
\n\t\t\t\t\tLoading...\n\t\t\t\t
\n\t\t\t
',E.groupingType=null!==(m=null==A?void 0:A.groupingType)&&void 0!==m?m:null,E.groupingTitleTemplate=null!==(v=null==A?void 0:A.groupingTitleTemplate)&&void 0!==v?v:"default"===E.groupingType?'
':'',E.tabsWrapperTemplate=null!==(y=null==A?void 0:A.tabsWrapperTemplate)&&void 0!==y?y:'
',E.preventSelection=null!==(g=null==A?void 0:A.preventSelection)&&void 0!==g&&g,E.isOpenOnFocus=null!==(w=null==A?void 0:A.isOpenOnFocus)&&void 0!==w&&w,E.input=null!==(b=E.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==b?b:null,E.output=null!==(C=E.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==C?C:null,E.itemsWrapper=null!==(S=E.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==S?S:null,E.items=null!==(x=Array.from(E.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==x?x:[],E.tabs=[],E.toggle=null!==(I=E.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==I?I:null,E.outputPlaceholder=null,E.selected=E.value=null!==(T=E.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==T?T:"",E.isOpened=!1,E.isCurrent=!1,E.animationInProcess=!1,E.selectedGroup="all",E.init(),E}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsComboBoxCollection,this),this.build()},e.prototype.build=function(){this.buildInput(),this.groupingType&&this.setGroups(),this.buildItems(),this.preventVisibility&&(this.isOpened=!0,this.recalculateDirection()),this.toggle&&this.buildToggle()},e.prototype.setResultAndRender=function(t){void 0===t&&(t=""),this.setResults(t),this.apiSearchQuery&&this.itemsFromJson()},e.prototype.buildInput=function(){var t=this;this.isOpenOnFocus&&this.input.addEventListener("focus",(function(){t.isOpened||(t.setResultAndRender(),t.open())})),this.input.addEventListener("input",(0,c.debounce)((function(e){t.setResultAndRender(e.target.value),t.isOpened||t.open()})))},e.prototype.buildItems=function(){this.apiUrl?this.itemsFromJson():(this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="",this.itemsFromHtml())},e.prototype.setResults=function(t){this.value=t,this.resultItems(),this.hasVisibleItems()?this.destroyOutputPlaceholder():this.buildOutputPlaceholder()},e.prototype.isItemExists=function(t){return this.items.some((function(e){return Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(e){return e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]}))}))},e.prototype.isTextExists=function(t,e){var n=e.map((function(t){return t.toLowerCase()}));return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(t){return n.includes(t.getAttribute("data-hs-combo-box-search-text").toLowerCase())}))},e.prototype.isTextExistsAny=function(t,e){return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(t){return t.getAttribute("data-hs-combo-box-search-text").toLowerCase().includes(e.toLowerCase())}))},e.prototype.valuesBySelector=function(t){return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).reduce((function(t,e){return a(a([],t,!0),[e.getAttribute("data-hs-combo-box-search-text")],!1)}),[])},e.prototype.buildOutputLoader=function(){if(this.outputLoader)return!1;this.outputLoader=(0,c.htmlToElement)(this.outputLoaderTemplate),this.items.length||this.outputPlaceholder?(this.outputLoader.style.position="absolute",this.outputLoader.style.top="0",this.outputLoader.style.bottom="0",this.outputLoader.style.left="0",this.outputLoader.style.right="0",this.outputLoader.style.zIndex="2"):(this.outputLoader.style.position="",this.outputLoader.style.top="",this.outputLoader.style.bottom="",this.outputLoader.style.left="",this.outputLoader.style.right="",this.outputLoader.style.zIndex="",this.outputLoader.style.height="30px"),this.output.append(this.outputLoader)},e.prototype.destroyOutputLoader=function(){this.outputLoader&&this.outputLoader.remove(),this.outputLoader=null},e.prototype.itemsFromJson=function(){return s(this,void 0,void 0,(function(){var t,e,n,o,i,r=this;return l(this,(function(s){switch(s.label){case 0:this.buildOutputLoader(),s.label=1;case 1:return s.trys.push([1,4,,5]),t="".concat(this.apiQuery),e="".concat(this.apiSearchQuery,"=").concat(this.value.toLowerCase()),n=this.apiUrl,this.apiQuery&&this.apiSearchQuery?n+="?".concat(e,"&").concat(t):this.apiQuery?n+="?".concat(t):this.apiSearchQuery&&(n+="?".concat(e)),[4,fetch(n,this.apiHeaders)];case 2:return[4,s.sent().json()];case 3:return o=s.sent(),this.apiDataPart&&(o=o[this.apiDataPart]),this.apiSearchQuery&&(this.items=[]),this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="","tabs"===this.groupingType?(this.setApiGroups(o),this.groupTabsRender(),this.jsonItemsRender(o)):"default"===this.groupingType?(this.setApiGroups(o),this.groups.forEach((function(t){var e=(0,c.htmlToElement)(r.groupingTitleTemplate);e.setAttribute("data-hs-combo-box-group-title",t.name),e.classList.add("--exclude-accessibility"),e.innerText=t.title;var n=o.filter((function(e){return e[r.apiGroupField]===t.name}));r.itemsWrapper?r.itemsWrapper.append(e):r.output.append(e),r.jsonItemsRender(n)}))):this.jsonItemsRender(o),this.setResults(this.input.value),[3,5];case 4:return i=s.sent(),console.error(i),[3,5];case 5:return this.destroyOutputLoader(),[2]}}))}))},e.prototype.jsonItemsRender=function(t){var e=this;t.forEach((function(t,n){if(e.isItemExists(t))return!1;var o=(0,c.htmlToElement)(e.outputItemTemplate);o.querySelectorAll("[data-hs-combo-box-search-text]").forEach((function(e){var n,o;e.textContent=null!==(n=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==n?n:"",e.setAttribute("data-hs-combo-box-search-text",null!==(o=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==o?o:"")})),o.querySelectorAll("[data-hs-combo-box-output-item-attr]").forEach((function(e){JSON.parse(e.getAttribute("data-hs-combo-box-output-item-attr")).forEach((function(n){e.setAttribute(n.attr,t[n.valueFrom])}))})),o.setAttribute("tabIndex","".concat(n)),"tabs"!==e.groupingType&&"default"!==e.groupingType||o.setAttribute("data-hs-combo-box-output-item",'{"group": {"name": "'.concat(t[e.apiGroupField],'", "title": "').concat(t[e.apiGroupField],'"}}')),e.items=a(a([],e.items,!0),[o],!1),e.preventSelection||o.addEventListener("click",(function(){e.close(o.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text")),e.setSelectedByValue(e.valuesBySelector(o))})),e.appendItemsToWrapper(o)}))},e.prototype.setGroups=function(){var t=[];this.items.forEach((function(e){var n=JSON.parse(e.getAttribute("data-hs-combo-box-output-item")).group;t.some((function(t){return(null==t?void 0:t.name)===n.name}))||t.push(n)})),this.groups=t},e.prototype.setCurrent=function(){window.$hsComboBoxCollection.length&&(window.$hsComboBoxCollection.map((function(t){return t.element.isCurrent=!1})),this.isCurrent=!0)},e.prototype.setApiGroups=function(t){var e=this,n=[];t.forEach((function(t){var o=t[e.apiGroupField];n.some((function(t){return t.name===o}))||n.push({name:o,title:o})})),this.groups=n},e.prototype.sortItems=function(){return this.items.sort((function(t,e){var n=t.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text"),o=e.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text");return no?1:0}))},e.prototype.itemRender=function(t){var e=this,n=t.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text");this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t),this.preventSelection||t.addEventListener("click",(function(){e.close(n),e.setSelectedByValue(e.valuesBySelector(t))}))},e.prototype.plainRender=function(t){var e=this;t.forEach((function(t){e.itemRender(t)}))},e.prototype.groupTabsRender=function(){var t=this,e=(0,c.htmlToElement)(this.tabsWrapperTemplate),n=(0,c.htmlToElement)('
');e.append(n),this.output.insertBefore(e,this.output.firstChild);var o=(0,c.htmlToElement)(this.groupingTitleTemplate);o.setAttribute("data-hs-combo-box-group-title","all"),o.classList.add("--exclude-accessibility","active"),o.innerText="All",this.tabs=a(a([],this.tabs,!0),[o],!1),n.append(o),o.addEventListener("click",(function(){t.selectedGroup="all";var e=t.tabs.find((function(e){return e.getAttribute("data-hs-combo-box-group-title")===t.selectedGroup}));t.tabs.forEach((function(t){return t.classList.remove("active")})),e.classList.add("active"),t.setItemsVisibility()})),this.groups.forEach((function(e){var o=(0,c.htmlToElement)(t.groupingTitleTemplate);o.setAttribute("data-hs-combo-box-group-title",e.name),o.classList.add("--exclude-accessibility"),o.innerText=e.title,t.tabs=a(a([],t.tabs,!0),[o],!1),n.append(o),o.addEventListener("click",(function(){t.selectedGroup=e.name;var n=t.tabs.find((function(e){return e.getAttribute("data-hs-combo-box-group-title")===t.selectedGroup}));t.tabs.forEach((function(t){return t.classList.remove("active")})),n.classList.add("active"),t.setItemsVisibility()}))}))},e.prototype.groupDefaultRender=function(){var t=this;this.groups.forEach((function(e){var n=(0,c.htmlToElement)(t.groupingTitleTemplate);n.setAttribute("data-hs-combo-box-group-title",e.name),n.classList.add("--exclude-accessibility"),n.innerText=e.title,t.itemsWrapper?t.itemsWrapper.append(n):t.output.append(n);var o=t.sortItems().filter((function(t){return JSON.parse(t.getAttribute("data-hs-combo-box-output-item")).group.name===e.name}));t.plainRender(o)}))},e.prototype.itemsFromHtml=function(){if("default"===this.groupingType)this.groupDefaultRender();else if("tabs"===this.groupingType){var t=this.sortItems();this.groupTabsRender(),this.plainRender(t)}else{t=this.sortItems();this.plainRender(t)}this.setResults(this.input.value)},e.prototype.buildToggle=function(){var t=this;this.toggle.addEventListener("click",(function(){t.isOpened?t.close():t.open(t.toggle.getAttribute("data-hs-combo-box-toggle"))}))},e.prototype.setSelectedByValue=function(t){var e=this;this.items.forEach((function(n){e.isTextExists(n,t)?n.classList.add("selected"):n.classList.remove("selected")}))},e.prototype.setValue=function(t){this.selected=t,this.value=t,this.input.value=t},e.prototype.setItemsVisibility=function(){var t=this;"tabs"===this.groupingType&&"all"!==this.selectedGroup&&this.items.forEach((function(t){t.style.display="none"}));var e="tabs"===this.groupingType?"all"===this.selectedGroup?this.items:this.items.filter((function(e){return JSON.parse(e.getAttribute("data-hs-combo-box-output-item")).group.name===t.selectedGroup})):this.items;"tabs"===this.groupingType&&"all"!==this.selectedGroup&&e.forEach((function(t){t.style.display="block"})),e.forEach((function(e){t.isTextExistsAny(e,t.value)?e.style.display="block":e.style.display="none"})),"default"===this.groupingType&&this.output.querySelectorAll("[data-hs-combo-box-group-title]").forEach((function(e){var n=e.getAttribute("data-hs-combo-box-group-title");t.items.filter((function(t){return JSON.parse(t.getAttribute("data-hs-combo-box-output-item")).group.name===n&&"block"===t.style.display})).length?e.style.display="block":e.style.display="none"}))},e.prototype.hasVisibleItems=function(){return!!this.items.length&&this.items.some((function(t){return"block"===t.style.display}))},e.prototype.appendItemsToWrapper=function(t){this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t)},e.prototype.buildOutputPlaceholder=function(){this.outputPlaceholder||(this.outputPlaceholder=(0,c.htmlToElement)(this.outputEmptyTemplate)),this.appendItemsToWrapper(this.outputPlaceholder)},e.prototype.destroyOutputPlaceholder=function(){this.outputPlaceholder&&this.outputPlaceholder.remove(),this.outputPlaceholder=null},e.prototype.resultItems=function(){if(!this.items.length)return!1;this.setItemsVisibility(),this.setSelectedByValue([this.selected])},e.prototype.setValueAndOpen=function(t){this.value=t,this.items.length&&this.setItemsVisibility()},e.prototype.open=function(t){var e=this;return!this.animationInProcess&&(void 0!==t&&this.setValueAndOpen(t),!this.preventVisibility&&(this.animationInProcess=!0,this.output.style.display="block",this.recalculateDirection(),setTimeout((function(){e.el.classList.add("active"),e.animationInProcess=!1})),void(this.isOpened=!0)))},e.prototype.setValueAndClear=function(t){t?this.setValue(t):this.setValue(this.selected),this.outputPlaceholder&&this.destroyOutputPlaceholder()},e.prototype.close=function(t){var e=this;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t),!1):(this.animationInProcess=!0,this.el.classList.remove("active"),this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom="",(0,c.afterTransition)(this.output,(function(){e.output.style.display="none",e.setValueAndClear(t),e.animationInProcess=!1})),void(this.isOpened=!1)))},e.prototype.recalculateDirection=function(){(0,c.isEnoughSpace)(this.output,this.input,"bottom",this.gap,this.viewport)?(this.output.classList.remove("bottom-full"),this.output.style.marginBottom="",this.output.classList.add("top-full"),this.output.style.marginTop="".concat(this.gap,"px")):(this.output.classList.remove("top-full"),this.output.style.marginTop="",this.output.classList.add("bottom-full"),this.output.style.marginBottom="".concat(this.gap,"px"))},e.getInstance=function(t,e){var n=window.$hsComboBoxCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsComboBoxCollection||(window.$hsComboBoxCollection=[]),document.querySelectorAll("[data-hs-combo-box]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsComboBoxCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-combo-box"),o=n?JSON.parse(n):{};new e(t,o)}})),window.$hsComboBoxCollection&&(window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.close=function(t){var e=window.$hsComboBoxCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.isOpened&&e.element.close()},e.closeCurrentlyOpened=function(t){if(void 0===t&&(t=null),!t.closest("[data-hs-combo-box].active")){var e=window.$hsComboBoxCollection.filter((function(t){return t.element.isOpened}))||null;e&&e.forEach((function(t){t.element.close()}))}},e.getPreparedItems=function(t,e){return void 0===t&&(t=!1),e?(t?Array.from(e.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter((function(t){return"none"!==t.style.display})).reverse():Array.from(e.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter((function(t){return"none"!==t.style.display}))).filter((function(t){return!t.classList.contains("disabled")})):null},e.setHighlighted=function(t,e,n){e.focus(),n.value=e.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text"),t&&t.classList.remove("hs-combo-box-output-item-highlighted"),e.classList.add("hs-combo-box-output-item-highlighted")},e.accessibility=function(t){if(window.$hsComboBoxCollection.find((function(t){return t.element.isOpened}))&&d.COMBO_BOX_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}},e.onEscape=function(){var t=window.$hsComboBoxCollection.find((function(t){return!t.element.preventVisibility&&t.element.isOpened}));t&&(t.element.close(),t.element.input.blur())},e.onArrow=function(t){var n;void 0===t&&(t=!0);var o=window.$hsComboBoxCollection.find((function(t){return t.element.preventVisibility?t.element.isCurrent:t.element.isOpened}));if(o){var i=null!==(n=o.element.itemsWrapper)&&void 0!==n?n:o.element.output;if(!i)return!1;var r,s=e.getPreparedItems(t,i),l=i.querySelector(".hs-combo-box-output-item-highlighted");l||s[0].classList.add("hs-combo-box-output-item-highlighted");var a=s.findIndex((function(t){return t===l}));a+1=this.limit)return!1;this.el.hasAttribute("disabled")&&this.el.setAttribute("disabled","");var t=this.target.cloneNode(!0);this.addToItems(t),this.limit&&this.items.length>=this.limit&&this.el.setAttribute("disabled","disabled"),this.fireEvent("copy",t),(0,s.dispatch)("copy.hs.copyMarkup",t,t)},e.prototype.addPredefinedItems=function(){var t=this;Array.from(this.wrapper.children).filter((function(t){return!t.classList.contains("[--ignore-for-count]")})).forEach((function(e){t.addToItems(e)}))},e.prototype.setTarget=function(){var t="string"==typeof this.targetSelector?document.querySelector(this.targetSelector).cloneNode(!0):this.targetSelector.cloneNode(!0);t.removeAttribute("id"),this.target=t},e.prototype.setWrapper=function(){this.wrapper="string"==typeof this.wrapperSelector?document.querySelector(this.wrapperSelector):this.wrapperSelector},e.prototype.addToItems=function(t){var e=this,n=t.querySelector("[data-hs-copy-markup-delete-item]");this.wrapper?this.wrapper.append(t):this.el.before(t),n&&n.addEventListener("click",(function(){return e.delete(t)})),this.items.push(t)},e.prototype.delete=function(t){var e=this.items.indexOf(t);-1!==e&&this.items.splice(e,1),t.remove(),this.fireEvent("delete",t),(0,s.dispatch)("delete.hs.copyMarkup",t,t)},e.getInstance=function(t,e){var n=window.$hsCopyMarkupCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsCopyMarkupCollection||(window.$hsCopyMarkupCollection=[]),document.querySelectorAll("[data-hs-copy-markup]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsCopyMarkupCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-copy-markup"),o=n?JSON.parse(n):{};new e(t,o)}}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=l),e.default=l},610:function(t,e,n){ /* * HSDropdown - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i .hs-dropdown-toggle")||i.el.children[0],i.menu=i.el.querySelector(":scope > .hs-dropdown-menu"),i.eventMode=(0,s.getClassProperty)(i.el,"--trigger","click"),i.closeMode=(0,s.getClassProperty)(i.el,"--auto-close","true"),i.animationInProcess=!1,i.toggle&&i.menu&&i.init(),i}return i(e,t),e.prototype.init=function(){var t=this;if(this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle.addEventListener("click",(function(){return t.onClickHandler()})),(0,s.isIOS)()||(0,s.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return t.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return t.onMouseLeaveHandler()})))},e.prototype.resizeHandler=function(){this.eventMode=(0,s.getClassProperty)(this.el,"--trigger","click")},e.prototype.onClickHandler=function(){this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?this.close():this.open()},e.prototype.onMouseEnterHandler=function(){if("hover"!==this.eventMode)return!1;this.el._popper&&this.forceClearState(),!this.el.classList.contains("open")&&this.menu.classList.contains("hidden")&&this.open()},e.prototype.onMouseLeaveHandler=function(){if("hover"!==this.eventMode)return!1;this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")&&this.close()},e.prototype.destroyPopper=function(){this.menu.classList.remove("block"),this.menu.classList.add("hidden"),this.menu.style.inset=null,this.menu.style.position=null,this.el&&this.el._popper&&this.el._popper.destroy(),this.animationInProcess=!1},e.prototype.absoluteStrategyModifiers=function(){var t=this;return[{name:"applyStyles",fn:function(e){var n=(window.getComputedStyle(t.el).getPropertyValue("--strategy")||"absolute").replace(" ",""),o=(window.getComputedStyle(t.el).getPropertyValue("--adaptive")||"adaptive").replace(" ","");e.state.elements.popper.style.position=n,e.state.elements.popper.style.transform="adaptive"===o?e.state.styles.popper.transform:null,e.state.elements.popper.style.top=null,e.state.elements.popper.style.bottom=null,e.state.elements.popper.style.left=null,e.state.elements.popper.style.right=null,e.state.elements.popper.style.margin=0}},{name:"computeStyles",options:{adaptive:!1}}]},e.prototype.open=function(){var t=this;if(this.el.classList.contains("open"))return!1;if(this.animationInProcess)return!1;this.animationInProcess=!0;var e=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),n=(window.getComputedStyle(this.el).getPropertyValue("--flip")||"true").replace(" ",""),o=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),i=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ",""));"static"!==o&&(this.el._popper=(0,l.createPopper)(this.el,this.menu,{placement:c.POSITIONS[e]||"bottom-start",strategy:o,modifiers:r(r([],"fixed"!==o?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===n},{name:"offset",options:{offset:[0,i]}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){t.el.classList.add("open"),t.animationInProcess=!1})),this.fireEvent("open",this.el),(0,s.dispatch)("open.hs.dropdown",this.el,this.el)},e.prototype.close=function(t){var e=this;if(void 0===t&&(t=!0),this.animationInProcess||!this.el.classList.contains("open"))return!1;if(this.animationInProcess=!0,t){var n=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,s.afterTransition)(n,(function(){return e.destroyPopper()}))}else this.destroyPopper();this.menu.style.margin=null,this.el.classList.remove("open"),this.fireEvent("close",this.el),(0,s.dispatch)("close.hs.dropdown",this.el,this.el)},e.prototype.forceClearState=function(){this.destroyPopper(),this.menu.style.margin=null,this.el.classList.remove("open")},e.getInstance=function(t,e){var n=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.autoInit=function(){if(window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),document.querySelectorAll(".hs-dropdown:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDropdownCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)})),window.$hsDropdownCollection){document.addEventListener("keydown",(function(t){return e.accessibility(t)})),window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)}));var t=window.innerWidth;window.addEventListener("resize",(function(){window.innerWidth!==t&&(t=innerWidth,e.closeCurrentlyOpened(null,!1))}))}},e.open=function(t){var e=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.menu.classList.contains("hidden")&&e.element.open()},e.close=function(t){var e=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&!e.element.menu.classList.contains("hidden")&&e.element.close()},e.accessibility=function(t){this.history=s.menuSearchHistory;var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e&&(c.DROPDOWN_ACCESSIBILITY_KEY_SET.includes(t.code)||4===t.code.length&&t.code[t.code.length-1].match(/^[A-Z]*$/))&&!t.metaKey&&!e.element.menu.querySelector("input:focus"))switch(console.log("Key code:",t.code),t.code){case"Escape":e.element.menu.querySelector(".hs-select.active")||(t.preventDefault(),this.onEscape(t));break;case"Enter":e.element.menu.querySelector(".hs-select button:focus")||e.element.menu.querySelector(".hs-collapse-toggle:focus")||this.onEnter(t);break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;default:t.preventDefault(),this.onFirstLetter(t.key)}},e.onEscape=function(t){var e=t.target.closest(".hs-dropdown.open");if(window.$hsDropdownCollection.find((function(t){return t.element.el===e}))){var n=window.$hsDropdownCollection.find((function(t){return t.element.el===e}));n&&(n.element.close(),n.element.toggle.focus())}else this.closeCurrentlyOpened()},e.onEnter=function(t){var e=t.target.parentElement;if(window.$hsDropdownCollection.find((function(t){return t.element.el===e}))){t.preventDefault();var n=window.$hsDropdownCollection.find((function(t){return t.element.el===e}));n&&n.element.open()}},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e){var n=e.element.menu;if(!n)return!1;var o=(t?Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])")).reverse():Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector("a:focus, button:focus"),r=o.findIndex((function(t){return t===i}));r+1 .hs-dropdown-toggle")||i.el.children[0],i.menu=i.el.querySelector(":scope > .hs-dropdown-menu"),i.eventMode=(0,s.getClassProperty)(i.el,"--trigger","click"),i.closeMode=(0,s.getClassProperty)(i.el,"--auto-close","true"),i.animationInProcess=!1,i.toggle&&i.menu&&i.init(),i}return i(e,t),e.prototype.init=function(){var t=this;if(this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle.addEventListener("click",(function(){return t.onClickHandler()})),(0,s.isIOS)()||(0,s.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return t.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return t.onMouseLeaveHandler()})))},e.prototype.resizeHandler=function(){this.eventMode=(0,s.getClassProperty)(this.el,"--trigger","click")},e.prototype.onClickHandler=function(){this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?this.close():this.open()},e.prototype.onMouseEnterHandler=function(){if("hover"!==this.eventMode)return!1;this.el._popper&&this.forceClearState(),!this.el.classList.contains("open")&&this.menu.classList.contains("hidden")&&this.open()},e.prototype.onMouseLeaveHandler=function(){if("hover"!==this.eventMode)return!1;this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")&&this.close()},e.prototype.destroyPopper=function(){this.menu.classList.remove("block"),this.menu.classList.add("hidden"),this.menu.style.inset=null,this.menu.style.position=null,this.el&&this.el._popper&&this.el._popper.destroy(),this.animationInProcess=!1},e.prototype.absoluteStrategyModifiers=function(){var t=this;return[{name:"applyStyles",fn:function(e){var n=(window.getComputedStyle(t.el).getPropertyValue("--strategy")||"absolute").replace(" ",""),o=(window.getComputedStyle(t.el).getPropertyValue("--adaptive")||"adaptive").replace(" ","");e.state.elements.popper.style.position=n,e.state.elements.popper.style.transform="adaptive"===o?e.state.styles.popper.transform:null,e.state.elements.popper.style.top=null,e.state.elements.popper.style.bottom=null,e.state.elements.popper.style.left=null,e.state.elements.popper.style.right=null,e.state.elements.popper.style.margin=0}},{name:"computeStyles",options:{adaptive:!1}}]},e.prototype.open=function(){var t=this;if(this.el.classList.contains("open"))return!1;if(this.animationInProcess)return!1;this.animationInProcess=!0;var e=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),n=(window.getComputedStyle(this.el).getPropertyValue("--flip")||"true").replace(" ",""),o=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),i=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ",""));"static"!==o&&(this.el._popper=(0,l.createPopper)(this.el,this.menu,{placement:c.POSITIONS[e]||"bottom-start",strategy:o,modifiers:r(r([],"fixed"!==o?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===n},{name:"offset",options:{offset:[0,i]}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){t.el.classList.add("open"),t.animationInProcess=!1})),this.fireEvent("open",this.el),(0,s.dispatch)("open.hs.dropdown",this.el,this.el)},e.prototype.close=function(t){var e=this;if(void 0===t&&(t=!0),this.animationInProcess||!this.el.classList.contains("open"))return!1;if(this.animationInProcess=!0,t){var n=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,s.afterTransition)(n,(function(){return e.destroyPopper()}))}else this.destroyPopper();this.menu.style.margin=null,this.el.classList.remove("open"),this.fireEvent("close",this.el),(0,s.dispatch)("close.hs.dropdown",this.el,this.el)},e.prototype.forceClearState=function(){this.destroyPopper(),this.menu.style.margin=null,this.el.classList.remove("open")},e.getInstance=function(t,e){var n=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.autoInit=function(){if(window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),document.querySelectorAll(".hs-dropdown:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDropdownCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)})),window.$hsDropdownCollection){document.addEventListener("keydown",(function(t){return e.accessibility(t)})),window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)}));var t=window.innerWidth;window.addEventListener("resize",(function(){window.innerWidth!==t&&(t=innerWidth,e.closeCurrentlyOpened(null,!1))}))}},e.open=function(t){var e=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.menu.classList.contains("hidden")&&e.element.open()},e.close=function(t){var e=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&!e.element.menu.classList.contains("hidden")&&e.element.close()},e.accessibility=function(t){this.history=s.menuSearchHistory;var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e&&(c.DROPDOWN_ACCESSIBILITY_KEY_SET.includes(t.code)||4===t.code.length&&t.code[t.code.length-1].match(/^[A-Z]*$/))&&!t.metaKey&&!e.element.menu.querySelector("input:focus"))switch(t.code){case"Escape":e.element.menu.querySelector(".hs-select.active")||(t.preventDefault(),this.onEscape(t));break;case"Enter":e.element.menu.querySelector(".hs-select button:focus")||e.element.menu.querySelector(".hs-collapse-toggle:focus")||this.onEnter(t);break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;default:t.preventDefault(),this.onFirstLetter(t.key)}},e.onEscape=function(t){var e=t.target.closest(".hs-dropdown.open");if(window.$hsDropdownCollection.find((function(t){return t.element.el===e}))){var n=window.$hsDropdownCollection.find((function(t){return t.element.el===e}));n&&(n.element.close(),n.element.toggle.focus())}else this.closeCurrentlyOpened()},e.onEnter=function(t){var e=t.target.parentElement;if(window.$hsDropdownCollection.find((function(t){return t.element.el===e}))){t.preventDefault();var n=window.$hsDropdownCollection.find((function(t){return t.element.el===e}));n&&n.element.open()}},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e){var n=e.element.menu;if(!n)return!1;var o=(t?Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])")).reverse():Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector("a:focus, button:focus"),r=o.findIndex((function(t){return t===i}));r+10?l.step:1,o.init(),o}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsInputNumberCollection,this),this.input&&this.increment&&this.build()},e.prototype.build=function(){this.input&&this.buildInput(),this.increment&&this.buildIncrement(),this.decrement&&this.buildDecrement(),this.inputValue<=0&&0===this.minInputValue&&(this.inputValue=0,this.input.value="0"),(this.inputValue<=0||this.minInputValue<0)&&this.changeValue(),this.input.hasAttribute("disabled")&&this.disableButtons()},e.prototype.buildInput=function(){var t=this;this.input.addEventListener("input",(function(){return t.changeValue()}))},e.prototype.buildIncrement=function(){var t=this;this.increment.addEventListener("click",(function(){t.changeValue("increment")}))},e.prototype.buildDecrement=function(){var t=this;this.decrement.addEventListener("click",(function(){t.changeValue("decrement")}))},e.prototype.changeValue=function(t){var e,n;void 0===t&&(t="none");var o={inputValue:this.inputValue},i=null!==(e=this.minInputValue)&&void 0!==e?e:Number.MIN_SAFE_INTEGER,r=null!==(n=this.maxInputValue)&&void 0!==n?n:Number.MAX_SAFE_INTEGER;switch(this.inputValue=isNaN(this.inputValue)?0:this.inputValue,t){case"increment":var l=this.inputValue+this.step;this.inputValue=l>=i&&l<=r?l:r,this.input.value=this.inputValue.toString();break;case"decrement":var a=this.inputValue-this.step;this.inputValue=a>=i&&a<=r?a:i,this.input.value=this.inputValue.toString();break;default:var c=isNaN(parseInt(this.input.value))?0:parseInt(this.input.value);this.inputValue=c>=r?r:c<=i?i:c,this.inputValue<=i&&(this.input.value=this.inputValue.toString())}o.inputValue=this.inputValue,this.inputValue===i?(this.el.classList.add("disabled"),this.decrement&&this.disableButtons("decrement")):(this.el.classList.remove("disabled"),this.decrement&&this.enableButtons("decrement")),this.inputValue===r?(this.el.classList.add("disabled"),this.increment&&this.disableButtons("increment")):(this.el.classList.remove("disabled"),this.increment&&this.enableButtons("increment")),this.fireEvent("change",o),(0,s.dispatch)("change.hs.inputNumber",this.el,o)},e.prototype.disableButtons=function(t){void 0===t&&(t="all"),"all"===t?("BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.setAttribute("disabled","disabled"),"BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.setAttribute("disabled","disabled")):"increment"===t?"BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.setAttribute("disabled","disabled"):"decrement"===t&&("BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.setAttribute("disabled","disabled"))},e.prototype.enableButtons=function(t){void 0===t&&(t="all"),"all"===t?("BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.removeAttribute("disabled"),"BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.removeAttribute("disabled")):"increment"===t?"BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.removeAttribute("disabled"):"decrement"===t&&("BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.removeAttribute("disabled"))},e.getInstance=function(t,e){var n=window.$hsInputNumberCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsInputNumberCollection||(window.$hsInputNumberCollection=[]),document.querySelectorAll("[data-hs-input-number]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsInputNumberCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=l),e.default=l},770:function(t,e,n){ /* * HSOverlay - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n-1?e[(o+1)%e.length].focus():e[0].focus()},e.on=function(t,e,n){var o=window.$hsOverlayCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)||t.element.overlay===("string"==typeof e?document.querySelector(e):e)}));o&&(o.element.events[t]=n)},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSOverlay=l),e.default=l},659:function(t,e,n){ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=t?(document.body.classList.add("hs-overlay-body-open"),e.element.overlay.classList.add("opened")):e.element.close(!0)},e.accessibility=function(t){var e,n,o=window.$hsOverlayCollection.filter((function(t){return t.element.overlay.classList.contains("open")})),i=o[o.length-1],r=null===(n=null===(e=null==i?void 0:i.element)||void 0===e?void 0:e.overlay)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),l=[];(null==r?void 0:r.length)&&r.forEach((function(t){(0,s.isParentOrElementHidden)(t)||l.push(t)}));var a=i&&!t.metaKey;if(a&&!i.element.isTabAccessibilityLimited&&"Tab"===t.code)return!1;a&&l.length&&"Tab"===t.code&&(t.preventDefault(),this.onTab(i,l)),a&&"Escape"===t.code&&(t.preventDefault(),this.onEscape(i))},e.onEscape=function(t){t&&t.element.hasAbilityToCloseOnBackdropClick&&t.element.close()},e.onTab=function(t,e){if(!e.length)return!1;var n=t.element.overlay.querySelector(":focus"),o=Array.from(e).indexOf(n);o>-1?e[(o+1)%e.length].focus():e[0].focus()},e.on=function(t,e,n){var o=window.$hsOverlayCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)||t.element.overlay===("string"==typeof e?document.querySelector(e):e)}));o&&(o.element.events[t]=n)},e}(n(737).default);window.addEventListener("load",(function(){a.autoInit()})),window.addEventListener("resize",(function(){!function(){if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((function(t){return t.element.autoClose})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.autoClose})).forEach((function(t){document.body.clientWidth>=t.element.autoClose&&t.element.close(!0)}))}(),function(){if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((function(t){return t.element.openedBreakpoint})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.openedBreakpoint})).forEach((function(t){a.setOpened(t.element.openedBreakpoint,t)}))}()})),"undefined"!=typeof window&&(window.HSOverlay=a),e.default=a},659:function(t,e,n){ /* * HSPinInput - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -73,7 +81,7 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&this.items[e-1].focus()},e.prototype.onKeydown=function(t,e){"Backspace"===t.key&&e>0&&(""===this.items[e].value?(this.items[e-1].value="",this.items[e-1].focus()):this.items[e].value=""),this.setCurrentValue(),this.toggleCompleted()},e.prototype.onFocusIn=function(t){this.items[t].setAttribute("placeholder","")},e.prototype.onFocusOut=function(t){this.items[t].setAttribute("placeholder",this.placeholders[t])},e.prototype.onPaste=function(t){var e=this;t.preventDefault(),this.items.forEach((function(n){document.activeElement===n&&e.autoFillAll(t.clipboardData.getData("text"))}))},e.getInstance=function(t,e){var n=window.$hsPinInputCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsPinInputCollection||(window.$hsPinInputCollection=[]),document.querySelectorAll("[data-hs-pin-input]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsPinInputCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=l),e.default=l},139:function(t,e,n){ /* * HSRemoveElement - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -81,7 +89,7 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0){if(this.activeSection===e)return!1;this.links.forEach((function(t){t.classList.remove("active")}));var a=this.el.querySelector('[href="#'.concat(e.getAttribute("id"),'"]'));if(a){a.classList.add("active");var c=a.closest("[data-hs-scrollspy-group]");if(c){var u=c.querySelector("[href]");u&&u.classList.add("active")}}this.activeSection=e}},e.prototype.scrollTo=function(t){var e=t.getAttribute("href"),n=document.querySelector(e),o=parseInt((0,r.getClassProperty)(this.el,"--scrollspy-offset","0")),i=parseInt((0,r.getClassProperty)(n,"--scrollspy-offset"))||o,s=this.scrollable===document?0:this.scrollable.offsetTop,l=n.offsetTop-i-s,a=this.scrollable===document?window:this.scrollable,c=function(){window.history.replaceState(null,null,t.getAttribute("href")),"scrollTo"in a&&a.scrollTo({top:l,left:0,behavior:"smooth"})},u=this.fireEvent("beforeScroll",this.el);(0,r.dispatch)("beforeScroll.hs.scrollspy",this.el,this.el),u instanceof Promise?u.then((function(){return c()})):c()},e.getInstance=function(t,e){void 0===e&&(e=!1);var n=window.$hsScrollspyCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.autoInit=function(){window.$hsScrollspyCollection||(window.$hsScrollspyCollection=[]),document.querySelectorAll("[data-hs-scrollspy]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsScrollspyCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){s.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=s),e.default=s},961:function(t,e,n){ /* * HSTogglePassword - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&i[i.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]",o.dropdownClasses=l.dropdownClasses||"absolute top-full z-[1] w-full bg-white border border-gray-200 rounded-md hidden mt-2",o.dropdownItemTemplate=l.dropdownItemTemplate||"
",o.dropdownItemTemplatesByType=l.dropdownItemTemplatesByType||null,o.dropdownItemClasses=l.dropdownItemClasses||"py-2 px-4 w-full cursor-pointer text-sm hover:bg-gray-300 hover:text-black",o.highlightedTextTagName=l.highlightedTextTagName||"u",o.highlightedTextClasses=l.highlightedTextClasses||"bg-green-200",o.jsonUrl&&o.fetchData().then((function(){return o.init()})),o}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsSearchByJsonCollection,this),this.buildDropdown(),this.el.addEventListener("input",(0,a.debounce)((function(e){t.val=e.target.value,t.val.length>t.minChars?t.searchData(t.val):t.result=[],t.result.length?t.dropdown.classList.remove("hidden"):t.dropdown.classList.add("hidden"),t.buildItems(),console.log("result:",t.result)})))},e.prototype.fetchData=function(){return s(this,void 0,void 0,(function(){var t=this;return l(this,(function(e){switch(e.label){case 0:return[4,fetch(this.jsonUrl).then((function(t){return t.json()})).then((function(e){return t.json=e}))];case 1:return e.sent(),[2]}}))}))},e.prototype.searchData=function(t){this.result=this.json.filter((function(e){var n=t.toLowerCase(),o=e.title.toLowerCase(),i=e.description.toLowerCase();return o.includes(n)||i.includes(n)}))},e.prototype.buildDropdown=function(){this.dropdown=(0,a.htmlToElement)(this.dropdownTemplate),this.dropdownClasses&&(0,a.classToClassList)(this.dropdownClasses,this.dropdown),this.el.after(this.dropdown)},e.prototype.buildItems=function(){var t=this;this.dropdown.innerHTML="",this.result.forEach((function(e){var n=(0,a.htmlToElement)(''));n.append(t.itemTemplate(e)),t.dropdown.append(n)}))},e.prototype.itemTemplate=function(t){var e=new RegExp(this.val,"gi"),n=t.title.replace(e,"<".concat(this.highlightedTextTagName,' class="inline-block ').concat(this.highlightedTextClasses,'">').concat(this.val,"")),o=t.description.replace(e,"<".concat(this.highlightedTextTagName,' class="inline-block ').concat(this.highlightedTextClasses,'">').concat(this.val,"")),i=this.dropdownItemTemplatesByType?this.dropdownItemTemplatesByType.find((function(e){return e.type===t.type})):null,r=i?(0,a.htmlToElement)(i.markup):(0,a.htmlToElement)(this.dropdownItemTemplate);this.dropdownItemClasses&&(0,a.classToClassList)(this.dropdownItemClasses,r);var s=r.querySelector("[data-title]");s?s.append((0,a.htmlToElement)("".concat(n,""))):r.append((0,a.htmlToElement)("".concat(n,"")));var l=r.querySelector("[data-description]");if(l)l.append((0,a.htmlToElement)("".concat(o,"")));else if(!i){var c=(0,a.htmlToElement)("
");r.append(c),r.append((0,a.htmlToElement)("".concat(o,"")))}return r},e.getInstance=function(t){var e=window.$hsSearchByJsonCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return e?e.element:null},e.autoInit=function(){window.$hsSearchByJsonCollection||(window.$hsSearchByJsonCollection=[]),document.querySelectorAll("[data-hs-search-by-json]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsSearchByJsonCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){c.autoInit()})),"undefined"!=typeof window&&(window.HSSearchByJson=c),e.default=c},233:function(t,e,n){ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&i[i.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]",o.dropdownClasses=l.dropdownClasses||"absolute top-full z-[1] w-full bg-white border border-gray-200 rounded-md hidden mt-2",o.dropdownItemTemplate=l.dropdownItemTemplate||"
",o.dropdownItemTemplatesByType=l.dropdownItemTemplatesByType||null,o.dropdownItemClasses=l.dropdownItemClasses||"py-2 px-4 w-full cursor-pointer text-sm hover:bg-gray-300 hover:text-black",o.highlightedTextTagName=l.highlightedTextTagName||"u",o.highlightedTextClasses=l.highlightedTextClasses||"bg-green-200",o.jsonUrl&&o.fetchData().then((function(){return o.init()})),o}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsSearchByJsonCollection,this),this.buildDropdown(),this.el.addEventListener("input",(0,a.debounce)((function(e){t.val=e.target.value,t.val.length>t.minChars?t.searchData(t.val):t.result=[],t.result.length?t.dropdown.classList.remove("hidden"):t.dropdown.classList.add("hidden"),t.buildItems()})))},e.prototype.fetchData=function(){return s(this,void 0,void 0,(function(){var t=this;return l(this,(function(e){switch(e.label){case 0:return[4,fetch(this.jsonUrl).then((function(t){return t.json()})).then((function(e){return t.json=e}))];case 1:return e.sent(),[2]}}))}))},e.prototype.searchData=function(t){this.result=this.json.filter((function(e){var n=t.toLowerCase(),o=e.title.toLowerCase(),i=e.description.toLowerCase();return o.includes(n)||i.includes(n)}))},e.prototype.buildDropdown=function(){this.dropdown=(0,a.htmlToElement)(this.dropdownTemplate),this.dropdownClasses&&(0,a.classToClassList)(this.dropdownClasses,this.dropdown),this.el.after(this.dropdown)},e.prototype.buildItems=function(){var t=this;this.dropdown.innerHTML="",this.result.forEach((function(e){var n=(0,a.htmlToElement)(''));n.append(t.itemTemplate(e)),t.dropdown.append(n)}))},e.prototype.itemTemplate=function(t){var e=new RegExp(this.val,"gi"),n=t.title.replace(e,"<".concat(this.highlightedTextTagName,' class="inline-block ').concat(this.highlightedTextClasses,'">').concat(this.val,"")),o=t.description.replace(e,"<".concat(this.highlightedTextTagName,' class="inline-block ').concat(this.highlightedTextClasses,'">').concat(this.val,"")),i=this.dropdownItemTemplatesByType?this.dropdownItemTemplatesByType.find((function(e){return e.type===t.type})):null,r=i?(0,a.htmlToElement)(i.markup):(0,a.htmlToElement)(this.dropdownItemTemplate);this.dropdownItemClasses&&(0,a.classToClassList)(this.dropdownItemClasses,r);var s=r.querySelector("[data-title]");s?s.append((0,a.htmlToElement)("".concat(n,""))):r.append((0,a.htmlToElement)("".concat(n,"")));var l=r.querySelector("[data-description]");if(l)l.append((0,a.htmlToElement)("".concat(o,"")));else if(!i){var c=(0,a.htmlToElement)("
");r.append(c),r.append((0,a.htmlToElement)("".concat(o,"")))}return r},e.getInstance=function(t){var e=window.$hsSearchByJsonCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return e?e.element:null},e.autoInit=function(){window.$hsSearchByJsonCollection||(window.$hsSearchByJsonCollection=[]),document.querySelectorAll("[data-hs-search-by-json]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsSearchByJsonCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){c.autoInit()})),"undefined"!=typeof window&&(window.HSSearchByJson=c),e.default=c},233:function(t,e,n){ /* * HSSelect - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n"),e=this.toggle.querySelector("[data-icon]"),n=this.toggle.querySelector("[data-title]"),!this.isMultiple&&e&&this.setToggleIcon(),!this.isMultiple&&n&&this.setToggleTitle(),this.isMultiple?this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder:this.toggleTextWrapper.innerHTML=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder,n||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,l.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),this.toggle.addEventListener("click",(function(){if(o.isDisabled)return!1;o.isOpened?o.close():o.open()}))},e.prototype.setToggleIcon=function(){var t,e,n=this.toggle.querySelector("[data-icon]");if(n.innerHTML="",n){var o=(0,l.htmlToElement)((null===(e=null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.options)||void 0===e?void 0:e.icon)||"");n.append(o),o?n.classList.remove("hidden"):n.classList.add("hidden")}},e.prototype.setToggleTitle=function(){var t,e=this.toggle.querySelector("[data-title]");if(e.classList.add("truncate"),e.innerHTML="",e){var n=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder;e.innerHTML=n,this.toggle.append(e)}},e.prototype.buildTags=function(){this.tags=document.createElement("div"),this.tags.classList.add("flex"),this.tagsClasses&&(0,l.classToClassList)(this.tagsClasses,this.tags),this.buildTagsInput(),this.buildTagsItems(),this.setTagsItems(),this.wrapper&&this.wrapper.append(this.tags)},e.prototype.buildTagsItems=function(){this.tagsItems=document.createElement("div"),this.tagsItems.classList.add("flex","flex-wrap","flex-0","items-center"),this.setTagsItems(),this.tags.append(this.tagsItems)},e.prototype.buildTagsItem=function(t){var e,n,o,i,r,s,a,c=this,u=this.getItemByValue(t),d=document.createElement("div");if(this.tagsItemClasses&&(0,l.classToClassList)(this.tagsItemClasses,d),this.tagsItemTemplate&&(i=(0,l.htmlToElement)(this.tagsItemTemplate),d.append(i)),null===(e=null==u?void 0:u.options)||void 0===e?void 0:e.icon){var p=(0,l.htmlToElement)(null===(n=null==u?void 0:u.options)||void 0===n?void 0:n.icon);(a=i?i.querySelector("[data-icon]"):document.createElement("span")).append(p),i||d.append(a)}i&&i.querySelector("[data-icon]")&&!(null===(o=null==u?void 0:u.options)||void 0===o?void 0:o.icon)&&i.querySelector("[data-icon]").classList.add("hidden"),(r=i?i.querySelector("[data-title]"):document.createElement("span")).textContent=u.title||"",i||d.append(r),i?s=i.querySelector("[data-remove]"):((s=document.createElement("span")).textContent="X",d.append(s)),s.addEventListener("click",(function(){c.value=c.value.filter((function(e){return e!==t})),c.unselectMultipleItems(),c.setTagsItems(),c.selectMultipleItems()})),this.tagsItems.append(d)},e.prototype.getItemByValue=function(t){return this.selectOptions.find((function(e){return e.val===t}))},e.prototype.setTagsItems=function(){var t=this;this.tagsItems.innerHTML="",this.value&&(this.value.forEach((function(e){t.buildTagsItem(e)})),this.tagsInput.readOnly=!0),this.value.length||(this.tagsInput.placeholder=this.placeholder,this.tagsInput.readOnly=!1)},e.prototype.buildTagsInput=function(){var t=this;this.tagsInput=document.createElement("input"),this.tagsInput.placeholder=this.placeholder,this.tagsInputClasses&&(0,l.classToClassList)(this.tagsInputClasses,this.tagsInput),this.tagsInput.addEventListener("focus",(function(){return t.open()})),this.tagsInput.addEventListener("input",(0,l.debounce)((function(e){return t.searchOptions(e.target.value)}))),this.tagsInput.addEventListener("keydown",(function(e){if("Enter"===e.key&&t.isAddTagOnEnter){var n=e.target.value;if(t.selectOptions.find((function(t){return t.val===n})))return!1;t.addSelectOption(n,n),t.buildOption(n,n),t.dropdown.querySelector('[data-value="'.concat(n,'"]')).click(),t.resetTagsInputField(),t.close()}})),this.tags.append(this.tagsInput)},e.prototype.buildDropdown=function(){var t=this;this.dropdown=(0,l.htmlToElement)(this.dropdownTag||"
"),this.dropdown.classList.add("absolute","top-full"),this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,l.classToClassList)(this.dropdownClasses,this.dropdown),this.wrapper&&this.wrapper.append(this.dropdown),this.dropdown&&this.hasSearch&&this.buildSearch(),this.selectOptions&&this.selectOptions.forEach((function(e,n){return t.buildOption(e.title,e.val,e.options,"".concat(n))}))},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,l.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,l.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]"),this.search=(0,l.htmlToElement)(''),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,l.classToClassList)(this.searchClasses,this.search),this.search.addEventListener("input",(0,l.debounce)((function(t){return e.searchOptions(t.target.value)}))),t?t.append(this.search):this.searchWrapper.append(this.search),this.dropdown.append(this.searchWrapper)},e.prototype.buildOption=function(t,e,n,o){var i=this;void 0===o&&(o="1");var r=null,s=(0,l.htmlToElement)(this.optionTag||"
");if(s.setAttribute("data-value",e),s.setAttribute("data-title-value",t),s.setAttribute("tabIndex",o),s.classList.add("cursor-pointer"),this.optionTemplate&&(r=(0,l.htmlToElement)(this.optionTemplate),s.append(r)),r?r.querySelector("[data-title]").textContent=t||"":s.textContent=t||"",n){if(n.icon){var a=(0,l.htmlToElement)(n.icon);if(a.classList.add("mw-full"),r)r.querySelector("[data-icon]").append(a);else{var c=(0,l.htmlToElement)("
");this.iconClasses&&(0,l.classToClassList)(this.iconClasses,c),c.append(a),s.append(c)}}if(n.description)if(r)r.querySelector("[data-description]").append(n.description);else{var u=(0,l.htmlToElement)("
");u.textContent=n.description,this.descriptionClasses&&(0,l.classToClassList)(this.descriptionClasses,u),s.append(u)}}r&&r.querySelector("[data-icon]")&&!n&&!(null==n?void 0:n.icon)&&r.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&s.classList.add("selected"),s.addEventListener("click",(function(){return i.onSelectOption(e)})),this.optionClasses&&(0,l.classToClassList)(this.optionClasses,s),this.dropdown&&this.dropdown.append(s)},e.prototype.destroyOption=function(t){var e=this.dropdown.querySelector('[data-value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.buildOriginalOption=function(t,e,n){var o=(0,l.htmlToElement)("");o.setAttribute("value",e),o.setAttribute("data-hs-select-option",JSON.stringify(n)),o.innerText=t,this.el.append(o)},e.prototype.destroyOriginalOption=function(t){var e=this.el.querySelector('[value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.onSelectOption=function(t){this.clearSelections(),this.isMultiple?(this.value=this.value.includes(t)?Array.from(this.value).filter((function(e){return e!==t})):s(s([],Array.from(this.value),!0),[t],!1),this.selectMultipleItems(),this.setNewValue()):(this.value=t,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),(0,l.dispatch)("change.hs.select",this.el,this.value),"tags"===this.mode&&this.resetTagsInputField(),this.isMultiple||(this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.close()),this.value.length||"tags"!==this.mode||(this.tagsInput.placeholder=this.placeholder)},e.prototype.addSelectOption=function(t,e,n){this.selectOptions=s(s([],this.selectOptions,!0),[{title:t,val:e,options:n}],!1)},e.prototype.removeSelectOption=function(t){if(!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t}))},e.prototype.resetTagsInputField=function(){this.tagsInput.value="",this.tagsInput.placeholder="",this.searchOptions("")},e.prototype.clearSelections=function(){Array.from(this.dropdown.children).forEach((function(t){t.classList.contains("selected")&&t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){t.selected&&(t.selected=!1)}))},e.prototype.setNewValue=function(){"tags"===this.mode?this.setTagsItems():this.value.length?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.stringFromValue=function(){var t=this,e=[];return this.selectOptions.forEach((function(n){t.isMultiple?t.value.includes(n.val)&&e.push(n.title):t.value===n.val&&e.push(n.title)})),this.toggleCountText&&""!==this.toggleCountText&&e.length>=this.toggleCountTextMinItems?"".concat(e.length," ").concat(this.toggleCountText):e.join(", ")},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0,Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")})).classList.add("selected")},e.prototype.selectMultipleItems=function(){var t=this;Array.from(this.dropdown.children).filter((function(e){return t.value.includes(e.getAttribute("data-value"))})).forEach((function(t){return t.classList.add("selected")})),Array.from(this.el.children).filter((function(e){return t.value.includes(e.value)})).forEach((function(t){return t.selected=!0}))},e.prototype.unselectMultipleItems=function(){Array.from(this.dropdown.children).forEach((function(t){return t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){return t.selected=!1}))},e.prototype.searchOptions=function(t){this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,l.htmlToElement)(""),this.searchNoResult.innerText=this.searchNoResultText,(0,l.classToClassList)(this.searchNoResultClasses,this.searchNoResult);var e=this.dropdown.querySelectorAll("[data-value]"),n=!1;e.forEach((function(e){e.getAttribute("data-title-value").toLowerCase().includes(t.toLowerCase())?(e.classList.remove("hidden"),n=!0):e.classList.add("hidden")})),n||this.dropdown.append(this.searchNoResult)},e.prototype.eraseToggleIcon=function(){var t=this.toggle.querySelector("[data-icon]");t&&(t.innerHTML=null,t.classList.add("hidden"))},e.prototype.eraseToggleTitle=function(){var t=this.toggle.querySelector("[data-title]");t?t.innerHTML=this.placeholder:this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.destroy=function(){var t=this.el.parentElement.parentElement;this.el.classList.remove("hidden"),this.el.style.display="",t.prepend(this.el),t.querySelector(".hs-select").remove(),this.wrapper=null},e.prototype.open=function(){var t=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){t.wrapper.classList.add("active"),t.dropdown.classList.add("opened"),t.hasSearch&&t.search.focus(),t.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,n,o=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,l.afterTransition)(this.dropdown,(function(){o.dropdown.classList.add("hidden"),o.hasSearch&&(o.search.value="",o.search.dispatchEvent(new Event("input",{bubbles:!0})),o.search.blur()),o.animationInProcess=!1})),null===(n=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===n||n.classList.remove("hs-select-option-highlighted"),this.isOpened=!1},e.prototype.addOption=function(t){var e=this,n="".concat(this.selectOptions.length),o=function(t){var o=t.title,i=t.val,r=t.options;!!e.selectOptions.some((function(t){return t.val===i}))||(e.addSelectOption(o,i,r),e.buildOption(o,i,r,n),e.buildOriginalOption(o,i,r))};Array.isArray(t)?t.forEach((function(t){o(t)})):o(t)},e.prototype.removeOption=function(t){var e=this,n=function(t){!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t),e.destroyOption(t),e.destroyOriginalOption(t),e.value===t&&(e.value=null,e.eraseToggleTitle(),e.eraseToggleIcon()))};Array.isArray(t)?t.forEach((function(t){n(t)})):n(t)},e.prototype.recalculateDirection=function(){var t,e,n,o;(0,l.isEnoughSpace)(this.dropdown,this.toggle||this.tagsInput,"bottom",this.dropdownSpace,this.viewport)?(this.dropdown.classList.remove("bottom-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="",this.dropdown.classList.add("top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.add(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="".concat(this.dropdownSpace,"px")):(this.dropdown.classList.remove("top-full"),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.classList.add("bottom-full"),(null===(o=this.dropdownDirectionClasses)||void 0===o?void 0:o.bottom)&&this.dropdown.classList.add(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="".concat(this.dropdownSpace,"px"))},e.getInstance=function(t,e){var n=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsSelectCollection||(window.$hsSelectCollection=[]),document.querySelectorAll("[data-hs-select]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsSelectCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-select"),o=n?JSON.parse(n):{};new e(t,o)}})),window.$hsSelectCollection&&(window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.close=function(t){var e=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.isOpened&&e.element.close()},e.closeCurrentlyOpened=function(t){if(void 0===t&&(t=null),!t.closest(".hs-select.active")){var e=window.$hsSelectCollection.filter((function(t){return t.element.isOpened}))||null;e&&e.forEach((function(t){t.element.close()}))}},e.accessibility=function(t){var e=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));if(e&&c.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(console.log(e),console.log("Key code:",t.code),t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Tab":t.preventDefault(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}},e.onEscape=function(){var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.close()},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));if(e){var n=e.element.dropdown;if(!n)return!1;var o=(t?Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var r=o.findIndex((function(t){return t===i}));r+1 *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var r=o.findIndex((function(t){return t===i}));if(!(r+1 *:not(.hidden)")):Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");o.length&&(o[0].focus(),i&&i.classList.remove("hs-select-option-highlighted"),o[0].classList.add("hs-select-option-highlighted"))}},e.onEnter=function(t){var e=t.target.previousSibling;if(window.$hsSelectCollection.find((function(t){return t.element.el===e}))){var n=window.$hsSelectCollection.find((function(t){return t.element.isOpened})),o=window.$hsSelectCollection.find((function(t){return t.element.el===e}));n.element.close(),o.element.open()}else{(o=window.$hsSelectCollection.find((function(t){return t.element.isOpened})))&&o.element.onSelectOption(t.target.dataset.value||"")}},e}(a.default);window.addEventListener("load",(function(){u.autoInit()})),document.addEventListener("scroll",(function(){if(!window.$hsSelectCollection)return!1;var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSSelect=u),e.default=u},957:function(t,e,n){ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n"),e=this.toggle.querySelector("[data-icon]"),n=this.toggle.querySelector("[data-title]"),!this.isMultiple&&e&&this.setToggleIcon(),!this.isMultiple&&n&&this.setToggleTitle(),this.isMultiple?this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder:this.toggleTextWrapper.innerHTML=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder,n||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,l.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),this.toggle.addEventListener("click",(function(){if(o.isDisabled)return!1;o.isOpened?o.close():o.open()}))},e.prototype.setToggleIcon=function(){var t,e,n=this.toggle.querySelector("[data-icon]");if(n.innerHTML="",n){var o=(0,l.htmlToElement)((null===(e=null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.options)||void 0===e?void 0:e.icon)||"");n.append(o),o?n.classList.remove("hidden"):n.classList.add("hidden")}},e.prototype.setToggleTitle=function(){var t,e=this.toggle.querySelector("[data-title]");if(e.classList.add("truncate"),e.innerHTML="",e){var n=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder;e.innerHTML=n,this.toggle.append(e)}},e.prototype.buildTags=function(){this.buildTagsInput(),this.setTagsItems()},e.prototype.reassignTagsInputPlaceholder=function(t){this.tagsInput.placeholder=t,this.tagsInputHelper.innerHTML=t,this.calculateInputWidth()},e.prototype.buildTagsItem=function(t){var e,n,o,i,r,s,a,c=this,u=this.getItemByValue(t),d=document.createElement("div");if(d.setAttribute("data-tag-value",t),this.tagsItemClasses&&(0,l.classToClassList)(this.tagsItemClasses,d),this.tagsItemTemplate&&(i=(0,l.htmlToElement)(this.tagsItemTemplate),d.append(i)),null===(e=null==u?void 0:u.options)||void 0===e?void 0:e.icon){var p=(0,l.htmlToElement)(null===(n=null==u?void 0:u.options)||void 0===n?void 0:n.icon);(a=i?i.querySelector("[data-icon]"):document.createElement("span")).append(p),i||d.append(a)}i&&i.querySelector("[data-icon]")&&!(null===(o=null==u?void 0:u.options)||void 0===o?void 0:o.icon)&&i.querySelector("[data-icon]").classList.add("hidden"),(r=i?i.querySelector("[data-title]"):document.createElement("span")).textContent=u.title||"",i||d.append(r),i?s=i.querySelector("[data-remove]"):((s=document.createElement("span")).textContent="X",d.append(s)),s.addEventListener("click",(function(){c.value=c.value.filter((function(e){return e!==t})),c.selectedItems=c.selectedItems.filter((function(e){return e!==t})),c.value.length||c.reassignTagsInputPlaceholder(c.placeholder),c.unselectMultipleItems(),c.selectMultipleItems(),d.remove()})),this.wrapper.append(d)},e.prototype.getItemByValue=function(t){return this.selectOptions.find((function(e){return e.val===t}))},e.prototype.setTagsItems=function(){var t=this;this.value&&this.value.forEach((function(e){t.selectedItems.includes(e)||t.buildTagsItem(e),t.selectedItems=t.selectedItems.includes(e)?t.selectedItems:s(s([],t.selectedItems,!0),[e],!1)}))},e.prototype.buildTagsInput=function(){var t=this;this.tagsInput=document.createElement("input"),this.tagsInputClasses&&(0,l.classToClassList)(this.tagsInputClasses,this.tagsInput),this.tagsInput.addEventListener("focus",(function(){return t.open()})),this.tagsInput.addEventListener("input",(function(){return t.calculateInputWidth()})),this.tagsInput.addEventListener("input",(0,l.debounce)((function(e){return t.searchOptions(e.target.value)}))),this.tagsInput.addEventListener("keydown",(function(e){if("Enter"===e.key&&t.isAddTagOnEnter){var n=e.target.value;if(t.selectOptions.find((function(t){return t.val===n})))return!1;t.addSelectOption(n,n),t.buildOption(n,n),t.dropdown.querySelector('[data-value="'.concat(n,'"]')).click(),t.resetTagsInputField()}})),this.wrapper.append(this.tagsInput),setTimeout((function(){t.adjustInputWidth(),t.reassignTagsInputPlaceholder(t.value.length?"":t.placeholder)}))},e.prototype.buildDropdown=function(){var t=this;this.dropdown=(0,l.htmlToElement)(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),this.dropdown.classList.add("absolute","top-full"),this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,l.classToClassList)(this.dropdownClasses,this.dropdown),this.wrapper&&this.wrapper.append(this.dropdown),this.dropdown&&this.hasSearch&&this.buildSearch(),this.selectOptions&&this.selectOptions.forEach((function(e,n){return t.buildOption(e.title,e.val,e.options,"".concat(n))}))},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,l.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,l.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]"),this.search=(0,l.htmlToElement)(''),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,l.classToClassList)(this.searchClasses,this.search),this.search.addEventListener("input",(0,l.debounce)((function(t){return e.searchOptions(t.target.value)}))),t?t.append(this.search):this.searchWrapper.append(this.search),this.dropdown.append(this.searchWrapper)},e.prototype.buildOption=function(t,e,n,o){var i=this;void 0===o&&(o="1");var r=null,s=(0,l.htmlToElement)(this.optionTag||"
");if(s.setAttribute("data-value",e),s.setAttribute("data-title-value",t),s.setAttribute("tabIndex",o),s.classList.add("cursor-pointer"),this.optionTemplate&&(r=(0,l.htmlToElement)(this.optionTemplate),s.append(r)),r?r.querySelector("[data-title]").textContent=t||"":s.textContent=t||"",n){if(n.icon){var a=(0,l.htmlToElement)(n.icon);if(a.classList.add("mw-full"),r)r.querySelector("[data-icon]").append(a);else{var c=(0,l.htmlToElement)("
");this.iconClasses&&(0,l.classToClassList)(this.iconClasses,c),c.append(a),s.append(c)}}if(n.description)if(r)r.querySelector("[data-description]").append(n.description);else{var u=(0,l.htmlToElement)("
");u.textContent=n.description,this.descriptionClasses&&(0,l.classToClassList)(this.descriptionClasses,u),s.append(u)}}r&&r.querySelector("[data-icon]")&&!n&&!(null==n?void 0:n.icon)&&r.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&s.classList.add("selected"),s.addEventListener("click",(function(){return i.onSelectOption(e)})),this.optionClasses&&(0,l.classToClassList)(this.optionClasses,s),this.dropdown&&this.dropdown.append(s)},e.prototype.destroyOption=function(t){var e=this.dropdown.querySelector('[data-value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.buildOriginalOption=function(t,e,n){var o=(0,l.htmlToElement)("");o.setAttribute("value",e),o.setAttribute("data-hs-select-option",JSON.stringify(n)),o.innerText=t,this.el.append(o)},e.prototype.destroyOriginalOption=function(t){var e=this.el.querySelector('[value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.buildTagsInputHelper=function(){this.tagsInputHelper=document.createElement("span"),this.tagsInputHelper.style.fontSize=window.getComputedStyle(this.tagsInput).fontSize,this.tagsInputHelper.style.fontFamily=window.getComputedStyle(this.tagsInput).fontFamily,this.tagsInputHelper.style.fontWeight=window.getComputedStyle(this.tagsInput).fontWeight,this.tagsInputHelper.style.letterSpacing=window.getComputedStyle(this.tagsInput).letterSpacing,this.tagsInputHelper.style.visibility="hidden",this.tagsInputHelper.style.whiteSpace="pre",this.tagsInputHelper.style.position="absolute",this.wrapper.appendChild(this.tagsInputHelper)},e.prototype.calculateInputWidth=function(){this.tagsInputHelper.textContent=this.tagsInput.value||this.tagsInput.placeholder;var t=parseInt(window.getComputedStyle(this.tagsInput).paddingLeft)+parseInt(window.getComputedStyle(this.tagsInput).paddingRight),e=parseInt(window.getComputedStyle(this.tagsInput).borderLeftWidth)+parseInt(window.getComputedStyle(this.tagsInput).borderRightWidth),n=this.tagsInputHelper.offsetWidth+t+e,o=this.wrapper.offsetWidth-(parseInt(window.getComputedStyle(this.wrapper).paddingLeft)+parseInt(window.getComputedStyle(this.wrapper).paddingRight));this.tagsInput.style.width="".concat(Math.min(n,o)+2,"px")},e.prototype.adjustInputWidth=function(){this.buildTagsInputHelper(),this.calculateInputWidth()},e.prototype.onSelectOption=function(t){var e=this;if(this.clearSelections(),this.isMultiple?(this.value=this.value.includes(t)?Array.from(this.value).filter((function(e){return e!==t})):s(s([],Array.from(this.value),!0),[t],!1),this.selectMultipleItems(),this.setNewValue()):(this.value=t,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),(0,l.dispatch)("change.hs.select",this.el,this.value),"tags"===this.mode){var n=this.selectedItems.filter((function(t){return!e.value.includes(t)}));n.length&&n.forEach((function(t){e.selectedItems=e.selectedItems.filter((function(e){return e!==t})),e.wrapper.querySelector('[data-tag-value="'.concat(t,'"]')).remove()})),this.resetTagsInputField()}this.isMultiple||(this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.close()),this.value.length||"tags"!==this.mode||this.reassignTagsInputPlaceholder(this.placeholder),this.isOpened&&"tags"===this.mode&&this.tagsInput&&this.tagsInput.focus()},e.prototype.addSelectOption=function(t,e,n){this.selectOptions=s(s([],this.selectOptions,!0),[{title:t,val:e,options:n}],!1)},e.prototype.removeSelectOption=function(t){if(!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t}))},e.prototype.resetTagsInputField=function(){this.tagsInput.value="",this.reassignTagsInputPlaceholder(""),this.searchOptions("")},e.prototype.clearSelections=function(){Array.from(this.dropdown.children).forEach((function(t){t.classList.contains("selected")&&t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){t.selected&&(t.selected=!1)}))},e.prototype.setNewValue=function(){"tags"===this.mode?this.setTagsItems():this.value.length?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.stringFromValue=function(){var t=this,e=[];return this.selectOptions.forEach((function(n){t.isMultiple?t.value.includes(n.val)&&e.push(n.title):t.value===n.val&&e.push(n.title)})),this.toggleCountText&&""!==this.toggleCountText&&e.length>=this.toggleCountTextMinItems?"".concat(e.length," ").concat(this.toggleCountText):e.join(", ")},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0,Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")})).classList.add("selected")},e.prototype.selectMultipleItems=function(){var t=this;Array.from(this.dropdown.children).filter((function(e){return t.value.includes(e.getAttribute("data-value"))})).forEach((function(t){return t.classList.add("selected")})),Array.from(this.el.children).filter((function(e){return t.value.includes(e.value)})).forEach((function(t){return t.selected=!0}))},e.prototype.unselectMultipleItems=function(){Array.from(this.dropdown.children).forEach((function(t){return t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){return t.selected=!1}))},e.prototype.searchOptions=function(t){this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,l.htmlToElement)(""),this.searchNoResult.innerText=this.searchNoResultText,(0,l.classToClassList)(this.searchNoResultClasses,this.searchNoResult);var e=this.dropdown.querySelectorAll("[data-value]"),n=!1;e.forEach((function(e){e.getAttribute("data-title-value").toLocaleLowerCase().includes(t.toLocaleLowerCase())?(e.classList.remove("hidden"),n=!0):e.classList.add("hidden")})),n||this.dropdown.append(this.searchNoResult)},e.prototype.eraseToggleIcon=function(){var t=this.toggle.querySelector("[data-icon]");t&&(t.innerHTML=null,t.classList.add("hidden"))},e.prototype.eraseToggleTitle=function(){var t=this.toggle.querySelector("[data-title]");t?t.innerHTML=this.placeholder:this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.destroy=function(){var t=this.el.parentElement.parentElement;this.el.classList.remove("hidden"),this.el.style.display="",t.prepend(this.el),t.querySelector(".hs-select").remove(),this.wrapper=null},e.prototype.open=function(){var t=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){t.wrapper.classList.add("active"),t.dropdown.classList.add("opened"),t.hasSearch&&!t.preventSearchFocus&&t.search.focus(),t.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,n,o=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,l.afterTransition)(this.dropdown,(function(){o.dropdown.classList.add("hidden"),o.hasSearch&&(o.search.value="",o.search.dispatchEvent(new Event("input",{bubbles:!0})),o.search.blur()),o.animationInProcess=!1})),null===(n=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===n||n.classList.remove("hs-select-option-highlighted"),this.isOpened=!1},e.prototype.addOption=function(t){var e=this,n="".concat(this.selectOptions.length),o=function(t){var o=t.title,i=t.val,r=t.options;!!e.selectOptions.some((function(t){return t.val===i}))||(e.addSelectOption(o,i,r),e.buildOption(o,i,r,n),e.buildOriginalOption(o,i,r))};Array.isArray(t)?t.forEach((function(t){o(t)})):o(t)},e.prototype.removeOption=function(t){var e=this,n=function(t){!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t),e.destroyOption(t),e.destroyOriginalOption(t),e.value===t&&(e.value=null,e.eraseToggleTitle(),e.eraseToggleIcon()))};Array.isArray(t)?t.forEach((function(t){n(t)})):n(t)},e.prototype.recalculateDirection=function(){var t,e,n,o;(0,l.isEnoughSpace)(this.dropdown,this.toggle||this.tagsInput,"bottom",this.dropdownSpace,this.viewport)?(this.dropdown.classList.remove("bottom-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="",this.dropdown.classList.add("top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.add(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="".concat(this.dropdownSpace,"px")):(this.dropdown.classList.remove("top-full"),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.classList.add("bottom-full"),(null===(o=this.dropdownDirectionClasses)||void 0===o?void 0:o.bottom)&&this.dropdown.classList.add(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="".concat(this.dropdownSpace,"px"))},e.getInstance=function(t,e){var n=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsSelectCollection||(window.$hsSelectCollection=[]),document.querySelectorAll("[data-hs-select]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsSelectCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-select"),o=n?JSON.parse(n):{};new e(t,o)}})),window.$hsSelectCollection&&(window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.close=function(t){var e=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.isOpened&&e.element.close()},e.closeCurrentlyOpened=function(t){if(void 0===t&&(t=null),!t.closest(".hs-select.active")){var e=window.$hsSelectCollection.filter((function(t){return t.element.isOpened}))||null;e&&e.forEach((function(t){t.element.close()}))}},e.accessibility=function(t){if(window.$hsSelectCollection.find((function(t){return t.element.isOpened}))&&c.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Tab":t.preventDefault(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}},e.onEscape=function(){var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.close()},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));if(e){var n=e.element.dropdown;if(!n)return!1;var o=(t?Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var r=o.findIndex((function(t){return t===i}));r+1 *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var r=o.findIndex((function(t){return t===i}));if(!(r+1 *:not(.hidden)")):Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");o.length&&(o[0].focus(),i&&i.classList.remove("hs-select-option-highlighted"),o[0].classList.add("hs-select-option-highlighted"))}},e.onEnter=function(t){var e=t.target.previousSibling;if(window.$hsSelectCollection.find((function(t){return t.element.el===e}))){var n=window.$hsSelectCollection.find((function(t){return t.element.isOpened})),o=window.$hsSelectCollection.find((function(t){return t.element.el===e}));n.element.close(),o.element.open()}else{(o=window.$hsSelectCollection.find((function(t){return t.element.isOpened})))&&o.element.onSelectOption(t.target.dataset.value||"")}},e}(a.default);window.addEventListener("load",(function(){u.autoInit()})),document.addEventListener("scroll",(function(){if(!window.$hsSelectCollection)return!1;var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSSelect=u),e.default=u},957:function(t,e,n){ /* * HSStepper - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;nt.totalSteps&&(t.totalSteps=n)}))},e.prototype.buildNav=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-nav-item]").forEach((function(e){return t.addNavItem(e)})),this.navItems.forEach((function(e){return t.buildNavItem(e)}))},e.prototype.buildNavItem=function(t){var e=this,n=t.index,o=t.isDisabled,i=t.el;n===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||o)&&i.addEventListener("click",(function(){return e.handleNavItemClick(t)}))},e.prototype.addNavItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-nav-item")),n=e.index,o=e.isFinal,i=void 0!==o&&o,r=e.isCompleted,s=void 0!==r&&r,l=e.isSkip,a=void 0!==l&&l,c=e.isOptional,u=void 0!==c&&c,d=e.isDisabled,p=void 0!==d&&d,h=e.isProcessed,f=void 0!==h&&h,v=e.hasError,m=void 0!==v&&v;s&&t.classList.add("success"),a&&t.classList.add("skipped"),p&&("BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")),m&&t.classList.add("error"),this.navItems.push({index:n,isFinal:i,isCompleted:s,isSkip:a,isOptional:u,isDisabled:p,isProcessed:f,hasError:m,el:t})},e.prototype.setCurrentNavItem=function(){var t=this;this.navItems.forEach((function(e){var n=e.index,o=e.el;n===t.currentIndex?t.setCurrentNavItemActions(o):t.unsetCurrentNavItemActions(o)}))},e.prototype.setCurrentNavItemActions=function(t){t.classList.add("active"),this.fireEvent("active",this.currentIndex),(0,s.dispatch)("active.hs.stepper",this.el,this.currentIndex)},e.prototype.getNavItem=function(t){return void 0===t&&(t=this.currentIndex),this.navItems.find((function(e){return e.index===t}))},e.prototype.setProcessedNavItemActions=function(t){t.isProcessed=!0,t.el.classList.add("processed")},e.prototype.setErrorNavItemActions=function(t){t.hasError=!0,t.el.classList.add("error")},e.prototype.unsetCurrentNavItemActions=function(t){t.classList.remove("active")},e.prototype.handleNavItemClick=function(t){var e=t.index;this.currentIndex=e,this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep()},e.prototype.buildContent=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-content-item]").forEach((function(e){return t.addContentItem(e)})),this.navItems.forEach((function(e){return t.buildContentItem(e)}))},e.prototype.buildContentItem=function(t){t.index===this.currentIndex&&this.setCurrentContentItem()},e.prototype.addContentItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-content-item")),n=e.index,o=e.isFinal,i=void 0!==o&&o,r=e.isCompleted,s=void 0!==r&&r,l=e.isSkip,a=void 0!==l&&l;s&&t.classList.add("success"),a&&t.classList.add("skipped"),this.contentItems.push({index:n,isFinal:i,isCompleted:s,isSkip:a,el:t})},e.prototype.setCurrentContentItem=function(){var t=this;if(this.isCompleted){var e=this.contentItems.find((function(t){return t.isFinal})),n=this.contentItems.filter((function(t){return!t.isFinal}));return e.el.style.display="",n.forEach((function(t){return t.el.style.display="none"})),!1}this.contentItems.forEach((function(e){var n=e.index,o=e.el;n===t.currentIndex?t.setCurrentContentItemActions(o):t.unsetCurrentContentItemActions(o)}))},e.prototype.hideAllContentItems=function(){this.contentItems.forEach((function(t){return t.el.style.display="none"}))},e.prototype.setCurrentContentItemActions=function(t){t.style.display=""},e.prototype.unsetCurrentContentItemActions=function(t){t.style.display="none"},e.prototype.disableAll=function(){var t=this.getNavItem(this.currentIndex);t.hasError=!1,t.isCompleted=!1,t.isDisabled=!1,t.el.classList.remove("error","success"),this.disableButtons()},e.prototype.disableNavItemActions=function(t){t.isDisabled=!0,t.el.classList.add("disabled")},e.prototype.enableNavItemActions=function(t){t.isDisabled=!1,t.el.classList.remove("disabled")},e.prototype.buildButtons=function(){this.backBtn=this.el.querySelector("[data-hs-stepper-back-btn]"),this.nextBtn=this.el.querySelector("[data-hs-stepper-next-btn]"),this.skipBtn=this.el.querySelector("[data-hs-stepper-skip-btn]"),this.completeStepBtn=this.el.querySelector("[data-hs-stepper-complete-step-btn]"),this.finishBtn=this.el.querySelector("[data-hs-stepper-finish-btn]"),this.resetBtn=this.el.querySelector("[data-hs-stepper-reset-btn]"),this.buildBackButton(),this.buildNextButton(),this.buildSkipButton(),this.buildCompleteStepButton(),this.buildFinishButton(),this.buildResetButton()},e.prototype.buildBackButton=function(){var t=this;this.backBtn&&(this.checkForTheFirstStep(),this.backBtn.addEventListener("click",(function(){if(t.handleBackButtonClick(),"linear"===t.mode){var e=t.navItems.find((function(e){return e.index===t.currentIndex})),n=t.contentItems.find((function(e){return e.index===t.currentIndex}));if(!e||!n)return;e.isCompleted&&(e.isCompleted=!1,e.isSkip=!1,e.el.classList.remove("success","skipped")),n.isCompleted&&(n.isCompleted=!1,n.isSkip=!1,n.el.classList.remove("success","skipped")),"linear"===t.mode&&t.currentIndex!==t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display=""),t.completeStepBtn&&(t.completeStepBtn.style.display="")),t.showSkipButton(),t.showFinishButton(),t.showCompleteStepButton()}})))},e.prototype.handleBackButtonClick=function(){1!==this.currentIndex&&("linear"===this.mode&&this.removeOptionalClasses(),this.currentIndex--,"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.fireEvent("back",this.currentIndex),(0,s.dispatch)("back.hs.stepper",this.el,this.currentIndex))},e.prototype.checkForTheFirstStep=function(){1===this.currentIndex?this.setToDisabled(this.backBtn):this.setToNonDisabled(this.backBtn)},e.prototype.setToDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")},e.prototype.setToNonDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled"),t.classList.remove("disabled")},e.prototype.buildNextButton=function(){var t=this;this.nextBtn&&this.nextBtn.addEventListener("click",(function(){var e;if(t.fireEvent("beforeNext",t.currentIndex),(0,s.dispatch)("beforeNext.hs.stepper",t.el,t.currentIndex),null===(e=t.getNavItem(t.currentIndex))||void 0===e?void 0:e.isProcessed)return t.disableAll(),!1;t.goToNext()}))},e.prototype.unsetProcessedNavItemActions=function(t){t.isProcessed=!1,t.el.classList.remove("processed")},e.prototype.handleNextButtonClick=function(t){if(void 0===t&&(t=!0),t)this.currentIndex===this.totalSteps?this.currentIndex=1:this.currentIndex++;else{var e=this.getUncompletedSteps();if(1===e.length){var n=e[0].index;this.currentIndex=n}else{if(this.currentIndex===this.totalSteps)return;this.currentIndex++}}"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton(),this.showFinishButton(),this.showCompleteStepButton(),this.fireEvent("next",this.currentIndex),(0,s.dispatch)("next.hs.stepper",this.el,this.currentIndex)},e.prototype.removeOptionalClasses=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=this.contentItems.find((function(e){return e.index===t.currentIndex}));e.isSkip=!1,e.hasError=!1,e.isDisabled=!1,n.isSkip=!1,e.el.classList.remove("skipped","success","error"),n.el.classList.remove("skipped","success","error")},e.prototype.buildSkipButton=function(){var t=this;this.skipBtn&&(this.showSkipButton(),this.skipBtn.addEventListener("click",(function(){t.handleSkipButtonClick(),"linear"===t.mode&&t.currentIndex===t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display="none"),t.completeStepBtn&&(t.completeStepBtn.style.display="none"),t.finishBtn&&(t.finishBtn.style.display=""))})))},e.prototype.setSkipItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),o=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&o&&(this.setSkipItemActions(n),this.setSkipItemActions(o))},e.prototype.setSkipItemActions=function(t){t.isSkip=!0,t.el.classList.add("skipped")},e.prototype.showSkipButton=function(){var t=this;if(this.skipBtn){var e=this.navItems.find((function(e){return e.index===t.currentIndex})).isOptional;this.skipBtn.style.display=e?"":"none"}},e.prototype.handleSkipButtonClick=function(){this.setSkipItem(),this.handleNextButtonClick(),this.fireEvent("skip",this.currentIndex),(0,s.dispatch)("skip.hs.stepper",this.el,this.currentIndex)},e.prototype.buildCompleteStepButton=function(){var t=this;this.completeStepBtn&&(this.completeStepBtnDefaultText=this.completeStepBtn.innerText,this.completeStepBtn.addEventListener("click",(function(){return t.handleCompleteStepButtonClick()})))},e.prototype.changeTextAndDisableCompleteButtonIfStepCompleted=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=JSON.parse(this.completeStepBtn.getAttribute("data-hs-stepper-complete-step-btn")).completedText;e&&(e.isCompleted?(this.completeStepBtn.innerText=n||this.completeStepBtnDefaultText,this.completeStepBtn.setAttribute("disabled","disabled"),this.completeStepBtn.classList.add("disabled")):(this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")))},e.prototype.setCompleteItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),o=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&o&&(this.setCompleteItemActions(n),this.setCompleteItemActions(o))},e.prototype.setCompleteItemActions=function(t){t.isCompleted=!0,t.el.classList.add("success")},e.prototype.showCompleteStepButton=function(){this.completeStepBtn&&(1===this.getUncompletedSteps().length?this.completeStepBtn.style.display="none":this.completeStepBtn.style.display="")},e.prototype.handleCompleteStepButtonClick=function(){this.setCompleteItem(),this.fireEvent("complete",this.currentIndex),(0,s.dispatch)("complete.hs.stepper",this.el,this.currentIndex),this.handleNextButtonClick(!1),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton()},e.prototype.buildFinishButton=function(){var t=this;this.finishBtn&&(this.isCompleted&&this.setCompleted(),this.finishBtn.addEventListener("click",(function(){return t.handleFinishButtonClick()})))},e.prototype.setCompleted=function(){this.el.classList.add("completed")},e.prototype.unsetCompleted=function(){this.el.classList.remove("completed")},e.prototype.showFinishButton=function(){this.finishBtn&&(1===this.getUncompletedSteps().length?this.finishBtn.style.display="":this.finishBtn.style.display="none")},e.prototype.handleFinishButtonClick=function(){var t=this,e=this.getUncompletedSteps(),n=this.getUncompletedSteps(!0),o=this.contentItems.find((function(t){return t.isFinal})).el;e.length&&e.forEach((function(e){var n=e.index;return t.setCompleteItem(n)})),this.currentIndex=this.totalSteps,this.setCurrentNavItem(),this.hideAllContentItems();var i=this.navItems.find((function(e){return e.index===t.currentIndex}));(i?i.el:null).classList.remove("active"),o.style.display="block",this.backBtn&&(this.backBtn.style.display="none"),this.nextBtn&&(this.nextBtn.style.display="none"),this.skipBtn&&(this.skipBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"),this.finishBtn&&(this.finishBtn.style.display="none"),this.resetBtn&&(this.resetBtn.style.display=""),n.length<=1&&(this.isCompleted=!0,this.setCompleted()),this.fireEvent("finish",this.currentIndex),(0,s.dispatch)("finish.hs.stepper",this.el,this.currentIndex)},e.prototype.buildResetButton=function(){var t=this;this.resetBtn&&this.resetBtn.addEventListener("click",(function(){return t.handleResetButtonClick()}))},e.prototype.handleResetButtonClick=function(){var t=this;this.backBtn&&(this.backBtn.style.display=""),this.nextBtn&&(this.nextBtn.style.display=""),this.completeStepBtn&&(this.completeStepBtn.style.display="",this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")),this.resetBtn&&(this.resetBtn.style.display="none"),this.navItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentNavItemActions(n),n.classList.remove("success","skipped")})),this.contentItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentContentItemActions(n),n.classList.remove("success","skipped")})),this.currentIndex=1,this.setCurrentNavItem(),this.setCurrentContentItem(),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.unsetCompleted(),this.isCompleted=!1,this.fireEvent("reset",this.currentIndex),(0,s.dispatch)("reset.hs.stepper",this.el,this.currentIndex)},e.prototype.setProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.setProcessedNavItemActions(e)},e.prototype.unsetProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.unsetProcessedNavItemActions(e)},e.prototype.goToNext=function(){"linear"===this.mode&&this.setCompleteItem(),this.handleNextButtonClick("linear"!==this.mode),"linear"===this.mode&&this.currentIndex===this.totalSteps&&(this.nextBtn&&(this.nextBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"))},e.prototype.disableButtons=function(){this.backBtn&&this.setToDisabled(this.backBtn),this.nextBtn&&this.setToDisabled(this.nextBtn)},e.prototype.enableButtons=function(){this.backBtn&&this.setToNonDisabled(this.backBtn),this.nextBtn&&this.setToNonDisabled(this.nextBtn)},e.prototype.setErrorNavItem=function(t){var e=this.getNavItem(t);e&&this.setErrorNavItemActions(e)},e.getInstance=function(t,e){var n=window.$hsStepperCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsStepperCollection||(window.$hsStepperCollection=[]),document.querySelectorAll("[data-hs-stepper]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsStepperCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=l),e.default=l},983:function(t,e,n){ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;nt.totalSteps&&(t.totalSteps=n)}))},e.prototype.buildNav=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-nav-item]").forEach((function(e){return t.addNavItem(e)})),this.navItems.forEach((function(e){return t.buildNavItem(e)}))},e.prototype.buildNavItem=function(t){var e=this,n=t.index,o=t.isDisabled,i=t.el;n===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||o)&&i.addEventListener("click",(function(){return e.handleNavItemClick(t)}))},e.prototype.addNavItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-nav-item")),n=e.index,o=e.isFinal,i=void 0!==o&&o,r=e.isCompleted,s=void 0!==r&&r,l=e.isSkip,a=void 0!==l&&l,c=e.isOptional,u=void 0!==c&&c,d=e.isDisabled,p=void 0!==d&&d,h=e.isProcessed,f=void 0!==h&&h,m=e.hasError,v=void 0!==m&&m;s&&t.classList.add("success"),a&&t.classList.add("skipped"),p&&("BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")),v&&t.classList.add("error"),this.navItems.push({index:n,isFinal:i,isCompleted:s,isSkip:a,isOptional:u,isDisabled:p,isProcessed:f,hasError:v,el:t})},e.prototype.setCurrentNavItem=function(){var t=this;this.navItems.forEach((function(e){var n=e.index,o=e.el;n===t.currentIndex?t.setCurrentNavItemActions(o):t.unsetCurrentNavItemActions(o)}))},e.prototype.setCurrentNavItemActions=function(t){t.classList.add("active"),this.fireEvent("active",this.currentIndex),(0,s.dispatch)("active.hs.stepper",this.el,this.currentIndex)},e.prototype.getNavItem=function(t){return void 0===t&&(t=this.currentIndex),this.navItems.find((function(e){return e.index===t}))},e.prototype.setProcessedNavItemActions=function(t){t.isProcessed=!0,t.el.classList.add("processed")},e.prototype.setErrorNavItemActions=function(t){t.hasError=!0,t.el.classList.add("error")},e.prototype.unsetCurrentNavItemActions=function(t){t.classList.remove("active")},e.prototype.handleNavItemClick=function(t){var e=t.index;this.currentIndex=e,this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep()},e.prototype.buildContent=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-content-item]").forEach((function(e){return t.addContentItem(e)})),this.navItems.forEach((function(e){return t.buildContentItem(e)}))},e.prototype.buildContentItem=function(t){t.index===this.currentIndex&&this.setCurrentContentItem()},e.prototype.addContentItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-content-item")),n=e.index,o=e.isFinal,i=void 0!==o&&o,r=e.isCompleted,s=void 0!==r&&r,l=e.isSkip,a=void 0!==l&&l;s&&t.classList.add("success"),a&&t.classList.add("skipped"),this.contentItems.push({index:n,isFinal:i,isCompleted:s,isSkip:a,el:t})},e.prototype.setCurrentContentItem=function(){var t=this;if(this.isCompleted){var e=this.contentItems.find((function(t){return t.isFinal})),n=this.contentItems.filter((function(t){return!t.isFinal}));return e.el.style.display="",n.forEach((function(t){return t.el.style.display="none"})),!1}this.contentItems.forEach((function(e){var n=e.index,o=e.el;n===t.currentIndex?t.setCurrentContentItemActions(o):t.unsetCurrentContentItemActions(o)}))},e.prototype.hideAllContentItems=function(){this.contentItems.forEach((function(t){return t.el.style.display="none"}))},e.prototype.setCurrentContentItemActions=function(t){t.style.display=""},e.prototype.unsetCurrentContentItemActions=function(t){t.style.display="none"},e.prototype.disableAll=function(){var t=this.getNavItem(this.currentIndex);t.hasError=!1,t.isCompleted=!1,t.isDisabled=!1,t.el.classList.remove("error","success"),this.disableButtons()},e.prototype.disableNavItemActions=function(t){t.isDisabled=!0,t.el.classList.add("disabled")},e.prototype.enableNavItemActions=function(t){t.isDisabled=!1,t.el.classList.remove("disabled")},e.prototype.buildButtons=function(){this.backBtn=this.el.querySelector("[data-hs-stepper-back-btn]"),this.nextBtn=this.el.querySelector("[data-hs-stepper-next-btn]"),this.skipBtn=this.el.querySelector("[data-hs-stepper-skip-btn]"),this.completeStepBtn=this.el.querySelector("[data-hs-stepper-complete-step-btn]"),this.finishBtn=this.el.querySelector("[data-hs-stepper-finish-btn]"),this.resetBtn=this.el.querySelector("[data-hs-stepper-reset-btn]"),this.buildBackButton(),this.buildNextButton(),this.buildSkipButton(),this.buildCompleteStepButton(),this.buildFinishButton(),this.buildResetButton()},e.prototype.buildBackButton=function(){var t=this;this.backBtn&&(this.checkForTheFirstStep(),this.backBtn.addEventListener("click",(function(){if(t.handleBackButtonClick(),"linear"===t.mode){var e=t.navItems.find((function(e){return e.index===t.currentIndex})),n=t.contentItems.find((function(e){return e.index===t.currentIndex}));if(!e||!n)return;e.isCompleted&&(e.isCompleted=!1,e.isSkip=!1,e.el.classList.remove("success","skipped")),n.isCompleted&&(n.isCompleted=!1,n.isSkip=!1,n.el.classList.remove("success","skipped")),"linear"===t.mode&&t.currentIndex!==t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display=""),t.completeStepBtn&&(t.completeStepBtn.style.display="")),t.showSkipButton(),t.showFinishButton(),t.showCompleteStepButton()}})))},e.prototype.handleBackButtonClick=function(){1!==this.currentIndex&&("linear"===this.mode&&this.removeOptionalClasses(),this.currentIndex--,"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.fireEvent("back",this.currentIndex),(0,s.dispatch)("back.hs.stepper",this.el,this.currentIndex))},e.prototype.checkForTheFirstStep=function(){1===this.currentIndex?this.setToDisabled(this.backBtn):this.setToNonDisabled(this.backBtn)},e.prototype.setToDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")},e.prototype.setToNonDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled"),t.classList.remove("disabled")},e.prototype.buildNextButton=function(){var t=this;this.nextBtn&&this.nextBtn.addEventListener("click",(function(){var e;if(t.fireEvent("beforeNext",t.currentIndex),(0,s.dispatch)("beforeNext.hs.stepper",t.el,t.currentIndex),null===(e=t.getNavItem(t.currentIndex))||void 0===e?void 0:e.isProcessed)return t.disableAll(),!1;t.goToNext()}))},e.prototype.unsetProcessedNavItemActions=function(t){t.isProcessed=!1,t.el.classList.remove("processed")},e.prototype.handleNextButtonClick=function(t){if(void 0===t&&(t=!0),t)this.currentIndex===this.totalSteps?this.currentIndex=1:this.currentIndex++;else{var e=this.getUncompletedSteps();if(1===e.length){var n=e[0].index;this.currentIndex=n}else{if(this.currentIndex===this.totalSteps)return;this.currentIndex++}}"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton(),this.showFinishButton(),this.showCompleteStepButton(),this.fireEvent("next",this.currentIndex),(0,s.dispatch)("next.hs.stepper",this.el,this.currentIndex)},e.prototype.removeOptionalClasses=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=this.contentItems.find((function(e){return e.index===t.currentIndex}));e.isSkip=!1,e.hasError=!1,e.isDisabled=!1,n.isSkip=!1,e.el.classList.remove("skipped","success","error"),n.el.classList.remove("skipped","success","error")},e.prototype.buildSkipButton=function(){var t=this;this.skipBtn&&(this.showSkipButton(),this.skipBtn.addEventListener("click",(function(){t.handleSkipButtonClick(),"linear"===t.mode&&t.currentIndex===t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display="none"),t.completeStepBtn&&(t.completeStepBtn.style.display="none"),t.finishBtn&&(t.finishBtn.style.display=""))})))},e.prototype.setSkipItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),o=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&o&&(this.setSkipItemActions(n),this.setSkipItemActions(o))},e.prototype.setSkipItemActions=function(t){t.isSkip=!0,t.el.classList.add("skipped")},e.prototype.showSkipButton=function(){var t=this;if(this.skipBtn){var e=this.navItems.find((function(e){return e.index===t.currentIndex})).isOptional;this.skipBtn.style.display=e?"":"none"}},e.prototype.handleSkipButtonClick=function(){this.setSkipItem(),this.handleNextButtonClick(),this.fireEvent("skip",this.currentIndex),(0,s.dispatch)("skip.hs.stepper",this.el,this.currentIndex)},e.prototype.buildCompleteStepButton=function(){var t=this;this.completeStepBtn&&(this.completeStepBtnDefaultText=this.completeStepBtn.innerText,this.completeStepBtn.addEventListener("click",(function(){return t.handleCompleteStepButtonClick()})))},e.prototype.changeTextAndDisableCompleteButtonIfStepCompleted=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=JSON.parse(this.completeStepBtn.getAttribute("data-hs-stepper-complete-step-btn")).completedText;e&&(e.isCompleted?(this.completeStepBtn.innerText=n||this.completeStepBtnDefaultText,this.completeStepBtn.setAttribute("disabled","disabled"),this.completeStepBtn.classList.add("disabled")):(this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")))},e.prototype.setCompleteItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),o=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&o&&(this.setCompleteItemActions(n),this.setCompleteItemActions(o))},e.prototype.setCompleteItemActions=function(t){t.isCompleted=!0,t.el.classList.add("success")},e.prototype.showCompleteStepButton=function(){this.completeStepBtn&&(1===this.getUncompletedSteps().length?this.completeStepBtn.style.display="none":this.completeStepBtn.style.display="")},e.prototype.handleCompleteStepButtonClick=function(){this.setCompleteItem(),this.fireEvent("complete",this.currentIndex),(0,s.dispatch)("complete.hs.stepper",this.el,this.currentIndex),this.handleNextButtonClick(!1),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton()},e.prototype.buildFinishButton=function(){var t=this;this.finishBtn&&(this.isCompleted&&this.setCompleted(),this.finishBtn.addEventListener("click",(function(){return t.handleFinishButtonClick()})))},e.prototype.setCompleted=function(){this.el.classList.add("completed")},e.prototype.unsetCompleted=function(){this.el.classList.remove("completed")},e.prototype.showFinishButton=function(){this.finishBtn&&(1===this.getUncompletedSteps().length?this.finishBtn.style.display="":this.finishBtn.style.display="none")},e.prototype.handleFinishButtonClick=function(){var t=this,e=this.getUncompletedSteps(),n=this.getUncompletedSteps(!0),o=this.contentItems.find((function(t){return t.isFinal})).el;e.length&&e.forEach((function(e){var n=e.index;return t.setCompleteItem(n)})),this.currentIndex=this.totalSteps,this.setCurrentNavItem(),this.hideAllContentItems();var i=this.navItems.find((function(e){return e.index===t.currentIndex}));(i?i.el:null).classList.remove("active"),o.style.display="block",this.backBtn&&(this.backBtn.style.display="none"),this.nextBtn&&(this.nextBtn.style.display="none"),this.skipBtn&&(this.skipBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"),this.finishBtn&&(this.finishBtn.style.display="none"),this.resetBtn&&(this.resetBtn.style.display=""),n.length<=1&&(this.isCompleted=!0,this.setCompleted()),this.fireEvent("finish",this.currentIndex),(0,s.dispatch)("finish.hs.stepper",this.el,this.currentIndex)},e.prototype.buildResetButton=function(){var t=this;this.resetBtn&&this.resetBtn.addEventListener("click",(function(){return t.handleResetButtonClick()}))},e.prototype.handleResetButtonClick=function(){var t=this;this.backBtn&&(this.backBtn.style.display=""),this.nextBtn&&(this.nextBtn.style.display=""),this.completeStepBtn&&(this.completeStepBtn.style.display="",this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")),this.resetBtn&&(this.resetBtn.style.display="none"),this.navItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentNavItemActions(n),n.classList.remove("success","skipped")})),this.contentItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentContentItemActions(n),n.classList.remove("success","skipped")})),this.currentIndex=1,this.setCurrentNavItem(),this.setCurrentContentItem(),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.unsetCompleted(),this.isCompleted=!1,this.fireEvent("reset",this.currentIndex),(0,s.dispatch)("reset.hs.stepper",this.el,this.currentIndex)},e.prototype.setProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.setProcessedNavItemActions(e)},e.prototype.unsetProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.unsetProcessedNavItemActions(e)},e.prototype.goToNext=function(){"linear"===this.mode&&this.setCompleteItem(),this.handleNextButtonClick("linear"!==this.mode),"linear"===this.mode&&this.currentIndex===this.totalSteps&&(this.nextBtn&&(this.nextBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"))},e.prototype.disableButtons=function(){this.backBtn&&this.setToDisabled(this.backBtn),this.nextBtn&&this.setToDisabled(this.nextBtn)},e.prototype.enableButtons=function(){this.backBtn&&this.setToNonDisabled(this.backBtn),this.nextBtn&&this.setToNonDisabled(this.nextBtn)},e.prototype.setErrorNavItem=function(t){var e=this.getNavItem(t);e&&this.setErrorNavItemActions(e)},e.getInstance=function(t,e){var n=window.$hsStepperCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsStepperCollection||(window.$hsStepperCollection=[]),document.querySelectorAll("[data-hs-stepper]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsStepperCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=l),e.default=l},983:function(t,e,n){ /* * HSStrongPassword - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -121,15 +129,15 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n?@[\\\\\\]^_`{|}~",o.target&&o.init(),o}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsStrongPasswordCollection,this),this.availableChecks.length&&this.build()},e.prototype.build=function(){var t=this;this.buildStrips(),this.hints&&this.buildHints(),this.setStrength(this.target.value),this.target.addEventListener("input",(function(e){t.setStrength(e.target.value)}))},e.prototype.buildStrips=function(){if(this.el.innerHTML="",this.stripClasses)for(var t=0;t");(0,s.classToClassList)(this.stripClasses,e),this.el.append(e)}},e.prototype.buildHints=function(){var t=this;this.weakness=this.hints.querySelector("[data-hs-strong-password-hints-weakness-text]")||null,this.rules=Array.from(this.hints.querySelectorAll("[data-hs-strong-password-hints-rule-text]"))||null,this.rules.forEach((function(e){var n,o=e.getAttribute("data-hs-strong-password-hints-rule-text");(null===(n=t.checksExclude)||void 0===n?void 0:n.includes(o))&&e.remove()})),this.weakness&&this.buildWeakness(),this.rules&&this.buildRules(),"popover"===this.mode&&(this.target.addEventListener("focus",(function(){t.isOpened=!0,t.hints.classList.remove("hidden"),t.hints.classList.add("block"),t.recalculateDirection()})),this.target.addEventListener("blur",(function(){t.isOpened=!1,t.hints.classList.remove("block","bottom-full","top-full"),t.hints.classList.add("hidden"),t.hints.style.marginTop="",t.hints.style.marginBottom=""})))},e.prototype.buildWeakness=function(){var t=this;this.checkStrength(this.target.value),this.setWeaknessText(),this.target.addEventListener("input",(function(){return setTimeout((function(){return t.setWeaknessText()}))}))},e.prototype.buildRules=function(){var t=this;this.setRulesText(),this.target.addEventListener("input",(function(){return setTimeout((function(){return t.setRulesText()}))}))},e.prototype.setWeaknessText=function(){var t=this.weakness.getAttribute("data-hs-strong-password-hints-weakness-text"),e=JSON.parse(t);this.weakness.textContent=e[this.strength]},e.prototype.setRulesText=function(){var t=this;this.rules.forEach((function(e){var n=e.getAttribute("data-hs-strong-password-hints-rule-text");t.checkIfPassed(e,t.passedRules.has(n))}))},e.prototype.togglePopover=function(){var t=this.el.querySelector(".popover");t&&t.classList.toggle("show")},e.prototype.checkStrength=function(t){var e=new Set,n={lowercase:/[a-z]+/,uppercase:/[A-Z]+/,numbers:/[0-9]+/,"special-characters":new RegExp("[".concat(this.specialCharactersSet,"]"))},o=0;return this.availableChecks.includes("lowercase")&&t.match(n.lowercase)&&(o+=1,e.add("lowercase")),this.availableChecks.includes("uppercase")&&t.match(n.uppercase)&&(o+=1,e.add("uppercase")),this.availableChecks.includes("numbers")&&t.match(n.numbers)&&(o+=1,e.add("numbers")),this.availableChecks.includes("special-characters")&&t.match(n["special-characters"])&&(o+=1,e.add("special-characters")),this.availableChecks.includes("min-length")&&t.length>=this.minLength&&(o+=1,e.add("min-length")),t.length||(o=0),o===this.availableChecks.length?this.el.classList.add("accepted"):this.el.classList.remove("accepted"),this.strength=o,this.passedRules=e,{strength:this.strength,rules:this.passedRules}},e.prototype.checkIfPassed=function(t,e){void 0===e&&(e=!1);var n=t.querySelector("[data-check]"),o=t.querySelector("[data-uncheck]");e?(t.classList.add("active"),n.classList.remove("hidden"),o.classList.add("hidden")):(t.classList.remove("active"),n.classList.add("hidden"),o.classList.remove("hidden"))},e.prototype.setStrength=function(t){var e=this.checkStrength(t),n=e.strength,o={strength:n,rules:e.rules};this.hideStrips(n),this.fireEvent("change",o),(0,s.dispatch)("change.hs.strongPassword",this.el,o)},e.prototype.hideStrips=function(t){Array.from(this.el.children).forEach((function(e,n){n1&&!!o.el.closest("[data-hs-toggle-password-group]"),o.target&&o.init(),o}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsTogglePasswordCollection,this),this.isShown?this.show():this.hide(),this.el.addEventListener(this.eventType,(function(){t.isShown?t.hide():t.show(),t.fireEvent("toggle",t.target),(0,s.dispatch)("toggle.hs.toggle-select",t.el,t.target)}))},e.prototype.getMultipleToggles=function(){var t=this.el.closest("[data-hs-toggle-password-group]").querySelectorAll("[data-hs-toggle-password]"),n=[];return t.forEach((function(t){n.push(e.getInstance(t))})),n},e.prototype.show=function(){this.isMultiple?(this.getMultipleToggles().forEach((function(t){return!!t&&(t.isShown=!0)})),this.el.closest("[data-hs-toggle-password-group]").classList.add("active")):(this.isShown=!0,this.el.classList.add("active"));this.target.forEach((function(t){t.type="text"}))},e.prototype.hide=function(){this.isMultiple?(this.getMultipleToggles().forEach((function(t){return!!t&&(t.isShown=!1)})),this.el.closest("[data-hs-toggle-password-group]").classList.remove("active")):(this.isShown=!1,this.el.classList.remove("active"));this.target.forEach((function(t){t.type="password"}))},e.getInstance=function(t,e){var n=window.$hsTogglePasswordCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsTogglePasswordCollection||(window.$hsTogglePasswordCollection=[]),document.querySelectorAll("[data-hs-toggle-password]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsTogglePasswordCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=l),e.default=l},679:function(t,e,n){ /* * HSTooltip - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n{Object.defineProperty(e,"__esModule",{value:!0}),e.COLLECTIONS=void 0;var o=n(413),i=n(460),r=n(629),s=n(652),l=n(610),a=n(371),c=n(770),u=n(659),d=n(139),p=n(591),h=n(233),f=n(957),v=n(983),m=n(949),y=n(87),g=n(366),w=n(679);e.COLLECTIONS=[{key:"copy-markup",fn:o.default},{key:"accordion",fn:i.default},{key:"carousel",fn:r.default},{key:"collapse",fn:s.default},{key:"dropdown",fn:l.default},{key:"input-number",fn:a.default},{key:"overlay",fn:c.default},{key:"pin-input",fn:u.default},{key:"remove-element",fn:d.default},{key:"scrollspy",fn:p.default},{key:"select",fn:h.default},{key:"stepper",fn:f.default},{key:"strong-password",fn:v.default},{key:"tabs",fn:m.default},{key:"toggle-count",fn:y.default},{key:"toggle-password",fn:g.default},{key:"tooltip",fn:w.default}]},313:(t,e,n)=>{ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n{Object.defineProperty(e,"__esModule",{value:!0}),e.COLLECTIONS=void 0;var o=n(413),i=n(460),r=n(629),s=n(652),l=n(23),a=n(610),c=n(371),u=n(770),d=n(659),p=n(139),h=n(591),f=n(233),m=n(957),v=n(983),y=n(949),g=n(87),w=n(366),b=n(679);e.COLLECTIONS=[{key:"copy-markup",fn:o.default},{key:"accordion",fn:i.default},{key:"carousel",fn:r.default},{key:"collapse",fn:s.default},{key:"combobox",fn:l.default},{key:"dropdown",fn:a.default},{key:"input-number",fn:c.default},{key:"overlay",fn:u.default},{key:"pin-input",fn:d.default},{key:"remove-element",fn:p.default},{key:"scrollspy",fn:h.default},{key:"select",fn:f.default},{key:"stepper",fn:m.default},{key:"strong-password",fn:v.default},{key:"tabs",fn:y.default},{key:"toggle-count",fn:g.default},{key:"toggle-password",fn:w.default},{key:"tooltip",fn:b.default}]},313:(t,e,n)=>{ /* * HSStaticMethods - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -Object.defineProperty(e,"__esModule",{value:!0});var o=n(969),i=n(362),r={getClassProperty:o.getClassProperty,afterTransition:o.afterTransition,autoInit:function(t){void 0===t&&(t="all"),"all"===t?i.COLLECTIONS.forEach((function(t){var e=t.fn;null==e||e.autoInit()})):i.COLLECTIONS.forEach((function(e){var n=e.key,o=e.fn;t.includes(n)&&(null==o||o.autoInit())}))}};"undefined"!=typeof window&&(window.HSStaticMethods=r),e.default=r},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=void 0;e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,l=window.innerHeight,a=s?r.top-s.top:r.top,c=(i?s.bottom:l)-r.bottom,u=t.clientHeight+o;return"bottom"===n?c>=u:"top"===n?a>=u:a>=u||c>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.HSStaticMethods=t.HSTooltip=t.HSTogglePassword=t.HSToggleCount=t.HSThemeSwitch=t.HSTabs=t.HSStrongPassword=t.HSStepper=t.HSSelect=t.HSScrollspy=t.HSSearchByJson=t.HSRemoveElement=t.HSPinInput=t.HSOverlay=t.HSInputNumber=t.HSDropdown=t.HSCollapse=t.HSCarousel=t.HSAccordion=t.HSCopyMarkup=void 0;var e=n(413);Object.defineProperty(t,"HSCopyMarkup",{enumerable:!0,get:function(){return e.default}});var i=n(460);Object.defineProperty(t,"HSAccordion",{enumerable:!0,get:function(){return i.default}});var r=n(629);Object.defineProperty(t,"HSCarousel",{enumerable:!0,get:function(){return r.default}});var s=n(652);Object.defineProperty(t,"HSCollapse",{enumerable:!0,get:function(){return s.default}});var l=n(610);Object.defineProperty(t,"HSDropdown",{enumerable:!0,get:function(){return l.default}});var a=n(371);Object.defineProperty(t,"HSInputNumber",{enumerable:!0,get:function(){return a.default}});var c=n(770);Object.defineProperty(t,"HSOverlay",{enumerable:!0,get:function(){return c.default}});var u=n(659);Object.defineProperty(t,"HSPinInput",{enumerable:!0,get:function(){return u.default}});var d=n(139);Object.defineProperty(t,"HSRemoveElement",{enumerable:!0,get:function(){return d.default}});var p=n(961);Object.defineProperty(t,"HSSearchByJson",{enumerable:!0,get:function(){return p.default}});var h=n(591);Object.defineProperty(t,"HSScrollspy",{enumerable:!0,get:function(){return h.default}});var f=n(233);Object.defineProperty(t,"HSSelect",{enumerable:!0,get:function(){return f.default}});var v=n(957);Object.defineProperty(t,"HSStepper",{enumerable:!0,get:function(){return v.default}});var m=n(983);Object.defineProperty(t,"HSStrongPassword",{enumerable:!0,get:function(){return m.default}});var y=n(949);Object.defineProperty(t,"HSTabs",{enumerable:!0,get:function(){return y.default}});var g=n(557);Object.defineProperty(t,"HSThemeSwitch",{enumerable:!0,get:function(){return g.default}});var w=n(87);Object.defineProperty(t,"HSToggleCount",{enumerable:!0,get:function(){return w.default}});var b=n(366);Object.defineProperty(t,"HSTogglePassword",{enumerable:!0,get:function(){return b.default}});var C=n(679);Object.defineProperty(t,"HSTooltip",{enumerable:!0,get:function(){return C.default}});var S=n(313);Object.defineProperty(t,"HSStaticMethods",{enumerable:!0,get:function(){return S.default}})})(),o})())); \ No newline at end of file +Object.defineProperty(e,"__esModule",{value:!0});var o=n(969),i=n(362),r={getClassProperty:o.getClassProperty,afterTransition:o.afterTransition,autoInit:function(t){void 0===t&&(t="all"),"all"===t?i.COLLECTIONS.forEach((function(t){var e=t.fn;null==e||e.autoInit()})):i.COLLECTIONS.forEach((function(e){var n=e.key,o=e.fn;t.includes(n)&&(null==o||o.autoInit())}))}};"undefined"!=typeof window&&(window.HSStaticMethods=r),e.default=r},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0;e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,l=window.innerHeight,a=s?r.top-s.top:r.top,c=(i?s.bottom:l)-r.bottom,u=t.clientHeight+o;return"bottom"===n?c>=u:"top"===n?a>=u:a>=u||c>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.HSStaticMethods=t.HSTooltip=t.HSTogglePassword=t.HSToggleCount=t.HSThemeSwitch=t.HSTabs=t.HSStrongPassword=t.HSStepper=t.HSSelect=t.HSScrollspy=t.HSSearchByJson=t.HSRemoveElement=t.HSPinInput=t.HSOverlay=t.HSInputNumber=t.HSDropdown=t.HSComboBox=t.HSCollapse=t.HSCarousel=t.HSAccordion=t.HSCopyMarkup=void 0;var e=n(413);Object.defineProperty(t,"HSCopyMarkup",{enumerable:!0,get:function(){return e.default}});var i=n(460);Object.defineProperty(t,"HSAccordion",{enumerable:!0,get:function(){return i.default}});var r=n(629);Object.defineProperty(t,"HSCarousel",{enumerable:!0,get:function(){return r.default}});var s=n(652);Object.defineProperty(t,"HSCollapse",{enumerable:!0,get:function(){return s.default}});var l=n(23);Object.defineProperty(t,"HSComboBox",{enumerable:!0,get:function(){return l.default}});var a=n(610);Object.defineProperty(t,"HSDropdown",{enumerable:!0,get:function(){return a.default}});var c=n(371);Object.defineProperty(t,"HSInputNumber",{enumerable:!0,get:function(){return c.default}});var u=n(770);Object.defineProperty(t,"HSOverlay",{enumerable:!0,get:function(){return u.default}});var d=n(659);Object.defineProperty(t,"HSPinInput",{enumerable:!0,get:function(){return d.default}});var p=n(139);Object.defineProperty(t,"HSRemoveElement",{enumerable:!0,get:function(){return p.default}});var h=n(961);Object.defineProperty(t,"HSSearchByJson",{enumerable:!0,get:function(){return h.default}});var f=n(591);Object.defineProperty(t,"HSScrollspy",{enumerable:!0,get:function(){return f.default}});var m=n(233);Object.defineProperty(t,"HSSelect",{enumerable:!0,get:function(){return m.default}});var v=n(957);Object.defineProperty(t,"HSStepper",{enumerable:!0,get:function(){return v.default}});var y=n(983);Object.defineProperty(t,"HSStrongPassword",{enumerable:!0,get:function(){return y.default}});var g=n(949);Object.defineProperty(t,"HSTabs",{enumerable:!0,get:function(){return g.default}});var w=n(557);Object.defineProperty(t,"HSThemeSwitch",{enumerable:!0,get:function(){return w.default}});var b=n(87);Object.defineProperty(t,"HSToggleCount",{enumerable:!0,get:function(){return b.default}});var C=n(366);Object.defineProperty(t,"HSTogglePassword",{enumerable:!0,get:function(){return C.default}});var S=n(679);Object.defineProperty(t,"HSTooltip",{enumerable:!0,get:function(){return S.default}});var x=n(313);Object.defineProperty(t,"HSStaticMethods",{enumerable:!0,get:function(){return x.default}})})(),o})())); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 0d823cc..ff2caf5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "preline", - "version": "2.0.3", + "version": "2.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "preline", - "version": "2.0.3", + "version": "2.1.0", "license": "MIT", "dependencies": { "@popperjs/core": "^2.11.2" @@ -15,25 +15,12 @@ "dts-bundle-generator": "^9.0.0", "prettier": "^3.0.0", "source-map-loader": "^4.0.1", - "tailwindcss": "^3.4.1", "terser-webpack-plugin": "^5.3.9", "ts-loader": "^9.4.2", "typescript": "^5.0.2", "webpack-cli": "^5.0.1" } }, - "node_modules/@alloc/quick-lru": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", - "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", @@ -43,102 +30,6 @@ "node": ">=10.0.0" } }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", @@ -197,51 +88,6 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, - "optional": true, - "engines": { - "node": ">=14" - } - }, "node_modules/@popperjs/core": { "version": "2.11.8", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", @@ -592,55 +438,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", - "dev": true - }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/arg": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", - "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", - "dev": true - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", @@ -692,15 +489,6 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, - "node_modules/camelcase-css": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", - "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, "node_modules/caniuse-lite": { "version": "1.0.30001570", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz", @@ -750,45 +538,6 @@ "node": ">=8" } }, - "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/chokidar/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/chrome-trace-event": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", @@ -871,30 +620,6 @@ "node": ">= 8" } }, - "node_modules/cssesc": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", - "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", - "dev": true, - "bin": { - "cssesc": "bin/cssesc" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/didyoumean": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", - "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", - "dev": true - }, - "node_modules/dlv": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", - "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", - "dev": true - }, "node_modules/dts-bundle-generator": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/dts-bundle-generator/-/dts-bundle-generator-9.0.0.tgz", @@ -911,12 +636,6 @@ "node": ">=14.0.0" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, "node_modules/electron-to-chromium": { "version": "1.4.613", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.613.tgz", @@ -1034,34 +753,6 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, - "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -1077,15 +768,6 @@ "node": ">= 4.9.1" } }, - "node_modules/fastq": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.16.0.tgz", - "integrity": "sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -1120,36 +802,6 @@ "flat": "cli.js" } }, - "node_modules/foreground-child": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", - "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -1168,40 +820,6 @@ "node": "6.* || 8.* || >= 10.*" } }, - "node_modules/glob": { - "version": "10.3.10", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", - "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", - "dev": true, - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^2.3.5", - "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, "node_modules/glob-to-regexp": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", @@ -1276,18 +894,6 @@ "node": ">=10.13.0" } }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/is-core-module": { "version": "2.13.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", @@ -1300,15 +906,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -1318,18 +915,6 @@ "node": ">=8" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -1366,24 +951,6 @@ "node": ">=0.10.0" } }, - "node_modules/jackspeak": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", - "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", - "dev": true, - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, "node_modules/jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", @@ -1398,15 +965,6 @@ "node": ">= 10.13.0" } }, - "node_modules/jiti": { - "version": "1.21.0", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz", - "integrity": "sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==", - "dev": true, - "bin": { - "jiti": "bin/jiti.js" - } - }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -1429,21 +987,6 @@ "node": ">=0.10.0" } }, - "node_modules/lilconfig": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", - "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true - }, "node_modules/loader-runner": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", @@ -1484,15 +1027,6 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, "node_modules/micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", @@ -1529,63 +1063,10 @@ "node": ">= 0.6" } }, - "node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/minipass": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", - "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", - "dev": true, - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "dev": true, - "dependencies": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, - "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true, "peer": true }, @@ -1596,33 +1077,6 @@ "dev": true, "peer": true }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-hash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", - "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, "node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -1683,36 +1137,12 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, - "node_modules/path-scurry": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", - "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", - "dev": true, - "dependencies": { - "lru-cache": "^9.1.1 || ^10.0.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.1.0.tgz", - "integrity": "sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==", - "dev": true, - "engines": { - "node": "14 || >=16.14" - } - }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/picomatch": { "version": "2.3.1", @@ -1726,24 +1156,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pirates": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", - "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, "node_modules/pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -1756,152 +1168,6 @@ "node": ">=8" } }, - "node_modules/postcss": { - "version": "8.4.33", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.33.tgz", - "integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/postcss-import": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", - "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", - "dev": true, - "dependencies": { - "postcss-value-parser": "^4.0.0", - "read-cache": "^1.0.0", - "resolve": "^1.1.7" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "postcss": "^8.0.0" - } - }, - "node_modules/postcss-js": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.0.1.tgz", - "integrity": "sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==", - "dev": true, - "dependencies": { - "camelcase-css": "^2.0.1" - }, - "engines": { - "node": "^12 || ^14 || >= 16" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - "peerDependencies": { - "postcss": "^8.4.21" - } - }, - "node_modules/postcss-load-config": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.2.tgz", - "integrity": "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "lilconfig": "^3.0.0", - "yaml": "^2.3.4" - }, - "engines": { - "node": ">= 14" - }, - "peerDependencies": { - "postcss": ">=8.0.9", - "ts-node": ">=9.0.0" - }, - "peerDependenciesMeta": { - "postcss": { - "optional": true - }, - "ts-node": { - "optional": true - } - } - }, - "node_modules/postcss-load-config/node_modules/lilconfig": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", - "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/postcss-nested": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.0.1.tgz", - "integrity": "sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==", - "dev": true, - "dependencies": { - "postcss-selector-parser": "^6.0.11" - }, - "engines": { - "node": ">=12.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - "peerDependencies": { - "postcss": "^8.2.14" - } - }, - "node_modules/postcss-selector-parser": { - "version": "6.0.15", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.15.tgz", - "integrity": "sha512-rEYkQOMUCEMhsKbK66tbEU9QVIxbhN18YiniAwA7XQYTVBqrBy+P2p5JcdqsHgKM2zWylp8d7J6eszocfds5Sw==", - "dev": true, - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-value-parser": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", - "dev": true - }, "node_modules/prettier": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.1.tgz", @@ -1926,26 +1192,6 @@ "node": ">=6" } }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -1955,27 +1201,6 @@ "safe-buffer": "^5.1.0" } }, - "node_modules/read-cache": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", - "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", - "dev": true, - "dependencies": { - "pify": "^2.3.0" - } - }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, "node_modules/rechoir": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", @@ -2035,39 +1260,6 @@ "node": ">=8" } }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -2169,18 +1361,6 @@ "node": ">=8" } }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -2244,21 +1424,6 @@ "node": ">=8" } }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -2271,50 +1436,6 @@ "node": ">=8" } }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/sucrase": { - "version": "3.35.0", - "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz", - "integrity": "sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==", - "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.2", - "commander": "^4.0.0", - "glob": "^10.3.10", - "lines-and-columns": "^1.1.6", - "mz": "^2.7.0", - "pirates": "^4.0.1", - "ts-interface-checker": "^0.1.9" - }, - "bin": { - "sucrase": "bin/sucrase", - "sucrase-node": "bin/sucrase-node" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/sucrase/node_modules/commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, "node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -2342,43 +1463,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tailwindcss": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.1.tgz", - "integrity": "sha512-qAYmXRfk3ENzuPBakNK0SRrUDipP8NQnEY6772uDhflcQz5EhRdD7JNZxyrFHVQNCwULPBn6FNPp9brpO7ctcA==", - "dev": true, - "dependencies": { - "@alloc/quick-lru": "^5.2.0", - "arg": "^5.0.2", - "chokidar": "^3.5.3", - "didyoumean": "^1.2.2", - "dlv": "^1.1.3", - "fast-glob": "^3.3.0", - "glob-parent": "^6.0.2", - "is-glob": "^4.0.3", - "jiti": "^1.19.1", - "lilconfig": "^2.1.0", - "micromatch": "^4.0.5", - "normalize-path": "^3.0.0", - "object-hash": "^3.0.0", - "picocolors": "^1.0.0", - "postcss": "^8.4.23", - "postcss-import": "^15.1.0", - "postcss-js": "^4.0.1", - "postcss-load-config": "^4.0.1", - "postcss-nested": "^6.0.1", - "postcss-selector-parser": "^6.0.11", - "resolve": "^1.22.2", - "sucrase": "^3.32.0" - }, - "bin": { - "tailwind": "lib/cli.js", - "tailwindcss": "lib/cli.js" - }, - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -2440,27 +1524,6 @@ } } }, - "node_modules/thenify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", - "dev": true, - "dependencies": { - "any-promise": "^1.0.0" - } - }, - "node_modules/thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", - "dev": true, - "dependencies": { - "thenify": ">= 3.1.0 < 4" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -2473,12 +1536,6 @@ "node": ">=8.0" } }, - "node_modules/ts-interface-checker": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", - "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", - "dev": true - }, "node_modules/ts-loader": { "version": "9.5.1", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.5.1.tgz", @@ -2567,12 +1624,6 @@ "punycode": "^2.1.0" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, "node_modules/watchpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", @@ -2751,24 +1802,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -2784,15 +1817,6 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, - "node_modules/yaml": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", - "dev": true, - "engines": { - "node": ">= 14" - } - }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", diff --git a/package.json b/package.json index 32cff38..051aaf9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "preline", - "version": "2.0.3", + "version": "2.1.0", "description": "Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.", "main": "index.js", "module": "./src/index.ts", @@ -48,7 +48,6 @@ "dts-bundle-generator": "^9.0.0", "prettier": "^3.0.0", "source-map-loader": "^4.0.1", - "tailwindcss": "^3.4.1", "terser-webpack-plugin": "^5.3.9", "ts-loader": "^9.4.2", "typescript": "^5.0.2", @@ -57,4 +56,4 @@ "dependencies": { "@popperjs/core": "^2.11.2" } -} +} \ No newline at end of file diff --git a/plugin.js b/plugin.js index 1e623b8..0d8ab9a 100644 --- a/plugin.js +++ b/plugin.js @@ -1,6 +1,6 @@ /* * Plugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @requires: tailwindcss ^3.1.2 * @license: Licensed under MIT (https://preline.co/docs/license.html) @@ -129,6 +129,23 @@ module.exports = plugin(function ({ addVariant, e }) { }, ]); + addVariant('hs-overlay-layout-open', [ + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `.hs-overlay-body-open.${e( + `hs-overlay-layout-open${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `.hs-overlay-body-open .${e( + `hs-overlay-layout-open${separator}${className}`, + )}`; + }); + }, + ]); + addVariant('hs-overlay-backdrop-open', [ ({ modifySelectors, separator }) => { modifySelectors(({ className }) => { @@ -208,6 +225,19 @@ module.exports = plugin(function ({ addVariant, e }) { }, ]); + addVariant('hs-select-active', [ + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `.active.${e(`hs-select-active${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `.active .${e(`hs-select-active${separator}${className}`)}`; + }); + }, + ]); + addVariant('hs-input-number-disabled', [ ({ modifySelectors, separator }) => { modifySelectors(({ className }) => { @@ -386,6 +416,40 @@ module.exports = plugin(function ({ addVariant, e }) { } ]); + addVariant('hs-combo-box-active', [ + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `.active .${e(`hs-combo-box-active${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `.active.${e(`hs-combo-box-active${separator}${className}`)}`; + }); + }, + ]); + + addVariant('hs-combo-box-selected', [ + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `.selected .${e(`hs-combo-box-selected${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `.selected.${e(`hs-combo-box-selected${separator}${className}`)}`; + }); + }, + ]); + + addVariant('hs-combo-box-tab-active', [ + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `.active.${e(`hs-combo-box-tab-active${separator}${className}`)}`; + }); + }, + ]); + addVariant('hs-apexcharts-tooltip-dark', [ ({ modifySelectors, separator }) => { modifySelectors(({ className }) => { diff --git a/preline.d.ts b/preline.d.ts index c0821f3..4a5bc11 100644 --- a/preline.d.ts +++ b/preline.d.ts @@ -1,4 +1,5 @@ + export interface ICopyMarkupOptions { targetSelector: string; wrapperSelector: string; @@ -131,6 +132,112 @@ export declare class HSCollapse extends HSBasePlugin<{}> implements ICollapse { static hide(target: HTMLElement): void; static on(evt: string, target: HTMLElement, cb: Function): void; } +export interface IComboBoxOptions { + gap?: number; + viewport?: string | HTMLElement | null; + preventVisibility?: boolean; + apiUrl?: string | null; + apiDataPart?: string | null; + apiQuery?: string | null; + apiSearchQuery?: string | null; + apiHeaders?: {}; + apiGroupField?: string | null; + outputItemTemplate?: string | null; + outputEmptyTemplate?: string | null; + outputLoaderTemplate?: string | null; + groupingType?: "default" | "tabs" | null; + groupingTitleTemplate?: string | null; + tabsWrapperTemplate?: string | null; + preventSelection?: boolean; + isOpenOnFocus?: boolean; +} +export interface IComboBox { + options?: IComboBoxOptions; + open(): void; + close(): void; + recalculateDirection(): void; +} +export declare class HSComboBox extends HSBasePlugin implements IComboBox { + gap: number; + viewport: string | HTMLElement | null; + preventVisibility: boolean; + apiUrl: string | null; + apiDataPart: string | null; + apiQuery: string | null; + apiSearchQuery: string | null; + apiHeaders: {}; + apiGroupField: string | null; + outputItemTemplate: string | null; + outputEmptyTemplate: string | null; + outputLoaderTemplate: string | null; + groupingType: "default" | "tabs" | null; + groupingTitleTemplate: string | null; + tabsWrapperTemplate: string | null; + preventSelection: boolean; + isOpenOnFocus: boolean; + private readonly input; + private readonly output; + private readonly itemsWrapper; + private items; + private tabs; + private readonly toggle; + private outputPlaceholder; + private outputLoader; + private value; + private selected; + private groups; + private selectedGroup; + isOpened: boolean; + isCurrent: boolean; + private animationInProcess; + constructor(el: HTMLElement, options?: IComboBoxOptions); + private init; + private build; + private setResultAndRender; + private buildInput; + private buildItems; + private setResults; + private isItemExists; + private isTextExists; + private isTextExistsAny; + private valuesBySelector; + private buildOutputLoader; + private destroyOutputLoader; + private itemsFromJson; + private jsonItemsRender; + private setGroups; + setCurrent(): void; + private setApiGroups; + private sortItems; + private itemRender; + private plainRender; + private groupTabsRender; + private groupDefaultRender; + private itemsFromHtml; + private buildToggle; + private setSelectedByValue; + private setValue; + private setItemsVisibility; + private hasVisibleItems; + private appendItemsToWrapper; + private buildOutputPlaceholder; + private destroyOutputPlaceholder; + private resultItems; + private setValueAndOpen; + open(val?: string): boolean; + private setValueAndClear; + close(val?: string | null): boolean; + recalculateDirection(): void; + static getInstance(target: HTMLElement | string, isInstance?: boolean): HSComboBox | ICollectionItem; + static autoInit(): void; + static close(target: HTMLElement | string): void; + static closeCurrentlyOpened(evtTarget?: HTMLElement | null): void; + static accessibility(evt: KeyboardEvent): void; + static onEscape(): void; + static onArrow(isArrowUp?: boolean): boolean; + static onStartEnd(isStart?: boolean): boolean; + static onEnter(evt: Event): void; +} export interface IDropdown { options?: {}; open(): void; @@ -172,6 +279,9 @@ export declare class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> imp static on(evt: string, target: HTMLElement, cb: Function): void; } export interface IInputNumberOptions { + min?: number; + max?: number; + step?: number; } export interface IInputNumber { options?: IInputNumberOptions; @@ -181,6 +291,9 @@ export declare class HSInputNumber extends HSBasePlugin imp private readonly increment; private readonly decrement; private inputValue; + private readonly minInputValue; + private readonly maxInputValue; + private readonly step; constructor(el: HTMLElement, options?: IInputNumberOptions); private init; private build; @@ -214,10 +327,13 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private autoHide; private readonly overlayId; overlay: HTMLElement | null; - isCloseWhenClickInside: string; - isTabAccessibilityLimited: string; - hasAutofocus: string; - hasAbilityToCloseOnBackdropClick: string; + isCloseWhenClickInside: boolean; + isTabAccessibilityLimited: boolean; + isLayoutAffect: boolean; + hasAutofocus: boolean; + hasAbilityToCloseOnBackdropClick: boolean; + openedBreakpoint: number | null; + autoClose: number | null; constructor(el: HTMLElement, options?: IOverlayOptions, events?: {}); private init; private hideAuto; @@ -226,11 +342,12 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private destroyBackdrop; private focusElement; open(): false | Promise; - close(): Promise; + close(forceClose?: boolean): Promise; static getInstance(target: HTMLElement, isInstance?: boolean): HTMLElement | ICollectionItem; static autoInit(): void; static open(target: HTMLElement): void; static close(target: HTMLElement): void; + static setOpened(breakpoint: number, el: ICollectionItem): void; static accessibility(evt: KeyboardEvent): boolean; static onEscape(target: ICollectionItem): void; static onTab(target: ICollectionItem, focusableElements: HTMLElement[]): boolean; @@ -353,13 +470,14 @@ export interface ISelectOptions { isOpened?: boolean; placeholder?: string; hasSearch?: boolean; + preventSearchFocus?: boolean; mode?: string; viewport?: string; + wrapperClasses?: string; toggleTag?: string; toggleClasses?: string; toggleCountText?: string; toggleCountTextMinItems?: number; - tagsClasses?: string; tagsItemTemplate?: string; tagsItemClasses?: string; tagsInputClasses?: string; @@ -370,6 +488,7 @@ export interface ISelectOptions { bottom?: string; }; dropdownSpace: number; + extraMarkup?: string | string[] | null; searchWrapperTemplate?: string; searchClasses?: string; searchWrapperClasses?: string; @@ -396,16 +515,18 @@ export declare class HSSelect extends HSBasePlugin implements IS value: string | string[] | null; private readonly placeholder; private readonly hasSearch; + private readonly preventSearchFocus; private readonly mode; private readonly viewport; isOpened: boolean | null; isMultiple: boolean | null; isDisabled: boolean | null; + selectedItems: string[]; private readonly toggleTag; private readonly toggleClasses; private readonly toggleCountText; private readonly toggleCountTextMinItems; - private readonly tagsClasses; + private readonly wrapperClasses; private readonly tagsItemTemplate; private readonly tagsItemClasses; private readonly tagsInputClasses; @@ -428,24 +549,25 @@ export declare class HSSelect extends HSBasePlugin implements IS private wrapper; private toggle; private toggleTextWrapper; - private tags; - private tagsItems; private tagsInput; private dropdown; private searchWrapper; private search; private searchNoResult; private selectOptions; + private extraMarkup; private readonly isAddTagOnEnter; + private tagsInputHelper; constructor(el: HTMLElement, options?: ISelectOptions); private init; private build; private buildWrapper; + private buildExtraMarkup; private buildToggle; private setToggleIcon; private setToggleTitle; private buildTags; - private buildTagsItems; + private reassignTagsInputPlaceholder; private buildTagsItem; private getItemByValue; private setTagsItems; @@ -456,6 +578,9 @@ export declare class HSSelect extends HSBasePlugin implements IS private destroyOption; private buildOriginalOption; private destroyOriginalOption; + private buildTagsInputHelper; + private calculateInputWidth; + private adjustInputWidth; private onSelectOption; private addSelectOption; private removeSelectOption; @@ -660,6 +785,8 @@ export declare class HSThemeSwitch extends HSBasePlugin imp constructor(el: HTMLElement, options?: IThemeSwitchOptions); private init; private setResetStyles; + private addSystemThemeObserver; + private removeSystemThemeObserver; setAppearance(theme?: string, isSaveToLocalStorage?: boolean, isSetDispatchEvent?: boolean): void; static getInstance(target: HTMLElement | string): HSThemeSwitch; static autoInit(): void; diff --git a/preline.js b/preline.js index 3b73d9b..e5a89be 100644 --- a/preline.js +++ b/preline.js @@ -1,7 +1,7 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={492:(t,e,n)=>{n.r(e),n.d(e,{afterMain:()=>S,afterRead:()=>w,afterWrite:()=>x,applyStyles:()=>P,arrow:()=>G,auto:()=>l,basePlacements:()=>a,beforeMain:()=>b,beforeRead:()=>y,beforeWrite:()=>I,bottom:()=>i,clippingParents:()=>d,computeStyles:()=>nt,createPopper:()=>Pt,createPopperBase:()=>kt,createPopperLite:()=>Bt,detectOverflow:()=>gt,end:()=>u,eventListeners:()=>it,flip:()=>wt,hide:()=>St,left:()=>s,main:()=>C,modifierPhases:()=>E,offset:()=>It,placements:()=>m,popper:()=>h,popperGenerator:()=>_t,popperOffsets:()=>Tt,preventOverflow:()=>xt,read:()=>g,reference:()=>f,right:()=>r,start:()=>c,top:()=>o,variationPlacements:()=>v,viewport:()=>p,write:()=>T});var o="top",i="bottom",r="right",s="left",l="auto",a=[o,i,r,s],c="start",u="end",d="clippingParents",p="viewport",h="popper",f="reference",v=a.reduce((function(t,e){return t.concat([e+"-"+c,e+"-"+u])}),[]),m=[].concat(a,[l]).reduce((function(t,e){return t.concat([e,e+"-"+c,e+"-"+u])}),[]),y="beforeRead",g="read",w="afterRead",b="beforeMain",C="main",S="afterMain",I="beforeWrite",T="write",x="afterWrite",E=[y,g,w,b,C,S,I,T,x];function O(t){return t?(t.nodeName||"").toLowerCase():null}function L(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function A(t){return t instanceof L(t).Element||t instanceof Element}function _(t){return t instanceof L(t).HTMLElement||t instanceof HTMLElement}function k(t){return"undefined"!=typeof ShadowRoot&&(t instanceof L(t).ShadowRoot||t instanceof ShadowRoot)}const P={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},o=e.attributes[t]||{},i=e.elements[t];_(i)&&O(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(t){var e=o[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var o=e.elements[t],i=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});_(o)&&O(o)&&(Object.assign(o.style,r),Object.keys(i).forEach((function(t){o.removeAttribute(t)})))}))}},requires:["computeStyles"]};function B(t){return t.split("-")[0]}var q=Math.max,j=Math.min,N=Math.round;function D(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function $(){return!/^((?!chrome|android).)*safari/i.test(D())}function H(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var o=t.getBoundingClientRect(),i=1,r=1;e&&_(t)&&(i=t.offsetWidth>0&&N(o.width)/t.offsetWidth||1,r=t.offsetHeight>0&&N(o.height)/t.offsetHeight||1);var s=(A(t)?L(t):window).visualViewport,l=!$()&&n,a=(o.left+(l&&s?s.offsetLeft:0))/i,c=(o.top+(l&&s?s.offsetTop:0))/r,u=o.width/i,d=o.height/r;return{width:u,height:d,top:c,right:a+u,bottom:c+d,left:a,x:a,y:c}}function M(t){var e=H(t),n=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:o}}function R(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&k(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function W(t){return L(t).getComputedStyle(t)}function V(t){return["table","td","th"].indexOf(O(t))>=0}function F(t){return((A(t)?t.ownerDocument:t.document)||window.document).documentElement}function U(t){return"html"===O(t)?t:t.assignedSlot||t.parentNode||(k(t)?t.host:null)||F(t)}function Y(t){return _(t)&&"fixed"!==W(t).position?t.offsetParent:null}function J(t){for(var e=L(t),n=Y(t);n&&V(n)&&"static"===W(n).position;)n=Y(n);return n&&("html"===O(n)||"body"===O(n)&&"static"===W(n).position)?e:n||function(t){var e=/firefox/i.test(D());if(/Trident/i.test(D())&&_(t)&&"fixed"===W(t).position)return null;var n=U(t);for(k(n)&&(n=n.host);_(n)&&["html","body"].indexOf(O(n))<0;){var o=W(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||e&&"filter"===o.willChange||e&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(t)||e}function K(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function z(t,e,n){return q(t,j(e,n))}function X(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Z(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}const G={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,l=t.name,c=t.options,u=n.elements.arrow,d=n.modifiersData.popperOffsets,p=B(n.placement),h=K(p),f=[s,r].indexOf(p)>=0?"height":"width";if(u&&d){var v=function(t,e){return X("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Z(t,a))}(c.padding,n),m=M(u),y="y"===h?o:s,g="y"===h?i:r,w=n.rects.reference[f]+n.rects.reference[h]-d[h]-n.rects.popper[f],b=d[h]-n.rects.reference[h],C=J(u),S=C?"y"===h?C.clientHeight||0:C.clientWidth||0:0,I=w/2-b/2,T=v[y],x=S-m[f]-v[g],E=S/2-m[f]/2+I,O=z(T,E,x),L=h;n.modifiersData[l]=((e={})[L]=O,e.centerOffset=O-E,e)}},effect:function(t){var e=t.state,n=t.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!=typeof o||(o=e.elements.popper.querySelector(o)))&&R(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Q(t){return t.split("-")[1]}var tt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function et(t){var e,n=t.popper,l=t.popperRect,a=t.placement,c=t.variation,d=t.offsets,p=t.position,h=t.gpuAcceleration,f=t.adaptive,v=t.roundOffsets,m=t.isFixed,y=d.x,g=void 0===y?0:y,w=d.y,b=void 0===w?0:w,C="function"==typeof v?v({x:g,y:b}):{x:g,y:b};g=C.x,b=C.y;var S=d.hasOwnProperty("x"),I=d.hasOwnProperty("y"),T=s,x=o,E=window;if(f){var O=J(n),A="clientHeight",_="clientWidth";if(O===L(n)&&"static"!==W(O=F(n)).position&&"absolute"===p&&(A="scrollHeight",_="scrollWidth"),a===o||(a===s||a===r)&&c===u)x=i,b-=(m&&O===E&&E.visualViewport?E.visualViewport.height:O[A])-l.height,b*=h?1:-1;if(a===s||(a===o||a===i)&&c===u)T=r,g-=(m&&O===E&&E.visualViewport?E.visualViewport.width:O[_])-l.width,g*=h?1:-1}var k,P=Object.assign({position:p},f&&tt),B=!0===v?function(t,e){var n=t.x,o=t.y,i=e.devicePixelRatio||1;return{x:N(n*i)/i||0,y:N(o*i)/i||0}}({x:g,y:b},L(n)):{x:g,y:b};return g=B.x,b=B.y,h?Object.assign({},P,((k={})[x]=I?"0":"",k[T]=S?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",k)):Object.assign({},P,((e={})[x]=I?b+"px":"",e[T]=S?g+"px":"",e.transform="",e))}const nt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,o=n.gpuAcceleration,i=void 0===o||o,r=n.adaptive,s=void 0===r||r,l=n.roundOffsets,a=void 0===l||l,c={placement:B(e.placement),variation:Q(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,et(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,et(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var ot={passive:!0};const it={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,o=t.options,i=o.scroll,r=void 0===i||i,s=o.resize,l=void 0===s||s,a=L(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&c.forEach((function(t){t.addEventListener("scroll",n.update,ot)})),l&&a.addEventListener("resize",n.update,ot),function(){r&&c.forEach((function(t){t.removeEventListener("scroll",n.update,ot)})),l&&a.removeEventListener("resize",n.update,ot)}},data:{}};var rt={left:"right",right:"left",bottom:"top",top:"bottom"};function st(t){return t.replace(/left|right|bottom|top/g,(function(t){return rt[t]}))}var lt={start:"end",end:"start"};function at(t){return t.replace(/start|end/g,(function(t){return lt[t]}))}function ct(t){var e=L(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ut(t){return H(F(t)).left+ct(t).scrollLeft}function dt(t){var e=W(t),n=e.overflow,o=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+o)}function pt(t){return["html","body","#document"].indexOf(O(t))>=0?t.ownerDocument.body:_(t)&&dt(t)?t:pt(U(t))}function ht(t,e){var n;void 0===e&&(e=[]);var o=pt(t),i=o===(null==(n=t.ownerDocument)?void 0:n.body),r=L(o),s=i?[r].concat(r.visualViewport||[],dt(o)?o:[]):o,l=e.concat(s);return i?l:l.concat(ht(U(s)))}function ft(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function vt(t,e,n){return e===p?ft(function(t,e){var n=L(t),o=F(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;var c=$();(c||!c&&"fixed"===e)&&(l=i.offsetLeft,a=i.offsetTop)}return{width:r,height:s,x:l+ut(t),y:a}}(t,n)):A(e)?function(t,e){var n=H(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(e,n):ft(function(t){var e,n=F(t),o=ct(t),i=null==(e=t.ownerDocument)?void 0:e.body,r=q(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=q(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-o.scrollLeft+ut(t),a=-o.scrollTop;return"rtl"===W(i||n).direction&&(l+=q(n.clientWidth,i?i.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}(F(t)))}function mt(t,e,n,o){var i="clippingParents"===e?function(t){var e=ht(U(t)),n=["absolute","fixed"].indexOf(W(t).position)>=0&&_(t)?J(t):t;return A(n)?e.filter((function(t){return A(t)&&R(t,n)&&"body"!==O(t)})):[]}(t):[].concat(e),r=[].concat(i,[n]),s=r[0],l=r.reduce((function(e,n){var i=vt(t,n,o);return e.top=q(i.top,e.top),e.right=j(i.right,e.right),e.bottom=j(i.bottom,e.bottom),e.left=q(i.left,e.left),e}),vt(t,s,o));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function yt(t){var e,n=t.reference,l=t.element,a=t.placement,d=a?B(a):null,p=a?Q(a):null,h=n.x+n.width/2-l.width/2,f=n.y+n.height/2-l.height/2;switch(d){case o:e={x:h,y:n.y-l.height};break;case i:e={x:h,y:n.y+n.height};break;case r:e={x:n.x+n.width,y:f};break;case s:e={x:n.x-l.width,y:f};break;default:e={x:n.x,y:n.y}}var v=d?K(d):null;if(null!=v){var m="y"===v?"height":"width";switch(p){case c:e[v]=e[v]-(n[m]/2-l[m]/2);break;case u:e[v]=e[v]+(n[m]/2-l[m]/2)}}return e}function gt(t,e){void 0===e&&(e={});var n=e,s=n.placement,l=void 0===s?t.placement:s,c=n.strategy,u=void 0===c?t.strategy:c,v=n.boundary,m=void 0===v?d:v,y=n.rootBoundary,g=void 0===y?p:y,w=n.elementContext,b=void 0===w?h:w,C=n.altBoundary,S=void 0!==C&&C,I=n.padding,T=void 0===I?0:I,x=X("number"!=typeof T?T:Z(T,a)),E=b===h?f:h,O=t.rects.popper,L=t.elements[S?E:b],_=mt(A(L)?L:L.contextElement||F(t.elements.popper),m,g,u),k=H(t.elements.reference),P=yt({reference:k,element:O,strategy:"absolute",placement:l}),B=ft(Object.assign({},O,P)),q=b===h?B:k,j={top:_.top-q.top+x.top,bottom:q.bottom-_.bottom+x.bottom,left:_.left-q.left+x.left,right:q.right-_.right+x.right},N=t.modifiersData.offset;if(b===h&&N){var D=N[l];Object.keys(j).forEach((function(t){var e=[r,i].indexOf(t)>=0?1:-1,n=[o,i].indexOf(t)>=0?"y":"x";j[t]+=D[n]*e}))}return j}const wt={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,u=t.name;if(!e.modifiersData[u]._skip){for(var d=n.mainAxis,p=void 0===d||d,h=n.altAxis,f=void 0===h||h,y=n.fallbackPlacements,g=n.padding,w=n.boundary,b=n.rootBoundary,C=n.altBoundary,S=n.flipVariations,I=void 0===S||S,T=n.allowedAutoPlacements,x=e.options.placement,E=B(x),O=y||(E===x||!I?[st(x)]:function(t){if(B(t)===l)return[];var e=st(t);return[at(t),e,at(e)]}(x)),L=[x].concat(O).reduce((function(t,n){return t.concat(B(n)===l?function(t,e){void 0===e&&(e={});var n=e,o=n.placement,i=n.boundary,r=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=void 0===c?m:c,d=Q(o),p=d?l?v:v.filter((function(t){return Q(t)===d})):a,h=p.filter((function(t){return u.indexOf(t)>=0}));0===h.length&&(h=p);var f=h.reduce((function(e,n){return e[n]=gt(t,{placement:n,boundary:i,rootBoundary:r,padding:s})[B(n)],e}),{});return Object.keys(f).sort((function(t,e){return f[t]-f[e]}))}(e,{placement:n,boundary:w,rootBoundary:b,padding:g,flipVariations:I,allowedAutoPlacements:T}):n)}),[]),A=e.rects.reference,_=e.rects.popper,k=new Map,P=!0,q=L[0],j=0;j=0,M=H?"width":"height",R=gt(e,{placement:N,boundary:w,rootBoundary:b,altBoundary:C,padding:g}),W=H?$?r:s:$?i:o;A[M]>_[M]&&(W=st(W));var V=st(W),F=[];if(p&&F.push(R[D]<=0),f&&F.push(R[W]<=0,R[V]<=0),F.every((function(t){return t}))){q=N,P=!1;break}k.set(N,F)}if(P)for(var U=function(t){var e=L.find((function(e){var n=k.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return q=e,"break"},Y=I?3:1;Y>0;Y--){if("break"===U(Y))break}e.placement!==q&&(e.modifiersData[u]._skip=!0,e.placement=q,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function bt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Ct(t){return[o,r,i,s].some((function(e){return t[e]>=0}))}const St={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,o=e.rects.reference,i=e.rects.popper,r=e.modifiersData.preventOverflow,s=gt(e,{elementContext:"reference"}),l=gt(e,{altBoundary:!0}),a=bt(s,o),c=bt(l,i,r),u=Ct(a),d=Ct(c);e.modifiersData[n]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};const It={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,i=t.name,l=n.offset,a=void 0===l?[0,0]:l,c=m.reduce((function(t,n){return t[n]=function(t,e,n){var i=B(t),l=[s,o].indexOf(i)>=0?-1:1,a="function"==typeof n?n(Object.assign({},e,{placement:t})):n,c=a[0],u=a[1];return c=c||0,u=(u||0)*l,[s,r].indexOf(i)>=0?{x:u,y:c}:{x:c,y:u}}(n,e.rects,a),t}),{}),u=c[e.placement],d=u.x,p=u.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=d,e.modifiersData.popperOffsets.y+=p),e.modifiersData[i]=c}};const Tt={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=yt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}};const xt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,l=t.name,a=n.mainAxis,u=void 0===a||a,d=n.altAxis,p=void 0!==d&&d,h=n.boundary,f=n.rootBoundary,v=n.altBoundary,m=n.padding,y=n.tether,g=void 0===y||y,w=n.tetherOffset,b=void 0===w?0:w,C=gt(e,{boundary:h,rootBoundary:f,padding:m,altBoundary:v}),S=B(e.placement),I=Q(e.placement),T=!I,x=K(S),E="x"===x?"y":"x",O=e.modifiersData.popperOffsets,L=e.rects.reference,A=e.rects.popper,_="function"==typeof b?b(Object.assign({},e.rects,{placement:e.placement})):b,k="number"==typeof _?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,N={x:0,y:0};if(O){if(u){var D,$="y"===x?o:s,H="y"===x?i:r,R="y"===x?"height":"width",W=O[x],V=W+C[$],F=W-C[H],U=g?-A[R]/2:0,Y=I===c?L[R]:A[R],X=I===c?-A[R]:-L[R],Z=e.elements.arrow,G=g&&Z?M(Z):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[$],nt=tt[H],ot=z(0,L[R],G[R]),it=T?L[R]/2-U-ot-et-k.mainAxis:Y-ot-et-k.mainAxis,rt=T?-L[R]/2+U+ot+nt+k.mainAxis:X+ot+nt+k.mainAxis,st=e.elements.arrow&&J(e.elements.arrow),lt=st?"y"===x?st.clientTop||0:st.clientLeft||0:0,at=null!=(D=null==P?void 0:P[x])?D:0,ct=W+rt-at,ut=z(g?j(V,W+it-at-lt):V,W,g?q(F,ct):F);O[x]=ut,N[x]=ut-W}if(p){var dt,pt="x"===x?o:s,ht="x"===x?i:r,ft=O[E],vt="y"===E?"height":"width",mt=ft+C[pt],yt=ft-C[ht],wt=-1!==[o,s].indexOf(S),bt=null!=(dt=null==P?void 0:P[E])?dt:0,Ct=wt?mt:ft-L[vt]-A[vt]-bt+k.altAxis,St=wt?ft+L[vt]+A[vt]-bt-k.altAxis:yt,It=g&&wt?function(t,e,n){var o=z(t,e,n);return o>n?n:o}(Ct,ft,St):z(g?Ct:mt,ft,g?St:yt);O[E]=It,N[E]=It-ft}e.modifiersData[l]=N}},requiresIfExists:["offset"]};function Et(t,e,n){void 0===n&&(n=!1);var o,i,r=_(e),s=_(e)&&function(t){var e=t.getBoundingClientRect(),n=N(e.width)/t.offsetWidth||1,o=N(e.height)/t.offsetHeight||1;return 1!==n||1!==o}(e),l=F(e),a=H(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==O(e)||dt(l))&&(c=(o=e)!==L(o)&&_(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:ct(o)),_(e)?((u=H(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):l&&(u.x=ut(l))),{x:a.left+c.scrollLeft-u.x,y:a.top+c.scrollTop-u.y,width:a.width,height:a.height}}function Ot(t){var e=new Map,n=new Set,o=[];function i(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var o=e.get(t);o&&i(o)}})),o.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||i(t)})),o}var Lt={placement:"bottom",modifiers:[],strategy:"absolute"};function At(){for(var t=arguments.length,e=new Array(t),n=0;n{Object.defineProperty(e,"__esModule",{value:!0}),e.COMBO_BOX_ACCESSIBILITY_KEY_SET=e.SELECT_ACCESSIBILITY_KEY_SET=e.TABS_ACCESSIBILITY_KEY_SET=e.OVERLAY_ACCESSIBILITY_KEY_SET=e.DROPDOWN_ACCESSIBILITY_KEY_SET=e.POSITIONS=void 0,e.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},e.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],e.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],e.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],e.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],e.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"]},460:function(t,e,n){ +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={492:(t,e,n)=>{n.r(e),n.d(e,{afterMain:()=>S,afterRead:()=>w,afterWrite:()=>T,applyStyles:()=>P,arrow:()=>Q,auto:()=>l,basePlacements:()=>a,beforeMain:()=>b,beforeRead:()=>y,beforeWrite:()=>x,bottom:()=>i,clippingParents:()=>d,computeStyles:()=>nt,createPopper:()=>Pt,createPopperBase:()=>_t,createPopperLite:()=>Bt,detectOverflow:()=>gt,end:()=>u,eventListeners:()=>it,flip:()=>wt,hide:()=>St,left:()=>s,main:()=>C,modifierPhases:()=>E,offset:()=>xt,placements:()=>v,popper:()=>h,popperGenerator:()=>kt,popperOffsets:()=>It,preventOverflow:()=>Tt,read:()=>g,reference:()=>f,right:()=>r,start:()=>c,top:()=>o,variationPlacements:()=>m,viewport:()=>p,write:()=>I});var o="top",i="bottom",r="right",s="left",l="auto",a=[o,i,r,s],c="start",u="end",d="clippingParents",p="viewport",h="popper",f="reference",m=a.reduce((function(t,e){return t.concat([e+"-"+c,e+"-"+u])}),[]),v=[].concat(a,[l]).reduce((function(t,e){return t.concat([e,e+"-"+c,e+"-"+u])}),[]),y="beforeRead",g="read",w="afterRead",b="beforeMain",C="main",S="afterMain",x="beforeWrite",I="write",T="afterWrite",E=[y,g,w,b,C,S,x,I,T];function O(t){return t?(t.nodeName||"").toLowerCase():null}function L(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function A(t){return t instanceof L(t).Element||t instanceof Element}function k(t){return t instanceof L(t).HTMLElement||t instanceof HTMLElement}function _(t){return"undefined"!=typeof ShadowRoot&&(t instanceof L(t).ShadowRoot||t instanceof ShadowRoot)}const P={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},o=e.attributes[t]||{},i=e.elements[t];k(i)&&O(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(t){var e=o[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var o=e.elements[t],i=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});k(o)&&O(o)&&(Object.assign(o.style,r),Object.keys(i).forEach((function(t){o.removeAttribute(t)})))}))}},requires:["computeStyles"]};function B(t){return t.split("-")[0]}var q=Math.max,N=Math.min,j=Math.round;function $(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function D(){return!/^((?!chrome|android).)*safari/i.test($())}function H(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var o=t.getBoundingClientRect(),i=1,r=1;e&&k(t)&&(i=t.offsetWidth>0&&j(o.width)/t.offsetWidth||1,r=t.offsetHeight>0&&j(o.height)/t.offsetHeight||1);var s=(A(t)?L(t):window).visualViewport,l=!D()&&n,a=(o.left+(l&&s?s.offsetLeft:0))/i,c=(o.top+(l&&s?s.offsetTop:0))/r,u=o.width/i,d=o.height/r;return{width:u,height:d,top:c,right:a+u,bottom:c+d,left:a,x:a,y:c}}function M(t){var e=H(t),n=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:o}}function R(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&_(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function W(t){return L(t).getComputedStyle(t)}function V(t){return["table","td","th"].indexOf(O(t))>=0}function F(t){return((A(t)?t.ownerDocument:t.document)||window.document).documentElement}function U(t){return"html"===O(t)?t:t.assignedSlot||t.parentNode||(_(t)?t.host:null)||F(t)}function J(t){return k(t)&&"fixed"!==W(t).position?t.offsetParent:null}function Y(t){for(var e=L(t),n=J(t);n&&V(n)&&"static"===W(n).position;)n=J(n);return n&&("html"===O(n)||"body"===O(n)&&"static"===W(n).position)?e:n||function(t){var e=/firefox/i.test($());if(/Trident/i.test($())&&k(t)&&"fixed"===W(t).position)return null;var n=U(t);for(_(n)&&(n=n.host);k(n)&&["html","body"].indexOf(O(n))<0;){var o=W(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||e&&"filter"===o.willChange||e&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(t)||e}function K(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function G(t,e,n){return q(t,N(e,n))}function z(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function X(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}const Q={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,l=t.name,c=t.options,u=n.elements.arrow,d=n.modifiersData.popperOffsets,p=B(n.placement),h=K(p),f=[s,r].indexOf(p)>=0?"height":"width";if(u&&d){var m=function(t,e){return z("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:X(t,a))}(c.padding,n),v=M(u),y="y"===h?o:s,g="y"===h?i:r,w=n.rects.reference[f]+n.rects.reference[h]-d[h]-n.rects.popper[f],b=d[h]-n.rects.reference[h],C=Y(u),S=C?"y"===h?C.clientHeight||0:C.clientWidth||0:0,x=w/2-b/2,I=m[y],T=S-v[f]-m[g],E=S/2-v[f]/2+x,O=G(I,E,T),L=h;n.modifiersData[l]=((e={})[L]=O,e.centerOffset=O-E,e)}},effect:function(t){var e=t.state,n=t.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!=typeof o||(o=e.elements.popper.querySelector(o)))&&R(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Z(t){return t.split("-")[1]}var tt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function et(t){var e,n=t.popper,l=t.popperRect,a=t.placement,c=t.variation,d=t.offsets,p=t.position,h=t.gpuAcceleration,f=t.adaptive,m=t.roundOffsets,v=t.isFixed,y=d.x,g=void 0===y?0:y,w=d.y,b=void 0===w?0:w,C="function"==typeof m?m({x:g,y:b}):{x:g,y:b};g=C.x,b=C.y;var S=d.hasOwnProperty("x"),x=d.hasOwnProperty("y"),I=s,T=o,E=window;if(f){var O=Y(n),A="clientHeight",k="clientWidth";if(O===L(n)&&"static"!==W(O=F(n)).position&&"absolute"===p&&(A="scrollHeight",k="scrollWidth"),a===o||(a===s||a===r)&&c===u)T=i,b-=(v&&O===E&&E.visualViewport?E.visualViewport.height:O[A])-l.height,b*=h?1:-1;if(a===s||(a===o||a===i)&&c===u)I=r,g-=(v&&O===E&&E.visualViewport?E.visualViewport.width:O[k])-l.width,g*=h?1:-1}var _,P=Object.assign({position:p},f&&tt),B=!0===m?function(t,e){var n=t.x,o=t.y,i=e.devicePixelRatio||1;return{x:j(n*i)/i||0,y:j(o*i)/i||0}}({x:g,y:b},L(n)):{x:g,y:b};return g=B.x,b=B.y,h?Object.assign({},P,((_={})[T]=x?"0":"",_[I]=S?"0":"",_.transform=(E.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",_)):Object.assign({},P,((e={})[T]=x?b+"px":"",e[I]=S?g+"px":"",e.transform="",e))}const nt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,o=n.gpuAcceleration,i=void 0===o||o,r=n.adaptive,s=void 0===r||r,l=n.roundOffsets,a=void 0===l||l,c={placement:B(e.placement),variation:Z(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,et(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,et(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var ot={passive:!0};const it={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,o=t.options,i=o.scroll,r=void 0===i||i,s=o.resize,l=void 0===s||s,a=L(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&c.forEach((function(t){t.addEventListener("scroll",n.update,ot)})),l&&a.addEventListener("resize",n.update,ot),function(){r&&c.forEach((function(t){t.removeEventListener("scroll",n.update,ot)})),l&&a.removeEventListener("resize",n.update,ot)}},data:{}};var rt={left:"right",right:"left",bottom:"top",top:"bottom"};function st(t){return t.replace(/left|right|bottom|top/g,(function(t){return rt[t]}))}var lt={start:"end",end:"start"};function at(t){return t.replace(/start|end/g,(function(t){return lt[t]}))}function ct(t){var e=L(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ut(t){return H(F(t)).left+ct(t).scrollLeft}function dt(t){var e=W(t),n=e.overflow,o=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+o)}function pt(t){return["html","body","#document"].indexOf(O(t))>=0?t.ownerDocument.body:k(t)&&dt(t)?t:pt(U(t))}function ht(t,e){var n;void 0===e&&(e=[]);var o=pt(t),i=o===(null==(n=t.ownerDocument)?void 0:n.body),r=L(o),s=i?[r].concat(r.visualViewport||[],dt(o)?o:[]):o,l=e.concat(s);return i?l:l.concat(ht(U(s)))}function ft(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mt(t,e,n){return e===p?ft(function(t,e){var n=L(t),o=F(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;var c=D();(c||!c&&"fixed"===e)&&(l=i.offsetLeft,a=i.offsetTop)}return{width:r,height:s,x:l+ut(t),y:a}}(t,n)):A(e)?function(t,e){var n=H(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(e,n):ft(function(t){var e,n=F(t),o=ct(t),i=null==(e=t.ownerDocument)?void 0:e.body,r=q(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=q(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-o.scrollLeft+ut(t),a=-o.scrollTop;return"rtl"===W(i||n).direction&&(l+=q(n.clientWidth,i?i.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}(F(t)))}function vt(t,e,n,o){var i="clippingParents"===e?function(t){var e=ht(U(t)),n=["absolute","fixed"].indexOf(W(t).position)>=0&&k(t)?Y(t):t;return A(n)?e.filter((function(t){return A(t)&&R(t,n)&&"body"!==O(t)})):[]}(t):[].concat(e),r=[].concat(i,[n]),s=r[0],l=r.reduce((function(e,n){var i=mt(t,n,o);return e.top=q(i.top,e.top),e.right=N(i.right,e.right),e.bottom=N(i.bottom,e.bottom),e.left=q(i.left,e.left),e}),mt(t,s,o));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function yt(t){var e,n=t.reference,l=t.element,a=t.placement,d=a?B(a):null,p=a?Z(a):null,h=n.x+n.width/2-l.width/2,f=n.y+n.height/2-l.height/2;switch(d){case o:e={x:h,y:n.y-l.height};break;case i:e={x:h,y:n.y+n.height};break;case r:e={x:n.x+n.width,y:f};break;case s:e={x:n.x-l.width,y:f};break;default:e={x:n.x,y:n.y}}var m=d?K(d):null;if(null!=m){var v="y"===m?"height":"width";switch(p){case c:e[m]=e[m]-(n[v]/2-l[v]/2);break;case u:e[m]=e[m]+(n[v]/2-l[v]/2)}}return e}function gt(t,e){void 0===e&&(e={});var n=e,s=n.placement,l=void 0===s?t.placement:s,c=n.strategy,u=void 0===c?t.strategy:c,m=n.boundary,v=void 0===m?d:m,y=n.rootBoundary,g=void 0===y?p:y,w=n.elementContext,b=void 0===w?h:w,C=n.altBoundary,S=void 0!==C&&C,x=n.padding,I=void 0===x?0:x,T=z("number"!=typeof I?I:X(I,a)),E=b===h?f:h,O=t.rects.popper,L=t.elements[S?E:b],k=vt(A(L)?L:L.contextElement||F(t.elements.popper),v,g,u),_=H(t.elements.reference),P=yt({reference:_,element:O,strategy:"absolute",placement:l}),B=ft(Object.assign({},O,P)),q=b===h?B:_,N={top:k.top-q.top+T.top,bottom:q.bottom-k.bottom+T.bottom,left:k.left-q.left+T.left,right:q.right-k.right+T.right},j=t.modifiersData.offset;if(b===h&&j){var $=j[l];Object.keys(N).forEach((function(t){var e=[r,i].indexOf(t)>=0?1:-1,n=[o,i].indexOf(t)>=0?"y":"x";N[t]+=$[n]*e}))}return N}const wt={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,u=t.name;if(!e.modifiersData[u]._skip){for(var d=n.mainAxis,p=void 0===d||d,h=n.altAxis,f=void 0===h||h,y=n.fallbackPlacements,g=n.padding,w=n.boundary,b=n.rootBoundary,C=n.altBoundary,S=n.flipVariations,x=void 0===S||S,I=n.allowedAutoPlacements,T=e.options.placement,E=B(T),O=y||(E===T||!x?[st(T)]:function(t){if(B(t)===l)return[];var e=st(t);return[at(t),e,at(e)]}(T)),L=[T].concat(O).reduce((function(t,n){return t.concat(B(n)===l?function(t,e){void 0===e&&(e={});var n=e,o=n.placement,i=n.boundary,r=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=void 0===c?v:c,d=Z(o),p=d?l?m:m.filter((function(t){return Z(t)===d})):a,h=p.filter((function(t){return u.indexOf(t)>=0}));0===h.length&&(h=p);var f=h.reduce((function(e,n){return e[n]=gt(t,{placement:n,boundary:i,rootBoundary:r,padding:s})[B(n)],e}),{});return Object.keys(f).sort((function(t,e){return f[t]-f[e]}))}(e,{placement:n,boundary:w,rootBoundary:b,padding:g,flipVariations:x,allowedAutoPlacements:I}):n)}),[]),A=e.rects.reference,k=e.rects.popper,_=new Map,P=!0,q=L[0],N=0;N=0,M=H?"width":"height",R=gt(e,{placement:j,boundary:w,rootBoundary:b,altBoundary:C,padding:g}),W=H?D?r:s:D?i:o;A[M]>k[M]&&(W=st(W));var V=st(W),F=[];if(p&&F.push(R[$]<=0),f&&F.push(R[W]<=0,R[V]<=0),F.every((function(t){return t}))){q=j,P=!1;break}_.set(j,F)}if(P)for(var U=function(t){var e=L.find((function(e){var n=_.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return q=e,"break"},J=x?3:1;J>0;J--){if("break"===U(J))break}e.placement!==q&&(e.modifiersData[u]._skip=!0,e.placement=q,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function bt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Ct(t){return[o,r,i,s].some((function(e){return t[e]>=0}))}const St={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,o=e.rects.reference,i=e.rects.popper,r=e.modifiersData.preventOverflow,s=gt(e,{elementContext:"reference"}),l=gt(e,{altBoundary:!0}),a=bt(s,o),c=bt(l,i,r),u=Ct(a),d=Ct(c);e.modifiersData[n]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};const xt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,i=t.name,l=n.offset,a=void 0===l?[0,0]:l,c=v.reduce((function(t,n){return t[n]=function(t,e,n){var i=B(t),l=[s,o].indexOf(i)>=0?-1:1,a="function"==typeof n?n(Object.assign({},e,{placement:t})):n,c=a[0],u=a[1];return c=c||0,u=(u||0)*l,[s,r].indexOf(i)>=0?{x:u,y:c}:{x:c,y:u}}(n,e.rects,a),t}),{}),u=c[e.placement],d=u.x,p=u.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=d,e.modifiersData.popperOffsets.y+=p),e.modifiersData[i]=c}};const It={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=yt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}};const Tt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,l=t.name,a=n.mainAxis,u=void 0===a||a,d=n.altAxis,p=void 0!==d&&d,h=n.boundary,f=n.rootBoundary,m=n.altBoundary,v=n.padding,y=n.tether,g=void 0===y||y,w=n.tetherOffset,b=void 0===w?0:w,C=gt(e,{boundary:h,rootBoundary:f,padding:v,altBoundary:m}),S=B(e.placement),x=Z(e.placement),I=!x,T=K(S),E="x"===T?"y":"x",O=e.modifiersData.popperOffsets,L=e.rects.reference,A=e.rects.popper,k="function"==typeof b?b(Object.assign({},e.rects,{placement:e.placement})):b,_="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,j={x:0,y:0};if(O){if(u){var $,D="y"===T?o:s,H="y"===T?i:r,R="y"===T?"height":"width",W=O[T],V=W+C[D],F=W-C[H],U=g?-A[R]/2:0,J=x===c?L[R]:A[R],z=x===c?-A[R]:-L[R],X=e.elements.arrow,Q=g&&X?M(X):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[D],nt=tt[H],ot=G(0,L[R],Q[R]),it=I?L[R]/2-U-ot-et-_.mainAxis:J-ot-et-_.mainAxis,rt=I?-L[R]/2+U+ot+nt+_.mainAxis:z+ot+nt+_.mainAxis,st=e.elements.arrow&&Y(e.elements.arrow),lt=st?"y"===T?st.clientTop||0:st.clientLeft||0:0,at=null!=($=null==P?void 0:P[T])?$:0,ct=W+rt-at,ut=G(g?N(V,W+it-at-lt):V,W,g?q(F,ct):F);O[T]=ut,j[T]=ut-W}if(p){var dt,pt="x"===T?o:s,ht="x"===T?i:r,ft=O[E],mt="y"===E?"height":"width",vt=ft+C[pt],yt=ft-C[ht],wt=-1!==[o,s].indexOf(S),bt=null!=(dt=null==P?void 0:P[E])?dt:0,Ct=wt?vt:ft-L[mt]-A[mt]-bt+_.altAxis,St=wt?ft+L[mt]+A[mt]-bt-_.altAxis:yt,xt=g&&wt?function(t,e,n){var o=G(t,e,n);return o>n?n:o}(Ct,ft,St):G(g?Ct:vt,ft,g?St:yt);O[E]=xt,j[E]=xt-ft}e.modifiersData[l]=j}},requiresIfExists:["offset"]};function Et(t,e,n){void 0===n&&(n=!1);var o,i,r=k(e),s=k(e)&&function(t){var e=t.getBoundingClientRect(),n=j(e.width)/t.offsetWidth||1,o=j(e.height)/t.offsetHeight||1;return 1!==n||1!==o}(e),l=F(e),a=H(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==O(e)||dt(l))&&(c=(o=e)!==L(o)&&k(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:ct(o)),k(e)?((u=H(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):l&&(u.x=ut(l))),{x:a.left+c.scrollLeft-u.x,y:a.top+c.scrollTop-u.y,width:a.width,height:a.height}}function Ot(t){var e=new Map,n=new Set,o=[];function i(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var o=e.get(t);o&&i(o)}})),o.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||i(t)})),o}var Lt={placement:"bottom",modifiers:[],strategy:"absolute"};function At(){for(var t=arguments.length,e=new Array(t),n=0;n{Object.defineProperty(e,"__esModule",{value:!0}),e.BREAKPOINTS=e.COMBO_BOX_ACCESSIBILITY_KEY_SET=e.SELECT_ACCESSIBILITY_KEY_SET=e.TABS_ACCESSIBILITY_KEY_SET=e.OVERLAY_ACCESSIBILITY_KEY_SET=e.DROPDOWN_ACCESSIBILITY_KEY_SET=e.POSITIONS=void 0,e.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},e.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],e.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],e.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],e.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],e.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],e.BREAKPOINTS={sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},460:function(t,e,n){ /* * HSAccordion - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -9,7 +9,7 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(969),s=function(t){function e(e,n,o){var i=t.call(this,e,n,o)||this;return i.toggle=i.el.querySelector(".hs-accordion-toggle")||null,i.content=i.el.querySelector(".hs-accordion-content")||null,i.group=i.el.closest(".hs-accordion-group")||null,i.isAlwaysOpened=i.group.hasAttribute("data-hs-accordion-always-open")||!1,i.toggle&&i.content&&i.init(),i}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsAccordionCollection,this),this.toggle.addEventListener("click",(function(){t.el.classList.contains("active")?t.hide():t.show()}))},e.prototype.show=function(){var t=this;this.group&&!this.isAlwaysOpened&&this.group.querySelector(".hs-accordion.active")&&this.group.querySelector(".hs-accordion.active")!==this.el&&window.$hsAccordionCollection.find((function(e){return e.element.el===t.group.querySelector(".hs-accordion.active")})).element.hide();if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),this.content.style.display="block",this.content.style.height="0",setTimeout((function(){t.content.style.height="".concat(t.content.scrollHeight,"px")})),(0,r.afterTransition)(this.content,(function(){t.content.style.display="block",t.content.style.height="",t.fireEvent("open",t.el),(0,r.dispatch)("open.hs.accordion",t.el,t.el)}))},e.prototype.hide=function(){var t=this;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){t.content.style.height="0"})),(0,r.afterTransition)(this.content,(function(){t.content.style.display="",t.content.style.height="0",t.fireEvent("close",t.el),(0,r.dispatch)("close.hs.accordion",t.el,t.el)}))},e.getInstance=function(t,e){var n=window.$hsAccordionCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.show=function(t){var e=window.$hsAccordionCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&"block"!==e.element.content.style.display&&e.element.show()},e.hide=function(t){var e=window.$hsAccordionCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&"block"===e.element.content.style.display&&e.element.hide()},e.autoInit=function(){window.$hsAccordionCollection||(window.$hsAccordionCollection=[]),document.querySelectorAll(".hs-accordion:not(.--prevent-on-load-init)").forEach((function(t){window.$hsAccordionCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e.on=function(t,e,n){var o=window.$hsAccordionCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));o&&(o.element.events[t]=n)},e}(n(737).default);window.addEventListener("load",(function(){s.autoInit()})),"undefined"!=typeof window&&(window.HSAccordion=s),e.default=s},737:(t,e)=>{ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -17,7 +17,7 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})},t.prototype.fireEvent=function(t,e){if(void 0===e&&(e=null),this.events.hasOwnProperty(t))return this.events[t](e)},t.prototype.on=function(t,e){this.events[t]=e},t}();e.default=n},629:function(t,e,n){ /* * HSCarousel - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -25,15 +25,23 @@ Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n *")||null,l.sliderWidth=l.inner.parentElement.clientWidth,l.touchX={start:0,end:0},l.init(),l}return i(e,t),e.prototype.init=function(){var t,e,n=this;this.createCollection(window.$hsCarouselCollection,this),this.inner&&(this.calculateWidth(),this.loadingClassesRemove&&("string"==typeof this.loadingClassesRemove?this.inner.classList.remove(this.loadingClassesRemove):(t=this.inner.classList).remove.apply(t,this.loadingClassesRemove)),this.loadingClassesAdd&&("string"==typeof this.loadingClassesAdd?this.inner.classList.add(this.loadingClassesAdd):(e=this.inner.classList).add.apply(e,this.loadingClassesAdd))),this.prev&&this.prev.addEventListener("click",(function(){n.goToPrev(),n.isAutoPlay&&(n.resetTimer(),n.setTimer())})),this.next&&this.next.addEventListener("click",(function(){n.goToNext(),n.isAutoPlay&&(n.resetTimer(),n.setTimer())})),this.dots&&this.dots.forEach((function(t,e){return t.addEventListener("click",(function(){n.goTo(e),n.isAutoPlay&&(n.resetTimer(),n.setTimer())}))})),this.slides.length&&(this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass(),this.isAutoPlay&&this.autoPlay()),this.inner&&this.afterLoadingClassesAdd&&setTimeout((function(){var t;"string"==typeof n.afterLoadingClassesAdd?n.inner.classList.add(n.afterLoadingClassesAdd):(t=n.inner.classList).add.apply(t,n.afterLoadingClassesAdd)})),this.el.classList.add("init"),this.el.addEventListener("touchstart",(function(t){n.touchX.start=t.changedTouches[0].screenX})),this.el.addEventListener("touchend",(function(t){n.touchX.end=t.changedTouches[0].screenX,n.detectDirection()})),this.observeResize()},e.prototype.observeResize=function(){var t=this;new ResizeObserver((function(){return t.recalculateWidth()})).observe(document.querySelector("body"))},e.prototype.calculateWidth=function(){var t=this;this.inner.style.width="".concat(this.sliderWidth*this.slides.length,"px"),this.inner.style.transform="translate(-".concat(this.currentIndex*this.sliderWidth,"px, 0px)"),this.slides.forEach((function(e){e.style.width="".concat(t.sliderWidth,"px")}))},e.prototype.addCurrentClass=function(){var t=this;this.slides.forEach((function(e,n){n===t.currentIndex?e.classList.add("active"):e.classList.remove("active")})),this.dots&&this.dots.forEach((function(e,n){n===t.currentIndex?e.classList.add("active"):e.classList.remove("active")}))},e.prototype.addDisabledClass=function(){if(!this.prev||!this.next)return!1;0===this.currentIndex?(this.next.classList.remove("disabled"),this.prev.classList.add("disabled")):this.currentIndex===this.slides.length-1?(this.prev.classList.remove("disabled"),this.next.classList.add("disabled")):(this.prev.classList.remove("disabled"),this.next.classList.remove("disabled"))},e.prototype.autoPlay=function(){this.setTimer()},e.prototype.setTimer=function(){var t=this;this.timer=setInterval((function(){t.currentIndex===t.slides.length-1?t.goTo(0):t.goToNext()}),this.speed)},e.prototype.resetTimer=function(){clearInterval(this.timer)},e.prototype.detectDirection=function(){var t=this.touchX,e=t.start,n=t.end;ne&&this.goToPrev()},e.prototype.recalculateWidth=function(){this.sliderWidth=this.inner.parentElement.clientWidth,this.calculateWidth()},e.prototype.goToPrev=function(){0===this.currentIndex&&this.isInfiniteLoop?(this.currentIndex=this.slides.length-1,this.inner.style.transform="translate(-".concat(this.currentIndex*this.sliderWidth,"px, 0px)"),this.addCurrentClass()):0!==this.currentIndex&&(this.currentIndex-=1,this.inner.style.transform="translate(-".concat(this.currentIndex*this.sliderWidth,"px, 0px)"),this.addCurrentClass(),this.addDisabledClass())},e.prototype.goToNext=function(){this.currentIndex===this.slides.length-1&&this.isInfiniteLoop?(this.currentIndex=0,this.inner.style.transform="translate(-".concat(this.currentIndex*this.sliderWidth,"px, 0px)"),this.addCurrentClass()):this.currentIndex0&&i[i.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t',E.outputEmptyTemplate=null!==(h=null==A?void 0:A.outputEmptyTemplate)&&void 0!==h?h:'
Nothing found...
',E.outputLoaderTemplate=null!==(f=null==A?void 0:A.outputLoaderTemplate)&&void 0!==f?f:'
\n\t\t\t\t
\n\t\t\t\t\tLoading...\n\t\t\t\t
\n\t\t\t
',E.groupingType=null!==(m=null==A?void 0:A.groupingType)&&void 0!==m?m:null,E.groupingTitleTemplate=null!==(v=null==A?void 0:A.groupingTitleTemplate)&&void 0!==v?v:"default"===E.groupingType?'
':'',E.tabsWrapperTemplate=null!==(y=null==A?void 0:A.tabsWrapperTemplate)&&void 0!==y?y:'
',E.preventSelection=null!==(g=null==A?void 0:A.preventSelection)&&void 0!==g&&g,E.isOpenOnFocus=null!==(w=null==A?void 0:A.isOpenOnFocus)&&void 0!==w&&w,E.input=null!==(b=E.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==b?b:null,E.output=null!==(C=E.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==C?C:null,E.itemsWrapper=null!==(S=E.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==S?S:null,E.items=null!==(x=Array.from(E.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==x?x:[],E.tabs=[],E.toggle=null!==(I=E.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==I?I:null,E.outputPlaceholder=null,E.selected=E.value=null!==(T=E.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==T?T:"",E.isOpened=!1,E.isCurrent=!1,E.animationInProcess=!1,E.selectedGroup="all",E.init(),E}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsComboBoxCollection,this),this.build()},e.prototype.build=function(){this.buildInput(),this.groupingType&&this.setGroups(),this.buildItems(),this.preventVisibility&&(this.isOpened=!0,this.recalculateDirection()),this.toggle&&this.buildToggle()},e.prototype.setResultAndRender=function(t){void 0===t&&(t=""),this.setResults(t),this.apiSearchQuery&&this.itemsFromJson()},e.prototype.buildInput=function(){var t=this;this.isOpenOnFocus&&this.input.addEventListener("focus",(function(){t.isOpened||(t.setResultAndRender(),t.open())})),this.input.addEventListener("input",(0,c.debounce)((function(e){t.setResultAndRender(e.target.value),t.isOpened||t.open()})))},e.prototype.buildItems=function(){this.apiUrl?this.itemsFromJson():(this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="",this.itemsFromHtml())},e.prototype.setResults=function(t){this.value=t,this.resultItems(),this.hasVisibleItems()?this.destroyOutputPlaceholder():this.buildOutputPlaceholder()},e.prototype.isItemExists=function(t){return this.items.some((function(e){return Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(e){return e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]}))}))},e.prototype.isTextExists=function(t,e){var n=e.map((function(t){return t.toLowerCase()}));return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(t){return n.includes(t.getAttribute("data-hs-combo-box-search-text").toLowerCase())}))},e.prototype.isTextExistsAny=function(t,e){return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(t){return t.getAttribute("data-hs-combo-box-search-text").toLowerCase().includes(e.toLowerCase())}))},e.prototype.valuesBySelector=function(t){return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).reduce((function(t,e){return a(a([],t,!0),[e.getAttribute("data-hs-combo-box-search-text")],!1)}),[])},e.prototype.buildOutputLoader=function(){if(this.outputLoader)return!1;this.outputLoader=(0,c.htmlToElement)(this.outputLoaderTemplate),this.items.length||this.outputPlaceholder?(this.outputLoader.style.position="absolute",this.outputLoader.style.top="0",this.outputLoader.style.bottom="0",this.outputLoader.style.left="0",this.outputLoader.style.right="0",this.outputLoader.style.zIndex="2"):(this.outputLoader.style.position="",this.outputLoader.style.top="",this.outputLoader.style.bottom="",this.outputLoader.style.left="",this.outputLoader.style.right="",this.outputLoader.style.zIndex="",this.outputLoader.style.height="30px"),this.output.append(this.outputLoader)},e.prototype.destroyOutputLoader=function(){this.outputLoader&&this.outputLoader.remove(),this.outputLoader=null},e.prototype.itemsFromJson=function(){return s(this,void 0,void 0,(function(){var t,e,n,o,i,r=this;return l(this,(function(s){switch(s.label){case 0:this.buildOutputLoader(),s.label=1;case 1:return s.trys.push([1,4,,5]),t="".concat(this.apiQuery),e="".concat(this.apiSearchQuery,"=").concat(this.value.toLowerCase()),n=this.apiUrl,this.apiQuery&&this.apiSearchQuery?n+="?".concat(e,"&").concat(t):this.apiQuery?n+="?".concat(t):this.apiSearchQuery&&(n+="?".concat(e)),[4,fetch(n,this.apiHeaders)];case 2:return[4,s.sent().json()];case 3:return o=s.sent(),this.apiDataPart&&(o=o[this.apiDataPart]),this.apiSearchQuery&&(this.items=[]),this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="","tabs"===this.groupingType?(this.setApiGroups(o),this.groupTabsRender(),this.jsonItemsRender(o)):"default"===this.groupingType?(this.setApiGroups(o),this.groups.forEach((function(t){var e=(0,c.htmlToElement)(r.groupingTitleTemplate);e.setAttribute("data-hs-combo-box-group-title",t.name),e.classList.add("--exclude-accessibility"),e.innerText=t.title;var n=o.filter((function(e){return e[r.apiGroupField]===t.name}));r.itemsWrapper?r.itemsWrapper.append(e):r.output.append(e),r.jsonItemsRender(n)}))):this.jsonItemsRender(o),this.setResults(this.input.value),[3,5];case 4:return i=s.sent(),console.error(i),[3,5];case 5:return this.destroyOutputLoader(),[2]}}))}))},e.prototype.jsonItemsRender=function(t){var e=this;t.forEach((function(t,n){if(e.isItemExists(t))return!1;var o=(0,c.htmlToElement)(e.outputItemTemplate);o.querySelectorAll("[data-hs-combo-box-search-text]").forEach((function(e){var n,o;e.textContent=null!==(n=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==n?n:"",e.setAttribute("data-hs-combo-box-search-text",null!==(o=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==o?o:"")})),o.querySelectorAll("[data-hs-combo-box-output-item-attr]").forEach((function(e){JSON.parse(e.getAttribute("data-hs-combo-box-output-item-attr")).forEach((function(n){e.setAttribute(n.attr,t[n.valueFrom])}))})),o.setAttribute("tabIndex","".concat(n)),"tabs"!==e.groupingType&&"default"!==e.groupingType||o.setAttribute("data-hs-combo-box-output-item",'{"group": {"name": "'.concat(t[e.apiGroupField],'", "title": "').concat(t[e.apiGroupField],'"}}')),e.items=a(a([],e.items,!0),[o],!1),e.preventSelection||o.addEventListener("click",(function(){e.close(o.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text")),e.setSelectedByValue(e.valuesBySelector(o))})),e.appendItemsToWrapper(o)}))},e.prototype.setGroups=function(){var t=[];this.items.forEach((function(e){var n=JSON.parse(e.getAttribute("data-hs-combo-box-output-item")).group;t.some((function(t){return(null==t?void 0:t.name)===n.name}))||t.push(n)})),this.groups=t},e.prototype.setCurrent=function(){window.$hsComboBoxCollection.length&&(window.$hsComboBoxCollection.map((function(t){return t.element.isCurrent=!1})),this.isCurrent=!0)},e.prototype.setApiGroups=function(t){var e=this,n=[];t.forEach((function(t){var o=t[e.apiGroupField];n.some((function(t){return t.name===o}))||n.push({name:o,title:o})})),this.groups=n},e.prototype.sortItems=function(){return this.items.sort((function(t,e){var n=t.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text"),o=e.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text");return no?1:0}))},e.prototype.itemRender=function(t){var e=this,n=t.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text");this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t),this.preventSelection||t.addEventListener("click",(function(){e.close(n),e.setSelectedByValue(e.valuesBySelector(t))}))},e.prototype.plainRender=function(t){var e=this;t.forEach((function(t){e.itemRender(t)}))},e.prototype.groupTabsRender=function(){var t=this,e=(0,c.htmlToElement)(this.tabsWrapperTemplate),n=(0,c.htmlToElement)('
');e.append(n),this.output.insertBefore(e,this.output.firstChild);var o=(0,c.htmlToElement)(this.groupingTitleTemplate);o.setAttribute("data-hs-combo-box-group-title","all"),o.classList.add("--exclude-accessibility","active"),o.innerText="All",this.tabs=a(a([],this.tabs,!0),[o],!1),n.append(o),o.addEventListener("click",(function(){t.selectedGroup="all";var e=t.tabs.find((function(e){return e.getAttribute("data-hs-combo-box-group-title")===t.selectedGroup}));t.tabs.forEach((function(t){return t.classList.remove("active")})),e.classList.add("active"),t.setItemsVisibility()})),this.groups.forEach((function(e){var o=(0,c.htmlToElement)(t.groupingTitleTemplate);o.setAttribute("data-hs-combo-box-group-title",e.name),o.classList.add("--exclude-accessibility"),o.innerText=e.title,t.tabs=a(a([],t.tabs,!0),[o],!1),n.append(o),o.addEventListener("click",(function(){t.selectedGroup=e.name;var n=t.tabs.find((function(e){return e.getAttribute("data-hs-combo-box-group-title")===t.selectedGroup}));t.tabs.forEach((function(t){return t.classList.remove("active")})),n.classList.add("active"),t.setItemsVisibility()}))}))},e.prototype.groupDefaultRender=function(){var t=this;this.groups.forEach((function(e){var n=(0,c.htmlToElement)(t.groupingTitleTemplate);n.setAttribute("data-hs-combo-box-group-title",e.name),n.classList.add("--exclude-accessibility"),n.innerText=e.title,t.itemsWrapper?t.itemsWrapper.append(n):t.output.append(n);var o=t.sortItems().filter((function(t){return JSON.parse(t.getAttribute("data-hs-combo-box-output-item")).group.name===e.name}));t.plainRender(o)}))},e.prototype.itemsFromHtml=function(){if("default"===this.groupingType)this.groupDefaultRender();else if("tabs"===this.groupingType){var t=this.sortItems();this.groupTabsRender(),this.plainRender(t)}else{t=this.sortItems();this.plainRender(t)}this.setResults(this.input.value)},e.prototype.buildToggle=function(){var t=this;this.toggle.addEventListener("click",(function(){t.isOpened?t.close():t.open(t.toggle.getAttribute("data-hs-combo-box-toggle"))}))},e.prototype.setSelectedByValue=function(t){var e=this;this.items.forEach((function(n){e.isTextExists(n,t)?n.classList.add("selected"):n.classList.remove("selected")}))},e.prototype.setValue=function(t){this.selected=t,this.value=t,this.input.value=t},e.prototype.setItemsVisibility=function(){var t=this;"tabs"===this.groupingType&&"all"!==this.selectedGroup&&this.items.forEach((function(t){t.style.display="none"}));var e="tabs"===this.groupingType?"all"===this.selectedGroup?this.items:this.items.filter((function(e){return JSON.parse(e.getAttribute("data-hs-combo-box-output-item")).group.name===t.selectedGroup})):this.items;"tabs"===this.groupingType&&"all"!==this.selectedGroup&&e.forEach((function(t){t.style.display="block"})),e.forEach((function(e){t.isTextExistsAny(e,t.value)?e.style.display="block":e.style.display="none"})),"default"===this.groupingType&&this.output.querySelectorAll("[data-hs-combo-box-group-title]").forEach((function(e){var n=e.getAttribute("data-hs-combo-box-group-title");t.items.filter((function(t){return JSON.parse(t.getAttribute("data-hs-combo-box-output-item")).group.name===n&&"block"===t.style.display})).length?e.style.display="block":e.style.display="none"}))},e.prototype.hasVisibleItems=function(){return!!this.items.length&&this.items.some((function(t){return"block"===t.style.display}))},e.prototype.appendItemsToWrapper=function(t){this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t)},e.prototype.buildOutputPlaceholder=function(){this.outputPlaceholder||(this.outputPlaceholder=(0,c.htmlToElement)(this.outputEmptyTemplate)),this.appendItemsToWrapper(this.outputPlaceholder)},e.prototype.destroyOutputPlaceholder=function(){this.outputPlaceholder&&this.outputPlaceholder.remove(),this.outputPlaceholder=null},e.prototype.resultItems=function(){if(!this.items.length)return!1;this.setItemsVisibility(),this.setSelectedByValue([this.selected])},e.prototype.setValueAndOpen=function(t){this.value=t,this.items.length&&this.setItemsVisibility()},e.prototype.open=function(t){var e=this;return!this.animationInProcess&&(void 0!==t&&this.setValueAndOpen(t),!this.preventVisibility&&(this.animationInProcess=!0,this.output.style.display="block",this.recalculateDirection(),setTimeout((function(){e.el.classList.add("active"),e.animationInProcess=!1})),void(this.isOpened=!0)))},e.prototype.setValueAndClear=function(t){t?this.setValue(t):this.setValue(this.selected),this.outputPlaceholder&&this.destroyOutputPlaceholder()},e.prototype.close=function(t){var e=this;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t),!1):(this.animationInProcess=!0,this.el.classList.remove("active"),this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom="",(0,c.afterTransition)(this.output,(function(){e.output.style.display="none",e.setValueAndClear(t),e.animationInProcess=!1})),void(this.isOpened=!1)))},e.prototype.recalculateDirection=function(){(0,c.isEnoughSpace)(this.output,this.input,"bottom",this.gap,this.viewport)?(this.output.classList.remove("bottom-full"),this.output.style.marginBottom="",this.output.classList.add("top-full"),this.output.style.marginTop="".concat(this.gap,"px")):(this.output.classList.remove("top-full"),this.output.style.marginTop="",this.output.classList.add("bottom-full"),this.output.style.marginBottom="".concat(this.gap,"px"))},e.getInstance=function(t,e){var n=window.$hsComboBoxCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsComboBoxCollection||(window.$hsComboBoxCollection=[]),document.querySelectorAll("[data-hs-combo-box]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsComboBoxCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-combo-box"),o=n?JSON.parse(n):{};new e(t,o)}})),window.$hsComboBoxCollection&&(window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.close=function(t){var e=window.$hsComboBoxCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.isOpened&&e.element.close()},e.closeCurrentlyOpened=function(t){if(void 0===t&&(t=null),!t.closest("[data-hs-combo-box].active")){var e=window.$hsComboBoxCollection.filter((function(t){return t.element.isOpened}))||null;e&&e.forEach((function(t){t.element.close()}))}},e.getPreparedItems=function(t,e){return void 0===t&&(t=!1),e?(t?Array.from(e.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter((function(t){return"none"!==t.style.display})).reverse():Array.from(e.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter((function(t){return"none"!==t.style.display}))).filter((function(t){return!t.classList.contains("disabled")})):null},e.setHighlighted=function(t,e,n){e.focus(),n.value=e.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text"),t&&t.classList.remove("hs-combo-box-output-item-highlighted"),e.classList.add("hs-combo-box-output-item-highlighted")},e.accessibility=function(t){if(window.$hsComboBoxCollection.find((function(t){return t.element.isOpened}))&&d.COMBO_BOX_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}},e.onEscape=function(){var t=window.$hsComboBoxCollection.find((function(t){return!t.element.preventVisibility&&t.element.isOpened}));t&&(t.element.close(),t.element.input.blur())},e.onArrow=function(t){var n;void 0===t&&(t=!0);var o=window.$hsComboBoxCollection.find((function(t){return t.element.preventVisibility?t.element.isCurrent:t.element.isOpened}));if(o){var i=null!==(n=o.element.itemsWrapper)&&void 0!==n?n:o.element.output;if(!i)return!1;var r,s=e.getPreparedItems(t,i),l=i.querySelector(".hs-combo-box-output-item-highlighted");l||s[0].classList.add("hs-combo-box-output-item-highlighted");var a=s.findIndex((function(t){return t===l}));a+1=this.limit)return!1;this.el.hasAttribute("disabled")&&this.el.setAttribute("disabled","");var t=this.target.cloneNode(!0);this.addToItems(t),this.limit&&this.items.length>=this.limit&&this.el.setAttribute("disabled","disabled"),this.fireEvent("copy",t),(0,s.dispatch)("copy.hs.copyMarkup",t,t)},e.prototype.addPredefinedItems=function(){var t=this;Array.from(this.wrapper.children).filter((function(t){return!t.classList.contains("[--ignore-for-count]")})).forEach((function(e){t.addToItems(e)}))},e.prototype.setTarget=function(){var t="string"==typeof this.targetSelector?document.querySelector(this.targetSelector).cloneNode(!0):this.targetSelector.cloneNode(!0);t.removeAttribute("id"),this.target=t},e.prototype.setWrapper=function(){this.wrapper="string"==typeof this.wrapperSelector?document.querySelector(this.wrapperSelector):this.wrapperSelector},e.prototype.addToItems=function(t){var e=this,n=t.querySelector("[data-hs-copy-markup-delete-item]");this.wrapper?this.wrapper.append(t):this.el.before(t),n&&n.addEventListener("click",(function(){return e.delete(t)})),this.items.push(t)},e.prototype.delete=function(t){var e=this.items.indexOf(t);-1!==e&&this.items.splice(e,1),t.remove(),this.fireEvent("delete",t),(0,s.dispatch)("delete.hs.copyMarkup",t,t)},e.getInstance=function(t,e){var n=window.$hsCopyMarkupCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsCopyMarkupCollection||(window.$hsCopyMarkupCollection=[]),document.querySelectorAll("[data-hs-copy-markup]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsCopyMarkupCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-copy-markup"),o=n?JSON.parse(n):{};new e(t,o)}}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=l),e.default=l},610:function(t,e,n){ /* * HSDropdown - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i .hs-dropdown-toggle")||i.el.children[0],i.menu=i.el.querySelector(":scope > .hs-dropdown-menu"),i.eventMode=(0,s.getClassProperty)(i.el,"--trigger","click"),i.closeMode=(0,s.getClassProperty)(i.el,"--auto-close","true"),i.animationInProcess=!1,i.toggle&&i.menu&&i.init(),i}return i(e,t),e.prototype.init=function(){var t=this;if(this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle.addEventListener("click",(function(){return t.onClickHandler()})),(0,s.isIOS)()||(0,s.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return t.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return t.onMouseLeaveHandler()})))},e.prototype.resizeHandler=function(){this.eventMode=(0,s.getClassProperty)(this.el,"--trigger","click")},e.prototype.onClickHandler=function(){this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?this.close():this.open()},e.prototype.onMouseEnterHandler=function(){if("hover"!==this.eventMode)return!1;this.el._popper&&this.forceClearState(),!this.el.classList.contains("open")&&this.menu.classList.contains("hidden")&&this.open()},e.prototype.onMouseLeaveHandler=function(){if("hover"!==this.eventMode)return!1;this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")&&this.close()},e.prototype.destroyPopper=function(){this.menu.classList.remove("block"),this.menu.classList.add("hidden"),this.menu.style.inset=null,this.menu.style.position=null,this.el&&this.el._popper&&this.el._popper.destroy(),this.animationInProcess=!1},e.prototype.absoluteStrategyModifiers=function(){var t=this;return[{name:"applyStyles",fn:function(e){var n=(window.getComputedStyle(t.el).getPropertyValue("--strategy")||"absolute").replace(" ",""),o=(window.getComputedStyle(t.el).getPropertyValue("--adaptive")||"adaptive").replace(" ","");e.state.elements.popper.style.position=n,e.state.elements.popper.style.transform="adaptive"===o?e.state.styles.popper.transform:null,e.state.elements.popper.style.top=null,e.state.elements.popper.style.bottom=null,e.state.elements.popper.style.left=null,e.state.elements.popper.style.right=null,e.state.elements.popper.style.margin=0}},{name:"computeStyles",options:{adaptive:!1}}]},e.prototype.open=function(){var t=this;if(this.el.classList.contains("open"))return!1;if(this.animationInProcess)return!1;this.animationInProcess=!0;var e=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),n=(window.getComputedStyle(this.el).getPropertyValue("--flip")||"true").replace(" ",""),o=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),i=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ",""));"static"!==o&&(this.el._popper=(0,l.createPopper)(this.el,this.menu,{placement:c.POSITIONS[e]||"bottom-start",strategy:o,modifiers:r(r([],"fixed"!==o?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===n},{name:"offset",options:{offset:[0,i]}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){t.el.classList.add("open"),t.animationInProcess=!1})),this.fireEvent("open",this.el),(0,s.dispatch)("open.hs.dropdown",this.el,this.el)},e.prototype.close=function(t){var e=this;if(void 0===t&&(t=!0),this.animationInProcess||!this.el.classList.contains("open"))return!1;if(this.animationInProcess=!0,t){var n=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,s.afterTransition)(n,(function(){return e.destroyPopper()}))}else this.destroyPopper();this.menu.style.margin=null,this.el.classList.remove("open"),this.fireEvent("close",this.el),(0,s.dispatch)("close.hs.dropdown",this.el,this.el)},e.prototype.forceClearState=function(){this.destroyPopper(),this.menu.style.margin=null,this.el.classList.remove("open")},e.getInstance=function(t,e){var n=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.autoInit=function(){if(window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),document.querySelectorAll(".hs-dropdown:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDropdownCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)})),window.$hsDropdownCollection){document.addEventListener("keydown",(function(t){return e.accessibility(t)})),window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)}));var t=window.innerWidth;window.addEventListener("resize",(function(){window.innerWidth!==t&&(t=innerWidth,e.closeCurrentlyOpened(null,!1))}))}},e.open=function(t){var e=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.menu.classList.contains("hidden")&&e.element.open()},e.close=function(t){var e=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&!e.element.menu.classList.contains("hidden")&&e.element.close()},e.accessibility=function(t){this.history=s.menuSearchHistory;var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e&&(c.DROPDOWN_ACCESSIBILITY_KEY_SET.includes(t.code)||4===t.code.length&&t.code[t.code.length-1].match(/^[A-Z]*$/))&&!t.metaKey&&!e.element.menu.querySelector("input:focus"))switch(console.log("Key code:",t.code),t.code){case"Escape":e.element.menu.querySelector(".hs-select.active")||(t.preventDefault(),this.onEscape(t));break;case"Enter":e.element.menu.querySelector(".hs-select button:focus")||e.element.menu.querySelector(".hs-collapse-toggle:focus")||this.onEnter(t);break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;default:t.preventDefault(),this.onFirstLetter(t.key)}},e.onEscape=function(t){var e=t.target.closest(".hs-dropdown.open");if(window.$hsDropdownCollection.find((function(t){return t.element.el===e}))){var n=window.$hsDropdownCollection.find((function(t){return t.element.el===e}));n&&(n.element.close(),n.element.toggle.focus())}else this.closeCurrentlyOpened()},e.onEnter=function(t){var e=t.target.parentElement;if(window.$hsDropdownCollection.find((function(t){return t.element.el===e}))){t.preventDefault();var n=window.$hsDropdownCollection.find((function(t){return t.element.el===e}));n&&n.element.open()}},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e){var n=e.element.menu;if(!n)return!1;var o=(t?Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])")).reverse():Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector("a:focus, button:focus"),r=o.findIndex((function(t){return t===i}));r+1 .hs-dropdown-toggle")||i.el.children[0],i.menu=i.el.querySelector(":scope > .hs-dropdown-menu"),i.eventMode=(0,s.getClassProperty)(i.el,"--trigger","click"),i.closeMode=(0,s.getClassProperty)(i.el,"--auto-close","true"),i.animationInProcess=!1,i.toggle&&i.menu&&i.init(),i}return i(e,t),e.prototype.init=function(){var t=this;if(this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle.addEventListener("click",(function(){return t.onClickHandler()})),(0,s.isIOS)()||(0,s.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return t.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return t.onMouseLeaveHandler()})))},e.prototype.resizeHandler=function(){this.eventMode=(0,s.getClassProperty)(this.el,"--trigger","click")},e.prototype.onClickHandler=function(){this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?this.close():this.open()},e.prototype.onMouseEnterHandler=function(){if("hover"!==this.eventMode)return!1;this.el._popper&&this.forceClearState(),!this.el.classList.contains("open")&&this.menu.classList.contains("hidden")&&this.open()},e.prototype.onMouseLeaveHandler=function(){if("hover"!==this.eventMode)return!1;this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")&&this.close()},e.prototype.destroyPopper=function(){this.menu.classList.remove("block"),this.menu.classList.add("hidden"),this.menu.style.inset=null,this.menu.style.position=null,this.el&&this.el._popper&&this.el._popper.destroy(),this.animationInProcess=!1},e.prototype.absoluteStrategyModifiers=function(){var t=this;return[{name:"applyStyles",fn:function(e){var n=(window.getComputedStyle(t.el).getPropertyValue("--strategy")||"absolute").replace(" ",""),o=(window.getComputedStyle(t.el).getPropertyValue("--adaptive")||"adaptive").replace(" ","");e.state.elements.popper.style.position=n,e.state.elements.popper.style.transform="adaptive"===o?e.state.styles.popper.transform:null,e.state.elements.popper.style.top=null,e.state.elements.popper.style.bottom=null,e.state.elements.popper.style.left=null,e.state.elements.popper.style.right=null,e.state.elements.popper.style.margin=0}},{name:"computeStyles",options:{adaptive:!1}}]},e.prototype.open=function(){var t=this;if(this.el.classList.contains("open"))return!1;if(this.animationInProcess)return!1;this.animationInProcess=!0;var e=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),n=(window.getComputedStyle(this.el).getPropertyValue("--flip")||"true").replace(" ",""),o=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),i=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ",""));"static"!==o&&(this.el._popper=(0,l.createPopper)(this.el,this.menu,{placement:c.POSITIONS[e]||"bottom-start",strategy:o,modifiers:r(r([],"fixed"!==o?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===n},{name:"offset",options:{offset:[0,i]}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){t.el.classList.add("open"),t.animationInProcess=!1})),this.fireEvent("open",this.el),(0,s.dispatch)("open.hs.dropdown",this.el,this.el)},e.prototype.close=function(t){var e=this;if(void 0===t&&(t=!0),this.animationInProcess||!this.el.classList.contains("open"))return!1;if(this.animationInProcess=!0,t){var n=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,s.afterTransition)(n,(function(){return e.destroyPopper()}))}else this.destroyPopper();this.menu.style.margin=null,this.el.classList.remove("open"),this.fireEvent("close",this.el),(0,s.dispatch)("close.hs.dropdown",this.el,this.el)},e.prototype.forceClearState=function(){this.destroyPopper(),this.menu.style.margin=null,this.el.classList.remove("open")},e.getInstance=function(t,e){var n=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.autoInit=function(){if(window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),document.querySelectorAll(".hs-dropdown:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDropdownCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)})),window.$hsDropdownCollection){document.addEventListener("keydown",(function(t){return e.accessibility(t)})),window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)}));var t=window.innerWidth;window.addEventListener("resize",(function(){window.innerWidth!==t&&(t=innerWidth,e.closeCurrentlyOpened(null,!1))}))}},e.open=function(t){var e=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.menu.classList.contains("hidden")&&e.element.open()},e.close=function(t){var e=window.$hsDropdownCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&!e.element.menu.classList.contains("hidden")&&e.element.close()},e.accessibility=function(t){this.history=s.menuSearchHistory;var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e&&(c.DROPDOWN_ACCESSIBILITY_KEY_SET.includes(t.code)||4===t.code.length&&t.code[t.code.length-1].match(/^[A-Z]*$/))&&!t.metaKey&&!e.element.menu.querySelector("input:focus"))switch(t.code){case"Escape":e.element.menu.querySelector(".hs-select.active")||(t.preventDefault(),this.onEscape(t));break;case"Enter":e.element.menu.querySelector(".hs-select button:focus")||e.element.menu.querySelector(".hs-collapse-toggle:focus")||this.onEnter(t);break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;default:t.preventDefault(),this.onFirstLetter(t.key)}},e.onEscape=function(t){var e=t.target.closest(".hs-dropdown.open");if(window.$hsDropdownCollection.find((function(t){return t.element.el===e}))){var n=window.$hsDropdownCollection.find((function(t){return t.element.el===e}));n&&(n.element.close(),n.element.toggle.focus())}else this.closeCurrentlyOpened()},e.onEnter=function(t){var e=t.target.parentElement;if(window.$hsDropdownCollection.find((function(t){return t.element.el===e}))){t.preventDefault();var n=window.$hsDropdownCollection.find((function(t){return t.element.el===e}));n&&n.element.open()}},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e){var n=e.element.menu;if(!n)return!1;var o=(t?Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])")).reverse():Array.from(n.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector("a:focus, button:focus"),r=o.findIndex((function(t){return t===i}));r+10?l.step:1,o.init(),o}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsInputNumberCollection,this),this.input&&this.increment&&this.build()},e.prototype.build=function(){this.input&&this.buildInput(),this.increment&&this.buildIncrement(),this.decrement&&this.buildDecrement(),this.inputValue<=0&&0===this.minInputValue&&(this.inputValue=0,this.input.value="0"),(this.inputValue<=0||this.minInputValue<0)&&this.changeValue(),this.input.hasAttribute("disabled")&&this.disableButtons()},e.prototype.buildInput=function(){var t=this;this.input.addEventListener("input",(function(){return t.changeValue()}))},e.prototype.buildIncrement=function(){var t=this;this.increment.addEventListener("click",(function(){t.changeValue("increment")}))},e.prototype.buildDecrement=function(){var t=this;this.decrement.addEventListener("click",(function(){t.changeValue("decrement")}))},e.prototype.changeValue=function(t){var e,n;void 0===t&&(t="none");var o={inputValue:this.inputValue},i=null!==(e=this.minInputValue)&&void 0!==e?e:Number.MIN_SAFE_INTEGER,r=null!==(n=this.maxInputValue)&&void 0!==n?n:Number.MAX_SAFE_INTEGER;switch(this.inputValue=isNaN(this.inputValue)?0:this.inputValue,t){case"increment":var l=this.inputValue+this.step;this.inputValue=l>=i&&l<=r?l:r,this.input.value=this.inputValue.toString();break;case"decrement":var a=this.inputValue-this.step;this.inputValue=a>=i&&a<=r?a:i,this.input.value=this.inputValue.toString();break;default:var c=isNaN(parseInt(this.input.value))?0:parseInt(this.input.value);this.inputValue=c>=r?r:c<=i?i:c,this.inputValue<=i&&(this.input.value=this.inputValue.toString())}o.inputValue=this.inputValue,this.inputValue===i?(this.el.classList.add("disabled"),this.decrement&&this.disableButtons("decrement")):(this.el.classList.remove("disabled"),this.decrement&&this.enableButtons("decrement")),this.inputValue===r?(this.el.classList.add("disabled"),this.increment&&this.disableButtons("increment")):(this.el.classList.remove("disabled"),this.increment&&this.enableButtons("increment")),this.fireEvent("change",o),(0,s.dispatch)("change.hs.inputNumber",this.el,o)},e.prototype.disableButtons=function(t){void 0===t&&(t="all"),"all"===t?("BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.setAttribute("disabled","disabled"),"BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.setAttribute("disabled","disabled")):"increment"===t?"BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.setAttribute("disabled","disabled"):"decrement"===t&&("BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.setAttribute("disabled","disabled"))},e.prototype.enableButtons=function(t){void 0===t&&(t="all"),"all"===t?("BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.removeAttribute("disabled"),"BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.removeAttribute("disabled")):"increment"===t?"BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.removeAttribute("disabled"):"decrement"===t&&("BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.removeAttribute("disabled"))},e.getInstance=function(t,e){var n=window.$hsInputNumberCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsInputNumberCollection||(window.$hsInputNumberCollection=[]),document.querySelectorAll("[data-hs-input-number]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsInputNumberCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=l),e.default=l},770:function(t,e,n){ /* * HSOverlay - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n-1?e[(o+1)%e.length].focus():e[0].focus()},e.on=function(t,e,n){var o=window.$hsOverlayCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)||t.element.overlay===("string"==typeof e?document.querySelector(e):e)}));o&&(o.element.events[t]=n)},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSOverlay=l),e.default=l},659:function(t,e,n){ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=t?(document.body.classList.add("hs-overlay-body-open"),e.element.overlay.classList.add("opened")):e.element.close(!0)},e.accessibility=function(t){var e,n,o=window.$hsOverlayCollection.filter((function(t){return t.element.overlay.classList.contains("open")})),i=o[o.length-1],r=null===(n=null===(e=null==i?void 0:i.element)||void 0===e?void 0:e.overlay)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),l=[];(null==r?void 0:r.length)&&r.forEach((function(t){(0,s.isParentOrElementHidden)(t)||l.push(t)}));var a=i&&!t.metaKey;if(a&&!i.element.isTabAccessibilityLimited&&"Tab"===t.code)return!1;a&&l.length&&"Tab"===t.code&&(t.preventDefault(),this.onTab(i,l)),a&&"Escape"===t.code&&(t.preventDefault(),this.onEscape(i))},e.onEscape=function(t){t&&t.element.hasAbilityToCloseOnBackdropClick&&t.element.close()},e.onTab=function(t,e){if(!e.length)return!1;var n=t.element.overlay.querySelector(":focus"),o=Array.from(e).indexOf(n);o>-1?e[(o+1)%e.length].focus():e[0].focus()},e.on=function(t,e,n){var o=window.$hsOverlayCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)||t.element.overlay===("string"==typeof e?document.querySelector(e):e)}));o&&(o.element.events[t]=n)},e}(n(737).default);window.addEventListener("load",(function(){a.autoInit()})),window.addEventListener("resize",(function(){!function(){if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((function(t){return t.element.autoClose})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.autoClose})).forEach((function(t){document.body.clientWidth>=t.element.autoClose&&t.element.close(!0)}))}(),function(){if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((function(t){return t.element.openedBreakpoint})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.openedBreakpoint})).forEach((function(t){a.setOpened(t.element.openedBreakpoint,t)}))}()})),"undefined"!=typeof window&&(window.HSOverlay=a),e.default=a},659:function(t,e,n){ /* * HSPinInput - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -73,7 +81,7 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&this.items[e-1].focus()},e.prototype.onKeydown=function(t,e){"Backspace"===t.key&&e>0&&(""===this.items[e].value?(this.items[e-1].value="",this.items[e-1].focus()):this.items[e].value=""),this.setCurrentValue(),this.toggleCompleted()},e.prototype.onFocusIn=function(t){this.items[t].setAttribute("placeholder","")},e.prototype.onFocusOut=function(t){this.items[t].setAttribute("placeholder",this.placeholders[t])},e.prototype.onPaste=function(t){var e=this;t.preventDefault(),this.items.forEach((function(n){document.activeElement===n&&e.autoFillAll(t.clipboardData.getData("text"))}))},e.getInstance=function(t,e){var n=window.$hsPinInputCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsPinInputCollection||(window.$hsPinInputCollection=[]),document.querySelectorAll("[data-hs-pin-input]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsPinInputCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=l),e.default=l},139:function(t,e,n){ /* * HSRemoveElement - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -81,7 +89,7 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0){if(this.activeSection===e)return!1;this.links.forEach((function(t){t.classList.remove("active")}));var a=this.el.querySelector('[href="#'.concat(e.getAttribute("id"),'"]'));if(a){a.classList.add("active");var c=a.closest("[data-hs-scrollspy-group]");if(c){var u=c.querySelector("[href]");u&&u.classList.add("active")}}this.activeSection=e}},e.prototype.scrollTo=function(t){var e=t.getAttribute("href"),n=document.querySelector(e),o=parseInt((0,r.getClassProperty)(this.el,"--scrollspy-offset","0")),i=parseInt((0,r.getClassProperty)(n,"--scrollspy-offset"))||o,s=this.scrollable===document?0:this.scrollable.offsetTop,l=n.offsetTop-i-s,a=this.scrollable===document?window:this.scrollable,c=function(){window.history.replaceState(null,null,t.getAttribute("href")),"scrollTo"in a&&a.scrollTo({top:l,left:0,behavior:"smooth"})},u=this.fireEvent("beforeScroll",this.el);(0,r.dispatch)("beforeScroll.hs.scrollspy",this.el,this.el),u instanceof Promise?u.then((function(){return c()})):c()},e.getInstance=function(t,e){void 0===e&&(e=!1);var n=window.$hsScrollspyCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element.el:null},e.autoInit=function(){window.$hsScrollspyCollection||(window.$hsScrollspyCollection=[]),document.querySelectorAll("[data-hs-scrollspy]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsScrollspyCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){s.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=s),e.default=s},961:function(t,e,n){ /* * HSTogglePassword - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&i[i.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]",o.dropdownClasses=l.dropdownClasses||"absolute top-full z-[1] w-full bg-white border border-gray-200 rounded-md hidden mt-2",o.dropdownItemTemplate=l.dropdownItemTemplate||"
",o.dropdownItemTemplatesByType=l.dropdownItemTemplatesByType||null,o.dropdownItemClasses=l.dropdownItemClasses||"py-2 px-4 w-full cursor-pointer text-sm hover:bg-gray-300 hover:text-black",o.highlightedTextTagName=l.highlightedTextTagName||"u",o.highlightedTextClasses=l.highlightedTextClasses||"bg-green-200",o.jsonUrl&&o.fetchData().then((function(){return o.init()})),o}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsSearchByJsonCollection,this),this.buildDropdown(),this.el.addEventListener("input",(0,a.debounce)((function(e){t.val=e.target.value,t.val.length>t.minChars?t.searchData(t.val):t.result=[],t.result.length?t.dropdown.classList.remove("hidden"):t.dropdown.classList.add("hidden"),t.buildItems(),console.log("result:",t.result)})))},e.prototype.fetchData=function(){return s(this,void 0,void 0,(function(){var t=this;return l(this,(function(e){switch(e.label){case 0:return[4,fetch(this.jsonUrl).then((function(t){return t.json()})).then((function(e){return t.json=e}))];case 1:return e.sent(),[2]}}))}))},e.prototype.searchData=function(t){this.result=this.json.filter((function(e){var n=t.toLowerCase(),o=e.title.toLowerCase(),i=e.description.toLowerCase();return o.includes(n)||i.includes(n)}))},e.prototype.buildDropdown=function(){this.dropdown=(0,a.htmlToElement)(this.dropdownTemplate),this.dropdownClasses&&(0,a.classToClassList)(this.dropdownClasses,this.dropdown),this.el.after(this.dropdown)},e.prototype.buildItems=function(){var t=this;this.dropdown.innerHTML="",this.result.forEach((function(e){var n=(0,a.htmlToElement)(''));n.append(t.itemTemplate(e)),t.dropdown.append(n)}))},e.prototype.itemTemplate=function(t){var e=new RegExp(this.val,"gi"),n=t.title.replace(e,"<".concat(this.highlightedTextTagName,' class="inline-block ').concat(this.highlightedTextClasses,'">').concat(this.val,"")),o=t.description.replace(e,"<".concat(this.highlightedTextTagName,' class="inline-block ').concat(this.highlightedTextClasses,'">').concat(this.val,"")),i=this.dropdownItemTemplatesByType?this.dropdownItemTemplatesByType.find((function(e){return e.type===t.type})):null,r=i?(0,a.htmlToElement)(i.markup):(0,a.htmlToElement)(this.dropdownItemTemplate);this.dropdownItemClasses&&(0,a.classToClassList)(this.dropdownItemClasses,r);var s=r.querySelector("[data-title]");s?s.append((0,a.htmlToElement)("".concat(n,""))):r.append((0,a.htmlToElement)("".concat(n,"")));var l=r.querySelector("[data-description]");if(l)l.append((0,a.htmlToElement)("".concat(o,"")));else if(!i){var c=(0,a.htmlToElement)("
");r.append(c),r.append((0,a.htmlToElement)("".concat(o,"")))}return r},e.getInstance=function(t){var e=window.$hsSearchByJsonCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return e?e.element:null},e.autoInit=function(){window.$hsSearchByJsonCollection||(window.$hsSearchByJsonCollection=[]),document.querySelectorAll("[data-hs-search-by-json]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsSearchByJsonCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){c.autoInit()})),"undefined"!=typeof window&&(window.HSSearchByJson=c),e.default=c},233:function(t,e,n){ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&i[i.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]",o.dropdownClasses=l.dropdownClasses||"absolute top-full z-[1] w-full bg-white border border-gray-200 rounded-md hidden mt-2",o.dropdownItemTemplate=l.dropdownItemTemplate||"
",o.dropdownItemTemplatesByType=l.dropdownItemTemplatesByType||null,o.dropdownItemClasses=l.dropdownItemClasses||"py-2 px-4 w-full cursor-pointer text-sm hover:bg-gray-300 hover:text-black",o.highlightedTextTagName=l.highlightedTextTagName||"u",o.highlightedTextClasses=l.highlightedTextClasses||"bg-green-200",o.jsonUrl&&o.fetchData().then((function(){return o.init()})),o}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsSearchByJsonCollection,this),this.buildDropdown(),this.el.addEventListener("input",(0,a.debounce)((function(e){t.val=e.target.value,t.val.length>t.minChars?t.searchData(t.val):t.result=[],t.result.length?t.dropdown.classList.remove("hidden"):t.dropdown.classList.add("hidden"),t.buildItems()})))},e.prototype.fetchData=function(){return s(this,void 0,void 0,(function(){var t=this;return l(this,(function(e){switch(e.label){case 0:return[4,fetch(this.jsonUrl).then((function(t){return t.json()})).then((function(e){return t.json=e}))];case 1:return e.sent(),[2]}}))}))},e.prototype.searchData=function(t){this.result=this.json.filter((function(e){var n=t.toLowerCase(),o=e.title.toLowerCase(),i=e.description.toLowerCase();return o.includes(n)||i.includes(n)}))},e.prototype.buildDropdown=function(){this.dropdown=(0,a.htmlToElement)(this.dropdownTemplate),this.dropdownClasses&&(0,a.classToClassList)(this.dropdownClasses,this.dropdown),this.el.after(this.dropdown)},e.prototype.buildItems=function(){var t=this;this.dropdown.innerHTML="",this.result.forEach((function(e){var n=(0,a.htmlToElement)(''));n.append(t.itemTemplate(e)),t.dropdown.append(n)}))},e.prototype.itemTemplate=function(t){var e=new RegExp(this.val,"gi"),n=t.title.replace(e,"<".concat(this.highlightedTextTagName,' class="inline-block ').concat(this.highlightedTextClasses,'">').concat(this.val,"")),o=t.description.replace(e,"<".concat(this.highlightedTextTagName,' class="inline-block ').concat(this.highlightedTextClasses,'">').concat(this.val,"")),i=this.dropdownItemTemplatesByType?this.dropdownItemTemplatesByType.find((function(e){return e.type===t.type})):null,r=i?(0,a.htmlToElement)(i.markup):(0,a.htmlToElement)(this.dropdownItemTemplate);this.dropdownItemClasses&&(0,a.classToClassList)(this.dropdownItemClasses,r);var s=r.querySelector("[data-title]");s?s.append((0,a.htmlToElement)("".concat(n,""))):r.append((0,a.htmlToElement)("".concat(n,"")));var l=r.querySelector("[data-description]");if(l)l.append((0,a.htmlToElement)("".concat(o,"")));else if(!i){var c=(0,a.htmlToElement)("
");r.append(c),r.append((0,a.htmlToElement)("".concat(o,"")))}return r},e.getInstance=function(t){var e=window.$hsSearchByJsonCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return e?e.element:null},e.autoInit=function(){window.$hsSearchByJsonCollection||(window.$hsSearchByJsonCollection=[]),document.querySelectorAll("[data-hs-search-by-json]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsSearchByJsonCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){c.autoInit()})),"undefined"!=typeof window&&(window.HSSearchByJson=c),e.default=c},233:function(t,e,n){ /* * HSSelect - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n"),e=this.toggle.querySelector("[data-icon]"),n=this.toggle.querySelector("[data-title]"),!this.isMultiple&&e&&this.setToggleIcon(),!this.isMultiple&&n&&this.setToggleTitle(),this.isMultiple?this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder:this.toggleTextWrapper.innerHTML=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder,n||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,l.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),this.toggle.addEventListener("click",(function(){if(o.isDisabled)return!1;o.isOpened?o.close():o.open()}))},e.prototype.setToggleIcon=function(){var t,e,n=this.toggle.querySelector("[data-icon]");if(n.innerHTML="",n){var o=(0,l.htmlToElement)((null===(e=null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.options)||void 0===e?void 0:e.icon)||"");n.append(o),o?n.classList.remove("hidden"):n.classList.add("hidden")}},e.prototype.setToggleTitle=function(){var t,e=this.toggle.querySelector("[data-title]");if(e.classList.add("truncate"),e.innerHTML="",e){var n=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder;e.innerHTML=n,this.toggle.append(e)}},e.prototype.buildTags=function(){this.tags=document.createElement("div"),this.tags.classList.add("flex"),this.tagsClasses&&(0,l.classToClassList)(this.tagsClasses,this.tags),this.buildTagsInput(),this.buildTagsItems(),this.setTagsItems(),this.wrapper&&this.wrapper.append(this.tags)},e.prototype.buildTagsItems=function(){this.tagsItems=document.createElement("div"),this.tagsItems.classList.add("flex","flex-wrap","flex-0","items-center"),this.setTagsItems(),this.tags.append(this.tagsItems)},e.prototype.buildTagsItem=function(t){var e,n,o,i,r,s,a,c=this,u=this.getItemByValue(t),d=document.createElement("div");if(this.tagsItemClasses&&(0,l.classToClassList)(this.tagsItemClasses,d),this.tagsItemTemplate&&(i=(0,l.htmlToElement)(this.tagsItemTemplate),d.append(i)),null===(e=null==u?void 0:u.options)||void 0===e?void 0:e.icon){var p=(0,l.htmlToElement)(null===(n=null==u?void 0:u.options)||void 0===n?void 0:n.icon);(a=i?i.querySelector("[data-icon]"):document.createElement("span")).append(p),i||d.append(a)}i&&i.querySelector("[data-icon]")&&!(null===(o=null==u?void 0:u.options)||void 0===o?void 0:o.icon)&&i.querySelector("[data-icon]").classList.add("hidden"),(r=i?i.querySelector("[data-title]"):document.createElement("span")).textContent=u.title||"",i||d.append(r),i?s=i.querySelector("[data-remove]"):((s=document.createElement("span")).textContent="X",d.append(s)),s.addEventListener("click",(function(){c.value=c.value.filter((function(e){return e!==t})),c.unselectMultipleItems(),c.setTagsItems(),c.selectMultipleItems()})),this.tagsItems.append(d)},e.prototype.getItemByValue=function(t){return this.selectOptions.find((function(e){return e.val===t}))},e.prototype.setTagsItems=function(){var t=this;this.tagsItems.innerHTML="",this.value&&(this.value.forEach((function(e){t.buildTagsItem(e)})),this.tagsInput.readOnly=!0),this.value.length||(this.tagsInput.placeholder=this.placeholder,this.tagsInput.readOnly=!1)},e.prototype.buildTagsInput=function(){var t=this;this.tagsInput=document.createElement("input"),this.tagsInput.placeholder=this.placeholder,this.tagsInputClasses&&(0,l.classToClassList)(this.tagsInputClasses,this.tagsInput),this.tagsInput.addEventListener("focus",(function(){return t.open()})),this.tagsInput.addEventListener("input",(0,l.debounce)((function(e){return t.searchOptions(e.target.value)}))),this.tagsInput.addEventListener("keydown",(function(e){if("Enter"===e.key&&t.isAddTagOnEnter){var n=e.target.value;if(t.selectOptions.find((function(t){return t.val===n})))return!1;t.addSelectOption(n,n),t.buildOption(n,n),t.dropdown.querySelector('[data-value="'.concat(n,'"]')).click(),t.resetTagsInputField(),t.close()}})),this.tags.append(this.tagsInput)},e.prototype.buildDropdown=function(){var t=this;this.dropdown=(0,l.htmlToElement)(this.dropdownTag||"
"),this.dropdown.classList.add("absolute","top-full"),this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,l.classToClassList)(this.dropdownClasses,this.dropdown),this.wrapper&&this.wrapper.append(this.dropdown),this.dropdown&&this.hasSearch&&this.buildSearch(),this.selectOptions&&this.selectOptions.forEach((function(e,n){return t.buildOption(e.title,e.val,e.options,"".concat(n))}))},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,l.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,l.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]"),this.search=(0,l.htmlToElement)(''),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,l.classToClassList)(this.searchClasses,this.search),this.search.addEventListener("input",(0,l.debounce)((function(t){return e.searchOptions(t.target.value)}))),t?t.append(this.search):this.searchWrapper.append(this.search),this.dropdown.append(this.searchWrapper)},e.prototype.buildOption=function(t,e,n,o){var i=this;void 0===o&&(o="1");var r=null,s=(0,l.htmlToElement)(this.optionTag||"
");if(s.setAttribute("data-value",e),s.setAttribute("data-title-value",t),s.setAttribute("tabIndex",o),s.classList.add("cursor-pointer"),this.optionTemplate&&(r=(0,l.htmlToElement)(this.optionTemplate),s.append(r)),r?r.querySelector("[data-title]").textContent=t||"":s.textContent=t||"",n){if(n.icon){var a=(0,l.htmlToElement)(n.icon);if(a.classList.add("mw-full"),r)r.querySelector("[data-icon]").append(a);else{var c=(0,l.htmlToElement)("
");this.iconClasses&&(0,l.classToClassList)(this.iconClasses,c),c.append(a),s.append(c)}}if(n.description)if(r)r.querySelector("[data-description]").append(n.description);else{var u=(0,l.htmlToElement)("
");u.textContent=n.description,this.descriptionClasses&&(0,l.classToClassList)(this.descriptionClasses,u),s.append(u)}}r&&r.querySelector("[data-icon]")&&!n&&!(null==n?void 0:n.icon)&&r.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&s.classList.add("selected"),s.addEventListener("click",(function(){return i.onSelectOption(e)})),this.optionClasses&&(0,l.classToClassList)(this.optionClasses,s),this.dropdown&&this.dropdown.append(s)},e.prototype.destroyOption=function(t){var e=this.dropdown.querySelector('[data-value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.buildOriginalOption=function(t,e,n){var o=(0,l.htmlToElement)("");o.setAttribute("value",e),o.setAttribute("data-hs-select-option",JSON.stringify(n)),o.innerText=t,this.el.append(o)},e.prototype.destroyOriginalOption=function(t){var e=this.el.querySelector('[value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.onSelectOption=function(t){this.clearSelections(),this.isMultiple?(this.value=this.value.includes(t)?Array.from(this.value).filter((function(e){return e!==t})):s(s([],Array.from(this.value),!0),[t],!1),this.selectMultipleItems(),this.setNewValue()):(this.value=t,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),(0,l.dispatch)("change.hs.select",this.el,this.value),"tags"===this.mode&&this.resetTagsInputField(),this.isMultiple||(this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.close()),this.value.length||"tags"!==this.mode||(this.tagsInput.placeholder=this.placeholder)},e.prototype.addSelectOption=function(t,e,n){this.selectOptions=s(s([],this.selectOptions,!0),[{title:t,val:e,options:n}],!1)},e.prototype.removeSelectOption=function(t){if(!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t}))},e.prototype.resetTagsInputField=function(){this.tagsInput.value="",this.tagsInput.placeholder="",this.searchOptions("")},e.prototype.clearSelections=function(){Array.from(this.dropdown.children).forEach((function(t){t.classList.contains("selected")&&t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){t.selected&&(t.selected=!1)}))},e.prototype.setNewValue=function(){"tags"===this.mode?this.setTagsItems():this.value.length?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.stringFromValue=function(){var t=this,e=[];return this.selectOptions.forEach((function(n){t.isMultiple?t.value.includes(n.val)&&e.push(n.title):t.value===n.val&&e.push(n.title)})),this.toggleCountText&&""!==this.toggleCountText&&e.length>=this.toggleCountTextMinItems?"".concat(e.length," ").concat(this.toggleCountText):e.join(", ")},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0,Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")})).classList.add("selected")},e.prototype.selectMultipleItems=function(){var t=this;Array.from(this.dropdown.children).filter((function(e){return t.value.includes(e.getAttribute("data-value"))})).forEach((function(t){return t.classList.add("selected")})),Array.from(this.el.children).filter((function(e){return t.value.includes(e.value)})).forEach((function(t){return t.selected=!0}))},e.prototype.unselectMultipleItems=function(){Array.from(this.dropdown.children).forEach((function(t){return t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){return t.selected=!1}))},e.prototype.searchOptions=function(t){this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,l.htmlToElement)(""),this.searchNoResult.innerText=this.searchNoResultText,(0,l.classToClassList)(this.searchNoResultClasses,this.searchNoResult);var e=this.dropdown.querySelectorAll("[data-value]"),n=!1;e.forEach((function(e){e.getAttribute("data-title-value").toLowerCase().includes(t.toLowerCase())?(e.classList.remove("hidden"),n=!0):e.classList.add("hidden")})),n||this.dropdown.append(this.searchNoResult)},e.prototype.eraseToggleIcon=function(){var t=this.toggle.querySelector("[data-icon]");t&&(t.innerHTML=null,t.classList.add("hidden"))},e.prototype.eraseToggleTitle=function(){var t=this.toggle.querySelector("[data-title]");t?t.innerHTML=this.placeholder:this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.destroy=function(){var t=this.el.parentElement.parentElement;this.el.classList.remove("hidden"),this.el.style.display="",t.prepend(this.el),t.querySelector(".hs-select").remove(),this.wrapper=null},e.prototype.open=function(){var t=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){t.wrapper.classList.add("active"),t.dropdown.classList.add("opened"),t.hasSearch&&t.search.focus(),t.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,n,o=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,l.afterTransition)(this.dropdown,(function(){o.dropdown.classList.add("hidden"),o.hasSearch&&(o.search.value="",o.search.dispatchEvent(new Event("input",{bubbles:!0})),o.search.blur()),o.animationInProcess=!1})),null===(n=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===n||n.classList.remove("hs-select-option-highlighted"),this.isOpened=!1},e.prototype.addOption=function(t){var e=this,n="".concat(this.selectOptions.length),o=function(t){var o=t.title,i=t.val,r=t.options;!!e.selectOptions.some((function(t){return t.val===i}))||(e.addSelectOption(o,i,r),e.buildOption(o,i,r,n),e.buildOriginalOption(o,i,r))};Array.isArray(t)?t.forEach((function(t){o(t)})):o(t)},e.prototype.removeOption=function(t){var e=this,n=function(t){!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t),e.destroyOption(t),e.destroyOriginalOption(t),e.value===t&&(e.value=null,e.eraseToggleTitle(),e.eraseToggleIcon()))};Array.isArray(t)?t.forEach((function(t){n(t)})):n(t)},e.prototype.recalculateDirection=function(){var t,e,n,o;(0,l.isEnoughSpace)(this.dropdown,this.toggle||this.tagsInput,"bottom",this.dropdownSpace,this.viewport)?(this.dropdown.classList.remove("bottom-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="",this.dropdown.classList.add("top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.add(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="".concat(this.dropdownSpace,"px")):(this.dropdown.classList.remove("top-full"),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.classList.add("bottom-full"),(null===(o=this.dropdownDirectionClasses)||void 0===o?void 0:o.bottom)&&this.dropdown.classList.add(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="".concat(this.dropdownSpace,"px"))},e.getInstance=function(t,e){var n=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsSelectCollection||(window.$hsSelectCollection=[]),document.querySelectorAll("[data-hs-select]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsSelectCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-select"),o=n?JSON.parse(n):{};new e(t,o)}})),window.$hsSelectCollection&&(window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.close=function(t){var e=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.isOpened&&e.element.close()},e.closeCurrentlyOpened=function(t){if(void 0===t&&(t=null),!t.closest(".hs-select.active")){var e=window.$hsSelectCollection.filter((function(t){return t.element.isOpened}))||null;e&&e.forEach((function(t){t.element.close()}))}},e.accessibility=function(t){var e=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));if(e&&c.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(console.log(e),console.log("Key code:",t.code),t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Tab":t.preventDefault(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}},e.onEscape=function(){var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.close()},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));if(e){var n=e.element.dropdown;if(!n)return!1;var o=(t?Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var r=o.findIndex((function(t){return t===i}));r+1 *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var r=o.findIndex((function(t){return t===i}));if(!(r+1 *:not(.hidden)")):Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");o.length&&(o[0].focus(),i&&i.classList.remove("hs-select-option-highlighted"),o[0].classList.add("hs-select-option-highlighted"))}},e.onEnter=function(t){var e=t.target.previousSibling;if(window.$hsSelectCollection.find((function(t){return t.element.el===e}))){var n=window.$hsSelectCollection.find((function(t){return t.element.isOpened})),o=window.$hsSelectCollection.find((function(t){return t.element.el===e}));n.element.close(),o.element.open()}else{(o=window.$hsSelectCollection.find((function(t){return t.element.isOpened})))&&o.element.onSelectOption(t.target.dataset.value||"")}},e}(a.default);window.addEventListener("load",(function(){u.autoInit()})),document.addEventListener("scroll",(function(){if(!window.$hsSelectCollection)return!1;var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSSelect=u),e.default=u},957:function(t,e,n){ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n"),e=this.toggle.querySelector("[data-icon]"),n=this.toggle.querySelector("[data-title]"),!this.isMultiple&&e&&this.setToggleIcon(),!this.isMultiple&&n&&this.setToggleTitle(),this.isMultiple?this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder:this.toggleTextWrapper.innerHTML=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder,n||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,l.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),this.toggle.addEventListener("click",(function(){if(o.isDisabled)return!1;o.isOpened?o.close():o.open()}))},e.prototype.setToggleIcon=function(){var t,e,n=this.toggle.querySelector("[data-icon]");if(n.innerHTML="",n){var o=(0,l.htmlToElement)((null===(e=null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.options)||void 0===e?void 0:e.icon)||"");n.append(o),o?n.classList.remove("hidden"):n.classList.add("hidden")}},e.prototype.setToggleTitle=function(){var t,e=this.toggle.querySelector("[data-title]");if(e.classList.add("truncate"),e.innerHTML="",e){var n=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder;e.innerHTML=n,this.toggle.append(e)}},e.prototype.buildTags=function(){this.buildTagsInput(),this.setTagsItems()},e.prototype.reassignTagsInputPlaceholder=function(t){this.tagsInput.placeholder=t,this.tagsInputHelper.innerHTML=t,this.calculateInputWidth()},e.prototype.buildTagsItem=function(t){var e,n,o,i,r,s,a,c=this,u=this.getItemByValue(t),d=document.createElement("div");if(d.setAttribute("data-tag-value",t),this.tagsItemClasses&&(0,l.classToClassList)(this.tagsItemClasses,d),this.tagsItemTemplate&&(i=(0,l.htmlToElement)(this.tagsItemTemplate),d.append(i)),null===(e=null==u?void 0:u.options)||void 0===e?void 0:e.icon){var p=(0,l.htmlToElement)(null===(n=null==u?void 0:u.options)||void 0===n?void 0:n.icon);(a=i?i.querySelector("[data-icon]"):document.createElement("span")).append(p),i||d.append(a)}i&&i.querySelector("[data-icon]")&&!(null===(o=null==u?void 0:u.options)||void 0===o?void 0:o.icon)&&i.querySelector("[data-icon]").classList.add("hidden"),(r=i?i.querySelector("[data-title]"):document.createElement("span")).textContent=u.title||"",i||d.append(r),i?s=i.querySelector("[data-remove]"):((s=document.createElement("span")).textContent="X",d.append(s)),s.addEventListener("click",(function(){c.value=c.value.filter((function(e){return e!==t})),c.selectedItems=c.selectedItems.filter((function(e){return e!==t})),c.value.length||c.reassignTagsInputPlaceholder(c.placeholder),c.unselectMultipleItems(),c.selectMultipleItems(),d.remove()})),this.wrapper.append(d)},e.prototype.getItemByValue=function(t){return this.selectOptions.find((function(e){return e.val===t}))},e.prototype.setTagsItems=function(){var t=this;this.value&&this.value.forEach((function(e){t.selectedItems.includes(e)||t.buildTagsItem(e),t.selectedItems=t.selectedItems.includes(e)?t.selectedItems:s(s([],t.selectedItems,!0),[e],!1)}))},e.prototype.buildTagsInput=function(){var t=this;this.tagsInput=document.createElement("input"),this.tagsInputClasses&&(0,l.classToClassList)(this.tagsInputClasses,this.tagsInput),this.tagsInput.addEventListener("focus",(function(){return t.open()})),this.tagsInput.addEventListener("input",(function(){return t.calculateInputWidth()})),this.tagsInput.addEventListener("input",(0,l.debounce)((function(e){return t.searchOptions(e.target.value)}))),this.tagsInput.addEventListener("keydown",(function(e){if("Enter"===e.key&&t.isAddTagOnEnter){var n=e.target.value;if(t.selectOptions.find((function(t){return t.val===n})))return!1;t.addSelectOption(n,n),t.buildOption(n,n),t.dropdown.querySelector('[data-value="'.concat(n,'"]')).click(),t.resetTagsInputField()}})),this.wrapper.append(this.tagsInput),setTimeout((function(){t.adjustInputWidth(),t.reassignTagsInputPlaceholder(t.value.length?"":t.placeholder)}))},e.prototype.buildDropdown=function(){var t=this;this.dropdown=(0,l.htmlToElement)(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),this.dropdown.classList.add("absolute","top-full"),this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,l.classToClassList)(this.dropdownClasses,this.dropdown),this.wrapper&&this.wrapper.append(this.dropdown),this.dropdown&&this.hasSearch&&this.buildSearch(),this.selectOptions&&this.selectOptions.forEach((function(e,n){return t.buildOption(e.title,e.val,e.options,"".concat(n))}))},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,l.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,l.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]"),this.search=(0,l.htmlToElement)(''),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,l.classToClassList)(this.searchClasses,this.search),this.search.addEventListener("input",(0,l.debounce)((function(t){return e.searchOptions(t.target.value)}))),t?t.append(this.search):this.searchWrapper.append(this.search),this.dropdown.append(this.searchWrapper)},e.prototype.buildOption=function(t,e,n,o){var i=this;void 0===o&&(o="1");var r=null,s=(0,l.htmlToElement)(this.optionTag||"
");if(s.setAttribute("data-value",e),s.setAttribute("data-title-value",t),s.setAttribute("tabIndex",o),s.classList.add("cursor-pointer"),this.optionTemplate&&(r=(0,l.htmlToElement)(this.optionTemplate),s.append(r)),r?r.querySelector("[data-title]").textContent=t||"":s.textContent=t||"",n){if(n.icon){var a=(0,l.htmlToElement)(n.icon);if(a.classList.add("mw-full"),r)r.querySelector("[data-icon]").append(a);else{var c=(0,l.htmlToElement)("
");this.iconClasses&&(0,l.classToClassList)(this.iconClasses,c),c.append(a),s.append(c)}}if(n.description)if(r)r.querySelector("[data-description]").append(n.description);else{var u=(0,l.htmlToElement)("
");u.textContent=n.description,this.descriptionClasses&&(0,l.classToClassList)(this.descriptionClasses,u),s.append(u)}}r&&r.querySelector("[data-icon]")&&!n&&!(null==n?void 0:n.icon)&&r.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&s.classList.add("selected"),s.addEventListener("click",(function(){return i.onSelectOption(e)})),this.optionClasses&&(0,l.classToClassList)(this.optionClasses,s),this.dropdown&&this.dropdown.append(s)},e.prototype.destroyOption=function(t){var e=this.dropdown.querySelector('[data-value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.buildOriginalOption=function(t,e,n){var o=(0,l.htmlToElement)("");o.setAttribute("value",e),o.setAttribute("data-hs-select-option",JSON.stringify(n)),o.innerText=t,this.el.append(o)},e.prototype.destroyOriginalOption=function(t){var e=this.el.querySelector('[value="'.concat(t,'"]'));if(!e)return!1;e.remove()},e.prototype.buildTagsInputHelper=function(){this.tagsInputHelper=document.createElement("span"),this.tagsInputHelper.style.fontSize=window.getComputedStyle(this.tagsInput).fontSize,this.tagsInputHelper.style.fontFamily=window.getComputedStyle(this.tagsInput).fontFamily,this.tagsInputHelper.style.fontWeight=window.getComputedStyle(this.tagsInput).fontWeight,this.tagsInputHelper.style.letterSpacing=window.getComputedStyle(this.tagsInput).letterSpacing,this.tagsInputHelper.style.visibility="hidden",this.tagsInputHelper.style.whiteSpace="pre",this.tagsInputHelper.style.position="absolute",this.wrapper.appendChild(this.tagsInputHelper)},e.prototype.calculateInputWidth=function(){this.tagsInputHelper.textContent=this.tagsInput.value||this.tagsInput.placeholder;var t=parseInt(window.getComputedStyle(this.tagsInput).paddingLeft)+parseInt(window.getComputedStyle(this.tagsInput).paddingRight),e=parseInt(window.getComputedStyle(this.tagsInput).borderLeftWidth)+parseInt(window.getComputedStyle(this.tagsInput).borderRightWidth),n=this.tagsInputHelper.offsetWidth+t+e,o=this.wrapper.offsetWidth-(parseInt(window.getComputedStyle(this.wrapper).paddingLeft)+parseInt(window.getComputedStyle(this.wrapper).paddingRight));this.tagsInput.style.width="".concat(Math.min(n,o)+2,"px")},e.prototype.adjustInputWidth=function(){this.buildTagsInputHelper(),this.calculateInputWidth()},e.prototype.onSelectOption=function(t){var e=this;if(this.clearSelections(),this.isMultiple?(this.value=this.value.includes(t)?Array.from(this.value).filter((function(e){return e!==t})):s(s([],Array.from(this.value),!0),[t],!1),this.selectMultipleItems(),this.setNewValue()):(this.value=t,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),(0,l.dispatch)("change.hs.select",this.el,this.value),"tags"===this.mode){var n=this.selectedItems.filter((function(t){return!e.value.includes(t)}));n.length&&n.forEach((function(t){e.selectedItems=e.selectedItems.filter((function(e){return e!==t})),e.wrapper.querySelector('[data-tag-value="'.concat(t,'"]')).remove()})),this.resetTagsInputField()}this.isMultiple||(this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.close()),this.value.length||"tags"!==this.mode||this.reassignTagsInputPlaceholder(this.placeholder),this.isOpened&&"tags"===this.mode&&this.tagsInput&&this.tagsInput.focus()},e.prototype.addSelectOption=function(t,e,n){this.selectOptions=s(s([],this.selectOptions,!0),[{title:t,val:e,options:n}],!1)},e.prototype.removeSelectOption=function(t){if(!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t}))},e.prototype.resetTagsInputField=function(){this.tagsInput.value="",this.reassignTagsInputPlaceholder(""),this.searchOptions("")},e.prototype.clearSelections=function(){Array.from(this.dropdown.children).forEach((function(t){t.classList.contains("selected")&&t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){t.selected&&(t.selected=!1)}))},e.prototype.setNewValue=function(){"tags"===this.mode?this.setTagsItems():this.value.length?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.stringFromValue=function(){var t=this,e=[];return this.selectOptions.forEach((function(n){t.isMultiple?t.value.includes(n.val)&&e.push(n.title):t.value===n.val&&e.push(n.title)})),this.toggleCountText&&""!==this.toggleCountText&&e.length>=this.toggleCountTextMinItems?"".concat(e.length," ").concat(this.toggleCountText):e.join(", ")},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0,Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")})).classList.add("selected")},e.prototype.selectMultipleItems=function(){var t=this;Array.from(this.dropdown.children).filter((function(e){return t.value.includes(e.getAttribute("data-value"))})).forEach((function(t){return t.classList.add("selected")})),Array.from(this.el.children).filter((function(e){return t.value.includes(e.value)})).forEach((function(t){return t.selected=!0}))},e.prototype.unselectMultipleItems=function(){Array.from(this.dropdown.children).forEach((function(t){return t.classList.remove("selected")})),Array.from(this.el.children).forEach((function(t){return t.selected=!1}))},e.prototype.searchOptions=function(t){this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,l.htmlToElement)(""),this.searchNoResult.innerText=this.searchNoResultText,(0,l.classToClassList)(this.searchNoResultClasses,this.searchNoResult);var e=this.dropdown.querySelectorAll("[data-value]"),n=!1;e.forEach((function(e){e.getAttribute("data-title-value").toLocaleLowerCase().includes(t.toLocaleLowerCase())?(e.classList.remove("hidden"),n=!0):e.classList.add("hidden")})),n||this.dropdown.append(this.searchNoResult)},e.prototype.eraseToggleIcon=function(){var t=this.toggle.querySelector("[data-icon]");t&&(t.innerHTML=null,t.classList.add("hidden"))},e.prototype.eraseToggleTitle=function(){var t=this.toggle.querySelector("[data-title]");t?t.innerHTML=this.placeholder:this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.destroy=function(){var t=this.el.parentElement.parentElement;this.el.classList.remove("hidden"),this.el.style.display="",t.prepend(this.el),t.querySelector(".hs-select").remove(),this.wrapper=null},e.prototype.open=function(){var t=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){t.wrapper.classList.add("active"),t.dropdown.classList.add("opened"),t.hasSearch&&!t.preventSearchFocus&&t.search.focus(),t.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,n,o=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,l.afterTransition)(this.dropdown,(function(){o.dropdown.classList.add("hidden"),o.hasSearch&&(o.search.value="",o.search.dispatchEvent(new Event("input",{bubbles:!0})),o.search.blur()),o.animationInProcess=!1})),null===(n=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===n||n.classList.remove("hs-select-option-highlighted"),this.isOpened=!1},e.prototype.addOption=function(t){var e=this,n="".concat(this.selectOptions.length),o=function(t){var o=t.title,i=t.val,r=t.options;!!e.selectOptions.some((function(t){return t.val===i}))||(e.addSelectOption(o,i,r),e.buildOption(o,i,r,n),e.buildOriginalOption(o,i,r))};Array.isArray(t)?t.forEach((function(t){o(t)})):o(t)},e.prototype.removeOption=function(t){var e=this,n=function(t){!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t),e.destroyOption(t),e.destroyOriginalOption(t),e.value===t&&(e.value=null,e.eraseToggleTitle(),e.eraseToggleIcon()))};Array.isArray(t)?t.forEach((function(t){n(t)})):n(t)},e.prototype.recalculateDirection=function(){var t,e,n,o;(0,l.isEnoughSpace)(this.dropdown,this.toggle||this.tagsInput,"bottom",this.dropdownSpace,this.viewport)?(this.dropdown.classList.remove("bottom-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="",this.dropdown.classList.add("top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.top)&&this.dropdown.classList.add(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="".concat(this.dropdownSpace,"px")):(this.dropdown.classList.remove("top-full"),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.classList.add("bottom-full"),(null===(o=this.dropdownDirectionClasses)||void 0===o?void 0:o.bottom)&&this.dropdown.classList.add(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="".concat(this.dropdownSpace,"px"))},e.getInstance=function(t,e){var n=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsSelectCollection||(window.$hsSelectCollection=[]),document.querySelectorAll("[data-hs-select]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsSelectCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){var n=t.getAttribute("data-hs-select"),o=n?JSON.parse(n):{};new e(t,o)}})),window.$hsSelectCollection&&(window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.close=function(t){var e=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));e&&e.element.isOpened&&e.element.close()},e.closeCurrentlyOpened=function(t){if(void 0===t&&(t=null),!t.closest(".hs-select.active")){var e=window.$hsSelectCollection.filter((function(t){return t.element.isOpened}))||null;e&&e.forEach((function(t){t.element.close()}))}},e.accessibility=function(t){if(window.$hsSelectCollection.find((function(t){return t.element.isOpened}))&&c.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),this.onArrow();break;case"ArrowDown":t.preventDefault(),this.onArrow(!1);break;case"Tab":t.preventDefault(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),this.onStartEnd();break;case"End":t.preventDefault(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}},e.onEscape=function(){var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.close()},e.onArrow=function(t){void 0===t&&(t=!0);var e=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));if(e){var n=e.element.dropdown;if(!n)return!1;var o=(t?Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var r=o.findIndex((function(t){return t===i}));r+1 *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");i||o[0].classList.add("hs-select-option-highlighted");var r=o.findIndex((function(t){return t===i}));if(!(r+1 *:not(.hidden)")):Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((function(t){return!t.classList.contains("disabled")})),i=n.querySelector(".hs-select-option-highlighted");o.length&&(o[0].focus(),i&&i.classList.remove("hs-select-option-highlighted"),o[0].classList.add("hs-select-option-highlighted"))}},e.onEnter=function(t){var e=t.target.previousSibling;if(window.$hsSelectCollection.find((function(t){return t.element.el===e}))){var n=window.$hsSelectCollection.find((function(t){return t.element.isOpened})),o=window.$hsSelectCollection.find((function(t){return t.element.el===e}));n.element.close(),o.element.open()}else{(o=window.$hsSelectCollection.find((function(t){return t.element.isOpened})))&&o.element.onSelectOption(t.target.dataset.value||"")}},e}(a.default);window.addEventListener("load",(function(){u.autoInit()})),document.addEventListener("scroll",(function(){if(!window.$hsSelectCollection)return!1;var t=window.$hsSelectCollection.find((function(t){return t.element.isOpened}));t&&t.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSSelect=u),e.default=u},957:function(t,e,n){ /* * HSStepper - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;nt.totalSteps&&(t.totalSteps=n)}))},e.prototype.buildNav=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-nav-item]").forEach((function(e){return t.addNavItem(e)})),this.navItems.forEach((function(e){return t.buildNavItem(e)}))},e.prototype.buildNavItem=function(t){var e=this,n=t.index,o=t.isDisabled,i=t.el;n===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||o)&&i.addEventListener("click",(function(){return e.handleNavItemClick(t)}))},e.prototype.addNavItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-nav-item")),n=e.index,o=e.isFinal,i=void 0!==o&&o,r=e.isCompleted,s=void 0!==r&&r,l=e.isSkip,a=void 0!==l&&l,c=e.isOptional,u=void 0!==c&&c,d=e.isDisabled,p=void 0!==d&&d,h=e.isProcessed,f=void 0!==h&&h,v=e.hasError,m=void 0!==v&&v;s&&t.classList.add("success"),a&&t.classList.add("skipped"),p&&("BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")),m&&t.classList.add("error"),this.navItems.push({index:n,isFinal:i,isCompleted:s,isSkip:a,isOptional:u,isDisabled:p,isProcessed:f,hasError:m,el:t})},e.prototype.setCurrentNavItem=function(){var t=this;this.navItems.forEach((function(e){var n=e.index,o=e.el;n===t.currentIndex?t.setCurrentNavItemActions(o):t.unsetCurrentNavItemActions(o)}))},e.prototype.setCurrentNavItemActions=function(t){t.classList.add("active"),this.fireEvent("active",this.currentIndex),(0,s.dispatch)("active.hs.stepper",this.el,this.currentIndex)},e.prototype.getNavItem=function(t){return void 0===t&&(t=this.currentIndex),this.navItems.find((function(e){return e.index===t}))},e.prototype.setProcessedNavItemActions=function(t){t.isProcessed=!0,t.el.classList.add("processed")},e.prototype.setErrorNavItemActions=function(t){t.hasError=!0,t.el.classList.add("error")},e.prototype.unsetCurrentNavItemActions=function(t){t.classList.remove("active")},e.prototype.handleNavItemClick=function(t){var e=t.index;this.currentIndex=e,this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep()},e.prototype.buildContent=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-content-item]").forEach((function(e){return t.addContentItem(e)})),this.navItems.forEach((function(e){return t.buildContentItem(e)}))},e.prototype.buildContentItem=function(t){t.index===this.currentIndex&&this.setCurrentContentItem()},e.prototype.addContentItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-content-item")),n=e.index,o=e.isFinal,i=void 0!==o&&o,r=e.isCompleted,s=void 0!==r&&r,l=e.isSkip,a=void 0!==l&&l;s&&t.classList.add("success"),a&&t.classList.add("skipped"),this.contentItems.push({index:n,isFinal:i,isCompleted:s,isSkip:a,el:t})},e.prototype.setCurrentContentItem=function(){var t=this;if(this.isCompleted){var e=this.contentItems.find((function(t){return t.isFinal})),n=this.contentItems.filter((function(t){return!t.isFinal}));return e.el.style.display="",n.forEach((function(t){return t.el.style.display="none"})),!1}this.contentItems.forEach((function(e){var n=e.index,o=e.el;n===t.currentIndex?t.setCurrentContentItemActions(o):t.unsetCurrentContentItemActions(o)}))},e.prototype.hideAllContentItems=function(){this.contentItems.forEach((function(t){return t.el.style.display="none"}))},e.prototype.setCurrentContentItemActions=function(t){t.style.display=""},e.prototype.unsetCurrentContentItemActions=function(t){t.style.display="none"},e.prototype.disableAll=function(){var t=this.getNavItem(this.currentIndex);t.hasError=!1,t.isCompleted=!1,t.isDisabled=!1,t.el.classList.remove("error","success"),this.disableButtons()},e.prototype.disableNavItemActions=function(t){t.isDisabled=!0,t.el.classList.add("disabled")},e.prototype.enableNavItemActions=function(t){t.isDisabled=!1,t.el.classList.remove("disabled")},e.prototype.buildButtons=function(){this.backBtn=this.el.querySelector("[data-hs-stepper-back-btn]"),this.nextBtn=this.el.querySelector("[data-hs-stepper-next-btn]"),this.skipBtn=this.el.querySelector("[data-hs-stepper-skip-btn]"),this.completeStepBtn=this.el.querySelector("[data-hs-stepper-complete-step-btn]"),this.finishBtn=this.el.querySelector("[data-hs-stepper-finish-btn]"),this.resetBtn=this.el.querySelector("[data-hs-stepper-reset-btn]"),this.buildBackButton(),this.buildNextButton(),this.buildSkipButton(),this.buildCompleteStepButton(),this.buildFinishButton(),this.buildResetButton()},e.prototype.buildBackButton=function(){var t=this;this.backBtn&&(this.checkForTheFirstStep(),this.backBtn.addEventListener("click",(function(){if(t.handleBackButtonClick(),"linear"===t.mode){var e=t.navItems.find((function(e){return e.index===t.currentIndex})),n=t.contentItems.find((function(e){return e.index===t.currentIndex}));if(!e||!n)return;e.isCompleted&&(e.isCompleted=!1,e.isSkip=!1,e.el.classList.remove("success","skipped")),n.isCompleted&&(n.isCompleted=!1,n.isSkip=!1,n.el.classList.remove("success","skipped")),"linear"===t.mode&&t.currentIndex!==t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display=""),t.completeStepBtn&&(t.completeStepBtn.style.display="")),t.showSkipButton(),t.showFinishButton(),t.showCompleteStepButton()}})))},e.prototype.handleBackButtonClick=function(){1!==this.currentIndex&&("linear"===this.mode&&this.removeOptionalClasses(),this.currentIndex--,"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.fireEvent("back",this.currentIndex),(0,s.dispatch)("back.hs.stepper",this.el,this.currentIndex))},e.prototype.checkForTheFirstStep=function(){1===this.currentIndex?this.setToDisabled(this.backBtn):this.setToNonDisabled(this.backBtn)},e.prototype.setToDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")},e.prototype.setToNonDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled"),t.classList.remove("disabled")},e.prototype.buildNextButton=function(){var t=this;this.nextBtn&&this.nextBtn.addEventListener("click",(function(){var e;if(t.fireEvent("beforeNext",t.currentIndex),(0,s.dispatch)("beforeNext.hs.stepper",t.el,t.currentIndex),null===(e=t.getNavItem(t.currentIndex))||void 0===e?void 0:e.isProcessed)return t.disableAll(),!1;t.goToNext()}))},e.prototype.unsetProcessedNavItemActions=function(t){t.isProcessed=!1,t.el.classList.remove("processed")},e.prototype.handleNextButtonClick=function(t){if(void 0===t&&(t=!0),t)this.currentIndex===this.totalSteps?this.currentIndex=1:this.currentIndex++;else{var e=this.getUncompletedSteps();if(1===e.length){var n=e[0].index;this.currentIndex=n}else{if(this.currentIndex===this.totalSteps)return;this.currentIndex++}}"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton(),this.showFinishButton(),this.showCompleteStepButton(),this.fireEvent("next",this.currentIndex),(0,s.dispatch)("next.hs.stepper",this.el,this.currentIndex)},e.prototype.removeOptionalClasses=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=this.contentItems.find((function(e){return e.index===t.currentIndex}));e.isSkip=!1,e.hasError=!1,e.isDisabled=!1,n.isSkip=!1,e.el.classList.remove("skipped","success","error"),n.el.classList.remove("skipped","success","error")},e.prototype.buildSkipButton=function(){var t=this;this.skipBtn&&(this.showSkipButton(),this.skipBtn.addEventListener("click",(function(){t.handleSkipButtonClick(),"linear"===t.mode&&t.currentIndex===t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display="none"),t.completeStepBtn&&(t.completeStepBtn.style.display="none"),t.finishBtn&&(t.finishBtn.style.display=""))})))},e.prototype.setSkipItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),o=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&o&&(this.setSkipItemActions(n),this.setSkipItemActions(o))},e.prototype.setSkipItemActions=function(t){t.isSkip=!0,t.el.classList.add("skipped")},e.prototype.showSkipButton=function(){var t=this;if(this.skipBtn){var e=this.navItems.find((function(e){return e.index===t.currentIndex})).isOptional;this.skipBtn.style.display=e?"":"none"}},e.prototype.handleSkipButtonClick=function(){this.setSkipItem(),this.handleNextButtonClick(),this.fireEvent("skip",this.currentIndex),(0,s.dispatch)("skip.hs.stepper",this.el,this.currentIndex)},e.prototype.buildCompleteStepButton=function(){var t=this;this.completeStepBtn&&(this.completeStepBtnDefaultText=this.completeStepBtn.innerText,this.completeStepBtn.addEventListener("click",(function(){return t.handleCompleteStepButtonClick()})))},e.prototype.changeTextAndDisableCompleteButtonIfStepCompleted=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=JSON.parse(this.completeStepBtn.getAttribute("data-hs-stepper-complete-step-btn")).completedText;e&&(e.isCompleted?(this.completeStepBtn.innerText=n||this.completeStepBtnDefaultText,this.completeStepBtn.setAttribute("disabled","disabled"),this.completeStepBtn.classList.add("disabled")):(this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")))},e.prototype.setCompleteItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),o=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&o&&(this.setCompleteItemActions(n),this.setCompleteItemActions(o))},e.prototype.setCompleteItemActions=function(t){t.isCompleted=!0,t.el.classList.add("success")},e.prototype.showCompleteStepButton=function(){this.completeStepBtn&&(1===this.getUncompletedSteps().length?this.completeStepBtn.style.display="none":this.completeStepBtn.style.display="")},e.prototype.handleCompleteStepButtonClick=function(){this.setCompleteItem(),this.fireEvent("complete",this.currentIndex),(0,s.dispatch)("complete.hs.stepper",this.el,this.currentIndex),this.handleNextButtonClick(!1),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton()},e.prototype.buildFinishButton=function(){var t=this;this.finishBtn&&(this.isCompleted&&this.setCompleted(),this.finishBtn.addEventListener("click",(function(){return t.handleFinishButtonClick()})))},e.prototype.setCompleted=function(){this.el.classList.add("completed")},e.prototype.unsetCompleted=function(){this.el.classList.remove("completed")},e.prototype.showFinishButton=function(){this.finishBtn&&(1===this.getUncompletedSteps().length?this.finishBtn.style.display="":this.finishBtn.style.display="none")},e.prototype.handleFinishButtonClick=function(){var t=this,e=this.getUncompletedSteps(),n=this.getUncompletedSteps(!0),o=this.contentItems.find((function(t){return t.isFinal})).el;e.length&&e.forEach((function(e){var n=e.index;return t.setCompleteItem(n)})),this.currentIndex=this.totalSteps,this.setCurrentNavItem(),this.hideAllContentItems();var i=this.navItems.find((function(e){return e.index===t.currentIndex}));(i?i.el:null).classList.remove("active"),o.style.display="block",this.backBtn&&(this.backBtn.style.display="none"),this.nextBtn&&(this.nextBtn.style.display="none"),this.skipBtn&&(this.skipBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"),this.finishBtn&&(this.finishBtn.style.display="none"),this.resetBtn&&(this.resetBtn.style.display=""),n.length<=1&&(this.isCompleted=!0,this.setCompleted()),this.fireEvent("finish",this.currentIndex),(0,s.dispatch)("finish.hs.stepper",this.el,this.currentIndex)},e.prototype.buildResetButton=function(){var t=this;this.resetBtn&&this.resetBtn.addEventListener("click",(function(){return t.handleResetButtonClick()}))},e.prototype.handleResetButtonClick=function(){var t=this;this.backBtn&&(this.backBtn.style.display=""),this.nextBtn&&(this.nextBtn.style.display=""),this.completeStepBtn&&(this.completeStepBtn.style.display="",this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")),this.resetBtn&&(this.resetBtn.style.display="none"),this.navItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentNavItemActions(n),n.classList.remove("success","skipped")})),this.contentItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentContentItemActions(n),n.classList.remove("success","skipped")})),this.currentIndex=1,this.setCurrentNavItem(),this.setCurrentContentItem(),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.unsetCompleted(),this.isCompleted=!1,this.fireEvent("reset",this.currentIndex),(0,s.dispatch)("reset.hs.stepper",this.el,this.currentIndex)},e.prototype.setProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.setProcessedNavItemActions(e)},e.prototype.unsetProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.unsetProcessedNavItemActions(e)},e.prototype.goToNext=function(){"linear"===this.mode&&this.setCompleteItem(),this.handleNextButtonClick("linear"!==this.mode),"linear"===this.mode&&this.currentIndex===this.totalSteps&&(this.nextBtn&&(this.nextBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"))},e.prototype.disableButtons=function(){this.backBtn&&this.setToDisabled(this.backBtn),this.nextBtn&&this.setToDisabled(this.nextBtn)},e.prototype.enableButtons=function(){this.backBtn&&this.setToNonDisabled(this.backBtn),this.nextBtn&&this.setToNonDisabled(this.nextBtn)},e.prototype.setErrorNavItem=function(t){var e=this.getNavItem(t);e&&this.setErrorNavItemActions(e)},e.getInstance=function(t,e){var n=window.$hsStepperCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsStepperCollection||(window.$hsStepperCollection=[]),document.querySelectorAll("[data-hs-stepper]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsStepperCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=l),e.default=l},983:function(t,e,n){ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;nt.totalSteps&&(t.totalSteps=n)}))},e.prototype.buildNav=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-nav-item]").forEach((function(e){return t.addNavItem(e)})),this.navItems.forEach((function(e){return t.buildNavItem(e)}))},e.prototype.buildNavItem=function(t){var e=this,n=t.index,o=t.isDisabled,i=t.el;n===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||o)&&i.addEventListener("click",(function(){return e.handleNavItemClick(t)}))},e.prototype.addNavItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-nav-item")),n=e.index,o=e.isFinal,i=void 0!==o&&o,r=e.isCompleted,s=void 0!==r&&r,l=e.isSkip,a=void 0!==l&&l,c=e.isOptional,u=void 0!==c&&c,d=e.isDisabled,p=void 0!==d&&d,h=e.isProcessed,f=void 0!==h&&h,m=e.hasError,v=void 0!==m&&m;s&&t.classList.add("success"),a&&t.classList.add("skipped"),p&&("BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")),v&&t.classList.add("error"),this.navItems.push({index:n,isFinal:i,isCompleted:s,isSkip:a,isOptional:u,isDisabled:p,isProcessed:f,hasError:v,el:t})},e.prototype.setCurrentNavItem=function(){var t=this;this.navItems.forEach((function(e){var n=e.index,o=e.el;n===t.currentIndex?t.setCurrentNavItemActions(o):t.unsetCurrentNavItemActions(o)}))},e.prototype.setCurrentNavItemActions=function(t){t.classList.add("active"),this.fireEvent("active",this.currentIndex),(0,s.dispatch)("active.hs.stepper",this.el,this.currentIndex)},e.prototype.getNavItem=function(t){return void 0===t&&(t=this.currentIndex),this.navItems.find((function(e){return e.index===t}))},e.prototype.setProcessedNavItemActions=function(t){t.isProcessed=!0,t.el.classList.add("processed")},e.prototype.setErrorNavItemActions=function(t){t.hasError=!0,t.el.classList.add("error")},e.prototype.unsetCurrentNavItemActions=function(t){t.classList.remove("active")},e.prototype.handleNavItemClick=function(t){var e=t.index;this.currentIndex=e,this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep()},e.prototype.buildContent=function(){var t=this;this.el.querySelectorAll("[data-hs-stepper-content-item]").forEach((function(e){return t.addContentItem(e)})),this.navItems.forEach((function(e){return t.buildContentItem(e)}))},e.prototype.buildContentItem=function(t){t.index===this.currentIndex&&this.setCurrentContentItem()},e.prototype.addContentItem=function(t){var e=JSON.parse(t.getAttribute("data-hs-stepper-content-item")),n=e.index,o=e.isFinal,i=void 0!==o&&o,r=e.isCompleted,s=void 0!==r&&r,l=e.isSkip,a=void 0!==l&&l;s&&t.classList.add("success"),a&&t.classList.add("skipped"),this.contentItems.push({index:n,isFinal:i,isCompleted:s,isSkip:a,el:t})},e.prototype.setCurrentContentItem=function(){var t=this;if(this.isCompleted){var e=this.contentItems.find((function(t){return t.isFinal})),n=this.contentItems.filter((function(t){return!t.isFinal}));return e.el.style.display="",n.forEach((function(t){return t.el.style.display="none"})),!1}this.contentItems.forEach((function(e){var n=e.index,o=e.el;n===t.currentIndex?t.setCurrentContentItemActions(o):t.unsetCurrentContentItemActions(o)}))},e.prototype.hideAllContentItems=function(){this.contentItems.forEach((function(t){return t.el.style.display="none"}))},e.prototype.setCurrentContentItemActions=function(t){t.style.display=""},e.prototype.unsetCurrentContentItemActions=function(t){t.style.display="none"},e.prototype.disableAll=function(){var t=this.getNavItem(this.currentIndex);t.hasError=!1,t.isCompleted=!1,t.isDisabled=!1,t.el.classList.remove("error","success"),this.disableButtons()},e.prototype.disableNavItemActions=function(t){t.isDisabled=!0,t.el.classList.add("disabled")},e.prototype.enableNavItemActions=function(t){t.isDisabled=!1,t.el.classList.remove("disabled")},e.prototype.buildButtons=function(){this.backBtn=this.el.querySelector("[data-hs-stepper-back-btn]"),this.nextBtn=this.el.querySelector("[data-hs-stepper-next-btn]"),this.skipBtn=this.el.querySelector("[data-hs-stepper-skip-btn]"),this.completeStepBtn=this.el.querySelector("[data-hs-stepper-complete-step-btn]"),this.finishBtn=this.el.querySelector("[data-hs-stepper-finish-btn]"),this.resetBtn=this.el.querySelector("[data-hs-stepper-reset-btn]"),this.buildBackButton(),this.buildNextButton(),this.buildSkipButton(),this.buildCompleteStepButton(),this.buildFinishButton(),this.buildResetButton()},e.prototype.buildBackButton=function(){var t=this;this.backBtn&&(this.checkForTheFirstStep(),this.backBtn.addEventListener("click",(function(){if(t.handleBackButtonClick(),"linear"===t.mode){var e=t.navItems.find((function(e){return e.index===t.currentIndex})),n=t.contentItems.find((function(e){return e.index===t.currentIndex}));if(!e||!n)return;e.isCompleted&&(e.isCompleted=!1,e.isSkip=!1,e.el.classList.remove("success","skipped")),n.isCompleted&&(n.isCompleted=!1,n.isSkip=!1,n.el.classList.remove("success","skipped")),"linear"===t.mode&&t.currentIndex!==t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display=""),t.completeStepBtn&&(t.completeStepBtn.style.display="")),t.showSkipButton(),t.showFinishButton(),t.showCompleteStepButton()}})))},e.prototype.handleBackButtonClick=function(){1!==this.currentIndex&&("linear"===this.mode&&this.removeOptionalClasses(),this.currentIndex--,"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.fireEvent("back",this.currentIndex),(0,s.dispatch)("back.hs.stepper",this.el,this.currentIndex))},e.prototype.checkForTheFirstStep=function(){1===this.currentIndex?this.setToDisabled(this.backBtn):this.setToNonDisabled(this.backBtn)},e.prototype.setToDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")},e.prototype.setToNonDisabled=function(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled"),t.classList.remove("disabled")},e.prototype.buildNextButton=function(){var t=this;this.nextBtn&&this.nextBtn.addEventListener("click",(function(){var e;if(t.fireEvent("beforeNext",t.currentIndex),(0,s.dispatch)("beforeNext.hs.stepper",t.el,t.currentIndex),null===(e=t.getNavItem(t.currentIndex))||void 0===e?void 0:e.isProcessed)return t.disableAll(),!1;t.goToNext()}))},e.prototype.unsetProcessedNavItemActions=function(t){t.isProcessed=!1,t.el.classList.remove("processed")},e.prototype.handleNextButtonClick=function(t){if(void 0===t&&(t=!0),t)this.currentIndex===this.totalSteps?this.currentIndex=1:this.currentIndex++;else{var e=this.getUncompletedSteps();if(1===e.length){var n=e[0].index;this.currentIndex=n}else{if(this.currentIndex===this.totalSteps)return;this.currentIndex++}}"linear"===this.mode&&this.removeOptionalClasses(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton(),this.showFinishButton(),this.showCompleteStepButton(),this.fireEvent("next",this.currentIndex),(0,s.dispatch)("next.hs.stepper",this.el,this.currentIndex)},e.prototype.removeOptionalClasses=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=this.contentItems.find((function(e){return e.index===t.currentIndex}));e.isSkip=!1,e.hasError=!1,e.isDisabled=!1,n.isSkip=!1,e.el.classList.remove("skipped","success","error"),n.el.classList.remove("skipped","success","error")},e.prototype.buildSkipButton=function(){var t=this;this.skipBtn&&(this.showSkipButton(),this.skipBtn.addEventListener("click",(function(){t.handleSkipButtonClick(),"linear"===t.mode&&t.currentIndex===t.totalSteps&&(t.nextBtn&&(t.nextBtn.style.display="none"),t.completeStepBtn&&(t.completeStepBtn.style.display="none"),t.finishBtn&&(t.finishBtn.style.display=""))})))},e.prototype.setSkipItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),o=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&o&&(this.setSkipItemActions(n),this.setSkipItemActions(o))},e.prototype.setSkipItemActions=function(t){t.isSkip=!0,t.el.classList.add("skipped")},e.prototype.showSkipButton=function(){var t=this;if(this.skipBtn){var e=this.navItems.find((function(e){return e.index===t.currentIndex})).isOptional;this.skipBtn.style.display=e?"":"none"}},e.prototype.handleSkipButtonClick=function(){this.setSkipItem(),this.handleNextButtonClick(),this.fireEvent("skip",this.currentIndex),(0,s.dispatch)("skip.hs.stepper",this.el,this.currentIndex)},e.prototype.buildCompleteStepButton=function(){var t=this;this.completeStepBtn&&(this.completeStepBtnDefaultText=this.completeStepBtn.innerText,this.completeStepBtn.addEventListener("click",(function(){return t.handleCompleteStepButtonClick()})))},e.prototype.changeTextAndDisableCompleteButtonIfStepCompleted=function(){var t=this,e=this.navItems.find((function(e){return e.index===t.currentIndex})),n=JSON.parse(this.completeStepBtn.getAttribute("data-hs-stepper-complete-step-btn")).completedText;e&&(e.isCompleted?(this.completeStepBtn.innerText=n||this.completeStepBtnDefaultText,this.completeStepBtn.setAttribute("disabled","disabled"),this.completeStepBtn.classList.add("disabled")):(this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")))},e.prototype.setCompleteItem=function(t){var e=this,n=this.navItems.find((function(n){return n.index===(t||e.currentIndex)})),o=this.contentItems.find((function(n){return n.index===(t||e.currentIndex)}));n&&o&&(this.setCompleteItemActions(n),this.setCompleteItemActions(o))},e.prototype.setCompleteItemActions=function(t){t.isCompleted=!0,t.el.classList.add("success")},e.prototype.showCompleteStepButton=function(){this.completeStepBtn&&(1===this.getUncompletedSteps().length?this.completeStepBtn.style.display="none":this.completeStepBtn.style.display="")},e.prototype.handleCompleteStepButtonClick=function(){this.setCompleteItem(),this.fireEvent("complete",this.currentIndex),(0,s.dispatch)("complete.hs.stepper",this.el,this.currentIndex),this.handleNextButtonClick(!1),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton()},e.prototype.buildFinishButton=function(){var t=this;this.finishBtn&&(this.isCompleted&&this.setCompleted(),this.finishBtn.addEventListener("click",(function(){return t.handleFinishButtonClick()})))},e.prototype.setCompleted=function(){this.el.classList.add("completed")},e.prototype.unsetCompleted=function(){this.el.classList.remove("completed")},e.prototype.showFinishButton=function(){this.finishBtn&&(1===this.getUncompletedSteps().length?this.finishBtn.style.display="":this.finishBtn.style.display="none")},e.prototype.handleFinishButtonClick=function(){var t=this,e=this.getUncompletedSteps(),n=this.getUncompletedSteps(!0),o=this.contentItems.find((function(t){return t.isFinal})).el;e.length&&e.forEach((function(e){var n=e.index;return t.setCompleteItem(n)})),this.currentIndex=this.totalSteps,this.setCurrentNavItem(),this.hideAllContentItems();var i=this.navItems.find((function(e){return e.index===t.currentIndex}));(i?i.el:null).classList.remove("active"),o.style.display="block",this.backBtn&&(this.backBtn.style.display="none"),this.nextBtn&&(this.nextBtn.style.display="none"),this.skipBtn&&(this.skipBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"),this.finishBtn&&(this.finishBtn.style.display="none"),this.resetBtn&&(this.resetBtn.style.display=""),n.length<=1&&(this.isCompleted=!0,this.setCompleted()),this.fireEvent("finish",this.currentIndex),(0,s.dispatch)("finish.hs.stepper",this.el,this.currentIndex)},e.prototype.buildResetButton=function(){var t=this;this.resetBtn&&this.resetBtn.addEventListener("click",(function(){return t.handleResetButtonClick()}))},e.prototype.handleResetButtonClick=function(){var t=this;this.backBtn&&(this.backBtn.style.display=""),this.nextBtn&&(this.nextBtn.style.display=""),this.completeStepBtn&&(this.completeStepBtn.style.display="",this.completeStepBtn.innerText=this.completeStepBtnDefaultText,this.completeStepBtn.removeAttribute("disabled"),this.completeStepBtn.classList.remove("disabled")),this.resetBtn&&(this.resetBtn.style.display="none"),this.navItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentNavItemActions(n),n.classList.remove("success","skipped")})),this.contentItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentContentItemActions(n),n.classList.remove("success","skipped")})),this.currentIndex=1,this.setCurrentNavItem(),this.setCurrentContentItem(),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.unsetCompleted(),this.isCompleted=!1,this.fireEvent("reset",this.currentIndex),(0,s.dispatch)("reset.hs.stepper",this.el,this.currentIndex)},e.prototype.setProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.setProcessedNavItemActions(e)},e.prototype.unsetProcessedNavItem=function(t){var e=this.getNavItem(t);e&&this.unsetProcessedNavItemActions(e)},e.prototype.goToNext=function(){"linear"===this.mode&&this.setCompleteItem(),this.handleNextButtonClick("linear"!==this.mode),"linear"===this.mode&&this.currentIndex===this.totalSteps&&(this.nextBtn&&(this.nextBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"))},e.prototype.disableButtons=function(){this.backBtn&&this.setToDisabled(this.backBtn),this.nextBtn&&this.setToDisabled(this.nextBtn)},e.prototype.enableButtons=function(){this.backBtn&&this.setToNonDisabled(this.backBtn),this.nextBtn&&this.setToNonDisabled(this.nextBtn)},e.prototype.setErrorNavItem=function(t){var e=this.getNavItem(t);e&&this.setErrorNavItemActions(e)},e.getInstance=function(t,e){var n=window.$hsStepperCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsStepperCollection||(window.$hsStepperCollection=[]),document.querySelectorAll("[data-hs-stepper]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsStepperCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=l),e.default=l},983:function(t,e,n){ /* * HSStrongPassword - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -121,15 +129,15 @@ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{ var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n?@[\\\\\\]^_`{|}~",o.target&&o.init(),o}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsStrongPasswordCollection,this),this.availableChecks.length&&this.build()},e.prototype.build=function(){var t=this;this.buildStrips(),this.hints&&this.buildHints(),this.setStrength(this.target.value),this.target.addEventListener("input",(function(e){t.setStrength(e.target.value)}))},e.prototype.buildStrips=function(){if(this.el.innerHTML="",this.stripClasses)for(var t=0;t");(0,s.classToClassList)(this.stripClasses,e),this.el.append(e)}},e.prototype.buildHints=function(){var t=this;this.weakness=this.hints.querySelector("[data-hs-strong-password-hints-weakness-text]")||null,this.rules=Array.from(this.hints.querySelectorAll("[data-hs-strong-password-hints-rule-text]"))||null,this.rules.forEach((function(e){var n,o=e.getAttribute("data-hs-strong-password-hints-rule-text");(null===(n=t.checksExclude)||void 0===n?void 0:n.includes(o))&&e.remove()})),this.weakness&&this.buildWeakness(),this.rules&&this.buildRules(),"popover"===this.mode&&(this.target.addEventListener("focus",(function(){t.isOpened=!0,t.hints.classList.remove("hidden"),t.hints.classList.add("block"),t.recalculateDirection()})),this.target.addEventListener("blur",(function(){t.isOpened=!1,t.hints.classList.remove("block","bottom-full","top-full"),t.hints.classList.add("hidden"),t.hints.style.marginTop="",t.hints.style.marginBottom=""})))},e.prototype.buildWeakness=function(){var t=this;this.checkStrength(this.target.value),this.setWeaknessText(),this.target.addEventListener("input",(function(){return setTimeout((function(){return t.setWeaknessText()}))}))},e.prototype.buildRules=function(){var t=this;this.setRulesText(),this.target.addEventListener("input",(function(){return setTimeout((function(){return t.setRulesText()}))}))},e.prototype.setWeaknessText=function(){var t=this.weakness.getAttribute("data-hs-strong-password-hints-weakness-text"),e=JSON.parse(t);this.weakness.textContent=e[this.strength]},e.prototype.setRulesText=function(){var t=this;this.rules.forEach((function(e){var n=e.getAttribute("data-hs-strong-password-hints-rule-text");t.checkIfPassed(e,t.passedRules.has(n))}))},e.prototype.togglePopover=function(){var t=this.el.querySelector(".popover");t&&t.classList.toggle("show")},e.prototype.checkStrength=function(t){var e=new Set,n={lowercase:/[a-z]+/,uppercase:/[A-Z]+/,numbers:/[0-9]+/,"special-characters":new RegExp("[".concat(this.specialCharactersSet,"]"))},o=0;return this.availableChecks.includes("lowercase")&&t.match(n.lowercase)&&(o+=1,e.add("lowercase")),this.availableChecks.includes("uppercase")&&t.match(n.uppercase)&&(o+=1,e.add("uppercase")),this.availableChecks.includes("numbers")&&t.match(n.numbers)&&(o+=1,e.add("numbers")),this.availableChecks.includes("special-characters")&&t.match(n["special-characters"])&&(o+=1,e.add("special-characters")),this.availableChecks.includes("min-length")&&t.length>=this.minLength&&(o+=1,e.add("min-length")),t.length||(o=0),o===this.availableChecks.length?this.el.classList.add("accepted"):this.el.classList.remove("accepted"),this.strength=o,this.passedRules=e,{strength:this.strength,rules:this.passedRules}},e.prototype.checkIfPassed=function(t,e){void 0===e&&(e=!1);var n=t.querySelector("[data-check]"),o=t.querySelector("[data-uncheck]");e?(t.classList.add("active"),n.classList.remove("hidden"),o.classList.add("hidden")):(t.classList.remove("active"),n.classList.add("hidden"),o.classList.remove("hidden"))},e.prototype.setStrength=function(t){var e=this.checkStrength(t),n=e.strength,o={strength:n,rules:e.rules};this.hideStrips(n),this.fireEvent("change",o),(0,s.dispatch)("change.hs.strongPassword",this.el,o)},e.prototype.hideStrips=function(t){Array.from(this.el.children).forEach((function(e,n){n1&&!!o.el.closest("[data-hs-toggle-password-group]"),o.target&&o.init(),o}return i(e,t),e.prototype.init=function(){var t=this;this.createCollection(window.$hsTogglePasswordCollection,this),this.isShown?this.show():this.hide(),this.el.addEventListener(this.eventType,(function(){t.isShown?t.hide():t.show(),t.fireEvent("toggle",t.target),(0,s.dispatch)("toggle.hs.toggle-select",t.el,t.target)}))},e.prototype.getMultipleToggles=function(){var t=this.el.closest("[data-hs-toggle-password-group]").querySelectorAll("[data-hs-toggle-password]"),n=[];return t.forEach((function(t){n.push(e.getInstance(t))})),n},e.prototype.show=function(){this.isMultiple?(this.getMultipleToggles().forEach((function(t){return!!t&&(t.isShown=!0)})),this.el.closest("[data-hs-toggle-password-group]").classList.add("active")):(this.isShown=!0,this.el.classList.add("active"));this.target.forEach((function(t){t.type="text"}))},e.prototype.hide=function(){this.isMultiple?(this.getMultipleToggles().forEach((function(t){return!!t&&(t.isShown=!1)})),this.el.closest("[data-hs-toggle-password-group]").classList.remove("active")):(this.isShown=!1,this.el.classList.remove("active"));this.target.forEach((function(t){t.type="password"}))},e.getInstance=function(t,e){var n=window.$hsTogglePasswordCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return n?e?n:n.element:null},e.autoInit=function(){window.$hsTogglePasswordCollection||(window.$hsTogglePasswordCollection=[]),document.querySelectorAll("[data-hs-toggle-password]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsTogglePasswordCollection.find((function(e){var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new e(t)}))},e}(n(737).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=l),e.default=l},679:function(t,e,n){ /* * HSTooltip - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n{Object.defineProperty(e,"__esModule",{value:!0}),e.COLLECTIONS=void 0;var o=n(413),i=n(460),r=n(629),s=n(652),l=n(610),a=n(371),c=n(770),u=n(659),d=n(139),p=n(591),h=n(233),f=n(957),v=n(983),m=n(949),y=n(87),g=n(366),w=n(679);e.COLLECTIONS=[{key:"copy-markup",fn:o.default},{key:"accordion",fn:i.default},{key:"carousel",fn:r.default},{key:"collapse",fn:s.default},{key:"dropdown",fn:l.default},{key:"input-number",fn:a.default},{key:"overlay",fn:c.default},{key:"pin-input",fn:u.default},{key:"remove-element",fn:d.default},{key:"scrollspy",fn:p.default},{key:"select",fn:h.default},{key:"stepper",fn:f.default},{key:"strong-password",fn:v.default},{key:"tabs",fn:m.default},{key:"toggle-count",fn:y.default},{key:"toggle-password",fn:g.default},{key:"tooltip",fn:w.default}]},313:(t,e,n)=>{ +var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n{Object.defineProperty(e,"__esModule",{value:!0}),e.COLLECTIONS=void 0;var o=n(413),i=n(460),r=n(629),s=n(652),l=n(23),a=n(610),c=n(371),u=n(770),d=n(659),p=n(139),h=n(591),f=n(233),m=n(957),v=n(983),y=n(949),g=n(87),w=n(366),b=n(679);e.COLLECTIONS=[{key:"copy-markup",fn:o.default},{key:"accordion",fn:i.default},{key:"carousel",fn:r.default},{key:"collapse",fn:s.default},{key:"combobox",fn:l.default},{key:"dropdown",fn:a.default},{key:"input-number",fn:c.default},{key:"overlay",fn:u.default},{key:"pin-input",fn:d.default},{key:"remove-element",fn:p.default},{key:"scrollspy",fn:h.default},{key:"select",fn:f.default},{key:"stepper",fn:m.default},{key:"strong-password",fn:v.default},{key:"tabs",fn:y.default},{key:"toggle-count",fn:g.default},{key:"toggle-password",fn:w.default},{key:"tooltip",fn:b.default}]},313:(t,e,n)=>{ /* * HSStaticMethods - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ -Object.defineProperty(e,"__esModule",{value:!0});var o=n(969),i=n(362),r={getClassProperty:o.getClassProperty,afterTransition:o.afterTransition,autoInit:function(t){void 0===t&&(t="all"),"all"===t?i.COLLECTIONS.forEach((function(t){var e=t.fn;null==e||e.autoInit()})):i.COLLECTIONS.forEach((function(e){var n=e.key,o=e.fn;t.includes(n)&&(null==o||o.autoInit())}))}};"undefined"!=typeof window&&(window.HSStaticMethods=r),e.default=r},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=void 0;e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,l=window.innerHeight,a=s?r.top-s.top:r.top,c=(i?s.bottom:l)-r.bottom,u=t.clientHeight+o;return"bottom"===n?c>=u:"top"===n?a>=u:a>=u||c>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.HSStaticMethods=t.HSTooltip=t.HSTogglePassword=t.HSToggleCount=t.HSThemeSwitch=t.HSTabs=t.HSStrongPassword=t.HSStepper=t.HSSelect=t.HSScrollspy=t.HSSearchByJson=t.HSRemoveElement=t.HSPinInput=t.HSOverlay=t.HSInputNumber=t.HSDropdown=t.HSCollapse=t.HSCarousel=t.HSAccordion=t.HSCopyMarkup=void 0;var e=n(413);Object.defineProperty(t,"HSCopyMarkup",{enumerable:!0,get:function(){return e.default}});var i=n(460);Object.defineProperty(t,"HSAccordion",{enumerable:!0,get:function(){return i.default}});var r=n(629);Object.defineProperty(t,"HSCarousel",{enumerable:!0,get:function(){return r.default}});var s=n(652);Object.defineProperty(t,"HSCollapse",{enumerable:!0,get:function(){return s.default}});var l=n(610);Object.defineProperty(t,"HSDropdown",{enumerable:!0,get:function(){return l.default}});var a=n(371);Object.defineProperty(t,"HSInputNumber",{enumerable:!0,get:function(){return a.default}});var c=n(770);Object.defineProperty(t,"HSOverlay",{enumerable:!0,get:function(){return c.default}});var u=n(659);Object.defineProperty(t,"HSPinInput",{enumerable:!0,get:function(){return u.default}});var d=n(139);Object.defineProperty(t,"HSRemoveElement",{enumerable:!0,get:function(){return d.default}});var p=n(961);Object.defineProperty(t,"HSSearchByJson",{enumerable:!0,get:function(){return p.default}});var h=n(591);Object.defineProperty(t,"HSScrollspy",{enumerable:!0,get:function(){return h.default}});var f=n(233);Object.defineProperty(t,"HSSelect",{enumerable:!0,get:function(){return f.default}});var v=n(957);Object.defineProperty(t,"HSStepper",{enumerable:!0,get:function(){return v.default}});var m=n(983);Object.defineProperty(t,"HSStrongPassword",{enumerable:!0,get:function(){return m.default}});var y=n(949);Object.defineProperty(t,"HSTabs",{enumerable:!0,get:function(){return y.default}});var g=n(557);Object.defineProperty(t,"HSThemeSwitch",{enumerable:!0,get:function(){return g.default}});var w=n(87);Object.defineProperty(t,"HSToggleCount",{enumerable:!0,get:function(){return w.default}});var b=n(366);Object.defineProperty(t,"HSTogglePassword",{enumerable:!0,get:function(){return b.default}});var C=n(679);Object.defineProperty(t,"HSTooltip",{enumerable:!0,get:function(){return C.default}});var S=n(313);Object.defineProperty(t,"HSStaticMethods",{enumerable:!0,get:function(){return S.default}})})(),o})())); \ No newline at end of file +Object.defineProperty(e,"__esModule",{value:!0});var o=n(969),i=n(362),r={getClassProperty:o.getClassProperty,afterTransition:o.afterTransition,autoInit:function(t){void 0===t&&(t="all"),"all"===t?i.COLLECTIONS.forEach((function(t){var e=t.fn;null==e||e.autoInit()})):i.COLLECTIONS.forEach((function(e){var n=e.key,o=e.fn;t.includes(n)&&(null==o||o.autoInit())}))}};"undefined"!=typeof window&&(window.HSStaticMethods=r),e.default=r},969:function(t,e){var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0;e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,n){return void 0===n&&(n=""),(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","")};e.getClassPropertyAlt=function(t,e,n){void 0===n&&(n="");var o="";return t.classList.forEach((function(t){t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};e.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};e.isEnoughSpace=function(t,e,n,o,i){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===i&&(i=null);var r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,l=window.innerHeight,a=s?r.top-s.top:r.top,c=(i?s.bottom:l)-r.bottom,u=t.clientHeight+o;return"bottom"===n?c>=u:"top"===n?a>=u:a>=u||c>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var o=function(t){return!!t&&("none"===window.getComputedStyle(t).display||o(t.parentElement))};e.isParentOrElementHidden=o;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;rthis.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.HSStaticMethods=t.HSTooltip=t.HSTogglePassword=t.HSToggleCount=t.HSThemeSwitch=t.HSTabs=t.HSStrongPassword=t.HSStepper=t.HSSelect=t.HSScrollspy=t.HSSearchByJson=t.HSRemoveElement=t.HSPinInput=t.HSOverlay=t.HSInputNumber=t.HSDropdown=t.HSComboBox=t.HSCollapse=t.HSCarousel=t.HSAccordion=t.HSCopyMarkup=void 0;var e=n(413);Object.defineProperty(t,"HSCopyMarkup",{enumerable:!0,get:function(){return e.default}});var i=n(460);Object.defineProperty(t,"HSAccordion",{enumerable:!0,get:function(){return i.default}});var r=n(629);Object.defineProperty(t,"HSCarousel",{enumerable:!0,get:function(){return r.default}});var s=n(652);Object.defineProperty(t,"HSCollapse",{enumerable:!0,get:function(){return s.default}});var l=n(23);Object.defineProperty(t,"HSComboBox",{enumerable:!0,get:function(){return l.default}});var a=n(610);Object.defineProperty(t,"HSDropdown",{enumerable:!0,get:function(){return a.default}});var c=n(371);Object.defineProperty(t,"HSInputNumber",{enumerable:!0,get:function(){return c.default}});var u=n(770);Object.defineProperty(t,"HSOverlay",{enumerable:!0,get:function(){return u.default}});var d=n(659);Object.defineProperty(t,"HSPinInput",{enumerable:!0,get:function(){return d.default}});var p=n(139);Object.defineProperty(t,"HSRemoveElement",{enumerable:!0,get:function(){return p.default}});var h=n(961);Object.defineProperty(t,"HSSearchByJson",{enumerable:!0,get:function(){return h.default}});var f=n(591);Object.defineProperty(t,"HSScrollspy",{enumerable:!0,get:function(){return f.default}});var m=n(233);Object.defineProperty(t,"HSSelect",{enumerable:!0,get:function(){return m.default}});var v=n(957);Object.defineProperty(t,"HSStepper",{enumerable:!0,get:function(){return v.default}});var y=n(983);Object.defineProperty(t,"HSStrongPassword",{enumerable:!0,get:function(){return y.default}});var g=n(949);Object.defineProperty(t,"HSTabs",{enumerable:!0,get:function(){return g.default}});var w=n(557);Object.defineProperty(t,"HSThemeSwitch",{enumerable:!0,get:function(){return w.default}});var b=n(87);Object.defineProperty(t,"HSToggleCount",{enumerable:!0,get:function(){return b.default}});var C=n(366);Object.defineProperty(t,"HSTogglePassword",{enumerable:!0,get:function(){return C.default}});var S=n(679);Object.defineProperty(t,"HSTooltip",{enumerable:!0,get:function(){return S.default}});var x=n(313);Object.defineProperty(t,"HSStaticMethods",{enumerable:!0,get:function(){return x.default}})})(),o})())); \ No newline at end of file diff --git a/src/constants.ts b/src/constants.ts index 68ea4a1..721a503 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -58,3 +58,11 @@ export const COMBO_BOX_ACCESSIBILITY_KEY_SET = [ 'Escape', 'Enter', ]; + +export const BREAKPOINTS: any = { + sm: 640, + md: 768, + lg: 1024, + xl: 1280, + '2xl': 1536, +}; diff --git a/src/index.ts b/src/index.ts index 3391cb8..6c73d7e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,6 +2,7 @@ export { default as HSCopyMarkup } from './plugins/copy-markup'; export { default as HSAccordion } from './plugins/accordion'; export { default as HSCarousel } from './plugins/carousel'; export { default as HSCollapse } from './plugins/collapse'; +export { default as HSComboBox } from './plugins/combobox'; export { default as HSDropdown } from './plugins/dropdown'; export { default as HSInputNumber } from './plugins/input-number'; export { default as HSOverlay } from './plugins/overlay'; diff --git a/src/plugins/accordion/index.ts b/src/plugins/accordion/index.ts index 8b4a100..555a4cf 100644 --- a/src/plugins/accordion/index.ts +++ b/src/plugins/accordion/index.ts @@ -1,6 +1,6 @@ /* * HSAccordion - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream diff --git a/src/plugins/base-plugin/index.ts b/src/plugins/base-plugin/index.ts index 0751ba6..2866d0b 100644 --- a/src/plugins/base-plugin/index.ts +++ b/src/plugins/base-plugin/index.ts @@ -1,6 +1,6 @@ /* * HSBasePlugin - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -22,7 +22,6 @@ export default class HSBasePlugin } public createCollection(collection: any[], element: any) { - if (!collection) collection = []; collection.push({ id: element?.el?.id || collection.length + 1, element, diff --git a/src/plugins/carousel/index.ts b/src/plugins/carousel/index.ts index 3694385..ac45af0 100644 --- a/src/plugins/carousel/index.ts +++ b/src/plugins/carousel/index.ts @@ -1,6 +1,6 @@ /* * HSCarousel - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream diff --git a/src/plugins/collapse/index.ts b/src/plugins/collapse/index.ts index 585b05c..c329fd2 100644 --- a/src/plugins/collapse/index.ts +++ b/src/plugins/collapse/index.ts @@ -1,6 +1,6 @@ /* * HSCollapse - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -63,6 +63,9 @@ class HSCollapse extends HSBasePlugin<{}> implements ICollapse { this.content.style.height = '0'; setTimeout(() => { this.content.style.height = `${this.content.scrollHeight}px`; + + this.fireEvent('beforeOpen', this.el); + dispatch('beforeOpen.hs.collapse', this.el, this.el); }); afterTransition(this.content, () => { diff --git a/src/plugins/combobox/index.ts b/src/plugins/combobox/index.ts new file mode 100644 index 0000000..6847ad6 --- /dev/null +++ b/src/plugins/combobox/index.ts @@ -0,0 +1,1024 @@ +/* + * HSComboBox + * @version: 2.1.0 + * @author: HTMLStream + * @license: Licensed under MIT (https://preline.co/docs/license.html) + * Copyright 2023 HTMLStream + */ + +import { + isEnoughSpace, + debounce, + afterTransition, + htmlToElement, + isParentOrElementHidden, +} from '../../utils'; + +import { IComboBox, IComboBoxOptions, IComboBoxItemAttr } from './interfaces'; + +import HSBasePlugin from '../base-plugin'; +import { ICollectionItem } from '../../interfaces'; + +import { COMBO_BOX_ACCESSIBILITY_KEY_SET } from '../../constants'; + +class HSComboBox extends HSBasePlugin implements IComboBox { + gap: number; + viewport: string | HTMLElement | null; + preventVisibility: boolean; + apiUrl: string | null; + apiDataPart: string | null; + apiQuery: string | null; + apiSearchQuery: string | null; + apiHeaders: {}; + apiGroupField: string | null; + outputItemTemplate: string | null; + outputEmptyTemplate: string | null; + outputLoaderTemplate: string | null; + groupingType: 'default' | 'tabs' | null; + groupingTitleTemplate: string | null; + tabsWrapperTemplate: string | null; + preventSelection: boolean; + isOpenOnFocus: boolean; + + private readonly input: HTMLInputElement | null; + private readonly output: HTMLElement | null; + private readonly itemsWrapper: HTMLElement | null; + private items: HTMLElement[] | []; + private tabs: HTMLElement[] | []; + private readonly toggle: HTMLElement | null; + private outputPlaceholder: HTMLElement | null; + private outputLoader: HTMLElement | null; + + private value: string | null; + private selected: string | null; + private groups: any[] | null; + private selectedGroup: string | null; + + isOpened: boolean; + isCurrent: boolean; + private animationInProcess: boolean; + + constructor(el: HTMLElement, options?: IComboBoxOptions) { + super(el, options); + + // Data parameters + const data = el.getAttribute('data-hs-combo-box'); + const dataOptions: IComboBoxOptions = data ? JSON.parse(data) : {}; + const concatOptions = { + ...dataOptions, + ...options, + }; + + this.gap = 5; + this.viewport = + (typeof concatOptions?.viewport === 'string' + ? (document.querySelector(concatOptions?.viewport) as HTMLElement) + : concatOptions?.viewport) ?? null; + this.preventVisibility = concatOptions?.preventVisibility ?? false; + this.apiUrl = concatOptions?.apiUrl ?? null; + this.apiDataPart = concatOptions?.apiDataPart ?? null; + this.apiQuery = concatOptions?.apiQuery ?? null; + this.apiSearchQuery = concatOptions?.apiSearchQuery ?? null; + this.apiHeaders = concatOptions?.apiHeaders ?? {}; + this.apiGroupField = concatOptions?.apiGroupField ?? null; + this.outputItemTemplate = + concatOptions?.outputItemTemplate ?? + `
+
+ + +
+
`; + this.outputEmptyTemplate = + concatOptions?.outputEmptyTemplate ?? + `
Nothing found...
`; + this.outputLoaderTemplate = + concatOptions?.outputLoaderTemplate ?? + `
+
+ Loading... +
+
`; + this.groupingType = concatOptions?.groupingType ?? null; + this.groupingTitleTemplate = + concatOptions?.groupingTitleTemplate ?? + (this.groupingType === 'default' + ? `
` + : ``); + this.tabsWrapperTemplate = + concatOptions?.tabsWrapperTemplate ?? + `
`; + this.preventSelection = concatOptions?.preventSelection ?? false; + this.isOpenOnFocus = concatOptions?.isOpenOnFocus ?? false; + + // Internal parameters + this.input = this.el.querySelector('[data-hs-combo-box-input]') ?? null; + this.output = this.el.querySelector('[data-hs-combo-box-output]') ?? null; + this.itemsWrapper = + this.el.querySelector('[data-hs-combo-box-output-items-wrapper]') ?? null; + this.items = + Array.from(this.el.querySelectorAll('[data-hs-combo-box-output-item]')) ?? + []; + this.tabs = []; + this.toggle = this.el.querySelector('[data-hs-combo-box-toggle]') ?? null; + this.outputPlaceholder = null; + + this.selected = this.value = + (this.el.querySelector('[data-hs-combo-box-input]') as HTMLInputElement) + .value ?? ''; + this.isOpened = false; + this.isCurrent = false; + this.animationInProcess = false; + this.selectedGroup = 'all'; + + this.init(); + } + + private init() { + this.createCollection(window.$hsComboBoxCollection, this); + + this.build(); + } + + private build() { + this.buildInput(); + if (this.groupingType) this.setGroups(); + this.buildItems(); + if (this.preventVisibility) { + this.isOpened = true; + + this.recalculateDirection(); + } + if (this.toggle) this.buildToggle(); + } + + private setResultAndRender(value = '') { + this.setResults(value); + + if (this.apiSearchQuery) this.itemsFromJson(); + } + + private buildInput() { + if (this.isOpenOnFocus) { + this.input.addEventListener('focus', () => { + if (!this.isOpened) { + this.setResultAndRender(); + this.open(); + } + }); + } + + this.input.addEventListener( + 'input', + debounce((evt: InputEvent) => { + this.setResultAndRender((evt.target as HTMLInputElement).value); + if (!this.isOpened) this.open(); + }), + ); + } + + private buildItems() { + if (this.apiUrl) this.itemsFromJson(); + else { + if (this.itemsWrapper) this.itemsWrapper.innerHTML = ''; + else this.output.innerHTML = ''; + this.itemsFromHtml(); + } + } + + private setResults(val: string) { + this.value = val; + + this.resultItems(); + + if (this.hasVisibleItems()) this.destroyOutputPlaceholder(); + else this.buildOutputPlaceholder(); + } + + private isItemExists(obj: never): boolean { + return this.items.some((el: HTMLElement) => + Array.from(el.querySelectorAll('[data-hs-combo-box-search-text]')).some( + (elI: HTMLElement) => + elI.getAttribute('data-hs-combo-box-search-text') === + obj[elI.getAttribute('data-hs-combo-box-output-item-field')], + ), + ); + } + + private isTextExists(el: HTMLElement, val: string[]): boolean { + const lowerCased = val.map((v) => v.toLowerCase()); + + return Array.from( + el.querySelectorAll('[data-hs-combo-box-search-text]'), + ).some((elI: HTMLElement) => + lowerCased.includes( + elI.getAttribute('data-hs-combo-box-search-text').toLowerCase(), + ), + ); + } + + private isTextExistsAny(el: HTMLElement, val: string): boolean { + return Array.from( + el.querySelectorAll('[data-hs-combo-box-search-text]'), + ).some((elI: HTMLElement) => + elI + .getAttribute('data-hs-combo-box-search-text') + .toLowerCase() + .includes(val.toLowerCase()), + ); + } + + private valuesBySelector(el: HTMLElement) { + return Array.from( + el.querySelectorAll('[data-hs-combo-box-search-text]'), + ).reduce( + (acc: any, cur: HTMLElement) => [ + ...acc, + cur.getAttribute('data-hs-combo-box-search-text'), + ], + [], + ); + } + + private buildOutputLoader() { + if (this.outputLoader) return false; + + this.outputLoader = htmlToElement(this.outputLoaderTemplate); + if (this.items.length || this.outputPlaceholder) { + this.outputLoader.style.position = 'absolute'; + this.outputLoader.style.top = '0'; + this.outputLoader.style.bottom = '0'; + this.outputLoader.style.left = '0'; + this.outputLoader.style.right = '0'; + this.outputLoader.style.zIndex = '2'; + } else { + this.outputLoader.style.position = ''; + this.outputLoader.style.top = ''; + this.outputLoader.style.bottom = ''; + this.outputLoader.style.left = ''; + this.outputLoader.style.right = ''; + this.outputLoader.style.zIndex = ''; + this.outputLoader.style.height = '30px'; + } + + this.output.append(this.outputLoader); + } + + private destroyOutputLoader() { + if (this.outputLoader) this.outputLoader.remove(); + + this.outputLoader = null; + } + + private async itemsFromJson() { + this.buildOutputLoader(); + + try { + const query = `${this.apiQuery}`; + const searchQuery = `${this.apiSearchQuery}=${this.value.toLowerCase()}`; + let url = this.apiUrl; + if (this.apiQuery && this.apiSearchQuery) { + url += `?${searchQuery}&${query}`; + } else if (this.apiQuery) { + url += `?${query}`; + } else if (this.apiSearchQuery) { + url += `?${searchQuery}`; + } + const res = await fetch(url, this.apiHeaders); + let items = await res.json(); + if (this.apiDataPart) { + items = items[this.apiDataPart]; + } + if (this.apiSearchQuery) { + this.items = []; + } + if (this.itemsWrapper) { + this.itemsWrapper.innerHTML = ''; + } else { + this.output.innerHTML = ''; + } + + if (this.groupingType === 'tabs') { + this.setApiGroups(items); + this.groupTabsRender(); + this.jsonItemsRender(items); + } else if (this.groupingType === 'default') { + this.setApiGroups(items); + + this.groups.forEach((el) => { + const title = htmlToElement(this.groupingTitleTemplate); + title.setAttribute('data-hs-combo-box-group-title', el.name); + title.classList.add('--exclude-accessibility'); + title.innerText = el.title; + const newItems = items.filter( + (i: any) => i[this.apiGroupField] === el.name, + ); + + if (this.itemsWrapper) this.itemsWrapper.append(title); + else this.output.append(title); + + this.jsonItemsRender(newItems); + }); + } else { + this.jsonItemsRender(items); + } + + this.setResults(this.input.value); + } catch (err) { + console.error(err); + } + + this.destroyOutputLoader(); + } + + private jsonItemsRender(items: any) { + items.forEach((item: never, index: number) => { + if (this.isItemExists(item)) return false; + + const newItem = htmlToElement(this.outputItemTemplate); + newItem + .querySelectorAll('[data-hs-combo-box-search-text]') + .forEach((el) => { + el.textContent = + item[el.getAttribute('data-hs-combo-box-output-item-field')] ?? ''; + el.setAttribute( + 'data-hs-combo-box-search-text', + item[el.getAttribute('data-hs-combo-box-output-item-field')] ?? '', + ); + }); + newItem + .querySelectorAll('[data-hs-combo-box-output-item-attr]') + .forEach((el) => { + const attributes = JSON.parse( + el.getAttribute('data-hs-combo-box-output-item-attr'), + ); + + attributes.forEach((attr: IComboBoxItemAttr) => { + el.setAttribute(attr.attr, item[attr.valueFrom]); + }); + }); + newItem.setAttribute('tabIndex', `${index}`); + if (this.groupingType === 'tabs' || this.groupingType === 'default') { + newItem.setAttribute( + 'data-hs-combo-box-output-item', + `{"group": {"name": "${item[this.apiGroupField]}", "title": "${ + item[this.apiGroupField] + }"}}`, + ); + } + + this.items = [...this.items, newItem]; + + if (!this.preventSelection) { + (newItem as HTMLElement).addEventListener('click', () => { + this.close( + (newItem as HTMLElement) + .querySelector('[data-hs-combo-box-value]') + .getAttribute('data-hs-combo-box-search-text'), + ); + + this.setSelectedByValue(this.valuesBySelector(newItem)); + }); + } + + this.appendItemsToWrapper(newItem); + }); + } + + private setGroups() { + const groups: any[] = []; + + this.items.forEach((item: HTMLElement) => { + const { group } = JSON.parse( + item.getAttribute('data-hs-combo-box-output-item'), + ); + + if (!groups.some((el) => el?.name === group.name)) { + groups.push(group); + } + }); + + this.groups = groups; + } + + public setCurrent() { + if (window.$hsComboBoxCollection.length) { + window.$hsComboBoxCollection.map((el) => (el.element.isCurrent = false)); + + this.isCurrent = true; + } + } + + private setApiGroups(items: any) { + const groups: any[] = []; + + items.forEach((item: any) => { + const group = item[this.apiGroupField]; + + if (!groups.some((el) => el.name === group)) { + groups.push({ + name: group, + title: group, + }); + } + }); + + this.groups = groups; + } + + private sortItems() { + const compareFn = (i1: HTMLElement, i2: HTMLElement) => { + const a = i1 + .querySelector('[data-hs-combo-box-value]') + .getAttribute('data-hs-combo-box-search-text'); + const b = i2 + .querySelector('[data-hs-combo-box-value]') + .getAttribute('data-hs-combo-box-search-text'); + + if (a < b) { + return -1; + } else if (a > b) { + return 1; + } + + return 0; + }; + + return this.items.sort(compareFn); + } + + private itemRender(item: HTMLElement) { + const val = item + .querySelector('[data-hs-combo-box-value]') + .getAttribute('data-hs-combo-box-search-text'); + + if (this.itemsWrapper) this.itemsWrapper.append(item); + else this.output.append(item); + + if (!this.preventSelection) { + item.addEventListener('click', () => { + this.close(val); + this.setSelectedByValue(this.valuesBySelector(item)); + }); + } + } + + private plainRender(items: HTMLElement[]) { + items.forEach((item: HTMLElement) => { + this.itemRender(item); + }); + } + + private groupTabsRender() { + const tabsScroll = htmlToElement(this.tabsWrapperTemplate); + const tabsWrapper = htmlToElement( + `
`, + ); + + tabsScroll.append(tabsWrapper); + this.output.insertBefore(tabsScroll, this.output.firstChild); + + const tabDef = htmlToElement(this.groupingTitleTemplate); + tabDef.setAttribute('data-hs-combo-box-group-title', 'all'); + tabDef.classList.add('--exclude-accessibility', 'active'); + tabDef.innerText = 'All'; + this.tabs = [...this.tabs, tabDef]; + tabsWrapper.append(tabDef); + tabDef.addEventListener('click', () => { + this.selectedGroup = 'all'; + const selectedTab = this.tabs.find( + (elI: HTMLElement) => + elI.getAttribute('data-hs-combo-box-group-title') === + this.selectedGroup, + ); + + this.tabs.forEach((el: HTMLElement) => el.classList.remove('active')); + selectedTab.classList.add('active'); + this.setItemsVisibility(); + }); + + this.groups.forEach((el) => { + const tab = htmlToElement(this.groupingTitleTemplate); + tab.setAttribute('data-hs-combo-box-group-title', el.name); + tab.classList.add('--exclude-accessibility'); + tab.innerText = el.title; + + this.tabs = [...this.tabs, tab]; + tabsWrapper.append(tab); + + tab.addEventListener('click', () => { + this.selectedGroup = el.name; + const selectedTab = this.tabs.find( + (elI: HTMLElement) => + elI.getAttribute('data-hs-combo-box-group-title') === + this.selectedGroup, + ); + + this.tabs.forEach((el: HTMLElement) => el.classList.remove('active')); + selectedTab.classList.add('active'); + this.setItemsVisibility(); + }); + }); + } + + private groupDefaultRender() { + this.groups.forEach((el) => { + const title = htmlToElement(this.groupingTitleTemplate); + title.setAttribute('data-hs-combo-box-group-title', el.name); + title.classList.add('--exclude-accessibility'); + title.innerText = el.title; + + if (this.itemsWrapper) this.itemsWrapper.append(title); + else this.output.append(title); + + const items = this.sortItems().filter((f) => { + const { group } = JSON.parse( + f.getAttribute('data-hs-combo-box-output-item'), + ); + + return group.name === el.name; + }); + + this.plainRender(items); + }); + } + + private itemsFromHtml() { + if (this.groupingType === 'default') { + this.groupDefaultRender(); + } else if (this.groupingType === 'tabs') { + const items = this.sortItems(); + + this.groupTabsRender(); + this.plainRender(items); + } else { + const items = this.sortItems(); + + this.plainRender(items); + } + this.setResults(this.input.value); + } + + private buildToggle() { + this.toggle.addEventListener('click', () => { + if (this.isOpened) this.close(); + else this.open(this.toggle.getAttribute('data-hs-combo-box-toggle')); + }); + } + + private setSelectedByValue(val: string[]) { + this.items.forEach((el) => { + if (this.isTextExists(el, val)) + (el as HTMLElement).classList.add('selected'); + else (el as HTMLElement).classList.remove('selected'); + }); + } + + private setValue(val: string) { + this.selected = val; + this.value = val; + this.input.value = val; + } + + private setItemsVisibility() { + if (this.groupingType === 'tabs' && this.selectedGroup !== 'all') { + this.items.forEach((item) => { + (item as HTMLElement).style.display = 'none'; + }); + } + + const items = + this.groupingType === 'tabs' + ? this.selectedGroup === 'all' + ? this.items + : this.items.filter((f: HTMLElement) => { + const { group } = JSON.parse( + f.getAttribute('data-hs-combo-box-output-item'), + ); + + return group.name === this.selectedGroup; + }) + : this.items; + + if (this.groupingType === 'tabs' && this.selectedGroup !== 'all') { + items.forEach((item) => { + (item as HTMLElement).style.display = 'block'; + }); + } + + items.forEach((item) => { + if (!this.isTextExistsAny(item, this.value)) + (item as HTMLElement).style.display = 'none'; + else (item as HTMLElement).style.display = 'block'; + }); + + if (this.groupingType === 'default') { + this.output + .querySelectorAll('[data-hs-combo-box-group-title]') + .forEach((el: HTMLElement) => { + const g = el.getAttribute('data-hs-combo-box-group-title'); + const items = this.items.filter((f: HTMLElement) => { + const { group } = JSON.parse( + f.getAttribute('data-hs-combo-box-output-item'), + ); + + return group.name === g && f.style.display === 'block'; + }); + + if (items.length) el.style.display = 'block'; + else el.style.display = 'none'; + }); + } + } + + private hasVisibleItems() { + return this.items.length + ? this.items.some((el: HTMLElement) => el.style.display === 'block') + : false; + } + + private appendItemsToWrapper(item: HTMLElement) { + if (this.itemsWrapper) { + this.itemsWrapper.append(item); + } else { + this.output.append(item); + } + } + + private buildOutputPlaceholder() { + if (!this.outputPlaceholder) + this.outputPlaceholder = htmlToElement(this.outputEmptyTemplate); + + this.appendItemsToWrapper(this.outputPlaceholder); + } + + private destroyOutputPlaceholder() { + if (this.outputPlaceholder) this.outputPlaceholder.remove(); + + this.outputPlaceholder = null; + } + + private resultItems() { + if (!this.items.length) return false; + + this.setItemsVisibility(); + this.setSelectedByValue([this.selected]); + } + + // Public methods + private setValueAndOpen(val: string) { + this.value = val; + + if (this.items.length) { + this.setItemsVisibility(); + } + } + + public open(val?: string) { + if (this.animationInProcess) return false; + + if (typeof val !== 'undefined') this.setValueAndOpen(val); + + if (this.preventVisibility) return false; + + this.animationInProcess = true; + + this.output.style.display = 'block'; + this.recalculateDirection(); + + setTimeout(() => { + this.el.classList.add('active'); + + this.animationInProcess = false; + }); + + this.isOpened = true; + } + + private setValueAndClear(val: string | null) { + if (val) this.setValue(val); + else this.setValue(this.selected); + + if (this.outputPlaceholder) this.destroyOutputPlaceholder(); + } + + public close(val?: string | null) { + if (this.animationInProcess) return false; + + if (this.preventVisibility) { + this.setValueAndClear(val); + + return false; + } + + this.animationInProcess = true; + + this.el.classList.remove('active'); + this.output.classList.remove('bottom-full', 'top-full'); + this.output.style.marginTop = ''; + this.output.style.marginBottom = ''; + + afterTransition(this.output, () => { + this.output.style.display = 'none'; + + this.setValueAndClear(val); + + this.animationInProcess = false; + }); + + this.isOpened = false; + } + + public recalculateDirection() { + if ( + isEnoughSpace( + this.output, + this.input, + 'bottom', + this.gap, + this.viewport as HTMLElement, + ) + ) { + this.output.classList.remove('bottom-full'); + this.output.style.marginBottom = ''; + this.output.classList.add('top-full'); + this.output.style.marginTop = `${this.gap}px`; + } else { + this.output.classList.remove('top-full'); + this.output.style.marginTop = ''; + this.output.classList.add('bottom-full'); + this.output.style.marginBottom = `${this.gap}px`; + } + } + + // Static methods + static getInstance(target: HTMLElement | string, isInstance?: boolean) { + const elInCollection = window.$hsComboBoxCollection.find( + (el) => + el.element.el === + (typeof target === 'string' ? document.querySelector(target) : target), + ); + + return elInCollection + ? isInstance + ? elInCollection + : elInCollection.element + : null; + } + + static autoInit() { + if (!window.$hsComboBoxCollection) window.$hsComboBoxCollection = []; + + document + .querySelectorAll('[data-hs-combo-box]:not(.--prevent-on-load-init)') + .forEach((el: HTMLElement) => { + if ( + !window.$hsComboBoxCollection.find( + (elC) => (elC?.element?.el as HTMLElement) === el, + ) + ) { + const data = el.getAttribute('data-hs-combo-box'); + const options: IComboBoxOptions = data ? JSON.parse(data) : {}; + + new HSComboBox(el, options); + } + }); + + if (window.$hsComboBoxCollection) { + window.addEventListener('click', (evt) => { + const evtTarget = evt.target; + + HSComboBox.closeCurrentlyOpened(evtTarget as HTMLElement); + }); + + document.addEventListener('keydown', (evt) => + HSComboBox.accessibility(evt), + ); + } + } + + static close(target: HTMLElement | string) { + const elInCollection = window.$hsComboBoxCollection.find( + (el) => + el.element.el === + (typeof target === 'string' ? document.querySelector(target) : target), + ); + + if (elInCollection && elInCollection.element.isOpened) { + elInCollection.element.close(); + } + } + + static closeCurrentlyOpened(evtTarget: HTMLElement | null = null) { + if (!evtTarget.closest('[data-hs-combo-box].active')) { + const currentlyOpened = + window.$hsComboBoxCollection.filter((el) => el.element.isOpened) || + null; + + if (currentlyOpened) { + currentlyOpened.forEach((el) => { + el.element.close(); + }); + } + } + } + + // Accessibility methods + private static getPreparedItems( + isReversed = false, + output: HTMLElement | null, + ): Element[] | null { + if (!output) return null; + + const preparedItems = isReversed + ? Array.from( + output.querySelectorAll(':scope > *:not(.--exclude-accessibility)'), + ) + .filter((el) => (el as HTMLElement).style.display !== 'none') + .reverse() + : Array.from( + output.querySelectorAll(':scope > *:not(.--exclude-accessibility)'), + ).filter((el) => (el as HTMLElement).style.display !== 'none'); + const items = preparedItems.filter( + (el: any) => !el.classList.contains('disabled'), + ); + + return items; + } + + private static setHighlighted( + prev: Element, + current: HTMLElement, + input: HTMLInputElement, + ): void { + current.focus(); + + input.value = current + .querySelector('[data-hs-combo-box-value]') + .getAttribute('data-hs-combo-box-search-text'); + + if (prev) prev.classList.remove('hs-combo-box-output-item-highlighted'); + current.classList.add('hs-combo-box-output-item-highlighted'); + } + + static accessibility(evt: KeyboardEvent) { + const target = window.$hsComboBoxCollection.find( + (el) => el.element.isOpened, + ); + + if ( + target && + COMBO_BOX_ACCESSIBILITY_KEY_SET.includes(evt.code) && + !evt.metaKey + ) { + switch (evt.code) { + case 'Escape': + evt.preventDefault(); + this.onEscape(); + break; + case 'ArrowUp': + evt.preventDefault(); + this.onArrow(); + break; + case 'ArrowDown': + evt.preventDefault(); + this.onArrow(false); + break; + case 'Home': + evt.preventDefault(); + this.onStartEnd(); + break; + case 'End': + evt.preventDefault(); + this.onStartEnd(false); + break; + case 'Enter': + evt.preventDefault(); + this.onEnter(evt); + break; + default: + break; + } + } + } + + static onEscape() { + const target = window.$hsComboBoxCollection.find( + (el) => !el.element.preventVisibility && el.element.isOpened, + ); + + if (target) { + target.element.close(); + target.element.input.blur(); + } + } + + static onArrow(isArrowUp = true) { + const target = window.$hsComboBoxCollection.find((el) => + el.element.preventVisibility ? el.element.isCurrent : el.element.isOpened, + ); + + if (target) { + const output = target.element.itemsWrapper ?? target.element.output; + + if (!output) return false; + + const items = HSComboBox.getPreparedItems(isArrowUp, output) as Element[]; + const current = output.querySelector( + '.hs-combo-box-output-item-highlighted', + ); + let currentItem = null; + if (!current) + items[0].classList.add('hs-combo-box-output-item-highlighted'); + let currentInd = items.findIndex((el: any) => el === current); + if (currentInd + 1 < items.length) currentInd++; + currentItem = items[currentInd] as HTMLButtonElement; + + HSComboBox.setHighlighted(current, currentItem, target.element.input); + } + } + + static onStartEnd(isStart = true) { + const target = window.$hsComboBoxCollection.find((el) => + el.element.preventVisibility ? el.element.isCurrent : el.element.isOpened, + ); + + if (target) { + const output = target.element.itemsWrapper ?? target.element.output; + + if (!output) return false; + + const items = HSComboBox.getPreparedItems(isStart, output) as Element[]; + const current = output.querySelector( + '.hs-combo-box-output-item-highlighted', + ); + + if (items.length) + HSComboBox.setHighlighted( + current, + items[0] as HTMLButtonElement, + target.element.input, + ); + } + } + + static onEnter(evt: Event) { + const target = evt.target; + const opened = window.$hsComboBoxCollection.find( + // ::TEST !el.element.preventVisibility && el.element.isOpened + (el) => !isParentOrElementHidden(el.element.el) && el.element.isOpened, + ); + const link: HTMLAnchorElement = opened.element.el.querySelector('a'); + + if ((target as HTMLElement).hasAttribute('data-hs-combo-box-input')) { + opened.element.close(); + (target as HTMLInputElement).blur(); + } else { + if (!opened.element.preventSelection) + opened.element.setSelectedByValue( + opened.element.valuesBySelector(evt.target as HTMLElement), + ); + if (opened.element.preventSelection && link) + window.location.assign(link.getAttribute('href')); + opened.element.close( + !opened.element.preventSelection + ? (evt.target as HTMLElement) + .querySelector('[data-hs-combo-box-value]') + .getAttribute('data-hs-combo-box-search-text') + : null, + ); + } + } +} + +declare global { + interface Window { + HSComboBox: Function; + $hsComboBoxCollection: ICollectionItem[]; + } +} + +window.addEventListener('load', () => { + HSComboBox.autoInit(); + + // Uncomment for debug + // console.log('ComboBox collection:', window.$hsComboBoxCollection); +}); + +document.addEventListener('scroll', () => { + if (!window.$hsComboBoxCollection) return false; + + const target = window.$hsComboBoxCollection.find((el) => el.element.isOpened); + + if (target) target.element.recalculateDirection(); +}); + +if (typeof window !== 'undefined') { + window.HSComboBox = HSComboBox; +} + +export default HSComboBox; diff --git a/src/plugins/combobox/interfaces.ts b/src/plugins/combobox/interfaces.ts new file mode 100644 index 0000000..9db5669 --- /dev/null +++ b/src/plugins/combobox/interfaces.ts @@ -0,0 +1,32 @@ +export interface IComboBoxOptions { + gap?: number; + viewport?: string | HTMLElement | null; + preventVisibility?: boolean; + apiUrl?: string | null; + apiDataPart?: string | null; + apiQuery?: string | null; + apiSearchQuery?: string | null; + apiHeaders?: {}; + apiGroupField?: string | null; + outputItemTemplate?: string | null; + outputEmptyTemplate?: string | null; + outputLoaderTemplate?: string | null; + groupingType?: "default" | "tabs" | null; + groupingTitleTemplate?: string | null; + tabsWrapperTemplate?: string | null; + preventSelection?: boolean; + isOpenOnFocus?: boolean; +} + +export interface IComboBox { + options?: IComboBoxOptions; + + open(): void; + close(): void; + recalculateDirection(): void; +} + +export interface IComboBoxItemAttr { + valueFrom: string; + attr: string; +} \ No newline at end of file diff --git a/src/plugins/combobox/types.ts b/src/plugins/combobox/types.ts new file mode 100644 index 0000000..37ba73a --- /dev/null +++ b/src/plugins/combobox/types.ts @@ -0,0 +1 @@ +// no types diff --git a/src/plugins/copy-markup/index.ts b/src/plugins/copy-markup/index.ts index a390011..7379199 100644 --- a/src/plugins/copy-markup/index.ts +++ b/src/plugins/copy-markup/index.ts @@ -1,6 +1,6 @@ /* * HSCopyMarkup - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream diff --git a/src/plugins/dropdown/index.ts b/src/plugins/dropdown/index.ts index 38f17cf..e8b3a4e 100644 --- a/src/plugins/dropdown/index.ts +++ b/src/plugins/dropdown/index.ts @@ -1,6 +1,6 @@ /* * HSDropdown - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -327,8 +327,6 @@ class HSDropdown !evt.metaKey && !target.element.menu.querySelector('input:focus') ) { - console.log('Key code:', evt.code); - switch (evt.code) { case 'Escape': if (!target.element.menu.querySelector('.hs-select.active')) { diff --git a/src/plugins/input-number/index.ts b/src/plugins/input-number/index.ts index caccf72..39c0e96 100644 --- a/src/plugins/input-number/index.ts +++ b/src/plugins/input-number/index.ts @@ -1,6 +1,6 @@ /* * HSInputNumber - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -33,21 +33,27 @@ class HSInputNumber this.decrement = this.el.querySelector('[data-hs-input-number-decrement]') || null; - this.inputValue = 0; if (this.input) { - this.inputValue = !isNaN(parseInt(this.input.value)) ? parseInt(this.input.value) : 0; + this.inputValue = !isNaN(parseInt(this.input.value)) + ? parseInt(this.input.value) + : 0; } const data = this.el.dataset.hsInputNumber; - const dataOptions: IInputNumberOptions = data ? JSON.parse(data) : {}; + const dataOptions: IInputNumberOptions = data + ? JSON.parse(data) + : { step: 1 }; const concatOptions = { ...dataOptions, - ...options + ...options, }; - this.minInputValue = ('min' in concatOptions) ? concatOptions.min : 0; - this.maxInputValue = ('max' in concatOptions) ? concatOptions.max : null; - this.step = ('step' in concatOptions && concatOptions.step > 0) ? concatOptions.step : 1; + this.minInputValue = 'min' in concatOptions ? concatOptions.min : 0; + this.maxInputValue = 'max' in concatOptions ? concatOptions.max : null; + this.step = + 'step' in concatOptions && concatOptions.step > 0 + ? concatOptions.step + : 1; this.init(); } @@ -63,13 +69,13 @@ class HSInputNumber if (this.increment) this.buildIncrement(); if (this.decrement) this.buildDecrement(); - if (this.minInputValue && this.inputValue <= this.minInputValue) { - this.inputValue = this.minInputValue; - this.input.value = this.minInputValue.toString(); - - this.changeValue(); + if (this.inputValue <= 0 && this.minInputValue === 0) { + this.inputValue = 0; + this.input.value = '0'; } + if (this.inputValue <= 0 || this.minInputValue < 0) this.changeValue(); + if (this.input.hasAttribute('disabled')) this.disableButtons(); } @@ -99,18 +105,34 @@ class HSInputNumber switch (event) { case 'increment': const incrementedResult = this.inputValue + this.step; - this.inputValue = incrementedResult >= minInputValue && incrementedResult <= maxInputValue ? incrementedResult : maxInputValue; + this.inputValue = + incrementedResult >= minInputValue && + incrementedResult <= maxInputValue + ? incrementedResult + : maxInputValue; this.input.value = this.inputValue.toString(); break; case 'decrement': const decrementedResult = this.inputValue - this.step; - this.inputValue = decrementedResult >= minInputValue && decrementedResult <= maxInputValue ? decrementedResult : minInputValue; + this.inputValue = + decrementedResult >= minInputValue && + decrementedResult <= maxInputValue + ? decrementedResult + : minInputValue; this.input.value = this.inputValue.toString(); break; default: - const defaultResult = isNaN(parseInt(this.input.value)) ? 0 : parseInt(this.input.value); - this.inputValue = defaultResult >= maxInputValue ? maxInputValue : defaultResult <= minInputValue ? minInputValue : defaultResult; - if (this.inputValue <= minInputValue) this.input.value = this.inputValue.toString(); + const defaultResult = isNaN(parseInt(this.input.value)) + ? 0 + : parseInt(this.input.value); + this.inputValue = + defaultResult >= maxInputValue + ? maxInputValue + : defaultResult <= minInputValue + ? minInputValue + : defaultResult; + if (this.inputValue <= minInputValue) + this.input.value = this.inputValue.toString(); break; } @@ -123,7 +145,6 @@ class HSInputNumber this.el.classList.remove('disabled'); if (this.decrement) this.enableButtons('decrement'); } - if (this.inputValue === maxInputValue) { this.el.classList.add('disabled'); if (this.increment) this.disableButtons('increment'); diff --git a/src/plugins/input-number/interfaces.ts b/src/plugins/input-number/interfaces.ts index 5bb51e8..f2f7fce 100644 --- a/src/plugins/input-number/interfaces.ts +++ b/src/plugins/input-number/interfaces.ts @@ -6,4 +6,4 @@ export interface IInputNumberOptions { export interface IInputNumber { options?: IInputNumberOptions; -} \ No newline at end of file +} diff --git a/src/plugins/overlay/index.ts b/src/plugins/overlay/index.ts index 9673905..e867640 100644 --- a/src/plugins/overlay/index.ts +++ b/src/plugins/overlay/index.ts @@ -1,12 +1,13 @@ /* * HSOverlay - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream */ import { + stringToBoolean, getClassProperty, isParentOrElementHidden, dispatch, @@ -15,6 +16,7 @@ import { import { IOverlayOptions, IOverlay } from './interfaces'; import { ICollectionItem } from '../../interfaces'; +import { BREAKPOINTS } from '../../constants'; import HSBasePlugin from '../base-plugin'; @@ -28,10 +30,13 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private readonly overlayId: string | null; public overlay: HTMLElement | null; - public isCloseWhenClickInside: string; - public isTabAccessibilityLimited: string; - public hasAutofocus: string; - public hasAbilityToCloseOnBackdropClick: string; + public isCloseWhenClickInside: boolean; + public isTabAccessibilityLimited: boolean; + public isLayoutAffect: boolean; + public hasAutofocus: boolean; + public hasAbilityToCloseOnBackdropClick: boolean; + public openedBreakpoint: number | null; + public autoClose: number | null; constructor(el: HTMLElement, options?: IOverlayOptions, events?: {}) { super(el, options, events); @@ -54,16 +59,39 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { this.overlayId = this.el.getAttribute('data-hs-overlay'); this.overlay = document.querySelector(this.overlayId); if (this.overlay) { - this.isCloseWhenClickInside = + this.isCloseWhenClickInside = stringToBoolean( getClassProperty(this.overlay, '--close-when-click-inside', 'false') || - 'false'; - this.isTabAccessibilityLimited = + 'false', + ); + this.isTabAccessibilityLimited = stringToBoolean( getClassProperty(this.overlay, '--tab-accessibility-limited', 'true') || - 'true'; - this.hasAutofocus = - getClassProperty(this.overlay, '--has-autofocus', 'true') || 'true'; - this.hasAbilityToCloseOnBackdropClick = - this.overlay.getAttribute('data-hs-overlay-keyboard') || 'true'; + 'true', + ); + this.isLayoutAffect = stringToBoolean( + getClassProperty(this.overlay, '--is-layout-affect', 'false') || + 'false', + ); + this.hasAutofocus = stringToBoolean( + getClassProperty(this.overlay, '--has-autofocus', 'true') || 'true', + ); + this.hasAbilityToCloseOnBackdropClick = stringToBoolean( + this.overlay.getAttribute('data-hs-overlay-keyboard') || 'true', + ); + + const autoCloseBreakpoint = getClassProperty( + this.overlay, + '--auto-close', + ); + this.autoClose = + !isNaN(+autoCloseBreakpoint) && isFinite(+autoCloseBreakpoint) + ? +autoCloseBreakpoint + : BREAKPOINTS[autoCloseBreakpoint] || null; + + const openedBreakpoint = getClassProperty(this.overlay, '--opened'); + this.openedBreakpoint = + (!isNaN(+openedBreakpoint) && isFinite(+openedBreakpoint) + ? +openedBreakpoint + : BREAKPOINTS[openedBreakpoint]) || null; } if (this.overlay) this.init(); @@ -72,20 +100,26 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private init() { this.createCollection(window.$hsOverlayCollection, this); + if (this.isLayoutAffect && this.openedBreakpoint) { + const instance = HSOverlay.getInstance(this.el, true); + + HSOverlay.setOpened( + this.openedBreakpoint, + instance as ICollectionItem, + ); + } + this.el.addEventListener('click', () => { - if (this.overlay.classList.contains(this.hiddenClass)) { - this.open(); - } else { - this.close(); - } + if (this.overlay.classList.contains('opened')) this.close(); + else this.open(); }); this.overlay.addEventListener('click', (evt) => { if ( (evt.target as HTMLElement).id && `#${(evt.target as HTMLElement).id}` === this.overlayId && - this.isCloseWhenClickInside === 'true' && - this.hasAbilityToCloseOnBackdropClick === 'true' + this.isCloseWhenClickInside && + this.hasAbilityToCloseOnBackdropClick ) { this.close(); } @@ -202,7 +236,9 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { if (!this.overlay) return false; const currentlyOpened = window.$hsOverlayCollection.find( - (el) => el.element.overlay === document.querySelector('.hs-overlay.open'), + (el) => + el.element.overlay === document.querySelector('.hs-overlay.open') && + !el.element.isLayoutAffect, ); const disabledScroll = getClassProperty(this.overlay, '--body-scroll', 'false') !== 'true'; @@ -230,39 +266,51 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { this.overlay.setAttribute('tabindex', '-1'); setTimeout(() => { - if (this.overlay.classList.contains(this.hiddenClass)) return false; + if (this.overlay.classList.contains('opened')) return false; - this.overlay.classList.add('open'); + this.overlay.classList.add('open', 'opened'); + if (this.isLayoutAffect) + document.body.classList.add('hs-overlay-body-open'); this.fireEvent('open', this.el); dispatch('open.hs.overlay', this.el, this.el); - if (this.hasAutofocus === 'true') this.focusElement(); + if (this.hasAutofocus) this.focusElement(); }, 50); } - public close() { - return new Promise((resolve) => { - if (!this.overlay) return false; - - this.overlay.classList.remove('open'); - this.overlay.removeAttribute('aria-overlay'); - this.overlay.removeAttribute('tabindex'); + public close(forceClose = false) { + if (this.isLayoutAffect) + document.body.classList.remove('hs-overlay-body-open'); - afterTransition(this.overlay, () => { - if (this.overlay.classList.contains('open')) return false; + const closeFn = (cb: Function) => { + if (this.overlay.classList.contains('open')) return false; - this.overlay.classList.add(this.hiddenClass); + this.overlay.classList.add(this.hiddenClass); - this.destroyBackdrop(); + this.destroyBackdrop(); - this.fireEvent('close', this.el); - dispatch('close.hs.overlay', this.el, this.el); + this.fireEvent('close', this.el); + dispatch('close.hs.overlay', this.el, this.el); + if (!document.querySelector('.hs-overlay.opened')) document.body.style.overflow = ''; - resolve(this.overlay); - }); + cb(this.overlay); + }; + + return new Promise((resolve) => { + if (!this.overlay) return false; + + this.overlay.classList.remove('open', 'opened'); + this.overlay.removeAttribute('aria-overlay'); + this.overlay.removeAttribute('tabindex'); + + if (forceClose) closeFn(resolve); + else + afterTransition(this.overlay, () => { + closeFn(resolve); + }); }); } @@ -352,6 +400,13 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { elInCollection.element.close(); } + static setOpened(breakpoint: number, el: ICollectionItem) { + if (document.body.clientWidth >= breakpoint) { + document.body.classList.add('hs-overlay-body-open'); + el.element.overlay.classList.add('opened'); + } else el.element.close(true); + } + // Accessibility methods static accessibility(evt: KeyboardEvent) { const targets = window.$hsOverlayCollection.filter((el) => @@ -370,7 +425,7 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { if ( basicCheck && - target.element.isTabAccessibilityLimited === 'false' && + !target.element.isTabAccessibilityLimited && evt.code === 'Tab' ) return false; @@ -386,7 +441,8 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { } static onEscape(target: ICollectionItem) { - if (target) target.element.close(); + if (target && target.element.hasAbilityToCloseOnBackdropClick) + target.element.close(); } static onTab( @@ -433,6 +489,39 @@ declare global { } } +const autoCloseResizeFn = () => { + if ( + !window.$hsOverlayCollection.length || + !window.$hsOverlayCollection.find((el) => el.element.autoClose) + ) + return false; + + const overlays = window.$hsOverlayCollection.filter( + (el) => el.element.autoClose, + ); + + overlays.forEach((overlay) => { + if (document.body.clientWidth >= overlay.element.autoClose) + overlay.element.close(true); + }); +}; + +const setOpenedResizeFn = () => { + if ( + !window.$hsOverlayCollection.length || + !window.$hsOverlayCollection.find((el) => el.element.openedBreakpoint) + ) + return false; + + const overlays = window.$hsOverlayCollection.filter( + (el) => el.element.openedBreakpoint, + ); + + overlays.forEach((overlay) => { + HSOverlay.setOpened(overlay.element.openedBreakpoint, overlay); + }); +}; + window.addEventListener('load', () => { HSOverlay.autoInit(); @@ -440,6 +529,11 @@ window.addEventListener('load', () => { // console.log('Overlay collection:', window.$hsOverlayCollection); }); +window.addEventListener('resize', () => { + autoCloseResizeFn(); + setOpenedResizeFn(); +}); + if (typeof window !== 'undefined') { window.HSOverlay = HSOverlay; } diff --git a/src/plugins/overlay/interfaces.ts b/src/plugins/overlay/interfaces.ts index 704022c..b46f900 100644 --- a/src/plugins/overlay/interfaces.ts +++ b/src/plugins/overlay/interfaces.ts @@ -6,8 +6,8 @@ export interface IOverlayOptions { export interface IOverlay { options?: IOverlayOptions; - + open(): void; - + close(): void; } diff --git a/src/plugins/pin-input/index.ts b/src/plugins/pin-input/index.ts index 1422546..136d69b 100644 --- a/src/plugins/pin-input/index.ts +++ b/src/plugins/pin-input/index.ts @@ -1,6 +1,6 @@ /* * HSPinInput - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream diff --git a/src/plugins/remove-element/index.ts b/src/plugins/remove-element/index.ts index b984c24..2f34cb4 100644 --- a/src/plugins/remove-element/index.ts +++ b/src/plugins/remove-element/index.ts @@ -1,6 +1,6 @@ /* * HSRemoveElement - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream diff --git a/src/plugins/scrollspy/index.ts b/src/plugins/scrollspy/index.ts index 49e18bb..a93e801 100644 --- a/src/plugins/scrollspy/index.ts +++ b/src/plugins/scrollspy/index.ts @@ -1,6 +1,6 @@ /* * HSScrollspy - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream diff --git a/src/plugins/search-by-json/index.ts b/src/plugins/search-by-json/index.ts index f9792d2..3cfaaf9 100644 --- a/src/plugins/search-by-json/index.ts +++ b/src/plugins/search-by-json/index.ts @@ -1,6 +1,6 @@ /* * HSTogglePassword - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -92,8 +92,6 @@ class HSSearchByJson } this.buildItems(); - - console.log('result:', this.result); }), ); } @@ -162,7 +160,7 @@ class HSSearchByJson if (description) description.append(htmlToElement(`${newDescription}`)); else if (!templateByType) { - const br = htmlToElement('
'); + const br = htmlToElement('
'); template.append(br); template.append(htmlToElement(`${newDescription}`)); } diff --git a/src/plugins/select/index.ts b/src/plugins/select/index.ts index 34613e4..ff92ddd 100644 --- a/src/plugins/select/index.ts +++ b/src/plugins/select/index.ts @@ -1,6 +1,6 @@ /* * HSSelect - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -31,18 +31,20 @@ class HSSelect extends HSBasePlugin implements ISelect { value: string | string[] | null; private readonly placeholder: string | null; private readonly hasSearch: boolean; + private readonly preventSearchFocus: boolean; private readonly mode: string | null; private readonly viewport: HTMLElement | null; isOpened: boolean | null; isMultiple: boolean | null; isDisabled: boolean | null; + selectedItems: string[]; private readonly toggleTag: string | null; private readonly toggleClasses: string | null; private readonly toggleCountText: string | null; private readonly toggleCountTextMinItems: number | null; - private readonly tagsClasses: string | null; + private readonly wrapperClasses: string | null; private readonly tagsItemTemplate: string | null; private readonly tagsItemClasses: string | null; private readonly tagsInputClasses: string | null; @@ -70,17 +72,18 @@ class HSSelect extends HSBasePlugin implements ISelect { private wrapper: HTMLElement | null; private toggle: HTMLElement | null; private toggleTextWrapper: HTMLElement | null; - private tags: HTMLElement | null; - private tagsItems: HTMLElement | null; private tagsInput: HTMLElement | null; private dropdown: HTMLElement | null; private searchWrapper: HTMLElement | null; private search: HTMLInputElement | null; private searchNoResult: HTMLElement | null; private selectOptions: ISingleOption[] | []; + private extraMarkup: string | string[] | null; private readonly isAddTagOnEnter: boolean; + private tagsInputHelper: HTMLElement | null; + constructor(el: HTMLElement, options?: ISelectOptions) { super(el, options); @@ -95,6 +98,7 @@ class HSSelect extends HSBasePlugin implements ISelect { concatOptions?.value || (this.el as HTMLSelectElement).value || null; this.placeholder = concatOptions?.placeholder || 'Select...'; this.hasSearch = concatOptions?.hasSearch || false; + this.preventSearchFocus = concatOptions?.preventSearchFocus || false; this.mode = concatOptions?.mode || 'default'; this.viewport = typeof concatOptions?.viewport !== 'undefined' @@ -103,11 +107,12 @@ class HSSelect extends HSBasePlugin implements ISelect { this.isOpened = Boolean(concatOptions?.isOpened) || false; this.isMultiple = this.el.hasAttribute('multiple') || false; this.isDisabled = this.el.hasAttribute('disabled') || false; + this.selectedItems = []; + this.wrapperClasses = concatOptions?.wrapperClasses || null; this.toggleTag = concatOptions?.toggleTag || null; this.toggleClasses = concatOptions?.toggleClasses || null; this.toggleCountText = concatOptions?.toggleCountText || null; this.toggleCountTextMinItems = concatOptions?.toggleCountTextMinItems || 1; - this.tagsClasses = concatOptions?.tagsClasses || null; this.tagsItemTemplate = concatOptions?.tagsItemTemplate || null; this.tagsItemClasses = concatOptions?.tagsItemClasses || null; this.tagsInputClasses = concatOptions?.tagsInputClasses || null; @@ -130,6 +135,7 @@ class HSSelect extends HSBasePlugin implements ISelect { this.optionTemplate = concatOptions?.optionTemplate || null; this.optionTag = concatOptions?.optionTag || null; this.optionClasses = concatOptions?.optionClasses || null; + this.extraMarkup = concatOptions?.extraMarkup || null; this.descriptionClasses = concatOptions?.descriptionClasses || null; this.iconClasses = concatOptions?.iconClasses || null; this.isAddTagOnEnter = concatOptions?.isAddTagOnEnter ?? true; @@ -137,6 +143,8 @@ class HSSelect extends HSBasePlugin implements ISelect { this.animationInProcess = false; this.selectOptions = []; + this.tagsInputHelper = null; + this.init(); } @@ -186,17 +194,42 @@ class HSSelect extends HSBasePlugin implements ISelect { if (this.mode === 'tags') this.buildTags(); else this.buildToggle(); this.buildDropdown(); + if (this.extraMarkup) this.buildExtraMarkup(); } private buildWrapper() { this.wrapper = document.createElement('div'); this.wrapper.classList.add('hs-select', 'relative'); + if (this.mode === 'tags') { + this.wrapper.addEventListener('click', (evt) => { + if ( + !(evt.target as HTMLElement).closest('[data-hs-select-dropdown]') && + !(evt.target as HTMLElement).closest('[data-tag-value]') + ) { + this.tagsInput.focus(); + } + }); + } + + if (this.wrapperClasses) + classToClassList(this.wrapperClasses, this.wrapper); + this.el.before(this.wrapper); this.wrapper.append(this.el); } + private buildExtraMarkup() { + const appendMarkup = (markup: string) => { + this.wrapper.append(htmlToElement(markup)); + }; + + if (Array.isArray(this.extraMarkup)) + this.extraMarkup.forEach((el) => appendMarkup(el)); + else appendMarkup(this.extraMarkup); + } + private buildToggle() { let icon, title; this.toggleTextWrapper = document.createElement('span'); @@ -258,24 +291,14 @@ class HSSelect extends HSBasePlugin implements ISelect { } private buildTags() { - this.tags = document.createElement('div'); - this.tags.classList.add('flex'); - if (this.tagsClasses) classToClassList(this.tagsClasses, this.tags); - this.buildTagsInput(); - this.buildTagsItems(); this.setTagsItems(); - - if (this.wrapper) this.wrapper.append(this.tags); } - private buildTagsItems() { - this.tagsItems = document.createElement('div'); - this.tagsItems.classList.add('flex', 'flex-wrap', 'flex-0', 'items-center'); - - this.setTagsItems(); - - this.tags.append(this.tagsItems); + private reassignTagsInputPlaceholder(placeholder: string) { + (this.tagsInput as HTMLInputElement).placeholder = placeholder; + this.tagsInputHelper.innerHTML = placeholder; + this.calculateInputWidth(); } private buildTagsItem(val: string) { @@ -284,6 +307,7 @@ class HSSelect extends HSBasePlugin implements ISelect { let template, title, remove, icon: null | HTMLElement; const newItem = document.createElement('div'); + newItem.setAttribute('data-tag-value', val); if (this.tagsItemClasses) classToClassList(this.tagsItemClasses, newItem); if (this.tagsItemTemplate) { @@ -331,14 +355,18 @@ class HSSelect extends HSBasePlugin implements ISelect { remove.addEventListener('click', () => { this.value = (this.value as string[]).filter((el) => el !== val); + this.selectedItems = this.selectedItems.filter((el) => el !== val); + + if (!this.value.length) + this.reassignTagsInputPlaceholder(this.placeholder); this.unselectMultipleItems(); - this.setTagsItems(); this.selectMultipleItems(); - this.fireEvent('change', this.value); + + newItem.remove(); }); - this.tagsItems.append(newItem); + this.wrapper.append(newItem); } private getItemByValue(val: string) { @@ -346,32 +374,25 @@ class HSSelect extends HSBasePlugin implements ISelect { } private setTagsItems() { - this.tagsItems.innerHTML = ''; - if (this.value) { (this.value as string[]).forEach((val) => { - this.buildTagsItem(val); - }); - (this.tagsInput as HTMLInputElement).placeholder = ''; - (this.tagsInput as HTMLInputElement).readOnly = true; - } + if (!this.selectedItems.includes(val)) this.buildTagsItem(val); - if (!this.value.length) { - (this.tagsInput as HTMLInputElement).placeholder = this.placeholder; - (this.tagsInput as HTMLInputElement).readOnly = false; + this.selectedItems = !this.selectedItems.includes(val) + ? [...this.selectedItems, val] + : this.selectedItems; + }); } } private buildTagsInput() { this.tagsInput = document.createElement('input'); - if (!this.value.length) - (this.tagsInput as HTMLInputElement).placeholder = this.placeholder; - if (this.tagsInputClasses) classToClassList(this.tagsInputClasses, this.tagsInput); this.tagsInput.addEventListener('focus', () => this.open()); + this.tagsInput.addEventListener('input', () => this.calculateInputWidth()); this.tagsInput.addEventListener( 'input', debounce((evt: InputEvent) => @@ -392,15 +413,23 @@ class HSSelect extends HSBasePlugin implements ISelect { ).click(); this.resetTagsInputField(); - this.close(); + // this.close(); } }); - this.tags.append(this.tagsInput); + this.wrapper.append(this.tagsInput); + + setTimeout(() => { + this.adjustInputWidth(); + this.reassignTagsInputPlaceholder( + this.value.length ? '' : this.placeholder, + ); + }); } private buildDropdown() { this.dropdown = htmlToElement(this.dropdownTag || '
'); + this.dropdown.setAttribute('data-hs-select-dropdown', ''); this.dropdown.classList.add('absolute', 'top-full'); if (!this.isOpened) this.dropdown.classList.add('hidden'); @@ -547,8 +576,58 @@ class HSSelect extends HSBasePlugin implements ISelect { option.remove(); } + private buildTagsInputHelper() { + this.tagsInputHelper = document.createElement('span'); + this.tagsInputHelper.style.fontSize = window.getComputedStyle( + this.tagsInput, + ).fontSize; + this.tagsInputHelper.style.fontFamily = window.getComputedStyle( + this.tagsInput, + ).fontFamily; + this.tagsInputHelper.style.fontWeight = window.getComputedStyle( + this.tagsInput, + ).fontWeight; + this.tagsInputHelper.style.letterSpacing = window.getComputedStyle( + this.tagsInput, + ).letterSpacing; + this.tagsInputHelper.style.visibility = 'hidden'; + this.tagsInputHelper.style.whiteSpace = 'pre'; + this.tagsInputHelper.style.position = 'absolute'; + + this.wrapper.appendChild(this.tagsInputHelper); + } + + private calculateInputWidth() { + this.tagsInputHelper.textContent = + (this.tagsInput as HTMLInputElement).value || + (this.tagsInput as HTMLInputElement).placeholder; + + const inputPadding = + parseInt(window.getComputedStyle(this.tagsInput).paddingLeft) + + parseInt(window.getComputedStyle(this.tagsInput).paddingRight); + const inputBorder = + parseInt(window.getComputedStyle(this.tagsInput).borderLeftWidth) + + parseInt(window.getComputedStyle(this.tagsInput).borderRightWidth); + const newWidth = + this.tagsInputHelper.offsetWidth + inputPadding + inputBorder; + const maxWidth = + this.wrapper.offsetWidth - + (parseInt(window.getComputedStyle(this.wrapper).paddingLeft) + + parseInt(window.getComputedStyle(this.wrapper).paddingRight)); + + (this.tagsInput as HTMLInputElement).style.width = `${ + Math.min(newWidth, maxWidth) + 2 + }px`; + } + + private adjustInputWidth() { + this.buildTagsInputHelper(); + this.calculateInputWidth(); + } + private onSelectOption(val: string) { this.clearSelections(); + if (this.isMultiple) { this.value = this.value.includes(val) ? Array.from(this.value).filter((el) => el !== val) @@ -566,7 +645,19 @@ class HSSelect extends HSBasePlugin implements ISelect { this.fireEvent('change', this.value); dispatch('change.hs.select', this.el, this.value); - if (this.mode === 'tags') this.resetTagsInputField(); + if (this.mode === 'tags') { + const intersection = this.selectedItems.filter( + (x) => !(this.value as string[]).includes(x), + ); + if (intersection.length) { + intersection.forEach((el) => { + this.selectedItems = this.selectedItems.filter((elI) => elI !== el); + this.wrapper.querySelector(`[data-tag-value="${el}"]`).remove(); + }); + } + + this.resetTagsInputField(); + } if (!this.isMultiple) { if (this.toggle.querySelector('[data-icon]')) this.setToggleIcon(); @@ -575,7 +666,10 @@ class HSSelect extends HSBasePlugin implements ISelect { } if (!this.value.length && this.mode === 'tags') - (this.tagsInput as HTMLInputElement).placeholder = this.placeholder; + this.reassignTagsInputPlaceholder(this.placeholder); + + if (this.isOpened && this.mode === 'tags' && this.tagsInput) + this.tagsInput.focus(); } private addSelectOption( @@ -594,16 +688,21 @@ class HSSelect extends HSBasePlugin implements ISelect { } private removeSelectOption(val: string) { - const hasOption = !!this.selectOptions.some((el: ISingleOption) => el.val === val); + const hasOption = !!this.selectOptions.some( + (el: ISingleOption) => el.val === val, + ); if (!hasOption) return false; - this.selectOptions = this.selectOptions.filter((el: ISingleOption) => el.val !== val); + this.selectOptions = this.selectOptions.filter( + (el: ISingleOption) => el.val !== val, + ); } private resetTagsInputField() { (this.tagsInput as HTMLInputElement).value = ''; - (this.tagsInput as HTMLInputElement).placeholder = ''; + + this.reassignTagsInputPlaceholder(''); this.searchOptions(''); } @@ -690,9 +789,9 @@ class HSSelect extends HSBasePlugin implements ISelect { let hasItems = false; options.forEach((el) => { - const optionVal = el.getAttribute('data-title-value').toLowerCase(); + const optionVal = el.getAttribute('data-title-value').toLocaleLowerCase(); - if (!optionVal.includes(val.toLowerCase())) el.classList.add('hidden'); + if (!optionVal.includes(val.toLocaleLowerCase())) el.classList.add('hidden'); else { el.classList.remove('hidden'); hasItems = true; @@ -744,7 +843,7 @@ class HSSelect extends HSBasePlugin implements ISelect { setTimeout(() => { this.wrapper.classList.add('active'); this.dropdown.classList.add('opened'); - if (this.hasSearch) this.search.focus(); + if (this.hasSearch && !this.preventSearchFocus) this.search.focus(); this.animationInProcess = false; }); @@ -787,7 +886,9 @@ class HSSelect extends HSBasePlugin implements ISelect { let i = `${this.selectOptions.length}`; const addOption = (option: ISingleOption) => { const { title, val, options } = option; - const hasOption = !!this.selectOptions.some((el: ISingleOption) => el.val === val); + const hasOption = !!this.selectOptions.some( + (el: ISingleOption) => el.val === val, + ); if (!hasOption) { this.addSelectOption(title, val, options); @@ -807,7 +908,9 @@ class HSSelect extends HSBasePlugin implements ISelect { public removeOption(values: string | string[]) { const removeOption = (val: string) => { - const hasOption = !!this.selectOptions.some((el: ISingleOption) => el.val === val); + const hasOption = !!this.selectOptions.some( + (el: ISingleOption) => el.val === val, + ); if (hasOption) { this.removeSelectOption(val); @@ -942,10 +1045,6 @@ class HSSelect extends HSBasePlugin implements ISelect { SELECT_ACCESSIBILITY_KEY_SET.includes(evt.code) && !evt.metaKey ) { - console.log(target); - - console.log('Key code:', evt.code); - switch (evt.code) { case 'Escape': evt.preventDefault(); diff --git a/src/plugins/select/interfaces.ts b/src/plugins/select/interfaces.ts index e0a74fc..b96cef6 100644 --- a/src/plugins/select/interfaces.ts +++ b/src/plugins/select/interfaces.ts @@ -14,16 +14,18 @@ export interface ISelectOptions { isOpened?: boolean; placeholder?: string; hasSearch?: boolean; + preventSearchFocus?: boolean; mode?: string; viewport?: string; + wrapperClasses?: string; + toggleTag?: string; toggleClasses?: string; toggleCountText?: string; toggleCountTextMinItems?: number; - tagsClasses?: string; tagsItemTemplate?: string; tagsItemClasses?: string; tagsInputClasses?: string; @@ -36,6 +38,8 @@ export interface ISelectOptions { }; dropdownSpace: number; + extraMarkup?: string | string[] | null; + searchWrapperTemplate?: string; searchClasses?: string; searchWrapperClasses?: string; diff --git a/src/plugins/stepper/index.ts b/src/plugins/stepper/index.ts index c5ca2a7..f41bc5c 100644 --- a/src/plugins/stepper/index.ts +++ b/src/plugins/stepper/index.ts @@ -1,6 +1,6 @@ /* * HSStepper - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream diff --git a/src/plugins/strong-password/index.ts b/src/plugins/strong-password/index.ts index d6484fe..57558af 100644 --- a/src/plugins/strong-password/index.ts +++ b/src/plugins/strong-password/index.ts @@ -1,6 +1,6 @@ /* * HSStrongPassword - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream diff --git a/src/plugins/tabs/index.ts b/src/plugins/tabs/index.ts index 454917c..02b23b6 100644 --- a/src/plugins/tabs/index.ts +++ b/src/plugins/tabs/index.ts @@ -1,6 +1,6 @@ /* * HSTabs - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -157,8 +157,6 @@ class HSTabs extends HSBasePlugin<{}> implements ITabs { evt.preventDefault(); - console.log('Key code:', evt.code); - switch (evt.code) { case isVertical === 'true' ? 'ArrowUp' : 'ArrowLeft': this.onArrow(); diff --git a/src/plugins/theme-switch/index.ts b/src/plugins/theme-switch/index.ts index 953717d..53dc63d 100644 --- a/src/plugins/theme-switch/index.ts +++ b/src/plugins/theme-switch/index.ts @@ -1,6 +1,6 @@ /* * HSThemeSwitch - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream @@ -29,7 +29,7 @@ class HSThemeSwitch this.theme = concatOptions?.theme || localStorage.getItem('hs_theme') || 'default'; - this.themeSet = ['dark', 'light', 'default']; + this.themeSet = ['light', 'dark', 'default']; this.init(); } @@ -51,14 +51,27 @@ class HSThemeSwitch return style; } + private addSystemThemeObserver() { + window + .matchMedia('(prefers-color-scheme: dark)') + .addEventListener('change', ({ matches }) => { + if (matches) this.setAppearance('dark', false); + else this.setAppearance('default', false); + }); + } + + private removeSystemThemeObserver() { + window.matchMedia('(prefers-color-scheme: dark)').removeEventListener; + } + // Public methods public setAppearance( theme = this.theme, isSaveToLocalStorage = true, isSetDispatchEvent = true, ) { - const resetStyles = this.setResetStyles(); const html = document.querySelector('html'); + const resetStyles = this.setResetStyles(); if (isSaveToLocalStorage) localStorage.setItem('hs_theme', theme); if (theme === 'auto') @@ -66,7 +79,7 @@ class HSThemeSwitch ? 'dark' : 'default'; - html.classList.remove('dark', 'default', 'auto'); + html.classList.remove('light', 'dark', 'default', 'auto'); html.classList.add(theme); setTimeout(() => resetStyles.remove()); @@ -91,6 +104,12 @@ class HSThemeSwitch static autoInit() { if (!window.$hsThemeSwitchCollection) window.$hsThemeSwitchCollection = []; + const toggleObserveSystemTheme = (el: HSThemeSwitch) => { + if (localStorage.getItem('hs_theme') === 'auto') + el.addSystemThemeObserver(); + else el.removeSystemThemeObserver(); + }; + document .querySelectorAll('[data-hs-theme-switch]:not(.--prevent-on-load-init)') .forEach((el: HTMLElement) => { @@ -103,10 +122,15 @@ class HSThemeSwitch (switchTheme.el as HTMLInputElement).checked = switchTheme.theme === 'dark'; + toggleObserveSystemTheme(switchTheme); + switchTheme.el.addEventListener('change', (evt) => { - switchTheme.setAppearance( - (evt.target as HTMLInputElement).checked ? 'dark' : 'default', - ); + const theme = (evt.target as HTMLInputElement).checked + ? 'dark' + : 'default'; + switchTheme.setAppearance(theme); + + toggleObserveSystemTheme(switchTheme); }); } }); @@ -119,9 +143,13 @@ class HSThemeSwitch const theme = el.getAttribute('data-hs-theme-click-value'); const switchTheme = new HSThemeSwitch(el); - switchTheme.el.addEventListener('click', () => - switchTheme.setAppearance(theme), - ); + toggleObserveSystemTheme(switchTheme); + + switchTheme.el.addEventListener('click', () => { + switchTheme.setAppearance(theme); + + toggleObserveSystemTheme(switchTheme); + }); }); } } diff --git a/src/plugins/toggle-count/index.ts b/src/plugins/toggle-count/index.ts index 9327eda..3656672 100644 --- a/src/plugins/toggle-count/index.ts +++ b/src/plugins/toggle-count/index.ts @@ -1,6 +1,6 @@ /* * HSToggleCount - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream diff --git a/src/plugins/toggle-password/index.ts b/src/plugins/toggle-password/index.ts index 48bc1c6..af4ede0 100644 --- a/src/plugins/toggle-password/index.ts +++ b/src/plugins/toggle-password/index.ts @@ -1,6 +1,6 @@ /* * HSTogglePassword - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream diff --git a/src/plugins/tooltip/index.ts b/src/plugins/tooltip/index.ts index c7b23e5..0f59b7e 100644 --- a/src/plugins/tooltip/index.ts +++ b/src/plugins/tooltip/index.ts @@ -1,6 +1,6 @@ /* * HSTooltip - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream diff --git a/src/spa/index.ts b/src/spa/index.ts index 206c75e..a2bbce7 100644 --- a/src/spa/index.ts +++ b/src/spa/index.ts @@ -4,6 +4,7 @@ import HSCopyMarkup from '../plugins/copy-markup'; import HSAccordion from '../plugins/accordion'; import HSCarousel from '../plugins/carousel'; import HSCollapse from '../plugins/collapse'; +import HSComboBox from '../plugins/combobox'; import HSDropdown from '../plugins/dropdown'; import HSInputNumber from '../plugins/input-number'; import HSOverlay from '../plugins/overlay'; @@ -23,6 +24,7 @@ export const COLLECTIONS: ISpaCollectionItem[] = [ { key: 'accordion', fn: HSAccordion }, { key: 'carousel', fn: HSCarousel }, { key: 'collapse', fn: HSCollapse }, + { key: 'combobox', fn: HSComboBox }, { key: 'dropdown', fn: HSDropdown }, { key: 'input-number', fn: HSInputNumber }, { key: 'overlay', fn: HSOverlay }, diff --git a/src/static/index.ts b/src/static/index.ts index 81c8506..5e4471c 100644 --- a/src/static/index.ts +++ b/src/static/index.ts @@ -1,6 +1,6 @@ /* * HSStaticMethods - * @version: 2.0.3 + * @version: 2.1.0 * @author: HTMLStream * @license: Licensed under MIT (https://preline.co/docs/license.html) * Copyright 2023 HTMLStream diff --git a/src/utils/index.ts b/src/utils/index.ts index 3e9bc6c..9083950 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,3 +1,7 @@ +const stringToBoolean = (string: string): boolean => { + return string === 'true' ? true : false; +}; + const getClassProperty = (el: HTMLElement, prop: string, val = '') => { return (window.getComputedStyle(el).getPropertyValue(prop) || val).replace( ' ', @@ -21,6 +25,24 @@ const getClassPropertyAlt = ( return targetClass.match(/:(.*)]/) ? targetClass.match(/:(.*)]/)[1] : val; }; +// const getClassPropertyAlt = ( +// el: HTMLElement, +// prop: string, +// val: string = '', +// ): string => { +// let targetClass = ''; + +// el.classList.forEach((className) => { +// if (className.includes(prop)) { +// targetClass = className; +// } +// }); + +// const match = targetClass.match(/:(.*)/); + +// return match ? match[1] : val; +// }; + const isIOS = () => { if (/iPad|iPhone|iPod/.test(navigator.platform)) { return true; @@ -116,15 +138,12 @@ const afterTransition = (el: HTMLElement, callback: Function) => { el.removeEventListener('transitionend', handleEvent, true); }; - - if ( + const hasTransition = window.getComputedStyle(el, null).getPropertyValue('transition') !== - 'all 0s ease 0s' - ) { - el.addEventListener('transitionend', handleEvent, true); - } else { - callback(); - } + (navigator.userAgent.includes('Firefox') ? 'all' : 'all 0s ease 0s'); + + if (hasTransition) el.addEventListener('transitionend', handleEvent, true); + else callback(); }; const htmlToElement = (html: string): HTMLElement => { @@ -139,9 +158,12 @@ const classToClassList = ( classes: string, target: HTMLElement, splitter = ' ', + action: 'add' | 'remove' = 'add', ) => { const classesToArray = classes.split(splitter); - classesToArray.forEach((cl) => target.classList.add(cl)); + classesToArray.forEach((cl) => + action === 'add' ? target.classList.add(cl) : target.classList.remove(cl), + ); }; const menuSearchHistory = { @@ -161,6 +183,7 @@ const menuSearchHistory = { }; export { + stringToBoolean, getClassProperty, getClassPropertyAlt, isIOS, diff --git a/webpack.config.js b/webpack.config.js index bd435d3..e426caa 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,11 +4,13 @@ const TerserPlugin = require('terser-webpack-plugin'); module.exports = { mode: 'production', watch: true, + stats: 'minimal', entry: { index: './src/index.ts', accordion: './src/plugins/accordion/index.ts', carousel: './src/plugins/carousel/index.ts', collapse: './src/plugins/collapse/index.ts', + combobox: './src/plugins/combobox/index.ts', 'copy-markup': './src/plugins/copy-markup/index.ts', dropdown: './src/plugins/dropdown/index.ts', 'input-number': './src/plugins/input-number/index.ts',