From 0c521a3c454f2ce345cad137473b77a89ed50a33 Mon Sep 17 00:00:00 2001 From: Bakhodir Date: Mon, 23 Sep 2024 21:29:43 +0300 Subject: [PATCH] v2.5.0 --- dist/accordion.d.ts | 5 +- dist/accordion.js | 9 +- dist/accordion.mjs | 9 + dist/carousel.d.ts | 74 +- dist/carousel.js | 13 +- dist/carousel.mjs | 9 + dist/collapse.js | 13 +- dist/collapse.mjs | 9 + dist/combobox.js | 13 +- dist/combobox.mjs | 1 + dist/copy-markup.js | 13 +- dist/copy-markup.mjs | 9 + dist/datatable.js | 13 +- dist/datatable.mjs | 9 + dist/dropdown.js | 13 +- dist/dropdown.mjs | 16 + dist/file-upload.d.ts | 2 +- dist/file-upload.js | 13 +- dist/file-upload.mjs | 9 + dist/helper-apexcharts.d.ts | 52 ++ dist/helper-apexcharts.js | 7 + dist/helper-apexcharts.mjs | 8 + dist/helper-clipboard.d.ts | 1 + dist/helper-clipboard.js | 7 + dist/helper-clipboard.mjs | 7 + dist/index.d.ts | 195 ++++- dist/index.js | 131 ++- dist/index.mjs | 187 ++++ dist/input-number.js | 13 +- dist/input-number.mjs | 9 + dist/overlay.d.ts | 3 + dist/overlay.js | 13 +- dist/overlay.mjs | 16 + dist/pin-input.js | 13 +- dist/pin-input.mjs | 9 + dist/preline.d.ts | 195 ++++- dist/preline.js | 131 ++- dist/range-slider.d.ts | 55 ++ dist/range-slider.js | 9 + dist/range-slider.mjs | 8 + dist/remove-element.js | 13 +- dist/remove-element.mjs | 9 + dist/scrollspy.js | 13 +- dist/scrollspy.mjs | 16 + dist/search-by-json.d.ts | 62 -- dist/select.d.ts | 51 ++ dist/select.js | 13 +- dist/select.mjs | 1 + dist/stepper.js | 13 +- dist/stepper.mjs | 9 + dist/strong-password.js | 13 +- dist/strong-password.mjs | 9 + dist/tabs.js | 13 +- dist/tabs.mjs | 9 + dist/textarea-auto-height.d.ts | 43 + dist/textarea-auto-height.js | 9 + dist/textarea-auto-height.mjs | 8 + dist/theme-switch.js | 10 +- dist/theme-switch.mjs | 1 + dist/toggle-count.js | 12 +- dist/toggle-count.mjs | 8 + dist/toggle-password.js | 13 +- dist/toggle-password.mjs | 9 + dist/tooltip.js | 13 +- dist/tooltip.mjs | 16 + dist/tree-view.d.ts | 65 ++ dist/tree-view.js | 16 + dist/tree-view.mjs | 9 + dts-config.js | 37 +- global.d.ts | 74 ++ index.d.ts | 195 ++++- index.js | 131 ++- package-lock.json | 421 ++++++--- package.json | 19 +- plugin.js | 88 +- plugin.ts | 676 +++++++++++++++ preline.d.ts | 195 ++++- preline.js | 131 ++- src/constants.ts | 1 + src/helpers/apexcharts/index.ts | 307 +++++++ src/helpers/apexcharts/interfaces.ts | 47 + src/helpers/clipboard/index.ts | 70 ++ src/helpers/types.ts | 12 + src/index.ts | 18 +- src/plugins/accordion/index.ts | 30 +- src/plugins/base-plugin/index.ts | 6 +- src/plugins/carousel/index.ts | 816 +++++++++++++++--- src/plugins/carousel/interfaces.ts | 20 +- src/plugins/carousel/types.ts | 4 +- src/plugins/collapse/index.ts | 4 +- src/plugins/combobox/index.ts | 8 +- src/plugins/copy-markup/index.ts | 7 +- src/plugins/datatable/index.ts | 4 +- src/plugins/dropdown/index.ts | 4 +- src/plugins/file-upload/index.ts | 6 +- src/plugins/input-number/index.ts | 7 +- src/plugins/overlay/index.ts | 43 +- src/plugins/overlay/interfaces.ts | 1 + src/plugins/pin-input/index.ts | 4 +- src/plugins/range-slider/index.ts | 215 +++++ src/plugins/range-slider/interfaces.ts | 24 + src/plugins/range-slider/types.ts | 4 + src/plugins/remove-element/index.ts | 13 +- src/plugins/scrollspy/index.ts | 4 +- src/plugins/search-by-json/index.ts | 217 ----- src/plugins/search-by-json/interfaces.ts | 28 - src/plugins/select/index.ts | 459 +++++++++- src/plugins/select/interfaces.ts | 24 + src/plugins/stepper/index.ts | 8 +- src/plugins/strong-password/index.ts | 7 +- src/plugins/tabs/index.ts | 4 +- src/plugins/tabs/interfaces.ts | 2 +- src/plugins/textarea-auto-height/index.ts | 167 ++++ .../textarea-auto-height/interfaces.ts | 7 + .../types.ts | 0 src/plugins/theme-switch/index.ts | 7 +- src/plugins/toggle-count/index.ts | 7 +- src/plugins/toggle-password/index.ts | 7 +- src/plugins/tooltip/index.ts | 4 +- src/plugins/tree-view/index.ts | 303 +++++++ src/plugins/tree-view/interfaces.ts | 20 + src/plugins/tree-view/types.ts | 1 + src/spa/index.ts | 23 +- src/static/index.ts | 12 +- src/utils/index.ts | 18 + tsconfig.json | 11 +- tsconfig.mjs.json | 22 + webpack.config.js | 14 +- webpack.config.mjs.js | 82 ++ 129 files changed, 5829 insertions(+), 1068 deletions(-) create mode 100644 dist/accordion.mjs create mode 100644 dist/carousel.mjs create mode 100644 dist/collapse.mjs create mode 100644 dist/combobox.mjs create mode 100644 dist/copy-markup.mjs create mode 100644 dist/datatable.mjs create mode 100644 dist/dropdown.mjs create mode 100644 dist/file-upload.mjs create mode 100644 dist/helper-apexcharts.d.ts create mode 100644 dist/helper-apexcharts.js create mode 100644 dist/helper-apexcharts.mjs create mode 100644 dist/helper-clipboard.d.ts create mode 100644 dist/helper-clipboard.js create mode 100644 dist/helper-clipboard.mjs create mode 100644 dist/index.mjs create mode 100644 dist/input-number.mjs create mode 100644 dist/overlay.mjs create mode 100644 dist/pin-input.mjs create mode 100644 dist/range-slider.d.ts create mode 100644 dist/range-slider.js create mode 100644 dist/range-slider.mjs create mode 100644 dist/remove-element.mjs create mode 100644 dist/scrollspy.mjs delete mode 100644 dist/search-by-json.d.ts create mode 100644 dist/select.mjs create mode 100644 dist/stepper.mjs create mode 100644 dist/strong-password.mjs create mode 100644 dist/tabs.mjs create mode 100644 dist/textarea-auto-height.d.ts create mode 100644 dist/textarea-auto-height.js create mode 100644 dist/textarea-auto-height.mjs create mode 100644 dist/theme-switch.mjs create mode 100644 dist/toggle-count.mjs create mode 100644 dist/toggle-password.mjs create mode 100644 dist/tooltip.mjs create mode 100644 dist/tree-view.d.ts create mode 100644 dist/tree-view.js create mode 100644 dist/tree-view.mjs create mode 100644 global.d.ts create mode 100644 plugin.ts create mode 100644 src/helpers/apexcharts/index.ts create mode 100644 src/helpers/apexcharts/interfaces.ts create mode 100644 src/helpers/clipboard/index.ts create mode 100644 src/helpers/types.ts create mode 100644 src/plugins/range-slider/index.ts create mode 100644 src/plugins/range-slider/interfaces.ts create mode 100644 src/plugins/range-slider/types.ts delete mode 100644 src/plugins/search-by-json/index.ts delete mode 100644 src/plugins/search-by-json/interfaces.ts create mode 100644 src/plugins/textarea-auto-height/index.ts create mode 100644 src/plugins/textarea-auto-height/interfaces.ts rename src/plugins/{search-by-json => textarea-auto-height}/types.ts (100%) create mode 100644 src/plugins/tree-view/index.ts create mode 100644 src/plugins/tree-view/interfaces.ts create mode 100644 src/plugins/tree-view/types.ts create mode 100644 tsconfig.mjs.json create mode 100644 webpack.config.mjs.js diff --git a/dist/accordion.d.ts b/dist/accordion.d.ts index 9becfa4..b05acf2 100644 --- a/dist/accordion.d.ts +++ b/dist/accordion.d.ts @@ -32,13 +32,14 @@ export interface IAccordion { declare class HSAccordion extends HSBasePlugin implements IAccordion { private readonly toggle; content: HTMLElement | null; - private readonly group; - private readonly isAlwaysOpened; + private group; + private isAlwaysOpened; static selectable: IAccordionTreeView[]; constructor(el: HTMLElement, options?: IAccordionOptions, events?: {}); private init; show(): boolean; hide(): boolean; + update(): boolean; static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem; static show(target: HTMLElement): void; static hide(target: HTMLElement): void; diff --git a/dist/accordion.js b/dist/accordion.js index 874102d..1e8c939 100644 --- a/dist/accordion.js +++ b/dist/accordion.js @@ -1,17 +1,16 @@ !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={740:function(t,e,n){ /* * HSAccordion - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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 .hs-accordion.active")&&this.group.querySelector(":scope > .hs-accordion.active")!==this.el&&window.$hsAccordionCollection.find((function(t){return t.element.el===e.group.querySelector(":scope > .hs-accordion.active")})).element.hide();if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.content.style.display="block",this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px")})),(0,s.afterTransition)(this.content,(function(){e.content.style.display="block",e.content.style.height="",e.fireEvent("open",e.el),(0,s.dispatch)("open.hs.accordion",e.el,e.el)}))},e.prototype.hide=function(){var t,e=this;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),(0,s.afterTransition)(this.content,(function(){e.content.style.display="",e.content.style.height="0",e.fireEvent("close",e.el),(0,s.dispatch)("close.hs.accordion",e.el,e.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.treeView=function(){var t=this;if(!document.querySelectorAll(".hs-accordion-treeview-root").length)return!1;this.selectable=[],document.querySelectorAll(".hs-accordion-treeview-root").forEach((function(e){var n=null==e?void 0:e.getAttribute("data-hs-accordion-options"),o=n?JSON.parse(n):{};t.selectable.push({el:e,options:r({},o)})})),this.selectable.length&&this.selectable.forEach((function(e){e.el.querySelectorAll(".hs-accordion-selectable").forEach((function(n){n.addEventListener("click",(function(o){o.stopPropagation(),t.toggleSelected(e,n)}))}))}))},e.toggleSelected=function(t,e){e.classList.contains("selected")?e.classList.remove("selected"):(t.el.querySelectorAll(".hs-accordion-selectable").forEach((function(t){return t.classList.remove("selected")})),e.classList.add("selected"))},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}(c(n(961)).default);window.addEventListener("load",(function(){l.autoInit(),document.querySelectorAll(".hs-accordion-treeview-root").length&&l.treeView()})),"undefined"!=typeof window&&(window.HSAccordion=l),e.default=l},961:(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 .hs-accordion.active")&&this.group.querySelector(":scope > .hs-accordion.active")!==this.el&&window.$hsAccordionCollection.find((function(t){return t.element.el===e.group.querySelector(":scope > .hs-accordion.active")})).element.hide();if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.content.style.display="block",this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px")})),(0,c.afterTransition)(this.content,(function(){e.content.style.display="block",e.content.style.height="",e.fireEvent("open",e.el),(0,c.dispatch)("open.hs.accordion",e.el,e.el)}))},e.prototype.hide=function(){var t,e=this;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),(0,c.afterTransition)(this.content,(function(){e.content.style.display="",e.content.style.height="0",e.fireEvent("close",e.el),(0,c.dispatch)("close.hs.accordion",e.el,e.el)}))},e.prototype.update=function(){var t=this;if(this.group=this.el.closest(".hs-accordion-group")||null,!this.group)return!1;this.isAlwaysOpened=this.group.hasAttribute("data-hs-accordion-always-open")||!1,window.$hsAccordionCollection.map((function(e){return e.id===t.el.id&&(e.element.group=t.group,e.element.isAlwaysOpened=t.isAlwaysOpened),e}))},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.treeView=function(){var t=this;if(!document.querySelectorAll(".hs-accordion-treeview-root").length)return!1;this.selectable=[],document.querySelectorAll(".hs-accordion-treeview-root").forEach((function(e){var n=null==e?void 0:e.getAttribute("data-hs-accordion-options"),o=n?JSON.parse(n):{};t.selectable.push({el:e,options:r({},o)})})),this.selectable.length&&this.selectable.forEach((function(e){e.el.querySelectorAll(".hs-accordion-selectable").forEach((function(n){n.addEventListener("click",(function(o){o.stopPropagation(),t.toggleSelected(e,n)}))}))}))},e.toggleSelected=function(t,e){e.classList.contains("selected")?e.classList.remove("selected"):(t.el.querySelectorAll(".hs-accordion-selectable").forEach((function(t){return t.classList.remove("selected")})),e.classList.add("selected"))},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}(s(n(961)).default);window.addEventListener("load",(function(){l.autoInit(),document.querySelectorAll(".hs-accordion-treeview-root").length&&l.treeView()})),"undefined"!=typeof window&&(window.HSAccordion=l),e.default=l},961:(t,e)=>{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},292:function(t,e){ /* - * HSBasePlugin - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},292: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.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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 i=function(t){return!!t&&("none"===window.getComputedStyle(t).display||i(t.parentElement))};e.isParentOrElementHidden=i;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(740);return n})())); \ No newline at end of file +var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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.isDirectChild=function(t,e){for(var n=t.children,o=0;o=u:"top"===n?l>=u:l>=u||a>=u};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 o;return void 0===e&&(e=200),function(){for(var i=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(740);return n})())); \ No newline at end of file diff --git a/dist/accordion.mjs b/dist/accordion.mjs new file mode 100644 index 0000000..db71036 --- /dev/null +++ b/dist/accordion.mjs @@ -0,0 +1,9 @@ +var e={615:(e,t,o)=>{o.d(t,{A:()=>i});class i{constructor(e,t,o){this.el=e,this.options=t,this.events=o,this.el=e,this.options=t,this.events={}}createCollection(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})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},926:(e,t,o)=>{o.d(t,{JD:()=>i,yd:()=>s});const i=(e,t,o=null)=>{const i=new CustomEvent(e,{detail:{payload:o},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(i)},s=(e,t)=>{const o=()=>{t(),e.removeEventListener("transitionend",o,!0)},i=window.getComputedStyle(e),s=i.getPropertyValue("transition-duration");"none"!==i.getPropertyValue("transition-property")&&parseFloat(s)>0?e.addEventListener("transitionend",o,!0):t()}}},t={};function o(i){var s=t[i];if(void 0!==s)return s.exports;var n=t[i]={exports:{}};return e[i](n,n.exports,o),n.exports}o.d=(e,t)=>{for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};o.d(i,{A:()=>c});var s=o(926),n=o(615); +/* + * HSAccordion + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class l extends n.A{constructor(e,t,o){super(e,t,o),this.toggle=this.el.querySelector(".hs-accordion-toggle")||null,this.content=this.el.querySelector(".hs-accordion-content")||null,this.update(),this.toggle&&this.content&&this.init()}init(){this.createCollection(window.$hsAccordionCollection,this),this.toggle.addEventListener("click",(e=>{e.stopPropagation(),this.el.classList.contains("active")?this.hide():this.show()}))}show(){var e;if(this.group&&!this.isAlwaysOpened&&this.group.querySelector(":scope > .hs-accordion.active")&&this.group.querySelector(":scope > .hs-accordion.active")!==this.el){window.$hsAccordionCollection.find((e=>e.element.el===this.group.querySelector(":scope > .hs-accordion.active"))).element.hide()}if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.content.style.display="block",this.content.style.height="0",setTimeout((()=>{this.content.style.height=`${this.content.scrollHeight}px`})),(0,s.yd)(this.content,(()=>{this.content.style.display="block",this.content.style.height="",this.fireEvent("open",this.el),(0,s.JD)("open.hs.accordion",this.el,this.el)}))}hide(){var e;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.content.style.height=`${this.content.scrollHeight}px`,setTimeout((()=>{this.content.style.height="0"})),(0,s.yd)(this.content,(()=>{this.content.style.display="",this.content.style.height="0",this.fireEvent("close",this.el),(0,s.JD)("close.hs.accordion",this.el,this.el)}))}update(){if(this.group=this.el.closest(".hs-accordion-group")||null,!this.group)return!1;this.isAlwaysOpened=this.group.hasAttribute("data-hs-accordion-always-open")||!1,window.$hsAccordionCollection.map((e=>(e.id===this.el.id&&(e.element.group=this.group,e.element.isAlwaysOpened=this.isAlwaysOpened),e)))}static getInstance(e,t){const o=window.$hsAccordionCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return o?t?o:o.element.el:null}static show(e){const t=window.$hsAccordionCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));t&&"block"!==t.element.content.style.display&&t.element.show()}static hide(e){const t=window.$hsAccordionCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));t&&"block"===t.element.content.style.display&&t.element.hide()}static autoInit(){window.$hsAccordionCollection||(window.$hsAccordionCollection=[]),document.querySelectorAll(".hs-accordion:not(.--prevent-on-load-init)").forEach((e=>{window.$hsAccordionCollection.find((t=>{var o;return(null===(o=null==t?void 0:t.element)||void 0===o?void 0:o.el)===e}))||new l(e)}))}static treeView(){if(!document.querySelectorAll(".hs-accordion-treeview-root").length)return!1;this.selectable=[],document.querySelectorAll(".hs-accordion-treeview-root").forEach((e=>{const t=null==e?void 0:e.getAttribute("data-hs-accordion-options"),o=t?JSON.parse(t):{};this.selectable.push({el:e,options:Object.assign({},o)})})),this.selectable.length&&this.selectable.forEach((e=>{const{el:t}=e;t.querySelectorAll(".hs-accordion-selectable").forEach((t=>{t.addEventListener("click",(o=>{o.stopPropagation(),this.toggleSelected(e,t)}))}))}))}static toggleSelected(e,t){t.classList.contains("selected")?t.classList.remove("selected"):(e.el.querySelectorAll(".hs-accordion-selectable").forEach((e=>e.classList.remove("selected"))),t.classList.add("selected"))}static on(e,t,o){const i=window.$hsAccordionCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));i&&(i.element.events[e]=o)}}window.addEventListener("load",(()=>{l.autoInit(),document.querySelectorAll(".hs-accordion-treeview-root").length&&l.treeView()})),"undefined"!=typeof window&&(window.HSAccordion=l);const c=l;var r=i.A;export{r as default}; \ No newline at end of file diff --git a/dist/carousel.d.ts b/dist/carousel.d.ts index 357f7b8..0a76473 100644 --- a/dist/carousel.d.ts +++ b/dist/carousel.d.ts @@ -16,13 +16,24 @@ export interface ICollectionItem { id: string | number; element: T; } +export type TCarouselOptionsSlidesQty = { + [key: string]: number; +}; export interface ICarouselOptions { currentIndex: number; loadingClasses?: string | string[]; + dotsItemClasses?: string; + isAutoHeight?: boolean; isAutoPlay?: boolean; - speed?: number; + isCentered?: boolean; + isDraggable?: boolean; isInfiniteLoop?: boolean; isRTL?: boolean; + isSnap?: boolean; + hasSnapSpacers?: boolean; + slidesQty?: TCarouselOptionsSlidesQty | number; + speed?: number; + updateDelay?: number; } export interface ICarousel { options?: ICarouselOptions; @@ -32,28 +43,69 @@ export interface ICarousel { goTo(i: number): void; } declare class HSCarousel extends HSBasePlugin implements ICarousel { + private currentIndex; + private readonly loadingClasses; + private readonly dotsItemClasses; + private readonly isAutoHeight; + private readonly isAutoPlay; + private readonly isCentered; + private readonly isDraggable; + private readonly isInfiniteLoop; + private readonly isRTL; + private readonly isSnap; + private readonly hasSnapSpacers; + private readonly slidesQty; + private readonly speed; + private readonly updateDelay; + private readonly loadingClassesRemove; + private readonly loadingClassesAdd; + private readonly afterLoadingClassesAdd; + private readonly container; private readonly inner; private readonly slides; private readonly prev; private readonly next; private readonly dots; + private dotsItems; + private readonly info; + private readonly infoTotal; + private readonly infoCurrent; private sliderWidth; - private currentIndex; - private readonly loadingClasses; - private readonly loadingClassesRemove; - private readonly loadingClassesAdd; - private readonly afterLoadingClassesAdd; - private readonly isAutoPlay; - private readonly isRTL; - private readonly speed; - private readonly isInfiniteLoop; private timer; + private isScrolling; + private isDragging; + private dragStartX; + private initialTranslateX; private readonly touchX; + private resizeContainer; + resizeContainerWidth: number; constructor(el: HTMLElement, options?: ICarouselOptions); + private setIsSnap; private init; + private initDragHandling; + private getTranslateXValue; + private removeClickEventWhileDragging; + private handleDragStart; + private handleDragMove; + private handleDragEnd; + private getEventX; + private getCurrentSlidesQty; + private buildSnapSpacers; + private initDots; + private buildDots; + private setDots; + private goToCurrentDot; + private buildInfo; + private setInfoTotal; + private setInfoCurrent; + private buildSingleDot; + private singleDotEvents; private observeResize; private calculateWidth; private addCurrentClass; + private setCurrentDot; + private setElementToDisabled; + private unsetElementToDisabled; private addDisabledClass; private autoPlay; private setTimer; @@ -61,9 +113,11 @@ declare class HSCarousel extends HSBasePlugin implements ICaro private detectDirection; recalculateWidth(): void; private calculateTransform; + private setTranslate; goToPrev(): void; goToNext(): void; goTo(i: number): void; + private setIndex; static getInstance(target: HTMLElement | string, isInstance?: boolean): HSCarousel | ICollectionItem; static autoInit(): void; } diff --git a/dist/carousel.js b/dist/carousel.js index 11e5fa8..d295380 100644 --- a/dist/carousel.js +++ b/dist/carousel.js @@ -1,17 +1,16 @@ -!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={961:(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 i=e();for(var s in i)("object"==typeof exports?exports:t)[s]=i[s]}}(self,(()=>(()=>{"use strict";var t={223:(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={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},961:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e,i){this.el=t,this.options=e,this.events=i,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var i;t.push({id:(null===(i=null==e?void 0:e.el)||void 0===i?void 0:i.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=i},268:function(t,e,i){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSCarousel + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},268:function(t,e,s){ +var s,n=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 i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},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 i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,i=1,s=arguments.length;it?o:-s:s>r?r:s<-t?o:s}())}},e.prototype.handleDragEnd=function(){var t=this;if(this.isDragging){this.isDragging=!1;var e=this.sliderWidth/this.getCurrentSlidesQty(),i=this.getTranslateXValue(),s=Math.round(i/e);this.isRTL&&(s=Math.round(i/e)),this.inner.classList.remove("dragging"),setTimeout((function(){t.calculateTransform(s),t.dots&&t.setCurrentDot(),t.dragStartX=null,t.initialTranslateX=null,t.inner.querySelectorAll("a.prevented-click").forEach((function(e){e.classList.remove("prevented-click"),e.removeEventListener("click",t.removeClickEventWhileDragging)}))}))}},e.prototype.getEventX=function(t){return t instanceof MouseEvent?t.clientX:t.touches[0].clientX},e.prototype.getCurrentSlidesQty=function(){var t=this;if("object"==typeof this.slidesQty){var e=document.body.clientWidth,i=0;return Object.keys(this.slidesQty).forEach((function(s){e>=(typeof s+1=="number"?t.slidesQty[s]:d.BREAKPOINTS[s])&&(i=t.slidesQty[s])})),i}return this.slidesQty},e.prototype.buildSnapSpacers=function(){var t=this.inner.querySelector(".hs-snap-before"),e=this.inner.querySelector(".hs-snap-after");t&&t.remove(),e&&e.remove();var i=this.sliderWidth,s=i/2-i/this.getCurrentSlidesQty()/2,n=(0,a.htmlToElement)('
')),r=(0,a.htmlToElement)('
'));this.inner.prepend(n),this.inner.appendChild(r)},e.prototype.initDots=function(){this.el.querySelectorAll(".hs-carousel-pagination-item").length?this.setDots():this.buildDots(),this.dots&&this.setCurrentDot()},e.prototype.buildDots=function(){this.dots.innerHTML="";for(var t=!this.isCentered&&this.slidesQty?this.slides.length-(this.getCurrentSlidesQty()-1):this.slides.length,e=0;ei+n)&&(c=d-n),(hs+r)&&(p=u-r),t.scrollTo({left:c,top:p,behavior:"smooth"})},e.prototype.buildInfo=function(){this.infoTotal&&this.setInfoTotal(),this.infoCurrent&&this.setInfoCurrent()},e.prototype.setInfoTotal=function(){this.infoTotal.innerText="".concat(this.slides.length)},e.prototype.setInfoCurrent=function(){this.infoCurrent.innerText="".concat(this.currentIndex+1)},e.prototype.buildSingleDot=function(t){var e=(0,a.htmlToElement)("");return this.dotsItemClasses&&(0,a.classToClassList)(this.dotsItemClasses,e),this.singleDotEvents(e,t),e},e.prototype.singleDotEvents=function(t,e){var i=this;t.addEventListener("click",(function(){i.goTo(e),i.isAutoPlay&&(i.resetTimer(),i.setTimer())}))},e.prototype.observeResize=function(){var t=this;new ResizeObserver((0,a.debounce)((function(e){for(var i=0,s=e;i=this.currentIndex-e?s.classList.add("active"):s.classList.remove("active")}else{var n=this.isCentered?this.currentIndex+this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.currentIndex+this.getCurrentSlidesQty();this.slides.forEach((function(e,i){i>=t.currentIndex&&i *").forEach((function(t,i){return e(t,i)}))},e.prototype.setElementToDisabled=function(t){t.classList.add("disabled"),"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled")},e.prototype.unsetElementToDisabled=function(t){t.classList.remove("disabled"),"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled")},e.prototype.addDisabledClass=function(){if(!this.prev||!this.next)return!1;var t=getComputedStyle(this.inner).getPropertyValue("gap"),e=Math.floor(this.getCurrentSlidesQty()/2),i=0,s=0,n=!1,r=!1;this.isSnap?(i=this.currentIndex,s=this.hasSnapSpacers?this.slides.length-1:this.slides.length-e-1,n=this.hasSnapSpacers?0===i:this.getCurrentSlidesQty()%2==0?i-e<0:i-e==0,r=i>=s&&this.container.scrollLeft+this.container.clientWidth+(parseFloat(t)||0)>=this.container.scrollWidth):(n=0===(i=this.currentIndex),r=i>=(s=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty())),n?(this.unsetElementToDisabled(this.next),this.setElementToDisabled(this.prev)):r?(this.unsetElementToDisabled(this.prev),this.setElementToDisabled(this.next)):(this.unsetElementToDisabled(this.prev),this.unsetElementToDisabled(this.next))},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,i=t.end;ie&&this.goToPrev()},e.prototype.recalculateWidth=function(){this.sliderWidth=this.inner.parentElement.getBoundingClientRect().width,this.calculateWidth(),this.sliderWidth!==this.inner.parentElement.getBoundingClientRect().width&&this.recalculateWidth()},e.prototype.calculateTransform=function(t){void 0!==t&&(this.currentIndex=t),this.currentIndex>this.slides.length-this.getCurrentSlidesQty()&&!this.isCentered&&(this.currentIndex=this.slides.length-this.getCurrentSlidesQty());var e=this.sliderWidth,i=e/this.getCurrentSlidesQty(),s=this.currentIndex*i;if(this.isSnap&&!this.isCentered&&this.container.scrollLefte&&(this.container.scrollLeft=this.container.scrollWidth),this.isCentered&&!this.isSnap){var n=(e-i)/2;if(0===this.currentIndex)s=-n;else if(this.currentIndex>=this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1)){s=this.slides.length*i-e+n}else s=this.currentIndex*i-n}this.isSnap||(this.inner.style.transform=this.isRTL?"translate(".concat(s,"px, 0px)"):"translate(".concat(-s,"px, 0px)")),this.isAutoHeight&&(this.inner.style.height="".concat(this.slides[this.currentIndex].clientHeight,"px")),this.dotsItems&&this.goToCurrentDot(),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass(),this.isSnap&&this.hasSnapSpacers&&this.buildSnapSpacers(),this.infoCurrent&&this.setInfoCurrent()},e.prototype.setTranslate=function(t){this.inner.style.transform=this.isRTL?"translate(".concat(-t,"px, 0px)"):"translate(".concat(t,"px, 0px)")},e.prototype.goToPrev=function(){if(this.currentIndex>0?this.currentIndex--:this.currentIndex=this.slides.length-this.getCurrentSlidesQty(),this.isSnap){var t=this.sliderWidth/this.getCurrentSlidesQty();this.container.scrollBy({left:Math.max(-this.container.scrollLeft,-t),behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()},e.prototype.goToNext=function(){var t=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty();if(this.currentIndexthis.currentIndex?e-this.currentIndex:this.currentIndex-e,n=e>this.currentIndex?-i*s:i*s;this.container.scrollBy({left:n,behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()},e.prototype.setIndex=function(t){this.currentIndex=t,this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()},e.getInstance=function(t,e){var i=window.$hsCarouselCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return i?e?i:i.element:null},e.autoInit=function(){window.$hsCarouselCollection||(window.$hsCarouselCollection=[]),document.querySelectorAll("[data-hs-carousel]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsCarouselCollection.find((function(e){var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new e(t)}))},e}(l.default);window.addEventListener("load",(function(){h.autoInit()})),"undefined"!=typeof window&&(window.HSCarousel=h),e.default=h},292:function(t,e){ /* - * HSCarousel - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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 s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},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 s(){this.constructor=t}i(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,i=arguments.length;s *")||null,l.sliderWidth=l.inner.parentElement.clientWidth,l.touchX={start:0,end:0},l.init(),l}return n(e,t),e.prototype.init=function(){var t,e,s=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(){s.goToPrev(),s.isAutoPlay&&(s.resetTimer(),s.setTimer())})),this.next&&this.next.addEventListener("click",(function(){s.goToNext(),s.isAutoPlay&&(s.resetTimer(),s.setTimer())})),this.dots&&this.dots.forEach((function(t,e){return t.addEventListener("click",(function(){s.goTo(e),s.isAutoPlay&&(s.resetTimer(),s.setTimer())}))})),this.slides.length&&(this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass(),this.isAutoPlay&&this.autoPlay()),this.inner&&this.afterLoadingClassesAdd&&setTimeout((function(){var t;"string"==typeof s.afterLoadingClassesAdd?s.inner.classList.add(s.afterLoadingClassesAdd):(t=s.inner.classList).add.apply(t,s.afterLoadingClassesAdd)})),this.el.classList.add("init"),this.el.addEventListener("touchstart",(function(t){s.touchX.start=t.changedTouches[0].screenX})),this.el.addEventListener("touchend",(function(t){s.touchX.end=t.changedTouches[0].screenX,s.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=this.calculateTransform(),this.slides.forEach((function(e){e.style.width="".concat(t.sliderWidth,"px")}))},e.prototype.addCurrentClass=function(){var t=this;this.slides.forEach((function(e,s){s===t.currentIndex?e.classList.add("active"):e.classList.remove("active")})),this.dots&&this.dots.forEach((function(e,s){s===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,s=t.end;se&&this.goToPrev()},e.prototype.recalculateWidth=function(){this.sliderWidth=this.inner.parentElement.clientWidth,this.calculateWidth()},e.prototype.calculateTransform=function(){var t=this.currentIndex*this.sliderWidth;return this.isRTL?"translate(".concat(t,"px, 0px)"):"translate(-".concat(t,"px, 0px)")},e.prototype.goToPrev=function(){0===this.currentIndex&&this.isInfiniteLoop?(this.currentIndex=this.slides.length-1,this.inner.style.transform=this.calculateTransform(),this.addCurrentClass()):0!==this.currentIndex&&(this.currentIndex-=1,this.inner.style.transform=this.calculateTransform(),this.addCurrentClass(),this.addDisabledClass())},e.prototype.goToNext=function(){this.currentIndex===this.slides.length-1&&this.isInfiniteLoop?(this.currentIndex=0,this.inner.style.transform=this.calculateTransform(),this.addCurrentClass()):this.currentIndexe&&(e=i)})),e};e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,i){return void 0===i&&(i=""),(window.getComputedStyle(t).getPropertyValue(e)||i).replace(" ","")};e.getClassPropertyAlt=function(t,e,i){void 0===i&&(i="");var s="";return t.classList.forEach((function(t){t.includes(e)&&(s=t)})),s.match(/:(.*)]/)?s.match(/:(.*)]/)[1]:i};var s=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=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.isDirectChild=function(t,e){for(var i=t.children,s=0;s=h:"top"===i?l>=h:l>=h||d>=h};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 s;return void 0===e&&(e=200),function(){for(var n=[],r=0;r0?t.addEventListener("transitionend",i,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,i,s){void 0===i&&(i=" "),void 0===s&&(s="add"),t.split(i).forEach((function(t){return"add"===s?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var i=function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s].call(r.exports,r,r.exports,i),r.exports}(268);return i})())); \ No newline at end of file diff --git a/dist/carousel.mjs b/dist/carousel.mjs new file mode 100644 index 0000000..facdaed --- /dev/null +++ b/dist/carousel.mjs @@ -0,0 +1,9 @@ +var t={189:(t,s,e)=>{e.d(s,{LO:()=>i});const i={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},615:(t,s,e)=>{e.d(s,{A:()=>i});class i{constructor(t,s,e){this.el=t,this.options=s,this.events=e,this.el=t,this.options=s,this.events={}}createCollection(t,s){var e;t.push({id:(null===(e=null==s?void 0:s.el)||void 0===e?void 0:e.id)||t.length+1,element:s})}fireEvent(t,s=null){if(this.events.hasOwnProperty(t))return this.events[t](s)}on(t,s){this.events[t]=s}}},926:(t,s,e)=>{e.d(s,{en:()=>r,fc:()=>n,sg:()=>i});const i=(t,s=200)=>{let e;return(...i)=>{clearTimeout(e),e=setTimeout((()=>{t.apply(void 0,i)}),s)}},n=t=>{const s=document.createElement("template");return t=t.trim(),s.innerHTML=t,s.content.firstChild},r=(t,s,e=" ",i="add")=>{t.split(e).forEach((t=>"add"===i?s.classList.add(t):s.classList.remove(t)))}}},s={};function e(i){var n=s[i];if(void 0!==n)return n.exports;var r=s[i]={exports:{}};return t[i](r,r.exports,e),r.exports}e.d=(t,s)=>{for(var i in s)e.o(s,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:s[i]})},e.o=(t,s)=>Object.prototype.hasOwnProperty.call(t,s);var i={};e.d(i,{A:()=>a});var n=e(926),r=e(615),l=e(189); +/* + * HSCarousel + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class h extends r.A{constructor(t,s){var e,i,n,r,l;super(t,s);const h=t.getAttribute("data-hs-carousel"),a=h?JSON.parse(h):{},o=Object.assign(Object.assign({},a),s);this.currentIndex=o.currentIndex||0,this.loadingClasses=o.loadingClasses?`${o.loadingClasses}`.split(","):null,this.dotsItemClasses=o.dotsItemClasses?o.dotsItemClasses:null,this.isAutoHeight=void 0!==o.isAutoHeight&&o.isAutoHeight,this.isAutoPlay=void 0!==o.isAutoPlay&&o.isAutoPlay,this.isCentered=void 0!==o.isCentered&&o.isCentered,this.isDraggable=void 0!==o.isDraggable&&o.isDraggable,this.isInfiniteLoop=void 0!==o.isInfiniteLoop&&o.isInfiniteLoop,this.isRTL=void 0!==o.isRTL&&o.isRTL,this.isSnap=void 0!==o.isSnap&&o.isSnap,this.hasSnapSpacers=void 0===o.hasSnapSpacers||o.hasSnapSpacers,this.speed=o.speed||4e3,this.updateDelay=o.updateDelay||0,this.slidesQty=o.slidesQty||1,this.loadingClassesRemove=(null===(e=this.loadingClasses)||void 0===e?void 0:e[0])?this.loadingClasses[0].split(" "):"opacity-0",this.loadingClassesAdd=(null===(i=this.loadingClasses)||void 0===i?void 0:i[1])?this.loadingClasses[1].split(" "):"",this.afterLoadingClassesAdd=(null===(n=this.loadingClasses)||void 0===n?void 0:n[2])?this.loadingClasses[2].split(" "):"",this.container=this.el.querySelector(".hs-carousel")||null,this.inner=this.el.querySelector(".hs-carousel-body")||null,this.slides=this.el.querySelectorAll(".hs-carousel-slide")||[],this.prev=this.el.querySelector(".hs-carousel-prev")||null,this.next=this.el.querySelector(".hs-carousel-next")||null,this.dots=this.el.querySelector(".hs-carousel-pagination")||null,this.info=this.el.querySelector(".hs-carousel-info")||null,this.infoTotal=(null===(r=null==this?void 0:this.info)||void 0===r?void 0:r.querySelector(".hs-carousel-info-total"))||null,this.infoCurrent=(null===(l=null==this?void 0:this.info)||void 0===l?void 0:l.querySelector(".hs-carousel-info-current"))||null,this.sliderWidth=this.el.getBoundingClientRect().width,this.isDragging=!1,this.dragStartX=null,this.initialTranslateX=null,this.touchX={start:0,end:0},this.resizeContainer=document.querySelector("body"),this.resizeContainerWidth=0,this.init()}setIsSnap(){const t=this.container.getBoundingClientRect(),s=t.left+t.width/2;let e=null,i=null,n=1/0;Array.from(this.inner.children).forEach((t=>{const i=t.getBoundingClientRect(),r=this.inner.getBoundingClientRect(),l=i.left+i.width/2-r.left,h=Math.abs(s-(r.left+l));ht===e))),this.setIndex(i),this.dots&&this.setCurrentDot()}init(){this.createCollection(window.$hsCarouselCollection,this),this.inner&&(this.calculateWidth(),this.isDraggable&&!this.isSnap&&this.initDragHandling()),this.prev&&this.prev.addEventListener("click",(()=>{this.goToPrev(),this.isAutoPlay&&(this.resetTimer(),this.setTimer())})),this.next&&this.next.addEventListener("click",(()=>{this.goToNext(),this.isAutoPlay&&(this.resetTimer(),this.setTimer())})),this.dots&&this.initDots(),this.info&&this.buildInfo(),this.slides.length&&(this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass(),this.isAutoPlay&&this.autoPlay()),setTimeout((()=>{this.isSnap&&this.setIsSnap(),this.loadingClassesRemove&&("string"==typeof this.loadingClassesRemove?this.inner.classList.remove(this.loadingClassesRemove):this.inner.classList.remove(...this.loadingClassesRemove)),this.loadingClassesAdd&&("string"==typeof this.loadingClassesAdd?this.inner.classList.add(this.loadingClassesAdd):this.inner.classList.add(...this.loadingClassesAdd)),this.inner&&this.afterLoadingClassesAdd&&setTimeout((()=>{"string"==typeof this.afterLoadingClassesAdd?this.inner.classList.add(this.afterLoadingClassesAdd):this.inner.classList.add(...this.afterLoadingClassesAdd)}))}),400),this.isSnap&&this.container.addEventListener("scroll",(()=>{clearTimeout(this.isScrolling),this.isScrolling=setTimeout((()=>{this.setIsSnap()}),100)})),this.el.classList.add("init"),this.isSnap||(this.el.addEventListener("touchstart",(t=>{this.touchX.start=t.changedTouches[0].screenX})),this.el.addEventListener("touchend",(t=>{this.touchX.end=t.changedTouches[0].screenX,this.detectDirection()}))),this.observeResize()}initDragHandling(){const t=this.inner;t&&(t.addEventListener("mousedown",this.handleDragStart.bind(this)),t.addEventListener("touchstart",this.handleDragStart.bind(this),{passive:!0}),document.addEventListener("mousemove",this.handleDragMove.bind(this)),document.addEventListener("touchmove",this.handleDragMove.bind(this),{passive:!1}),document.addEventListener("mouseup",this.handleDragEnd.bind(this)),document.addEventListener("touchend",this.handleDragEnd.bind(this)))}getTranslateXValue(){var t;const s=window.getComputedStyle(this.inner).transform;if("none"!==s){const e=null===(t=s.match(/matrix.*\((.+)\)/))||void 0===t?void 0:t[1].split(", ");if(e){let t=parseFloat(6===e.length?e[4]:e[12]);return this.isRTL&&(t=-t),isNaN(t)||0===t?0:-t}}return 0}removeClickEventWhileDragging(t){t.preventDefault()}handleDragStart(t){t.preventDefault(),this.isDragging=!0,this.dragStartX=this.getEventX(t),this.initialTranslateX=this.isRTL?this.getTranslateXValue():-this.getTranslateXValue(),this.inner.classList.add("dragging")}handleDragMove(t){if(!this.isDragging)return;this.inner.querySelectorAll("a:not(.prevented-click)").forEach((t=>{t.classList.add("prevented-click"),t.addEventListener("click",this.removeClickEventWhileDragging)}));let s=this.getEventX(t)-this.dragStartX;this.isRTL&&(s=-s);const e=this.initialTranslateX+s;this.setTranslate((()=>{let t=this.sliderWidth*this.slides.length/this.getCurrentSlidesQty()-this.sliderWidth;const s=this.sliderWidth,i=(s-s/this.getCurrentSlidesQty())/2,n=this.isCentered?i:0;this.isCentered&&(t+=i);const r=-t;return this.isRTL?et?r:-e:e>n?n:e<-t?r:e})())}handleDragEnd(){if(!this.isDragging)return;this.isDragging=!1;const t=this.sliderWidth/this.getCurrentSlidesQty(),s=this.getTranslateXValue();let e=Math.round(s/t);this.isRTL&&(e=Math.round(s/t)),this.inner.classList.remove("dragging"),setTimeout((()=>{this.calculateTransform(e),this.dots&&this.setCurrentDot(),this.dragStartX=null,this.initialTranslateX=null,this.inner.querySelectorAll("a.prevented-click").forEach((t=>{t.classList.remove("prevented-click"),t.removeEventListener("click",this.removeClickEventWhileDragging)}))}))}getEventX(t){return t instanceof MouseEvent?t.clientX:t.touches[0].clientX}getCurrentSlidesQty(){if("object"==typeof this.slidesQty){const t=document.body.clientWidth;let s=0;return Object.keys(this.slidesQty).forEach((e=>{t>=(typeof e+1=="number"?this.slidesQty[e]:l.LO[e])&&(s=this.slidesQty[e])})),s}return this.slidesQty}buildSnapSpacers(){const t=this.inner.querySelector(".hs-snap-before"),s=this.inner.querySelector(".hs-snap-after");t&&t.remove(),s&&s.remove();const e=this.sliderWidth,i=e/2-e/this.getCurrentSlidesQty()/2,r=(0,n.fc)(`
`),l=(0,n.fc)(`
`);this.inner.prepend(r),this.inner.appendChild(l)}initDots(){this.el.querySelectorAll(".hs-carousel-pagination-item").length?this.setDots():this.buildDots(),this.dots&&this.setCurrentDot()}buildDots(){this.dots.innerHTML="";const t=!this.isCentered&&this.slidesQty?this.slides.length-(this.getCurrentSlidesQty()-1):this.slides.length;for(let s=0;s{const e=t.getAttribute("data-carousel-pagination-item-target");this.singleDotEvents(t,e?+e:s)}))}goToCurrentDot(){const t=this.dots,s=t.getBoundingClientRect(),e=t.scrollLeft,i=t.scrollTop,n=t.clientWidth,r=t.clientHeight,l=this.dotsItems[this.currentIndex],h=l.getBoundingClientRect(),a=h.left-s.left+e,o=a+l.clientWidth,d=h.top-s.top+i,c=d+l.clientHeight;let u=e,g=i;(ae+n)&&(u=o-n),(di+r)&&(g=c-r),t.scrollTo({left:u,top:g,behavior:"smooth"})}buildInfo(){this.infoTotal&&this.setInfoTotal(),this.infoCurrent&&this.setInfoCurrent()}setInfoTotal(){this.infoTotal.innerText=`${this.slides.length}`}setInfoCurrent(){this.infoCurrent.innerText=`${this.currentIndex+1}`}buildSingleDot(t){const s=(0,n.fc)("");return this.dotsItemClasses&&(0,n.en)(this.dotsItemClasses,s),this.singleDotEvents(s,t),s}singleDotEvents(t,s){t.addEventListener("click",(()=>{this.goTo(s),this.isAutoPlay&&(this.resetTimer(),this.setTimer())}))}observeResize(){new ResizeObserver((0,n.sg)((t=>{for(let s of t){const t=s.contentRect.width;t!==this.resizeContainerWidth&&(this.recalculateWidth(),this.dots&&this.initDots(),this.addCurrentClass(),this.resizeContainerWidth=t)}}),this.updateDelay)).observe(this.resizeContainer)}calculateWidth(){this.isSnap||(this.inner.style.width=this.sliderWidth*this.slides.length/this.getCurrentSlidesQty()+"px"),this.slides.forEach((t=>{t.style.width=this.sliderWidth/this.getCurrentSlidesQty()+"px"})),this.calculateTransform()}addCurrentClass(){if(this.isSnap){const t=Math.floor(this.getCurrentSlidesQty()/2);for(let s=0;s=this.currentIndex-t?e.classList.add("active"):e.classList.remove("active")}}else{const t=this.isCentered?this.currentIndex+this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.currentIndex+this.getCurrentSlidesQty();this.slides.forEach(((s,e)=>{e>=this.currentIndex&&e{let e=!1;const i=Math.floor(this.getCurrentSlidesQty()/2);e=this.isSnap&&!this.hasSnapSpacers?s===(this.getCurrentSlidesQty()%2==0?this.currentIndex-i+1:this.currentIndex-i):s===this.currentIndex,e?t.classList.add("active"):t.classList.remove("active")};this.dotsItems?this.dotsItems.forEach(((s,e)=>t(s,e))):this.dots.querySelectorAll(":scope > *").forEach(((s,e)=>t(s,e)))}setElementToDisabled(t){t.classList.add("disabled"),"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled")}unsetElementToDisabled(t){t.classList.remove("disabled"),"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled")}addDisabledClass(){if(!this.prev||!this.next)return!1;const t=getComputedStyle(this.inner).getPropertyValue("gap"),s=Math.floor(this.getCurrentSlidesQty()/2);let e=0,i=0,n=!1,r=!1;this.isSnap?(e=this.currentIndex,i=this.hasSnapSpacers?this.slides.length-1:this.slides.length-s-1,n=this.hasSnapSpacers?0===e:this.getCurrentSlidesQty()%2==0?e-s<0:e-s==0,r=e>=i&&this.container.scrollLeft+this.container.clientWidth+(parseFloat(t)||0)>=this.container.scrollWidth):(e=this.currentIndex,i=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty(),n=0===e,r=e>=i),n?(this.unsetElementToDisabled(this.next),this.setElementToDisabled(this.prev)):r?(this.unsetElementToDisabled(this.prev),this.setElementToDisabled(this.next)):(this.unsetElementToDisabled(this.prev),this.unsetElementToDisabled(this.next))}autoPlay(){this.setTimer()}setTimer(){this.timer=setInterval((()=>{this.currentIndex===this.slides.length-1?this.goTo(0):this.goToNext()}),this.speed)}resetTimer(){clearInterval(this.timer)}detectDirection(){const{start:t,end:s}=this.touchX;st&&this.goToPrev()}recalculateWidth(){this.sliderWidth=this.inner.parentElement.getBoundingClientRect().width,this.calculateWidth(),this.sliderWidth!==this.inner.parentElement.getBoundingClientRect().width&&this.recalculateWidth()}calculateTransform(t){void 0!==t&&(this.currentIndex=t),this.currentIndex>this.slides.length-this.getCurrentSlidesQty()&&!this.isCentered&&(this.currentIndex=this.slides.length-this.getCurrentSlidesQty());const s=this.sliderWidth,e=s/this.getCurrentSlidesQty();let i=this.currentIndex*e;if(this.isSnap&&!this.isCentered&&this.container.scrollLefts&&(this.container.scrollLeft=this.container.scrollWidth),this.isCentered&&!this.isSnap){const t=(s-e)/2;if(0===this.currentIndex)i=-t;else if(this.currentIndex>=this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1)){i=this.slides.length*e-s+t}else i=this.currentIndex*e-t}this.isSnap||(this.inner.style.transform=this.isRTL?`translate(${i}px, 0px)`:`translate(${-i}px, 0px)`),this.isAutoHeight&&(this.inner.style.height=`${this.slides[this.currentIndex].clientHeight}px`),this.dotsItems&&this.goToCurrentDot(),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass(),this.isSnap&&this.hasSnapSpacers&&this.buildSnapSpacers(),this.infoCurrent&&this.setInfoCurrent()}setTranslate(t){this.inner.style.transform=this.isRTL?`translate(${-t}px, 0px)`:`translate(${t}px, 0px)`}goToPrev(){if(this.currentIndex>0?this.currentIndex--:this.currentIndex=this.slides.length-this.getCurrentSlidesQty(),this.isSnap){const t=this.sliderWidth/this.getCurrentSlidesQty();this.container.scrollBy({left:Math.max(-this.container.scrollLeft,-t),behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()}goToNext(){const t=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty();if(this.currentIndexthis.currentIndex?s-this.currentIndex:this.currentIndex-s,i=s>this.currentIndex?-t*e:t*e;this.container.scrollBy({left:i,behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()}setIndex(t){this.currentIndex=t,this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}static getInstance(t,s){const e=window.$hsCarouselCollection.find((s=>s.element.el===("string"==typeof t?document.querySelector(t):t)));return e?s?e:e.element:null}static autoInit(){window.$hsCarouselCollection||(window.$hsCarouselCollection=[]),document.querySelectorAll("[data-hs-carousel]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsCarouselCollection.find((s=>{var e;return(null===(e=null==s?void 0:s.element)||void 0===e?void 0:e.el)===t}))||new h(t)}))}}window.addEventListener("load",(()=>{h.autoInit()})),"undefined"!=typeof window&&(window.HSCarousel=h);const a=h;var o=i.A;export{o as default}; \ No newline at end of file diff --git a/dist/collapse.js b/dist/collapse.js index 86034ee..2bf987a 100644 --- a/dist/collapse.js +++ b/dist/collapse.js @@ -1,17 +1,16 @@ -!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={961:(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={961:(t,e)=>{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},485:function(t,e,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSCollapse + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},485: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)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(292),l=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,e=this;this.createCollection(window.$hsCollapseCollection,this),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.el.ariaExpanded="true":this.el.ariaExpanded="false"),this.el.addEventListener("click",(function(){e.content.classList.contains("open")?e.hide():e.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,e=this;if(this.animationInProcess||this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.add("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="true"),this.content.classList.add("open"),this.content.classList.remove("hidden"),this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px"),e.fireEvent("beforeOpen",e.el),(0,r.dispatch)("beforeOpen.hs.collapse",e.el,e.el)})),(0,r.afterTransition)(this.content,(function(){e.content.style.height="",e.fireEvent("open",e.el),(0,r.dispatch)("open.hs.collapse",e.el,e.el),e.animationInProcess=!1}))},e.prototype.hide=function(){var t,e=this;if(this.animationInProcess||!this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.remove("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),this.content.classList.remove("open"),(0,r.afterTransition)(this.content,(function(){e.content.classList.add("hidden"),e.content.style.height="",e.fireEvent("hide",e.el),(0,r.dispatch)("hide.hs.collapse",e.el,e.el),e.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}(s(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSCollapse=l),e.default=l},292:function(t,e){ /* - * HSCollapse - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(292),l=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,e=this;this.createCollection(window.$hsCollapseCollection,this),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.el.ariaExpanded="true":this.el.ariaExpanded="false"),this.el.addEventListener("click",(function(){e.content.classList.contains("open")?e.hide():e.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,e=this;if(this.animationInProcess||this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.add("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="true"),this.content.classList.add("open"),this.content.classList.remove("hidden"),this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px"),e.fireEvent("beforeOpen",e.el),(0,r.dispatch)("beforeOpen.hs.collapse",e.el,e.el)})),(0,r.afterTransition)(this.content,(function(){e.content.style.height="",e.fireEvent("open",e.el),(0,r.dispatch)("open.hs.collapse",e.el,e.el),e.animationInProcess=!1}))},e.prototype.hide=function(){var t,e=this;if(this.animationInProcess||!this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.remove("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),this.content.classList.remove("open"),(0,r.afterTransition)(this.content,(function(){e.content.classList.add("hidden"),e.content.style.height="",e.fireEvent("hide",e.el),(0,r.dispatch)("hide.hs.collapse",e.el,e.el),e.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}(s(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSCollapse=l),e.default=l},292: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.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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,a=r?s.top-r.top:s.top,c=(i?r.bottom:l)-s.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 i=function(t){return!!t&&("none"===window.getComputedStyle(t).display||i(t.parentElement))};e.isParentOrElementHidden=i;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],s=0;s0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(485);return n})())); \ No newline at end of file +var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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.isDirectChild=function(t,e){for(var n=t.children,o=0;o=u:"top"===n?a>=u:a>=u||c>=u};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 o;return void 0===e&&(e=200),function(){for(var i=[],s=0;s0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(485);return n})())); \ No newline at end of file diff --git a/dist/collapse.mjs b/dist/collapse.mjs new file mode 100644 index 0000000..badfa7a --- /dev/null +++ b/dist/collapse.mjs @@ -0,0 +1,9 @@ +var e={615:(e,t,n)=>{n.d(t,{A:()=>s});class s{constructor(e,t,n){this.el=e,this.options=t,this.events=n,this.el=e,this.options=t,this.events={}}createCollection(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})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},926:(e,t,n)=>{n.d(t,{JD:()=>s,yd:()=>i});const s=(e,t,n=null)=>{const s=new CustomEvent(e,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(s)},i=(e,t)=>{const n=()=>{t(),e.removeEventListener("transitionend",n,!0)},s=window.getComputedStyle(e),i=s.getPropertyValue("transition-duration");"none"!==s.getPropertyValue("transition-property")&&parseFloat(i)>0?e.addEventListener("transitionend",n,!0):t()}}},t={};function n(s){var i=t[s];if(void 0!==i)return i.exports;var o=t[s]={exports:{}};return e[s](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var s={};n.d(s,{A:()=>a});var i=n(926),o=n(615); +/* + * HSCollapse + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class l extends o.A{constructor(e,t,n){super(e,t,n),this.contentId=this.el.dataset.hsCollapse,this.content=document.querySelector(this.contentId),this.animationInProcess=!1,this.content&&this.init()}init(){var e;this.createCollection(window.$hsCollapseCollection,this),(null===(e=null==this?void 0:this.el)||void 0===e?void 0:e.ariaExpanded)&&(this.el.classList.contains("open")?this.el.ariaExpanded="true":this.el.ariaExpanded="false"),this.el.addEventListener("click",(()=>{this.content.classList.contains("open")?this.hide():this.show()}))}hideAllMegaMenuItems(){this.content.querySelectorAll(".hs-mega-menu-content.block").forEach((e=>{e.classList.remove("block"),e.classList.add("hidden")}))}show(){var e;if(this.animationInProcess||this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.add("open"),(null===(e=null==this?void 0:this.el)||void 0===e?void 0:e.ariaExpanded)&&(this.el.ariaExpanded="true"),this.content.classList.add("open"),this.content.classList.remove("hidden"),this.content.style.height="0",setTimeout((()=>{this.content.style.height=`${this.content.scrollHeight}px`,this.fireEvent("beforeOpen",this.el),(0,i.JD)("beforeOpen.hs.collapse",this.el,this.el)})),(0,i.yd)(this.content,(()=>{this.content.style.height="",this.fireEvent("open",this.el),(0,i.JD)("open.hs.collapse",this.el,this.el),this.animationInProcess=!1}))}hide(){var e;if(this.animationInProcess||!this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.remove("open"),(null===(e=null==this?void 0:this.el)||void 0===e?void 0:e.ariaExpanded)&&(this.el.ariaExpanded="false"),this.content.style.height=`${this.content.scrollHeight}px`,setTimeout((()=>{this.content.style.height="0"})),this.content.classList.remove("open"),(0,i.yd)(this.content,(()=>{this.content.classList.add("hidden"),this.content.style.height="",this.fireEvent("hide",this.el),(0,i.JD)("hide.hs.collapse",this.el,this.el),this.animationInProcess=!1})),this.content.querySelectorAll(".hs-mega-menu-content.block").length&&this.hideAllMegaMenuItems()}static getInstance(e,t=!1){const n=window.$hsCollapseCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return n?t?n:n.element.el:null}static autoInit(){window.$hsCollapseCollection||(window.$hsCollapseCollection=[]),document.querySelectorAll(".hs-collapse-toggle:not(.--prevent-on-load-init)").forEach((e=>{window.$hsCollapseCollection.find((t=>{var n;return(null===(n=null==t?void 0:t.element)||void 0===n?void 0:n.el)===e}))||new l(e)}))}static show(e){const t=window.$hsCollapseCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));t&&t.element.content.classList.contains("hidden")&&t.element.show()}static hide(e){const t=window.$hsCollapseCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));t&&!t.element.content.classList.contains("hidden")&&t.element.hide()}static on(e,t,n){const s=window.$hsCollapseCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));s&&(s.element.events[e]=n)}}window.addEventListener("load",(()=>{l.autoInit()})),"undefined"!=typeof window&&(window.HSCollapse=l);const a=l;var h=s.A;export{h as default}; \ No newline at end of file diff --git a/dist/combobox.js b/dist/combobox.js index 493d059..481c738 100644 --- a/dist/combobox.js +++ b/dist/combobox.js @@ -1,17 +1,16 @@ -!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={223:(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}},961:(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 o=e();for(var i in o)("object"==typeof exports?exports:t)[i]=o[i]}}(self,(()=>(()=>{"use strict";var t={223:(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={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},961:(t,e)=>{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},809:function(t,e,o){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSComboBox + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},809:function(t,e,o){ +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\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t',P.outputEmptyTemplate=null!==(m=null==k?void 0:k.outputEmptyTemplate)&&void 0!==m?m:'
Nothing found...
',P.outputLoaderTemplate=null!==(f=null==k?void 0:k.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
',P.groupingType=null!==(b=null==k?void 0:k.groupingType)&&void 0!==b?b:null,P.groupingTitleTemplate=null!==(v=null==k?void 0:k.groupingTitleTemplate)&&void 0!==v?v:"default"===P.groupingType?'
':'',P.tabsWrapperTemplate=null!==(g=null==k?void 0:k.tabsWrapperTemplate)&&void 0!==g?g:'
',P.preventSelection=null!==(y=null==k?void 0:k.preventSelection)&&void 0!==y&&y,P.preventAutoPosition=null!==(x=null==k?void 0:k.preventAutoPosition)&&void 0!==x&&x,P.isOpenOnFocus=null!==(E=null==k?void 0:k.isOpenOnFocus)&&void 0!==E&&E,P.input=null!==(T=P.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==T?T:null,P.output=null!==(S=P.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==S?S:null,P.itemsWrapper=null!==(w=P.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==w?w:null,P.items=null!==(A=Array.from(P.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==A?A:[],P.tabs=[],P.toggle=null!==(I=P.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==I?I:null,P.toggleClose=null!==(C=P.el.querySelector("[data-hs-combo-box-close]"))&&void 0!==C?C:null,P.toggleOpen=null!==(L=P.el.querySelector("[data-hs-combo-box-open]"))&&void 0!==L?L:null,P.outputPlaceholder=null,P.selected=P.value=null!==(O=P.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==O?O:"",P.isOpened=!1,P.isCurrent=!1,P.animationInProcess=!1,P.selectedGroup="all",P.init(),P}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.preventAutoPosition||this.recalculateDirection()),this.toggle&&this.buildToggle(),this.toggleClose&&this.buildToggleClose(),this.toggleOpen&&this.buildToggleOpen()},e.prototype.setResultAndRender=function(t){void 0===t&&(t="");var e=this.preventVisibility?this.input.value:t;this.setResults(e),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,p.debounce)((function(e){t.setResultAndRender(e.target.value),""!==t.input.value?t.el.classList.add("has-value"):t.el.classList.remove("has-value"),t.isOpened||t.open()})))},e.prototype.buildItems=function(){this.output.role="listbox",this.output.tabIndex=-1,this.output.ariaOrientation="vertical",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){var o,i,n,r=null!==(o=e.getAttribute("data-hs-combo-box-output-item-group-field"))&&void 0!==o?o:null,s=null!==(i=JSON.parse(e.getAttribute("data-hs-combo-box-output-item")))&&void 0!==i?i:null,l=null;return r&&(null===(n=null==s?void 0:s.group)||void 0===n?void 0:n.name)&&(l=t[r]),Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(e){var o;return(null===(o=null==s?void 0:s.group)||void 0===o?void 0:o.name)&&l?l===s.group.name&&e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]: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,p.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,p.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){var i=(0,p.htmlToElement)(e.outputItemTemplate);i.querySelectorAll("[data-hs-combo-box-output-item-field]").forEach((function(e){var o=t[e.getAttribute("data-hs-combo-box-output-item-field")],i=e.hasAttribute("data-hs-combo-box-output-item-hide-if-empty");e.textContent=null!=o?o:"",!o&&i&&(e.style.display="none")})),i.querySelectorAll("[data-hs-combo-box-search-text]").forEach((function(e){var o;e.setAttribute("data-hs-combo-box-search-text",null!==(o=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==o?o:"")})),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,p.htmlToElement)(this.tabsWrapperTemplate),o=(0,p.htmlToElement)('
');e.append(o),this.output.insertBefore(e,this.output.firstChild);var i=(0,p.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,p.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,p.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,e,o,i,n=this;this.isOpened?((null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="true")):((null===(o=null==this?void 0:this.toggle)||void 0===o?void 0:o.ariaExpanded)&&(this.toggle.ariaExpanded="false"),(null===(i=null==this?void 0:this.input)||void 0===i?void 0:i.ariaExpanded)&&(this.input.ariaExpanded="false")),this.toggle.addEventListener("click",(function(){n.isOpened?n.close():n.open(n.toggle.getAttribute("data-hs-combo-box-toggle"))}))},e.prototype.buildToggleClose=function(){var t=this;this.toggleClose.addEventListener("click",(function(){return t.close()}))},e.prototype.buildToggleOpen=function(){var t=this;this.toggleOpen.addEventListener("click",(function(){return t.open()}))},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,this.fireEvent("select",this.el),(0,p.dispatch)("select.hs.combobox",this.el,this.value)},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,p.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.preventAutoPosition||this.recalculateDirection(),setTimeout((function(){var t,o;(null===(t=null==e?void 0:e.input)||void 0===t?void 0:t.ariaExpanded)&&(e.input.ariaExpanded="true"),(null===(o=null==e?void 0:e.toggle)||void 0===o?void 0:o.ariaExpanded)&&(e.toggle.ariaExpanded="true"),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,o,i=this;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),!1):(this.animationInProcess=!0,(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="false"),(null===(o=null==this?void 0:this.toggle)||void 0===o?void 0:o.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.el.classList.remove("active"),this.preventAutoPosition||(this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom=""),(0,p.afterTransition)(this.output,(function(){i.output.style.display="none",i.setValueAndClear(t),i.animationInProcess=!1})),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),void(this.isOpened=!1)))},e.prototype.recalculateDirection=function(){(0,p.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.preventVisibility?t.element.isCurrent: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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+10&&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\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t',P.outputEmptyTemplate=null!==(m=null==k?void 0:k.outputEmptyTemplate)&&void 0!==m?m:'
Nothing found...
',P.outputLoaderTemplate=null!==(f=null==k?void 0:k.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
',P.groupingType=null!==(b=null==k?void 0:k.groupingType)&&void 0!==b?b:null,P.groupingTitleTemplate=null!==(v=null==k?void 0:k.groupingTitleTemplate)&&void 0!==v?v:"default"===P.groupingType?'
':'',P.tabsWrapperTemplate=null!==(g=null==k?void 0:k.tabsWrapperTemplate)&&void 0!==g?g:'
',P.preventSelection=null!==(y=null==k?void 0:k.preventSelection)&&void 0!==y&&y,P.preventAutoPosition=null!==(x=null==k?void 0:k.preventAutoPosition)&&void 0!==x&&x,P.isOpenOnFocus=null!==(E=null==k?void 0:k.isOpenOnFocus)&&void 0!==E&&E,P.input=null!==(T=P.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==T?T:null,P.output=null!==(S=P.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==S?S:null,P.itemsWrapper=null!==(w=P.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==w?w:null,P.items=null!==(A=Array.from(P.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==A?A:[],P.tabs=[],P.toggle=null!==(I=P.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==I?I:null,P.toggleClose=null!==(L=P.el.querySelector("[data-hs-combo-box-close]"))&&void 0!==L?L:null,P.toggleOpen=null!==(C=P.el.querySelector("[data-hs-combo-box-open]"))&&void 0!==C?C:null,P.outputPlaceholder=null,P.selected=P.value=null!==(O=P.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==O?O:"",P.isOpened=!1,P.isCurrent=!1,P.animationInProcess=!1,P.selectedGroup="all",P.init(),P}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.preventAutoPosition||this.recalculateDirection()),this.toggle&&this.buildToggle(),this.toggleClose&&this.buildToggleClose(),this.toggleOpen&&this.buildToggleOpen()},e.prototype.setResultAndRender=function(t){void 0===t&&(t="");var e=this.preventVisibility?this.input.value:t;this.setResults(e),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,p.debounce)((function(e){t.setResultAndRender(e.target.value),""!==t.input.value?t.el.classList.add("has-value"):t.el.classList.remove("has-value"),t.isOpened||t.open()})))},e.prototype.buildItems=function(){this.output.role="listbox",this.output.tabIndex=-1,this.output.ariaOrientation="vertical",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){var o,i,n,r=null!==(o=e.getAttribute("data-hs-combo-box-output-item-group-field"))&&void 0!==o?o:null,s=null!==(i=JSON.parse(e.getAttribute("data-hs-combo-box-output-item")))&&void 0!==i?i:null,l=null;return r&&(null===(n=null==s?void 0:s.group)||void 0===n?void 0:n.name)&&(l=t[r]),Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(e){var o;return(null===(o=null==s?void 0:s.group)||void 0===o?void 0:o.name)&&l?l===s.group.name&&e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]: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,p.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,p.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){var i=(0,p.htmlToElement)(e.outputItemTemplate);i.querySelectorAll("[data-hs-combo-box-output-item-field]").forEach((function(e){var o=t[e.getAttribute("data-hs-combo-box-output-item-field")],i=e.hasAttribute("data-hs-combo-box-output-item-hide-if-empty");e.textContent=null!=o?o:"",!o&&i&&(e.style.display="none")})),i.querySelectorAll("[data-hs-combo-box-search-text]").forEach((function(e){var o;e.setAttribute("data-hs-combo-box-search-text",null!==(o=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==o?o:"")})),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,p.htmlToElement)(this.tabsWrapperTemplate),o=(0,p.htmlToElement)('
');e.append(o),this.output.insertBefore(e,this.output.firstChild);var i=(0,p.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,p.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,p.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,e,o,i,n=this;this.isOpened?((null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="true")):((null===(o=null==this?void 0:this.toggle)||void 0===o?void 0:o.ariaExpanded)&&(this.toggle.ariaExpanded="false"),(null===(i=null==this?void 0:this.input)||void 0===i?void 0:i.ariaExpanded)&&(this.input.ariaExpanded="false")),this.toggle.addEventListener("click",(function(){n.isOpened?n.close():n.open(n.toggle.getAttribute("data-hs-combo-box-toggle"))}))},e.prototype.buildToggleClose=function(){var t=this;this.toggleClose.addEventListener("click",(function(){return t.close()}))},e.prototype.buildToggleOpen=function(){var t=this;this.toggleOpen.addEventListener("click",(function(){return t.open()}))},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,this.fireEvent("select",this.el),(0,p.dispatch)("select.hs.combobox",this.el,this.value)},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,p.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.preventAutoPosition||this.recalculateDirection(),setTimeout((function(){var t,o;(null===(t=null==e?void 0:e.input)||void 0===t?void 0:t.ariaExpanded)&&(e.input.ariaExpanded="true"),(null===(o=null==e?void 0:e.toggle)||void 0===o?void 0:o.ariaExpanded)&&(e.toggle.ariaExpanded="true"),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,o,i=this;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),!1):(this.animationInProcess=!0,(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="false"),(null===(o=null==this?void 0:this.toggle)||void 0===o?void 0:o.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.el.classList.remove("active"),this.preventAutoPosition||(this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom=""),(0,p.afterTransition)(this.output,(function(){i.output.style.display="none",i.setValueAndClear(t),i.animationInProcess=!1})),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),void(this.isOpened=!1)))},e.prototype.recalculateDirection=function(){(0,p.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.preventVisibility?t.element.isCurrent: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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+1e&&(e=o)})),e};e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,o){return void 0===o&&(o=""),(window.getComputedStyle(t).getPropertyValue(e)||o).replace(" ","")};e.getClassPropertyAlt=function(t,e,o){void 0===o&&(o="");var i="";return t.classList.forEach((function(t){t.includes(e)&&(i=t)})),i.match(/:(.*)]/)?i.match(/:(.*)]/)[1]:o};var i=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=i;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,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,p=t.clientHeight+i;return"bottom"===o?u>=p:"top"===o?a>=p:a>=p||u>=p};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 i;return void 0===e&&(e=200),function(){for(var n=[],r=0;r0?t.addEventListener("transitionend",o,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,o,i){void 0===o&&(o=" "),void 0===i&&(i="add"),t.split(o).forEach((function(t){return"add"===i?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(809);return o})())); \ No newline at end of file +var o=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var o=i(t);"auto"!==o&&(o=parseInt(o,10))>e&&(e=o)})),e};e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,o){return void 0===o&&(o=""),(window.getComputedStyle(t).getPropertyValue(e)||o).replace(" ","")};e.getClassPropertyAlt=function(t,e,o){void 0===o&&(o="");var i="";return t.classList.forEach((function(t){t.includes(e)&&(i=t)})),i.match(/:(.*)]/)?i.match(/:(.*)]/)[1]:o};var i=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=i;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.isDirectChild=function(t,e){for(var o=t.children,i=0;i=p:"top"===o?a>=p:a>=p||u>=p};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 i;return void 0===e&&(e=200),function(){for(var n=[],r=0;r0?t.addEventListener("transitionend",o,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,o,i){void 0===o&&(o=" "),void 0===i&&(i="add"),t.split(o).forEach((function(t){return"add"===i?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(809);return o})())); \ No newline at end of file diff --git a/dist/combobox.mjs b/dist/combobox.mjs new file mode 100644 index 0000000..2faf4a8 --- /dev/null +++ b/dist/combobox.mjs @@ -0,0 +1 @@ +var t={189:(t,e,i)=>{i.d(e,{jU:()=>s});const s=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"]},615:(t,e,i)=>{i.d(e,{A:()=>s});class s{constructor(t,e,i){this.el=t,this.options=e,this.events=i,this.el=t,this.options=e,this.events={}}createCollection(t,e){var i;t.push({id:(null===(i=null==e?void 0:e.el)||void 0===i?void 0:i.id)||t.length+1,element:e})}fireEvent(t,e=null){if(this.events.hasOwnProperty(t))return this.events[t](e)}on(t,e){this.events[t]=e}}},926:(t,e,i)=>{i.d(e,{JD:()=>n,PR:()=>s,fc:()=>r,sH:()=>o,sg:()=>l,yd:()=>a});const s=(t,e,i="auto",s=10,o=null)=>{const l=e.getBoundingClientRect(),n=o?o.getBoundingClientRect():null,a=window.innerHeight,r=n?l.top-n.top:l.top,u=(o?n.bottom:a)-l.bottom,d=t.clientHeight+s;return"bottom"===i?u>=d:"top"===i?r>=d:r>=d||u>=d},o=t=>{if(!t)return!1;return"none"===window.getComputedStyle(t).display||o(t.parentElement)},l=(t,e=200)=>{let i;return(...s)=>{clearTimeout(i),i=setTimeout((()=>{t.apply(void 0,s)}),e)}},n=(t,e,i=null)=>{const s=new CustomEvent(t,{detail:{payload:i},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(s)},a=(t,e)=>{const i=()=>{e(),t.removeEventListener("transitionend",i,!0)},s=window.getComputedStyle(t),o=s.getPropertyValue("transition-duration");"none"!==s.getPropertyValue("transition-property")&&parseFloat(o)>0?t.addEventListener("transitionend",i,!0):e()},r=t=>{const e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild}}},e={};function i(s){var o=e[s];if(void 0!==o)return o.exports;var l=e[s]={exports:{}};return t[s](l,l.exports,i),l.exports}i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var s={};i.d(s,{A:()=>u});var o=i(926),l=i(615),n=i(189),a=function(t,e,i,s){return new(i||(i=Promise))((function(o,l){function n(t){try{r(s.next(t))}catch(t){l(t)}}function a(t){try{r(s.throw(t))}catch(t){l(t)}}function r(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,a)}r((s=s.apply(t,e||[])).next())}))};class r extends l.A{constructor(t,e,i){var s,o,l,n,a,r,u,d,h,p,c,m,b,v,g,y,x,f,w,A,L,E,T,C,S;super(t,e,i);const O=t.getAttribute("data-hs-combo-box"),I=O?JSON.parse(O):{},P=Object.assign(Object.assign({},I),e);this.gap=5,this.viewport=null!==(s="string"==typeof(null==P?void 0:P.viewport)?document.querySelector(null==P?void 0:P.viewport):null==P?void 0:P.viewport)&&void 0!==s?s:null,this.preventVisibility=null!==(o=null==P?void 0:P.preventVisibility)&&void 0!==o&&o,this.apiUrl=null!==(l=null==P?void 0:P.apiUrl)&&void 0!==l?l:null,this.apiDataPart=null!==(n=null==P?void 0:P.apiDataPart)&&void 0!==n?n:null,this.apiQuery=null!==(a=null==P?void 0:P.apiQuery)&&void 0!==a?a:null,this.apiSearchQuery=null!==(r=null==P?void 0:P.apiSearchQuery)&&void 0!==r?r:null,this.apiHeaders=null!==(u=null==P?void 0:P.apiHeaders)&&void 0!==u?u:{},this.apiGroupField=null!==(d=null==P?void 0:P.apiGroupField)&&void 0!==d?d:null,this.outputItemTemplate=null!==(h=null==P?void 0:P.outputItemTemplate)&&void 0!==h?h:'
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
',this.outputEmptyTemplate=null!==(p=null==P?void 0:P.outputEmptyTemplate)&&void 0!==p?p:'
Nothing found...
',this.outputLoaderTemplate=null!==(c=null==P?void 0:P.outputLoaderTemplate)&&void 0!==c?c:'
\n\t\t\t\t
\n\t\t\t\t\tLoading...\n\t\t\t\t
\n\t\t\t
',this.groupingType=null!==(m=null==P?void 0:P.groupingType)&&void 0!==m?m:null,this.groupingTitleTemplate=null!==(b=null==P?void 0:P.groupingTitleTemplate)&&void 0!==b?b:"default"===this.groupingType?'
':'',this.tabsWrapperTemplate=null!==(v=null==P?void 0:P.tabsWrapperTemplate)&&void 0!==v?v:'
',this.preventSelection=null!==(g=null==P?void 0:P.preventSelection)&&void 0!==g&&g,this.preventAutoPosition=null!==(y=null==P?void 0:P.preventAutoPosition)&&void 0!==y&&y,this.isOpenOnFocus=null!==(x=null==P?void 0:P.isOpenOnFocus)&&void 0!==x&&x,this.input=null!==(f=this.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==f?f:null,this.output=null!==(w=this.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==w?w:null,this.itemsWrapper=null!==(A=this.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==A?A:null,this.items=null!==(L=Array.from(this.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==L?L:[],this.tabs=[],this.toggle=null!==(E=this.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==E?E:null,this.toggleClose=null!==(T=this.el.querySelector("[data-hs-combo-box-close]"))&&void 0!==T?T:null,this.toggleOpen=null!==(C=this.el.querySelector("[data-hs-combo-box-open]"))&&void 0!==C?C:null,this.outputPlaceholder=null,this.selected=this.value=null!==(S=this.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==S?S:"",this.isOpened=!1,this.isCurrent=!1,this.animationInProcess=!1,this.selectedGroup="all",this.init()}init(){this.createCollection(window.$hsComboBoxCollection,this),this.build()}build(){this.buildInput(),this.groupingType&&this.setGroups(),this.buildItems(),this.preventVisibility&&(this.preventAutoPosition||this.recalculateDirection()),this.toggle&&this.buildToggle(),this.toggleClose&&this.buildToggleClose(),this.toggleOpen&&this.buildToggleOpen()}setResultAndRender(t=""){let e=this.preventVisibility?this.input.value:t;this.setResults(e),this.apiSearchQuery&&this.itemsFromJson()}buildInput(){this.isOpenOnFocus&&this.input.addEventListener("focus",(()=>{this.isOpened||(this.setResultAndRender(),this.open())})),this.input.addEventListener("input",(0,o.sg)((t=>{this.setResultAndRender(t.target.value),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),this.isOpened||this.open()})))}buildItems(){this.output.role="listbox",this.output.tabIndex=-1,this.output.ariaOrientation="vertical",this.apiUrl?this.itemsFromJson():(this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="",this.itemsFromHtml())}setResults(t){this.value=t,this.resultItems(),this.hasVisibleItems()?this.destroyOutputPlaceholder():this.buildOutputPlaceholder()}isItemExists(t){return this.items.some((e=>{var i,s,o;const l=null!==(i=e.getAttribute("data-hs-combo-box-output-item-group-field"))&&void 0!==i?i:null,n=null!==(s=JSON.parse(e.getAttribute("data-hs-combo-box-output-item")))&&void 0!==s?s:null;let a=null;return l&&(null===(o=null==n?void 0:n.group)||void 0===o?void 0:o.name)&&(a=t[l]),Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some((e=>{var i;return(null===(i=null==n?void 0:n.group)||void 0===i?void 0:i.name)&&a?a===n.group.name&&e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]:e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]}))}))}isTextExists(t,e){const i=e.map((t=>t.toLowerCase()));return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).some((t=>i.includes(t.getAttribute("data-hs-combo-box-search-text").toLowerCase())))}isTextExistsAny(t,e){return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).some((t=>t.getAttribute("data-hs-combo-box-search-text").toLowerCase().includes(e.toLowerCase())))}valuesBySelector(t){return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).reduce(((t,e)=>[...t,e.getAttribute("data-hs-combo-box-search-text")]),[])}buildOutputLoader(){if(this.outputLoader)return!1;this.outputLoader=(0,o.fc)(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)}destroyOutputLoader(){this.outputLoader&&this.outputLoader.remove(),this.outputLoader=null}itemsFromJson(){return a(this,void 0,void 0,(function*(){this.buildOutputLoader();try{const t=`${this.apiQuery}`,e=`${this.apiSearchQuery}=${this.value.toLowerCase()}`;let i=this.apiUrl;this.apiQuery&&this.apiSearchQuery?i+=`?${e}&${t}`:this.apiQuery?i+=`?${t}`:this.apiSearchQuery&&(i+=`?${e}`);const s=yield fetch(i,this.apiHeaders);let l=yield s.json();this.apiDataPart&&(l=l[this.apiDataPart]),this.apiSearchQuery&&(this.items=[]),this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="","tabs"===this.groupingType?(this.setApiGroups(l),this.groupTabsRender(),this.jsonItemsRender(l)):"default"===this.groupingType?(this.setApiGroups(l),this.groups.forEach((t=>{const e=(0,o.fc)(this.groupingTitleTemplate);e.setAttribute("data-hs-combo-box-group-title",t.name),e.classList.add("--exclude-accessibility"),e.innerText=t.title;const i=l.filter((e=>e[this.apiGroupField]===t.name));this.itemsWrapper?this.itemsWrapper.append(e):this.output.append(e),this.jsonItemsRender(i)}))):this.jsonItemsRender(l),this.setResults(this.input.value)}catch(t){console.error(t)}this.destroyOutputLoader()}))}jsonItemsRender(t){t.forEach(((t,e)=>{const i=(0,o.fc)(this.outputItemTemplate);i.querySelectorAll("[data-hs-combo-box-output-item-field]").forEach((e=>{const i=t[e.getAttribute("data-hs-combo-box-output-item-field")],s=e.hasAttribute("data-hs-combo-box-output-item-hide-if-empty");e.textContent=null!=i?i:"",!i&&s&&(e.style.display="none")})),i.querySelectorAll("[data-hs-combo-box-search-text]").forEach((e=>{var i;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((e=>{JSON.parse(e.getAttribute("data-hs-combo-box-output-item-attr")).forEach((i=>{e.setAttribute(i.attr,t[i.valueFrom])}))})),i.setAttribute("tabIndex",`${e}`),"tabs"!==this.groupingType&&"default"!==this.groupingType||i.setAttribute("data-hs-combo-box-output-item",`{"group": {"name": "${t[this.apiGroupField]}", "title": "${t[this.apiGroupField]}"}}`),this.items=[...this.items,i],this.preventSelection||i.addEventListener("click",(()=>{this.close(i.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text")),this.setSelectedByValue(this.valuesBySelector(i))})),this.appendItemsToWrapper(i)}))}setGroups(){const t=[];this.items.forEach((e=>{const{group:i}=JSON.parse(e.getAttribute("data-hs-combo-box-output-item"));t.some((t=>(null==t?void 0:t.name)===i.name))||t.push(i)})),this.groups=t}setCurrent(){window.$hsComboBoxCollection.length&&(window.$hsComboBoxCollection.map((t=>t.element.isCurrent=!1)),this.isCurrent=!0)}setApiGroups(t){const e=[];t.forEach((t=>{const i=t[this.apiGroupField];e.some((t=>t.name===i))||e.push({name:i,title:i})})),this.groups=e}sortItems(){return this.items.sort(((t,e)=>{const i=t.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text"),s=e.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text");return is?1:0}))}itemRender(t){const e=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",(()=>{this.close(e),this.setSelectedByValue(this.valuesBySelector(t))}))}plainRender(t){t.forEach((t=>{this.itemRender(t)}))}groupTabsRender(){const t=(0,o.fc)(this.tabsWrapperTemplate),e=(0,o.fc)('
');t.append(e),this.output.insertBefore(t,this.output.firstChild);const i=(0,o.fc)(this.groupingTitleTemplate);i.setAttribute("data-hs-combo-box-group-title","all"),i.classList.add("--exclude-accessibility","active"),i.innerText="All",this.tabs=[...this.tabs,i],e.append(i),i.addEventListener("click",(()=>{this.selectedGroup="all";const t=this.tabs.find((t=>t.getAttribute("data-hs-combo-box-group-title")===this.selectedGroup));this.tabs.forEach((t=>t.classList.remove("active"))),t.classList.add("active"),this.setItemsVisibility()})),this.groups.forEach((t=>{const i=(0,o.fc)(this.groupingTitleTemplate);i.setAttribute("data-hs-combo-box-group-title",t.name),i.classList.add("--exclude-accessibility"),i.innerText=t.title,this.tabs=[...this.tabs,i],e.append(i),i.addEventListener("click",(()=>{this.selectedGroup=t.name;const e=this.tabs.find((t=>t.getAttribute("data-hs-combo-box-group-title")===this.selectedGroup));this.tabs.forEach((t=>t.classList.remove("active"))),e.classList.add("active"),this.setItemsVisibility()}))}))}groupDefaultRender(){this.groups.forEach((t=>{const e=(0,o.fc)(this.groupingTitleTemplate);e.setAttribute("data-hs-combo-box-group-title",t.name),e.classList.add("--exclude-accessibility"),e.innerText=t.title,this.itemsWrapper?this.itemsWrapper.append(e):this.output.append(e);const i=this.sortItems().filter((e=>{const{group:i}=JSON.parse(e.getAttribute("data-hs-combo-box-output-item"));return i.name===t.name}));this.plainRender(i)}))}itemsFromHtml(){if("default"===this.groupingType)this.groupDefaultRender();else if("tabs"===this.groupingType){const t=this.sortItems();this.groupTabsRender(),this.plainRender(t)}else{const t=this.sortItems();this.plainRender(t)}this.setResults(this.input.value)}buildToggle(){var t,e,i,s;this.isOpened?((null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="true")):((null===(i=null==this?void 0:this.toggle)||void 0===i?void 0:i.ariaExpanded)&&(this.toggle.ariaExpanded="false"),(null===(s=null==this?void 0:this.input)||void 0===s?void 0:s.ariaExpanded)&&(this.input.ariaExpanded="false")),this.toggle.addEventListener("click",(()=>{this.isOpened?this.close():this.open(this.toggle.getAttribute("data-hs-combo-box-toggle"))}))}buildToggleClose(){this.toggleClose.addEventListener("click",(()=>this.close()))}buildToggleOpen(){this.toggleOpen.addEventListener("click",(()=>this.open()))}setSelectedByValue(t){this.items.forEach((e=>{this.isTextExists(e,t)?e.classList.add("selected"):e.classList.remove("selected")}))}setValue(t){this.selected=t,this.value=t,this.input.value=t,this.fireEvent("select",this.el),(0,o.JD)("select.hs.combobox",this.el,this.value)}setItemsVisibility(){"tabs"===this.groupingType&&"all"!==this.selectedGroup&&this.items.forEach((t=>{t.style.display="none"}));const t="tabs"===this.groupingType?"all"===this.selectedGroup?this.items:this.items.filter((t=>{const{group:e}=JSON.parse(t.getAttribute("data-hs-combo-box-output-item"));return e.name===this.selectedGroup})):this.items;"tabs"===this.groupingType&&"all"!==this.selectedGroup&&t.forEach((t=>{t.style.display="block"})),t.forEach((t=>{this.isTextExistsAny(t,this.value)?t.style.display="block":t.style.display="none"})),"default"===this.groupingType&&this.output.querySelectorAll("[data-hs-combo-box-group-title]").forEach((t=>{const e=t.getAttribute("data-hs-combo-box-group-title");this.items.filter((t=>{const{group:i}=JSON.parse(t.getAttribute("data-hs-combo-box-output-item"));return i.name===e&&"block"===t.style.display})).length?t.style.display="block":t.style.display="none"}))}hasVisibleItems(){return!!this.items.length&&this.items.some((t=>"block"===t.style.display))}appendItemsToWrapper(t){this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t)}buildOutputPlaceholder(){this.outputPlaceholder||(this.outputPlaceholder=(0,o.fc)(this.outputEmptyTemplate)),this.appendItemsToWrapper(this.outputPlaceholder)}destroyOutputPlaceholder(){this.outputPlaceholder&&this.outputPlaceholder.remove(),this.outputPlaceholder=null}resultItems(){if(!this.items.length)return!1;this.setItemsVisibility(),this.setSelectedByValue([this.selected])}setValueAndOpen(t){this.value=t,this.items.length&&this.setItemsVisibility()}open(t){return!this.animationInProcess&&(void 0!==t&&this.setValueAndOpen(t),!this.preventVisibility&&(this.animationInProcess=!0,this.output.style.display="block",this.preventAutoPosition||this.recalculateDirection(),setTimeout((()=>{var t,e;(null===(t=null==this?void 0:this.input)||void 0===t?void 0:t.ariaExpanded)&&(this.input.ariaExpanded="true"),(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.el.classList.add("active"),this.animationInProcess=!1})),void(this.isOpened=!0)))}setValueAndClear(t){t?this.setValue(t):this.setValue(this.selected),this.outputPlaceholder&&this.destroyOutputPlaceholder()}close(t){var e,i;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),!1):(this.animationInProcess=!0,(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="false"),(null===(i=null==this?void 0:this.toggle)||void 0===i?void 0:i.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.el.classList.remove("active"),this.preventAutoPosition||(this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom=""),(0,o.yd)(this.output,(()=>{this.output.style.display="none",this.setValueAndClear(t),this.animationInProcess=!1})),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),void(this.isOpened=!1)))}recalculateDirection(){(0,o.PR)(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=`${this.gap}px`):(this.output.classList.remove("top-full"),this.output.style.marginTop="",this.output.classList.add("bottom-full"),this.output.style.marginBottom=`${this.gap}px`)}static getInstance(t,e){const i=window.$hsComboBoxCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element:null}static autoInit(){window.$hsComboBoxCollection||(window.$hsComboBoxCollection=[]),document.querySelectorAll("[data-hs-combo-box]:not(.--prevent-on-load-init)").forEach((t=>{if(!window.$hsComboBoxCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))){const e=t.getAttribute("data-hs-combo-box"),i=e?JSON.parse(e):{};new r(t,i)}})),window.$hsComboBoxCollection&&(window.addEventListener("click",(t=>{const e=t.target;r.closeCurrentlyOpened(e)})),document.addEventListener("keydown",(t=>r.accessibility(t))))}static close(t){const e=window.$hsComboBoxCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));e&&e.element.isOpened&&e.element.close()}static closeCurrentlyOpened(t=null){if(!t.closest("[data-hs-combo-box].active")){const t=window.$hsComboBoxCollection.filter((t=>t.element.isOpened))||null;t&&t.forEach((t=>{t.element.close()}))}}static getPreparedItems(t=!1,e){if(!e)return null;return(t?Array.from(e.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter((t=>"none"!==t.style.display)).reverse():Array.from(e.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter((t=>"none"!==t.style.display))).filter((t=>!t.classList.contains("disabled")))}static setHighlighted(t,e,i){e.focus(),i.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")}static accessibility(t){if(window.$hsComboBoxCollection.find((t=>t.element.preventVisibility?t.element.isCurrent:t.element.isOpened))&&n.jU.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}}static onEscape(){const t=window.$hsComboBoxCollection.find((t=>!t.element.preventVisibility&&t.element.isOpened));t&&(t.element.close(),t.element.input.blur())}static onArrow(t=!0){var e;const i=window.$hsComboBoxCollection.find((t=>t.element.preventVisibility?t.element.isCurrent:t.element.isOpened));if(i){const s=null!==(e=i.element.itemsWrapper)&&void 0!==e?e:i.element.output;if(!s)return!1;const o=r.getPreparedItems(t,s),l=s.querySelector(".hs-combo-box-output-item-highlighted");let n=null;l||o[0].classList.add("hs-combo-box-output-item-highlighted");let a=o.findIndex((t=>t===l));a+1t.element.preventVisibility?t.element.isCurrent:t.element.isOpened));if(i){const s=null!==(e=i.element.itemsWrapper)&&void 0!==e?e:i.element.output;if(!s)return!1;const o=r.getPreparedItems(t,s),l=s.querySelector(".hs-combo-box-output-item-highlighted");o.length&&r.setHighlighted(l,o[0],i.element.input)}}static onEnter(t){const e=t.target,i=window.$hsComboBoxCollection.find((e=>!(0,o.sH)(e.element.el)&&t.target.closest("[data-hs-combo-box]")===e.element.el)),s=i.element.el.querySelector(".hs-combo-box-output-item-highlighted a");e.hasAttribute("data-hs-combo-box-input")?(i.element.close(),e.blur()):(i.element.preventSelection||i.element.setSelectedByValue(i.element.valuesBySelector(t.target)),i.element.preventSelection&&s&&window.location.assign(s.getAttribute("href")),i.element.close(i.element.preventSelection?null:t.target.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text")))}}window.addEventListener("load",(()=>{r.autoInit()})),document.addEventListener("scroll",(()=>{if(!window.$hsComboBoxCollection)return!1;const t=window.$hsComboBoxCollection.find((t=>t.element.isOpened));t&&!t.element.preventAutoPosition&&t.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSComboBox=r);const u=r;var d=s.A;export{d as default}; \ No newline at end of file diff --git a/dist/copy-markup.js b/dist/copy-markup.js index 5f1ea2b..31a97a8 100644 --- a/dist/copy-markup.js +++ b/dist/copy-markup.js @@ -1,17 +1,16 @@ -!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={961:(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={961:(t,e)=>{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},406:function(t,e,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSCopyMarkup + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},406: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=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,a.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,a.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}(s(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=l),e.default=l},292:function(t,e){ /* - * HSCopyMarkup - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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,a.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,a.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}(s(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=l),e.default=l},292: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.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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 i=function(t){return!!t&&("none"===window.getComputedStyle(t).display||i(t.parentElement))};e.isParentOrElementHidden=i;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(406);return n})())); \ No newline at end of file +var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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.isDirectChild=function(t,e){for(var n=t.children,o=0;o=c:"top"===n?l>=c:l>=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 o;return void 0===e&&(e=200),function(){for(var i=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(406);return n})())); \ No newline at end of file diff --git a/dist/copy-markup.mjs b/dist/copy-markup.mjs new file mode 100644 index 0000000..ca9bf6f --- /dev/null +++ b/dist/copy-markup.mjs @@ -0,0 +1,9 @@ +var t={615:(t,e,i)=>{i.d(e,{A:()=>s});class s{constructor(t,e,i){this.el=t,this.options=e,this.events=i,this.el=t,this.options=e,this.events={}}createCollection(t,e){var i;t.push({id:(null===(i=null==e?void 0:e.el)||void 0===i?void 0:i.id)||t.length+1,element:e})}fireEvent(t,e=null){if(this.events.hasOwnProperty(t))return this.events[t](e)}on(t,e){this.events[t]=e}}},926:(t,e,i)=>{i.d(e,{JD:()=>s});const s=(t,e,i=null)=>{const s=new CustomEvent(t,{detail:{payload:i},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(s)}}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var o=e[s]={exports:{}};return t[s](o,o.exports,i),o.exports}i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var s={};i.d(s,{A:()=>l});var r=i(926),o=i(615); +/* + * HSCopyMarkup + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class n extends o.A{constructor(t,e){super(t,e);const i=t.getAttribute("data-hs-copy-markup"),s=i?JSON.parse(i):{},r=Object.assign(Object.assign({},s),e);this.targetSelector=(null==r?void 0:r.targetSelector)||null,this.wrapperSelector=(null==r?void 0:r.wrapperSelector)||null,this.limit=(null==r?void 0:r.limit)||null,this.items=[],this.targetSelector&&this.init()}init(){this.createCollection(window.$hsCopyMarkupCollection,this),this.setTarget(),this.setWrapper(),this.addPredefinedItems(),this.el.addEventListener("click",(()=>this.copy()))}copy(){if(this.limit&&this.items.length>=this.limit)return!1;this.el.hasAttribute("disabled")&&this.el.setAttribute("disabled","");const 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,r.JD)("copy.hs.copyMarkup",t,t)}addPredefinedItems(){Array.from(this.wrapper.children).filter((t=>!t.classList.contains("[--ignore-for-count]"))).forEach((t=>{this.addToItems(t)}))}setTarget(){const t="string"==typeof this.targetSelector?document.querySelector(this.targetSelector).cloneNode(!0):this.targetSelector.cloneNode(!0);t.removeAttribute("id"),this.target=t}setWrapper(){this.wrapper="string"==typeof this.wrapperSelector?document.querySelector(this.wrapperSelector):this.wrapperSelector}addToItems(t){const e=t.querySelector("[data-hs-copy-markup-delete-item]");this.wrapper?this.wrapper.append(t):this.el.before(t),e&&e.addEventListener("click",(()=>this.delete(t))),this.items.push(t)}delete(t){const e=this.items.indexOf(t);-1!==e&&this.items.splice(e,1),t.remove(),this.fireEvent("delete",t),(0,r.JD)("delete.hs.copyMarkup",t,t)}static getInstance(t,e){const i=window.$hsCopyMarkupCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element:null}static autoInit(){window.$hsCopyMarkupCollection||(window.$hsCopyMarkupCollection=[]),document.querySelectorAll("[data-hs-copy-markup]:not(.--prevent-on-load-init)").forEach((t=>{if(!window.$hsCopyMarkupCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))){const e=t.getAttribute("data-hs-copy-markup"),i=e?JSON.parse(e):{};new n(t,i)}}))}}window.addEventListener("load",(()=>{n.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=n);const l=n;var a=s.A;export{a as default}; \ No newline at end of file diff --git a/dist/datatable.js b/dist/datatable.js index fc64b8a..103d031 100644 --- a/dist/datatable.js +++ b/dist/datatable.js @@ -1,17 +1,16 @@ -!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={961:(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 i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(self,(()=>(()=>{"use strict";var t={961:(t,e)=>{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},814:function(t,e,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSDataTable + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},814:function(t,e,n){ +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)}),a=this&&this.__assign||function(){return a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n1&&(this.buildPagingPage(1),l>2&&this.pagingPages.appendChild((0,s.htmlToElement)('...')));for(var d=l;d<=c;d++)this.buildPagingPage(d);c...')),this.buildPagingPage(a)),this.disablePagingArrow(this.pagingPrev,0===e),this.disablePagingArrow(this.pagingNext,e===n-1),this.hidePagingIfSinglePage()},e.prototype.buildPagingPage=function(t){var e=this,n=this.dataTable.page.info().page,i=(0,s.htmlToElement)('');i.innerText="".concat(t),i.setAttribute("data-page","".concat(t)),this.pageBtnClasses&&(0,s.classToClassList)(this.pageBtnClasses,i),n===t-1&&i.classList.add("active"),i.addEventListener("click",(function(){return e.onPageClick(t)})),this.pagingPages.append(i)},e.prototype.onPageClick=function(t){this.dataTable.page(t-1).draw("page")},e.prototype.initRowSelecting=function(){var t=this;this.rowSelectingAll.addEventListener("change",(function(){return t.onSelectAllChange()}))},e.prototype.triggerChangeEventToRow=function(){var t=this;this.table.querySelectorAll("tbody ".concat(this.rowSelectingIndividual)).forEach((function(e){e.addEventListener("change",(function(){t.updateSelectAllCheckbox()}))}))},e.prototype.onSelectAllChange=function(){var t=this,e=this.rowSelectingAll.checked;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var i=n.querySelector(t.rowSelectingIndividual);i&&(i.checked=e)})),this.updateSelectAllCheckbox()},e.prototype.updateSelectAllCheckbox=function(){var t=this;if(!this.dataTable.rows({search:"applied"}).count())return this.rowSelectingAll.checked=!1,!1;var e=!0;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var i=n.querySelector(t.rowSelectingIndividual);if(i&&!i.checked)return e=!1,!1})),this.rowSelectingAll.checked=e},e.getInstance=function(t,e){var n=window.$hsDataTableCollection.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.$hsDataTableCollection||(window.$hsDataTableCollection=[]),document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDataTableCollection.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}(l(n(961)).default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").length&&("undefined"==typeof jQuery&&console.error("HSDataTable: jQuery is not available, please add it to the page."),"undefined"==typeof DataTable&&console.error("HSDataTable: DataTable is not available, please add it to the page.")),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery&&c.autoInit()})),"undefined"!=typeof window&&(window.HSDataTable=c),e.default=c},292:function(t,e){ /* - * HSDataTable - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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)}),a=this&&this.__assign||function(){return a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n1&&(this.buildPagingPage(1),r>2&&this.pagingPages.appendChild((0,s.htmlToElement)('...')));for(var d=r;d<=c;d++)this.buildPagingPage(d);c...')),this.buildPagingPage(a)),this.disablePagingArrow(this.pagingPrev,0===e),this.disablePagingArrow(this.pagingNext,e===n-1),this.hidePagingIfSinglePage()},e.prototype.buildPagingPage=function(t){var e=this,n=this.dataTable.page.info().page,i=(0,s.htmlToElement)('');i.innerText="".concat(t),i.setAttribute("data-page","".concat(t)),this.pageBtnClasses&&(0,s.classToClassList)(this.pageBtnClasses,i),n===t-1&&i.classList.add("active"),i.addEventListener("click",(function(){return e.onPageClick(t)})),this.pagingPages.append(i)},e.prototype.onPageClick=function(t){this.dataTable.page(t-1).draw("page")},e.prototype.initRowSelecting=function(){var t=this;this.rowSelectingAll.addEventListener("change",(function(){return t.onSelectAllChange()}))},e.prototype.triggerChangeEventToRow=function(){var t=this;this.table.querySelectorAll("tbody ".concat(this.rowSelectingIndividual)).forEach((function(e){e.addEventListener("change",(function(){t.updateSelectAllCheckbox()}))}))},e.prototype.onSelectAllChange=function(){var t=this,e=this.rowSelectingAll.checked;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var i=n.querySelector(t.rowSelectingIndividual);i&&(i.checked=e)})),this.updateSelectAllCheckbox()},e.prototype.updateSelectAllCheckbox=function(){var t=this;if(!this.dataTable.rows({search:"applied"}).count())return this.rowSelectingAll.checked=!1,!1;var e=!0;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var i=n.querySelector(t.rowSelectingIndividual);if(i&&!i.checked)return e=!1,!1})),this.rowSelectingAll.checked=e},e.getInstance=function(t,e){var n=window.$hsDataTableCollection.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.$hsDataTableCollection||(window.$hsDataTableCollection=[]),document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDataTableCollection.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}(r(n(961)).default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").length&&("undefined"==typeof jQuery&&console.error("HSDataTable: jQuery is not available, please add it to the page."),"undefined"==typeof DataTable&&console.error("HSDataTable: DataTable is not available, please add it to the page.")),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery&&c.autoInit()})),"undefined"!=typeof window&&(window.HSDataTable=c),e.default=c},292: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.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=i(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var i=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=i;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 a=e.getBoundingClientRect(),l=o?o.getBoundingClientRect():null,r=window.innerHeight,s=l?a.top-l.top:a.top,c=(o?l.bottom:r)-a.bottom,d=t.clientHeight+i;return"bottom"===n?c>=d:"top"===n?s>=d:s>=d||c>=d};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 i;return void 0===e&&(e=200),function(){for(var o=[],a=0;a0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,i){void 0===n&&(n=" "),void 0===i&&(i="add"),t.split(n).forEach((function(t){return"add"===i?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(i){var o=e[i];if(void 0!==o)return o.exports;var a=e[i]={exports:{}};return t[i].call(a.exports,a,a.exports,n),a.exports}(814);return n})())); \ No newline at end of file +var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=i(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var i=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=i;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.isDirectChild=function(t,e){for(var n=t.children,i=0;i=d:"top"===n?s>=d:s>=d||c>=d};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 i;return void 0===e&&(e=200),function(){for(var o=[],a=0;a0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,i){void 0===n&&(n=" "),void 0===i&&(i="add"),t.split(n).forEach((function(t){return"add"===i?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(i){var o=e[i];if(void 0!==o)return o.exports;var a=e[i]={exports:{}};return t[i].call(a.exports,a,a.exports,n),a.exports}(814);return n})())); \ No newline at end of file diff --git a/dist/datatable.mjs b/dist/datatable.mjs new file mode 100644 index 0000000..296eb9f --- /dev/null +++ b/dist/datatable.mjs @@ -0,0 +1,9 @@ +var t={615:(t,e,i)=>{i.d(e,{A:()=>a});class a{constructor(t,e,i){this.el=t,this.options=e,this.events=i,this.el=t,this.options=e,this.events={}}createCollection(t,e){var i;t.push({id:(null===(i=null==e?void 0:e.el)||void 0===i?void 0:i.id)||t.length+1,element:e})}fireEvent(t,e=null){if(this.events.hasOwnProperty(t))return this.events[t](e)}on(t,e){this.events[t]=e}}},926:(t,e,i)=>{i.d(e,{en:()=>s,fc:()=>n,sg:()=>a});const a=(t,e=200)=>{let i;return(...a)=>{clearTimeout(i),i=setTimeout((()=>{t.apply(void 0,a)}),e)}},n=t=>{const e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild},s=(t,e,i=" ",a="add")=>{t.split(i).forEach((t=>"add"===a?e.classList.add(t):e.classList.remove(t)))}}},e={};function i(a){var n=e[a];if(void 0!==n)return n.exports;var s=e[a]={exports:{}};return t[a](s,s.exports,i),s.exports}i.d=(t,e)=>{for(var a in e)i.o(e,a)&&!i.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var a={};i.d(a,{A:()=>o});var n=i(926),s=i(615); +/* + * HSDataTable + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class l extends s.A{constructor(t,e,i){var a,n,s,l,o,h,d,r,g,c,p,u,v,b,f,S,w,P,T,y,m,x,C,A,E;super(t,e,i),this.el="string"==typeof t?document.querySelector(t):t;const I=[];Array.from(this.el.querySelectorAll("thead th, thead td")).forEach(((t,e)=>{t.classList.contains("--exclude-from-ordering")&&I.push({targets:e,orderable:!1})}));const L=this.el.getAttribute("data-hs-datatable"),O=L?JSON.parse(L):{};this.concatOptions=Object.assign(Object.assign({searching:!0,lengthChange:!1,order:[],columnDefs:[...I]},O),e),this.table=this.el.querySelector("table"),this.search=null!==(a=this.el.querySelector("[data-hs-datatable-search]"))&&void 0!==a?a:null,this.pageEntities=null!==(n=this.el.querySelector("[data-hs-datatable-page-entities]"))&&void 0!==n?n:null,this.paging=null!==(s=this.el.querySelector("[data-hs-datatable-paging]"))&&void 0!==s?s:null,this.pagingPrev=null!==(l=this.el.querySelector("[data-hs-datatable-paging-prev]"))&&void 0!==l?l:null,this.pagingNext=null!==(o=this.el.querySelector("[data-hs-datatable-paging-next]"))&&void 0!==o?o:null,this.pagingPages=null!==(h=this.el.querySelector("[data-hs-datatable-paging-pages]"))&&void 0!==h?h:null,this.info=null!==(d=this.el.querySelector("[data-hs-datatable-info]"))&&void 0!==d?d:null,this.infoFrom=null!==(r=this.el.querySelector("[data-hs-datatable-info-from]"))&&void 0!==r?r:null,this.infoTo=null!==(g=this.el.querySelector("[data-hs-datatable-info-to]"))&&void 0!==g?g:null,this.infoLength=null!==(c=this.el.querySelector("[data-hs-datatable-info-length]"))&&void 0!==c?c:null,(null===(p=this.concatOptions)||void 0===p?void 0:p.rowSelectingOptions)&&(this.rowSelectingAll=null!==(S=(null===(v=null===(u=this.concatOptions)||void 0===u?void 0:u.rowSelectingOptions)||void 0===v?void 0:v.selectAllSelector)?document.querySelector(null===(f=null===(b=this.concatOptions)||void 0===b?void 0:b.rowSelectingOptions)||void 0===f?void 0:f.selectAllSelector):document.querySelector("[data-hs-datatable-row-selecting-all]"))&&void 0!==S?S:null),(null===(w=this.concatOptions)||void 0===w?void 0:w.rowSelectingOptions)&&(this.rowSelectingIndividual=null!==(m=null!==(y=null===(T=null===(P=this.concatOptions)||void 0===P?void 0:P.rowSelectingOptions)||void 0===T?void 0:T.individualSelector)&&void 0!==y?y:"[data-hs-datatable-row-selecting-individual]")&&void 0!==m?m:null),this.pageEntities&&(this.concatOptions.pageLength=parseInt(this.pageEntities.value)),this.maxPagesToShow=3,this.isRowSelecting=!!(null===(x=this.concatOptions)||void 0===x?void 0:x.rowSelectingOptions),this.pageBtnClasses=null!==(E=null===(A=null===(C=this.concatOptions)||void 0===C?void 0:C.pagingOptions)||void 0===A?void 0:A.pageBtnClasses)&&void 0!==E?E:null,this.init()}init(){this.createCollection(window.$hsDataTableCollection,this),this.initTable(),this.search&&this.initSearch(),this.pageEntities&&this.initPageEntities(),this.paging&&this.initPaging(),this.pagingPrev&&this.initPagingPrev(),this.pagingNext&&this.initPagingNext(),this.pagingPages&&this.buildPagingPages(),this.info&&this.initInfo(),this.isRowSelecting&&this.initRowSelecting()}initTable(){this.dataTable=new DataTable(this.table,this.concatOptions),this.isRowSelecting&&this.triggerChangeEventToRow(),this.dataTable.on("draw",(()=>{this.isRowSelecting&&this.updateSelectAllCheckbox(),this.isRowSelecting&&this.triggerChangeEventToRow(),this.updateInfo(),this.updatePaging()}))}initSearch(){this.search.addEventListener("input",(0,n.sg)((t=>this.onSearchInput(t.target.value))))}onSearchInput(t){this.dataTable.search(t).draw()}initPageEntities(){this.pageEntities.addEventListener("change",(t=>this.onEntitiesChange(parseInt(t.target.value))))}onEntitiesChange(t){this.dataTable.page.len(t).draw()}initInfo(){this.infoFrom&&this.initInfoFrom(),this.infoTo&&this.initInfoTo(),this.infoLength&&this.initInfoLength()}initInfoFrom(){const{start:t}=this.dataTable.page.info();this.infoFrom.innerText=`${t+1}`}initInfoTo(){const{end:t}=this.dataTable.page.info();this.infoTo.innerText=`${t}`}initInfoLength(){const{recordsTotal:t}=this.dataTable.page.info();this.infoLength.innerText=`${t}`}updateInfo(){this.initInfo()}initPaging(){this.hidePagingIfSinglePage()}hidePagingIfSinglePage(){const{pages:t}=this.dataTable.page.info();t<2?(this.paging.classList.add("hidden"),this.paging.style.display="none"):(this.paging.classList.remove("hidden"),this.paging.style.display="")}initPagingPrev(){this.pagingPrev.addEventListener("click",(()=>{this.onPrevClick()}))}onPrevClick(){this.dataTable.page("previous").draw("page")}disablePagingArrow(t,e){e?(t.classList.add("disabled"),t.setAttribute("disabled","disabled")):(t.classList.remove("disabled"),t.removeAttribute("disabled"))}initPagingNext(){this.pagingNext.addEventListener("click",(()=>{this.onNextClick()}))}onNextClick(){this.dataTable.page("next").draw("page")}buildPagingPages(){this.updatePaging()}updatePaging(){const{page:t,pages:e,length:i}=this.dataTable.page.info(),a=this.dataTable.rows({search:"applied"}).count(),s=Math.ceil(a/i),l=t+1;let o=Math.max(1,l-Math.floor(this.maxPagesToShow/2)),h=Math.min(s,o+(this.maxPagesToShow-1));h-o+11&&(this.buildPagingPage(1),o>2&&this.pagingPages.appendChild((0,n.fc)('...')));for(let t=o;t<=h;t++)this.buildPagingPage(t);h...')),this.buildPagingPage(s)),this.disablePagingArrow(this.pagingPrev,0===t),this.disablePagingArrow(this.pagingNext,t===e-1),this.hidePagingIfSinglePage()}buildPagingPage(t){const{page:e}=this.dataTable.page.info(),i=(0,n.fc)('');i.innerText=`${t}`,i.setAttribute("data-page",`${t}`),this.pageBtnClasses&&(0,n.en)(this.pageBtnClasses,i),e===t-1&&i.classList.add("active"),i.addEventListener("click",(()=>this.onPageClick(t))),this.pagingPages.append(i)}onPageClick(t){this.dataTable.page(t-1).draw("page")}initRowSelecting(){this.rowSelectingAll.addEventListener("change",(()=>this.onSelectAllChange()))}triggerChangeEventToRow(){this.table.querySelectorAll(`tbody ${this.rowSelectingIndividual}`).forEach((t=>{t.addEventListener("change",(()=>{this.updateSelectAllCheckbox()}))}))}onSelectAllChange(){let t=this.rowSelectingAll.checked;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((e=>{const i=e.querySelector(this.rowSelectingIndividual);i&&(i.checked=t)})),this.updateSelectAllCheckbox()}updateSelectAllCheckbox(){if(!this.dataTable.rows({search:"applied"}).count())return this.rowSelectingAll.checked=!1,!1;let t=!0;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((e=>{const i=e.querySelector(this.rowSelectingIndividual);if(i&&!i.checked)return t=!1,!1})),this.rowSelectingAll.checked=t}static getInstance(t,e){const i=window.$hsDataTableCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element.el:null}static autoInit(){window.$hsDataTableCollection||(window.$hsDataTableCollection=[]),document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsDataTableCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new l(t)}))}}window.addEventListener("load",(()=>{document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").length&&("undefined"==typeof jQuery&&console.error("HSDataTable: jQuery is not available, please add it to the page."),"undefined"==typeof DataTable&&console.error("HSDataTable: DataTable is not available, please add it to the page.")),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery&&l.autoInit()})),"undefined"!=typeof window&&(window.HSDataTable=l);const o=l;var h=a.A;export{h as default}; \ No newline at end of file diff --git a/dist/dropdown.js b/dist/dropdown.js index 6b0ba98..99ba56d 100644 --- a/dist/dropdown.js +++ b/dist/dropdown.js @@ -1,17 +1,16 @@ -!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={170:(e,t,n)=>{n.r(t),n.d(t,{afterMain:()=>x,afterRead:()=>w,afterWrite:()=>C,applyStyles:()=>_,arrow:()=>J,auto:()=>a,basePlacements:()=>l,beforeMain:()=>b,beforeRead:()=>y,beforeWrite:()=>O,bottom:()=>r,clippingParents:()=>f,computeStyles:()=>ne,createPopper:()=>_e,createPopperBase:()=>De,createPopperLite:()=>Me,detectOverflow:()=>ge,end:()=>u,eventListeners:()=>re,flip:()=>we,hide:()=>xe,left:()=>s,main:()=>E,modifierPhases:()=>L,offset:()=>Oe,placements:()=>v,popper:()=>p,popperGenerator:()=>Te,popperOffsets:()=>Se,preventOverflow:()=>Ce,read:()=>g,reference:()=>h,right:()=>i,start:()=>c,top:()=>o,variationPlacements:()=>m,viewport:()=>d,write:()=>S});var o="top",r="bottom",i="right",s="left",a="auto",l=[o,r,i,s],c="start",u="end",f="clippingParents",d="viewport",p="popper",h="reference",m=l.reduce((function(e,t){return e.concat([t+"-"+c,t+"-"+u])}),[]),v=[].concat(l,[a]).reduce((function(e,t){return e.concat([t,t+"-"+c,t+"-"+u])}),[]),y="beforeRead",g="read",w="afterRead",b="beforeMain",E="main",x="afterMain",O="beforeWrite",S="write",C="afterWrite",L=[y,g,w,b,E,x,O,S,C];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 I(e){return e instanceof A(e).Element||e instanceof Element}function T(e){return e instanceof A(e).HTMLElement||e instanceof HTMLElement}function D(e){return"undefined"!=typeof ShadowRoot&&(e instanceof A(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)&&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}),{});T(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 j=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 q(){return!/^((?!chrome|android).)*safari/i.test(k())}function R(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)?A(e):window).visualViewport,a=!q()&&n,l=(o.left+(a&&s?s.offsetLeft:0))/r,c=(o.top+(a&&s?s.offsetTop:0))/i,u=o.width/r,f=o.height/i;return{width:u,height:f,top:c,right:l+u,bottom:c+f,left:l,x:l,y:c}}function W(e){var t=R(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 V(e){return A(e).getComputedStyle(e)}function $(e){return["table","td","th"].indexOf(P(e))>=0}function N(e){return((I(e)?e.ownerDocument:e.document)||window.document).documentElement}function K(e){return"html"===P(e)?e:e.assignedSlot||e.parentNode||(D(e)?e.host:null)||N(e)}function F(e){return T(e)&&"fixed"!==V(e).position?e.offsetParent:null}function U(e){for(var t=A(e),n=F(e);n&&$(n)&&"static"===V(n).position;)n=F(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())&&T(e)&&"fixed"===V(e).position)return null;var n=K(e);for(D(n)&&(n=n.host);T(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 z(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function X(e,t,n){return j(e,H(t,n))}function Z(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function G(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,u=n.elements.arrow,f=n.modifiersData.popperOffsets,d=M(n.placement),p=z(d),h=[s,i].indexOf(d)>=0?"height":"width";if(u&&f){var m=function(e,t){return Z("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:G(e,l))}(c.padding,n),v=W(u),y="y"===p?o:s,g="y"===p?r:i,w=n.rects.reference[h]+n.rects.reference[p]-f[p]-n.rects.popper[h],b=f[p]-n.rects.reference[p],E=U(u),x=E?"y"===p?E.clientHeight||0:E.clientWidth||0:0,O=w/2-b/2,S=m[y],C=x-v[h]-m[g],L=x/2-v[h]/2+O,P=X(S,L,C),A=p;n.modifiersData[a]=((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)))&&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,f=e.offsets,d=e.position,p=e.gpuAcceleration,h=e.adaptive,m=e.roundOffsets,v=e.isFixed,y=f.x,g=void 0===y?0:y,w=f.y,b=void 0===w?0:w,E="function"==typeof m?m({x:g,y:b}):{x:g,y:b};g=E.x,b=E.y;var x=f.hasOwnProperty("x"),O=f.hasOwnProperty("y"),S=s,C=o,L=window;if(h){var P=U(n),I="clientHeight",T="clientWidth";if(P===A(n)&&"static"!==V(P=N(n)).position&&"absolute"===d&&(I="scrollHeight",T="scrollWidth"),l===o||(l===s||l===i)&&c===u)C=r,b-=(v&&P===L&&L.visualViewport?L.visualViewport.height:P[I])-a.height,b*=p?1:-1;if(l===s||(l===o||l===r)&&c===u)S=i,g-=(v&&P===L&&L.visualViewport?L.visualViewport.width:P[T])-a.width,g*=p?1:-1}var D,_=Object.assign({position:d},h&&ee),M=!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:g,y:b},A(n)):{x:g,y:b};return g=M.x,b=M.y,p?Object.assign({},_,((D={})[C]=O?"0":"",D[S]=x?"0":"",D.transform=(L.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",D)):Object.assign({},_,((t={})[C]=O?b+"px":"",t[S]=x?g+"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:M(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=A(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=A(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ue(e){return R(N(e)).left+ce(e).scrollLeft}function fe(e){var t=V(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function de(e){return["html","body","#document"].indexOf(P(e))>=0?e.ownerDocument.body:T(e)&&fe(e)?e:de(K(e))}function pe(e,t){var n;void 0===t&&(t=[]);var o=de(e),r=o===(null==(n=e.ownerDocument)?void 0:n.body),i=A(o),s=r?[i].concat(i.visualViewport||[],fe(o)?o:[]):o,a=t.concat(s);return r?a:a.concat(pe(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===d?he(function(e,t){var n=A(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=q();(c||!c&&"fixed"===t)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:i,height:s,x:a+ue(e),y:l}}(e,n)):I(t)?function(e,t){var n=R(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=j(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=j(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-o.scrollLeft+ue(e),l=-o.scrollTop;return"rtl"===V(r||n).direction&&(a+=j(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=pe(K(e)),n=["absolute","fixed"].indexOf(V(e).position)>=0&&T(e)?U(e):e;return I(n)?t.filter((function(e){return I(e)&&Y(e,n)&&"body"!==P(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=j(r.top,t.top),t.right=H(r.right,t.right),t.bottom=H(r.bottom,t.bottom),t.left=j(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,f=l?M(l):null,d=l?Q(l):null,p=n.x+n.width/2-a.width/2,h=n.y+n.height/2-a.height/2;switch(f){case o:t={x:p,y:n.y-a.height};break;case r:t={x:p,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=f?z(f):null;if(null!=m){var v="y"===m?"height":"width";switch(d){case c:t[m]=t[m]-(n[v]/2-a[v]/2);break;case u:t[m]=t[m]+(n[v]/2-a[v]/2)}}return t}function ge(e,t){void 0===t&&(t={});var n=t,s=n.placement,a=void 0===s?e.placement:s,c=n.strategy,u=void 0===c?e.strategy:c,m=n.boundary,v=void 0===m?f:m,y=n.rootBoundary,g=void 0===y?d:y,w=n.elementContext,b=void 0===w?p:w,E=n.altBoundary,x=void 0!==E&&E,O=n.padding,S=void 0===O?0:O,C=Z("number"!=typeof S?S:G(S,l)),L=b===p?h:p,P=e.rects.popper,A=e.elements[x?L:b],T=ve(I(A)?A:A.contextElement||N(e.elements.popper),v,g,u),D=R(e.elements.reference),_=ye({reference:D,element:P,strategy:"absolute",placement:a}),M=he(Object.assign({},P,_)),j=b===p?M:D,H={top:T.top-j.top+C.top,bottom:j.bottom-T.bottom+C.bottom,left:T.left-j.left+C.left,right:j.right-T.right+C.right},B=e.modifiersData.offset;if(b===p&&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 we={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,u=e.name;if(!t.modifiersData[u]._skip){for(var f=n.mainAxis,d=void 0===f||f,p=n.altAxis,h=void 0===p||p,y=n.fallbackPlacements,g=n.padding,w=n.boundary,b=n.rootBoundary,E=n.altBoundary,x=n.flipVariations,O=void 0===x||x,S=n.allowedAutoPlacements,C=t.options.placement,L=M(C),P=y||(L===C||!O?[se(C)]:function(e){if(M(e)===a)return[];var t=se(e);return[le(e),t,le(t)]}(C)),A=[C].concat(P).reduce((function(e,n){return e.concat(M(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,u=void 0===c?v:c,f=Q(o),d=f?a?m:m.filter((function(e){return Q(e)===f})):l,p=d.filter((function(e){return u.indexOf(e)>=0}));0===p.length&&(p=d);var h=p.reduce((function(t,n){return t[n]=ge(e,{placement:n,boundary:r,rootBoundary:i,padding:s})[M(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}(t,{placement:n,boundary:w,rootBoundary:b,padding:g,flipVariations:O,allowedAutoPlacements:S}):n)}),[]),I=t.rects.reference,T=t.rects.popper,D=new Map,_=!0,j=A[0],H=0;H=0,W=R?"width":"height",Y=ge(t,{placement:B,boundary:w,rootBoundary:b,altBoundary:E,padding:g}),V=R?q?i:s:q?r:o;I[W]>T[W]&&(V=se(V));var $=se(V),N=[];if(d&&N.push(Y[k]<=0),h&&N.push(Y[V]<=0,Y[$]<=0),N.every((function(e){return e}))){j=B,_=!1;break}D.set(B,N)}if(_)for(var K=function(e){var t=A.find((function(t){var n=D.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return j=t,"break"},F=O?3:1;F>0;F--){if("break"===K(F))break}t.placement!==j&&(t.modifiersData[u]._skip=!0,t.placement=j,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=ge(t,{elementContext:"reference"}),a=ge(t,{altBoundary:!0}),l=be(s,o),c=be(a,r,i),u=Ee(l),f=Ee(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}};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=M(e),a=[s,o].indexOf(r)>=0?-1:1,l="function"==typeof n?n(Object.assign({},t,{placement:e})):n,c=l[0],u=l[1];return c=c||0,u=(u||0)*a,[s,i].indexOf(r)>=0?{x:u,y:c}:{x:c,y:u}}(n,t.rects,l),e}),{}),u=c[t.placement],f=u.x,d=u.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=d),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,u=void 0===l||l,f=n.altAxis,d=void 0!==f&&f,p=n.boundary,h=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,E=ge(t,{boundary:p,rootBoundary:h,padding:v,altBoundary:m}),x=M(t.placement),O=Q(t.placement),S=!O,C=z(x),L="x"===C?"y":"x",P=t.modifiersData.popperOffsets,A=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(P){if(u){var k,q="y"===C?o:s,R="y"===C?r:i,Y="y"===C?"height":"width",V=P[C],$=V+E[q],N=V-E[R],K=g?-I[Y]/2:0,F=O===c?A[Y]:I[Y],Z=O===c?-I[Y]:-A[Y],G=t.elements.arrow,J=g&&G?W(G):{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[R],oe=X(0,A[Y],J[Y]),re=S?A[Y]/2-K-oe-te-D.mainAxis:F-oe-te-D.mainAxis,ie=S?-A[Y]/2+K+oe+ne+D.mainAxis:Z+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=V+ie-le,ue=X(g?H($,V+re-le-ae):$,V,g?j(N,ce):N);P[C]=ue,B[C]=ue-V}if(d){var fe,de="x"===C?o:s,pe="x"===C?r:i,he=P[L],me="y"===L?"height":"width",ve=he+E[de],ye=he-E[pe],we=-1!==[o,s].indexOf(x),be=null!=(fe=null==_?void 0:_[L])?fe:0,Ee=we?ve:he-A[me]-I[me]-be+D.altAxis,xe=we?he+A[me]+I[me]-be-D.altAxis:ye,Oe=g&&we?function(e,t,n){var o=X(e,t,n);return o>n?n:o}(Ee,he,xe):X(g?Ee:ve,he,g?xe:ye);P[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=R(e,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!n)&&(("body"!==P(t)||fe(a))&&(c=(o=t)!==A(o)&&T(o)?{scrollLeft:(r=o).scrollLeft,scrollTop:r.scrollTop}:ce(o)),T(t)?((u=R(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):a&&(u.x=ue(a))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.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 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}},961:(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={170:(e,t,n)=>{n.r(t),n.d(t,{afterMain:()=>E,afterRead:()=>w,afterWrite:()=>C,applyStyles:()=>_,arrow:()=>J,auto:()=>a,basePlacements:()=>l,beforeMain:()=>b,beforeRead:()=>y,beforeWrite:()=>O,bottom:()=>r,clippingParents:()=>f,computeStyles:()=>ne,createPopper:()=>_e,createPopperBase:()=>De,createPopperLite:()=>Me,detectOverflow:()=>ge,end:()=>u,eventListeners:()=>re,flip:()=>we,hide:()=>Ee,left:()=>s,main:()=>x,modifierPhases:()=>L,offset:()=>Oe,placements:()=>v,popper:()=>p,popperGenerator:()=>Te,popperOffsets:()=>Se,preventOverflow:()=>Ce,read:()=>g,reference:()=>h,right:()=>i,start:()=>c,top:()=>o,variationPlacements:()=>m,viewport:()=>d,write:()=>S});var o="top",r="bottom",i="right",s="left",a="auto",l=[o,r,i,s],c="start",u="end",f="clippingParents",d="viewport",p="popper",h="reference",m=l.reduce((function(e,t){return e.concat([t+"-"+c,t+"-"+u])}),[]),v=[].concat(l,[a]).reduce((function(e,t){return e.concat([t,t+"-"+c,t+"-"+u])}),[]),y="beforeRead",g="read",w="afterRead",b="beforeMain",x="main",E="afterMain",O="beforeWrite",S="write",C="afterWrite",L=[y,g,w,b,x,E,O,S,C];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 I(e){return e instanceof A(e).Element||e instanceof Element}function T(e){return e instanceof A(e).HTMLElement||e instanceof HTMLElement}function D(e){return"undefined"!=typeof ShadowRoot&&(e instanceof A(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)&&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}),{});T(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 j=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 q(){return!/^((?!chrome|android).)*safari/i.test(k())}function R(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)?A(e):window).visualViewport,a=!q()&&n,l=(o.left+(a&&s?s.offsetLeft:0))/r,c=(o.top+(a&&s?s.offsetTop:0))/i,u=o.width/r,f=o.height/i;return{width:u,height:f,top:c,right:l+u,bottom:c+f,left:l,x:l,y:c}}function W(e){var t=R(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 V(e){return A(e).getComputedStyle(e)}function $(e){return["table","td","th"].indexOf(P(e))>=0}function N(e){return((I(e)?e.ownerDocument:e.document)||window.document).documentElement}function K(e){return"html"===P(e)?e:e.assignedSlot||e.parentNode||(D(e)?e.host:null)||N(e)}function F(e){return T(e)&&"fixed"!==V(e).position?e.offsetParent:null}function U(e){for(var t=A(e),n=F(e);n&&$(n)&&"static"===V(n).position;)n=F(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())&&T(e)&&"fixed"===V(e).position)return null;var n=K(e);for(D(n)&&(n=n.host);T(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 z(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function X(e,t,n){return j(e,H(t,n))}function Z(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function G(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,u=n.elements.arrow,f=n.modifiersData.popperOffsets,d=M(n.placement),p=z(d),h=[s,i].indexOf(d)>=0?"height":"width";if(u&&f){var m=function(e,t){return Z("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:G(e,l))}(c.padding,n),v=W(u),y="y"===p?o:s,g="y"===p?r:i,w=n.rects.reference[h]+n.rects.reference[p]-f[p]-n.rects.popper[h],b=f[p]-n.rects.reference[p],x=U(u),E=x?"y"===p?x.clientHeight||0:x.clientWidth||0:0,O=w/2-b/2,S=m[y],C=E-v[h]-m[g],L=E/2-v[h]/2+O,P=X(S,L,C),A=p;n.modifiersData[a]=((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)))&&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,f=e.offsets,d=e.position,p=e.gpuAcceleration,h=e.adaptive,m=e.roundOffsets,v=e.isFixed,y=f.x,g=void 0===y?0:y,w=f.y,b=void 0===w?0:w,x="function"==typeof m?m({x:g,y:b}):{x:g,y:b};g=x.x,b=x.y;var E=f.hasOwnProperty("x"),O=f.hasOwnProperty("y"),S=s,C=o,L=window;if(h){var P=U(n),I="clientHeight",T="clientWidth";if(P===A(n)&&"static"!==V(P=N(n)).position&&"absolute"===d&&(I="scrollHeight",T="scrollWidth"),l===o||(l===s||l===i)&&c===u)C=r,b-=(v&&P===L&&L.visualViewport?L.visualViewport.height:P[I])-a.height,b*=p?1:-1;if(l===s||(l===o||l===r)&&c===u)S=i,g-=(v&&P===L&&L.visualViewport?L.visualViewport.width:P[T])-a.width,g*=p?1:-1}var D,_=Object.assign({position:d},h&&ee),M=!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:g,y:b},A(n)):{x:g,y:b};return g=M.x,b=M.y,p?Object.assign({},_,((D={})[C]=O?"0":"",D[S]=E?"0":"",D.transform=(L.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",D)):Object.assign({},_,((t={})[C]=O?b+"px":"",t[S]=E?g+"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:M(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=A(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=A(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ue(e){return R(N(e)).left+ce(e).scrollLeft}function fe(e){var t=V(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function de(e){return["html","body","#document"].indexOf(P(e))>=0?e.ownerDocument.body:T(e)&&fe(e)?e:de(K(e))}function pe(e,t){var n;void 0===t&&(t=[]);var o=de(e),r=o===(null==(n=e.ownerDocument)?void 0:n.body),i=A(o),s=r?[i].concat(i.visualViewport||[],fe(o)?o:[]):o,a=t.concat(s);return r?a:a.concat(pe(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===d?he(function(e,t){var n=A(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=q();(c||!c&&"fixed"===t)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:i,height:s,x:a+ue(e),y:l}}(e,n)):I(t)?function(e,t){var n=R(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=j(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=j(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-o.scrollLeft+ue(e),l=-o.scrollTop;return"rtl"===V(r||n).direction&&(a+=j(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=pe(K(e)),n=["absolute","fixed"].indexOf(V(e).position)>=0&&T(e)?U(e):e;return I(n)?t.filter((function(e){return I(e)&&Y(e,n)&&"body"!==P(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=j(r.top,t.top),t.right=H(r.right,t.right),t.bottom=H(r.bottom,t.bottom),t.left=j(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,f=l?M(l):null,d=l?Q(l):null,p=n.x+n.width/2-a.width/2,h=n.y+n.height/2-a.height/2;switch(f){case o:t={x:p,y:n.y-a.height};break;case r:t={x:p,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=f?z(f):null;if(null!=m){var v="y"===m?"height":"width";switch(d){case c:t[m]=t[m]-(n[v]/2-a[v]/2);break;case u:t[m]=t[m]+(n[v]/2-a[v]/2)}}return t}function ge(e,t){void 0===t&&(t={});var n=t,s=n.placement,a=void 0===s?e.placement:s,c=n.strategy,u=void 0===c?e.strategy:c,m=n.boundary,v=void 0===m?f:m,y=n.rootBoundary,g=void 0===y?d:y,w=n.elementContext,b=void 0===w?p:w,x=n.altBoundary,E=void 0!==x&&x,O=n.padding,S=void 0===O?0:O,C=Z("number"!=typeof S?S:G(S,l)),L=b===p?h:p,P=e.rects.popper,A=e.elements[E?L:b],T=ve(I(A)?A:A.contextElement||N(e.elements.popper),v,g,u),D=R(e.elements.reference),_=ye({reference:D,element:P,strategy:"absolute",placement:a}),M=he(Object.assign({},P,_)),j=b===p?M:D,H={top:T.top-j.top+C.top,bottom:j.bottom-T.bottom+C.bottom,left:T.left-j.left+C.left,right:j.right-T.right+C.right},B=e.modifiersData.offset;if(b===p&&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 we={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,u=e.name;if(!t.modifiersData[u]._skip){for(var f=n.mainAxis,d=void 0===f||f,p=n.altAxis,h=void 0===p||p,y=n.fallbackPlacements,g=n.padding,w=n.boundary,b=n.rootBoundary,x=n.altBoundary,E=n.flipVariations,O=void 0===E||E,S=n.allowedAutoPlacements,C=t.options.placement,L=M(C),P=y||(L===C||!O?[se(C)]:function(e){if(M(e)===a)return[];var t=se(e);return[le(e),t,le(t)]}(C)),A=[C].concat(P).reduce((function(e,n){return e.concat(M(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,u=void 0===c?v:c,f=Q(o),d=f?a?m:m.filter((function(e){return Q(e)===f})):l,p=d.filter((function(e){return u.indexOf(e)>=0}));0===p.length&&(p=d);var h=p.reduce((function(t,n){return t[n]=ge(e,{placement:n,boundary:r,rootBoundary:i,padding:s})[M(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}(t,{placement:n,boundary:w,rootBoundary:b,padding:g,flipVariations:O,allowedAutoPlacements:S}):n)}),[]),I=t.rects.reference,T=t.rects.popper,D=new Map,_=!0,j=A[0],H=0;H=0,W=R?"width":"height",Y=ge(t,{placement:B,boundary:w,rootBoundary:b,altBoundary:x,padding:g}),V=R?q?i:s:q?r:o;I[W]>T[W]&&(V=se(V));var $=se(V),N=[];if(d&&N.push(Y[k]<=0),h&&N.push(Y[V]<=0,Y[$]<=0),N.every((function(e){return e}))){j=B,_=!1;break}D.set(B,N)}if(_)for(var K=function(e){var t=A.find((function(t){var n=D.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return j=t,"break"},F=O?3:1;F>0;F--){if("break"===K(F))break}t.placement!==j&&(t.modifiersData[u]._skip=!0,t.placement=j,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 xe(e){return[o,i,r,s].some((function(t){return e[t]>=0}))}const Ee={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=ge(t,{elementContext:"reference"}),a=ge(t,{altBoundary:!0}),l=be(s,o),c=be(a,r,i),u=xe(l),f=xe(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}};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=M(e),a=[s,o].indexOf(r)>=0?-1:1,l="function"==typeof n?n(Object.assign({},t,{placement:e})):n,c=l[0],u=l[1];return c=c||0,u=(u||0)*a,[s,i].indexOf(r)>=0?{x:u,y:c}:{x:c,y:u}}(n,t.rects,l),e}),{}),u=c[t.placement],f=u.x,d=u.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=d),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,u=void 0===l||l,f=n.altAxis,d=void 0!==f&&f,p=n.boundary,h=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,x=ge(t,{boundary:p,rootBoundary:h,padding:v,altBoundary:m}),E=M(t.placement),O=Q(t.placement),S=!O,C=z(E),L="x"===C?"y":"x",P=t.modifiersData.popperOffsets,A=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(P){if(u){var k,q="y"===C?o:s,R="y"===C?r:i,Y="y"===C?"height":"width",V=P[C],$=V+x[q],N=V-x[R],K=g?-I[Y]/2:0,F=O===c?A[Y]:I[Y],Z=O===c?-I[Y]:-A[Y],G=t.elements.arrow,J=g&&G?W(G):{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[R],oe=X(0,A[Y],J[Y]),re=S?A[Y]/2-K-oe-te-D.mainAxis:F-oe-te-D.mainAxis,ie=S?-A[Y]/2+K+oe+ne+D.mainAxis:Z+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=V+ie-le,ue=X(g?H($,V+re-le-ae):$,V,g?j(N,ce):N);P[C]=ue,B[C]=ue-V}if(d){var fe,de="x"===C?o:s,pe="x"===C?r:i,he=P[L],me="y"===L?"height":"width",ve=he+x[de],ye=he-x[pe],we=-1!==[o,s].indexOf(E),be=null!=(fe=null==_?void 0:_[L])?fe:0,xe=we?ve:he-A[me]-I[me]-be+D.altAxis,Ee=we?he+A[me]+I[me]-be-D.altAxis:ye,Oe=g&&we?function(e,t,n){var o=X(e,t,n);return o>n?n:o}(xe,he,Ee):X(g?xe:ve,he,g?Ee:ye);P[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=R(e,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!n)&&(("body"!==P(t)||fe(a))&&(c=(o=t)!==A(o)&&T(o)?{scrollLeft:(r=o).scrollLeft,scrollTop:r.scrollTop}:ce(o)),T(t)?((u=R(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):a&&(u.x=ue(a))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.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 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={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},961:(e,t)=>{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},891:function(e,t,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSDropdown + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},891:function(e,t,n){ +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.querySelector(":scope > .hs-dropdown-toggle-wrapper > .hs-dropdown-toggle")||r.el.children[0],r.closers=Array.from(r.el.querySelectorAll(":scope .hs-dropdown-close"))||null,r.menu=r.el.querySelector(":scope > .hs-dropdown-menu"),r.eventMode=(0,a.getClassProperty)(r.el,"--trigger","click"),r.closeMode=(0,a.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&&this.buildToggle(),this.menu&&this.buildMenu(),this.closers&&this.buildClosers(),(0,a.isIOS)()||(0,a.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return e.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return e.onMouseLeaveHandler()})))},t.prototype.resizeHandler=function(){this.eventMode=(0,a.getClassProperty)(this.el,"--trigger","click"),this.closeMode=(0,a.getClassProperty)(this.el,"--auto-close","true")},t.prototype.buildToggle=function(){var e,t=this;(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.el.classList.contains("open")?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(e){return t.onClickHandler(e)}))},t.prototype.buildMenu=function(){this.menu.role="menu"},t.prototype.buildClosers=function(){var e=this;this.closers.forEach((function(t){t.addEventListener("click",(function(){return e.close()}))}))},t.prototype.onClickHandler=function(e){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}}]},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(" ","")),s=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ","");"static"!==o&&(this.el._popper=(0,l.createPopper)(this.el,this.menu,{placement:u.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]}},{name:"computeStyles",options:{adaptive:"fixed"===o,gpuAcceleration:"true"===s}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){var t;(null===(t=null==e?void 0:e.toggle)||void 0===t?void 0:t.ariaExpanded)&&(e.toggle.ariaExpanded="true"),e.el.classList.add("open"),e.animationInProcess=!1})),this.fireEvent("open",this.el),(0,a.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;var n;if(this.animationInProcess=!0,e){var o=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,a.afterTransition)(o,(function(){return t.destroyPopper()}))}else this.destroyPopper();t.menu.style.margin=null,(null===(n=null==t?void 0:t.toggle)||void 0===n?void 0:n.ariaExpanded)&&(t.toggle.ariaExpanded="false"),t.el.classList.remove("open"),t.fireEvent("close",t.el),(0,a.dispatch)("close.hs.dropdown",t.el,t.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=a.menuSearchHistory;var t=window.$hsDropdownCollection.find((function(e){return e.element.el.classList.contains("open")}));if(t&&(u.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")&&!t.element.menu.querySelector("textarea: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(),e.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":e.preventDefault(),e.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":e.preventDefault(),e.stopImmediatePropagation(),this.onStartEnd();break;case"End":e.preventDefault(),e.stopImmediatePropagation(),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+1 .hs-dropdown-toggle")||r.el.querySelector(":scope > .hs-dropdown-toggle-wrapper > .hs-dropdown-toggle")||r.el.children[0],r.closers=Array.from(r.el.querySelectorAll(":scope .hs-dropdown-close"))||null,r.menu=r.el.querySelector(":scope > .hs-dropdown-menu"),r.eventMode=(0,a.getClassProperty)(r.el,"--trigger","click"),r.closeMode=(0,a.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&&this.buildToggle(),this.menu&&this.buildMenu(),this.closers&&this.buildClosers(),(0,a.isIOS)()||(0,a.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return e.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return e.onMouseLeaveHandler()})))},t.prototype.resizeHandler=function(){this.eventMode=(0,a.getClassProperty)(this.el,"--trigger","click"),this.closeMode=(0,a.getClassProperty)(this.el,"--auto-close","true")},t.prototype.buildToggle=function(){var e,t=this;(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.el.classList.contains("open")?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(e){return t.onClickHandler(e)}))},t.prototype.buildMenu=function(){this.menu.role="menu"},t.prototype.buildClosers=function(){var e=this;this.closers.forEach((function(t){t.addEventListener("click",(function(){return e.close()}))}))},t.prototype.onClickHandler=function(e){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}}]},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(" ","")),s=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ","");"static"!==o&&(this.el._popper=(0,l.createPopper)(this.el,this.menu,{placement:u.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]}},{name:"computeStyles",options:{adaptive:"fixed"===o,gpuAcceleration:"true"===s}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){var t;(null===(t=null==e?void 0:e.toggle)||void 0===t?void 0:t.ariaExpanded)&&(e.toggle.ariaExpanded="true"),e.el.classList.add("open"),e.animationInProcess=!1})),this.fireEvent("open",this.el),(0,a.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;var n;if(this.animationInProcess=!0,e){var o=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,a.afterTransition)(o,(function(){return t.destroyPopper()}))}else this.destroyPopper();t.menu.style.margin=null,(null===(n=null==t?void 0:t.toggle)||void 0===n?void 0:n.ariaExpanded)&&(t.toggle.ariaExpanded="false"),t.el.classList.remove("open"),t.fireEvent("close",t.el),(0,a.dispatch)("close.hs.dropdown",t.el,t.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=a.menuSearchHistory;var t=window.$hsDropdownCollection.find((function(e){return e.element.el.classList.contains("open")}));if(t&&(u.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")&&!t.element.menu.querySelector("textarea: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(),e.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":e.preventDefault(),e.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":e.preventDefault(),e.stopImmediatePropagation(),this.onStartEnd();break;case"End":e.preventDefault(),e.stopImmediatePropagation(),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+1t&&(t=n)})),t};t.stringToBoolean=function(e){return"true"===e};t.getClassProperty=function(e,t,n){return void 0===n&&(n=""),(window.getComputedStyle(e).getPropertyValue(t)||n).replace(" ","")};t.getClassPropertyAlt=function(e,t,n){void 0===n&&(n="");var o="";return e.classList.forEach((function(e){e.includes(t)&&(o=e)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};var o=function(e){return window.getComputedStyle(e).getPropertyValue("z-index")};t.getZIndex=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,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,u=e.clientHeight+o;return"bottom"===n?c>=u:"top"===n?l>=u:l>=u||c>=u};t.isFormElement=function(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement};var r=function(e){return!!e&&("none"===window.getComputedStyle(e).display||r(e.parentElement))};t.isParentOrElementHidden=r;t.debounce=function(e,t){var o;return void 0===t&&(t=200),function(){for(var r=[],i=0;i0?e.addEventListener("transitionend",n,!0):t()};t.htmlToElement=function(e){var t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild};t.classToClassList=function(e,t,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),e.split(n).forEach((function(e){return"add"===o?t.classList.add(e):t.classList.remove(e)}))};t.menuSearchHistory={historyIndex:-1,addHistory:function(e){this.historyIndex=e},existsInHistory:function(e){return e>this.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(891)})())); \ No newline at end of file +var n=this;Object.defineProperty(t,"__esModule",{value:!0}),t.menuSearchHistory=t.classToClassList=t.htmlToElement=t.afterTransition=t.dispatch=t.debounce=t.isDirectChild=t.isFormElement=t.isParentOrElementHidden=t.isEnoughSpace=t.isIpadOS=t.isIOS=t.getZIndex=t.getClassPropertyAlt=t.getClassProperty=t.stringToBoolean=void 0,t.getHighestZIndex=function(e){var t=Number.NEGATIVE_INFINITY;return e.forEach((function(e){var n=o(e);"auto"!==n&&(n=parseInt(n,10))>t&&(t=n)})),t};t.stringToBoolean=function(e){return"true"===e};t.getClassProperty=function(e,t,n){return void 0===n&&(n=""),(window.getComputedStyle(e).getPropertyValue(t)||n).replace(" ","")};t.getClassPropertyAlt=function(e,t,n){void 0===n&&(n="");var o="";return e.classList.forEach((function(e){e.includes(t)&&(o=e)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};var o=function(e){return window.getComputedStyle(e).getPropertyValue("z-index")};t.getZIndex=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.isDirectChild=function(e,t){for(var n=e.children,o=0;o=u:"top"===n?l>=u:l>=u||c>=u};t.isFormElement=function(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement};var r=function(e){return!!e&&("none"===window.getComputedStyle(e).display||r(e.parentElement))};t.isParentOrElementHidden=r;t.debounce=function(e,t){var o;return void 0===t&&(t=200),function(){for(var r=[],i=0;i0?e.addEventListener("transitionend",n,!0):t()};t.htmlToElement=function(e){var t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild};t.classToClassList=function(e,t,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),e.split(n).forEach((function(e){return"add"===o?t.classList.add(e):t.classList.remove(e)}))};t.menuSearchHistory={historyIndex:-1,addHistory:function(e){this.historyIndex=e},existsInHistory:function(e){return e>this.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(891)})())); \ No newline at end of file diff --git a/dist/dropdown.mjs b/dist/dropdown.mjs new file mode 100644 index 0000000..ed0a101 --- /dev/null +++ b/dist/dropdown.mjs @@ -0,0 +1,16 @@ +var e={316:(e,t,n)=>{function o(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function r(e){return e instanceof o(e).Element||e instanceof Element}function i(e){return e instanceof o(e).HTMLElement||e instanceof HTMLElement}function s(e){return"undefined"!=typeof ShadowRoot&&(e instanceof o(e).ShadowRoot||e instanceof ShadowRoot)}n.d(t,{n4:()=>ve});var a=Math.max,l=Math.min,c=Math.round;function d(){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 p(){return!/^((?!chrome|android).)*safari/i.test(d())}function f(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var s=e.getBoundingClientRect(),a=1,l=1;t&&i(e)&&(a=e.offsetWidth>0&&c(s.width)/e.offsetWidth||1,l=e.offsetHeight>0&&c(s.height)/e.offsetHeight||1);var d=(r(e)?o(e):window).visualViewport,f=!p()&&n,u=(s.left+(f&&d?d.offsetLeft:0))/a,h=(s.top+(f&&d?d.offsetTop:0))/l,m=s.width/a,v=s.height/l;return{width:m,height:v,top:h,right:u+m,bottom:h+v,left:u,x:u,y:h}}function u(e){var t=o(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function h(e){return e?(e.nodeName||"").toLowerCase():null}function m(e){return((r(e)?e.ownerDocument:e.document)||window.document).documentElement}function v(e){return f(m(e)).left+u(e).scrollLeft}function g(e){return o(e).getComputedStyle(e)}function y(e){var t=g(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function w(e,t,n){void 0===n&&(n=!1);var r,s,a=i(t),l=i(t)&&function(e){var t=e.getBoundingClientRect(),n=c(t.width)/e.offsetWidth||1,o=c(t.height)/e.offsetHeight||1;return 1!==n||1!==o}(t),d=m(t),p=f(e,l,n),g={scrollLeft:0,scrollTop:0},w={x:0,y:0};return(a||!a&&!n)&&(("body"!==h(t)||y(d))&&(g=(r=t)!==o(r)&&i(r)?{scrollLeft:(s=r).scrollLeft,scrollTop:s.scrollTop}:u(r)),i(t)?((w=f(t,!0)).x+=t.clientLeft,w.y+=t.clientTop):d&&(w.x=v(d))),{x:p.left+g.scrollLeft-w.x,y:p.top+g.scrollTop-w.y,width:p.width,height:p.height}}function b(e){var t=f(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 x(e){return"html"===h(e)?e:e.assignedSlot||e.parentNode||(s(e)?e.host:null)||m(e)}function O(e){return["html","body","#document"].indexOf(h(e))>=0?e.ownerDocument.body:i(e)&&y(e)?e:O(x(e))}function E(e,t){var n;void 0===t&&(t=[]);var r=O(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),s=o(r),a=i?[s].concat(s.visualViewport||[],y(r)?r:[]):r,l=t.concat(a);return i?l:l.concat(E(x(a)))}function D(e){return["table","td","th"].indexOf(h(e))>=0}function L(e){return i(e)&&"fixed"!==g(e).position?e.offsetParent:null}function C(e){for(var t=o(e),n=L(e);n&&D(n)&&"static"===g(n).position;)n=L(n);return n&&("html"===h(n)||"body"===h(n)&&"static"===g(n).position)?t:n||function(e){var t=/firefox/i.test(d());if(/Trident/i.test(d())&&i(e)&&"fixed"===g(e).position)return null;var n=x(e);for(s(n)&&(n=n.host);i(n)&&["html","body"].indexOf(h(n))<0;){var o=g(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}var P="top",A="bottom",S="right",j="left",M="auto",k=[P,A,S,j],H="start",I="end",q="clippingParents",T="viewport",W="popper",$="reference",V=k.reduce((function(e,t){return e.concat([t+"-"+H,t+"-"+I])}),[]),B=[].concat(k,[M]).reduce((function(e,t){return e.concat([t,t+"-"+H,t+"-"+I])}),[]),R=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function z(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 F={placement:"bottom",modifiers:[],strategy:"absolute"};function N(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function Y(e){var t,n=e.reference,o=e.element,r=e.placement,i=r?J(r):null,s=r?G(r):null,a=n.x+n.width/2-o.width/2,l=n.y+n.height/2-o.height/2;switch(i){case P:t={x:a,y:n.y-o.height};break;case A:t={x:a,y:n.y+n.height};break;case S:t={x:n.x+n.width,y:l};break;case j:t={x:n.x-o.width,y:l};break;default:t={x:n.x,y:n.y}}var c=i?X(i):null;if(null!=c){var d="y"===c?"height":"width";switch(s){case H:t[c]=t[c]-(n[d]/2-o[d]/2);break;case I:t[c]=t[c]+(n[d]/2-o[d]/2)}}return t}var K={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Z(e){var t,n=e.popper,r=e.popperRect,i=e.placement,s=e.variation,a=e.offsets,l=e.position,d=e.gpuAcceleration,p=e.adaptive,f=e.roundOffsets,u=e.isFixed,h=a.x,v=void 0===h?0:h,y=a.y,w=void 0===y?0:y,b="function"==typeof f?f({x:v,y:w}):{x:v,y:w};v=b.x,w=b.y;var x=a.hasOwnProperty("x"),O=a.hasOwnProperty("y"),E=j,D=P,L=window;if(p){var M=C(n),k="clientHeight",H="clientWidth";if(M===o(n)&&"static"!==g(M=m(n)).position&&"absolute"===l&&(k="scrollHeight",H="scrollWidth"),i===P||(i===j||i===S)&&s===I)D=A,w-=(u&&M===L&&L.visualViewport?L.visualViewport.height:M[k])-r.height,w*=d?1:-1;if(i===j||(i===P||i===A)&&s===I)E=S,v-=(u&&M===L&&L.visualViewport?L.visualViewport.width:M[H])-r.width,v*=d?1:-1}var q,T=Object.assign({position:l},p&&K),W=!0===f?function(e,t){var n=e.x,o=e.y,r=t.devicePixelRatio||1;return{x:c(n*r)/r||0,y:c(o*r)/r||0}}({x:v,y:w},o(n)):{x:v,y:w};return v=W.x,w=W.y,d?Object.assign({},T,((q={})[D]=O?"0":"",q[E]=x?"0":"",q.transform=(L.devicePixelRatio||1)<=1?"translate("+v+"px, "+w+"px)":"translate3d("+v+"px, "+w+"px, 0)",q)):Object.assign({},T,((t={})[D]=O?w+"px":"",t[E]=x?v+"px":"",t.transform="",t))}const Q={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,o=e.name,r=n.offset,i=void 0===r?[0,0]:r,s=B.reduce((function(e,n){return e[n]=function(e,t,n){var o=J(e),r=[j,P].indexOf(o)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*r,[j,S].indexOf(o)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,i),e}),{}),a=s[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[o]=s}};var ee={left:"right",right:"left",bottom:"top",top:"bottom"};function te(e){return e.replace(/left|right|bottom|top/g,(function(e){return ee[e]}))}var ne={start:"end",end:"start"};function oe(e){return e.replace(/start|end/g,(function(e){return ne[e]}))}function re(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&s(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function ie(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function se(e,t,n){return t===T?ie(function(e,t){var n=o(e),r=m(e),i=n.visualViewport,s=r.clientWidth,a=r.clientHeight,l=0,c=0;if(i){s=i.width,a=i.height;var d=p();(d||!d&&"fixed"===t)&&(l=i.offsetLeft,c=i.offsetTop)}return{width:s,height:a,x:l+v(e),y:c}}(e,n)):r(t)?function(e,t){var n=f(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):ie(function(e){var t,n=m(e),o=u(e),r=null==(t=e.ownerDocument)?void 0:t.body,i=a(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=a(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-o.scrollLeft+v(e),c=-o.scrollTop;return"rtl"===g(r||n).direction&&(l+=a(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:s,x:l,y:c}}(m(e)))}function ae(e,t,n,o){var s="clippingParents"===t?function(e){var t=E(x(e)),n=["absolute","fixed"].indexOf(g(e).position)>=0&&i(e)?C(e):e;return r(n)?t.filter((function(e){return r(e)&&re(e,n)&&"body"!==h(e)})):[]}(e):[].concat(t),c=[].concat(s,[n]),d=c[0],p=c.reduce((function(t,n){var r=se(e,n,o);return t.top=a(r.top,t.top),t.right=l(r.right,t.right),t.bottom=l(r.bottom,t.bottom),t.left=a(r.left,t.left),t}),se(e,d,o));return p.width=p.right-p.left,p.height=p.bottom-p.top,p.x=p.left,p.y=p.top,p}function le(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function ce(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function de(e,t){void 0===t&&(t={});var n=t,o=n.placement,i=void 0===o?e.placement:o,s=n.strategy,a=void 0===s?e.strategy:s,l=n.boundary,c=void 0===l?q:l,d=n.rootBoundary,p=void 0===d?T:d,u=n.elementContext,h=void 0===u?W:u,v=n.altBoundary,g=void 0!==v&&v,y=n.padding,w=void 0===y?0:y,b=le("number"!=typeof w?w:ce(w,k)),x=h===W?$:W,O=e.rects.popper,E=e.elements[g?x:h],D=ae(r(E)?E:E.contextElement||m(e.elements.popper),c,p,a),L=f(e.elements.reference),C=Y({reference:L,element:O,strategy:"absolute",placement:i}),j=ie(Object.assign({},O,C)),M=h===W?j:L,H={top:D.top-M.top+b.top,bottom:M.bottom-D.bottom+b.bottom,left:D.left-M.left+b.left,right:M.right-D.right+b.right},I=e.modifiersData.offset;if(h===W&&I){var V=I[i];Object.keys(H).forEach((function(e){var t=[S,A].indexOf(e)>=0?1:-1,n=[P,A].indexOf(e)>=0?"y":"x";H[e]+=V[n]*t}))}return H}function pe(e,t,n){return a(e,l(t,n))}const fe={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name,r=n.mainAxis,i=void 0===r||r,s=n.altAxis,c=void 0!==s&&s,d=n.boundary,p=n.rootBoundary,f=n.altBoundary,u=n.padding,h=n.tether,m=void 0===h||h,v=n.tetherOffset,g=void 0===v?0:v,y=de(t,{boundary:d,rootBoundary:p,padding:u,altBoundary:f}),w=J(t.placement),x=G(t.placement),O=!x,E=X(w),D="x"===E?"y":"x",L=t.modifiersData.popperOffsets,M=t.rects.reference,k=t.rects.popper,I="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,q="number"==typeof I?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,W={x:0,y:0};if(L){if(i){var $,V="y"===E?P:j,B="y"===E?A:S,R="y"===E?"height":"width",z=L[E],F=z+y[V],N=z-y[B],_=m?-k[R]/2:0,U=x===H?M[R]:k[R],Y=x===H?-k[R]:-M[R],K=t.elements.arrow,Z=m&&K?b(K):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},ee=Q[V],te=Q[B],ne=pe(0,M[R],Z[R]),oe=O?M[R]/2-_-ne-ee-q.mainAxis:U-ne-ee-q.mainAxis,re=O?-M[R]/2+_+ne+te+q.mainAxis:Y+ne+te+q.mainAxis,ie=t.elements.arrow&&C(t.elements.arrow),se=ie?"y"===E?ie.clientTop||0:ie.clientLeft||0:0,ae=null!=($=null==T?void 0:T[E])?$:0,le=z+re-ae,ce=pe(m?l(F,z+oe-ae-se):F,z,m?a(N,le):N);L[E]=ce,W[E]=ce-z}if(c){var fe,ue="x"===E?P:j,he="x"===E?A:S,me=L[D],ve="y"===D?"height":"width",ge=me+y[ue],ye=me-y[he],we=-1!==[P,j].indexOf(w),be=null!=(fe=null==T?void 0:T[D])?fe:0,xe=we?ge:me-M[ve]-k[ve]-be+q.altAxis,Oe=we?me+M[ve]+k[ve]-be-q.altAxis:ye,Ee=m&&we?function(e,t,n){var o=pe(e,t,n);return o>n?n:o}(xe,me,Oe):pe(m?xe:ge,me,m?Oe:ye);L[D]=Ee,W[D]=Ee-me}t.modifiersData[o]=W}},requiresIfExists:["offset"]};const ue={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,o=e.name,r=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=J(n.placement),l=X(a),c=[j,S].indexOf(a)>=0?"height":"width";if(i&&s){var d=function(e,t){return le("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:ce(e,k))}(r.padding,n),p=b(i),f="y"===l?P:j,u="y"===l?A:S,h=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],m=s[l]-n.rects.reference[l],v=C(i),g=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,y=h/2-m/2,w=d[f],x=g-p[c]-d[u],O=g/2-p[c]/2+y,E=pe(w,O,x),D=l;n.modifiersData[o]=((t={})[D]=E,t.centerOffset=E-O,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)))&&re(t.elements.popper,o)&&(t.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function he(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 me(e){return[P,S,A,j].some((function(t){return e[t]>=0}))}var ve=_({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,s=void 0===i||i,a=r.resize,l=void 0===a||a,c=o(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&d.forEach((function(e){e.addEventListener("scroll",n.update,U)})),l&&c.addEventListener("resize",n.update,U),function(){s&&d.forEach((function(e){e.removeEventListener("scroll",n.update,U)})),l&&c.removeEventListener("resize",n.update,U)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Y({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{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:G(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,Z(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,Z(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:{}},{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)&&h(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]||{},s=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});i(o)&&h(o)&&(Object.assign(o.style,s),Object.keys(r).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]},Q,{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var r=n.mainAxis,i=void 0===r||r,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,d=n.boundary,p=n.rootBoundary,f=n.altBoundary,u=n.flipVariations,h=void 0===u||u,m=n.allowedAutoPlacements,v=t.options.placement,g=J(v),y=l||(g===v||!h?[te(v)]:function(e){if(J(e)===M)return[];var t=te(e);return[oe(e),t,oe(t)]}(v)),w=[v].concat(y).reduce((function(e,n){return e.concat(J(n)===M?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,l=n.allowedAutoPlacements,c=void 0===l?B:l,d=G(o),p=d?a?V:V.filter((function(e){return G(e)===d})):k,f=p.filter((function(e){return c.indexOf(e)>=0}));0===f.length&&(f=p);var u=f.reduce((function(t,n){return t[n]=de(e,{placement:n,boundary:r,rootBoundary:i,padding:s})[J(n)],t}),{});return Object.keys(u).sort((function(e,t){return u[e]-u[t]}))}(t,{placement:n,boundary:d,rootBoundary:p,padding:c,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),b=t.rects.reference,x=t.rects.popper,O=new Map,E=!0,D=w[0],L=0;L=0,W=T?"width":"height",$=de(t,{placement:C,boundary:d,rootBoundary:p,altBoundary:f,padding:c}),R=T?q?S:j:q?A:P;b[W]>x[W]&&(R=te(R));var z=te(R),F=[];if(i&&F.push($[I]<=0),a&&F.push($[R]<=0,$[z]<=0),F.every((function(e){return e}))){D=C,E=!1;break}O.set(C,F)}if(E)for(var N=function(e){var t=w.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return D=t,"break"},_=h?3:1;_>0;_--){if("break"===N(_))break}t.placement!==D&&(t.modifiersData[o]._skip=!0,t.placement=D,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},fe,ue,{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=de(t,{elementContext:"reference"}),a=de(t,{altBoundary:!0}),l=he(s,o),c=he(a,r,i),d=me(l),p=me(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}}]})},189:(e,t,n)=>{n.d(t,{In:()=>r,lP:()=>o});const o={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"},r=["Escape","ArrowUp","ArrowDown","Home","End","Enter"]},615:(e,t,n)=>{n.d(t,{A:()=>o});class o{constructor(e,t,n){this.el=e,this.options=t,this.events=n,this.el=e,this.options=t,this.events={}}createCollection(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})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},926:(e,t,n)=>{n.d(t,{BF:()=>r,IM:()=>c,JD:()=>a,gj:()=>o,un:()=>i,yd:()=>l,zG:()=>s}); +/* + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +const o=(e,t,n="")=>(window.getComputedStyle(e).getPropertyValue(t)||n).replace(" ",""),r=(e,t,n="")=>{let o="";return e.classList.forEach((e=>{e.includes(t)&&(o=e)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};const i=()=>!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),s=()=>navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),a=(e,t,n=null)=>{const o=new CustomEvent(e,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(o)},l=(e,t)=>{const n=()=>{t(),e.removeEventListener("transitionend",n,!0)},o=window.getComputedStyle(e),r=o.getPropertyValue("transition-duration");"none"!==o.getPropertyValue("transition-property")&&parseFloat(r)>0?e.addEventListener("transitionend",n,!0):t()},c={historyIndex:-1,addHistory(e){this.historyIndex=e},existsInHistory(e){return e>this.historyIndex},clearHistory(){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](i,i.exports,n),i.exports}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);var o={};n.d(o,{A:()=>c});var r=n(926),i=n(316),s=n(615),a=n(189); +/* + * HSDropdown + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class l extends s.A{constructor(e,t,n){super(e,t,n),this.toggle=this.el.querySelector(":scope > .hs-dropdown-toggle")||this.el.querySelector(":scope > .hs-dropdown-toggle-wrapper > .hs-dropdown-toggle")||this.el.children[0],this.closers=Array.from(this.el.querySelectorAll(":scope .hs-dropdown-close"))||null,this.menu=this.el.querySelector(":scope > .hs-dropdown-menu"),this.eventMode=(0,r.gj)(this.el,"--trigger","click"),this.closeMode=(0,r.gj)(this.el,"--auto-close","true"),this.animationInProcess=!1,this.toggle&&this.menu&&this.init()}init(){if(this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle&&this.buildToggle(),this.menu&&this.buildMenu(),this.closers&&this.buildClosers(),(0,r.un)()||(0,r.zG)()||(this.el.addEventListener("mouseenter",(()=>this.onMouseEnterHandler())),this.el.addEventListener("mouseleave",(()=>this.onMouseLeaveHandler())))}resizeHandler(){this.eventMode=(0,r.gj)(this.el,"--trigger","click"),this.closeMode=(0,r.gj)(this.el,"--auto-close","true")}buildToggle(){var e;(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.el.classList.contains("open")?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(e=>this.onClickHandler(e)))}buildMenu(){this.menu.role="menu"}buildClosers(){this.closers.forEach((e=>{e.addEventListener("click",(()=>this.close()))}))}onClickHandler(e){this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?this.close():this.open()}onMouseEnterHandler(){if("hover"!==this.eventMode)return!1;this.el._popper&&this.forceClearState(),!this.el.classList.contains("open")&&this.menu.classList.contains("hidden")&&this.open()}onMouseLeaveHandler(){if("hover"!==this.eventMode)return!1;this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")&&this.close()}destroyPopper(){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}absoluteStrategyModifiers(){return[{name:"applyStyles",fn:e=>{const t=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"absolute").replace(" ",""),n=(window.getComputedStyle(this.el).getPropertyValue("--adaptive")||"adaptive").replace(" ","");e.state.elements.popper.style.position=t,e.state.elements.popper.style.transform="adaptive"===n?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}}]}open(){if(this.el.classList.contains("open"))return!1;if(this.animationInProcess)return!1;this.animationInProcess=!0;const e=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),t=(window.getComputedStyle(this.el).getPropertyValue("--flip")||"true").replace(" ",""),n=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),o=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ","")),s=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ","");"static"!==n&&(this.el._popper=(0,i.n4)(this.el,this.menu,{placement:a.lP[e]||"bottom-start",strategy:n,modifiers:[..."fixed"!==n?this.absoluteStrategyModifiers():[],{name:"flip",enabled:"true"===t},{name:"offset",options:{offset:[0,o]}},{name:"computeStyles",options:{adaptive:"fixed"===n,gpuAcceleration:"true"===s}}]})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((()=>{var e;(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.el.classList.add("open"),this.animationInProcess=!1})),this.fireEvent("open",this.el),(0,r.JD)("open.hs.dropdown",this.el,this.el)}close(e=!0){if(this.animationInProcess||!this.el.classList.contains("open"))return!1;if(this.animationInProcess=!0,e){const e=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,r.yd)(e,(()=>this.destroyPopper()))}else this.destroyPopper();(()=>{var e;this.menu.style.margin=null,(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.el.classList.remove("open"),this.fireEvent("close",this.el),(0,r.JD)("close.hs.dropdown",this.el,this.el)})()}forceClearState(){this.destroyPopper(),this.menu.style.margin=null,this.el.classList.remove("open")}static getInstance(e,t){const n=window.$hsDropdownCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return n?t?n:n.element.el:null}static autoInit(){if(window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),document.querySelectorAll(".hs-dropdown:not(.--prevent-on-load-init)").forEach((e=>{window.$hsDropdownCollection.find((t=>{var n;return(null===(n=null==t?void 0:t.element)||void 0===n?void 0:n.el)===e}))||new l(e)})),window.$hsDropdownCollection){document.addEventListener("keydown",(e=>l.accessibility(e))),window.addEventListener("click",(e=>{const t=e.target;l.closeCurrentlyOpened(t)}));let e=window.innerWidth;window.addEventListener("resize",(()=>{window.innerWidth!==e&&(e=innerWidth,l.closeCurrentlyOpened(null,!1))}))}}static open(e){const t=window.$hsDropdownCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));t&&t.element.menu.classList.contains("hidden")&&t.element.open()}static close(e){const t=window.$hsDropdownCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));t&&!t.element.menu.classList.contains("hidden")&&t.element.close()}static accessibility(e){this.history=r.IM;const t=window.$hsDropdownCollection.find((e=>e.element.el.classList.contains("open")));if(t&&(a.In.includes(e.code)||4===e.code.length&&e.code[e.code.length-1].match(/^[A-Z]*$/))&&!e.metaKey&&!t.element.menu.querySelector("input:focus")&&!t.element.menu.querySelector("textarea: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(),e.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":e.preventDefault(),e.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":e.preventDefault(),e.stopImmediatePropagation(),this.onStartEnd();break;case"End":e.preventDefault(),e.stopImmediatePropagation(),this.onStartEnd(!1);break;default:e.preventDefault(),this.onFirstLetter(e.key)}}static onEscape(e){const t=e.target.closest(".hs-dropdown.open");if(window.$hsDropdownCollection.find((e=>e.element.el===t))){const e=window.$hsDropdownCollection.find((e=>e.element.el===t));e&&(e.element.close(),e.element.toggle.focus())}else this.closeCurrentlyOpened()}static onEnter(e){const t=e.target.parentElement;if(window.$hsDropdownCollection.find((e=>e.element.el===t))){e.preventDefault();const n=window.$hsDropdownCollection.find((e=>e.element.el===t));n&&n.element.open()}}static onArrow(e=!0){const t=window.$hsDropdownCollection.find((e=>e.element.el.classList.contains("open")));if(t){const n=t.element.menu;if(!n)return!1;const 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((e=>!e.classList.contains("disabled"))),r=n.querySelector("a:focus, button:focus");let i=o.findIndex((e=>e===r));i+1e.element.el.classList.contains("open")));if(t){const n=t.element.menu;if(!n)return!1;const o=(e?Array.from(n.querySelectorAll("a")):Array.from(n.querySelectorAll("a")).reverse()).filter((e=>!e.classList.contains("disabled")));o.length&&o[0].focus()}}static onFirstLetter(e){const t=window.$hsDropdownCollection.find((e=>e.element.el.classList.contains("open")));if(t){const n=t.element.menu;if(!n)return!1;const o=Array.from(n.querySelectorAll("a")),r=()=>o.findIndex(((t,n)=>t.innerText.toLowerCase().charAt(0)===e.toLowerCase()&&this.history.existsInHistory(n)));let i=r();-1===i&&(this.history.clearHistory(),i=r()),-1!==i&&(o[i].focus(),this.history.addHistory(i))}}static closeCurrentlyOpened(e=null,t=!0){const n=e&&e.closest(".hs-dropdown")&&e.closest(".hs-dropdown").parentElement.closest(".hs-dropdown")?e.closest(".hs-dropdown").parentElement.closest(".hs-dropdown"):null;let o=n?window.$hsDropdownCollection.filter((e=>e.element.el.classList.contains("open")&&e.element.menu.closest(".hs-dropdown").parentElement.closest(".hs-dropdown")===n)):window.$hsDropdownCollection.filter((e=>e.element.el.classList.contains("open")));e&&e.closest(".hs-dropdown")&&"inside"===(0,r.BF)(e.closest(".hs-dropdown"),"--auto-close")&&(o=o.filter((t=>t.element.el!==e.closest(".hs-dropdown")))),o&&o.forEach((e=>{if("false"===e.element.closeMode||"outside"===e.element.closeMode)return!1;e.element.close(t)}))}static on(e,t,n){const o=window.$hsDropdownCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));o&&(o.element.events[e]=n)}}window.addEventListener("load",(()=>{l.autoInit()})),window.addEventListener("resize",(()=>{window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),window.$hsDropdownCollection.forEach((e=>e.element.resizeHandler()))})),"undefined"!=typeof window&&(window.HSDropdown=l);const c=l;var d=o.A;export{d as default}; \ No newline at end of file diff --git a/dist/file-upload.d.ts b/dist/file-upload.d.ts index 32b4d95..4fbaae6 100644 --- a/dist/file-upload.d.ts +++ b/dist/file-upload.d.ts @@ -31,7 +31,7 @@ declare class HSFileUpload extends HSBasePlugin implements I private previewTemplate; private extensions; private singleton; - private dropzone; + dropzone: Dropzone | null; constructor(el: HTMLElement, options?: IFileUploadOptions, events?: {}); private init; private initDropzone; diff --git a/dist/file-upload.js b/dist/file-upload.js index 473a4e1..6921cc9 100644 --- a/dist/file-upload.js +++ b/dist/file-upload.js @@ -1,17 +1,16 @@ -!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={961:(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={961:(t,e)=>{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},234:function(t,e,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSFileUpload + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},234: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\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t.\n\t\t\t\t\t\t

\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t0%\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t',l.extensions=_.merge({default:{icon:'',class:"size-5"},xls:{icon:'',class:"size-5"},doc:{icon:'',class:"size-5"},zip:{icon:'',class:"size-5"}},s.extensions),l.singleton=s.singleton,l.concatOptions=r(r({clickable:l.el.querySelector("[data-hs-file-upload-trigger]"),previewsContainer:l.el.querySelector("[data-hs-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:l.previewTemplate,autoHideTrigger:!1},s),n),l.init(),l}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsFileUploadCollection,this),this.initDropzone()},e.prototype.initDropzone=function(){var t=this,e=this.el.querySelector("[data-hs-file-upload-clear]"),n=Array.from(this.el.querySelectorAll("[data-hs-file-upload-pseudo-trigger]"));this.dropzone=new Dropzone(this.el,this.concatOptions),this.dropzone.on("addedfile",(function(e){return t.onAddFile(e)})),this.dropzone.on("removedfile",(function(){return t.onRemoveFile()})),this.dropzone.on("uploadprogress",(function(e,n){return t.onUploadProgress(e,n)})),this.dropzone.on("complete",(function(e){return t.onComplete(e)})),e&&(e.onclick=function(){t.dropzone.files.length&&t.dropzone.removeAllFiles(!0)}),n.length&&n.forEach((function(e){e.onclick=function(){var e,n;(null===(e=t.concatOptions)||void 0===e?void 0:e.clickable)&&(null===(n=t.concatOptions)||void 0===n?void 0:n.clickable).click()}}))},e.prototype.onAddFile=function(t){var e=this,n=t.previewElement,o=t.previewElement.querySelector("[data-hs-file-upload-reload]");if(!n)return!1;this.singleton&&this.dropzone.files.length>1&&this.dropzone.removeFile(this.dropzone.files[0]),o&&o.addEventListener("click",(function(n){n.preventDefault(),n.stopPropagation();var o=document.createElement("input");o.type="file",o.click(),o.addEventListener("change",(function(n){var o,i=null===(o=n.target.files)||void 0===o?void 0:o[0];if(i){var r=i;r.status=Dropzone.ADDED,r.accepted=!0,r.previewElement=t.previewElement,r.previewTemplate=t.previewTemplate,r.previewsContainer=t.previewsContainer,e.dropzone.removeFile(t),e.dropzone.addFile(r)}}))})),this.previewAccepted(t)},e.prototype.previewAccepted=function(t){var e=this,n=t.previewElement,o=this.splitFileName(t.name),i=n.querySelector("[data-hs-file-upload-file-name]"),r=n.querySelector("[data-hs-file-upload-file-ext]"),l=n.querySelector("[data-hs-file-upload-file-size]"),a=n.querySelector("[data-hs-file-upload-file-icon]"),s=this.el.querySelector("[data-hs-file-upload-trigger]"),d=n.querySelector("[data-dz-thumbnail]"),p=n.querySelector("[data-hs-file-upload-remove]");i&&(i.textContent=o.name),r&&(r.textContent=o.extension),l&&(l.textContent=this.formatFileSize(t.size)),d&&(t.type.includes("image/")?d.classList.remove("hidden"):this.setIcon(o.extension,a)),this.dropzone.files.length>0&&this.concatOptions.autoHideTrigger&&(s.style.display="none"),p&&(p.onclick=function(){return e.dropzone.removeFile(t)})},e.prototype.onRemoveFile=function(){var t=this.el.querySelector("[data-hs-file-upload-trigger]");0===this.dropzone.files.length&&this.concatOptions.autoHideTrigger&&(t.style.display="")},e.prototype.onUploadProgress=function(t,e){var n=t.previewElement;if(!n)return!1;var o=n.querySelector("[data-hs-file-upload-progress-bar]"),i=n.querySelector("[data-hs-file-upload-progress-bar-pane]"),r=n.querySelector("[data-hs-file-upload-progress-bar-value]"),l=Math.floor(e);o&&o.setAttribute("aria-valuenow","".concat(l)),i&&(i.style.width="".concat(l,"%")),r&&(r.innerText="".concat(l))},e.prototype.onComplete=function(t){var e=t.previewElement;if(!e)return!1;e.classList.add("complete")},e.prototype.setIcon=function(t,e){var n=this.createIcon(t);e.append(n)},e.prototype.createIcon=function(t){var e,n,o=(null===(e=this.extensions[t])||void 0===e?void 0:e.icon)?(0,a.htmlToElement)(this.extensions[t].icon):(0,a.htmlToElement)(this.extensions.default.icon);return(0,a.classToClassList)((null===(n=this.extensions[t])||void 0===n?void 0:n.class)?this.extensions[t].class:this.extensions.default.class,o),o},e.prototype.formatFileSize=function(t){return t<1024?t.toFixed(2)+" B":t<1048576?(t/1024).toFixed(2)+" KB":t<1073741824?(t/1048576).toFixed(2)+" MB":t<1099511627776?(t/1073741824).toFixed(2)+" GB":(t/1099511627776).toFixed(2)+" TB"},e.prototype.splitFileName=function(t){var e=t.lastIndexOf(".");return-1==e?{name:t,extension:""}:{name:t.substring(0,e),extension:t.substring(e+1)}},e.getInstance=function(t,e){var n=window.$hsFileUploadCollection.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.$hsFileUploadCollection||(window.$hsFileUploadCollection=[]),document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsFileUploadCollection.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}(s.default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").length&&("undefined"==typeof _&&console.error("HSFileUpload: Lodash is not available, please add it to the page."),"undefined"==typeof Dropzone&&console.error("HSFileUpload: Dropzone is not available, please add it to the page.")),"undefined"!=typeof _&&"undefined"!=typeof Dropzone&&d.autoInit()})),"undefined"!=typeof window&&(window.HSFileUpload=d),e.default=d},292:function(t,e){ /* - * HSFileUpload - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t.\n\t\t\t\t\t\t

\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t0%\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t',l.extensions=_.merge({default:{icon:'',class:"size-5"},xls:{icon:'',class:"size-5"},doc:{icon:'',class:"size-5"},zip:{icon:'',class:"size-5"}},s.extensions),l.singleton=s.singleton,l.concatOptions=r(r({clickable:l.el.querySelector("[data-hs-file-upload-trigger]"),previewsContainer:l.el.querySelector("[data-hs-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:l.previewTemplate,autoHideTrigger:!1},s),n),l.init(),l}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsFileUploadCollection,this),this.initDropzone()},e.prototype.initDropzone=function(){var t=this,e=this.el.querySelector("[data-hs-file-upload-clear]"),n=Array.from(this.el.querySelectorAll("[data-hs-file-upload-pseudo-trigger]"));this.dropzone=new Dropzone(this.el,this.concatOptions),this.dropzone.on("addedfile",(function(e){return t.onAddFile(e)})),this.dropzone.on("removedfile",(function(){return t.onRemoveFile()})),this.dropzone.on("uploadprogress",(function(e,n){return t.onUploadProgress(e,n)})),this.dropzone.on("complete",(function(e){return t.onComplete(e)})),e&&(e.onclick=function(){t.dropzone.files.length&&t.dropzone.removeAllFiles(!0)}),n.length&&n.forEach((function(e){e.onclick=function(){var e,n;(null===(e=t.concatOptions)||void 0===e?void 0:e.clickable)&&(null===(n=t.concatOptions)||void 0===n?void 0:n.clickable).click()}}))},e.prototype.onAddFile=function(t){var e=this,n=t.previewElement,o=t.previewElement.querySelector("[data-hs-file-upload-reload]");if(!n)return!1;this.singleton&&this.dropzone.files.length>1&&this.dropzone.removeFile(this.dropzone.files[0]),o&&o.addEventListener("click",(function(n){n.preventDefault(),n.stopPropagation();var o=document.createElement("input");o.type="file",o.click(),o.addEventListener("change",(function(n){var o,i=null===(o=n.target.files)||void 0===o?void 0:o[0];if(i){var r=i;r.status=Dropzone.ADDED,r.accepted=!0,r.previewElement=t.previewElement,r.previewTemplate=t.previewTemplate,r.previewsContainer=t.previewsContainer,e.dropzone.removeFile(t),e.dropzone.addFile(r)}}))})),this.previewAccepted(t)},e.prototype.previewAccepted=function(t){var e=this,n=t.previewElement,o=this.splitFileName(t.name),i=n.querySelector("[data-hs-file-upload-file-name]"),r=n.querySelector("[data-hs-file-upload-file-ext]"),l=n.querySelector("[data-hs-file-upload-file-size]"),a=n.querySelector("[data-hs-file-upload-file-icon]"),s=this.el.querySelector("[data-hs-file-upload-trigger]"),d=n.querySelector("[data-dz-thumbnail]"),p=n.querySelector("[data-hs-file-upload-remove]");i&&(i.textContent=o.name),r&&(r.textContent=o.extension),l&&(l.textContent=this.formatFileSize(t.size)),d&&(t.type.includes("image/")?d.classList.remove("hidden"):this.setIcon(o.extension,a)),this.dropzone.files.length>0&&this.concatOptions.autoHideTrigger&&(s.style.display="none"),p&&(p.onclick=function(){return e.dropzone.removeFile(t)})},e.prototype.onRemoveFile=function(){var t=this.el.querySelector("[data-hs-file-upload-trigger]");0===this.dropzone.files.length&&this.concatOptions.autoHideTrigger&&(t.style.display="")},e.prototype.onUploadProgress=function(t,e){var n=t.previewElement;if(!n)return!1;var o=n.querySelector("[data-hs-file-upload-progress-bar]"),i=n.querySelector("[data-hs-file-upload-progress-bar-pane]"),r=n.querySelector("[data-hs-file-upload-progress-bar-value]"),l=Math.floor(e);o&&o.setAttribute("aria-valuenow","".concat(l)),i&&(i.style.width="".concat(l,"%")),r&&(r.innerText="".concat(l))},e.prototype.onComplete=function(t){var e=t.previewElement;if(!e)return!1;e.classList.add("complete")},e.prototype.setIcon=function(t,e){var n=this.createIcon(t);e.append(n)},e.prototype.createIcon=function(t){var e,n,o=(null===(e=this.extensions[t])||void 0===e?void 0:e.icon)?(0,a.htmlToElement)(this.extensions[t].icon):(0,a.htmlToElement)(this.extensions.default.icon);return(0,a.classToClassList)((null===(n=this.extensions[t])||void 0===n?void 0:n.class)?this.extensions[t].class:this.extensions.default.class,o),o},e.prototype.formatFileSize=function(t){return t<1024?t.toFixed(2)+" B":t<1048576?(t/1024).toFixed(2)+" KB":t<1073741824?(t/1048576).toFixed(2)+" MB":t<1099511627776?(t/1073741824).toFixed(2)+" GB":(t/1099511627776).toFixed(2)+" TB"},e.prototype.splitFileName=function(t){var e=t.lastIndexOf(".");return-1==e?{name:t,extension:""}:{name:t.substring(0,e),extension:t.substring(e+1)}},e.getInstance=function(t,e){var n=window.$hsFileUploadCollection.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.$hsFileUploadCollection||(window.$hsFileUploadCollection=[]),document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsFileUploadCollection.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}(s.default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").length&&("undefined"==typeof _&&console.error("HSFileUpload: Lodash is not available, please add it to the page."),"undefined"==typeof Dropzone&&console.error("HSFileUpload: Dropzone is not available, please add it to the page.")),"undefined"!=typeof _&&"undefined"!=typeof Dropzone&&d.autoInit()})),"undefined"!=typeof window&&(window.HSFileUpload=d),e.default=d},292: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.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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(),l=i?i.getBoundingClientRect():null,a=window.innerHeight,s=l?r.top-l.top:r.top,d=(i?l.bottom:a)-r.bottom,p=t.clientHeight+o;return"bottom"===n?d>=p:"top"===n?s>=p:s>=p||d>=p};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 o;return void 0===e&&(e=200),function(){for(var i=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(234);return n})())); \ No newline at end of file +var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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.isDirectChild=function(t,e){for(var n=t.children,o=0;o=p:"top"===n?s>=p:s>=p||d>=p};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 o;return void 0===e&&(e=200),function(){for(var i=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(234);return n})())); \ No newline at end of file diff --git a/dist/file-upload.mjs b/dist/file-upload.mjs new file mode 100644 index 0000000..c440e03 --- /dev/null +++ b/dist/file-upload.mjs @@ -0,0 +1,9 @@ +var e={615:(e,t,i)=>{i.d(t,{A:()=>l});class l{constructor(e,t,i){this.el=e,this.options=t,this.events=i,this.el=e,this.options=t,this.events={}}createCollection(e,t){var i;e.push({id:(null===(i=null==t?void 0:t.el)||void 0===i?void 0:i.id)||e.length+1,element:t})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},926:(e,t,i)=>{i.d(t,{en:()=>o,fc:()=>l});const l=e=>{const t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild},o=(e,t,i=" ",l="add")=>{e.split(i).forEach((e=>"add"===l?t.classList.add(e):t.classList.remove(e)))}}},t={};function i(l){var o=t[l];if(void 0!==o)return o.exports;var n=t[l]={exports:{}};return e[l](n,n.exports,i),n.exports}i.d=(e,t)=>{for(var l in t)i.o(t,l)&&!i.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var l={};i.d(l,{A:()=>s});var o=i(926),n=i(615); +/* + * HSFileUpload + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +"undefined"!=typeof Dropzone&&(Dropzone.autoDiscover=!1);class a extends n.A{constructor(e,t,i){var l;super(e,t,i),this.extensions={},this.el="string"==typeof e?document.querySelector(e):e;const o=this.el.getAttribute("data-hs-file-upload"),n=o?JSON.parse(o):{};this.previewTemplate=(null===(l=this.el.querySelector("[data-hs-file-upload-preview]"))||void 0===l?void 0:l.innerHTML)||'
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t.\n\t\t\t\t\t\t

\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t0%\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t
',this.extensions=_.merge({default:{icon:'',class:"size-5"},xls:{icon:'',class:"size-5"},doc:{icon:'',class:"size-5"},zip:{icon:'',class:"size-5"}},n.extensions),this.singleton=n.singleton,this.concatOptions=Object.assign(Object.assign({clickable:this.el.querySelector("[data-hs-file-upload-trigger]"),previewsContainer:this.el.querySelector("[data-hs-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:this.previewTemplate,autoHideTrigger:!1},n),t),this.init()}init(){this.createCollection(window.$hsFileUploadCollection,this),this.initDropzone()}initDropzone(){const e=this.el.querySelector("[data-hs-file-upload-clear]"),t=Array.from(this.el.querySelectorAll("[data-hs-file-upload-pseudo-trigger]"));this.dropzone=new Dropzone(this.el,this.concatOptions),this.dropzone.on("addedfile",(e=>this.onAddFile(e))),this.dropzone.on("removedfile",(()=>this.onRemoveFile())),this.dropzone.on("uploadprogress",((e,t)=>this.onUploadProgress(e,t))),this.dropzone.on("complete",(e=>this.onComplete(e))),e&&(e.onclick=()=>{this.dropzone.files.length&&this.dropzone.removeAllFiles(!0)}),t.length&&t.forEach((e=>{e.onclick=()=>{var e,t;(null===(e=this.concatOptions)||void 0===e?void 0:e.clickable)&&(null===(t=this.concatOptions)||void 0===t?void 0:t.clickable).click()}}))}onAddFile(e){const{previewElement:t}=e,i=e.previewElement.querySelector("[data-hs-file-upload-reload]");if(!t)return!1;this.singleton&&this.dropzone.files.length>1&&this.dropzone.removeFile(this.dropzone.files[0]),i&&i.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation();const i=document.createElement("input");i.type="file",i.click(),i.addEventListener("change",(t=>{var i;const l=null===(i=t.target.files)||void 0===i?void 0:i[0];if(l){const t=l;t.status=Dropzone.ADDED,t.accepted=!0,t.previewElement=e.previewElement,t.previewTemplate=e.previewTemplate,t.previewsContainer=e.previewsContainer,this.dropzone.removeFile(e),this.dropzone.addFile(t)}}))})),this.previewAccepted(e)}previewAccepted(e){const{previewElement:t}=e,i=this.splitFileName(e.name),l=t.querySelector("[data-hs-file-upload-file-name]"),o=t.querySelector("[data-hs-file-upload-file-ext]"),n=t.querySelector("[data-hs-file-upload-file-size]"),a=t.querySelector("[data-hs-file-upload-file-icon]"),s=this.el.querySelector("[data-hs-file-upload-trigger]"),r=t.querySelector("[data-dz-thumbnail]"),d=t.querySelector("[data-hs-file-upload-remove]");l&&(l.textContent=i.name),o&&(o.textContent=i.extension),n&&(n.textContent=this.formatFileSize(e.size)),r&&(e.type.includes("image/")?r.classList.remove("hidden"):this.setIcon(i.extension,a)),this.dropzone.files.length>0&&this.concatOptions.autoHideTrigger&&(s.style.display="none"),d&&(d.onclick=()=>this.dropzone.removeFile(e))}onRemoveFile(){const e=this.el.querySelector("[data-hs-file-upload-trigger]");0===this.dropzone.files.length&&this.concatOptions.autoHideTrigger&&(e.style.display="")}onUploadProgress(e,t){const{previewElement:i}=e;if(!i)return!1;const l=i.querySelector("[data-hs-file-upload-progress-bar]"),o=i.querySelector("[data-hs-file-upload-progress-bar-pane]"),n=i.querySelector("[data-hs-file-upload-progress-bar-value]"),a=Math.floor(t);l&&l.setAttribute("aria-valuenow",`${a}`),o&&(o.style.width=`${a}%`),n&&(n.innerText=`${a}`)}onComplete(e){const{previewElement:t}=e;if(!t)return!1;t.classList.add("complete")}setIcon(e,t){const i=this.createIcon(e);t.append(i)}createIcon(e){var t,i;const l=(null===(t=this.extensions[e])||void 0===t?void 0:t.icon)?(0,o.fc)(this.extensions[e].icon):(0,o.fc)(this.extensions.default.icon);return(0,o.en)((null===(i=this.extensions[e])||void 0===i?void 0:i.class)?this.extensions[e].class:this.extensions.default.class,l),l}formatFileSize(e){return e<1024?e.toFixed(2)+" B":e<1048576?(e/1024).toFixed(2)+" KB":e<1073741824?(e/1048576).toFixed(2)+" MB":e<1099511627776?(e/1073741824).toFixed(2)+" GB":(e/1099511627776).toFixed(2)+" TB"}splitFileName(e){let t=e.lastIndexOf(".");return-1==t?{name:e,extension:""}:{name:e.substring(0,t),extension:e.substring(t+1)}}static getInstance(e,t){const i=window.$hsFileUploadCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element.el:null}static autoInit(){window.$hsFileUploadCollection||(window.$hsFileUploadCollection=[]),document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").forEach((e=>{window.$hsFileUploadCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))||new a(e)}))}}window.addEventListener("load",(()=>{document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").length&&("undefined"==typeof _&&console.error("HSFileUpload: Lodash is not available, please add it to the page."),"undefined"==typeof Dropzone&&console.error("HSFileUpload: Dropzone is not available, please add it to the page.")),"undefined"!=typeof _&&"undefined"!=typeof Dropzone&&a.autoInit()})),"undefined"!=typeof window&&(window.HSFileUpload=a);const s=a;var r=l.A;export{r as default}; \ No newline at end of file diff --git a/dist/helper-apexcharts.d.ts b/dist/helper-apexcharts.d.ts new file mode 100644 index 0000000..d5f61c5 --- /dev/null +++ b/dist/helper-apexcharts.d.ts @@ -0,0 +1,52 @@ +import { ApexOptions } from 'apexcharts'; + +export interface IBuildTooltipHelperOptions { + title: string; + mode: string; + valuePrefix: string; + isValueDivided: boolean; + valuePostfix: string; + hasTextLabel: boolean; + invertGroup: boolean; + labelDivider: string; + wrapperClasses: string; + wrapperExtClasses: string; + seriesClasses: string; + seriesExtClasses: string; + titleClasses: string; + titleExtClasses: string; + markerClasses: string; + markerExtClasses: string; + valueClasses: string; + valueExtClasses: string; + labelClasses: string; + labelExtClasses: string; + hasCategory?: boolean; +} +export interface IChartProps { + dataPointIndex: number; + ctx: { + opts: ApexOptions; + }; + series: [ + ][]; +} +export interface IChartPropsSeries { + name: string; + altValue?: string; + data: number[]; +} +export interface IChartDonutProps { + series: IChartPropsSeries[]; + seriesIndex: number; + w: { + globals: ApexOptions; + }; +} +export declare function buildTooltip(props: IChartProps, options: IBuildTooltipHelperOptions): string; +export declare function buildTooltipCompareTwo(props: IChartProps, options: IBuildTooltipHelperOptions): string; +export declare function buildTooltipCompareTwoAlt(props: IChartProps, options: IBuildTooltipHelperOptions): string; +export declare function buildTooltipForDonut({ series, seriesIndex, w }: IChartDonutProps, textColor: string[]): string; +export declare function buildChart(id: string, shared: Function, light: string, dark: string): any; + +export {}; diff --git a/dist/helper-apexcharts.js b/dist/helper-apexcharts.js new file mode 100644 index 0000000..1f9b0ea --- /dev/null +++ b/dist/helper-apexcharts.js @@ -0,0 +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 a=e();for(var s in a)("object"==typeof exports?exports:t)[s]=a[s]}}(self,(()=>(()=>{"use strict";var t={};return(()=>{var e=t; +/* + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */Object.defineProperty(e,"__esModule",{value:!0}),e.buildTooltip=function(t,e){var a=e.title,s=e.mode,o=e.valuePrefix,n=void 0===o?"$":o,c=e.isValueDivided,r=void 0===c||c,l=e.valuePostfix,i=void 0===l?"":l,d=e.hasTextLabel,p=void 0!==d&&d,v=e.invertGroup,x=void 0!==v&&v,u=e.labelDivider,g=void 0===u?"":u,b=e.wrapperClasses,f=void 0===b?"ms-0.5 mb-2 bg-white border border-gray-200 text-gray-800 rounded-lg shadow-md dark:bg-neutral-800 dark:border-neutral-700":b,h=e.wrapperExtClasses,m=void 0===h?"":h,k=e.seriesClasses,y=void 0===k?"text-[12px]":k,w=e.seriesExtClasses,C=void 0===w?"":w,E=e.titleClasses,j=void 0===E?"font-semibold !text-sm !bg-white !border-gray-200 text-gray-800 rounded-t-lg dark:!bg-neutral-800 dark:!border-neutral-700 dark:text-neutral-200":E,P=e.titleExtClasses,T=void 0===P?"":P,D=e.markerClasses,L=void 0===D?"!w-2.5 !h-2.5 !me-1.5":D,z=e.markerExtClasses,I=void 0===z?"!rounded-sm":z,A=e.valueClasses,B=void 0===A?"!font-medium text-gray-500 !ms-auto dark:text-neutral-400":A,V=e.valueExtClasses,_=void 0===V?"":V,F=e.labelClasses,O=void 0===F?"text-gray-500 dark:text-neutral-400":F,S=e.labelExtClasses,$=void 0===S?"":S,q=t.dataPointIndex,G=t.ctx.opts.colors,H=t.ctx.opts.series,M="";return H.forEach((function(e,a){var s=t.series[a][q]||("object"!=typeof H[a].data[q]?H[a].data[q]:t.series[a][q]),o=H[a].name,c=x?{left:"".concat(p?o:"").concat(g),right:"".concat(n).concat(s>=1e3&&r?"".concat(s/1e3,"k"):s).concat(i)}:{left:"".concat(n).concat(s>=1e3&&r?"".concat(s/1e3,"k"):s).concat(i),right:"".concat(p?o:"").concat(g)},l='').concat(c.left,"");M+='
\n \n \n
\n
\n ').concat(c.right,"\n
\n
\n
\n ").concat(l,"\n
")})),'
\n
').concat(a,"
\n ").concat(M,"\n
")},e.buildTooltipCompareTwo=function(t,e){var a=t.dataPointIndex,s=t.ctx.opts.xaxis.categories,o=t.ctx.opts.colors,n=t.ctx.opts.series,c=e.title,r=e.mode,l=e.valuePrefix,i=void 0===l?"$":l,d=e.isValueDivided,p=void 0===d||d,v=e.valuePostfix,x=void 0===v?"":v,u=e.hasCategory,g=void 0===u||u,b=e.hasTextLabel,f=void 0!==b&&b,h=e.labelDivider,m=void 0===h?"":h,k=e.wrapperClasses,y=void 0===k?"ms-0.5 mb-2 bg-white border border-gray-200 text-gray-800 rounded-lg shadow-md dark:bg-neutral-800 dark:border-neutral-700":k,w=e.wrapperExtClasses,C=void 0===w?"":w,E=e.seriesClasses,j=void 0===E?"!justify-between w-full text-[12px]":E,P=e.seriesExtClasses,T=void 0===P?"":P,D=e.titleClasses,L=void 0===D?"flex justify-between font-semibold !text-sm !bg-white !border-gray-200 text-gray-800 rounded-t-lg dark:!bg-neutral-800 dark:!border-neutral-700 dark:text-neutral-200":D,z=e.titleExtClasses,I=void 0===z?"":z,A=e.markerClasses,B=void 0===A?"!w-2.5 !h-2.5 !me-1.5":A,V=e.markerExtClasses,_=void 0===V?"!rounded-sm":V,F=e.valueClasses,O=void 0===F?"!font-medium text-gray-500 !ms-auto dark:text-neutral-400":F,S=e.valueExtClasses,$=void 0===S?"":S,q=e.labelClasses,G=void 0===q?"text-gray-500 dark:text-neutral-400 ms-2":q,H=e.labelExtClasses,M=void 0===H?"":H,J="",K=n[0].data[a],N=n[1].data[a],Q=s[a].split(" "),R=g?"".concat(Q[0]).concat(Q[1]?" ":"").concat(Q[1]?Q[1].slice(0,3):""):"",U=K>N,W=K/N==1,X=W?0:K/N*100,Y=U?'':'';return n.forEach((function(e,s){var c=t.series[s][a]||("object"!=typeof n[s].data[a]?n[s].data[a]:t.series[s][a]),r=n[s].name,l=n[s].altValue||null,d='').concat(R," ").concat(r||"",""),v=l||'').concat(i).concat(c>=1e3&&p?"".concat(c/1e3,"k"):c).concat(x).concat(m,"");J+='
\n \n \n
\n
\n ').concat(v,"\n
\n
\n
\n ").concat(f?d:"","\n
")})),'
\n
\n ').concat(c,'\n \n ').concat(W?"":Y,'\n \n ').concat(X.toFixed(1),"%\n \n \n
\n ").concat(J,"\n
")},e.buildTooltipCompareTwoAlt=function(t,e){var a=t.dataPointIndex,s=t.ctx.opts.xaxis.categories,o=t.ctx.opts.colors,n=t.ctx.opts.series,c=e.title,r=e.mode,l=e.valuePrefix,i=void 0===l?"$":l,d=e.isValueDivided,p=void 0===d||d,v=e.valuePostfix,x=void 0===v?"":v,u=e.hasCategory,g=void 0===u||u,b=e.hasTextLabel,f=void 0!==b&&b,h=e.labelDivider,m=void 0===h?"":h,k=e.wrapperClasses,y=void 0===k?"ms-0.5 mb-2 bg-white border border-gray-200 text-gray-800 rounded-lg shadow-md dark:bg-neutral-800 dark:border-neutral-700":k,w=e.wrapperExtClasses,C=void 0===w?"":w,E=e.seriesClasses,j=void 0===E?"!justify-between w-full text-[12px]":E,P=e.seriesExtClasses,T=void 0===P?"":P,D=e.titleClasses,L=void 0===D?"flex justify-between font-semibold !text-sm !bg-white !border-gray-200 text-gray-800 rounded-t-lg dark:!bg-neutral-800 dark:!border-neutral-700 dark:text-neutral-200":D,z=e.titleExtClasses,I=void 0===z?"":z,A=e.markerClasses,B=void 0===A?"!w-2.5 !h-2.5 !me-1.5":A,V=e.markerExtClasses,_=void 0===V?"!rounded-sm":V,F=e.valueClasses,O=void 0===F?"!font-medium text-gray-500 !ms-auto dark:text-neutral-400":F,S=e.valueExtClasses,$=void 0===S?"":S,q=e.labelClasses,G=void 0===q?"text-gray-500 dark:text-neutral-400 ms-2":q,H=e.labelExtClasses,M=void 0===H?"":H,J="",K=n[0].data[a],N=n[1].data[a],Q=s[a].split(" "),R=g?"".concat(Q[0]).concat(Q[1]?" ":"").concat(Q[1]?Q[1].slice(0,3):""):"",U=K>N,W=K/N==1,X=W?0:K/N*100,Y=U?'':'';return n.forEach((function(e,s){var c=t.series[s][a]||("object"!=typeof n[s].data[a]?n[s].data[a]:t.series[s][a]),r=n[s].name,l='').concat(i).concat(c>=1e3&&p?"".concat(c/1e3,"k"):c).concat(x,"");J+='
\n \n \n
\n
\n ').concat(R," ").concat(r||"").concat(m,"\n
\n
\n
\n ").concat(f?l:"","\n
")})),'
\n
\n ').concat(c,'\n \n ').concat(W?"":Y,'\n \n ').concat(X.toFixed(1),"%\n \n \n
\n ").concat(J,"\n
")},e.buildTooltipForDonut=function(t,e){var a=t.series,s=t.seriesIndex,o=t.w.globals,n=o.colors;return'
\n
\n
\n ').concat(o.labels[s],': \n ').concat(a[s],"\n
\n
\n
")},e.buildChart=function(t,e,a,s){var o=document.querySelector(t),n=null;if(!o)return!1;var c=o.closest('[role="tabpanel"]'),r=null;Array.from(document.querySelector("html").classList).forEach((function(t){["dark","light","default"].includes(t)&&(r=t)}));var l=function(t){return void 0===t&&(t=r||localStorage.getItem("hs_theme")),window._.merge(e(t),"dark"===t?s:a)};o&&((n=new ApexCharts(o,l())).render(),window.addEventListener("on-hs-appearance-change",(function(t){return n.updateOptions(l(t.detail))})),c&&c.addEventListener("on-hs-appearance-change",(function(t){return n.updateOptions(l(t.detail))})));return n}})(),t})())); \ No newline at end of file diff --git a/dist/helper-apexcharts.mjs b/dist/helper-apexcharts.mjs new file mode 100644 index 0000000..4f2e628 --- /dev/null +++ b/dist/helper-apexcharts.mjs @@ -0,0 +1,8 @@ +var e={d:(t,s)=>{for(var a in s)e.o(s,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:s[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={}; +/* + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +function s(e,t){const{title:s,mode:a,valuePrefix:l="$",isValueDivided:r=!0,valuePostfix:n="",hasTextLabel:o=!1,invertGroup:i=!1,labelDivider:d="",wrapperClasses:p="ms-0.5 mb-2 bg-white border border-gray-200 text-gray-800 rounded-lg shadow-md dark:bg-neutral-800 dark:border-neutral-700",wrapperExtClasses:c="",seriesClasses:x="text-[12px]",seriesExtClasses:u="",titleClasses:$="font-semibold !text-sm !bg-white !border-gray-200 text-gray-800 rounded-t-lg dark:!bg-neutral-800 dark:!border-neutral-700 dark:text-neutral-200",titleExtClasses:g="",markerClasses:h="!w-2.5 !h-2.5 !me-1.5",markerExtClasses:v="!rounded-sm",valueClasses:b="!font-medium text-gray-500 !ms-auto dark:text-neutral-400",valueExtClasses:m="",labelClasses:k="text-gray-500 dark:text-neutral-400",labelExtClasses:y=""}=t,{dataPointIndex:w}=e,{colors:f}=e.ctx.opts,C=e.ctx.opts.series;let E="";return C.forEach(((t,s)=>{const a=e.series[s][w]||("object"!=typeof C[s].data[w]?C[s].data[w]:e.series[s][w]),p=C[s].name,c=i?{left:`${o?p:""}${d}`,right:`${l}${a>=1e3&&r?a/1e3+"k":a}${n}`}:{left:`${l}${a>=1e3&&r?a/1e3+"k":a}${n}`,right:`${o?p:""}${d}`},$=`${c.left}`;E+=`
\n \n \n
\n
\n ${c.right}\n
\n
\n
\n ${$}\n
`})),`
\n
${s}
\n ${E}\n
`}function a(e,t){const{dataPointIndex:s}=e,{categories:a}=e.ctx.opts.xaxis,{colors:l}=e.ctx.opts,r=e.ctx.opts.series,{title:n,mode:o,valuePrefix:i="$",isValueDivided:d=!0,valuePostfix:p="",hasCategory:c=!0,hasTextLabel:x=!1,labelDivider:u="",wrapperClasses:$="ms-0.5 mb-2 bg-white border border-gray-200 text-gray-800 rounded-lg shadow-md dark:bg-neutral-800 dark:border-neutral-700",wrapperExtClasses:g="",seriesClasses:h="!justify-between w-full text-[12px]",seriesExtClasses:v="",titleClasses:b="flex justify-between font-semibold !text-sm !bg-white !border-gray-200 text-gray-800 rounded-t-lg dark:!bg-neutral-800 dark:!border-neutral-700 dark:text-neutral-200",titleExtClasses:m="",markerClasses:k="!w-2.5 !h-2.5 !me-1.5",markerExtClasses:y="!rounded-sm",valueClasses:w="!font-medium text-gray-500 !ms-auto dark:text-neutral-400",valueExtClasses:f="",labelClasses:C="text-gray-500 dark:text-neutral-400 ms-2",labelExtClasses:E=""}=t;let j="";const P=r[0].data[s],T=r[1].data[s],D=a[s].split(" "),q=c?`${D[0]}${D[1]?" ":""}${D[1]?D[1].slice(0,3):""}`:"",L=P>T,z=P/T==1,I=z?0:P/T*100,O=L?'':'';return r.forEach(((t,a)=>{const n=e.series[a][s]||("object"!=typeof r[a].data[s]?r[a].data[s]:e.series[a][s]),o=r[a].name,c=r[a].altValue||null,$=`${q} ${o||""}`,g=c||`${i}${n>=1e3&&d?n/1e3+"k":n}${p}${u}`;j+=`
\n \n \n
\n
\n ${g}\n
\n
\n
\n ${x?$:""}\n
`})),`
\n
\n ${n}\n \n ${z?"":O}\n \n ${I.toFixed(1)}%\n \n \n
\n ${j}\n
`}function l(e,t){const{dataPointIndex:s}=e,{categories:a}=e.ctx.opts.xaxis,{colors:l}=e.ctx.opts,r=e.ctx.opts.series,{title:n,mode:o,valuePrefix:i="$",isValueDivided:d=!0,valuePostfix:p="",hasCategory:c=!0,hasTextLabel:x=!1,labelDivider:u="",wrapperClasses:$="ms-0.5 mb-2 bg-white border border-gray-200 text-gray-800 rounded-lg shadow-md dark:bg-neutral-800 dark:border-neutral-700",wrapperExtClasses:g="",seriesClasses:h="!justify-between w-full text-[12px]",seriesExtClasses:v="",titleClasses:b="flex justify-between font-semibold !text-sm !bg-white !border-gray-200 text-gray-800 rounded-t-lg dark:!bg-neutral-800 dark:!border-neutral-700 dark:text-neutral-200",titleExtClasses:m="",markerClasses:k="!w-2.5 !h-2.5 !me-1.5",markerExtClasses:y="!rounded-sm",valueClasses:w="!font-medium text-gray-500 !ms-auto dark:text-neutral-400",valueExtClasses:f="",labelClasses:C="text-gray-500 dark:text-neutral-400 ms-2",labelExtClasses:E=""}=t;let j="";const P=r[0].data[s],T=r[1].data[s],D=a[s].split(" "),q=c?`${D[0]}${D[1]?" ":""}${D[1]?D[1].slice(0,3):""}`:"",L=P>T,z=P/T==1,I=z?0:P/T*100,O=L?'':'';return r.forEach(((t,a)=>{const n=e.series[a][s]||("object"!=typeof r[a].data[s]?r[a].data[s]:e.series[a][s]),o=r[a].name,c=`${i}${n>=1e3&&d?n/1e3+"k":n}${p}`;j+=`
\n \n \n
\n
\n ${q} ${o||""}${u}\n
\n
\n
\n ${x?c:""}\n
`})),`
\n
\n ${n}\n \n ${z?"":O}\n \n ${I.toFixed(1)}%\n \n \n
\n ${j}\n
`}function r({series:e,seriesIndex:t,w:s},a){const{globals:l}=s,{colors:r}=l;return`
\n
\n
\n ${l.labels[t]}: \n ${e[t]}\n
\n
\n
`}function n(e,t,s,a){const l=document.querySelector(e);let r=null;if(!l)return!1;const n=l.closest('[role="tabpanel"]');let o=null;Array.from(document.querySelector("html").classList).forEach((e=>{["dark","light","default"].includes(e)&&(o=e)}));const i=(e=o||localStorage.getItem("hs_theme"))=>window._.merge(t(e),"dark"===e?a:s);return l&&(r=new ApexCharts(l,i()),r.render(),window.addEventListener("on-hs-appearance-change",(e=>r.updateOptions(i(e.detail)))),n&&n.addEventListener("on-hs-appearance-change",(e=>r.updateOptions(i(e.detail))))),r}e.d(t,{Jw:()=>n,TE:()=>r,jD:()=>a,qH:()=>s,qc:()=>l});var o=t.Jw,i=t.qH,d=t.jD,p=t.qc,c=t.TE;export{o as buildChart,i as buildTooltip,d as buildTooltipCompareTwo,p as buildTooltipCompareTwoAlt,c as buildTooltipForDonut}; \ No newline at end of file diff --git a/dist/helper-clipboard.d.ts b/dist/helper-clipboard.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/helper-clipboard.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/helper-clipboard.js b/dist/helper-clipboard.js new file mode 100644 index 0000000..28b537e --- /dev/null +++ b/dist/helper-clipboard.js @@ -0,0 +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={};return(()=>{var t,o=e; +/* + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */Object.defineProperty(o,"__esModule",{value:!0});var n=null!==(t=null===window||void 0===window?void 0:window.HS_CLIPBOARD_SELECTOR)&&void 0!==t?t:".js-clipboard";window.addEventListener("load",(function(){document.querySelectorAll(n).forEach((function(e){new ClipboardJS(e,{text:function(e){var t=e.dataset.clipboardText;if(t)return t;var o=e.dataset.clipboardTarget,n=document.querySelector(o);return"SELECT"===n.tagName||"INPUT"===n.tagName||"TEXTAREA"===n.tagName?n.value:n.textContent}}).on("success",(function(){var t,o=e.querySelector(".js-clipboard-default"),n=e.querySelector(".js-clipboard-success"),i=e.querySelector(".js-clipboard-success-text"),r=e.dataset.clipboardSuccessText||"",l=e.closest(".hs-tooltip");i&&(t=i.textContent,i.textContent=r),o&&n&&(o.style.display="none",n.style.display="block"),l&&window.HSTooltip.show(l),setTimeout((function(){i&&t&&(i.textContent=t),l&&window.HSTooltip.hide(l),o&&n&&(n.style.display="",o.style.display="")}),800)}))}))}))})(),e})())); \ No newline at end of file diff --git a/dist/helper-clipboard.mjs b/dist/helper-clipboard.mjs new file mode 100644 index 0000000..ef96ede --- /dev/null +++ b/dist/helper-clipboard.mjs @@ -0,0 +1,7 @@ +/* + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +var t;const e=null!==(t=null===window||void 0===window?void 0:window.HS_CLIPBOARD_SELECTOR)&&void 0!==t?t:".js-clipboard";window.addEventListener("load",(()=>{document.querySelectorAll(e).forEach((t=>{new ClipboardJS(t,{text:t=>{const e=t.dataset.clipboardText;if(e)return e;const o=t.dataset.clipboardTarget,l=document.querySelector(o);return"SELECT"===l.tagName||"INPUT"===l.tagName||"TEXTAREA"===l.tagName?l.value:l.textContent}}).on("success",(()=>{const e=t.querySelector(".js-clipboard-default"),o=t.querySelector(".js-clipboard-success"),l=t.querySelector(".js-clipboard-success-text"),s=t.dataset.clipboardSuccessText||"",n=t.closest(".hs-tooltip");let a;l&&(a=l.textContent,l.textContent=s),e&&o&&(e.style.display="none",o.style.display="block"),n&&window.HSTooltip.show(n),setTimeout((function(){l&&a&&(l.textContent=a),n&&window.HSTooltip.hide(n),e&&o&&(o.style.display="",e.style.display="")}),800)}))}))})); \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts index 3fd3f92..96d2c9e 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -58,13 +58,14 @@ export interface IAccordion { export declare class HSAccordion extends HSBasePlugin implements IAccordion { private readonly toggle; content: HTMLElement | null; - private readonly group; - private readonly isAlwaysOpened; + private group; + private isAlwaysOpened; static selectable: IAccordionTreeView[]; constructor(el: HTMLElement, options?: IAccordionOptions, events?: {}); private init; show(): boolean; hide(): boolean; + update(): boolean; static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem; static show(target: HTMLElement): void; static hide(target: HTMLElement): void; @@ -73,13 +74,24 @@ export declare class HSAccordion extends HSBasePlugin impleme static toggleSelected(root: IAccordionTreeView, item: HTMLElement): void; static on(evt: string, target: HTMLElement, cb: Function): void; } +export type TCarouselOptionsSlidesQty = { + [key: string]: number; +}; export interface ICarouselOptions { currentIndex: number; loadingClasses?: string | string[]; + dotsItemClasses?: string; + isAutoHeight?: boolean; isAutoPlay?: boolean; - speed?: number; + isCentered?: boolean; + isDraggable?: boolean; isInfiniteLoop?: boolean; isRTL?: boolean; + isSnap?: boolean; + hasSnapSpacers?: boolean; + slidesQty?: TCarouselOptionsSlidesQty | number; + speed?: number; + updateDelay?: number; } export interface ICarousel { options?: ICarouselOptions; @@ -89,28 +101,69 @@ export interface ICarousel { goTo(i: number): void; } export declare class HSCarousel extends HSBasePlugin implements ICarousel { + private currentIndex; + private readonly loadingClasses; + private readonly dotsItemClasses; + private readonly isAutoHeight; + private readonly isAutoPlay; + private readonly isCentered; + private readonly isDraggable; + private readonly isInfiniteLoop; + private readonly isRTL; + private readonly isSnap; + private readonly hasSnapSpacers; + private readonly slidesQty; + private readonly speed; + private readonly updateDelay; + private readonly loadingClassesRemove; + private readonly loadingClassesAdd; + private readonly afterLoadingClassesAdd; + private readonly container; private readonly inner; private readonly slides; private readonly prev; private readonly next; private readonly dots; + private dotsItems; + private readonly info; + private readonly infoTotal; + private readonly infoCurrent; private sliderWidth; - private currentIndex; - private readonly loadingClasses; - private readonly loadingClassesRemove; - private readonly loadingClassesAdd; - private readonly afterLoadingClassesAdd; - private readonly isAutoPlay; - private readonly isRTL; - private readonly speed; - private readonly isInfiniteLoop; private timer; + private isScrolling; + private isDragging; + private dragStartX; + private initialTranslateX; private readonly touchX; + private resizeContainer; + resizeContainerWidth: number; constructor(el: HTMLElement, options?: ICarouselOptions); + private setIsSnap; private init; + private initDragHandling; + private getTranslateXValue; + private removeClickEventWhileDragging; + private handleDragStart; + private handleDragMove; + private handleDragEnd; + private getEventX; + private getCurrentSlidesQty; + private buildSnapSpacers; + private initDots; + private buildDots; + private setDots; + private goToCurrentDot; + private buildInfo; + private setInfoTotal; + private setInfoCurrent; + private buildSingleDot; + private singleDotEvents; private observeResize; private calculateWidth; private addCurrentClass; + private setCurrentDot; + private setElementToDisabled; + private unsetElementToDisabled; private addDisabledClass; private autoPlay; private setTimer; @@ -118,9 +171,11 @@ export declare class HSCarousel extends HSBasePlugin implement private detectDirection; recalculateWidth(): void; private calculateTransform; + private setTranslate; goToPrev(): void; goToNext(): void; goTo(i: number): void; + private setIndex; static getInstance(target: HTMLElement | string, isInstance?: boolean): HSCarousel | ICollectionItem; static autoInit(): void; } @@ -341,6 +396,7 @@ export interface IOverlayOptions { isClosePrev?: boolean; backdropClasses?: string | null; backdropExtraClasses?: string | null; + moveOverlayToBody?: number | null; } export interface IOverlay { options?: IOverlayOptions; @@ -358,6 +414,7 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private autoHide; private readonly overlayId; overlay: HTMLElement | null; + initContainer: HTMLElement | null; isCloseWhenClickInside: boolean; isTabAccessibilityLimited: boolean; isLayoutAffect: boolean; @@ -365,6 +422,7 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { hasAbilityToCloseOnBackdropClick: boolean; openedBreakpoint: number | null; autoClose: number | null; + moveOverlayToBody: number | null; constructor(el: HTMLElement, options?: IOverlayOptions, events?: {}); private init; private hideAuto; @@ -457,6 +515,13 @@ export interface ISingleOption { selected?: boolean; options?: ISingleOptionOptions | null; } +export interface IApiFieldMap { + id: string; + title: string; + icon?: string | null; + description?: string | null; + [key: string]: unknown; +} export interface ISelectOptions { value?: string | string[]; isOpened?: boolean; @@ -466,6 +531,13 @@ export interface ISelectOptions { mode?: string; viewport?: string; wrapperClasses?: string; + apiUrl?: string | null; + apiQuery?: string | null; + apiOptions?: RequestInit | null; + apiDataPart?: string | null; + apiSearchQueryKey?: string | null; + apiFieldsMap?: IApiFieldMap | null; + apiIconTag?: string | null; toggleTag?: string; toggleClasses?: string; toggleSeparators?: { @@ -477,6 +549,7 @@ export interface ISelectOptions { toggleCountTextMode?: string; tagsItemTemplate?: string; tagsItemClasses?: string; + tagsInputId?: string; tagsInputClasses?: string; dropdownTag?: string; dropdownClasses?: string; @@ -485,11 +558,18 @@ export interface ISelectOptions { bottom?: string; }; dropdownSpace: number; + dropdownPlacement: string | null; + dropdownScope: "window" | "parent"; extraMarkup?: string | string[] | null; + searchTemplate?: string; searchWrapperTemplate?: string; + searchId?: string; + searchLimit?: number | typeof Infinity; + isSearchDirectMatch?: boolean; searchClasses?: string; searchWrapperClasses?: string; searchPlaceholder?: string; + searchNoResultTemplate?: string | null; searchNoResultText?: string | null; searchNoResultClasses?: string | null; optionTemplate?: string; @@ -519,6 +599,13 @@ export declare class HSSelect extends HSBasePlugin implements IS isMultiple: boolean | null; isDisabled: boolean | null; selectedItems: string[]; + private readonly apiUrl; + private readonly apiQuery; + private readonly apiOptions; + private readonly apiDataPart; + private readonly apiSearchQueryKey; + private readonly apiFieldsMap; + private readonly apiIconTag; private readonly toggleTag; private readonly toggleClasses; private readonly toggleSeparators; @@ -528,15 +615,23 @@ export declare class HSSelect extends HSBasePlugin implements IS private readonly wrapperClasses; private readonly tagsItemTemplate; private readonly tagsItemClasses; + private readonly tagsInputId; private readonly tagsInputClasses; private readonly dropdownTag; private readonly dropdownClasses; private readonly dropdownDirectionClasses; dropdownSpace: number | null; + readonly dropdownPlacement: string | null; + readonly dropdownScope: "window" | "parent"; + private readonly searchTemplate; private readonly searchWrapperTemplate; private readonly searchPlaceholder; + private readonly searchId; + private readonly searchLimit; + private readonly isSearchDirectMatch; private readonly searchClasses; private readonly searchWrapperClasses; + private readonly searchNoResultTemplate; private readonly searchNoResultText; private readonly searchNoResultClasses; private readonly optionTag; @@ -550,6 +645,7 @@ export declare class HSSelect extends HSBasePlugin implements IS private toggleTextWrapper; private tagsInput; private dropdown; + private popperInstance; private searchWrapper; private search; private searchNoResult; @@ -557,6 +653,8 @@ export declare class HSSelect extends HSBasePlugin implements IS private extraMarkup; private readonly isAddTagOnEnter; private tagsInputHelper; + private remoteOptions; + private optionId; constructor(el: HTMLElement, options?: ISelectOptions); setValue(val: string | string[]): void; private init; @@ -573,8 +671,16 @@ export declare class HSSelect extends HSBasePlugin implements IS private setTagsItems; private buildTagsInput; private buildDropdown; + private buildPopper; + private updateDropdownWidth; private buildSearch; private buildOption; + private buildOptionFromRemoteData; + private buildOptionsFromRemoteData; + private optionsFromRemoteData; + private apiRequest; + private sortElements; + private remoteSearch; private destroyOption; private buildOriginalOption; private destroyOriginalOption; @@ -588,6 +694,8 @@ export declare class HSSelect extends HSBasePlugin implements IS private resetTagsInputField; private clearSelections; private setNewValue; + private stringFromValueBasic; + private stringFromValueRemoteData; private stringFromValue; private selectSingleItem; private selectMultipleItems; @@ -595,6 +703,7 @@ export declare class HSSelect extends HSBasePlugin implements IS private searchOptions; private eraseToggleIcon; private eraseToggleTitle; + private toggleFn; destroy(): void; open(): boolean; close(): boolean; @@ -774,6 +883,25 @@ export declare class HSTabs extends HSBasePlugin<{}> implements ITabs { static onStartEnd(isOpposite?: boolean): void; static on(evt: string, target: HTMLElement, cb: Function): void; } +export interface ITextareaAutoHeightOptions { + defaultHeight: number; +} +export interface ITextareaAutoHeight { + options?: ITextareaAutoHeightOptions; +} +export declare class HSTextareaAutoHeight extends HSBasePlugin implements ITextareaAutoHeight { + private readonly defaultHeight; + constructor(el: HTMLTextAreaElement, options?: ITextareaAutoHeightOptions); + private init; + private setAutoHeight; + private textareaSetHeight; + private checkIfOneLine; + private isParentHidden; + private parentType; + private callbackAccordingToType; + static getInstance(target: HTMLTextAreaElement | string, isInstance?: boolean): HSTextareaAutoHeight | ICollectionItem; + static autoInit(): void; +} export interface IThemeSwitchOptions { theme?: "dark" | "light" | "default"; } @@ -868,6 +996,47 @@ export declare class HSTooltip extends HSBasePlugin<{}> implements ITooltip { static hide(target: HTMLElement): void; static on(evt: string, target: HTMLElement, cb: Function): void; } +export type ITreeViewOptionsControlBy = "checkbox" | "button"; +export interface ITreeViewItem { + id: string; + value: string; + isDir: boolean; + path: string; + isSelected?: boolean; +} +export interface ITreeViewOptions { + items: ITreeViewItem[] | null; + controlBy?: ITreeViewOptionsControlBy; + autoSelectChildren?: boolean; + isIndeterminate?: boolean; +} +export interface ITreeView { + options?: ITreeViewOptions; +} +export declare class HSTreeView extends HSBasePlugin implements ITreeView { + private items; + private readonly controlBy; + private readonly autoSelectChildren; + private readonly isIndeterminate; + static group: number; + constructor(el: HTMLElement, options?: ITreeViewOptions, events?: {}); + private init; + private initItems; + private controlByButton; + private controlByCheckbox; + private getItem; + private getPath; + private unselectItem; + private selectItem; + private selectChildren; + private toggleParent; + update(): void; + getSelectedItems(): ITreeViewItem[]; + changeItemProp(id: string, prop: string, val: any): void; + static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem; + static autoInit(): void; + static on(evt: string, target: HTMLElement, cb: Function): void; +} export interface IStaticMethods { getClassProperty(el: HTMLElement, prop?: string, val?: string): string; afterTransition(el: HTMLElement, cb: Function): void; @@ -877,10 +1046,12 @@ export interface IStaticMethods { export declare const HSStaticMethods: IStaticMethods; declare let HSDataTableModule: any; declare let HSFileUploadModule: any; +declare let HSRangeSliderModule: any; export { HSDataTableModule as HSDataTable, HSFileUploadModule as HSFileUpload, + HSRangeSliderModule as HSRangeSlider, }; export {}; diff --git a/dist/index.js b/dist/index.js index 3e4f2f8..cb4963a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,177 +1,214 @@ -!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={170:(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:()=>g,beforeWrite:()=>x,bottom:()=>i,clippingParents:()=>d,computeStyles:()=>nt,createPopper:()=>Pt,createPopperBase:()=>kt,createPopperLite:()=>Bt,detectOverflow:()=>yt,end:()=>u,eventListeners:()=>it,flip:()=>wt,hide:()=>St,left:()=>s,main:()=>C,modifierPhases:()=>E,offset:()=>xt,placements:()=>m,popper:()=>h,popperGenerator:()=>_t,popperOffsets:()=>It,preventOverflow:()=>Tt,read:()=>y,reference:()=>f,right:()=>r,start:()=>c,top:()=>o,variationPlacements:()=>v,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",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])}),[]),g="beforeRead",y="read",w="afterRead",b="beforeMain",C="main",S="afterMain",x="beforeWrite",I="write",T="afterWrite",E=[g,y,w,b,C,S,x,I,T];function L(t){return t?(t.nodeName||"").toLowerCase():null}function O(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 O(t).Element||t instanceof Element}function _(t){return t instanceof O(t).HTMLElement||t instanceof HTMLElement}function k(t){return"undefined"!=typeof ShadowRoot&&(t instanceof O(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)&&L(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)&&L(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,H=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 M(){return!/^((?!chrome|android).)*safari/i.test(D())}function j(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&&H(o.width)/t.offsetWidth||1,r=t.offsetHeight>0&&H(o.height)/t.offsetHeight||1);var s=(A(t)?O(t):window).visualViewport,l=!M()&&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 $(t){var e=j(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 V(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 R(t){return O(t).getComputedStyle(t)}function F(t){return["table","td","th"].indexOf(L(t))>=0}function W(t){return((A(t)?t.ownerDocument:t.document)||window.document).documentElement}function z(t){return"html"===L(t)?t:t.assignedSlot||t.parentNode||(k(t)?t.host:null)||W(t)}function U(t){return _(t)&&"fixed"!==R(t).position?t.offsetParent:null}function J(t){for(var e=O(t),n=U(t);n&&F(n)&&"static"===R(n).position;)n=U(n);return n&&("html"===L(n)||"body"===L(n)&&"static"===R(n).position)?e:n||function(t){var e=/firefox/i.test(D());if(/Trident/i.test(D())&&_(t)&&"fixed"===R(t).position)return null;var n=z(t);for(k(n)&&(n=n.host);_(n)&&["html","body"].indexOf(L(n))<0;){var o=R(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 Y(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Z(t,e,n){return q(t,N(e,n))}function K(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function G(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=Y(p),f=[s,r].indexOf(p)>=0?"height":"width";if(u&&d){var v=function(t,e){return K("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:G(t,a))}(c.padding,n),m=$(u),g="y"===h?o:s,y="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,x=w/2-b/2,I=v[g],T=S-m[f]-v[y],E=S/2-m[f]/2+x,L=Z(I,E,T),O=h;n.modifiersData[l]=((e={})[O]=L,e.centerOffset=L-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)))&&V(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function X(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,g=d.x,y=void 0===g?0:g,w=d.y,b=void 0===w?0:w,C="function"==typeof v?v({x:y,y:b}):{x:y,y:b};y=C.x,b=C.y;var S=d.hasOwnProperty("x"),x=d.hasOwnProperty("y"),I=s,T=o,E=window;if(f){var L=J(n),A="clientHeight",_="clientWidth";if(L===O(n)&&"static"!==R(L=W(n)).position&&"absolute"===p&&(A="scrollHeight",_="scrollWidth"),a===o||(a===s||a===r)&&c===u)T=i,b-=(m&&L===E&&E.visualViewport?E.visualViewport.height:L[A])-l.height,b*=h?1:-1;if(a===s||(a===o||a===i)&&c===u)I=r,y-=(m&&L===E&&E.visualViewport?E.visualViewport.width:L[_])-l.width,y*=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:H(n*i)/i||0,y:H(o*i)/i||0}}({x:y,y:b},O(n)):{x:y,y:b};return y=B.x,b=B.y,h?Object.assign({},P,((k={})[T]=x?"0":"",k[I]=S?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",k)):Object.assign({},P,((e={})[T]=x?b+"px":"",e[I]=S?y+"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:X(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=O(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=O(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ut(t){return j(W(t)).left+ct(t).scrollLeft}function dt(t){var e=R(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(L(t))>=0?t.ownerDocument.body:_(t)&&dt(t)?t:pt(z(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=O(o),s=i?[r].concat(r.visualViewport||[],dt(o)?o:[]):o,l=e.concat(s);return i?l:l.concat(ht(z(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=O(t),o=W(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;var c=M();(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=j(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=W(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"===R(i||n).direction&&(l+=q(n.clientWidth,i?i.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}(W(t)))}function mt(t,e,n,o){var i="clippingParents"===e?function(t){var e=ht(z(t)),n=["absolute","fixed"].indexOf(R(t).position)>=0&&_(t)?J(t):t;return A(n)?e.filter((function(t){return A(t)&&V(t,n)&&"body"!==L(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=N(i.right,e.right),e.bottom=N(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 gt(t){var e,n=t.reference,l=t.element,a=t.placement,d=a?B(a):null,p=a?X(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?Y(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 yt(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,g=n.rootBoundary,y=void 0===g?p:g,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=K("number"!=typeof I?I:G(I,a)),E=b===h?f:h,L=t.rects.popper,O=t.elements[S?E:b],_=mt(A(O)?O:O.contextElement||W(t.elements.popper),m,y,u),k=j(t.elements.reference),P=gt({reference:k,element:L,strategy:"absolute",placement:l}),B=ft(Object.assign({},L,P)),q=b===h?B:k,N={top:_.top-q.top+T.top,bottom:q.bottom-_.bottom+T.bottom,left:_.left-q.left+T.left,right:q.right-_.right+T.right},H=t.modifiersData.offset;if(b===h&&H){var D=H[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]+=D[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,g=n.fallbackPlacements,y=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),L=g||(E===T||!x?[st(T)]:function(t){if(B(t)===l)return[];var e=st(t);return[at(t),e,at(e)]}(T)),O=[T].concat(L).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=X(o),p=d?l?v:v.filter((function(t){return X(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]=yt(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:y,flipVariations:x,allowedAutoPlacements:I}):n)}),[]),A=e.rects.reference,_=e.rects.popper,k=new Map,P=!0,q=O[0],N=0;N=0,$=j?"width":"height",V=yt(e,{placement:H,boundary:w,rootBoundary:b,altBoundary:C,padding:y}),R=j?M?r:s:M?i:o;A[$]>_[$]&&(R=st(R));var F=st(R),W=[];if(p&&W.push(V[D]<=0),f&&W.push(V[R]<=0,V[F]<=0),W.every((function(t){return t}))){q=H,P=!1;break}k.set(H,W)}if(P)for(var z=function(t){var e=O.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"},U=x?3:1;U>0;U--){if("break"===z(U))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=yt(e,{elementContext:"reference"}),l=yt(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=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 It={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=gt({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,v=n.altBoundary,m=n.padding,g=n.tether,y=void 0===g||g,w=n.tetherOffset,b=void 0===w?0:w,C=yt(e,{boundary:h,rootBoundary:f,padding:m,altBoundary:v}),S=B(e.placement),x=X(e.placement),I=!x,T=Y(S),E="x"===T?"y":"x",L=e.modifiersData.popperOffsets,O=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,H={x:0,y:0};if(L){if(u){var D,M="y"===T?o:s,j="y"===T?i:r,V="y"===T?"height":"width",R=L[T],F=R+C[M],W=R-C[j],z=y?-A[V]/2:0,U=x===c?O[V]:A[V],K=x===c?-A[V]:-O[V],G=e.elements.arrow,Q=y&&G?$(G):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[M],nt=tt[j],ot=Z(0,O[V],Q[V]),it=I?O[V]/2-z-ot-et-k.mainAxis:U-ot-et-k.mainAxis,rt=I?-O[V]/2+z+ot+nt+k.mainAxis:K+ot+nt+k.mainAxis,st=e.elements.arrow&&J(e.elements.arrow),lt=st?"y"===T?st.clientTop||0:st.clientLeft||0:0,at=null!=(D=null==P?void 0:P[T])?D:0,ct=R+rt-at,ut=Z(y?N(F,R+it-at-lt):F,R,y?q(W,ct):W);L[T]=ut,H[T]=ut-R}if(p){var dt,pt="x"===T?o:s,ht="x"===T?i:r,ft=L[E],vt="y"===E?"height":"width",mt=ft+C[pt],gt=ft-C[ht],wt=-1!==[o,s].indexOf(S),bt=null!=(dt=null==P?void 0:P[E])?dt:0,Ct=wt?mt:ft-O[vt]-A[vt]-bt+k.altAxis,St=wt?ft+O[vt]+A[vt]-bt-k.altAxis:gt,xt=y&&wt?function(t,e,n){var o=Z(t,e,n);return o>n?n:o}(Ct,ft,St):Z(y?Ct:mt,ft,y?St:gt);L[E]=xt,H[E]=xt-ft}e.modifiersData[l]=H}},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=H(e.width)/t.offsetWidth||1,o=H(e.height)/t.offsetHeight||1;return 1!==n||1!==o}(e),l=W(e),a=j(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==L(e)||dt(l))&&(c=(o=e)!==O(o)&&_(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:ct(o)),_(e)?((u=j(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 Lt(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 Ot={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}},158:function(t,e,n){var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.HSFileUpload=e.HSDataTable=e.HSStaticMethods=e.HSTooltip=e.HSTogglePassword=e.HSToggleCount=e.HSThemeSwitch=e.HSTabs=e.HSStrongPassword=e.HSStepper=e.HSSelect=e.HSScrollspy=e.HSRemoveElement=e.HSPinInput=e.HSOverlay=e.HSInputNumber=e.HSDropdown=e.HSComboBox=e.HSCollapse=e.HSCarousel=e.HSAccordion=e.HSCopyMarkup=void 0;var i=n(406);Object.defineProperty(e,"HSCopyMarkup",{enumerable:!0,get:function(){return o(i).default}});var r=n(740);Object.defineProperty(e,"HSAccordion",{enumerable:!0,get:function(){return o(r).default}});var s=n(268);Object.defineProperty(e,"HSCarousel",{enumerable:!0,get:function(){return o(s).default}});var l=n(485);Object.defineProperty(e,"HSCollapse",{enumerable:!0,get:function(){return o(l).default}});var a=n(809);Object.defineProperty(e,"HSComboBox",{enumerable:!0,get:function(){return o(a).default}});var c=n(891);Object.defineProperty(e,"HSDropdown",{enumerable:!0,get:function(){return o(c).default}});var u=n(332);Object.defineProperty(e,"HSInputNumber",{enumerable:!0,get:function(){return o(u).default}});var d=n(850);Object.defineProperty(e,"HSOverlay",{enumerable:!0,get:function(){return o(d).default}});var p=n(60);Object.defineProperty(e,"HSPinInput",{enumerable:!0,get:function(){return o(p).default}});var h=n(911);Object.defineProperty(e,"HSRemoveElement",{enumerable:!0,get:function(){return o(h).default}});var f=n(751);Object.defineProperty(e,"HSScrollspy",{enumerable:!0,get:function(){return o(f).default}});var v=n(442);Object.defineProperty(e,"HSSelect",{enumerable:!0,get:function(){return o(v).default}});var m=n(887);Object.defineProperty(e,"HSStepper",{enumerable:!0,get:function(){return o(m).default}});var g=n(97);Object.defineProperty(e,"HSStrongPassword",{enumerable:!0,get:function(){return o(g).default}});var y=n(166);Object.defineProperty(e,"HSTabs",{enumerable:!0,get:function(){return o(y).default}});var w=n(502);Object.defineProperty(e,"HSThemeSwitch",{enumerable:!0,get:function(){return o(w).default}});var b=n(684);Object.defineProperty(e,"HSToggleCount",{enumerable:!0,get:function(){return o(b).default}});var C=n(100);Object.defineProperty(e,"HSTogglePassword",{enumerable:!0,get:function(){return o(C).default}});var S=n(969);Object.defineProperty(e,"HSTooltip",{enumerable:!0,get:function(){return o(S).default}});var x=n(957);Object.defineProperty(e,"HSStaticMethods",{enumerable:!0,get:function(){return o(x).default}}),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery?e.HSDataTable=n(814).default:e.HSDataTable=null,"undefined"!=typeof _&&"undefined"!=typeof Dropzone?e.HSFileUpload=n(234).default:e.HSFileUpload=null},740: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 i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(self,(()=>(()=>{"use strict";var t={170:(t,e,n)=>{n.r(e),n.d(e,{afterMain:()=>C,afterRead:()=>w,afterWrite:()=>T,applyStyles:()=>P,arrow:()=>Z,auto:()=>l,basePlacements:()=>a,beforeMain:()=>b,beforeRead:()=>g,beforeWrite:()=>x,bottom:()=>o,clippingParents:()=>d,computeStyles:()=>nt,createPopper:()=>Pt,createPopperBase:()=>kt,createPopperLite:()=>Dt,detectOverflow:()=>yt,end:()=>u,eventListeners:()=>ot,flip:()=>wt,hide:()=>Ct,left:()=>s,main:()=>S,modifierPhases:()=>E,offset:()=>xt,placements:()=>m,popper:()=>h,popperGenerator:()=>_t,popperOffsets:()=>It,preventOverflow:()=>Tt,read:()=>y,reference:()=>f,right:()=>r,start:()=>c,top:()=>i,variationPlacements:()=>v,viewport:()=>p,write:()=>I});var i="top",o="bottom",r="right",s="left",l="auto",a=[i,o,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])}),[]),g="beforeRead",y="read",w="afterRead",b="beforeMain",S="main",C="afterMain",x="beforeWrite",I="write",T="afterWrite",E=[g,y,w,b,S,C,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 _(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]||{},i=e.attributes[t]||{},o=e.elements[t];_(o)&&O(o)&&(Object.assign(o.style,n),Object.keys(i).forEach((function(t){var e=i[t];!1===e?o.removeAttribute(t):o.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 i=e.elements[t],o=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});_(i)&&O(i)&&(Object.assign(i.style,r),Object.keys(o).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]};function D(t){return t.split("-")[0]}var B=Math.max,q=Math.min,H=Math.round;function M(){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 N(){return!/^((?!chrome|android).)*safari/i.test(M())}function j(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var i=t.getBoundingClientRect(),o=1,r=1;e&&_(t)&&(o=t.offsetWidth>0&&H(i.width)/t.offsetWidth||1,r=t.offsetHeight>0&&H(i.height)/t.offsetHeight||1);var s=(A(t)?L(t):window).visualViewport,l=!N()&&n,a=(i.left+(l&&s?s.offsetLeft:0))/o,c=(i.top+(l&&s?s.offsetTop:0))/r,u=i.width/o,d=i.height/r;return{width:u,height:d,top:c,right:a+u,bottom:c+d,left:a,x:a,y:c}}function $(t){var e=j(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function V(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&k(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function R(t){return L(t).getComputedStyle(t)}function F(t){return["table","td","th"].indexOf(O(t))>=0}function W(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)||W(t)}function z(t){return _(t)&&"fixed"!==R(t).position?t.offsetParent:null}function Q(t){for(var e=L(t),n=z(t);n&&F(n)&&"static"===R(n).position;)n=z(n);return n&&("html"===O(n)||"body"===O(n)&&"static"===R(n).position)?e:n||function(t){var e=/firefox/i.test(M());if(/Trident/i.test(M())&&_(t)&&"fixed"===R(t).position)return null;var n=U(t);for(k(n)&&(n=n.host);_(n)&&["html","body"].indexOf(O(n))<0;){var i=R(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(t)||e}function J(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function K(t,e,n){return B(t,q(e,n))}function Y(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 Z={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=D(n.placement),h=J(p),f=[s,r].indexOf(p)>=0?"height":"width";if(u&&d){var v=function(t,e){return Y("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:X(t,a))}(c.padding,n),m=$(u),g="y"===h?i:s,y="y"===h?o:r,w=n.rects.reference[f]+n.rects.reference[h]-d[h]-n.rects.popper[f],b=d[h]-n.rects.reference[h],S=Q(u),C=S?"y"===h?S.clientHeight||0:S.clientWidth||0:0,x=w/2-b/2,I=v[g],T=C-m[f]-v[y],E=C/2-m[f]/2+x,O=K(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,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&V(e.elements.popper,i)&&(e.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function G(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,g=d.x,y=void 0===g?0:g,w=d.y,b=void 0===w?0:w,S="function"==typeof v?v({x:y,y:b}):{x:y,y:b};y=S.x,b=S.y;var C=d.hasOwnProperty("x"),x=d.hasOwnProperty("y"),I=s,T=i,E=window;if(f){var O=Q(n),A="clientHeight",_="clientWidth";if(O===L(n)&&"static"!==R(O=W(n)).position&&"absolute"===p&&(A="scrollHeight",_="scrollWidth"),a===i||(a===s||a===r)&&c===u)T=o,b-=(m&&O===E&&E.visualViewport?E.visualViewport.height:O[A])-l.height,b*=h?1:-1;if(a===s||(a===i||a===o)&&c===u)I=r,y-=(m&&O===E&&E.visualViewport?E.visualViewport.width:O[_])-l.width,y*=h?1:-1}var k,P=Object.assign({position:p},f&&tt),D=!0===v?function(t,e){var n=t.x,i=t.y,o=e.devicePixelRatio||1;return{x:H(n*o)/o||0,y:H(i*o)/o||0}}({x:y,y:b},L(n)):{x:y,y:b};return y=D.x,b=D.y,h?Object.assign({},P,((k={})[T]=x?"0":"",k[I]=C?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",k)):Object.assign({},P,((e={})[T]=x?b+"px":"",e[I]=C?y+"px":"",e.transform="",e))}const nt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,i=n.gpuAcceleration,o=void 0===i||i,r=n.adaptive,s=void 0===r||r,l=n.roundOffsets,a=void 0===l||l,c={placement:D(e.placement),variation:G(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,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 it={passive:!0};const ot={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,i=t.options,o=i.scroll,r=void 0===o||o,s=i.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,it)})),l&&a.addEventListener("resize",n.update,it),function(){r&&c.forEach((function(t){t.removeEventListener("scroll",n.update,it)})),l&&a.removeEventListener("resize",n.update,it)}},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 j(W(t)).left+ct(t).scrollLeft}function dt(t){var e=R(t),n=e.overflow,i=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+i)}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 i=pt(t),o=i===(null==(n=t.ownerDocument)?void 0:n.body),r=L(i),s=o?[r].concat(r.visualViewport||[],dt(i)?i:[]):i,l=e.concat(s);return o?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),i=W(t),o=n.visualViewport,r=i.clientWidth,s=i.clientHeight,l=0,a=0;if(o){r=o.width,s=o.height;var c=N();(c||!c&&"fixed"===e)&&(l=o.offsetLeft,a=o.offsetTop)}return{width:r,height:s,x:l+ut(t),y:a}}(t,n)):A(e)?function(t,e){var n=j(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=W(t),i=ct(t),o=null==(e=t.ownerDocument)?void 0:e.body,r=B(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=B(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-i.scrollLeft+ut(t),a=-i.scrollTop;return"rtl"===R(o||n).direction&&(l+=B(n.clientWidth,o?o.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}(W(t)))}function mt(t,e,n,i){var o="clippingParents"===e?function(t){var e=ht(U(t)),n=["absolute","fixed"].indexOf(R(t).position)>=0&&_(t)?Q(t):t;return A(n)?e.filter((function(t){return A(t)&&V(t,n)&&"body"!==O(t)})):[]}(t):[].concat(e),r=[].concat(o,[n]),s=r[0],l=r.reduce((function(e,n){var o=vt(t,n,i);return e.top=B(o.top,e.top),e.right=q(o.right,e.right),e.bottom=q(o.bottom,e.bottom),e.left=B(o.left,e.left),e}),vt(t,s,i));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function gt(t){var e,n=t.reference,l=t.element,a=t.placement,d=a?D(a):null,p=a?G(a):null,h=n.x+n.width/2-l.width/2,f=n.y+n.height/2-l.height/2;switch(d){case i:e={x:h,y:n.y-l.height};break;case o: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?J(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 yt(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,g=n.rootBoundary,y=void 0===g?p:g,w=n.elementContext,b=void 0===w?h:w,S=n.altBoundary,C=void 0!==S&&S,x=n.padding,I=void 0===x?0:x,T=Y("number"!=typeof I?I:X(I,a)),E=b===h?f:h,O=t.rects.popper,L=t.elements[C?E:b],_=mt(A(L)?L:L.contextElement||W(t.elements.popper),m,y,u),k=j(t.elements.reference),P=gt({reference:k,element:O,strategy:"absolute",placement:l}),D=ft(Object.assign({},O,P)),B=b===h?D:k,q={top:_.top-B.top+T.top,bottom:B.bottom-_.bottom+T.bottom,left:_.left-B.left+T.left,right:B.right-_.right+T.right},H=t.modifiersData.offset;if(b===h&&H){var M=H[l];Object.keys(q).forEach((function(t){var e=[r,o].indexOf(t)>=0?1:-1,n=[i,o].indexOf(t)>=0?"y":"x";q[t]+=M[n]*e}))}return q}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,g=n.fallbackPlacements,y=n.padding,w=n.boundary,b=n.rootBoundary,S=n.altBoundary,C=n.flipVariations,x=void 0===C||C,I=n.allowedAutoPlacements,T=e.options.placement,E=D(T),O=g||(E===T||!x?[st(T)]:function(t){if(D(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(D(n)===l?function(t,e){void 0===e&&(e={});var n=e,i=n.placement,o=n.boundary,r=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=void 0===c?m:c,d=G(i),p=d?l?v:v.filter((function(t){return G(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]=yt(t,{placement:n,boundary:o,rootBoundary:r,padding:s})[D(n)],e}),{});return Object.keys(f).sort((function(t,e){return f[t]-f[e]}))}(e,{placement:n,boundary:w,rootBoundary:b,padding:y,flipVariations:x,allowedAutoPlacements:I}):n)}),[]),A=e.rects.reference,_=e.rects.popper,k=new Map,P=!0,B=L[0],q=0;q=0,$=j?"width":"height",V=yt(e,{placement:H,boundary:w,rootBoundary:b,altBoundary:S,padding:y}),R=j?N?r:s:N?o:i;A[$]>_[$]&&(R=st(R));var F=st(R),W=[];if(p&&W.push(V[M]<=0),f&&W.push(V[R]<=0,V[F]<=0),W.every((function(t){return t}))){B=H,P=!1;break}k.set(H,W)}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 B=e,"break"},z=x?3:1;z>0;z--){if("break"===U(z))break}e.placement!==B&&(e.modifiersData[u]._skip=!0,e.placement=B,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 St(t){return[i,r,o,s].some((function(e){return t[e]>=0}))}const Ct={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,i=e.rects.reference,o=e.rects.popper,r=e.modifiersData.preventOverflow,s=yt(e,{elementContext:"reference"}),l=yt(e,{altBoundary:!0}),a=bt(s,i),c=bt(l,o,r),u=St(a),d=St(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,o=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 o=D(t),l=[s,i].indexOf(o)>=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(o)>=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[o]=c}};const It={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=gt({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,v=n.altBoundary,m=n.padding,g=n.tether,y=void 0===g||g,w=n.tetherOffset,b=void 0===w?0:w,S=yt(e,{boundary:h,rootBoundary:f,padding:m,altBoundary:v}),C=D(e.placement),x=G(e.placement),I=!x,T=J(C),E="x"===T?"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,H={x:0,y:0};if(O){if(u){var M,N="y"===T?i:s,j="y"===T?o:r,V="y"===T?"height":"width",R=O[T],F=R+S[N],W=R-S[j],U=y?-A[V]/2:0,z=x===c?L[V]:A[V],Y=x===c?-A[V]:-L[V],X=e.elements.arrow,Z=y&&X?$(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[N],nt=tt[j],it=K(0,L[V],Z[V]),ot=I?L[V]/2-U-it-et-k.mainAxis:z-it-et-k.mainAxis,rt=I?-L[V]/2+U+it+nt+k.mainAxis:Y+it+nt+k.mainAxis,st=e.elements.arrow&&Q(e.elements.arrow),lt=st?"y"===T?st.clientTop||0:st.clientLeft||0:0,at=null!=(M=null==P?void 0:P[T])?M:0,ct=R+rt-at,ut=K(y?q(F,R+ot-at-lt):F,R,y?B(W,ct):W);O[T]=ut,H[T]=ut-R}if(p){var dt,pt="x"===T?i:s,ht="x"===T?o:r,ft=O[E],vt="y"===E?"height":"width",mt=ft+S[pt],gt=ft-S[ht],wt=-1!==[i,s].indexOf(C),bt=null!=(dt=null==P?void 0:P[E])?dt:0,St=wt?mt:ft-L[vt]-A[vt]-bt+k.altAxis,Ct=wt?ft+L[vt]+A[vt]-bt-k.altAxis:gt,xt=y&&wt?function(t,e,n){var i=K(t,e,n);return i>n?n:i}(St,ft,Ct):K(y?St:mt,ft,y?Ct:gt);O[E]=xt,H[E]=xt-ft}e.modifiersData[l]=H}},requiresIfExists:["offset"]};function Et(t,e,n){void 0===n&&(n=!1);var i,o,r=_(e),s=_(e)&&function(t){var e=t.getBoundingClientRect(),n=H(e.width)/t.offsetWidth||1,i=H(e.height)/t.offsetHeight||1;return 1!==n||1!==i}(e),l=W(e),a=j(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==O(e)||dt(l))&&(c=(i=e)!==L(i)&&_(i)?{scrollLeft:(o=i).scrollLeft,scrollTop:o.scrollTop}:ct(i)),_(e)?((u=j(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,i=[];function o(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var i=e.get(t);i&&o(i)}})),i.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||o(t)})),i}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={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},158:function(t,e,n){ /* - * HSAccordion - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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 .hs-accordion.active")&&this.group.querySelector(":scope > .hs-accordion.active")!==this.el&&window.$hsAccordionCollection.find((function(t){return t.element.el===e.group.querySelector(":scope > .hs-accordion.active")})).element.hide();if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.content.style.display="block",this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px")})),(0,l.afterTransition)(this.content,(function(){e.content.style.display="block",e.content.style.height="",e.fireEvent("open",e.el),(0,l.dispatch)("open.hs.accordion",e.el,e.el)}))},e.prototype.hide=function(){var t,e=this;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),(0,l.afterTransition)(this.content,(function(){e.content.style.display="",e.content.style.height="0",e.fireEvent("close",e.el),(0,l.dispatch)("close.hs.accordion",e.el,e.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.treeView=function(){var t=this;if(!document.querySelectorAll(".hs-accordion-treeview-root").length)return!1;this.selectable=[],document.querySelectorAll(".hs-accordion-treeview-root").forEach((function(e){var n=null==e?void 0:e.getAttribute("data-hs-accordion-options"),o=n?JSON.parse(n):{};t.selectable.push({el:e,options:r({},o)})})),this.selectable.length&&this.selectable.forEach((function(e){e.el.querySelectorAll(".hs-accordion-selectable").forEach((function(n){n.addEventListener("click",(function(o){o.stopPropagation(),t.toggleSelected(e,n)}))}))}))},e.toggleSelected=function(t,e){e.classList.contains("selected")?e.classList.remove("selected"):(t.el.querySelectorAll(".hs-accordion-selectable").forEach((function(t){return t.classList.remove("selected")})),e.classList.add("selected"))},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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit(),document.querySelectorAll(".hs-accordion-treeview-root").length&&a.treeView()})),"undefined"!=typeof window&&(window.HSAccordion=a),e.default=a},961:(t,e)=>{ +var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.HSRangeSlider=e.HSFileUpload=e.HSDataTable=e.HSStaticMethods=e.HSTreeView=e.HSTooltip=e.HSTogglePassword=e.HSToggleCount=e.HSThemeSwitch=e.HSTextareaAutoHeight=e.HSTabs=e.HSStrongPassword=e.HSStepper=e.HSSelect=e.HSScrollspy=e.HSRemoveElement=e.HSPinInput=e.HSOverlay=e.HSInputNumber=e.HSDropdown=e.HSComboBox=e.HSCollapse=e.HSCarousel=e.HSAccordion=e.HSCopyMarkup=void 0;var o=n(406);Object.defineProperty(e,"HSCopyMarkup",{enumerable:!0,get:function(){return i(o).default}});var r=n(740);Object.defineProperty(e,"HSAccordion",{enumerable:!0,get:function(){return i(r).default}});var s=n(268);Object.defineProperty(e,"HSCarousel",{enumerable:!0,get:function(){return i(s).default}});var l=n(485);Object.defineProperty(e,"HSCollapse",{enumerable:!0,get:function(){return i(l).default}});var a=n(809);Object.defineProperty(e,"HSComboBox",{enumerable:!0,get:function(){return i(a).default}});var c=n(891);Object.defineProperty(e,"HSDropdown",{enumerable:!0,get:function(){return i(c).default}});var u=n(332);Object.defineProperty(e,"HSInputNumber",{enumerable:!0,get:function(){return i(u).default}});var d=n(850);Object.defineProperty(e,"HSOverlay",{enumerable:!0,get:function(){return i(d).default}});var p=n(60);Object.defineProperty(e,"HSPinInput",{enumerable:!0,get:function(){return i(p).default}});var h=n(911);Object.defineProperty(e,"HSRemoveElement",{enumerable:!0,get:function(){return i(h).default}});var f=n(751);Object.defineProperty(e,"HSScrollspy",{enumerable:!0,get:function(){return i(f).default}});var v=n(442);Object.defineProperty(e,"HSSelect",{enumerable:!0,get:function(){return i(v).default}});var m=n(887);Object.defineProperty(e,"HSStepper",{enumerable:!0,get:function(){return i(m).default}});var g=n(97);Object.defineProperty(e,"HSStrongPassword",{enumerable:!0,get:function(){return i(g).default}});var y=n(166);Object.defineProperty(e,"HSTabs",{enumerable:!0,get:function(){return i(y).default}});var w=n(144);Object.defineProperty(e,"HSTextareaAutoHeight",{enumerable:!0,get:function(){return i(w).default}});var b=n(502);Object.defineProperty(e,"HSThemeSwitch",{enumerable:!0,get:function(){return i(b).default}});var S=n(684);Object.defineProperty(e,"HSToggleCount",{enumerable:!0,get:function(){return i(S).default}});var C=n(100);Object.defineProperty(e,"HSTogglePassword",{enumerable:!0,get:function(){return i(C).default}});var x=n(969);Object.defineProperty(e,"HSTooltip",{enumerable:!0,get:function(){return i(x).default}});var I=n(772);Object.defineProperty(e,"HSTreeView",{enumerable:!0,get:function(){return i(I).default}});var T=n(957);Object.defineProperty(e,"HSStaticMethods",{enumerable:!0,get:function(){return i(T).default}}),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery?e.HSDataTable=n(814).default:e.HSDataTable=null,"undefined"!=typeof _&&"undefined"!=typeof Dropzone?e.HSFileUpload=n(234).default:e.HSFileUpload=null,void 0!==typeof noUiSlider?e.HSRangeSlider=n(347).default:e.HSRangeSlider=null},740:function(t,e,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSAccordion + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},268:function(t,e,n){ +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;n .hs-accordion.active")&&this.group.querySelector(":scope > .hs-accordion.active")!==this.el&&window.$hsAccordionCollection.find((function(t){return t.element.el===e.group.querySelector(":scope > .hs-accordion.active")})).element.hide();if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.content.style.display="block",this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px")})),(0,l.afterTransition)(this.content,(function(){e.content.style.display="block",e.content.style.height="",e.fireEvent("open",e.el),(0,l.dispatch)("open.hs.accordion",e.el,e.el)}))},e.prototype.hide=function(){var t,e=this;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),(0,l.afterTransition)(this.content,(function(){e.content.style.display="",e.content.style.height="0",e.fireEvent("close",e.el),(0,l.dispatch)("close.hs.accordion",e.el,e.el)}))},e.prototype.update=function(){var t=this;if(this.group=this.el.closest(".hs-accordion-group")||null,!this.group)return!1;this.isAlwaysOpened=this.group.hasAttribute("data-hs-accordion-always-open")||!1,window.$hsAccordionCollection.map((function(e){return e.id===t.el.id&&(e.element.group=t.group,e.element.isAlwaysOpened=t.isAlwaysOpened),e}))},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.treeView=function(){var t=this;if(!document.querySelectorAll(".hs-accordion-treeview-root").length)return!1;this.selectable=[],document.querySelectorAll(".hs-accordion-treeview-root").forEach((function(e){var n=null==e?void 0:e.getAttribute("data-hs-accordion-options"),i=n?JSON.parse(n):{};t.selectable.push({el:e,options:r({},i)})})),this.selectable.length&&this.selectable.forEach((function(e){e.el.querySelectorAll(".hs-accordion-selectable").forEach((function(n){n.addEventListener("click",(function(i){i.stopPropagation(),t.toggleSelected(e,n)}))}))}))},e.toggleSelected=function(t,e){e.classList.contains("selected")?e.classList.remove("selected"):(t.el.querySelectorAll(".hs-accordion-selectable").forEach((function(t){return t.classList.remove("selected")})),e.classList.add("selected"))},e.on=function(t,e,n){var i=window.$hsAccordionCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));i&&(i.element.events[t]=n)},e}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit(),document.querySelectorAll(".hs-accordion-treeview-root").length&&a.treeView()})),"undefined"!=typeof window&&(window.HSAccordion=a),e.default=a},961:(t,e)=>{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},268:function(t,e,n){ /* * HSCarousel - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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=this.calculateTransform(),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.calculateTransform=function(){var t=this.currentIndex*this.sliderWidth;return this.isRTL?"translate(".concat(t,"px, 0px)"):"translate(-".concat(t,"px, 0px)")},e.prototype.goToPrev=function(){0===this.currentIndex&&this.isInfiniteLoop?(this.currentIndex=this.slides.length-1,this.inner.style.transform=this.calculateTransform(),this.addCurrentClass()):0!==this.currentIndex&&(this.currentIndex-=1,this.inner.style.transform=this.calculateTransform(),this.addCurrentClass(),this.addDisabledClass())},e.prototype.goToNext=function(){this.currentIndex===this.slides.length-1&&this.isInfiniteLoop?(this.currentIndex=0,this.inner.style.transform=this.calculateTransform(),this.addCurrentClass()):this.currentIndext?s:-i:i>r?r:i<-t?s:i}())}},e.prototype.handleDragEnd=function(){var t=this;if(this.isDragging){this.isDragging=!1;var e=this.sliderWidth/this.getCurrentSlidesQty(),n=this.getTranslateXValue(),i=Math.round(n/e);this.isRTL&&(i=Math.round(n/e)),this.inner.classList.remove("dragging"),setTimeout((function(){t.calculateTransform(i),t.dots&&t.setCurrentDot(),t.dragStartX=null,t.initialTranslateX=null,t.inner.querySelectorAll("a.prevented-click").forEach((function(e){e.classList.remove("prevented-click"),e.removeEventListener("click",t.removeClickEventWhileDragging)}))}))}},e.prototype.getEventX=function(t){return t instanceof MouseEvent?t.clientX:t.touches[0].clientX},e.prototype.getCurrentSlidesQty=function(){var t=this;if("object"==typeof this.slidesQty){var e=document.body.clientWidth,n=0;return Object.keys(this.slidesQty).forEach((function(i){e>=(typeof i+1=="number"?t.slidesQty[i]:c.BREAKPOINTS[i])&&(n=t.slidesQty[i])})),n}return this.slidesQty},e.prototype.buildSnapSpacers=function(){var t=this.inner.querySelector(".hs-snap-before"),e=this.inner.querySelector(".hs-snap-after");t&&t.remove(),e&&e.remove();var n=this.sliderWidth,i=n/2-n/this.getCurrentSlidesQty()/2,o=(0,l.htmlToElement)('
')),r=(0,l.htmlToElement)('
'));this.inner.prepend(o),this.inner.appendChild(r)},e.prototype.initDots=function(){this.el.querySelectorAll(".hs-carousel-pagination-item").length?this.setDots():this.buildDots(),this.dots&&this.setCurrentDot()},e.prototype.buildDots=function(){this.dots.innerHTML="";for(var t=!this.isCentered&&this.slidesQty?this.slides.length-(this.getCurrentSlidesQty()-1):this.slides.length,e=0;en+o)&&(p=c-o),(ui+r)&&(h=d-r),t.scrollTo({left:p,top:h,behavior:"smooth"})},e.prototype.buildInfo=function(){this.infoTotal&&this.setInfoTotal(),this.infoCurrent&&this.setInfoCurrent()},e.prototype.setInfoTotal=function(){this.infoTotal.innerText="".concat(this.slides.length)},e.prototype.setInfoCurrent=function(){this.infoCurrent.innerText="".concat(this.currentIndex+1)},e.prototype.buildSingleDot=function(t){var e=(0,l.htmlToElement)("");return this.dotsItemClasses&&(0,l.classToClassList)(this.dotsItemClasses,e),this.singleDotEvents(e,t),e},e.prototype.singleDotEvents=function(t,e){var n=this;t.addEventListener("click",(function(){n.goTo(e),n.isAutoPlay&&(n.resetTimer(),n.setTimer())}))},e.prototype.observeResize=function(){var t=this;new ResizeObserver((0,l.debounce)((function(e){for(var n=0,i=e;n=this.currentIndex-e?i.classList.add("active"):i.classList.remove("active")}else{var o=this.isCentered?this.currentIndex+this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.currentIndex+this.getCurrentSlidesQty();this.slides.forEach((function(e,n){n>=t.currentIndex&&n *").forEach((function(t,n){return e(t,n)}))},e.prototype.setElementToDisabled=function(t){t.classList.add("disabled"),"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled")},e.prototype.unsetElementToDisabled=function(t){t.classList.remove("disabled"),"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled")},e.prototype.addDisabledClass=function(){if(!this.prev||!this.next)return!1;var t=getComputedStyle(this.inner).getPropertyValue("gap"),e=Math.floor(this.getCurrentSlidesQty()/2),n=0,i=0,o=!1,r=!1;this.isSnap?(n=this.currentIndex,i=this.hasSnapSpacers?this.slides.length-1:this.slides.length-e-1,o=this.hasSnapSpacers?0===n:this.getCurrentSlidesQty()%2==0?n-e<0:n-e==0,r=n>=i&&this.container.scrollLeft+this.container.clientWidth+(parseFloat(t)||0)>=this.container.scrollWidth):(o=0===(n=this.currentIndex),r=n>=(i=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty())),o?(this.unsetElementToDisabled(this.next),this.setElementToDisabled(this.prev)):r?(this.unsetElementToDisabled(this.prev),this.setElementToDisabled(this.next)):(this.unsetElementToDisabled(this.prev),this.unsetElementToDisabled(this.next))},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.getBoundingClientRect().width,this.calculateWidth(),this.sliderWidth!==this.inner.parentElement.getBoundingClientRect().width&&this.recalculateWidth()},e.prototype.calculateTransform=function(t){void 0!==t&&(this.currentIndex=t),this.currentIndex>this.slides.length-this.getCurrentSlidesQty()&&!this.isCentered&&(this.currentIndex=this.slides.length-this.getCurrentSlidesQty());var e=this.sliderWidth,n=e/this.getCurrentSlidesQty(),i=this.currentIndex*n;if(this.isSnap&&!this.isCentered&&this.container.scrollLefte&&(this.container.scrollLeft=this.container.scrollWidth),this.isCentered&&!this.isSnap){var o=(e-n)/2;if(0===this.currentIndex)i=-o;else if(this.currentIndex>=this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1)){i=this.slides.length*n-e+o}else i=this.currentIndex*n-o}this.isSnap||(this.inner.style.transform=this.isRTL?"translate(".concat(i,"px, 0px)"):"translate(".concat(-i,"px, 0px)")),this.isAutoHeight&&(this.inner.style.height="".concat(this.slides[this.currentIndex].clientHeight,"px")),this.dotsItems&&this.goToCurrentDot(),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass(),this.isSnap&&this.hasSnapSpacers&&this.buildSnapSpacers(),this.infoCurrent&&this.setInfoCurrent()},e.prototype.setTranslate=function(t){this.inner.style.transform=this.isRTL?"translate(".concat(-t,"px, 0px)"):"translate(".concat(t,"px, 0px)")},e.prototype.goToPrev=function(){if(this.currentIndex>0?this.currentIndex--:this.currentIndex=this.slides.length-this.getCurrentSlidesQty(),this.isSnap){var t=this.sliderWidth/this.getCurrentSlidesQty();this.container.scrollBy({left:Math.max(-this.container.scrollLeft,-t),behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()},e.prototype.goToNext=function(){var t=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty();if(this.currentIndexthis.currentIndex?e-this.currentIndex:this.currentIndex-e,o=e>this.currentIndex?-n*i:n*i;this.container.scrollBy({left:o,behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()},e.prototype.setIndex=function(t){this.currentIndex=t,this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()},e.getInstance=function(t,e){var n=window.$hsCarouselCollection.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.$hsCarouselCollection||(window.$hsCarouselCollection=[]),document.querySelectorAll("[data-hs-carousel]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsCarouselCollection.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}(a.default);window.addEventListener("load",(function(){u.autoInit()})),"undefined"!=typeof window&&(window.HSCarousel=u),e.default=u},485:function(t,e,n){ /* * HSCollapse - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(292),l=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,e=this;this.createCollection(window.$hsCollapseCollection,this),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.el.ariaExpanded="true":this.el.ariaExpanded="false"),this.el.addEventListener("click",(function(){e.content.classList.contains("open")?e.hide():e.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,e=this;if(this.animationInProcess||this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.add("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="true"),this.content.classList.add("open"),this.content.classList.remove("hidden"),this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px"),e.fireEvent("beforeOpen",e.el),(0,s.dispatch)("beforeOpen.hs.collapse",e.el,e.el)})),(0,s.afterTransition)(this.content,(function(){e.content.style.height="",e.fireEvent("open",e.el),(0,s.dispatch)("open.hs.collapse",e.el,e.el),e.animationInProcess=!1}))},e.prototype.hide=function(){var t,e=this;if(this.animationInProcess||!this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.remove("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),this.content.classList.remove("open"),(0,s.afterTransition)(this.content,(function(){e.content.classList.add("hidden"),e.content.style.height="",e.fireEvent("hide",e.el),(0,s.dispatch)("hide.hs.collapse",e.el,e.el),e.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}(r(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSCollapse=l),e.default=l},809:function(t,e,n){ +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.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(292),l=function(t){function e(e,n,i){var o=t.call(this,e,n,i)||this;return o.contentId=o.el.dataset.hsCollapse,o.content=document.querySelector(o.contentId),o.animationInProcess=!1,o.content&&o.init(),o}return o(e,t),e.prototype.init=function(){var t,e=this;this.createCollection(window.$hsCollapseCollection,this),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.el.ariaExpanded="true":this.el.ariaExpanded="false"),this.el.addEventListener("click",(function(){e.content.classList.contains("open")?e.hide():e.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,e=this;if(this.animationInProcess||this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.add("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="true"),this.content.classList.add("open"),this.content.classList.remove("hidden"),this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px"),e.fireEvent("beforeOpen",e.el),(0,s.dispatch)("beforeOpen.hs.collapse",e.el,e.el)})),(0,s.afterTransition)(this.content,(function(){e.content.style.height="",e.fireEvent("open",e.el),(0,s.dispatch)("open.hs.collapse",e.el,e.el),e.animationInProcess=!1}))},e.prototype.hide=function(){var t,e=this;if(this.animationInProcess||!this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.remove("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),this.content.classList.remove("open"),(0,s.afterTransition)(this.content,(function(){e.content.classList.add("hidden"),e.content.style.height="",e.fireEvent("hide",e.el),(0,s.dispatch)("hide.hs.collapse",e.el,e.el),e.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 i=window.$hsCollapseCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));i&&(i.element.events[t]=n)},e}(r(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSCollapse=l),e.default=l},809:function(t,e,n){ /* * HSComboBox - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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]\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t',_.outputEmptyTemplate=null!==(f=null==B?void 0:B.outputEmptyTemplate)&&void 0!==f?f:'
Nothing found...
',_.outputLoaderTemplate=null!==(v=null==B?void 0:B.outputLoaderTemplate)&&void 0!==v?v:'
\n\t\t\t\t
\n\t\t\t\t\tLoading...\n\t\t\t\t
\n\t\t\t
',_.groupingType=null!==(m=null==B?void 0:B.groupingType)&&void 0!==m?m:null,_.groupingTitleTemplate=null!==(g=null==B?void 0:B.groupingTitleTemplate)&&void 0!==g?g:"default"===_.groupingType?'
':'',_.tabsWrapperTemplate=null!==(y=null==B?void 0:B.tabsWrapperTemplate)&&void 0!==y?y:'
',_.preventSelection=null!==(w=null==B?void 0:B.preventSelection)&&void 0!==w&&w,_.preventAutoPosition=null!==(b=null==B?void 0:B.preventAutoPosition)&&void 0!==b&&b,_.isOpenOnFocus=null!==(C=null==B?void 0:B.isOpenOnFocus)&&void 0!==C&&C,_.input=null!==(S=_.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==S?S:null,_.output=null!==(x=_.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==x?x:null,_.itemsWrapper=null!==(I=_.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==I?I:null,_.items=null!==(T=Array.from(_.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==T?T:[],_.tabs=[],_.toggle=null!==(E=_.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==E?E:null,_.toggleClose=null!==(L=_.el.querySelector("[data-hs-combo-box-close]"))&&void 0!==L?L:null,_.toggleOpen=null!==(O=_.el.querySelector("[data-hs-combo-box-open]"))&&void 0!==O?O:null,_.outputPlaceholder=null,_.selected=_.value=null!==(A=_.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==A?A:"",_.isOpened=!1,_.isCurrent=!1,_.animationInProcess=!1,_.selectedGroup="all",_.init(),_}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.preventAutoPosition||this.recalculateDirection()),this.toggle&&this.buildToggle(),this.toggleClose&&this.buildToggleClose(),this.toggleOpen&&this.buildToggleOpen()},e.prototype.setResultAndRender=function(t){void 0===t&&(t="");var e=this.preventVisibility?this.input.value:t;this.setResults(e),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.input.value?t.el.classList.add("has-value"):t.el.classList.remove("has-value"),t.isOpened||t.open()})))},e.prototype.buildItems=function(){this.output.role="listbox",this.output.tabIndex=-1,this.output.ariaOrientation="vertical",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){var n,o,i,r=null!==(n=e.getAttribute("data-hs-combo-box-output-item-group-field"))&&void 0!==n?n:null,s=null!==(o=JSON.parse(e.getAttribute("data-hs-combo-box-output-item")))&&void 0!==o?o:null,l=null;return r&&(null===(i=null==s?void 0:s.group)||void 0===i?void 0:i.name)&&(l=t[r]),Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(e){var n;return(null===(n=null==s?void 0:s.group)||void 0===n?void 0:n.name)&&l?l===s.group.name&&e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]: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,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,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,u.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){var o=(0,u.htmlToElement)(e.outputItemTemplate);o.querySelectorAll("[data-hs-combo-box-output-item-field]").forEach((function(e){var n=t[e.getAttribute("data-hs-combo-box-output-item-field")],o=e.hasAttribute("data-hs-combo-box-output-item-hide-if-empty");e.textContent=null!=n?n:"",!n&&o&&(e.style.display="none")})),o.querySelectorAll("[data-hs-combo-box-search-text]").forEach((function(e){var n;e.setAttribute("data-hs-combo-box-search-text",null!==(n=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==n?n:"")})),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,u.htmlToElement)(this.tabsWrapperTemplate),n=(0,u.htmlToElement)('
');e.append(n),this.output.insertBefore(e,this.output.firstChild);var o=(0,u.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,u.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,u.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,e,n,o,i=this;this.isOpened?((null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="true")):((null===(n=null==this?void 0:this.toggle)||void 0===n?void 0:n.ariaExpanded)&&(this.toggle.ariaExpanded="false"),(null===(o=null==this?void 0:this.input)||void 0===o?void 0:o.ariaExpanded)&&(this.input.ariaExpanded="false")),this.toggle.addEventListener("click",(function(){i.isOpened?i.close():i.open(i.toggle.getAttribute("data-hs-combo-box-toggle"))}))},e.prototype.buildToggleClose=function(){var t=this;this.toggleClose.addEventListener("click",(function(){return t.close()}))},e.prototype.buildToggleOpen=function(){var t=this;this.toggleOpen.addEventListener("click",(function(){return t.open()}))},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,this.fireEvent("select",this.el),(0,u.dispatch)("select.hs.combobox",this.el,this.value)},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,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.preventAutoPosition||this.recalculateDirection(),setTimeout((function(){var t,n;(null===(t=null==e?void 0:e.input)||void 0===t?void 0:t.ariaExpanded)&&(e.input.ariaExpanded="true"),(null===(n=null==e?void 0:e.toggle)||void 0===n?void 0:n.ariaExpanded)&&(e.toggle.ariaExpanded="true"),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,n,o=this;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),!1):(this.animationInProcess=!0,(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="false"),(null===(n=null==this?void 0:this.toggle)||void 0===n?void 0:n.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.el.classList.remove("active"),this.preventAutoPosition||(this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom=""),(0,u.afterTransition)(this.output,(function(){o.output.style.display="none",o.setValueAndClear(t),o.animationInProcess=!1})),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),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 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.preventVisibility?t.element.isCurrent: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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+10&&o[o.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t',_.outputEmptyTemplate=null!==(f=null==D?void 0:D.outputEmptyTemplate)&&void 0!==f?f:'
Nothing found...
',_.outputLoaderTemplate=null!==(v=null==D?void 0:D.outputLoaderTemplate)&&void 0!==v?v:'
\n\t\t\t\t
\n\t\t\t\t\tLoading...\n\t\t\t\t
\n\t\t\t
',_.groupingType=null!==(m=null==D?void 0:D.groupingType)&&void 0!==m?m:null,_.groupingTitleTemplate=null!==(g=null==D?void 0:D.groupingTitleTemplate)&&void 0!==g?g:"default"===_.groupingType?'
':'',_.tabsWrapperTemplate=null!==(y=null==D?void 0:D.tabsWrapperTemplate)&&void 0!==y?y:'
',_.preventSelection=null!==(w=null==D?void 0:D.preventSelection)&&void 0!==w&&w,_.preventAutoPosition=null!==(b=null==D?void 0:D.preventAutoPosition)&&void 0!==b&&b,_.isOpenOnFocus=null!==(S=null==D?void 0:D.isOpenOnFocus)&&void 0!==S&&S,_.input=null!==(C=_.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==C?C:null,_.output=null!==(x=_.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==x?x:null,_.itemsWrapper=null!==(I=_.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==I?I:null,_.items=null!==(T=Array.from(_.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==T?T:[],_.tabs=[],_.toggle=null!==(E=_.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==E?E:null,_.toggleClose=null!==(O=_.el.querySelector("[data-hs-combo-box-close]"))&&void 0!==O?O:null,_.toggleOpen=null!==(L=_.el.querySelector("[data-hs-combo-box-open]"))&&void 0!==L?L:null,_.outputPlaceholder=null,_.selected=_.value=null!==(A=_.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==A?A:"",_.isOpened=!1,_.isCurrent=!1,_.animationInProcess=!1,_.selectedGroup="all",_.init(),_}return o(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.preventAutoPosition||this.recalculateDirection()),this.toggle&&this.buildToggle(),this.toggleClose&&this.buildToggleClose(),this.toggleOpen&&this.buildToggleOpen()},e.prototype.setResultAndRender=function(t){void 0===t&&(t="");var e=this.preventVisibility?this.input.value:t;this.setResults(e),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.input.value?t.el.classList.add("has-value"):t.el.classList.remove("has-value"),t.isOpened||t.open()})))},e.prototype.buildItems=function(){this.output.role="listbox",this.output.tabIndex=-1,this.output.ariaOrientation="vertical",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){var n,i,o,r=null!==(n=e.getAttribute("data-hs-combo-box-output-item-group-field"))&&void 0!==n?n:null,s=null!==(i=JSON.parse(e.getAttribute("data-hs-combo-box-output-item")))&&void 0!==i?i:null,l=null;return r&&(null===(o=null==s?void 0:s.group)||void 0===o?void 0:o.name)&&(l=t[r]),Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(e){var n;return(null===(n=null==s?void 0:s.group)||void 0===n?void 0:n.name)&&l?l===s.group.name&&e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]: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,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,n,i,o,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 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 n=i.filter((function(e){return e[r.apiGroupField]===t.name}));r.itemsWrapper?r.itemsWrapper.append(e):r.output.append(e),r.jsonItemsRender(n)}))):this.jsonItemsRender(i),this.setResults(this.input.value),[3,5];case 4:return o=s.sent(),console.error(o),[3,5];case 5:return this.destroyOutputLoader(),[2]}}))}))},e.prototype.jsonItemsRender=function(t){var e=this;t.forEach((function(t,n){var i=(0,u.htmlToElement)(e.outputItemTemplate);i.querySelectorAll("[data-hs-combo-box-output-item-field]").forEach((function(e){var n=t[e.getAttribute("data-hs-combo-box-output-item-field")],i=e.hasAttribute("data-hs-combo-box-output-item-hide-if-empty");e.textContent=null!=n?n:"",!n&&i&&(e.style.display="none")})),i.querySelectorAll("[data-hs-combo-box-search-text]").forEach((function(e){var n;e.setAttribute("data-hs-combo-box-search-text",null!==(n=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==n?n:"")})),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(n){e.setAttribute(n.attr,t[n.valueFrom])}))})),i.setAttribute("tabIndex","".concat(n)),"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 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 i=t[e.apiGroupField];n.some((function(t){return t.name===i}))||n.push({name:i,title:i})})),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"),i=e.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text");return ni?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,u.htmlToElement)(this.tabsWrapperTemplate),n=(0,u.htmlToElement)('
');e.append(n),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),n.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),n.append(i),i.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,u.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 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,e,n,i,o=this;this.isOpened?((null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="true")):((null===(n=null==this?void 0:this.toggle)||void 0===n?void 0:n.ariaExpanded)&&(this.toggle.ariaExpanded="false"),(null===(i=null==this?void 0:this.input)||void 0===i?void 0:i.ariaExpanded)&&(this.input.ariaExpanded="false")),this.toggle.addEventListener("click",(function(){o.isOpened?o.close():o.open(o.toggle.getAttribute("data-hs-combo-box-toggle"))}))},e.prototype.buildToggleClose=function(){var t=this;this.toggleClose.addEventListener("click",(function(){return t.close()}))},e.prototype.buildToggleOpen=function(){var t=this;this.toggleOpen.addEventListener("click",(function(){return t.open()}))},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,this.fireEvent("select",this.el),(0,u.dispatch)("select.hs.combobox",this.el,this.value)},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,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.preventAutoPosition||this.recalculateDirection(),setTimeout((function(){var t,n;(null===(t=null==e?void 0:e.input)||void 0===t?void 0:t.ariaExpanded)&&(e.input.ariaExpanded="true"),(null===(n=null==e?void 0:e.toggle)||void 0===n?void 0:n.ariaExpanded)&&(e.toggle.ariaExpanded="true"),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,n,i=this;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),!1):(this.animationInProcess=!0,(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="false"),(null===(n=null==this?void 0:this.toggle)||void 0===n?void 0:n.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.el.classList.remove("active"),this.preventAutoPosition||(this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom=""),(0,u.afterTransition)(this.output,(function(){i.output.style.display="none",i.setValueAndClear(t),i.animationInProcess=!1})),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),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 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"),i=n?JSON.parse(n):{};new e(t,i)}})),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.preventVisibility?t.element.isCurrent: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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 i=window.$hsComboBoxCollection.find((function(t){return t.element.preventVisibility?t.element.isCurrent:t.element.isOpened}));if(i){var o=null!==(n=i.element.itemsWrapper)&&void 0!==n?n:i.element.output;if(!o)return!1;var r,s=e.getPreparedItems(t,o),l=o.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,l.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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=a),e.default=a},814:function(t,e,n){ +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;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,l.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,l.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"),i=n?JSON.parse(n):{};new e(t,i)}}))},e}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=a),e.default=a},814:function(t,e,n){ /* * HSDataTable - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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&&(this.buildPagingPage(1),l>2&&this.pagingPages.appendChild((0,a.htmlToElement)('...')));for(var u=l;u<=c;u++)this.buildPagingPage(u);c...')),this.buildPagingPage(r)),this.disablePagingArrow(this.pagingPrev,0===e),this.disablePagingArrow(this.pagingNext,e===n-1),this.hidePagingIfSinglePage()},e.prototype.buildPagingPage=function(t){var e=this,n=this.dataTable.page.info().page,o=(0,a.htmlToElement)('');o.innerText="".concat(t),o.setAttribute("data-page","".concat(t)),this.pageBtnClasses&&(0,a.classToClassList)(this.pageBtnClasses,o),n===t-1&&o.classList.add("active"),o.addEventListener("click",(function(){return e.onPageClick(t)})),this.pagingPages.append(o)},e.prototype.onPageClick=function(t){this.dataTable.page(t-1).draw("page")},e.prototype.initRowSelecting=function(){var t=this;this.rowSelectingAll.addEventListener("change",(function(){return t.onSelectAllChange()}))},e.prototype.triggerChangeEventToRow=function(){var t=this;this.table.querySelectorAll("tbody ".concat(this.rowSelectingIndividual)).forEach((function(e){e.addEventListener("change",(function(){t.updateSelectAllCheckbox()}))}))},e.prototype.onSelectAllChange=function(){var t=this,e=this.rowSelectingAll.checked;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var o=n.querySelector(t.rowSelectingIndividual);o&&(o.checked=e)})),this.updateSelectAllCheckbox()},e.prototype.updateSelectAllCheckbox=function(){var t=this;if(!this.dataTable.rows({search:"applied"}).count())return this.rowSelectingAll.checked=!1,!1;var e=!0;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var o=n.querySelector(t.rowSelectingIndividual);if(o&&!o.checked)return e=!1,!1})),this.rowSelectingAll.checked=e},e.getInstance=function(t,e){var n=window.$hsDataTableCollection.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.$hsDataTableCollection||(window.$hsDataTableCollection=[]),document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDataTableCollection.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}(l(n(961)).default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").length&&("undefined"==typeof jQuery&&console.error("HSDataTable: jQuery is not available, please add it to the page."),"undefined"==typeof DataTable&&console.error("HSDataTable: DataTable is not available, please add it to the page.")),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery&&c.autoInit()})),"undefined"!=typeof window&&(window.HSDataTable=c),e.default=c},891:function(t,e,n){ +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;n1&&(this.buildPagingPage(1),l>2&&this.pagingPages.appendChild((0,a.htmlToElement)('...')));for(var u=l;u<=c;u++)this.buildPagingPage(u);c...')),this.buildPagingPage(r)),this.disablePagingArrow(this.pagingPrev,0===e),this.disablePagingArrow(this.pagingNext,e===n-1),this.hidePagingIfSinglePage()},e.prototype.buildPagingPage=function(t){var e=this,n=this.dataTable.page.info().page,i=(0,a.htmlToElement)('');i.innerText="".concat(t),i.setAttribute("data-page","".concat(t)),this.pageBtnClasses&&(0,a.classToClassList)(this.pageBtnClasses,i),n===t-1&&i.classList.add("active"),i.addEventListener("click",(function(){return e.onPageClick(t)})),this.pagingPages.append(i)},e.prototype.onPageClick=function(t){this.dataTable.page(t-1).draw("page")},e.prototype.initRowSelecting=function(){var t=this;this.rowSelectingAll.addEventListener("change",(function(){return t.onSelectAllChange()}))},e.prototype.triggerChangeEventToRow=function(){var t=this;this.table.querySelectorAll("tbody ".concat(this.rowSelectingIndividual)).forEach((function(e){e.addEventListener("change",(function(){t.updateSelectAllCheckbox()}))}))},e.prototype.onSelectAllChange=function(){var t=this,e=this.rowSelectingAll.checked;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var i=n.querySelector(t.rowSelectingIndividual);i&&(i.checked=e)})),this.updateSelectAllCheckbox()},e.prototype.updateSelectAllCheckbox=function(){var t=this;if(!this.dataTable.rows({search:"applied"}).count())return this.rowSelectingAll.checked=!1,!1;var e=!0;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var i=n.querySelector(t.rowSelectingIndividual);if(i&&!i.checked)return e=!1,!1})),this.rowSelectingAll.checked=e},e.getInstance=function(t,e){var n=window.$hsDataTableCollection.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.$hsDataTableCollection||(window.$hsDataTableCollection=[]),document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDataTableCollection.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}(l(n(961)).default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").length&&("undefined"==typeof jQuery&&console.error("HSDataTable: jQuery is not available, please add it to the page."),"undefined"==typeof DataTable&&console.error("HSDataTable: DataTable is not available, please add it to the page.")),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery&&c.autoInit()})),"undefined"!=typeof window&&(window.HSDataTable=c),e.default=c},891:function(t,e,n){ /* * HSDropdown - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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.querySelector(":scope > .hs-dropdown-toggle-wrapper > .hs-dropdown-toggle")||i.el.children[0],i.closers=Array.from(i.el.querySelectorAll(":scope .hs-dropdown-close"))||null,i.menu=i.el.querySelector(":scope > .hs-dropdown-menu"),i.eventMode=(0,l.getClassProperty)(i.el,"--trigger","click"),i.closeMode=(0,l.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&&this.buildToggle(),this.menu&&this.buildMenu(),this.closers&&this.buildClosers(),(0,l.isIOS)()||(0,l.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return t.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return t.onMouseLeaveHandler()})))},e.prototype.resizeHandler=function(){this.eventMode=(0,l.getClassProperty)(this.el,"--trigger","click"),this.closeMode=(0,l.getClassProperty)(this.el,"--auto-close","true")},e.prototype.buildToggle=function(){var t,e=this;(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(t){return e.onClickHandler(t)}))},e.prototype.buildMenu=function(){this.menu.role="menu"},e.prototype.buildClosers=function(){var t=this;this.closers.forEach((function(e){e.addEventListener("click",(function(){return t.close()}))}))},e.prototype.onClickHandler=function(t){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}}]},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(" ","")),s=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ","");"static"!==o&&(this.el._popper=(0,a.createPopper)(this.el,this.menu,{placement:u.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]}},{name:"computeStyles",options:{adaptive:"fixed"===o,gpuAcceleration:"true"===s}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){var e;(null===(e=null==t?void 0:t.toggle)||void 0===e?void 0:e.ariaExpanded)&&(t.toggle.ariaExpanded="true"),t.el.classList.add("open"),t.animationInProcess=!1})),this.fireEvent("open",this.el),(0,l.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;var n;if(this.animationInProcess=!0,t){var o=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,l.afterTransition)(o,(function(){return e.destroyPopper()}))}else this.destroyPopper();e.menu.style.margin=null,(null===(n=null==e?void 0:e.toggle)||void 0===n?void 0:n.ariaExpanded)&&(e.toggle.ariaExpanded="false"),e.el.classList.remove("open"),e.fireEvent("close",e.el),(0,l.dispatch)("close.hs.dropdown",e.el,e.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=l.menuSearchHistory;var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e&&(u.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")&&!e.element.menu.querySelector("textarea: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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")||o.el.querySelector(":scope > .hs-dropdown-toggle-wrapper > .hs-dropdown-toggle")||o.el.children[0],o.closers=Array.from(o.el.querySelectorAll(":scope .hs-dropdown-close"))||null,o.menu=o.el.querySelector(":scope > .hs-dropdown-menu"),o.eventMode=(0,l.getClassProperty)(o.el,"--trigger","click"),o.closeMode=(0,l.getClassProperty)(o.el,"--auto-close","true"),o.animationInProcess=!1,o.toggle&&o.menu&&o.init(),o}return o(e,t),e.prototype.init=function(){var t=this;if(this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle&&this.buildToggle(),this.menu&&this.buildMenu(),this.closers&&this.buildClosers(),(0,l.isIOS)()||(0,l.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return t.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return t.onMouseLeaveHandler()})))},e.prototype.resizeHandler=function(){this.eventMode=(0,l.getClassProperty)(this.el,"--trigger","click"),this.closeMode=(0,l.getClassProperty)(this.el,"--auto-close","true")},e.prototype.buildToggle=function(){var t,e=this;(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(t){return e.onClickHandler(t)}))},e.prototype.buildMenu=function(){this.menu.role="menu"},e.prototype.buildClosers=function(){var t=this;this.closers.forEach((function(e){e.addEventListener("click",(function(){return t.close()}))}))},e.prototype.onClickHandler=function(t){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(" ",""),i=(window.getComputedStyle(t.el).getPropertyValue("--adaptive")||"adaptive").replace(" ","");e.state.elements.popper.style.position=n,e.state.elements.popper.style.transform="adaptive"===i?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}}]},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(" ",""),i=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),o=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ","")),s=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ","");"static"!==i&&(this.el._popper=(0,a.createPopper)(this.el,this.menu,{placement:u.POSITIONS[e]||"bottom-start",strategy:i,modifiers:r(r([],"fixed"!==i?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===n},{name:"offset",options:{offset:[0,o]}},{name:"computeStyles",options:{adaptive:"fixed"===i,gpuAcceleration:"true"===s}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){var e;(null===(e=null==t?void 0:t.toggle)||void 0===e?void 0:e.ariaExpanded)&&(t.toggle.ariaExpanded="true"),t.el.classList.add("open"),t.animationInProcess=!1})),this.fireEvent("open",this.el),(0,l.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;var n;if(this.animationInProcess=!0,t){var i=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,l.afterTransition)(i,(function(){return e.destroyPopper()}))}else this.destroyPopper();e.menu.style.margin=null,(null===(n=null==e?void 0:e.toggle)||void 0===n?void 0:n.ariaExpanded)&&(e.toggle.ariaExpanded="false"),e.el.classList.remove("open"),e.fireEvent("close",e.el),(0,l.dispatch)("close.hs.dropdown",e.el,e.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=l.menuSearchHistory;var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e&&(u.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")&&!e.element.menu.querySelector("textarea: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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 i=(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")})),o=n.querySelector("a:focus, button:focus"),r=i.findIndex((function(t){return t===o}));r+1\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t.\n\t\t\t\t\t\t

\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t0%\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t',s.extensions=_.merge({default:{icon:'',class:"size-5"},xls:{icon:'',class:"size-5"},doc:{icon:'',class:"size-5"},zip:{icon:'',class:"size-5"}},a.extensions),s.singleton=a.singleton,s.concatOptions=r(r({clickable:s.el.querySelector("[data-hs-file-upload-trigger]"),previewsContainer:s.el.querySelector("[data-hs-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:s.previewTemplate,autoHideTrigger:!1},a),n),s.init(),s}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsFileUploadCollection,this),this.initDropzone()},e.prototype.initDropzone=function(){var t=this,e=this.el.querySelector("[data-hs-file-upload-clear]"),n=Array.from(this.el.querySelectorAll("[data-hs-file-upload-pseudo-trigger]"));this.dropzone=new Dropzone(this.el,this.concatOptions),this.dropzone.on("addedfile",(function(e){return t.onAddFile(e)})),this.dropzone.on("removedfile",(function(){return t.onRemoveFile()})),this.dropzone.on("uploadprogress",(function(e,n){return t.onUploadProgress(e,n)})),this.dropzone.on("complete",(function(e){return t.onComplete(e)})),e&&(e.onclick=function(){t.dropzone.files.length&&t.dropzone.removeAllFiles(!0)}),n.length&&n.forEach((function(e){e.onclick=function(){var e,n;(null===(e=t.concatOptions)||void 0===e?void 0:e.clickable)&&(null===(n=t.concatOptions)||void 0===n?void 0:n.clickable).click()}}))},e.prototype.onAddFile=function(t){var e=this,n=t.previewElement,o=t.previewElement.querySelector("[data-hs-file-upload-reload]");if(!n)return!1;this.singleton&&this.dropzone.files.length>1&&this.dropzone.removeFile(this.dropzone.files[0]),o&&o.addEventListener("click",(function(n){n.preventDefault(),n.stopPropagation();var o=document.createElement("input");o.type="file",o.click(),o.addEventListener("change",(function(n){var o,i=null===(o=n.target.files)||void 0===o?void 0:o[0];if(i){var r=i;r.status=Dropzone.ADDED,r.accepted=!0,r.previewElement=t.previewElement,r.previewTemplate=t.previewTemplate,r.previewsContainer=t.previewsContainer,e.dropzone.removeFile(t),e.dropzone.addFile(r)}}))})),this.previewAccepted(t)},e.prototype.previewAccepted=function(t){var e=this,n=t.previewElement,o=this.splitFileName(t.name),i=n.querySelector("[data-hs-file-upload-file-name]"),r=n.querySelector("[data-hs-file-upload-file-ext]"),s=n.querySelector("[data-hs-file-upload-file-size]"),l=n.querySelector("[data-hs-file-upload-file-icon]"),a=this.el.querySelector("[data-hs-file-upload-trigger]"),c=n.querySelector("[data-dz-thumbnail]"),u=n.querySelector("[data-hs-file-upload-remove]");i&&(i.textContent=o.name),r&&(r.textContent=o.extension),s&&(s.textContent=this.formatFileSize(t.size)),c&&(t.type.includes("image/")?c.classList.remove("hidden"):this.setIcon(o.extension,l)),this.dropzone.files.length>0&&this.concatOptions.autoHideTrigger&&(a.style.display="none"),u&&(u.onclick=function(){return e.dropzone.removeFile(t)})},e.prototype.onRemoveFile=function(){var t=this.el.querySelector("[data-hs-file-upload-trigger]");0===this.dropzone.files.length&&this.concatOptions.autoHideTrigger&&(t.style.display="")},e.prototype.onUploadProgress=function(t,e){var n=t.previewElement;if(!n)return!1;var o=n.querySelector("[data-hs-file-upload-progress-bar]"),i=n.querySelector("[data-hs-file-upload-progress-bar-pane]"),r=n.querySelector("[data-hs-file-upload-progress-bar-value]"),s=Math.floor(e);o&&o.setAttribute("aria-valuenow","".concat(s)),i&&(i.style.width="".concat(s,"%")),r&&(r.innerText="".concat(s))},e.prototype.onComplete=function(t){var e=t.previewElement;if(!e)return!1;e.classList.add("complete")},e.prototype.setIcon=function(t,e){var n=this.createIcon(t);e.append(n)},e.prototype.createIcon=function(t){var e,n,o=(null===(e=this.extensions[t])||void 0===e?void 0:e.icon)?(0,l.htmlToElement)(this.extensions[t].icon):(0,l.htmlToElement)(this.extensions.default.icon);return(0,l.classToClassList)((null===(n=this.extensions[t])||void 0===n?void 0:n.class)?this.extensions[t].class:this.extensions.default.class,o),o},e.prototype.formatFileSize=function(t){return t<1024?t.toFixed(2)+" B":t<1048576?(t/1024).toFixed(2)+" KB":t<1073741824?(t/1048576).toFixed(2)+" MB":t<1099511627776?(t/1073741824).toFixed(2)+" GB":(t/1099511627776).toFixed(2)+" TB"},e.prototype.splitFileName=function(t){var e=t.lastIndexOf(".");return-1==e?{name:t,extension:""}:{name:t.substring(0,e),extension:t.substring(e+1)}},e.getInstance=function(t,e){var n=window.$hsFileUploadCollection.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.$hsFileUploadCollection||(window.$hsFileUploadCollection=[]),document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsFileUploadCollection.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}(a.default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").length&&("undefined"==typeof _&&console.error("HSFileUpload: Lodash is not available, please add it to the page."),"undefined"==typeof Dropzone&&console.error("HSFileUpload: Dropzone is not available, please add it to the page.")),"undefined"!=typeof _&&"undefined"!=typeof Dropzone&&c.autoInit()})),"undefined"!=typeof window&&(window.HSFileUpload=c),e.default=c},332:function(t,e,n){ +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;n\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t.\n\t\t\t\t\t\t

\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t0%\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t',s.extensions=_.merge({default:{icon:'',class:"size-5"},xls:{icon:'',class:"size-5"},doc:{icon:'',class:"size-5"},zip:{icon:'',class:"size-5"}},a.extensions),s.singleton=a.singleton,s.concatOptions=r(r({clickable:s.el.querySelector("[data-hs-file-upload-trigger]"),previewsContainer:s.el.querySelector("[data-hs-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:s.previewTemplate,autoHideTrigger:!1},a),n),s.init(),s}return o(e,t),e.prototype.init=function(){this.createCollection(window.$hsFileUploadCollection,this),this.initDropzone()},e.prototype.initDropzone=function(){var t=this,e=this.el.querySelector("[data-hs-file-upload-clear]"),n=Array.from(this.el.querySelectorAll("[data-hs-file-upload-pseudo-trigger]"));this.dropzone=new Dropzone(this.el,this.concatOptions),this.dropzone.on("addedfile",(function(e){return t.onAddFile(e)})),this.dropzone.on("removedfile",(function(){return t.onRemoveFile()})),this.dropzone.on("uploadprogress",(function(e,n){return t.onUploadProgress(e,n)})),this.dropzone.on("complete",(function(e){return t.onComplete(e)})),e&&(e.onclick=function(){t.dropzone.files.length&&t.dropzone.removeAllFiles(!0)}),n.length&&n.forEach((function(e){e.onclick=function(){var e,n;(null===(e=t.concatOptions)||void 0===e?void 0:e.clickable)&&(null===(n=t.concatOptions)||void 0===n?void 0:n.clickable).click()}}))},e.prototype.onAddFile=function(t){var e=this,n=t.previewElement,i=t.previewElement.querySelector("[data-hs-file-upload-reload]");if(!n)return!1;this.singleton&&this.dropzone.files.length>1&&this.dropzone.removeFile(this.dropzone.files[0]),i&&i.addEventListener("click",(function(n){n.preventDefault(),n.stopPropagation();var i=document.createElement("input");i.type="file",i.click(),i.addEventListener("change",(function(n){var i,o=null===(i=n.target.files)||void 0===i?void 0:i[0];if(o){var r=o;r.status=Dropzone.ADDED,r.accepted=!0,r.previewElement=t.previewElement,r.previewTemplate=t.previewTemplate,r.previewsContainer=t.previewsContainer,e.dropzone.removeFile(t),e.dropzone.addFile(r)}}))})),this.previewAccepted(t)},e.prototype.previewAccepted=function(t){var e=this,n=t.previewElement,i=this.splitFileName(t.name),o=n.querySelector("[data-hs-file-upload-file-name]"),r=n.querySelector("[data-hs-file-upload-file-ext]"),s=n.querySelector("[data-hs-file-upload-file-size]"),l=n.querySelector("[data-hs-file-upload-file-icon]"),a=this.el.querySelector("[data-hs-file-upload-trigger]"),c=n.querySelector("[data-dz-thumbnail]"),u=n.querySelector("[data-hs-file-upload-remove]");o&&(o.textContent=i.name),r&&(r.textContent=i.extension),s&&(s.textContent=this.formatFileSize(t.size)),c&&(t.type.includes("image/")?c.classList.remove("hidden"):this.setIcon(i.extension,l)),this.dropzone.files.length>0&&this.concatOptions.autoHideTrigger&&(a.style.display="none"),u&&(u.onclick=function(){return e.dropzone.removeFile(t)})},e.prototype.onRemoveFile=function(){var t=this.el.querySelector("[data-hs-file-upload-trigger]");0===this.dropzone.files.length&&this.concatOptions.autoHideTrigger&&(t.style.display="")},e.prototype.onUploadProgress=function(t,e){var n=t.previewElement;if(!n)return!1;var i=n.querySelector("[data-hs-file-upload-progress-bar]"),o=n.querySelector("[data-hs-file-upload-progress-bar-pane]"),r=n.querySelector("[data-hs-file-upload-progress-bar-value]"),s=Math.floor(e);i&&i.setAttribute("aria-valuenow","".concat(s)),o&&(o.style.width="".concat(s,"%")),r&&(r.innerText="".concat(s))},e.prototype.onComplete=function(t){var e=t.previewElement;if(!e)return!1;e.classList.add("complete")},e.prototype.setIcon=function(t,e){var n=this.createIcon(t);e.append(n)},e.prototype.createIcon=function(t){var e,n,i=(null===(e=this.extensions[t])||void 0===e?void 0:e.icon)?(0,l.htmlToElement)(this.extensions[t].icon):(0,l.htmlToElement)(this.extensions.default.icon);return(0,l.classToClassList)((null===(n=this.extensions[t])||void 0===n?void 0:n.class)?this.extensions[t].class:this.extensions.default.class,i),i},e.prototype.formatFileSize=function(t){return t<1024?t.toFixed(2)+" B":t<1048576?(t/1024).toFixed(2)+" KB":t<1073741824?(t/1048576).toFixed(2)+" MB":t<1099511627776?(t/1073741824).toFixed(2)+" GB":(t/1099511627776).toFixed(2)+" TB"},e.prototype.splitFileName=function(t){var e=t.lastIndexOf(".");return-1==e?{name:t,extension:""}:{name:t.substring(0,e),extension:t.substring(e+1)}},e.getInstance=function(t,e){var n=window.$hsFileUploadCollection.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.$hsFileUploadCollection||(window.$hsFileUploadCollection=[]),document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsFileUploadCollection.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}(a.default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").length&&("undefined"==typeof _&&console.error("HSFileUpload: Lodash is not available, please add it to the page."),"undefined"==typeof Dropzone&&console.error("HSFileUpload: Dropzone is not available, please add it to the page.")),"undefined"!=typeof _&&"undefined"!=typeof Dropzone&&c.autoInit()})),"undefined"!=typeof window&&(window.HSFileUpload=c),e.default=c},332:function(t,e,n){ /* * HSInputNumber - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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?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.checkIsNumberAndConvert=function(){var t=this.input.value.trim(),e=this.cleanAndExtractNumber(t);null!==e?(this.inputValue=e,this.input.value=e.toString()):(this.inputValue=0,this.input.value="0")},e.prototype.cleanAndExtractNumber=function(t){var e=[],n=!1;t.split("").forEach((function(t){t>="0"&&t<="9"?e.push(t):"."!==t||n||(e.push(t),n=!0)}));var o=e.join(""),i=parseFloat(o);return isNaN(i)?null:i},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 s=this.inputValue+this.step;this.inputValue=s>=i&&s<=r?s: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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=a),e.default=a},850:function(t,e,n){ +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?l.step:1,i.init(),i}return o(e,t),e.prototype.init=function(){this.createCollection(window.$hsInputNumberCollection,this),this.input&&this.increment&&this.build()},e.prototype.checkIsNumberAndConvert=function(){var t=this.input.value.trim(),e=this.cleanAndExtractNumber(t);null!==e?(this.inputValue=e,this.input.value=e.toString()):(this.inputValue=0,this.input.value="0")},e.prototype.cleanAndExtractNumber=function(t){var e=[],n=!1;t.split("").forEach((function(t){t>="0"&&t<="9"?e.push(t):"."!==t||n||(e.push(t),n=!0)}));var i=e.join(""),o=parseFloat(i);return isNaN(o)?null:o},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},o=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 s=this.inputValue+this.step;this.inputValue=s>=o&&s<=r?s:r,this.input.value=this.inputValue.toString();break;case"decrement":var a=this.inputValue-this.step;this.inputValue=a>=o&&a<=r?a:o,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<=o?o:c,this.inputValue<=o&&(this.input.value=this.inputValue.toString())}i.inputValue=this.inputValue,this.inputValue===o?(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",i),(0,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=a),e.default=a},850:function(t,e,n){ /* * HSOverlay - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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"])'),s=[];(null==r?void 0:r.length)&&r.forEach((function(t){(0,l.isParentOrElementHidden)(t)||s.push(t)}));var a=i&&!t.metaKey;if(a&&!i.element.isTabAccessibilityLimited&&"Tab"===t.code)return!1;a&&s.length&&"Tab"===t.code&&(t.preventDefault(),this.onTab(i,s)),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}(s(n(961)).default);window.addEventListener("load",(function(){c.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.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.overlay.classList.contains("opened")})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.overlay.classList.contains("opened")})).forEach((function(t){var e=parseInt(window.getComputedStyle(t.element.overlay).getPropertyValue("z-index")),n=document.querySelector("#".concat(t.element.overlay.id,"-backdrop"));if(e===parseInt(window.getComputedStyle(n).getPropertyValue("z-index"))+1)return!1;"style"in n&&(n.style.zIndex="".concat(e-1)),document.body.classList.add("hs-overlay-body-open")}))}()})),"undefined"!=typeof window&&(window.HSOverlay=c),e.default=c},60:function(t,e,n){ +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;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,i=window.$hsOverlayCollection.filter((function(t){return t.element.overlay.classList.contains("open")})),o=i[i.length-1],r=null===(n=null===(e=null==o?void 0:o.element)||void 0===e?void 0:e.overlay)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=[];(null==r?void 0:r.length)&&r.forEach((function(t){(0,l.isParentOrElementHidden)(t)||s.push(t)}));var a=o&&!t.metaKey;if(a&&!o.element.isTabAccessibilityLimited&&"Tab"===t.code)return!1;a&&s.length&&"Tab"===t.code&&(t.preventDefault(),this.onTab(o,s)),a&&"Escape"===t.code&&(t.preventDefault(),this.onEscape(o))},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"),i=Array.from(e).indexOf(n);i>-1?e[(i+1)%e.length].focus():e[0].focus()},e.on=function(t,e,n){var i=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)}));i&&(i.element.events[t]=n)},e}(s(n(961)).default),u=function(){if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((function(t){return t.element.moveOverlayToBody})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.moveOverlayToBody})).forEach((function(t){var e=t.element.moveOverlayToBody,n=t.element.initContainer,i=document.querySelector("body"),o=t.element.overlay;if(!n&&o)return!1;document.body.clientWidth<=e&&!(0,l.isDirectChild)(i,o)?i.appendChild(o):document.body.clientWidth>e&&!n.contains(o)&&n.appendChild(o)}))};window.addEventListener("load",(function(){c.autoInit(),u()})),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)}))}(),u(),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.overlay.classList.contains("opened")})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.overlay.classList.contains("opened")})).forEach((function(t){var e=parseInt(window.getComputedStyle(t.element.overlay).getPropertyValue("z-index")),n=document.querySelector("#".concat(t.element.overlay.id,"-backdrop"));if(e===parseInt(window.getComputedStyle(n).getPropertyValue("z-index"))+1)return!1;"style"in n&&(n.style.zIndex="".concat(e-1)),document.body.classList.add("hs-overlay-body-open")}))}()})),"undefined"!=typeof window&&(window.HSOverlay=c),e.default=c},60:function(t,e,n){ /* * HSPinInput - * @version: 2.4.1 + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=a),e.default=a},347:function(t,e,n){ +/* + * HSRangeSlider + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=a),e.default=a},911:function(t,e,n){ +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){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,s.getClassProperty)(this.el,"--scrollspy-offset","0")),i=parseInt((0,s.getClassProperty)(n,"--scrollspy-offset"))||o,r=this.scrollable===document?0:this.scrollable.offsetTop,l=n.offsetTop-i-r,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,s.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}(r(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=l),e.default=l},442:function(t,e,n){ +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.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(292),l=function(t){function e(e,n){void 0===n&&(n={});var i=t.call(this,e,n)||this;return i.activeSection=null,i.contentId=i.el.getAttribute("data-hs-scrollspy"),i.content=document.querySelector(i.contentId),i.links=i.el.querySelectorAll("[href]"),i.sections=[],i.scrollableId=i.el.getAttribute("data-hs-scrollspy-scrollable-parent"),i.scrollable=i.scrollableId?document.querySelector(i.scrollableId):document,i.init(),i}return o(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,s.getClassProperty)(this.el,"--scrollspy-offset","0")),i=parseInt((0,s.getClassProperty)(e,"--scrollspy-offset"))||n,o=t.target===document?0:parseInt(String(t.target.getBoundingClientRect().top)),r=parseInt(String(e.getBoundingClientRect().top))-i-o,l=e.offsetHeight;if(r<=0&&r+l>0){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),i=parseInt((0,s.getClassProperty)(this.el,"--scrollspy-offset","0")),o=parseInt((0,s.getClassProperty)(n,"--scrollspy-offset"))||i,r=this.scrollable===document?0:this.scrollable.offsetTop,l=n.offsetTop-o-r,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,s.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}(r(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=l),e.default=l},442:function(t,e,n){ /* * HSSelect - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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"),n=this.toggle.querySelector("[data-icon]"),o=this.toggle.querySelector("[data-title]"),!this.isMultiple&&n&&this.setToggleIcon(),!this.isMultiple&&o&&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,o||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,a.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),(null===(e=this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.isOpened?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(){if(i.isDisabled)return!1;i.isOpened?i.close():i.open()}))},e.prototype.setToggleIcon=function(){var t,e,n=this.toggle.querySelector("[data-icon]");if(n.innerHTML="",n){var o=(0,a.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.isDisabled&&this.wrapper.classList.add("disabled"),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,l,c=this,u=this.getItemByValue(t),d=document.createElement("div");if(d.setAttribute("data-tag-value",t),this.tagsItemClasses&&(0,a.classToClassList)(this.tagsItemClasses,d),this.tagsItemTemplate&&(i=(0,a.htmlToElement)(this.tagsItemTemplate),d.append(i)),null===(e=null==u?void 0:u.options)||void 0===e?void 0:e.icon){var p=(0,a.htmlToElement)(null===(n=null==u?void 0:u.options)||void 0===n?void 0:n.icon);(l=i?i.querySelector("[data-icon]"):document.createElement("span")).append(p),i||d.append(l)}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,a.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,a.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,a.htmlToElement)(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),this.dropdown.classList.add("absolute","top-full"),this.dropdown.role="listbox",this.dropdown.tabIndex=-1,this.dropdown.ariaOrientation="vertical",this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,a.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.disabled,e.selected,e.options,"".concat(n))}))},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,a.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,a.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]"),this.search=(0,a.htmlToElement)(''),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,a.classToClassList)(this.searchClasses,this.search),this.search.addEventListener("input",(0,a.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,i,r){var l=this;void 0===n&&(n=!1),void 0===o&&(o=!1),void 0===r&&(r="1");var c=null,u=(0,a.htmlToElement)(this.optionTag||"
");if(u.setAttribute("data-value",e),u.setAttribute("data-title-value",t),u.setAttribute("tabIndex",r),u.classList.add("cursor-pointer"),n&&u.classList.add("disabled"),o&&(this.isMultiple?this.value=s(s([],this.value,!0),[e],!1):this.value=e),this.optionTemplate&&(c=(0,a.htmlToElement)(this.optionTemplate),u.append(c)),c?c.querySelector("[data-title]").textContent=t||"":u.textContent=t||"",i){if(i.icon){var d=(0,a.htmlToElement)(i.icon);if(d.classList.add("max-w-full"),c)c.querySelector("[data-icon]").append(d);else{var p=(0,a.htmlToElement)("
");this.iconClasses&&(0,a.classToClassList)(this.iconClasses,p),p.append(d),u.append(p)}}if(i.description)if(c)c.querySelector("[data-description]").append(i.description);else{var h=(0,a.htmlToElement)("
");h.textContent=i.description,this.descriptionClasses&&(0,a.classToClassList)(this.descriptionClasses,h),u.append(h)}}c&&c.querySelector("[data-icon]")&&!i&&!(null==i?void 0:i.icon)&&c.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&u.classList.add("selected"),n||u.addEventListener("click",(function(){return l.onSelectOption(e)})),this.optionClasses&&(0,a.classToClassList)(this.optionClasses,u),this.dropdown&&this.dropdown.append(u),o&&this.setNewValue()},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,o,i){var r=(0,a.htmlToElement)("");r.setAttribute("value",e),n&&r.setAttribute("disabled","disabled"),o&&r.setAttribute("selected","selected"),r.setAttribute("data-hs-select-option",JSON.stringify(i)),r.innerText=t,this.el.append(r)},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,a.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(),this.triggerChangeEventForNativeSelect()},e.prototype.triggerChangeEventForNativeSelect=function(){var t=new Event("change",{bubbles:!0});this.el.dispatchEvent(t)},e.prototype.addSelectOption=function(t,e,n,o,i){this.selectOptions=s(s([],this.selectOptions,!0),[{title:t,val:e,disabled:n,selected:o,options:i}],!1)},e.prototype.removeSelectOption=function(t,e){if(void 0===e&&(e=!1),!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t})),console.log(e),this.value=e?this.value.filter((function(e){return e!==t})):t,console.log(this.value)},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():(console.log(),this.value.length?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder)},e.prototype.stringFromValue=function(){var t=this,e=[],n="";if(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)if("nItemsAndCount"===this.toggleCountTextMode){var o=e.slice(0,this.toggleCountTextMinItems-1);n="".concat(o.join(this.toggleSeparators.items)," ").concat(this.toggleSeparators.betweenItemsAndCounter," ").concat(e.length-o.length," ").concat(this.toggleCountText)}else n="".concat(e.length," ").concat(this.toggleCountText);else n=e.join(this.toggleSeparators.items);return n},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0;var e=Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")}));e&&e.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,a.htmlToElement)(""),this.searchNoResult.innerText=this.searchNoResultText,(0,a.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,e=this,n=(null===(t=null===window||void 0===window?void 0:window.$hsSelectCollection)||void 0===t?void 0:t.find((function(t){return t.element.isOpened})))||null;if(n&&n.element.close(),this.animationInProcess)return!1;this.animationInProcess=!0,this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){var t;(null===(t=null==e?void 0:e.toggle)||void 0===t?void 0:t.ariaExpanded)&&(e.toggle.ariaExpanded="true"),e.wrapper.classList.add("active"),e.dropdown.classList.add("opened"),e.hasSearch&&!e.preventSearchFocus&&e.search.focus(),e.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,n,o,i=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,a.afterTransition)(this.dropdown,(function(){i.dropdown.classList.add("hidden"),i.hasSearch&&(i.search.value="",i.search.dispatchEvent(new Event("input",{bubbles:!0})),i.search.blur()),i.animationInProcess=!1})),null===(o=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===o||o.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.disabled,s=t.selected,l=t.options;!!e.selectOptions.some((function(t){return t.val===i}))||(e.addSelectOption(o,i,r,s,l),e.buildOption(o,i,r,s,l,n),e.buildOriginalOption(o,i,r,s,l),s&&!e.isMultiple&&e.onSelectOption(i))};Array.isArray(t)?t.forEach((function(t){o(t)})):o(t)},e.prototype.removeOption=function(t){var e=this,n=function(t,n){void 0===n&&(n=!1),!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t,n),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,e.isMultiple)})):n(t,this.isMultiple),this.setNewValue()},e.prototype.recalculateDirection=function(){var t,e,n,o;(0,a.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.open=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.open()},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}))&&u.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Tab":t.preventDefault(),t.stopImmediatePropagation(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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")||n.querySelector(".selected");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")||n.querySelector(".selected");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}(c.default);window.addEventListener("load",(function(){d.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=d),e.default=d},887:function(t,e,n){ +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&&o[o.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]",s.searchNoResultText=(null==c?void 0:c.searchNoResultText)||"No results found",s.searchNoResultClasses=(null==c?void 0:c.searchNoResultClasses)||"px-4 text-sm text-gray-800 dark:text-neutral-200",s.optionTemplate=(null==c?void 0:c.optionTemplate)||null,s.optionTag=(null==c?void 0:c.optionTag)||null,s.optionClasses=(null==c?void 0:c.optionClasses)||null,s.extraMarkup=(null==c?void 0:c.extraMarkup)||null,s.descriptionClasses=(null==c?void 0:c.descriptionClasses)||null,s.iconClasses=(null==c?void 0:c.iconClasses)||null,s.isAddTagOnEnter=null===(o=null==c?void 0:c.isAddTagOnEnter)||void 0===o||o,s.animationInProcess=!1,s.selectOptions=[],s.remoteOptions=[],s.tagsInputHelper=null,s.init(),s}return o(e,t),e.prototype.setValue=function(t){this.value=t,this.clearSelections(),Array.isArray(t)?(this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder,this.unselectMultipleItems(),this.selectMultipleItems()):(this.setToggleTitle(),this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.selectSingleItem())},e.prototype.init=function(){this.createCollection(window.$hsSelectCollection,this),this.build()},e.prototype.build=function(){var t=this;if(this.el.style.display="none",this.el.children&&Array.from(this.el.children).filter((function(t){return t.value&&""!==t.value})).forEach((function(e){var n=e.getAttribute("data-hs-select-option");t.selectOptions=a(a([],t.selectOptions,!0),[{title:e.textContent,val:e.value,disabled:e.disabled,options:"undefined"!==n?JSON.parse(n):null}],!1)})),this.isMultiple){var e=Array.from(this.el.children).filter((function(t){return t.selected}));if(e){var n=[];e.forEach((function(t){n.push(t.value)})),this.value=n}}this.buildWrapper(),"tags"===this.mode?this.buildTags():this.buildToggle(),this.buildDropdown(),this.extraMarkup&&this.buildExtraMarkup()},e.prototype.buildWrapper=function(){var t=this;this.wrapper=document.createElement("div"),this.wrapper.classList.add("hs-select","relative"),"tags"===this.mode&&this.wrapper.addEventListener("click",(function(e){e.target.closest("[data-hs-select-dropdown]")||e.target.closest("[data-tag-value]")||t.tagsInput.focus()})),this.wrapperClasses&&(0,u.classToClassList)(this.wrapperClasses,this.wrapper),this.el.before(this.wrapper),this.wrapper.append(this.el)},e.prototype.buildExtraMarkup=function(){var t=this,e=function(e){var n=(0,u.htmlToElement)(e);return t.wrapper.append(n),n},n=function(e){e.classList.contains("--prevent-click")||e.addEventListener("click",(function(e){e.stopPropagation(),t.toggleFn()}))};if(Array.isArray(this.extraMarkup))this.extraMarkup.forEach((function(t){var i=e(t);n(i)}));else{var i=e(this.extraMarkup);n(i)}},e.prototype.buildToggle=function(){var t,e,n,i,o=this;this.toggleTextWrapper=document.createElement("span"),this.toggleTextWrapper.classList.add("truncate"),this.toggle=(0,u.htmlToElement)(this.toggleTag||"
"),n=this.toggle.querySelector("[data-icon]"),i=this.toggle.querySelector("[data-title]"),!this.isMultiple&&n&&this.setToggleIcon(),!this.isMultiple&&i&&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,i||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,u.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),(null===(e=this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.isOpened?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(){if(o.isDisabled)return!1;o.toggleFn()}))},e.prototype.setToggleIcon=function(){var t,e=this.getItemByValue(this.value),n=this.toggle.querySelector("[data-icon]");if(n.innerHTML="",n){var i=(0,u.htmlToElement)(this.apiUrl&&this.apiIconTag?this.apiIconTag||"":(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.icon)||"");this.value&&this.apiUrl&&this.apiIconTag&&e[this.apiFieldsMap.icon]&&(i.src=e[this.apiFieldsMap.icon]||""),n.append(i),i&&(null==i?void 0:i.src)?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.isDisabled&&this.wrapper.classList.add("disabled"),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,i,o,r,s,l,a,c=this,d=this.getItemByValue(t),p=document.createElement("div");if(p.setAttribute("data-tag-value",t),this.tagsItemClasses&&(0,u.classToClassList)(this.tagsItemClasses,p),this.tagsItemTemplate&&(r=(0,u.htmlToElement)(this.tagsItemTemplate),p.append(r)),(null===(e=null==d?void 0:d.options)||void 0===e?void 0:e.icon)||this.apiIconTag){var h=(0,u.htmlToElement)(this.apiUrl&&this.apiIconTag?this.apiIconTag:null===(n=null==d?void 0:d.options)||void 0===n?void 0:n.icon);this.apiUrl&&this.apiIconTag&&d[this.apiFieldsMap.icon]&&(h.src=d[this.apiFieldsMap.icon]||""),(a=r?r.querySelector("[data-icon]"):document.createElement("span")).append(h),r||p.append(a)}!r||!r.querySelector("[data-icon]")||(null===(i=null==d?void 0:d.options)||void 0===i?void 0:i.icon)||this.apiUrl||this.apiIconTag||d[null===(o=this.apiFieldsMap)||void 0===o?void 0:o.icon]||r.querySelector("[data-icon]").classList.add("hidden"),(s=r?r.querySelector("[data-title]"):document.createElement("span")).textContent=d.title||"",r||p.append(s),r?l=r.querySelector("[data-remove]"):((l=document.createElement("span")).textContent="X",p.append(l)),l.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(),p.remove()})),this.wrapper.append(p)},e.prototype.getItemByValue=function(t){var e=this;return this.apiUrl?this.remoteOptions.find((function(n){return n[e.apiFieldsMap.title]===t})):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:a(a([],t.selectedItems,!0),[e],!1)}))},e.prototype.buildTagsInput=function(){var t=this;this.tagsInput=document.createElement("input"),this.tagsInputId&&(this.tagsInput.id=this.tagsInputId),this.tagsInputClasses&&(0,u.classToClassList)(this.tagsInputClasses,this.tagsInput),this.tagsInput.addEventListener("focus",(function(){t.isOpened||t.open()})),this.tagsInput.addEventListener("input",(function(){return t.calculateInputWidth()})),this.tagsInput.addEventListener("input",(0,u.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,u.htmlToElement)(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),"parent"===this.dropdownScope&&this.dropdown.classList.add("absolute","top-full"),this.dropdown.role="listbox",this.dropdown.tabIndex=-1,this.dropdown.ariaOrientation="vertical",this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,u.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.disabled,e.selected,e.options,"".concat(n))})),this.apiUrl&&this.optionsFromRemoteData(),"window"===this.dropdownScope&&this.buildPopper()},e.prototype.buildPopper=function(){"undefined"!=typeof Popper&&Popper.createPopper&&(document.body.appendChild(this.dropdown),this.popperInstance=Popper.createPopper("tags"===this.mode?this.wrapper:this.toggle,this.dropdown,{placement:p.POSITIONS[this.dropdownPlacement]||"bottom",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,5]}}]}))},e.prototype.updateDropdownWidth=function(){var t="tags"===this.mode?this.wrapper:this.toggle;this.dropdown.style.width="".concat(t.clientWidth,"px")},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,u.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,u.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]");var n=(0,u.htmlToElement)(this.searchTemplate||'');this.search="INPUT"===n.tagName?n:n.querySelector(":scope input"),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,u.classToClassList)(this.searchClasses,this.search),this.searchId&&(this.search.id=this.searchId),this.search.addEventListener("input",(0,u.debounce)((function(t){e.apiUrl?e.remoteSearch(t.target.value):e.searchOptions(t.target.value)}))),t?t.append(n):this.searchWrapper.append(n),this.dropdown.append(this.searchWrapper)},e.prototype.buildOption=function(t,e,n,i,o,r,s){var l,c=this;void 0===n&&(n=!1),void 0===i&&(i=!1),void 0===r&&(r="1");var d=null,p=null,h=(0,u.htmlToElement)(this.optionTag||"
");if(h.setAttribute("data-value",e),h.setAttribute("data-title-value",t),h.setAttribute("tabIndex",r),h.classList.add("cursor-pointer"),h.setAttribute("data-id",s||"".concat(this.optionId)),s||this.optionId++,n&&h.classList.add("disabled"),i&&(this.isMultiple?this.value=a(a([],this.value,!0),[e],!1):this.value=e),this.optionTemplate&&(d=(0,u.htmlToElement)(this.optionTemplate),h.append(d)),d?d.querySelector("[data-title]").textContent=t||"":h.textContent=t||"",o){if(o.icon){var f=(0,u.htmlToElement)(null!==(l=this.apiIconTag)&&void 0!==l?l:o.icon);if(f.classList.add("max-w-full"),this.apiUrl&&(f.setAttribute("alt",t),f.setAttribute("src",o.icon)),d)d.querySelector("[data-icon]").append(f);else{var v=(0,u.htmlToElement)("
");this.iconClasses&&(0,u.classToClassList)(this.iconClasses,v),v.append(f),h.append(v)}}if(o.description)if(d)(p=d.querySelector("[data-description]"))&&p.append(o.description);else{var m=(0,u.htmlToElement)("
");m.textContent=o.description,this.descriptionClasses&&(0,u.classToClassList)(this.descriptionClasses,m),h.append(m)}}d&&d.querySelector("[data-icon]")&&!o&&!(null==o?void 0:o.icon)&&d.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&h.classList.add("selected"),n||h.addEventListener("click",(function(){return c.onSelectOption(e)})),this.optionClasses&&(0,u.classToClassList)(this.optionClasses,h),this.dropdown&&this.dropdown.append(h),i&&this.setNewValue()},e.prototype.buildOptionFromRemoteData=function(t,e,n,i,o,r,s){void 0===n&&(n=!1),void 0===i&&(i=!1),void 0===o&&(o="1"),o?this.buildOption(t,e,n,i,s,o,r):alert("ID parameter is required for generating remote options! Please check your API endpoint have it.")},e.prototype.buildOptionsFromRemoteData=function(t){var e=this;t.forEach((function(t,n){var i=null,o="",r={id:"",title:"",icon:null,description:null,rest:{}};Object.keys(t).forEach((function(n){var s;t[e.apiFieldsMap.id]&&(i=t[e.apiFieldsMap.id]),t[e.apiFieldsMap.title]&&(o=t[e.apiFieldsMap.title]),t[e.apiFieldsMap.icon]&&(r.icon=t[e.apiFieldsMap.icon]),t[null===(s=e.apiFieldsMap)||void 0===s?void 0:s.description]&&(r.description=t[e.apiFieldsMap.description]),r.rest[n]=t[n]})),e.buildOriginalOption(o,o,i,!1,!1,r),e.buildOptionFromRemoteData(o,o,!1,!1,"".concat(n),i,r)})),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")},e.prototype.optionsFromRemoteData=function(){return s(this,arguments,void 0,(function(t){var e;return void 0===t&&(t=""),l(this,(function(n){switch(n.label){case 0:return[4,this.apiRequest(t)];case 1:return e=n.sent(),this.remoteOptions=e,e.length?this.buildOptionsFromRemoteData(this.remoteOptions):console.log("There is no data were responded!"),[2]}}))}))},e.prototype.apiRequest=function(){return s(this,arguments,void 0,(function(t){var e,n,i,o,r,s;return void 0===t&&(t=""),l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=this.apiUrl,n=this.apiSearchQueryKey?"".concat(this.apiSearchQueryKey,"=").concat(t.toLowerCase()):null,i="".concat(this.apiQuery),o=this.apiOptions||{},n&&(e+="?".concat(n)),this.apiQuery&&(e+="".concat(n?"&":"?").concat(i)),[4,fetch(e,o)];case 1:return[4,l.sent().json()];case 2:return r=l.sent(),[2,this.apiDataPart?r[this.apiDataPart]:r];case 3:return s=l.sent(),console.error(s),[3,4];case 4:return[2]}}))}))},e.prototype.sortElements=function(t,e){var n=Array.from(t.querySelectorAll(e));n.sort((function(t,e){var n=t.classList.contains("selected")||t.hasAttribute("selected"),i=e.classList.contains("selected")||e.hasAttribute("selected");return n&&!i?-1:!n&&i?1:0})),n.forEach((function(e){return t.appendChild(e)}))},e.prototype.remoteSearch=function(t){return s(this,void 0,void 0,(function(){var e,n,i,o,r=this;return l(this,(function(s){switch(s.label){case 0:return[4,this.apiRequest(t)];case 1:return e=s.sent(),this.remoteOptions=e,n=e.map((function(t){return"".concat(t.id)})),null,o=this.dropdown.querySelectorAll("[data-value]"),this.el.querySelectorAll("[data-hs-select-option]").forEach((function(t){var e,i=t.getAttribute("data-id");n.includes(i)||(null===(e=r.value)||void 0===e?void 0:e.includes(t.value))||r.destroyOriginalOption(t.value)})),o.forEach((function(t){var e,i=t.getAttribute("data-id");n.includes(i)||(null===(e=r.value)||void 0===e?void 0:e.includes(t.getAttribute("data-value")))?n=n.filter((function(t){return t!==i})):r.destroyOption(t.getAttribute("data-value"))})),(i=e.filter((function(t){return n.includes("".concat(t.id))}))).length?this.buildOptionsFromRemoteData(i):console.log("There is no data were responded!"),[2]}}))}))},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,i,o,r){var s=(0,u.htmlToElement)("");s.setAttribute("value",e),i&&s.setAttribute("disabled","disabled"),o&&s.setAttribute("selected","selected"),n&&s.setAttribute("data-id",n),s.setAttribute("data-hs-select-option",JSON.stringify(r)),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,i=this.wrapper.offsetWidth-(parseInt(window.getComputedStyle(this.wrapper).paddingLeft)+parseInt(window.getComputedStyle(this.wrapper).paddingRight));this.tagsInput.style.width="".concat(Math.min(n,i)+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})):a(a([],Array.from(this.value),!0),[t],!1),this.selectMultipleItems(),this.setNewValue()):(this.value=t,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),(0,u.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(),this.triggerChangeEventForNativeSelect()},e.prototype.triggerChangeEventForNativeSelect=function(){var t=new Event("change",{bubbles:!0});this.el.dispatchEvent(t)},e.prototype.addSelectOption=function(t,e,n,i,o){this.selectOptions=a(a([],this.selectOptions,!0),[{title:t,val:e,disabled:n,selected:i,options:o}],!1)},e.prototype.removeSelectOption=function(t,e){if(void 0===e&&(e=!1),!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t})),this.value=e?this.value.filter((function(e){return e!==t})):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(){var t;"tags"===this.mode?this.setTagsItems():(null===(t=this.value)||void 0===t?void 0:t.length)?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.stringFromValueBasic=function(t){var e=this,n=[],i="";if(t.forEach((function(t){e.isMultiple?e.value.includes(t.val)&&n.push(t.title):e.value===t.val&&n.push(t.title)})),this.toggleCountText&&""!==this.toggleCountText&&n.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){var o=n.slice(0,this.toggleCountTextMinItems-1);i="".concat(o.join(this.toggleSeparators.items)," ").concat(this.toggleSeparators.betweenItemsAndCounter," ").concat(n.length-o.length," ").concat(this.toggleCountText)}else i="".concat(n.length," ").concat(this.toggleCountText);else i=n.join(this.toggleSeparators.items);return i},e.prototype.stringFromValueRemoteData=function(){var t=this,e=this.dropdown.querySelectorAll("[data-title-value]"),n=[],i="";if(e.forEach((function(e){var i=e.getAttribute("data-value");t.isMultiple?t.value.includes(i)&&n.push(i):t.value===i&&n.push(i)})),this.toggleCountText&&""!==this.toggleCountText&&n.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){var o=n.slice(0,this.toggleCountTextMinItems-1);i="".concat(o.join(this.toggleSeparators.items)," ").concat(this.toggleSeparators.betweenItemsAndCounter," ").concat(n.length-o.length," ").concat(this.toggleCountText)}else i="".concat(n.length," ").concat(this.toggleCountText);else i=n.join(this.toggleSeparators.items);return i},e.prototype.stringFromValue=function(){return this.apiUrl?this.stringFromValueRemoteData():this.stringFromValueBasic(this.selectOptions)},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0;var e=Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")}));e&&e.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){var e=this;this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,u.htmlToElement)(this.searchNoResultTemplate),this.searchNoResult.innerText=this.searchNoResultText,(0,u.classToClassList)(this.searchNoResultClasses,this.searchNoResult);var n,i=this.dropdown.querySelectorAll("[data-value]"),o=!1;this.searchLimit&&(n=0),i.forEach((function(i){var r=i.getAttribute("data-title-value").toLocaleLowerCase(),s=t?t.split("").map((function(t){return t.match(/\w/)?"".concat(t,"[\\W_]*"):"\\W*"})).join(""):"",l=new RegExp(s,"i"),a=e.isSearchDirectMatch,c=r.trim();(t?a?!c.toLowerCase().includes(t.toLowerCase())||n>=e.searchLimit:!l.test(c)||n>=e.searchLimit:!l.test(c))?i.classList.add("hidden"):(i.classList.remove("hidden"),o=!0,e.searchLimit&&n++)})),o||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.toggleFn=function(){this.isOpened?this.close():this.open()},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,e=this,n=(null===(t=null===window||void 0===window?void 0:window.$hsSelectCollection)||void 0===t?void 0:t.find((function(t){return t.element.isOpened})))||null;if(n&&n.element.close(),this.animationInProcess)return!1;this.animationInProcess=!0,"window"===this.dropdownScope&&this.dropdown.classList.add("invisible"),this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){var t;(null===(t=null==e?void 0:e.toggle)||void 0===t?void 0:t.ariaExpanded)&&(e.toggle.ariaExpanded="true"),e.wrapper.classList.add("active"),e.dropdown.classList.add("opened"),e.dropdown.classList.contains("w-full")&&"window"===e.dropdownScope&&e.updateDropdownWidth(),e.popperInstance&&"window"===e.dropdownScope&&(e.popperInstance.update(),e.dropdown.classList.remove("invisible")),e.hasSearch&&!e.preventSearchFocus&&e.search.focus(),e.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,n,i,o=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,u.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===(i=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===i||i.classList.remove("hs-select-option-highlighted"),this.isOpened=!1},e.prototype.addOption=function(t){var e=this,n="".concat(this.selectOptions.length),i=function(t){var i=t.title,o=t.val,r=t.disabled,s=t.selected,l=t.options;!!e.selectOptions.some((function(t){return t.val===o}))||(e.addSelectOption(i,o,r,s,l),e.buildOption(i,o,r,s,l,n),e.buildOriginalOption(i,o,null,r,s,l),s&&!e.isMultiple&&e.onSelectOption(o))};Array.isArray(t)?t.forEach((function(t){i(t)})):i(t)},e.prototype.removeOption=function(t){var e=this,n=function(t,n){void 0===n&&(n=!1),!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t,n),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,e.isMultiple)})):n(t,this.isMultiple),this.setNewValue()},e.prototype.recalculateDirection=function(){var t,e,n,i;(0,u.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===(i=this.dropdownDirectionClasses)||void 0===i?void 0:i.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"),i=n?JSON.parse(n):{};new e(t,i)}})),window.$hsSelectCollection&&(window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.open=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.open()},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")&&!t.closest("[data-hs-select-dropdown].opened")){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}))&&p.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Tab":t.preventDefault(),t.stopImmediatePropagation(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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 i=(t?Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),o=n.querySelector(".hs-select-option-highlighted")||n.querySelector(".selected");o||i[0].classList.add("hs-select-option-highlighted");var r=i.findIndex((function(t){return t===o}));r+1 *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),o=n.querySelector(".hs-select-option-highlighted")||n.querySelector(".selected");o||i[0].classList.add("hs-select-option-highlighted");var r=i.findIndex((function(t){return t===o}));if(!(r+1 *:not(.hidden)")):Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((function(t){return!t.classList.contains("disabled")})),o=n.querySelector(".hs-select-option-highlighted");i.length&&(i[0].focus(),o&&o.classList.remove("hs-select-option-highlighted"),i[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})),i=window.$hsSelectCollection.find((function(t){return t.element.el===e}));n.element.close(),i.element.open()}else{(i=window.$hsSelectCollection.find((function(t){return t.element.isOpened})))&&i.element.onSelectOption(t.target.dataset.value||"")}},e}(d.default);window.addEventListener("load",(function(){h.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=h),e.default=h},887:function(t,e,n){ /* * HSStepper - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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,l.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,l.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,l.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,l.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,l.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,l.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,l.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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=a),e.default=a},97:function(t,e,n){ +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;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,o=t.el;n===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||i)&&o.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,o=void 0!==i&&i,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:o,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,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,l.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,o=void 0!==i&&i,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:o,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,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,l.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,l.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,l.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,l.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,l.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 o=this.navItems.find((function(e){return e.index===t.currentIndex}));(o?o.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,l.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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=a),e.default=a},97:function(t,e,n){ /* * HSStrongPassword - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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,l.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,l.dispatch)("change.hs.strongPassword",this.el,o)},e.prototype.hideStrips=function(t){Array.from(this.el.children).forEach((function(e,n){n?@[\\\\\\]^_`{|}~",i.target&&i.init(),i}return o(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,l.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,i=e.getAttribute("data-hs-strong-password-hints-rule-text");(null===(n=t.checksExclude)||void 0===n?void 0:n.includes(i))&&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,"]"))},i=0;return this.availableChecks.includes("lowercase")&&t.match(n.lowercase)&&(i+=1,e.add("lowercase")),this.availableChecks.includes("uppercase")&&t.match(n.uppercase)&&(i+=1,e.add("uppercase")),this.availableChecks.includes("numbers")&&t.match(n.numbers)&&(i+=1,e.add("numbers")),this.availableChecks.includes("special-characters")&&t.match(n["special-characters"])&&(i+=1,e.add("special-characters")),this.availableChecks.includes("min-length")&&t.length>=this.minLength&&(i+=1,e.add("min-length")),t.length||(i=0),i===this.availableChecks.length?this.el.classList.add("accepted"):this.el.classList.remove("accepted"),this.strength=i,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]"),i=t.querySelector("[data-uncheck]");e?(t.classList.add("active"),n.classList.remove("hidden"),i.classList.add("hidden")):(t.classList.remove("active"),n.classList.add("hidden"),i.classList.remove("hidden"))},e.prototype.setStrength=function(t){var e=this.checkStrength(t),n=e.strength,i={strength:n,rules:e.rules};this.hideStrips(n),this.fireEvent("change",i),(0,l.dispatch)("change.hs.strongPassword",this.el,i)},e.prototype.hideStrips=function(t){Array.from(this.el.children).forEach((function(e,n){nt)},e.prototype.isParentHidden=function(){return this.el.closest(".hs-collapse")||this.el.closest(".hs-overlay")},e.prototype.parentType=function(){return this.el.closest(".hs-collapse")?"collapse":!!this.el.closest(".hs-overlay")&&"overlay"},e.prototype.callbackAccordingToType=function(){var t=this;if("collapse"===this.parentType()){var e=this.el.closest(".hs-collapse").id;window.HSCollapse.getInstance('[data-hs-collapse="#'.concat(e,'"]'),!0).element.on("beforeOpen",(function(){if(!t.el)return!1;t.textareaSetHeight(3)}))}else{if("overlay"!==this.parentType())return!1;window.HSOverlay.getInstance(this.el.closest(".hs-overlay"),!0).element.on("open",(function(){if(!t.el)return!1;t.textareaSetHeight(3)}))}},e.getInstance=function(t,e){var n=window.$hsTextareaAutoHeightCollection.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.$hsTextareaAutoHeightCollection||(window.$hsTextareaAutoHeightCollection=[]),document.querySelectorAll("[data-hs-textarea-auto-height]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsTextareaAutoHeightCollection.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-textarea-auto-height"),i=n?JSON.parse(n):{};new e(t,i)}}))},e}(s(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSTextareaAutoHeight=l),e.default=l},502:function(t,e,n){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;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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=a),e.default=a},969:function(t,e,n){ +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;n1&&!!i.el.closest("[data-hs-toggle-password-group]"),i.target&&i.init(),i}return o(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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=a),e.default=a},969:function(t,e,n){ /* * HSTooltip - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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{ +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&&a{ /* * HSStaticMethods - * @version: 2.4.1 + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +Object.defineProperty(e,"__esModule",{value:!0});var i=n(292),o=n(255),r={getClassProperty:i.getClassProperty,afterTransition:i.afterTransition,autoInit:function(t){void 0===t&&(t="all"),"all"===t?o.COLLECTIONS.forEach((function(t){var e=t.fn;null==e||e.autoInit()})):o.COLLECTIONS.forEach((function(e){var n=e.key,i=e.fn;t.includes(n)&&(null==i||i.autoInit())}))},cleanCollection:function(t){void 0===t&&(t="all"),"all"===t?o.COLLECTIONS.forEach((function(t){var e=t.collection;window[e]instanceof Array&&(window[e]=[])})):o.COLLECTIONS.forEach((function(e){var n=e.key,i=e.collection;t.includes(n)&&window[i]instanceof Array&&(window[i]=[])}))}};"undefined"!=typeof window&&(window.HSStaticMethods=r),e.default=r},292:function(t,e){ +/* + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -Object.defineProperty(e,"__esModule",{value:!0});var o=n(292),i=n(255),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())}))},cleanCollection:function(t){void 0===t&&(t="all"),"all"===t?i.COLLECTIONS.forEach((function(t){var e=t.collection;window[e]instanceof Array&&(window[e]=[])})):i.COLLECTIONS.forEach((function(e){var n=e.key,o=e.collection;t.includes(n)&&window[o]instanceof Array&&(window[o]=[])}))}};"undefined"!=typeof window&&(window.HSStaticMethods=r),e.default=r},292: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.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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 i=function(t){return!!t&&("none"===window.getComputedStyle(t).display||i(t.parentElement))};e.isParentOrElementHidden=i;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}return 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})},n(158)})())); \ No newline at end of file +var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=i(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var i=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=i;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.isDirectChild=function(t,e){for(var n=t.children,i=0;i=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 i;return void 0===e&&(e=200),function(){for(var o=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,i){void 0===n&&(n=" "),void 0===i&&(i="add"),t.split(n).forEach((function(t){return"add"===i?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};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}return n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},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})},n(158)})())); \ No newline at end of file diff --git a/dist/index.mjs b/dist/index.mjs new file mode 100644 index 0000000..3121818 --- /dev/null +++ b/dist/index.mjs @@ -0,0 +1,187 @@ +var t={316:(t,e,i)=>{function s(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function n(t){return t instanceof s(t).Element||t instanceof Element}function o(t){return t instanceof s(t).HTMLElement||t instanceof HTMLElement}function l(t){return"undefined"!=typeof ShadowRoot&&(t instanceof s(t).ShadowRoot||t instanceof ShadowRoot)}i.d(e,{n4:()=>vt});var a=Math.max,r=Math.min,d=Math.round;function h(){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 c(){return!/^((?!chrome|android).)*safari/i.test(h())}function u(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var l=t.getBoundingClientRect(),a=1,r=1;e&&o(t)&&(a=t.offsetWidth>0&&d(l.width)/t.offsetWidth||1,r=t.offsetHeight>0&&d(l.height)/t.offsetHeight||1);var h=(n(t)?s(t):window).visualViewport,u=!c()&&i,p=(l.left+(u&&h?h.offsetLeft:0))/a,m=(l.top+(u&&h?h.offsetTop:0))/r,g=l.width/a,v=l.height/r;return{width:g,height:v,top:m,right:p+g,bottom:m+v,left:p,x:p,y:m}}function p(t){var e=s(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function m(t){return t?(t.nodeName||"").toLowerCase():null}function g(t){return((n(t)?t.ownerDocument:t.document)||window.document).documentElement}function v(t){return u(g(t)).left+p(t).scrollLeft}function f(t){return s(t).getComputedStyle(t)}function y(t){var e=f(t),i=e.overflow,s=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+n+s)}function w(t,e,i){void 0===i&&(i=!1);var n,l,a=o(e),r=o(e)&&function(t){var e=t.getBoundingClientRect(),i=d(e.width)/t.offsetWidth||1,s=d(e.height)/t.offsetHeight||1;return 1!==i||1!==s}(e),h=g(e),c=u(t,r,i),f={scrollLeft:0,scrollTop:0},w={x:0,y:0};return(a||!a&&!i)&&(("body"!==m(e)||y(h))&&(f=(n=e)!==s(n)&&o(n)?{scrollLeft:(l=n).scrollLeft,scrollTop:l.scrollTop}:p(n)),o(e)?((w=u(e,!0)).x+=e.clientLeft,w.y+=e.clientTop):h&&(w.x=v(h))),{x:c.left+f.scrollLeft-w.x,y:c.top+f.scrollTop-w.y,width:c.width,height:c.height}}function b(t){var e=u(t),i=t.offsetWidth,s=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:s}}function C(t){return"html"===m(t)?t:t.assignedSlot||t.parentNode||(l(t)?t.host:null)||g(t)}function S(t){return["html","body","#document"].indexOf(m(t))>=0?t.ownerDocument.body:o(t)&&y(t)?t:S(C(t))}function x(t,e){var i;void 0===e&&(e=[]);var n=S(t),o=n===(null==(i=t.ownerDocument)?void 0:i.body),l=s(n),a=o?[l].concat(l.visualViewport||[],y(n)?n:[]):n,r=e.concat(a);return o?r:r.concat(x(C(a)))}function I(t){return["table","td","th"].indexOf(m(t))>=0}function A(t){return o(t)&&"fixed"!==f(t).position?t.offsetParent:null}function L(t){for(var e=s(t),i=A(t);i&&I(i)&&"static"===f(i).position;)i=A(i);return i&&("html"===m(i)||"body"===m(i)&&"static"===f(i).position)?e:i||function(t){var e=/firefox/i.test(h());if(/Trident/i.test(h())&&o(t)&&"fixed"===f(t).position)return null;var i=C(t);for(l(i)&&(i=i.host);o(i)&&["html","body"].indexOf(m(i))<0;){var s=f(i);if("none"!==s.transform||"none"!==s.perspective||"paint"===s.contain||-1!==["transform","perspective"].indexOf(s.willChange)||e&&"filter"===s.willChange||e&&s.filter&&"none"!==s.filter)return i;i=i.parentNode}return null}(t)||e}var T="top",E="bottom",k="right",O="left",$="auto",P=[T,E,k,O],D="start",q="end",B="clippingParents",H="viewport",N="popper",M="reference",V=P.reduce((function(t,e){return t.concat([e+"-"+D,e+"-"+q])}),[]),R=[].concat(P,[$]).reduce((function(t,e){return t.concat([e,e+"-"+D,e+"-"+q])}),[]),F=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function j(t){var e=new Map,i=new Set,s=[];function n(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var s=e.get(t);s&&n(s)}})),s.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||n(t)})),s}var W={placement:"bottom",modifiers:[],strategy:"absolute"};function U(){for(var t=arguments.length,e=new Array(t),i=0;i=0?"x":"y"}function G(t){var e,i=t.reference,s=t.element,n=t.placement,o=n?Q(n):null,l=n?X(n):null,a=i.x+i.width/2-s.width/2,r=i.y+i.height/2-s.height/2;switch(o){case T:e={x:a,y:i.y-s.height};break;case E:e={x:a,y:i.y+i.height};break;case k:e={x:i.x+i.width,y:r};break;case O:e={x:i.x-s.width,y:r};break;default:e={x:i.x,y:i.y}}var d=o?Z(o):null;if(null!=d){var h="y"===d?"height":"width";switch(l){case D:e[d]=e[d]-(i[h]/2-s[h]/2);break;case q:e[d]=e[d]+(i[h]/2-s[h]/2)}}return e}var K={top:"auto",right:"auto",bottom:"auto",left:"auto"};function _(t){var e,i=t.popper,n=t.popperRect,o=t.placement,l=t.variation,a=t.offsets,r=t.position,h=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,p=t.isFixed,m=a.x,v=void 0===m?0:m,y=a.y,w=void 0===y?0:y,b="function"==typeof u?u({x:v,y:w}):{x:v,y:w};v=b.x,w=b.y;var C=a.hasOwnProperty("x"),S=a.hasOwnProperty("y"),x=O,I=T,A=window;if(c){var $=L(i),P="clientHeight",D="clientWidth";if($===s(i)&&"static"!==f($=g(i)).position&&"absolute"===r&&(P="scrollHeight",D="scrollWidth"),o===T||(o===O||o===k)&&l===q)I=E,w-=(p&&$===A&&A.visualViewport?A.visualViewport.height:$[P])-n.height,w*=h?1:-1;if(o===O||(o===T||o===E)&&l===q)x=k,v-=(p&&$===A&&A.visualViewport?A.visualViewport.width:$[D])-n.width,v*=h?1:-1}var B,H=Object.assign({position:r},c&&K),N=!0===u?function(t,e){var i=t.x,s=t.y,n=e.devicePixelRatio||1;return{x:d(i*n)/n||0,y:d(s*n)/n||0}}({x:v,y:w},s(i)):{x:v,y:w};return v=N.x,w=N.y,h?Object.assign({},H,((B={})[I]=S?"0":"",B[x]=C?"0":"",B.transform=(A.devicePixelRatio||1)<=1?"translate("+v+"px, "+w+"px)":"translate3d("+v+"px, "+w+"px, 0)",B)):Object.assign({},H,((e={})[I]=S?w+"px":"",e[x]=C?v+"px":"",e.transform="",e))}const Y={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,s=t.name,n=i.offset,o=void 0===n?[0,0]:n,l=R.reduce((function(t,i){return t[i]=function(t,e,i){var s=Q(t),n=[O,T].indexOf(s)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,l=o[0],a=o[1];return l=l||0,a=(a||0)*n,[O,k].indexOf(s)>=0?{x:a,y:l}:{x:l,y:a}}(i,e.rects,o),t}),{}),a=l[e.placement],r=a.x,d=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=r,e.modifiersData.popperOffsets.y+=d),e.modifiersData[s]=l}};var tt={left:"right",right:"left",bottom:"top",top:"bottom"};function et(t){return t.replace(/left|right|bottom|top/g,(function(t){return tt[t]}))}var it={start:"end",end:"start"};function st(t){return t.replace(/start|end/g,(function(t){return it[t]}))}function nt(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&l(i)){var s=e;do{if(s&&t.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function ot(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function lt(t,e,i){return e===H?ot(function(t,e){var i=s(t),n=g(t),o=i.visualViewport,l=n.clientWidth,a=n.clientHeight,r=0,d=0;if(o){l=o.width,a=o.height;var h=c();(h||!h&&"fixed"===e)&&(r=o.offsetLeft,d=o.offsetTop)}return{width:l,height:a,x:r+v(t),y:d}}(t,i)):n(e)?function(t,e){var i=u(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):ot(function(t){var e,i=g(t),s=p(t),n=null==(e=t.ownerDocument)?void 0:e.body,o=a(i.scrollWidth,i.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),l=a(i.scrollHeight,i.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),r=-s.scrollLeft+v(t),d=-s.scrollTop;return"rtl"===f(n||i).direction&&(r+=a(i.clientWidth,n?n.clientWidth:0)-o),{width:o,height:l,x:r,y:d}}(g(t)))}function at(t,e,i,s){var l="clippingParents"===e?function(t){var e=x(C(t)),i=["absolute","fixed"].indexOf(f(t).position)>=0&&o(t)?L(t):t;return n(i)?e.filter((function(t){return n(t)&&nt(t,i)&&"body"!==m(t)})):[]}(t):[].concat(e),d=[].concat(l,[i]),h=d[0],c=d.reduce((function(e,i){var n=lt(t,i,s);return e.top=a(n.top,e.top),e.right=r(n.right,e.right),e.bottom=r(n.bottom,e.bottom),e.left=a(n.left,e.left),e}),lt(t,h,s));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function rt(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function dt(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}function ht(t,e){void 0===e&&(e={});var i=e,s=i.placement,o=void 0===s?t.placement:s,l=i.strategy,a=void 0===l?t.strategy:l,r=i.boundary,d=void 0===r?B:r,h=i.rootBoundary,c=void 0===h?H:h,p=i.elementContext,m=void 0===p?N:p,v=i.altBoundary,f=void 0!==v&&v,y=i.padding,w=void 0===y?0:y,b=rt("number"!=typeof w?w:dt(w,P)),C=m===N?M:N,S=t.rects.popper,x=t.elements[f?C:m],I=at(n(x)?x:x.contextElement||g(t.elements.popper),d,c,a),A=u(t.elements.reference),L=G({reference:A,element:S,strategy:"absolute",placement:o}),O=ot(Object.assign({},S,L)),$=m===N?O:A,D={top:I.top-$.top+b.top,bottom:$.bottom-I.bottom+b.bottom,left:I.left-$.left+b.left,right:$.right-I.right+b.right},q=t.modifiersData.offset;if(m===N&&q){var V=q[o];Object.keys(D).forEach((function(t){var e=[k,E].indexOf(t)>=0?1:-1,i=[T,E].indexOf(t)>=0?"y":"x";D[t]+=V[i]*e}))}return D}function ct(t,e,i){return a(t,r(e,i))}const ut={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,s=t.name,n=i.mainAxis,o=void 0===n||n,l=i.altAxis,d=void 0!==l&&l,h=i.boundary,c=i.rootBoundary,u=i.altBoundary,p=i.padding,m=i.tether,g=void 0===m||m,v=i.tetherOffset,f=void 0===v?0:v,y=ht(e,{boundary:h,rootBoundary:c,padding:p,altBoundary:u}),w=Q(e.placement),C=X(e.placement),S=!C,x=Z(w),I="x"===x?"y":"x",A=e.modifiersData.popperOffsets,$=e.rects.reference,P=e.rects.popper,q="function"==typeof f?f(Object.assign({},e.rects,{placement:e.placement})):f,B="number"==typeof q?{mainAxis:q,altAxis:q}:Object.assign({mainAxis:0,altAxis:0},q),H=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,N={x:0,y:0};if(A){if(o){var M,V="y"===x?T:O,R="y"===x?E:k,F="y"===x?"height":"width",j=A[x],W=j+y[V],U=j-y[R],z=g?-P[F]/2:0,J=C===D?$[F]:P[F],G=C===D?-P[F]:-$[F],K=e.elements.arrow,_=g&&K?b(K):{width:0,height:0},Y=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},tt=Y[V],et=Y[R],it=ct(0,$[F],_[F]),st=S?$[F]/2-z-it-tt-B.mainAxis:J-it-tt-B.mainAxis,nt=S?-$[F]/2+z+it+et+B.mainAxis:G+it+et+B.mainAxis,ot=e.elements.arrow&&L(e.elements.arrow),lt=ot?"y"===x?ot.clientTop||0:ot.clientLeft||0:0,at=null!=(M=null==H?void 0:H[x])?M:0,rt=j+nt-at,dt=ct(g?r(W,j+st-at-lt):W,j,g?a(U,rt):U);A[x]=dt,N[x]=dt-j}if(d){var ut,pt="x"===x?T:O,mt="x"===x?E:k,gt=A[I],vt="y"===I?"height":"width",ft=gt+y[pt],yt=gt-y[mt],wt=-1!==[T,O].indexOf(w),bt=null!=(ut=null==H?void 0:H[I])?ut:0,Ct=wt?ft:gt-$[vt]-P[vt]-bt+B.altAxis,St=wt?gt+$[vt]+P[vt]-bt-B.altAxis:yt,xt=g&&wt?function(t,e,i){var s=ct(t,e,i);return s>i?i:s}(Ct,gt,St):ct(g?Ct:ft,gt,g?St:yt);A[I]=xt,N[I]=xt-gt}e.modifiersData[s]=N}},requiresIfExists:["offset"]};const pt={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,s=t.name,n=t.options,o=i.elements.arrow,l=i.modifiersData.popperOffsets,a=Q(i.placement),r=Z(a),d=[O,k].indexOf(a)>=0?"height":"width";if(o&&l){var h=function(t,e){return rt("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:dt(t,P))}(n.padding,i),c=b(o),u="y"===r?T:O,p="y"===r?E:k,m=i.rects.reference[d]+i.rects.reference[r]-l[r]-i.rects.popper[d],g=l[r]-i.rects.reference[r],v=L(o),f=v?"y"===r?v.clientHeight||0:v.clientWidth||0:0,y=m/2-g/2,w=h[u],C=f-c[d]-h[p],S=f/2-c[d]/2+y,x=ct(w,S,C),I=r;i.modifiersData[s]=((e={})[I]=x,e.centerOffset=x-S,e)}},effect:function(t){var e=t.state,i=t.options.element,s=void 0===i?"[data-popper-arrow]":i;null!=s&&("string"!=typeof s||(s=e.elements.popper.querySelector(s)))&&nt(e.elements.popper,s)&&(e.elements.arrow=s)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function mt(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function gt(t){return[T,k,E,O].some((function(e){return t[e]>=0}))}var vt=z({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,o=n.scroll,l=void 0===o||o,a=n.resize,r=void 0===a||a,d=s(e.elements.popper),h=[].concat(e.scrollParents.reference,e.scrollParents.popper);return l&&h.forEach((function(t){t.addEventListener("scroll",i.update,J)})),r&&d.addEventListener("resize",i.update,J),function(){l&&h.forEach((function(t){t.removeEventListener("scroll",i.update,J)})),r&&d.removeEventListener("resize",i.update,J)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=G({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,s=i.gpuAcceleration,n=void 0===s||s,o=i.adaptive,l=void 0===o||o,a=i.roundOffsets,r=void 0===a||a,d={placement:Q(e.placement),variation:X(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,_(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:l,roundOffsets:r})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,_(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:r})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},s=e.attributes[t]||{},n=e.elements[t];o(n)&&m(n)&&(Object.assign(n.style,i),Object.keys(s).forEach((function(t){var e=s[t];!1===e?n.removeAttribute(t):n.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var s=e.elements[t],n=e.attributes[t]||{},l=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});o(s)&&m(s)&&(Object.assign(s.style,l),Object.keys(n).forEach((function(t){s.removeAttribute(t)})))}))}},requires:["computeStyles"]},Y,{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,s=t.name;if(!e.modifiersData[s]._skip){for(var n=i.mainAxis,o=void 0===n||n,l=i.altAxis,a=void 0===l||l,r=i.fallbackPlacements,d=i.padding,h=i.boundary,c=i.rootBoundary,u=i.altBoundary,p=i.flipVariations,m=void 0===p||p,g=i.allowedAutoPlacements,v=e.options.placement,f=Q(v),y=r||(f===v||!m?[et(v)]:function(t){if(Q(t)===$)return[];var e=et(t);return[st(t),e,st(e)]}(v)),w=[v].concat(y).reduce((function(t,i){return t.concat(Q(i)===$?function(t,e){void 0===e&&(e={});var i=e,s=i.placement,n=i.boundary,o=i.rootBoundary,l=i.padding,a=i.flipVariations,r=i.allowedAutoPlacements,d=void 0===r?R:r,h=X(s),c=h?a?V:V.filter((function(t){return X(t)===h})):P,u=c.filter((function(t){return d.indexOf(t)>=0}));0===u.length&&(u=c);var p=u.reduce((function(e,i){return e[i]=ht(t,{placement:i,boundary:n,rootBoundary:o,padding:l})[Q(i)],e}),{});return Object.keys(p).sort((function(t,e){return p[t]-p[e]}))}(e,{placement:i,boundary:h,rootBoundary:c,padding:d,flipVariations:m,allowedAutoPlacements:g}):i)}),[]),b=e.rects.reference,C=e.rects.popper,S=new Map,x=!0,I=w[0],A=0;A=0,N=H?"width":"height",M=ht(e,{placement:L,boundary:h,rootBoundary:c,altBoundary:u,padding:d}),F=H?B?k:O:B?E:T;b[N]>C[N]&&(F=et(F));var j=et(F),W=[];if(o&&W.push(M[q]<=0),a&&W.push(M[F]<=0,M[j]<=0),W.every((function(t){return t}))){I=L,x=!1;break}S.set(L,W)}if(x)for(var U=function(t){var e=w.find((function(e){var i=S.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return I=e,"break"},z=m?3:1;z>0;z--){if("break"===U(z))break}e.placement!==I&&(e.modifiersData[s]._skip=!0,e.placement=I,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},ut,pt,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,s=e.rects.reference,n=e.rects.popper,o=e.modifiersData.preventOverflow,l=ht(e,{elementContext:"reference"}),a=ht(e,{altBoundary:!0}),r=mt(l,s),d=mt(a,n,o),h=gt(r),c=gt(d);e.modifiersData[i]={referenceClippingOffsets:r,popperEscapeOffsets:d,isReferenceHidden:h,hasPopperEscaped:c},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":c})}}]})},189:(t,e,i)=>{i.d(e,{Fy:()=>o,In:()=>n,LO:()=>r,fp:()=>l,jU:()=>a,lP:()=>s});const s={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"},n=["Escape","ArrowUp","ArrowDown","Home","End","Enter"],o=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],l=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"],a=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],r={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},290:(t,e,i)=>{i.d(e,{A:()=>l});var s=i(926),n=i(615); +/* + * HSAccordion + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class o extends n.A{constructor(t,e,i){super(t,e,i),this.toggle=this.el.querySelector(".hs-accordion-toggle")||null,this.content=this.el.querySelector(".hs-accordion-content")||null,this.update(),this.toggle&&this.content&&this.init()}init(){this.createCollection(window.$hsAccordionCollection,this),this.toggle.addEventListener("click",(t=>{t.stopPropagation(),this.el.classList.contains("active")?this.hide():this.show()}))}show(){var t;if(this.group&&!this.isAlwaysOpened&&this.group.querySelector(":scope > .hs-accordion.active")&&this.group.querySelector(":scope > .hs-accordion.active")!==this.el){window.$hsAccordionCollection.find((t=>t.element.el===this.group.querySelector(":scope > .hs-accordion.active"))).element.hide()}if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.content.style.display="block",this.content.style.height="0",setTimeout((()=>{this.content.style.height=`${this.content.scrollHeight}px`})),(0,s.yd)(this.content,(()=>{this.content.style.display="block",this.content.style.height="",this.fireEvent("open",this.el),(0,s.JD)("open.hs.accordion",this.el,this.el)}))}hide(){var t;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.content.style.height=`${this.content.scrollHeight}px`,setTimeout((()=>{this.content.style.height="0"})),(0,s.yd)(this.content,(()=>{this.content.style.display="",this.content.style.height="0",this.fireEvent("close",this.el),(0,s.JD)("close.hs.accordion",this.el,this.el)}))}update(){if(this.group=this.el.closest(".hs-accordion-group")||null,!this.group)return!1;this.isAlwaysOpened=this.group.hasAttribute("data-hs-accordion-always-open")||!1,window.$hsAccordionCollection.map((t=>(t.id===this.el.id&&(t.element.group=this.group,t.element.isAlwaysOpened=this.isAlwaysOpened),t)))}static getInstance(t,e){const i=window.$hsAccordionCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element.el:null}static show(t){const e=window.$hsAccordionCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));e&&"block"!==e.element.content.style.display&&e.element.show()}static hide(t){const e=window.$hsAccordionCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));e&&"block"===e.element.content.style.display&&e.element.hide()}static autoInit(){window.$hsAccordionCollection||(window.$hsAccordionCollection=[]),document.querySelectorAll(".hs-accordion:not(.--prevent-on-load-init)").forEach((t=>{window.$hsAccordionCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new o(t)}))}static treeView(){if(!document.querySelectorAll(".hs-accordion-treeview-root").length)return!1;this.selectable=[],document.querySelectorAll(".hs-accordion-treeview-root").forEach((t=>{const e=null==t?void 0:t.getAttribute("data-hs-accordion-options"),i=e?JSON.parse(e):{};this.selectable.push({el:t,options:Object.assign({},i)})})),this.selectable.length&&this.selectable.forEach((t=>{const{el:e}=t;e.querySelectorAll(".hs-accordion-selectable").forEach((e=>{e.addEventListener("click",(i=>{i.stopPropagation(),this.toggleSelected(t,e)}))}))}))}static toggleSelected(t,e){e.classList.contains("selected")?e.classList.remove("selected"):(t.el.querySelectorAll(".hs-accordion-selectable").forEach((t=>t.classList.remove("selected"))),e.classList.add("selected"))}static on(t,e,i){const s=window.$hsAccordionCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));s&&(s.element.events[t]=i)}}window.addEventListener("load",(()=>{o.autoInit(),document.querySelectorAll(".hs-accordion-treeview-root").length&&o.treeView()})),"undefined"!=typeof window&&(window.HSAccordion=o);const l=o},615:(t,e,i)=>{i.d(e,{A:()=>s});class s{constructor(t,e,i){this.el=t,this.options=e,this.events=i,this.el=t,this.options=e,this.events={}}createCollection(t,e){var i;t.push({id:(null===(i=null==e?void 0:e.el)||void 0===i?void 0:i.id)||t.length+1,element:e})}fireEvent(t,e=null){if(this.events.hasOwnProperty(t))return this.events[t](e)}on(t,e){this.events[t]=e}}},238:(t,e,i)=>{i.d(e,{A:()=>a});var s=i(926),n=i(615),o=i(189); +/* + * HSCarousel + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class l extends n.A{constructor(t,e){var i,s,n,o,l;super(t,e);const a=t.getAttribute("data-hs-carousel"),r=a?JSON.parse(a):{},d=Object.assign(Object.assign({},r),e);this.currentIndex=d.currentIndex||0,this.loadingClasses=d.loadingClasses?`${d.loadingClasses}`.split(","):null,this.dotsItemClasses=d.dotsItemClasses?d.dotsItemClasses:null,this.isAutoHeight=void 0!==d.isAutoHeight&&d.isAutoHeight,this.isAutoPlay=void 0!==d.isAutoPlay&&d.isAutoPlay,this.isCentered=void 0!==d.isCentered&&d.isCentered,this.isDraggable=void 0!==d.isDraggable&&d.isDraggable,this.isInfiniteLoop=void 0!==d.isInfiniteLoop&&d.isInfiniteLoop,this.isRTL=void 0!==d.isRTL&&d.isRTL,this.isSnap=void 0!==d.isSnap&&d.isSnap,this.hasSnapSpacers=void 0===d.hasSnapSpacers||d.hasSnapSpacers,this.speed=d.speed||4e3,this.updateDelay=d.updateDelay||0,this.slidesQty=d.slidesQty||1,this.loadingClassesRemove=(null===(i=this.loadingClasses)||void 0===i?void 0:i[0])?this.loadingClasses[0].split(" "):"opacity-0",this.loadingClassesAdd=(null===(s=this.loadingClasses)||void 0===s?void 0:s[1])?this.loadingClasses[1].split(" "):"",this.afterLoadingClassesAdd=(null===(n=this.loadingClasses)||void 0===n?void 0:n[2])?this.loadingClasses[2].split(" "):"",this.container=this.el.querySelector(".hs-carousel")||null,this.inner=this.el.querySelector(".hs-carousel-body")||null,this.slides=this.el.querySelectorAll(".hs-carousel-slide")||[],this.prev=this.el.querySelector(".hs-carousel-prev")||null,this.next=this.el.querySelector(".hs-carousel-next")||null,this.dots=this.el.querySelector(".hs-carousel-pagination")||null,this.info=this.el.querySelector(".hs-carousel-info")||null,this.infoTotal=(null===(o=null==this?void 0:this.info)||void 0===o?void 0:o.querySelector(".hs-carousel-info-total"))||null,this.infoCurrent=(null===(l=null==this?void 0:this.info)||void 0===l?void 0:l.querySelector(".hs-carousel-info-current"))||null,this.sliderWidth=this.el.getBoundingClientRect().width,this.isDragging=!1,this.dragStartX=null,this.initialTranslateX=null,this.touchX={start:0,end:0},this.resizeContainer=document.querySelector("body"),this.resizeContainerWidth=0,this.init()}setIsSnap(){const t=this.container.getBoundingClientRect(),e=t.left+t.width/2;let i=null,s=null,n=1/0;Array.from(this.inner.children).forEach((t=>{const s=t.getBoundingClientRect(),o=this.inner.getBoundingClientRect(),l=s.left+s.width/2-o.left,a=Math.abs(e-(o.left+l));at===i))),this.setIndex(s),this.dots&&this.setCurrentDot()}init(){this.createCollection(window.$hsCarouselCollection,this),this.inner&&(this.calculateWidth(),this.isDraggable&&!this.isSnap&&this.initDragHandling()),this.prev&&this.prev.addEventListener("click",(()=>{this.goToPrev(),this.isAutoPlay&&(this.resetTimer(),this.setTimer())})),this.next&&this.next.addEventListener("click",(()=>{this.goToNext(),this.isAutoPlay&&(this.resetTimer(),this.setTimer())})),this.dots&&this.initDots(),this.info&&this.buildInfo(),this.slides.length&&(this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass(),this.isAutoPlay&&this.autoPlay()),setTimeout((()=>{this.isSnap&&this.setIsSnap(),this.loadingClassesRemove&&("string"==typeof this.loadingClassesRemove?this.inner.classList.remove(this.loadingClassesRemove):this.inner.classList.remove(...this.loadingClassesRemove)),this.loadingClassesAdd&&("string"==typeof this.loadingClassesAdd?this.inner.classList.add(this.loadingClassesAdd):this.inner.classList.add(...this.loadingClassesAdd)),this.inner&&this.afterLoadingClassesAdd&&setTimeout((()=>{"string"==typeof this.afterLoadingClassesAdd?this.inner.classList.add(this.afterLoadingClassesAdd):this.inner.classList.add(...this.afterLoadingClassesAdd)}))}),400),this.isSnap&&this.container.addEventListener("scroll",(()=>{clearTimeout(this.isScrolling),this.isScrolling=setTimeout((()=>{this.setIsSnap()}),100)})),this.el.classList.add("init"),this.isSnap||(this.el.addEventListener("touchstart",(t=>{this.touchX.start=t.changedTouches[0].screenX})),this.el.addEventListener("touchend",(t=>{this.touchX.end=t.changedTouches[0].screenX,this.detectDirection()}))),this.observeResize()}initDragHandling(){const t=this.inner;t&&(t.addEventListener("mousedown",this.handleDragStart.bind(this)),t.addEventListener("touchstart",this.handleDragStart.bind(this),{passive:!0}),document.addEventListener("mousemove",this.handleDragMove.bind(this)),document.addEventListener("touchmove",this.handleDragMove.bind(this),{passive:!1}),document.addEventListener("mouseup",this.handleDragEnd.bind(this)),document.addEventListener("touchend",this.handleDragEnd.bind(this)))}getTranslateXValue(){var t;const e=window.getComputedStyle(this.inner).transform;if("none"!==e){const i=null===(t=e.match(/matrix.*\((.+)\)/))||void 0===t?void 0:t[1].split(", ");if(i){let t=parseFloat(6===i.length?i[4]:i[12]);return this.isRTL&&(t=-t),isNaN(t)||0===t?0:-t}}return 0}removeClickEventWhileDragging(t){t.preventDefault()}handleDragStart(t){t.preventDefault(),this.isDragging=!0,this.dragStartX=this.getEventX(t),this.initialTranslateX=this.isRTL?this.getTranslateXValue():-this.getTranslateXValue(),this.inner.classList.add("dragging")}handleDragMove(t){if(!this.isDragging)return;this.inner.querySelectorAll("a:not(.prevented-click)").forEach((t=>{t.classList.add("prevented-click"),t.addEventListener("click",this.removeClickEventWhileDragging)}));let e=this.getEventX(t)-this.dragStartX;this.isRTL&&(e=-e);const i=this.initialTranslateX+e;this.setTranslate((()=>{let t=this.sliderWidth*this.slides.length/this.getCurrentSlidesQty()-this.sliderWidth;const e=this.sliderWidth,s=(e-e/this.getCurrentSlidesQty())/2,n=this.isCentered?s:0;this.isCentered&&(t+=s);const o=-t;return this.isRTL?it?o:-i:i>n?n:i<-t?o:i})())}handleDragEnd(){if(!this.isDragging)return;this.isDragging=!1;const t=this.sliderWidth/this.getCurrentSlidesQty(),e=this.getTranslateXValue();let i=Math.round(e/t);this.isRTL&&(i=Math.round(e/t)),this.inner.classList.remove("dragging"),setTimeout((()=>{this.calculateTransform(i),this.dots&&this.setCurrentDot(),this.dragStartX=null,this.initialTranslateX=null,this.inner.querySelectorAll("a.prevented-click").forEach((t=>{t.classList.remove("prevented-click"),t.removeEventListener("click",this.removeClickEventWhileDragging)}))}))}getEventX(t){return t instanceof MouseEvent?t.clientX:t.touches[0].clientX}getCurrentSlidesQty(){if("object"==typeof this.slidesQty){const t=document.body.clientWidth;let e=0;return Object.keys(this.slidesQty).forEach((i=>{t>=(typeof i+1=="number"?this.slidesQty[i]:o.LO[i])&&(e=this.slidesQty[i])})),e}return this.slidesQty}buildSnapSpacers(){const t=this.inner.querySelector(".hs-snap-before"),e=this.inner.querySelector(".hs-snap-after");t&&t.remove(),e&&e.remove();const i=this.sliderWidth,n=i/2-i/this.getCurrentSlidesQty()/2,o=(0,s.fc)(`
`),l=(0,s.fc)(`
`);this.inner.prepend(o),this.inner.appendChild(l)}initDots(){this.el.querySelectorAll(".hs-carousel-pagination-item").length?this.setDots():this.buildDots(),this.dots&&this.setCurrentDot()}buildDots(){this.dots.innerHTML="";const t=!this.isCentered&&this.slidesQty?this.slides.length-(this.getCurrentSlidesQty()-1):this.slides.length;for(let e=0;e{const i=t.getAttribute("data-carousel-pagination-item-target");this.singleDotEvents(t,i?+i:e)}))}goToCurrentDot(){const t=this.dots,e=t.getBoundingClientRect(),i=t.scrollLeft,s=t.scrollTop,n=t.clientWidth,o=t.clientHeight,l=this.dotsItems[this.currentIndex],a=l.getBoundingClientRect(),r=a.left-e.left+i,d=r+l.clientWidth,h=a.top-e.top+s,c=h+l.clientHeight;let u=i,p=s;(ri+n)&&(u=d-n),(hs+o)&&(p=c-o),t.scrollTo({left:u,top:p,behavior:"smooth"})}buildInfo(){this.infoTotal&&this.setInfoTotal(),this.infoCurrent&&this.setInfoCurrent()}setInfoTotal(){this.infoTotal.innerText=`${this.slides.length}`}setInfoCurrent(){this.infoCurrent.innerText=`${this.currentIndex+1}`}buildSingleDot(t){const e=(0,s.fc)("");return this.dotsItemClasses&&(0,s.en)(this.dotsItemClasses,e),this.singleDotEvents(e,t),e}singleDotEvents(t,e){t.addEventListener("click",(()=>{this.goTo(e),this.isAutoPlay&&(this.resetTimer(),this.setTimer())}))}observeResize(){new ResizeObserver((0,s.sg)((t=>{for(let e of t){const t=e.contentRect.width;t!==this.resizeContainerWidth&&(this.recalculateWidth(),this.dots&&this.initDots(),this.addCurrentClass(),this.resizeContainerWidth=t)}}),this.updateDelay)).observe(this.resizeContainer)}calculateWidth(){this.isSnap||(this.inner.style.width=this.sliderWidth*this.slides.length/this.getCurrentSlidesQty()+"px"),this.slides.forEach((t=>{t.style.width=this.sliderWidth/this.getCurrentSlidesQty()+"px"})),this.calculateTransform()}addCurrentClass(){if(this.isSnap){const t=Math.floor(this.getCurrentSlidesQty()/2);for(let e=0;e=this.currentIndex-t?i.classList.add("active"):i.classList.remove("active")}}else{const t=this.isCentered?this.currentIndex+this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.currentIndex+this.getCurrentSlidesQty();this.slides.forEach(((e,i)=>{i>=this.currentIndex&&i{let i=!1;const s=Math.floor(this.getCurrentSlidesQty()/2);i=this.isSnap&&!this.hasSnapSpacers?e===(this.getCurrentSlidesQty()%2==0?this.currentIndex-s+1:this.currentIndex-s):e===this.currentIndex,i?t.classList.add("active"):t.classList.remove("active")};this.dotsItems?this.dotsItems.forEach(((e,i)=>t(e,i))):this.dots.querySelectorAll(":scope > *").forEach(((e,i)=>t(e,i)))}setElementToDisabled(t){t.classList.add("disabled"),"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled")}unsetElementToDisabled(t){t.classList.remove("disabled"),"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled")}addDisabledClass(){if(!this.prev||!this.next)return!1;const t=getComputedStyle(this.inner).getPropertyValue("gap"),e=Math.floor(this.getCurrentSlidesQty()/2);let i=0,s=0,n=!1,o=!1;this.isSnap?(i=this.currentIndex,s=this.hasSnapSpacers?this.slides.length-1:this.slides.length-e-1,n=this.hasSnapSpacers?0===i:this.getCurrentSlidesQty()%2==0?i-e<0:i-e==0,o=i>=s&&this.container.scrollLeft+this.container.clientWidth+(parseFloat(t)||0)>=this.container.scrollWidth):(i=this.currentIndex,s=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty(),n=0===i,o=i>=s),n?(this.unsetElementToDisabled(this.next),this.setElementToDisabled(this.prev)):o?(this.unsetElementToDisabled(this.prev),this.setElementToDisabled(this.next)):(this.unsetElementToDisabled(this.prev),this.unsetElementToDisabled(this.next))}autoPlay(){this.setTimer()}setTimer(){this.timer=setInterval((()=>{this.currentIndex===this.slides.length-1?this.goTo(0):this.goToNext()}),this.speed)}resetTimer(){clearInterval(this.timer)}detectDirection(){const{start:t,end:e}=this.touchX;et&&this.goToPrev()}recalculateWidth(){this.sliderWidth=this.inner.parentElement.getBoundingClientRect().width,this.calculateWidth(),this.sliderWidth!==this.inner.parentElement.getBoundingClientRect().width&&this.recalculateWidth()}calculateTransform(t){void 0!==t&&(this.currentIndex=t),this.currentIndex>this.slides.length-this.getCurrentSlidesQty()&&!this.isCentered&&(this.currentIndex=this.slides.length-this.getCurrentSlidesQty());const e=this.sliderWidth,i=e/this.getCurrentSlidesQty();let s=this.currentIndex*i;if(this.isSnap&&!this.isCentered&&this.container.scrollLefte&&(this.container.scrollLeft=this.container.scrollWidth),this.isCentered&&!this.isSnap){const t=(e-i)/2;if(0===this.currentIndex)s=-t;else if(this.currentIndex>=this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1)){s=this.slides.length*i-e+t}else s=this.currentIndex*i-t}this.isSnap||(this.inner.style.transform=this.isRTL?`translate(${s}px, 0px)`:`translate(${-s}px, 0px)`),this.isAutoHeight&&(this.inner.style.height=`${this.slides[this.currentIndex].clientHeight}px`),this.dotsItems&&this.goToCurrentDot(),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass(),this.isSnap&&this.hasSnapSpacers&&this.buildSnapSpacers(),this.infoCurrent&&this.setInfoCurrent()}setTranslate(t){this.inner.style.transform=this.isRTL?`translate(${-t}px, 0px)`:`translate(${t}px, 0px)`}goToPrev(){if(this.currentIndex>0?this.currentIndex--:this.currentIndex=this.slides.length-this.getCurrentSlidesQty(),this.isSnap){const t=this.sliderWidth/this.getCurrentSlidesQty();this.container.scrollBy({left:Math.max(-this.container.scrollLeft,-t),behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()}goToNext(){const t=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty();if(this.currentIndexthis.currentIndex?e-this.currentIndex:this.currentIndex-e,s=e>this.currentIndex?-t*i:t*i;this.container.scrollBy({left:s,behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()}setIndex(t){this.currentIndex=t,this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}static getInstance(t,e){const i=window.$hsCarouselCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element:null}static autoInit(){window.$hsCarouselCollection||(window.$hsCarouselCollection=[]),document.querySelectorAll("[data-hs-carousel]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsCarouselCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new l(t)}))}}window.addEventListener("load",(()=>{l.autoInit()})),"undefined"!=typeof window&&(window.HSCarousel=l);const a=l},883:(t,e,i)=>{i.d(e,{A:()=>l});var s=i(926),n=i(615); +/* + * HSCollapse + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class o extends n.A{constructor(t,e,i){super(t,e,i),this.contentId=this.el.dataset.hsCollapse,this.content=document.querySelector(this.contentId),this.animationInProcess=!1,this.content&&this.init()}init(){var t;this.createCollection(window.$hsCollapseCollection,this),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.el.ariaExpanded="true":this.el.ariaExpanded="false"),this.el.addEventListener("click",(()=>{this.content.classList.contains("open")?this.hide():this.show()}))}hideAllMegaMenuItems(){this.content.querySelectorAll(".hs-mega-menu-content.block").forEach((t=>{t.classList.remove("block"),t.classList.add("hidden")}))}show(){var t;if(this.animationInProcess||this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.add("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="true"),this.content.classList.add("open"),this.content.classList.remove("hidden"),this.content.style.height="0",setTimeout((()=>{this.content.style.height=`${this.content.scrollHeight}px`,this.fireEvent("beforeOpen",this.el),(0,s.JD)("beforeOpen.hs.collapse",this.el,this.el)})),(0,s.yd)(this.content,(()=>{this.content.style.height="",this.fireEvent("open",this.el),(0,s.JD)("open.hs.collapse",this.el,this.el),this.animationInProcess=!1}))}hide(){var t;if(this.animationInProcess||!this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.remove("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="false"),this.content.style.height=`${this.content.scrollHeight}px`,setTimeout((()=>{this.content.style.height="0"})),this.content.classList.remove("open"),(0,s.yd)(this.content,(()=>{this.content.classList.add("hidden"),this.content.style.height="",this.fireEvent("hide",this.el),(0,s.JD)("hide.hs.collapse",this.el,this.el),this.animationInProcess=!1})),this.content.querySelectorAll(".hs-mega-menu-content.block").length&&this.hideAllMegaMenuItems()}static getInstance(t,e=!1){const i=window.$hsCollapseCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element.el:null}static autoInit(){window.$hsCollapseCollection||(window.$hsCollapseCollection=[]),document.querySelectorAll(".hs-collapse-toggle:not(.--prevent-on-load-init)").forEach((t=>{window.$hsCollapseCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new o(t)}))}static show(t){const e=window.$hsCollapseCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));e&&e.element.content.classList.contains("hidden")&&e.element.show()}static hide(t){const e=window.$hsCollapseCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));e&&!e.element.content.classList.contains("hidden")&&e.element.hide()}static on(t,e,i){const s=window.$hsCollapseCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));s&&(s.element.events[t]=i)}}window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSCollapse=o);const l=o},459:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(926),n=i(615),o=i(189),l=function(t,e,i,s){return new(i||(i=Promise))((function(n,o){function l(t){try{r(s.next(t))}catch(t){o(t)}}function a(t){try{r(s.throw(t))}catch(t){o(t)}}function r(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(l,a)}r((s=s.apply(t,e||[])).next())}))};class a extends n.A{constructor(t,e,i){var s,n,o,l,a,r,d,h,c,u,p,m,g,v,f,y,w,b,C,S,x,I,A,L,T;super(t,e,i);const E=t.getAttribute("data-hs-combo-box"),k=E?JSON.parse(E):{},O=Object.assign(Object.assign({},k),e);this.gap=5,this.viewport=null!==(s="string"==typeof(null==O?void 0:O.viewport)?document.querySelector(null==O?void 0:O.viewport):null==O?void 0:O.viewport)&&void 0!==s?s:null,this.preventVisibility=null!==(n=null==O?void 0:O.preventVisibility)&&void 0!==n&&n,this.apiUrl=null!==(o=null==O?void 0:O.apiUrl)&&void 0!==o?o:null,this.apiDataPart=null!==(l=null==O?void 0:O.apiDataPart)&&void 0!==l?l:null,this.apiQuery=null!==(a=null==O?void 0:O.apiQuery)&&void 0!==a?a:null,this.apiSearchQuery=null!==(r=null==O?void 0:O.apiSearchQuery)&&void 0!==r?r:null,this.apiHeaders=null!==(d=null==O?void 0:O.apiHeaders)&&void 0!==d?d:{},this.apiGroupField=null!==(h=null==O?void 0:O.apiGroupField)&&void 0!==h?h:null,this.outputItemTemplate=null!==(c=null==O?void 0:O.outputItemTemplate)&&void 0!==c?c:'
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
',this.outputEmptyTemplate=null!==(u=null==O?void 0:O.outputEmptyTemplate)&&void 0!==u?u:'
Nothing found...
',this.outputLoaderTemplate=null!==(p=null==O?void 0:O.outputLoaderTemplate)&&void 0!==p?p:'
\n\t\t\t\t
\n\t\t\t\t\tLoading...\n\t\t\t\t
\n\t\t\t
',this.groupingType=null!==(m=null==O?void 0:O.groupingType)&&void 0!==m?m:null,this.groupingTitleTemplate=null!==(g=null==O?void 0:O.groupingTitleTemplate)&&void 0!==g?g:"default"===this.groupingType?'
':'',this.tabsWrapperTemplate=null!==(v=null==O?void 0:O.tabsWrapperTemplate)&&void 0!==v?v:'
',this.preventSelection=null!==(f=null==O?void 0:O.preventSelection)&&void 0!==f&&f,this.preventAutoPosition=null!==(y=null==O?void 0:O.preventAutoPosition)&&void 0!==y&&y,this.isOpenOnFocus=null!==(w=null==O?void 0:O.isOpenOnFocus)&&void 0!==w&&w,this.input=null!==(b=this.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==b?b:null,this.output=null!==(C=this.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==C?C:null,this.itemsWrapper=null!==(S=this.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==S?S:null,this.items=null!==(x=Array.from(this.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==x?x:[],this.tabs=[],this.toggle=null!==(I=this.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==I?I:null,this.toggleClose=null!==(A=this.el.querySelector("[data-hs-combo-box-close]"))&&void 0!==A?A:null,this.toggleOpen=null!==(L=this.el.querySelector("[data-hs-combo-box-open]"))&&void 0!==L?L:null,this.outputPlaceholder=null,this.selected=this.value=null!==(T=this.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==T?T:"",this.isOpened=!1,this.isCurrent=!1,this.animationInProcess=!1,this.selectedGroup="all",this.init()}init(){this.createCollection(window.$hsComboBoxCollection,this),this.build()}build(){this.buildInput(),this.groupingType&&this.setGroups(),this.buildItems(),this.preventVisibility&&(this.preventAutoPosition||this.recalculateDirection()),this.toggle&&this.buildToggle(),this.toggleClose&&this.buildToggleClose(),this.toggleOpen&&this.buildToggleOpen()}setResultAndRender(t=""){let e=this.preventVisibility?this.input.value:t;this.setResults(e),this.apiSearchQuery&&this.itemsFromJson()}buildInput(){this.isOpenOnFocus&&this.input.addEventListener("focus",(()=>{this.isOpened||(this.setResultAndRender(),this.open())})),this.input.addEventListener("input",(0,s.sg)((t=>{this.setResultAndRender(t.target.value),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),this.isOpened||this.open()})))}buildItems(){this.output.role="listbox",this.output.tabIndex=-1,this.output.ariaOrientation="vertical",this.apiUrl?this.itemsFromJson():(this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="",this.itemsFromHtml())}setResults(t){this.value=t,this.resultItems(),this.hasVisibleItems()?this.destroyOutputPlaceholder():this.buildOutputPlaceholder()}isItemExists(t){return this.items.some((e=>{var i,s,n;const o=null!==(i=e.getAttribute("data-hs-combo-box-output-item-group-field"))&&void 0!==i?i:null,l=null!==(s=JSON.parse(e.getAttribute("data-hs-combo-box-output-item")))&&void 0!==s?s:null;let a=null;return o&&(null===(n=null==l?void 0:l.group)||void 0===n?void 0:n.name)&&(a=t[o]),Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some((e=>{var i;return(null===(i=null==l?void 0:l.group)||void 0===i?void 0:i.name)&&a?a===l.group.name&&e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]:e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]}))}))}isTextExists(t,e){const i=e.map((t=>t.toLowerCase()));return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).some((t=>i.includes(t.getAttribute("data-hs-combo-box-search-text").toLowerCase())))}isTextExistsAny(t,e){return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).some((t=>t.getAttribute("data-hs-combo-box-search-text").toLowerCase().includes(e.toLowerCase())))}valuesBySelector(t){return Array.from(t.querySelectorAll("[data-hs-combo-box-search-text]")).reduce(((t,e)=>[...t,e.getAttribute("data-hs-combo-box-search-text")]),[])}buildOutputLoader(){if(this.outputLoader)return!1;this.outputLoader=(0,s.fc)(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)}destroyOutputLoader(){this.outputLoader&&this.outputLoader.remove(),this.outputLoader=null}itemsFromJson(){return l(this,void 0,void 0,(function*(){this.buildOutputLoader();try{const t=`${this.apiQuery}`,e=`${this.apiSearchQuery}=${this.value.toLowerCase()}`;let i=this.apiUrl;this.apiQuery&&this.apiSearchQuery?i+=`?${e}&${t}`:this.apiQuery?i+=`?${t}`:this.apiSearchQuery&&(i+=`?${e}`);const n=yield fetch(i,this.apiHeaders);let o=yield n.json();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((t=>{const e=(0,s.fc)(this.groupingTitleTemplate);e.setAttribute("data-hs-combo-box-group-title",t.name),e.classList.add("--exclude-accessibility"),e.innerText=t.title;const i=o.filter((e=>e[this.apiGroupField]===t.name));this.itemsWrapper?this.itemsWrapper.append(e):this.output.append(e),this.jsonItemsRender(i)}))):this.jsonItemsRender(o),this.setResults(this.input.value)}catch(t){console.error(t)}this.destroyOutputLoader()}))}jsonItemsRender(t){t.forEach(((t,e)=>{const i=(0,s.fc)(this.outputItemTemplate);i.querySelectorAll("[data-hs-combo-box-output-item-field]").forEach((e=>{const i=t[e.getAttribute("data-hs-combo-box-output-item-field")],s=e.hasAttribute("data-hs-combo-box-output-item-hide-if-empty");e.textContent=null!=i?i:"",!i&&s&&(e.style.display="none")})),i.querySelectorAll("[data-hs-combo-box-search-text]").forEach((e=>{var i;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((e=>{JSON.parse(e.getAttribute("data-hs-combo-box-output-item-attr")).forEach((i=>{e.setAttribute(i.attr,t[i.valueFrom])}))})),i.setAttribute("tabIndex",`${e}`),"tabs"!==this.groupingType&&"default"!==this.groupingType||i.setAttribute("data-hs-combo-box-output-item",`{"group": {"name": "${t[this.apiGroupField]}", "title": "${t[this.apiGroupField]}"}}`),this.items=[...this.items,i],this.preventSelection||i.addEventListener("click",(()=>{this.close(i.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text")),this.setSelectedByValue(this.valuesBySelector(i))})),this.appendItemsToWrapper(i)}))}setGroups(){const t=[];this.items.forEach((e=>{const{group:i}=JSON.parse(e.getAttribute("data-hs-combo-box-output-item"));t.some((t=>(null==t?void 0:t.name)===i.name))||t.push(i)})),this.groups=t}setCurrent(){window.$hsComboBoxCollection.length&&(window.$hsComboBoxCollection.map((t=>t.element.isCurrent=!1)),this.isCurrent=!0)}setApiGroups(t){const e=[];t.forEach((t=>{const i=t[this.apiGroupField];e.some((t=>t.name===i))||e.push({name:i,title:i})})),this.groups=e}sortItems(){return this.items.sort(((t,e)=>{const i=t.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text"),s=e.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text");return is?1:0}))}itemRender(t){const e=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",(()=>{this.close(e),this.setSelectedByValue(this.valuesBySelector(t))}))}plainRender(t){t.forEach((t=>{this.itemRender(t)}))}groupTabsRender(){const t=(0,s.fc)(this.tabsWrapperTemplate),e=(0,s.fc)('
');t.append(e),this.output.insertBefore(t,this.output.firstChild);const i=(0,s.fc)(this.groupingTitleTemplate);i.setAttribute("data-hs-combo-box-group-title","all"),i.classList.add("--exclude-accessibility","active"),i.innerText="All",this.tabs=[...this.tabs,i],e.append(i),i.addEventListener("click",(()=>{this.selectedGroup="all";const t=this.tabs.find((t=>t.getAttribute("data-hs-combo-box-group-title")===this.selectedGroup));this.tabs.forEach((t=>t.classList.remove("active"))),t.classList.add("active"),this.setItemsVisibility()})),this.groups.forEach((t=>{const i=(0,s.fc)(this.groupingTitleTemplate);i.setAttribute("data-hs-combo-box-group-title",t.name),i.classList.add("--exclude-accessibility"),i.innerText=t.title,this.tabs=[...this.tabs,i],e.append(i),i.addEventListener("click",(()=>{this.selectedGroup=t.name;const e=this.tabs.find((t=>t.getAttribute("data-hs-combo-box-group-title")===this.selectedGroup));this.tabs.forEach((t=>t.classList.remove("active"))),e.classList.add("active"),this.setItemsVisibility()}))}))}groupDefaultRender(){this.groups.forEach((t=>{const e=(0,s.fc)(this.groupingTitleTemplate);e.setAttribute("data-hs-combo-box-group-title",t.name),e.classList.add("--exclude-accessibility"),e.innerText=t.title,this.itemsWrapper?this.itemsWrapper.append(e):this.output.append(e);const i=this.sortItems().filter((e=>{const{group:i}=JSON.parse(e.getAttribute("data-hs-combo-box-output-item"));return i.name===t.name}));this.plainRender(i)}))}itemsFromHtml(){if("default"===this.groupingType)this.groupDefaultRender();else if("tabs"===this.groupingType){const t=this.sortItems();this.groupTabsRender(),this.plainRender(t)}else{const t=this.sortItems();this.plainRender(t)}this.setResults(this.input.value)}buildToggle(){var t,e,i,s;this.isOpened?((null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="true")):((null===(i=null==this?void 0:this.toggle)||void 0===i?void 0:i.ariaExpanded)&&(this.toggle.ariaExpanded="false"),(null===(s=null==this?void 0:this.input)||void 0===s?void 0:s.ariaExpanded)&&(this.input.ariaExpanded="false")),this.toggle.addEventListener("click",(()=>{this.isOpened?this.close():this.open(this.toggle.getAttribute("data-hs-combo-box-toggle"))}))}buildToggleClose(){this.toggleClose.addEventListener("click",(()=>this.close()))}buildToggleOpen(){this.toggleOpen.addEventListener("click",(()=>this.open()))}setSelectedByValue(t){this.items.forEach((e=>{this.isTextExists(e,t)?e.classList.add("selected"):e.classList.remove("selected")}))}setValue(t){this.selected=t,this.value=t,this.input.value=t,this.fireEvent("select",this.el),(0,s.JD)("select.hs.combobox",this.el,this.value)}setItemsVisibility(){"tabs"===this.groupingType&&"all"!==this.selectedGroup&&this.items.forEach((t=>{t.style.display="none"}));const t="tabs"===this.groupingType?"all"===this.selectedGroup?this.items:this.items.filter((t=>{const{group:e}=JSON.parse(t.getAttribute("data-hs-combo-box-output-item"));return e.name===this.selectedGroup})):this.items;"tabs"===this.groupingType&&"all"!==this.selectedGroup&&t.forEach((t=>{t.style.display="block"})),t.forEach((t=>{this.isTextExistsAny(t,this.value)?t.style.display="block":t.style.display="none"})),"default"===this.groupingType&&this.output.querySelectorAll("[data-hs-combo-box-group-title]").forEach((t=>{const e=t.getAttribute("data-hs-combo-box-group-title");this.items.filter((t=>{const{group:i}=JSON.parse(t.getAttribute("data-hs-combo-box-output-item"));return i.name===e&&"block"===t.style.display})).length?t.style.display="block":t.style.display="none"}))}hasVisibleItems(){return!!this.items.length&&this.items.some((t=>"block"===t.style.display))}appendItemsToWrapper(t){this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t)}buildOutputPlaceholder(){this.outputPlaceholder||(this.outputPlaceholder=(0,s.fc)(this.outputEmptyTemplate)),this.appendItemsToWrapper(this.outputPlaceholder)}destroyOutputPlaceholder(){this.outputPlaceholder&&this.outputPlaceholder.remove(),this.outputPlaceholder=null}resultItems(){if(!this.items.length)return!1;this.setItemsVisibility(),this.setSelectedByValue([this.selected])}setValueAndOpen(t){this.value=t,this.items.length&&this.setItemsVisibility()}open(t){return!this.animationInProcess&&(void 0!==t&&this.setValueAndOpen(t),!this.preventVisibility&&(this.animationInProcess=!0,this.output.style.display="block",this.preventAutoPosition||this.recalculateDirection(),setTimeout((()=>{var t,e;(null===(t=null==this?void 0:this.input)||void 0===t?void 0:t.ariaExpanded)&&(this.input.ariaExpanded="true"),(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.el.classList.add("active"),this.animationInProcess=!1})),void(this.isOpened=!0)))}setValueAndClear(t){t?this.setValue(t):this.setValue(this.selected),this.outputPlaceholder&&this.destroyOutputPlaceholder()}close(t){var e,i;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),!1):(this.animationInProcess=!0,(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="false"),(null===(i=null==this?void 0:this.toggle)||void 0===i?void 0:i.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.el.classList.remove("active"),this.preventAutoPosition||(this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom=""),(0,s.yd)(this.output,(()=>{this.output.style.display="none",this.setValueAndClear(t),this.animationInProcess=!1})),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),void(this.isOpened=!1)))}recalculateDirection(){(0,s.PR)(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=`${this.gap}px`):(this.output.classList.remove("top-full"),this.output.style.marginTop="",this.output.classList.add("bottom-full"),this.output.style.marginBottom=`${this.gap}px`)}static getInstance(t,e){const i=window.$hsComboBoxCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element:null}static autoInit(){window.$hsComboBoxCollection||(window.$hsComboBoxCollection=[]),document.querySelectorAll("[data-hs-combo-box]:not(.--prevent-on-load-init)").forEach((t=>{if(!window.$hsComboBoxCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))){const e=t.getAttribute("data-hs-combo-box"),i=e?JSON.parse(e):{};new a(t,i)}})),window.$hsComboBoxCollection&&(window.addEventListener("click",(t=>{const e=t.target;a.closeCurrentlyOpened(e)})),document.addEventListener("keydown",(t=>a.accessibility(t))))}static close(t){const e=window.$hsComboBoxCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));e&&e.element.isOpened&&e.element.close()}static closeCurrentlyOpened(t=null){if(!t.closest("[data-hs-combo-box].active")){const t=window.$hsComboBoxCollection.filter((t=>t.element.isOpened))||null;t&&t.forEach((t=>{t.element.close()}))}}static getPreparedItems(t=!1,e){if(!e)return null;return(t?Array.from(e.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter((t=>"none"!==t.style.display)).reverse():Array.from(e.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter((t=>"none"!==t.style.display))).filter((t=>!t.classList.contains("disabled")))}static setHighlighted(t,e,i){e.focus(),i.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")}static accessibility(t){if(window.$hsComboBoxCollection.find((t=>t.element.preventVisibility?t.element.isCurrent:t.element.isOpened))&&o.jU.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}}static onEscape(){const t=window.$hsComboBoxCollection.find((t=>!t.element.preventVisibility&&t.element.isOpened));t&&(t.element.close(),t.element.input.blur())}static onArrow(t=!0){var e;const i=window.$hsComboBoxCollection.find((t=>t.element.preventVisibility?t.element.isCurrent:t.element.isOpened));if(i){const s=null!==(e=i.element.itemsWrapper)&&void 0!==e?e:i.element.output;if(!s)return!1;const n=a.getPreparedItems(t,s),o=s.querySelector(".hs-combo-box-output-item-highlighted");let l=null;o||n[0].classList.add("hs-combo-box-output-item-highlighted");let r=n.findIndex((t=>t===o));r+1t.element.preventVisibility?t.element.isCurrent:t.element.isOpened));if(i){const s=null!==(e=i.element.itemsWrapper)&&void 0!==e?e:i.element.output;if(!s)return!1;const n=a.getPreparedItems(t,s),o=s.querySelector(".hs-combo-box-output-item-highlighted");n.length&&a.setHighlighted(o,n[0],i.element.input)}}static onEnter(t){const e=t.target,i=window.$hsComboBoxCollection.find((e=>!(0,s.sH)(e.element.el)&&t.target.closest("[data-hs-combo-box]")===e.element.el)),n=i.element.el.querySelector(".hs-combo-box-output-item-highlighted a");e.hasAttribute("data-hs-combo-box-input")?(i.element.close(),e.blur()):(i.element.preventSelection||i.element.setSelectedByValue(i.element.valuesBySelector(t.target)),i.element.preventSelection&&n&&window.location.assign(n.getAttribute("href")),i.element.close(i.element.preventSelection?null:t.target.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text")))}}window.addEventListener("load",(()=>{a.autoInit()})),document.addEventListener("scroll",(()=>{if(!window.$hsComboBoxCollection)return!1;const t=window.$hsComboBoxCollection.find((t=>t.element.isOpened));t&&!t.element.preventAutoPosition&&t.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSComboBox=a);const r=a},588:(t,e,i)=>{i.d(e,{A:()=>l});var s=i(926),n=i(615); +/* + * HSCopyMarkup + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class o extends n.A{constructor(t,e){super(t,e);const i=t.getAttribute("data-hs-copy-markup"),s=i?JSON.parse(i):{},n=Object.assign(Object.assign({},s),e);this.targetSelector=(null==n?void 0:n.targetSelector)||null,this.wrapperSelector=(null==n?void 0:n.wrapperSelector)||null,this.limit=(null==n?void 0:n.limit)||null,this.items=[],this.targetSelector&&this.init()}init(){this.createCollection(window.$hsCopyMarkupCollection,this),this.setTarget(),this.setWrapper(),this.addPredefinedItems(),this.el.addEventListener("click",(()=>this.copy()))}copy(){if(this.limit&&this.items.length>=this.limit)return!1;this.el.hasAttribute("disabled")&&this.el.setAttribute("disabled","");const 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.JD)("copy.hs.copyMarkup",t,t)}addPredefinedItems(){Array.from(this.wrapper.children).filter((t=>!t.classList.contains("[--ignore-for-count]"))).forEach((t=>{this.addToItems(t)}))}setTarget(){const t="string"==typeof this.targetSelector?document.querySelector(this.targetSelector).cloneNode(!0):this.targetSelector.cloneNode(!0);t.removeAttribute("id"),this.target=t}setWrapper(){this.wrapper="string"==typeof this.wrapperSelector?document.querySelector(this.wrapperSelector):this.wrapperSelector}addToItems(t){const e=t.querySelector("[data-hs-copy-markup-delete-item]");this.wrapper?this.wrapper.append(t):this.el.before(t),e&&e.addEventListener("click",(()=>this.delete(t))),this.items.push(t)}delete(t){const e=this.items.indexOf(t);-1!==e&&this.items.splice(e,1),t.remove(),this.fireEvent("delete",t),(0,s.JD)("delete.hs.copyMarkup",t,t)}static getInstance(t,e){const i=window.$hsCopyMarkupCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element:null}static autoInit(){window.$hsCopyMarkupCollection||(window.$hsCopyMarkupCollection=[]),document.querySelectorAll("[data-hs-copy-markup]:not(.--prevent-on-load-init)").forEach((t=>{if(!window.$hsCopyMarkupCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))){const e=t.getAttribute("data-hs-copy-markup"),i=e?JSON.parse(e):{};new o(t,i)}}))}}window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=o);const l=o},784:(t,e,i)=>{i.d(e,{A:()=>l});var s=i(926),n=i(615); +/* + * HSDataTable + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class o extends n.A{constructor(t,e,i){var s,n,o,l,a,r,d,h,c,u,p,m,g,v,f,y,w,b,C,S,x,I,A,L,T;super(t,e,i),this.el="string"==typeof t?document.querySelector(t):t;const E=[];Array.from(this.el.querySelectorAll("thead th, thead td")).forEach(((t,e)=>{t.classList.contains("--exclude-from-ordering")&&E.push({targets:e,orderable:!1})}));const k=this.el.getAttribute("data-hs-datatable"),O=k?JSON.parse(k):{};this.concatOptions=Object.assign(Object.assign({searching:!0,lengthChange:!1,order:[],columnDefs:[...E]},O),e),this.table=this.el.querySelector("table"),this.search=null!==(s=this.el.querySelector("[data-hs-datatable-search]"))&&void 0!==s?s:null,this.pageEntities=null!==(n=this.el.querySelector("[data-hs-datatable-page-entities]"))&&void 0!==n?n:null,this.paging=null!==(o=this.el.querySelector("[data-hs-datatable-paging]"))&&void 0!==o?o:null,this.pagingPrev=null!==(l=this.el.querySelector("[data-hs-datatable-paging-prev]"))&&void 0!==l?l:null,this.pagingNext=null!==(a=this.el.querySelector("[data-hs-datatable-paging-next]"))&&void 0!==a?a:null,this.pagingPages=null!==(r=this.el.querySelector("[data-hs-datatable-paging-pages]"))&&void 0!==r?r:null,this.info=null!==(d=this.el.querySelector("[data-hs-datatable-info]"))&&void 0!==d?d:null,this.infoFrom=null!==(h=this.el.querySelector("[data-hs-datatable-info-from]"))&&void 0!==h?h:null,this.infoTo=null!==(c=this.el.querySelector("[data-hs-datatable-info-to]"))&&void 0!==c?c:null,this.infoLength=null!==(u=this.el.querySelector("[data-hs-datatable-info-length]"))&&void 0!==u?u:null,(null===(p=this.concatOptions)||void 0===p?void 0:p.rowSelectingOptions)&&(this.rowSelectingAll=null!==(y=(null===(g=null===(m=this.concatOptions)||void 0===m?void 0:m.rowSelectingOptions)||void 0===g?void 0:g.selectAllSelector)?document.querySelector(null===(f=null===(v=this.concatOptions)||void 0===v?void 0:v.rowSelectingOptions)||void 0===f?void 0:f.selectAllSelector):document.querySelector("[data-hs-datatable-row-selecting-all]"))&&void 0!==y?y:null),(null===(w=this.concatOptions)||void 0===w?void 0:w.rowSelectingOptions)&&(this.rowSelectingIndividual=null!==(x=null!==(S=null===(C=null===(b=this.concatOptions)||void 0===b?void 0:b.rowSelectingOptions)||void 0===C?void 0:C.individualSelector)&&void 0!==S?S:"[data-hs-datatable-row-selecting-individual]")&&void 0!==x?x:null),this.pageEntities&&(this.concatOptions.pageLength=parseInt(this.pageEntities.value)),this.maxPagesToShow=3,this.isRowSelecting=!!(null===(I=this.concatOptions)||void 0===I?void 0:I.rowSelectingOptions),this.pageBtnClasses=null!==(T=null===(L=null===(A=this.concatOptions)||void 0===A?void 0:A.pagingOptions)||void 0===L?void 0:L.pageBtnClasses)&&void 0!==T?T:null,this.init()}init(){this.createCollection(window.$hsDataTableCollection,this),this.initTable(),this.search&&this.initSearch(),this.pageEntities&&this.initPageEntities(),this.paging&&this.initPaging(),this.pagingPrev&&this.initPagingPrev(),this.pagingNext&&this.initPagingNext(),this.pagingPages&&this.buildPagingPages(),this.info&&this.initInfo(),this.isRowSelecting&&this.initRowSelecting()}initTable(){this.dataTable=new DataTable(this.table,this.concatOptions),this.isRowSelecting&&this.triggerChangeEventToRow(),this.dataTable.on("draw",(()=>{this.isRowSelecting&&this.updateSelectAllCheckbox(),this.isRowSelecting&&this.triggerChangeEventToRow(),this.updateInfo(),this.updatePaging()}))}initSearch(){this.search.addEventListener("input",(0,s.sg)((t=>this.onSearchInput(t.target.value))))}onSearchInput(t){this.dataTable.search(t).draw()}initPageEntities(){this.pageEntities.addEventListener("change",(t=>this.onEntitiesChange(parseInt(t.target.value))))}onEntitiesChange(t){this.dataTable.page.len(t).draw()}initInfo(){this.infoFrom&&this.initInfoFrom(),this.infoTo&&this.initInfoTo(),this.infoLength&&this.initInfoLength()}initInfoFrom(){const{start:t}=this.dataTable.page.info();this.infoFrom.innerText=`${t+1}`}initInfoTo(){const{end:t}=this.dataTable.page.info();this.infoTo.innerText=`${t}`}initInfoLength(){const{recordsTotal:t}=this.dataTable.page.info();this.infoLength.innerText=`${t}`}updateInfo(){this.initInfo()}initPaging(){this.hidePagingIfSinglePage()}hidePagingIfSinglePage(){const{pages:t}=this.dataTable.page.info();t<2?(this.paging.classList.add("hidden"),this.paging.style.display="none"):(this.paging.classList.remove("hidden"),this.paging.style.display="")}initPagingPrev(){this.pagingPrev.addEventListener("click",(()=>{this.onPrevClick()}))}onPrevClick(){this.dataTable.page("previous").draw("page")}disablePagingArrow(t,e){e?(t.classList.add("disabled"),t.setAttribute("disabled","disabled")):(t.classList.remove("disabled"),t.removeAttribute("disabled"))}initPagingNext(){this.pagingNext.addEventListener("click",(()=>{this.onNextClick()}))}onNextClick(){this.dataTable.page("next").draw("page")}buildPagingPages(){this.updatePaging()}updatePaging(){const{page:t,pages:e,length:i}=this.dataTable.page.info(),n=this.dataTable.rows({search:"applied"}).count(),o=Math.ceil(n/i),l=t+1;let a=Math.max(1,l-Math.floor(this.maxPagesToShow/2)),r=Math.min(o,a+(this.maxPagesToShow-1));r-a+11&&(this.buildPagingPage(1),a>2&&this.pagingPages.appendChild((0,s.fc)('...')));for(let t=a;t<=r;t++)this.buildPagingPage(t);r...')),this.buildPagingPage(o)),this.disablePagingArrow(this.pagingPrev,0===t),this.disablePagingArrow(this.pagingNext,t===e-1),this.hidePagingIfSinglePage()}buildPagingPage(t){const{page:e}=this.dataTable.page.info(),i=(0,s.fc)('');i.innerText=`${t}`,i.setAttribute("data-page",`${t}`),this.pageBtnClasses&&(0,s.en)(this.pageBtnClasses,i),e===t-1&&i.classList.add("active"),i.addEventListener("click",(()=>this.onPageClick(t))),this.pagingPages.append(i)}onPageClick(t){this.dataTable.page(t-1).draw("page")}initRowSelecting(){this.rowSelectingAll.addEventListener("change",(()=>this.onSelectAllChange()))}triggerChangeEventToRow(){this.table.querySelectorAll(`tbody ${this.rowSelectingIndividual}`).forEach((t=>{t.addEventListener("change",(()=>{this.updateSelectAllCheckbox()}))}))}onSelectAllChange(){let t=this.rowSelectingAll.checked;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((e=>{const i=e.querySelector(this.rowSelectingIndividual);i&&(i.checked=t)})),this.updateSelectAllCheckbox()}updateSelectAllCheckbox(){if(!this.dataTable.rows({search:"applied"}).count())return this.rowSelectingAll.checked=!1,!1;let t=!0;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((e=>{const i=e.querySelector(this.rowSelectingIndividual);if(i&&!i.checked)return t=!1,!1})),this.rowSelectingAll.checked=t}static getInstance(t,e){const i=window.$hsDataTableCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element.el:null}static autoInit(){window.$hsDataTableCollection||(window.$hsDataTableCollection=[]),document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsDataTableCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new o(t)}))}}window.addEventListener("load",(()=>{document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").length&&("undefined"==typeof jQuery&&console.error("HSDataTable: jQuery is not available, please add it to the page."),"undefined"==typeof DataTable&&console.error("HSDataTable: DataTable is not available, please add it to the page.")),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery&&o.autoInit()})),"undefined"!=typeof window&&(window.HSDataTable=o);const l=o},249:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(926),n=i(316),o=i(615),l=i(189); +/* + * HSDropdown + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class a extends o.A{constructor(t,e,i){super(t,e,i),this.toggle=this.el.querySelector(":scope > .hs-dropdown-toggle")||this.el.querySelector(":scope > .hs-dropdown-toggle-wrapper > .hs-dropdown-toggle")||this.el.children[0],this.closers=Array.from(this.el.querySelectorAll(":scope .hs-dropdown-close"))||null,this.menu=this.el.querySelector(":scope > .hs-dropdown-menu"),this.eventMode=(0,s.gj)(this.el,"--trigger","click"),this.closeMode=(0,s.gj)(this.el,"--auto-close","true"),this.animationInProcess=!1,this.toggle&&this.menu&&this.init()}init(){if(this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle&&this.buildToggle(),this.menu&&this.buildMenu(),this.closers&&this.buildClosers(),(0,s.un)()||(0,s.zG)()||(this.el.addEventListener("mouseenter",(()=>this.onMouseEnterHandler())),this.el.addEventListener("mouseleave",(()=>this.onMouseLeaveHandler())))}resizeHandler(){this.eventMode=(0,s.gj)(this.el,"--trigger","click"),this.closeMode=(0,s.gj)(this.el,"--auto-close","true")}buildToggle(){var t;(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(t=>this.onClickHandler(t)))}buildMenu(){this.menu.role="menu"}buildClosers(){this.closers.forEach((t=>{t.addEventListener("click",(()=>this.close()))}))}onClickHandler(t){this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?this.close():this.open()}onMouseEnterHandler(){if("hover"!==this.eventMode)return!1;this.el._popper&&this.forceClearState(),!this.el.classList.contains("open")&&this.menu.classList.contains("hidden")&&this.open()}onMouseLeaveHandler(){if("hover"!==this.eventMode)return!1;this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")&&this.close()}destroyPopper(){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}absoluteStrategyModifiers(){return[{name:"applyStyles",fn:t=>{const e=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"absolute").replace(" ",""),i=(window.getComputedStyle(this.el).getPropertyValue("--adaptive")||"adaptive").replace(" ","");t.state.elements.popper.style.position=e,t.state.elements.popper.style.transform="adaptive"===i?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}}]}open(){if(this.el.classList.contains("open"))return!1;if(this.animationInProcess)return!1;this.animationInProcess=!0;const t=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),e=(window.getComputedStyle(this.el).getPropertyValue("--flip")||"true").replace(" ",""),i=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),o=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ","")),a=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ","");"static"!==i&&(this.el._popper=(0,n.n4)(this.el,this.menu,{placement:l.lP[t]||"bottom-start",strategy:i,modifiers:[..."fixed"!==i?this.absoluteStrategyModifiers():[],{name:"flip",enabled:"true"===e},{name:"offset",options:{offset:[0,o]}},{name:"computeStyles",options:{adaptive:"fixed"===i,gpuAcceleration:"true"===a}}]})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((()=>{var t;(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.el.classList.add("open"),this.animationInProcess=!1})),this.fireEvent("open",this.el),(0,s.JD)("open.hs.dropdown",this.el,this.el)}close(t=!0){if(this.animationInProcess||!this.el.classList.contains("open"))return!1;if(this.animationInProcess=!0,t){const t=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,s.yd)(t,(()=>this.destroyPopper()))}else this.destroyPopper();(()=>{var t;this.menu.style.margin=null,(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.el.classList.remove("open"),this.fireEvent("close",this.el),(0,s.JD)("close.hs.dropdown",this.el,this.el)})()}forceClearState(){this.destroyPopper(),this.menu.style.margin=null,this.el.classList.remove("open")}static getInstance(t,e){const i=window.$hsDropdownCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element.el:null}static autoInit(){if(window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),document.querySelectorAll(".hs-dropdown:not(.--prevent-on-load-init)").forEach((t=>{window.$hsDropdownCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new a(t)})),window.$hsDropdownCollection){document.addEventListener("keydown",(t=>a.accessibility(t))),window.addEventListener("click",(t=>{const e=t.target;a.closeCurrentlyOpened(e)}));let t=window.innerWidth;window.addEventListener("resize",(()=>{window.innerWidth!==t&&(t=innerWidth,a.closeCurrentlyOpened(null,!1))}))}}static open(t){const e=window.$hsDropdownCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));e&&e.element.menu.classList.contains("hidden")&&e.element.open()}static close(t){const e=window.$hsDropdownCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));e&&!e.element.menu.classList.contains("hidden")&&e.element.close()}static accessibility(t){this.history=s.IM;const e=window.$hsDropdownCollection.find((t=>t.element.el.classList.contains("open")));if(e&&(l.In.includes(t.code)||4===t.code.length&&t.code[t.code.length-1].match(/^[A-Z]*$/))&&!t.metaKey&&!e.element.menu.querySelector("input:focus")&&!e.element.menu.querySelector("textarea: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd(!1);break;default:t.preventDefault(),this.onFirstLetter(t.key)}}static onEscape(t){const e=t.target.closest(".hs-dropdown.open");if(window.$hsDropdownCollection.find((t=>t.element.el===e))){const t=window.$hsDropdownCollection.find((t=>t.element.el===e));t&&(t.element.close(),t.element.toggle.focus())}else this.closeCurrentlyOpened()}static onEnter(t){const e=t.target.parentElement;if(window.$hsDropdownCollection.find((t=>t.element.el===e))){t.preventDefault();const i=window.$hsDropdownCollection.find((t=>t.element.el===e));i&&i.element.open()}}static onArrow(t=!0){const e=window.$hsDropdownCollection.find((t=>t.element.el.classList.contains("open")));if(e){const i=e.element.menu;if(!i)return!1;const s=(t?Array.from(i.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])")).reverse():Array.from(i.querySelectorAll("a:not([hidden]), .hs-dropdown > button:not([hidden])"))).filter((t=>!t.classList.contains("disabled"))),n=i.querySelector("a:focus, button:focus");let o=s.findIndex((t=>t===n));o+1t.element.el.classList.contains("open")));if(e){const i=e.element.menu;if(!i)return!1;const s=(t?Array.from(i.querySelectorAll("a")):Array.from(i.querySelectorAll("a")).reverse()).filter((t=>!t.classList.contains("disabled")));s.length&&s[0].focus()}}static onFirstLetter(t){const e=window.$hsDropdownCollection.find((t=>t.element.el.classList.contains("open")));if(e){const i=e.element.menu;if(!i)return!1;const s=Array.from(i.querySelectorAll("a")),n=()=>s.findIndex(((e,i)=>e.innerText.toLowerCase().charAt(0)===t.toLowerCase()&&this.history.existsInHistory(i)));let o=n();-1===o&&(this.history.clearHistory(),o=n()),-1!==o&&(s[o].focus(),this.history.addHistory(o))}}static closeCurrentlyOpened(t=null,e=!0){const i=t&&t.closest(".hs-dropdown")&&t.closest(".hs-dropdown").parentElement.closest(".hs-dropdown")?t.closest(".hs-dropdown").parentElement.closest(".hs-dropdown"):null;let n=i?window.$hsDropdownCollection.filter((t=>t.element.el.classList.contains("open")&&t.element.menu.closest(".hs-dropdown").parentElement.closest(".hs-dropdown")===i)):window.$hsDropdownCollection.filter((t=>t.element.el.classList.contains("open")));t&&t.closest(".hs-dropdown")&&"inside"===(0,s.BF)(t.closest(".hs-dropdown"),"--auto-close")&&(n=n.filter((e=>e.element.el!==t.closest(".hs-dropdown")))),n&&n.forEach((t=>{if("false"===t.element.closeMode||"outside"===t.element.closeMode)return!1;t.element.close(e)}))}static on(t,e,i){const s=window.$hsDropdownCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));s&&(s.element.events[t]=i)}}window.addEventListener("load",(()=>{a.autoInit()})),window.addEventListener("resize",(()=>{window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),window.$hsDropdownCollection.forEach((t=>t.element.resizeHandler()))})),"undefined"!=typeof window&&(window.HSDropdown=a);const r=a},872:(t,e,i)=>{i.d(e,{A:()=>l});var s=i(926),n=i(615); +/* + * HSFileUpload + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +"undefined"!=typeof Dropzone&&(Dropzone.autoDiscover=!1);class o extends n.A{constructor(t,e,i){var s;super(t,e,i),this.extensions={},this.el="string"==typeof t?document.querySelector(t):t;const n=this.el.getAttribute("data-hs-file-upload"),o=n?JSON.parse(n):{};this.previewTemplate=(null===(s=this.el.querySelector("[data-hs-file-upload-preview]"))||void 0===s?void 0:s.innerHTML)||'
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t.\n\t\t\t\t\t\t

\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t0%\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t
',this.extensions=_.merge({default:{icon:'',class:"size-5"},xls:{icon:'',class:"size-5"},doc:{icon:'',class:"size-5"},zip:{icon:'',class:"size-5"}},o.extensions),this.singleton=o.singleton,this.concatOptions=Object.assign(Object.assign({clickable:this.el.querySelector("[data-hs-file-upload-trigger]"),previewsContainer:this.el.querySelector("[data-hs-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:this.previewTemplate,autoHideTrigger:!1},o),e),this.init()}init(){this.createCollection(window.$hsFileUploadCollection,this),this.initDropzone()}initDropzone(){const t=this.el.querySelector("[data-hs-file-upload-clear]"),e=Array.from(this.el.querySelectorAll("[data-hs-file-upload-pseudo-trigger]"));this.dropzone=new Dropzone(this.el,this.concatOptions),this.dropzone.on("addedfile",(t=>this.onAddFile(t))),this.dropzone.on("removedfile",(()=>this.onRemoveFile())),this.dropzone.on("uploadprogress",((t,e)=>this.onUploadProgress(t,e))),this.dropzone.on("complete",(t=>this.onComplete(t))),t&&(t.onclick=()=>{this.dropzone.files.length&&this.dropzone.removeAllFiles(!0)}),e.length&&e.forEach((t=>{t.onclick=()=>{var t,e;(null===(t=this.concatOptions)||void 0===t?void 0:t.clickable)&&(null===(e=this.concatOptions)||void 0===e?void 0:e.clickable).click()}}))}onAddFile(t){const{previewElement:e}=t,i=t.previewElement.querySelector("[data-hs-file-upload-reload]");if(!e)return!1;this.singleton&&this.dropzone.files.length>1&&this.dropzone.removeFile(this.dropzone.files[0]),i&&i.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation();const i=document.createElement("input");i.type="file",i.click(),i.addEventListener("change",(e=>{var i;const s=null===(i=e.target.files)||void 0===i?void 0:i[0];if(s){const e=s;e.status=Dropzone.ADDED,e.accepted=!0,e.previewElement=t.previewElement,e.previewTemplate=t.previewTemplate,e.previewsContainer=t.previewsContainer,this.dropzone.removeFile(t),this.dropzone.addFile(e)}}))})),this.previewAccepted(t)}previewAccepted(t){const{previewElement:e}=t,i=this.splitFileName(t.name),s=e.querySelector("[data-hs-file-upload-file-name]"),n=e.querySelector("[data-hs-file-upload-file-ext]"),o=e.querySelector("[data-hs-file-upload-file-size]"),l=e.querySelector("[data-hs-file-upload-file-icon]"),a=this.el.querySelector("[data-hs-file-upload-trigger]"),r=e.querySelector("[data-dz-thumbnail]"),d=e.querySelector("[data-hs-file-upload-remove]");s&&(s.textContent=i.name),n&&(n.textContent=i.extension),o&&(o.textContent=this.formatFileSize(t.size)),r&&(t.type.includes("image/")?r.classList.remove("hidden"):this.setIcon(i.extension,l)),this.dropzone.files.length>0&&this.concatOptions.autoHideTrigger&&(a.style.display="none"),d&&(d.onclick=()=>this.dropzone.removeFile(t))}onRemoveFile(){const t=this.el.querySelector("[data-hs-file-upload-trigger]");0===this.dropzone.files.length&&this.concatOptions.autoHideTrigger&&(t.style.display="")}onUploadProgress(t,e){const{previewElement:i}=t;if(!i)return!1;const s=i.querySelector("[data-hs-file-upload-progress-bar]"),n=i.querySelector("[data-hs-file-upload-progress-bar-pane]"),o=i.querySelector("[data-hs-file-upload-progress-bar-value]"),l=Math.floor(e);s&&s.setAttribute("aria-valuenow",`${l}`),n&&(n.style.width=`${l}%`),o&&(o.innerText=`${l}`)}onComplete(t){const{previewElement:e}=t;if(!e)return!1;e.classList.add("complete")}setIcon(t,e){const i=this.createIcon(t);e.append(i)}createIcon(t){var e,i;const n=(null===(e=this.extensions[t])||void 0===e?void 0:e.icon)?(0,s.fc)(this.extensions[t].icon):(0,s.fc)(this.extensions.default.icon);return(0,s.en)((null===(i=this.extensions[t])||void 0===i?void 0:i.class)?this.extensions[t].class:this.extensions.default.class,n),n}formatFileSize(t){return t<1024?t.toFixed(2)+" B":t<1048576?(t/1024).toFixed(2)+" KB":t<1073741824?(t/1048576).toFixed(2)+" MB":t<1099511627776?(t/1073741824).toFixed(2)+" GB":(t/1099511627776).toFixed(2)+" TB"}splitFileName(t){let e=t.lastIndexOf(".");return-1==e?{name:t,extension:""}:{name:t.substring(0,e),extension:t.substring(e+1)}}static getInstance(t,e){const i=window.$hsFileUploadCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element.el:null}static autoInit(){window.$hsFileUploadCollection||(window.$hsFileUploadCollection=[]),document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsFileUploadCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new o(t)}))}}window.addEventListener("load",(()=>{document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").length&&("undefined"==typeof _&&console.error("HSFileUpload: Lodash is not available, please add it to the page."),"undefined"==typeof Dropzone&&console.error("HSFileUpload: Dropzone is not available, please add it to the page.")),"undefined"!=typeof _&&"undefined"!=typeof Dropzone&&o.autoInit()})),"undefined"!=typeof window&&(window.HSFileUpload=o);const l=o},542:(t,e,i)=>{i.d(e,{A:()=>l});var s=i(926),n=i(615); +/* + * HSInputNumber + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class o extends n.A{constructor(t,e){super(t,e),this.input=this.el.querySelector("[data-hs-input-number-input]")||null,this.increment=this.el.querySelector("[data-hs-input-number-increment]")||null,this.decrement=this.el.querySelector("[data-hs-input-number-decrement]")||null,this.input&&this.checkIsNumberAndConvert();const i=this.el.dataset.hsInputNumber,s=i?JSON.parse(i):{step:1},n=Object.assign(Object.assign({},s),e);this.minInputValue="min"in n?n.min:0,this.maxInputValue="max"in n?n.max:null,this.step="step"in n&&n.step>0?n.step:1,this.init()}init(){this.createCollection(window.$hsInputNumberCollection,this),this.input&&this.increment&&this.build()}checkIsNumberAndConvert(){const t=this.input.value.trim(),e=this.cleanAndExtractNumber(t);null!==e?(this.inputValue=e,this.input.value=e.toString()):(this.inputValue=0,this.input.value="0")}cleanAndExtractNumber(t){const e=[];let i=!1;t.split("").forEach((t=>{t>="0"&&t<="9"?e.push(t):"."!==t||i||(e.push(t),i=!0)}));const s=e.join(""),n=parseFloat(s);return isNaN(n)?null:n}build(){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()}buildInput(){this.input.addEventListener("input",(()=>this.changeValue()))}buildIncrement(){this.increment.addEventListener("click",(()=>{this.changeValue("increment")}))}buildDecrement(){this.decrement.addEventListener("click",(()=>{this.changeValue("decrement")}))}changeValue(t="none"){var e,i;const n={inputValue:this.inputValue},o=null!==(e=this.minInputValue)&&void 0!==e?e:Number.MIN_SAFE_INTEGER,l=null!==(i=this.maxInputValue)&&void 0!==i?i:Number.MAX_SAFE_INTEGER;switch(this.inputValue=isNaN(this.inputValue)?0:this.inputValue,t){case"increment":const t=this.inputValue+this.step;this.inputValue=t>=o&&t<=l?t:l,this.input.value=this.inputValue.toString();break;case"decrement":const e=this.inputValue-this.step;this.inputValue=e>=o&&e<=l?e:o,this.input.value=this.inputValue.toString();break;default:const i=isNaN(parseInt(this.input.value))?0:parseInt(this.input.value);this.inputValue=i>=l?l:i<=o?o:i,this.inputValue<=o&&(this.input.value=this.inputValue.toString())}n.inputValue=this.inputValue,this.inputValue===o?(this.el.classList.add("disabled"),this.decrement&&this.disableButtons("decrement")):(this.el.classList.remove("disabled"),this.decrement&&this.enableButtons("decrement")),this.inputValue===l?(this.el.classList.add("disabled"),this.increment&&this.disableButtons("increment")):(this.el.classList.remove("disabled"),this.increment&&this.enableButtons("increment")),this.fireEvent("change",n),(0,s.JD)("change.hs.inputNumber",this.el,n)}disableButtons(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"))}enableButtons(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"))}static getInstance(t,e){const i=window.$hsInputNumberCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element:null}static autoInit(){window.$hsInputNumberCollection||(window.$hsInputNumberCollection=[]),document.querySelectorAll("[data-hs-input-number]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsInputNumberCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new o(t)}))}}window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=o);const l=o},252:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(926),n=i(189),o=i(615); +/* + * HSOverlay + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class l extends o.A{constructor(t,e,i){var o,l,a,r,d;super(t,e,i);const h=t.getAttribute("data-hs-overlay-options"),c=h?JSON.parse(h):{},u=Object.assign(Object.assign({},c),e);if(this.hiddenClass=(null==u?void 0:u.hiddenClass)||"hidden",this.emulateScrollbarSpace=(null==u?void 0:u.emulateScrollbarSpace)||!1,this.isClosePrev=null===(o=null==u?void 0:u.isClosePrev)||void 0===o||o,this.backdropClasses=null!==(l=null==u?void 0:u.backdropClasses)&&void 0!==l?l:"hs-overlay-backdrop transition duration fixed inset-0 bg-gray-900 bg-opacity-50 dark:bg-opacity-80 dark:bg-neutral-900",this.backdropExtraClasses=null!==(a=null==u?void 0:u.backdropExtraClasses)&&void 0!==a?a:"",this.moveOverlayToBody=(null==u?void 0:u.moveOverlayToBody)||null,this.openNextOverlay=!1,this.autoHide=null,this.overlayId=this.el.getAttribute("data-hs-overlay"),this.overlay=document.querySelector(this.overlayId),this.initContainer=(null===(r=this.overlay)||void 0===r?void 0:r.parentElement)||null,this.overlay){this.isCloseWhenClickInside=(0,s.PK)((0,s.gj)(this.overlay,"--close-when-click-inside","false")||"false"),this.isTabAccessibilityLimited=(0,s.PK)((0,s.gj)(this.overlay,"--tab-accessibility-limited","true")||"true"),this.isLayoutAffect=(0,s.PK)((0,s.gj)(this.overlay,"--is-layout-affect","false")||"false"),this.hasAutofocus=(0,s.PK)((0,s.gj)(this.overlay,"--has-autofocus","true")||"true"),this.hasAbilityToCloseOnBackdropClick=(0,s.PK)(this.overlay.getAttribute("data-hs-overlay-keyboard")||"true");const t=(0,s.gj)(this.overlay,"--auto-close");this.autoClose=!isNaN(+t)&&isFinite(+t)?+t:n.LO[t]||null;const e=(0,s.gj)(this.overlay,"--opened");this.openedBreakpoint=(!isNaN(+e)&&isFinite(+e)?+e:n.LO[e])||null}this.animationTarget=(null===(d=null==this?void 0:this.overlay)||void 0===d?void 0:d.querySelector(".hs-overlay-animation-target"))||this.overlay,this.overlay&&this.init()}init(){var t;if(this.createCollection(window.$hsOverlayCollection,this),this.isLayoutAffect&&this.openedBreakpoint){const t=l.getInstance(this.el,!0);l.setOpened(this.openedBreakpoint,t)}(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.overlay.classList.contains("opened")?this.el.ariaExpanded="true":this.el.ariaExpanded="false"),this.el.addEventListener("click",(()=>{this.overlay.classList.contains("opened")?this.close():this.open()})),this.overlay.addEventListener("click",(t=>{t.target.id&&`#${t.target.id}`===this.overlayId&&this.isCloseWhenClickInside&&this.hasAbilityToCloseOnBackdropClick&&this.close()}))}hideAuto(){const t=parseInt((0,s.gj)(this.overlay,"--auto-hide","0"));t&&(this.autoHide=setTimeout((()=>{this.close()}),t))}checkTimer(){this.autoHide&&(clearTimeout(this.autoHide),this.autoHide=null)}buildBackdrop(){const t=this.overlay.classList.value.split(" "),e=parseInt(window.getComputedStyle(this.overlay).getPropertyValue("z-index")),i=this.overlay.getAttribute("data-hs-overlay-backdrop-container")||!1;let n=document.createElement("div"),o=`${this.backdropClasses} ${this.backdropExtraClasses}`;const l="static"!==(0,s.gj)(this.overlay,"--overlay-backdrop","true"),a="false"===(0,s.gj)(this.overlay,"--overlay-backdrop","true");n.id=`${this.overlay.id}-backdrop`,"style"in n&&(n.style.zIndex=""+(e-1));for(const e of t)(e.startsWith("hs-overlay-backdrop-open:")||e.includes(":hs-overlay-backdrop-open:"))&&(o+=` ${e}`);a||(i&&(n=document.querySelector(i).cloneNode(!0),n.classList.remove("hidden"),o=`${n.classList.toString()}`,n.classList.value=""),l&&n.addEventListener("click",(()=>this.close()),!0),n.setAttribute("data-hs-overlay-backdrop-template",""),document.body.appendChild(n),setTimeout((()=>{n.classList.value=o})))}destroyBackdrop(){const t=document.querySelector(`#${this.overlay.id}-backdrop`);t&&(this.openNextOverlay&&(t.style.transitionDuration=1.8*parseFloat(window.getComputedStyle(t).transitionDuration.replace(/[^\d.-]/g,""))+"s"),t.classList.add("opacity-0"),(0,s.yd)(t,(()=>{t.remove()})))}focusElement(){const t=this.overlay.querySelector("[autofocus]");if(!t)return!1;t.focus()}getScrollbarSize(){let t=document.createElement("div");t.style.overflow="scroll",t.style.width="100px",t.style.height="100px",document.body.appendChild(t);let e=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),e}open(){if(!this.overlay)return!1;const t=document.querySelectorAll(".hs-overlay.open"),e=window.$hsOverlayCollection.find((e=>Array.from(t).includes(e.element.overlay)&&!e.element.isLayoutAffect)),i=document.querySelectorAll(`[data-hs-overlay="#${this.overlay.id}"]`),n="true"!==(0,s.gj)(this.overlay,"--body-scroll","false");if(this.isClosePrev&&e)return this.openNextOverlay=!0,e.element.close().then((()=>{this.open(),this.openNextOverlay=!1}));n&&(document.body.style.overflow="hidden",this.emulateScrollbarSpace&&(document.body.style.paddingRight=`${this.getScrollbarSize()}px`)),this.buildBackdrop(),this.checkTimer(),this.hideAuto(),i.forEach((t=>{t.ariaExpanded&&(t.ariaExpanded="true")})),this.overlay.classList.remove(this.hiddenClass),this.overlay.setAttribute("aria-overlay","true"),this.overlay.setAttribute("tabindex","-1"),setTimeout((()=>{if(this.overlay.classList.contains("opened"))return!1;this.overlay.classList.add("open","opened"),this.isLayoutAffect&&document.body.classList.add("hs-overlay-body-open"),this.fireEvent("open",this.el),(0,s.JD)("open.hs.overlay",this.el,this.el),this.hasAutofocus&&this.focusElement()}),50)}close(t=!1){this.isLayoutAffect&&document.body.classList.remove("hs-overlay-body-open");const e=t=>{if(this.overlay.classList.contains("open"))return!1;document.querySelectorAll(`[data-hs-overlay="#${this.overlay.id}"]`).forEach((t=>{t.ariaExpanded&&(t.ariaExpanded="false")})),this.overlay.classList.add(this.hiddenClass),this.destroyBackdrop(),this.fireEvent("close",this.el),(0,s.JD)("close.hs.overlay",this.el,this.el),document.querySelector(".hs-overlay.opened")||(document.body.style.overflow="",this.emulateScrollbarSpace&&(document.body.style.paddingRight="")),t(this.overlay)};return new Promise((i=>{if(!this.overlay)return!1;this.overlay.classList.remove("open","opened"),this.overlay.removeAttribute("aria-overlay"),this.overlay.removeAttribute("tabindex"),t?e(i):(0,s.yd)(this.animationTarget,(()=>e(i)))}))}static getInstance(t,e){const i=window.$hsOverlayCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)||e.element.overlay===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element.el:null}static autoInit(){window.$hsOverlayCollection||(window.$hsOverlayCollection=[]),document.querySelectorAll("[data-hs-overlay]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsOverlayCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new l(t)})),window.$hsOverlayCollection&&document.addEventListener("keydown",(t=>l.accessibility(t)))}static open(t){const e=window.$hsOverlayCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)||e.element.overlay===("string"==typeof t?document.querySelector(t):t)));e&&e.element.overlay.classList.contains(e.element.hiddenClass)&&e.element.open()}static close(t){const e=window.$hsOverlayCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)||e.element.overlay===("string"==typeof t?document.querySelector(t):t)));e&&!e.element.overlay.classList.contains(e.element.hiddenClass)&&e.element.close()}static setOpened(t,e){document.body.clientWidth>=t?(document.body.classList.add("hs-overlay-body-open"),e.element.overlay.classList.add("opened")):e.element.close(!0)}static accessibility(t){var e,i;const n=window.$hsOverlayCollection.filter((t=>t.element.overlay.classList.contains("open"))),o=n[n.length-1],l=null===(i=null===(e=null==o?void 0:o.element)||void 0===e?void 0:e.overlay)||void 0===i?void 0:i.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),a=[];(null==l?void 0:l.length)&&l.forEach((t=>{(0,s.sH)(t)||a.push(t)}));const r=o&&!t.metaKey;if(r&&!o.element.isTabAccessibilityLimited&&"Tab"===t.code)return!1;r&&a.length&&"Tab"===t.code&&(t.preventDefault(),this.onTab(o,a)),r&&"Escape"===t.code&&(t.preventDefault(),this.onEscape(o))}static onEscape(t){t&&t.element.hasAbilityToCloseOnBackdropClick&&t.element.close()}static onTab(t,e){if(!e.length)return!1;const i=t.element.overlay.querySelector(":focus"),s=Array.from(e).indexOf(i);if(s>-1){e[(s+1)%e.length].focus()}else e[0].focus()}static on(t,e,i){const s=window.$hsOverlayCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)||t.element.overlay===("string"==typeof e?document.querySelector(e):e)));s&&(s.element.events[t]=i)}}const a=()=>{if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((t=>t.element.moveOverlayToBody)))return!1;window.$hsOverlayCollection.filter((t=>t.element.moveOverlayToBody)).forEach((t=>{const e=t.element.moveOverlayToBody,i=t.element.initContainer,n=document.querySelector("body"),o=t.element.overlay;if(!i&&o)return!1;document.body.clientWidth<=e&&!(0,s.wC)(n,o)?n.appendChild(o):document.body.clientWidth>e&&!i.contains(o)&&i.appendChild(o)}))};window.addEventListener("load",(()=>{l.autoInit(),a()})),window.addEventListener("resize",(()=>{(()=>{if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((t=>t.element.autoClose)))return!1;window.$hsOverlayCollection.filter((t=>t.element.autoClose)).forEach((t=>{document.body.clientWidth>=t.element.autoClose&&t.element.close(!0)}))})(),a(),(()=>{if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((t=>t.element.autoClose)))return!1;window.$hsOverlayCollection.filter((t=>t.element.autoClose)).forEach((t=>{document.body.clientWidth>=t.element.autoClose&&t.element.close(!0)}))})(),(()=>{if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((t=>t.element.overlay.classList.contains("opened"))))return!1;window.$hsOverlayCollection.filter((t=>t.element.overlay.classList.contains("opened"))).forEach((t=>{const e=parseInt(window.getComputedStyle(t.element.overlay).getPropertyValue("z-index")),i=document.querySelector(`#${t.element.overlay.id}-backdrop`);if(e===parseInt(window.getComputedStyle(i).getPropertyValue("z-index"))+1)return!1;"style"in i&&(i.style.zIndex=""+(e-1)),document.body.classList.add("hs-overlay-body-open")}))})()})),"undefined"!=typeof window&&(window.HSOverlay=l);const r=l},698:(t,e,i)=>{i.d(e,{A:()=>l});var s=i(926),n=i(615); +/* + * HSPinInput + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class o extends n.A{constructor(t,e){super(t,e);const i=t.getAttribute("data-hs-pin-input"),s=i?JSON.parse(i):{},n=Object.assign(Object.assign({},s),e);this.items=this.el.querySelectorAll("[data-hs-pin-input-item]"),this.currentItem=null,this.currentValue=new Array(this.items.length).fill(""),this.placeholders=[],this.availableCharsRE=new RegExp((null==n?void 0:n.availableCharsRE)||"^[a-zA-Z0-9]+$"),this.init()}init(){this.createCollection(window.$hsPinInputCollection,this),this.items.length&&this.build()}build(){this.buildInputItems()}buildInputItems(){this.items.forEach(((t,e)=>{this.placeholders.push(t.getAttribute("placeholder")||""),t.hasAttribute("autofocus")&&this.onFocusIn(e),t.addEventListener("input",(t=>this.onInput(t,e))),t.addEventListener("paste",(t=>this.onPaste(t))),t.addEventListener("keydown",(t=>this.onKeydown(t,e))),t.addEventListener("focusin",(()=>this.onFocusIn(e))),t.addEventListener("focusout",(()=>this.onFocusOut(e)))}))}checkIfNumber(t){return t.match(this.availableCharsRE)}autoFillAll(t){Array.from(t).forEach(((t,e)=>{if(!(null==this?void 0:this.items[e]))return!1;this.items[e].value=t,this.items[e].dispatchEvent(new Event("input",{bubbles:!0}))}))}setCurrentValue(){this.currentValue=Array.from(this.items).map((t=>t.value))}toggleCompleted(){this.currentValue.includes("")?this.el.classList.remove("active"):this.el.classList.add("active")}onInput(t,e){const i=t.target.value;if(this.currentItem=t.target,this.currentItem.value="",this.currentItem.value=i[i.length-1],!this.checkIfNumber(this.currentItem.value))return this.currentItem.value=this.currentValue[e]||"",!1;if(this.setCurrentValue(),this.currentItem.value){if(e0&&this.items[e-1].focus()}onKeydown(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()}onFocusIn(t){this.items[t].setAttribute("placeholder","")}onFocusOut(t){this.items[t].setAttribute("placeholder",this.placeholders[t])}onPaste(t){t.preventDefault(),this.items.forEach((e=>{document.activeElement===e&&this.autoFillAll(t.clipboardData.getData("text"))}))}static getInstance(t,e){const i=window.$hsPinInputCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element:null}static autoInit(){window.$hsPinInputCollection||(window.$hsPinInputCollection=[]),document.querySelectorAll("[data-hs-pin-input]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsPinInputCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new o(t)}))}}window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=o);const l=o},161:(t,e,i)=>{i.d(e,{A:()=>o});var s=i(615); +/* + * HSRangeSlider + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */class n extends s.A{constructor(t,e,i){super(t,e,i);const s=t.getAttribute("data-hs-range-slider"),n=s?JSON.parse(s):{};this.concatOptions=Object.assign(Object.assign(Object.assign({},n),e),{cssClasses:Object.assign(Object.assign({},noUiSlider.cssClasses),this.processClasses(n.cssClasses))}),this.init()}get formattedValue(){const t=this.el.noUiSlider.get();if(Array.isArray(t)&&this.format){const e=[];return t.forEach((t=>{e.push(this.format.to(t))})),e}return this.format?this.format.to(t):t}processClasses(t){const e={};return Object.keys(t).forEach((i=>{i&&(e[i]=`${noUiSlider.cssClasses[i]} ${t[i]}`)})),e}init(){var t,e,i,s,n,o,l,a,r,d,h,c,u;this.createCollection(window.$hsRangeSliderCollection,this),("object"==typeof(null===(t=this.concatOptions)||void 0===t?void 0:t.formatter)?"thousandsSeparatorAndDecimalPoints"===(null===(i=null===(e=this.concatOptions)||void 0===e?void 0:e.formatter)||void 0===i?void 0:i.type):"thousandsSeparatorAndDecimalPoints"===(null===(s=this.concatOptions)||void 0===s?void 0:s.formatter))?this.thousandsSeparatorAndDecimalPointsFormatter():("object"==typeof(null===(n=this.concatOptions)||void 0===n?void 0:n.formatter)?"integer"===(null===(l=null===(o=this.concatOptions)||void 0===o?void 0:o.formatter)||void 0===l?void 0:l.type):"integer"===(null===(a=this.concatOptions)||void 0===a?void 0:a.formatter))?this.integerFormatter():"object"==typeof(null===(r=this.concatOptions)||void 0===r?void 0:r.formatter)&&((null===(h=null===(d=this.concatOptions)||void 0===d?void 0:d.formatter)||void 0===h?void 0:h.prefix)||(null===(u=null===(c=this.concatOptions)||void 0===c?void 0:c.formatter)||void 0===u?void 0:u.postfix))&&this.prefixOrPostfixFormatter(),noUiSlider.create(this.el,this.concatOptions),this.concatOptions.disabled&&this.setDisabled()}formatValue(t){var e,i,s,n,o,l,a,r,d;let h="";return"object"==typeof(null===(e=this.concatOptions)||void 0===e?void 0:e.formatter)?((null===(s=null===(i=this.concatOptions)||void 0===i?void 0:i.formatter)||void 0===s?void 0:s.prefix)&&(h+=null===(o=null===(n=this.concatOptions)||void 0===n?void 0:n.formatter)||void 0===o?void 0:o.prefix),h+=t,(null===(a=null===(l=this.concatOptions)||void 0===l?void 0:l.formatter)||void 0===a?void 0:a.postfix)&&(h+=null===(d=null===(r=this.concatOptions)||void 0===r?void 0:r.formatter)||void 0===d?void 0:d.postfix)):h+=t,h}integerFormatter(){var t;this.format={to:t=>this.formatValue(Math.round(t)),from:t=>Math.round(+t)},(null===(t=this.concatOptions)||void 0===t?void 0:t.tooltips)&&(this.concatOptions.tooltips=this.format)}prefixOrPostfixFormatter(){var t;this.format={to:t=>this.formatValue(t),from:t=>+t},(null===(t=this.concatOptions)||void 0===t?void 0:t.tooltips)&&(this.concatOptions.tooltips=this.format)}thousandsSeparatorAndDecimalPointsFormatter(){var t;this.format={to:t=>this.formatValue(new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}).format(t)),from:t=>parseFloat(t.replace(/,/g,""))},(null===(t=this.concatOptions)||void 0===t?void 0:t.tooltips)&&(this.concatOptions.tooltips=this.format)}setDisabled(){this.el.setAttribute("disabled","disabled"),this.el.classList.add("disabled")}static getInstance(t,e=!1){const i=window.$hsRangeSliderCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element.el:null}static autoInit(){window.$hsRangeSliderCollection||(window.$hsRangeSliderCollection=[]),document.querySelectorAll("[data-hs-range-slider]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsRangeSliderCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new n(t)}))}static on(t,e,i){const s=window.$hsRangeSliderCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));s&&(s.element.events[t]=i)}}window.addEventListener("load",(()=>{n.autoInit()})),"undefined"!=typeof window&&(window.HSRangeSlider=n);const o=n},89:(t,e,i)=>{i.d(e,{A:()=>l});var s=i(926),n=i(615); +/* + * HSRemoveElement + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class o extends n.A{constructor(t,e){super(t,e);const i=t.getAttribute("data-hs-remove-element-options"),s=i?JSON.parse(i):{},n=Object.assign(Object.assign({},s),e);this.removeTargetId=this.el.getAttribute("data-hs-remove-element"),this.removeTarget=document.querySelector(this.removeTargetId),this.removeTargetAnimationClass=(null==n?void 0:n.removeTargetAnimationClass)||"hs-removing",this.removeTarget&&this.init()}init(){this.createCollection(window.$hsRemoveElementCollection,this),this.el.addEventListener("click",(()=>this.remove()))}remove(){if(!this.removeTarget)return!1;this.removeTarget.classList.add(this.removeTargetAnimationClass),(0,s.yd)(this.removeTarget,(()=>setTimeout((()=>this.removeTarget.remove()))))}static autoInit(){window.$hsRemoveElementCollection||(window.$hsRemoveElementCollection=[]),document.querySelectorAll("[data-hs-remove-element]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsRemoveElementCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new o(t)}))}}window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSRemoveElement=o);const l=o},817:(t,e,i)=>{i.d(e,{A:()=>l});var s=i(926),n=i(615); +/* + * HSScrollspy + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class o extends n.A{constructor(t,e={}){super(t,e),this.activeSection=null,this.contentId=this.el.getAttribute("data-hs-scrollspy"),this.content=document.querySelector(this.contentId),this.links=this.el.querySelectorAll("[href]"),this.sections=[],this.scrollableId=this.el.getAttribute("data-hs-scrollspy-scrollable-parent"),this.scrollable=this.scrollableId?document.querySelector(this.scrollableId):document,this.init()}init(){this.createCollection(window.$hsScrollspyCollection,this),this.links.forEach((t=>{this.sections.push(this.scrollable.querySelector(t.getAttribute("href")))})),Array.from(this.sections).forEach((t=>{if(!t.getAttribute("id"))return!1;this.scrollable.addEventListener("scroll",(e=>this.update(e,t)))})),this.links.forEach((t=>{t.addEventListener("click",(e=>{if(e.preventDefault(),"javascript:;"===t.getAttribute("href"))return!1;this.scrollTo(t)}))}))}update(t,e){const i=parseInt((0,s.gj)(this.el,"--scrollspy-offset","0")),n=parseInt((0,s.gj)(e,"--scrollspy-offset"))||i,o=t.target===document?0:parseInt(String(t.target.getBoundingClientRect().top)),l=parseInt(String(e.getBoundingClientRect().top))-n-o,a=e.offsetHeight;if(l<=0&&l+a>0){if(this.activeSection===e)return!1;this.links.forEach((t=>{t.classList.remove("active")}));const t=this.el.querySelector(`[href="#${e.getAttribute("id")}"]`);if(t){t.classList.add("active");const e=t.closest("[data-hs-scrollspy-group]");if(e){const t=e.querySelector("[href]");t&&t.classList.add("active")}}this.activeSection=e}}scrollTo(t){const e=t.getAttribute("href"),i=document.querySelector(e),n=parseInt((0,s.gj)(this.el,"--scrollspy-offset","0")),o=parseInt((0,s.gj)(i,"--scrollspy-offset"))||n,l=this.scrollable===document?0:this.scrollable.offsetTop,a=i.offsetTop-o-l,r=this.scrollable===document?window:this.scrollable,d=()=>{window.history.replaceState(null,null,t.getAttribute("href")),"scrollTo"in r&&r.scrollTo({top:a,left:0,behavior:"smooth"})},h=this.fireEvent("beforeScroll",this.el);(0,s.JD)("beforeScroll.hs.scrollspy",this.el,this.el),h instanceof Promise?h.then((()=>d())):d()}static getInstance(t,e=!1){const i=window.$hsScrollspyCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element.el:null}static autoInit(){window.$hsScrollspyCollection||(window.$hsScrollspyCollection=[]),document.querySelectorAll("[data-hs-scrollspy]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsScrollspyCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new o(t)}))}}window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=o);const l=o},236:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(926),n=i(615),o=i(189),l=function(t,e,i,s){return new(i||(i=Promise))((function(n,o){function l(t){try{r(s.next(t))}catch(t){o(t)}}function a(t){try{r(s.throw(t))}catch(t){o(t)}}function r(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(l,a)}r((s=s.apply(t,e||[])).next())}))};class a extends n.A{constructor(t,e){var i,s;super(t,e),this.optionId=0;const n=t.getAttribute("data-hs-select"),o=n?JSON.parse(n):{},l=Object.assign(Object.assign({},o),e),a={items:", ",betweenItemsAndCounter:"and"};this.value=(null==l?void 0:l.value)||this.el.value||null,this.placeholder=(null==l?void 0:l.placeholder)||"Select...",this.hasSearch=(null==l?void 0:l.hasSearch)||!1,this.preventSearchFocus=(null==l?void 0:l.preventSearchFocus)||!1,this.mode=(null==l?void 0:l.mode)||"default",this.viewport=void 0!==(null==l?void 0:l.viewport)?document.querySelector(null==l?void 0:l.viewport):null,this.isOpened=Boolean(null==l?void 0:l.isOpened)||!1,this.isMultiple=this.el.hasAttribute("multiple")||!1,this.isDisabled=this.el.hasAttribute("disabled")||!1,this.selectedItems=[],this.apiUrl=(null==l?void 0:l.apiUrl)||null,this.apiQuery=(null==l?void 0:l.apiQuery)||null,this.apiOptions=(null==l?void 0:l.apiOptions)||null,this.apiSearchQueryKey=(null==l?void 0:l.apiSearchQueryKey)||null,this.apiDataPart=(null==l?void 0:l.apiDataPart)||null,this.apiFieldsMap=(null==l?void 0:l.apiFieldsMap)||null,this.apiIconTag=(null==l?void 0:l.apiIconTag)||null,this.wrapperClasses=(null==l?void 0:l.wrapperClasses)||null,this.toggleTag=(null==l?void 0:l.toggleTag)||null,this.toggleClasses=(null==l?void 0:l.toggleClasses)||null,this.toggleSeparators=null!==(i=Object.assign(Object.assign({},a),null==l?void 0:l.toggleSeparators))&&void 0!==i?i:a,this.toggleCountText=(null==l?void 0:l.toggleCountText)||null,this.toggleCountTextMinItems=(null==l?void 0:l.toggleCountTextMinItems)||1,this.toggleCountTextMode=(null==l?void 0:l.toggleCountTextMode)||"countAfterLimit",this.tagsItemTemplate=(null==l?void 0:l.tagsItemTemplate)||null,this.tagsItemClasses=(null==l?void 0:l.tagsItemClasses)||null,this.tagsInputId=(null==l?void 0:l.tagsInputId)||null,this.tagsInputClasses=(null==l?void 0:l.tagsInputClasses)||null,this.dropdownTag=(null==l?void 0:l.dropdownTag)||null,this.dropdownClasses=(null==l?void 0:l.dropdownClasses)||null,this.dropdownDirectionClasses=(null==l?void 0:l.dropdownDirectionClasses)||null,this.dropdownSpace=(null==l?void 0:l.dropdownSpace)||10,this.dropdownPlacement=(null==l?void 0:l.dropdownPlacement)||null,this.dropdownScope=(null==l?void 0:l.dropdownScope)||"parent",this.searchTemplate=(null==l?void 0:l.searchTemplate)||null,this.searchWrapperTemplate=(null==l?void 0:l.searchWrapperTemplate)||null,this.searchWrapperClasses=(null==l?void 0:l.searchWrapperClasses)||"bg-white p-2 sticky top-0",this.searchId=(null==l?void 0:l.searchId)||null,this.searchLimit=(null==l?void 0:l.searchLimit)||1/0,this.isSearchDirectMatch=void 0===(null==l?void 0:l.isSearchDirectMatch)||(null==l?void 0:l.isSearchDirectMatch),this.searchClasses=(null==l?void 0:l.searchClasses)||"block w-[calc(100%-2rem)] text-sm border-gray-200 rounded-md focus:border-blue-500 focus:ring-blue-500 dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 py-2 px-3 my-2 mx-4",this.searchPlaceholder=(null==l?void 0:l.searchPlaceholder)||"Search...",this.searchNoResultTemplate=(null==l?void 0:l.searchNoResultTemplate)||"",this.searchNoResultText=(null==l?void 0:l.searchNoResultText)||"No results found",this.searchNoResultClasses=(null==l?void 0:l.searchNoResultClasses)||"px-4 text-sm text-gray-800 dark:text-neutral-200",this.optionTemplate=(null==l?void 0:l.optionTemplate)||null,this.optionTag=(null==l?void 0:l.optionTag)||null,this.optionClasses=(null==l?void 0:l.optionClasses)||null,this.extraMarkup=(null==l?void 0:l.extraMarkup)||null,this.descriptionClasses=(null==l?void 0:l.descriptionClasses)||null,this.iconClasses=(null==l?void 0:l.iconClasses)||null,this.isAddTagOnEnter=null===(s=null==l?void 0:l.isAddTagOnEnter)||void 0===s||s,this.animationInProcess=!1,this.selectOptions=[],this.remoteOptions=[],this.tagsInputHelper=null,this.init()}setValue(t){this.value=t,this.clearSelections(),Array.isArray(t)?(this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder,this.unselectMultipleItems(),this.selectMultipleItems()):(this.setToggleTitle(),this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.selectSingleItem())}init(){this.createCollection(window.$hsSelectCollection,this),this.build()}build(){if(this.el.style.display="none",this.el.children&&Array.from(this.el.children).filter((t=>t.value&&""!==t.value)).forEach((t=>{const e=t.getAttribute("data-hs-select-option");this.selectOptions=[...this.selectOptions,{title:t.textContent,val:t.value,disabled:t.disabled,options:"undefined"!==e?JSON.parse(e):null}]})),this.isMultiple){const t=Array.from(this.el.children).filter((t=>t.selected));if(t){const e=[];t.forEach((t=>{e.push(t.value)})),this.value=e}}this.buildWrapper(),"tags"===this.mode?this.buildTags():this.buildToggle(),this.buildDropdown(),this.extraMarkup&&this.buildExtraMarkup()}buildWrapper(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("hs-select","relative"),"tags"===this.mode&&this.wrapper.addEventListener("click",(t=>{t.target.closest("[data-hs-select-dropdown]")||t.target.closest("[data-tag-value]")||this.tagsInput.focus()})),this.wrapperClasses&&(0,s.en)(this.wrapperClasses,this.wrapper),this.el.before(this.wrapper),this.wrapper.append(this.el)}buildExtraMarkup(){const t=t=>{const e=(0,s.fc)(t);return this.wrapper.append(e),e},e=t=>{t.classList.contains("--prevent-click")||t.addEventListener("click",(t=>{t.stopPropagation(),this.toggleFn()}))};if(Array.isArray(this.extraMarkup))this.extraMarkup.forEach((i=>{const s=t(i);e(s)}));else{const i=t(this.extraMarkup);e(i)}}buildToggle(){var t,e;let i,n;this.toggleTextWrapper=document.createElement("span"),this.toggleTextWrapper.classList.add("truncate"),this.toggle=(0,s.fc)(this.toggleTag||"
"),i=this.toggle.querySelector("[data-icon]"),n=this.toggle.querySelector("[data-title]"),!this.isMultiple&&i&&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,s.en)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),(null===(e=this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.isOpened?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(()=>{if(this.isDisabled)return!1;this.toggleFn()}))}setToggleIcon(){var t;const e=this.getItemByValue(this.value),i=this.toggle.querySelector("[data-icon]");if(i.innerHTML="",i){const n=(0,s.fc)(this.apiUrl&&this.apiIconTag?this.apiIconTag||"":(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.icon)||"");this.value&&this.apiUrl&&this.apiIconTag&&e[this.apiFieldsMap.icon]&&(n.src=e[this.apiFieldsMap.icon]||""),i.append(n),n&&(null==n?void 0:n.src)?i.classList.remove("hidden"):i.classList.add("hidden")}}setToggleTitle(){var t;const e=this.toggle.querySelector("[data-title]");if(e.classList.add("truncate"),e.innerHTML="",e){const i=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder;e.innerHTML=i,this.toggle.append(e)}}buildTags(){this.isDisabled&&this.wrapper.classList.add("disabled"),this.buildTagsInput(),this.setTagsItems()}reassignTagsInputPlaceholder(t){this.tagsInput.placeholder=t,this.tagsInputHelper.innerHTML=t,this.calculateInputWidth()}buildTagsItem(t){var e,i,n,o;const l=this.getItemByValue(t);let a,r,d,h;const c=document.createElement("div");if(c.setAttribute("data-tag-value",t),this.tagsItemClasses&&(0,s.en)(this.tagsItemClasses,c),this.tagsItemTemplate&&(a=(0,s.fc)(this.tagsItemTemplate),c.append(a)),(null===(e=null==l?void 0:l.options)||void 0===e?void 0:e.icon)||this.apiIconTag){const t=(0,s.fc)(this.apiUrl&&this.apiIconTag?this.apiIconTag:null===(i=null==l?void 0:l.options)||void 0===i?void 0:i.icon);this.apiUrl&&this.apiIconTag&&l[this.apiFieldsMap.icon]&&(t.src=l[this.apiFieldsMap.icon]||""),h=a?a.querySelector("[data-icon]"):document.createElement("span"),h.append(t),a||c.append(h)}!a||!a.querySelector("[data-icon]")||(null===(n=null==l?void 0:l.options)||void 0===n?void 0:n.icon)||this.apiUrl||this.apiIconTag||l[null===(o=this.apiFieldsMap)||void 0===o?void 0:o.icon]||a.querySelector("[data-icon]").classList.add("hidden"),r=a?a.querySelector("[data-title]"):document.createElement("span"),r.textContent=l.title||"",a||c.append(r),a?d=a.querySelector("[data-remove]"):(d=document.createElement("span"),d.textContent="X",c.append(d)),d.addEventListener("click",(()=>{this.value=this.value.filter((e=>e!==t)),this.selectedItems=this.selectedItems.filter((e=>e!==t)),this.value.length||this.reassignTagsInputPlaceholder(this.placeholder),this.unselectMultipleItems(),this.selectMultipleItems(),c.remove()})),this.wrapper.append(c)}getItemByValue(t){return this.apiUrl?this.remoteOptions.find((e=>e[this.apiFieldsMap.title]===t)):this.selectOptions.find((e=>e.val===t))}setTagsItems(){this.value&&this.value.forEach((t=>{this.selectedItems.includes(t)||this.buildTagsItem(t),this.selectedItems=this.selectedItems.includes(t)?this.selectedItems:[...this.selectedItems,t]}))}buildTagsInput(){this.tagsInput=document.createElement("input"),this.tagsInputId&&(this.tagsInput.id=this.tagsInputId),this.tagsInputClasses&&(0,s.en)(this.tagsInputClasses,this.tagsInput),this.tagsInput.addEventListener("focus",(()=>{this.isOpened||this.open()})),this.tagsInput.addEventListener("input",(()=>this.calculateInputWidth())),this.tagsInput.addEventListener("input",(0,s.sg)((t=>this.searchOptions(t.target.value)))),this.tagsInput.addEventListener("keydown",(t=>{if("Enter"===t.key&&this.isAddTagOnEnter){const e=t.target.value;if(this.selectOptions.find((t=>t.val===e)))return!1;this.addSelectOption(e,e),this.buildOption(e,e),this.dropdown.querySelector(`[data-value="${e}"]`).click(),this.resetTagsInputField()}})),this.wrapper.append(this.tagsInput),setTimeout((()=>{this.adjustInputWidth(),this.reassignTagsInputPlaceholder(this.value.length?"":this.placeholder)}))}buildDropdown(){this.dropdown=(0,s.fc)(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),"parent"===this.dropdownScope&&this.dropdown.classList.add("absolute","top-full"),this.dropdown.role="listbox",this.dropdown.tabIndex=-1,this.dropdown.ariaOrientation="vertical",this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,s.en)(this.dropdownClasses,this.dropdown),this.wrapper&&this.wrapper.append(this.dropdown),this.dropdown&&this.hasSearch&&this.buildSearch(),this.selectOptions&&this.selectOptions.forEach(((t,e)=>this.buildOption(t.title,t.val,t.disabled,t.selected,t.options,`${e}`))),this.apiUrl&&this.optionsFromRemoteData(),"window"===this.dropdownScope&&this.buildPopper()}buildPopper(){"undefined"!=typeof Popper&&Popper.createPopper&&(document.body.appendChild(this.dropdown),this.popperInstance=Popper.createPopper("tags"===this.mode?this.wrapper:this.toggle,this.dropdown,{placement:o.lP[this.dropdownPlacement]||"bottom",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,5]}}]}))}updateDropdownWidth(){const t="tags"===this.mode?this.wrapper:this.toggle;this.dropdown.style.width=`${t.clientWidth}px`}buildSearch(){let t;this.searchWrapper=(0,s.fc)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,s.en)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]");const e=(0,s.fc)(this.searchTemplate||'');this.search="INPUT"===e.tagName?e:e.querySelector(":scope input"),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,s.en)(this.searchClasses,this.search),this.searchId&&(this.search.id=this.searchId),this.search.addEventListener("input",(0,s.sg)((t=>{this.apiUrl?this.remoteSearch(t.target.value):this.searchOptions(t.target.value)}))),t?t.append(e):this.searchWrapper.append(e),this.dropdown.append(this.searchWrapper)}buildOption(t,e,i=!1,n=!1,o,l="1",a){var r;let d=null,h=null,c=null,u=null;const p=(0,s.fc)(this.optionTag||"
");if(p.setAttribute("data-value",e),p.setAttribute("data-title-value",t),p.setAttribute("tabIndex",l),p.classList.add("cursor-pointer"),p.setAttribute("data-id",a||`${this.optionId}`),a||this.optionId++,i&&p.classList.add("disabled"),n&&(this.isMultiple?this.value=[...this.value,e]:this.value=e),this.optionTemplate&&(d=(0,s.fc)(this.optionTemplate),p.append(d)),d?(h=d.querySelector("[data-title]"),h.textContent=t||""):p.textContent=t||"",o){if(o.icon){const e=(0,s.fc)(null!==(r=this.apiIconTag)&&void 0!==r?r:o.icon);if(e.classList.add("max-w-full"),this.apiUrl&&(e.setAttribute("alt",t),e.setAttribute("src",o.icon)),d)c=d.querySelector("[data-icon]"),c.append(e);else{const t=(0,s.fc)("
");this.iconClasses&&(0,s.en)(this.iconClasses,t),t.append(e),p.append(t)}}if(o.description)if(d)u=d.querySelector("[data-description]"),u&&u.append(o.description);else{const t=(0,s.fc)("
");t.textContent=o.description,this.descriptionClasses&&(0,s.en)(this.descriptionClasses,t),p.append(t)}}d&&d.querySelector("[data-icon]")&&!o&&!(null==o?void 0:o.icon)&&d.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&p.classList.add("selected"),i||p.addEventListener("click",(()=>this.onSelectOption(e))),this.optionClasses&&(0,s.en)(this.optionClasses,p),this.dropdown&&this.dropdown.append(p),n&&this.setNewValue()}buildOptionFromRemoteData(t,e,i=!1,s=!1,n="1",o,l){n?this.buildOption(t,e,i,s,l,n,o):alert("ID parameter is required for generating remote options! Please check your API endpoint have it.")}buildOptionsFromRemoteData(t){t.forEach(((t,e)=>{let i=null,s="";const n={id:"",title:"",icon:null,description:null,rest:{}};Object.keys(t).forEach((e=>{var o;t[this.apiFieldsMap.id]&&(i=t[this.apiFieldsMap.id]),t[this.apiFieldsMap.title]&&(s=t[this.apiFieldsMap.title]),t[this.apiFieldsMap.icon]&&(n.icon=t[this.apiFieldsMap.icon]),t[null===(o=this.apiFieldsMap)||void 0===o?void 0:o.description]&&(n.description=t[this.apiFieldsMap.description]),n.rest[e]=t[e]})),this.buildOriginalOption(s,s,i,!1,!1,n),this.buildOptionFromRemoteData(s,s,!1,!1,`${e}`,i,n)})),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")}optionsFromRemoteData(){return l(this,arguments,void 0,(function*(t=""){const e=yield this.apiRequest(t);this.remoteOptions=e,e.length?this.buildOptionsFromRemoteData(this.remoteOptions):console.log("There is no data were responded!")}))}apiRequest(){return l(this,arguments,void 0,(function*(t=""){try{let e=this.apiUrl;const i=this.apiSearchQueryKey?`${this.apiSearchQueryKey}=${t.toLowerCase()}`:null,s=`${this.apiQuery}`,n=this.apiOptions||{};i&&(e+=`?${i}`),this.apiQuery&&(e+=`${i?"&":"?"}${s}`);const o=yield fetch(e,n),l=yield o.json();return this.apiDataPart?l[this.apiDataPart]:l}catch(t){console.error(t)}}))}sortElements(t,e){const i=Array.from(t.querySelectorAll(e));i.sort(((t,e)=>{const i=t.classList.contains("selected")||t.hasAttribute("selected"),s=e.classList.contains("selected")||e.hasAttribute("selected");return i&&!s?-1:!i&&s?1:0})),i.forEach((e=>t.appendChild(e)))}remoteSearch(t){return l(this,void 0,void 0,(function*(){const e=yield this.apiRequest(t);this.remoteOptions=e;let i=e.map((t=>`${t.id}`)),s=null;const n=this.dropdown.querySelectorAll("[data-value]");this.el.querySelectorAll("[data-hs-select-option]").forEach((t=>{var e;const s=t.getAttribute("data-id");i.includes(s)||(null===(e=this.value)||void 0===e?void 0:e.includes(t.value))||this.destroyOriginalOption(t.value)})),n.forEach((t=>{var e;const s=t.getAttribute("data-id");i.includes(s)||(null===(e=this.value)||void 0===e?void 0:e.includes(t.getAttribute("data-value")))?i=i.filter((t=>t!==s)):this.destroyOption(t.getAttribute("data-value"))})),s=e.filter((t=>i.includes(`${t.id}`))),s.length?this.buildOptionsFromRemoteData(s):console.log("There is no data were responded!")}))}destroyOption(t){const e=this.dropdown.querySelector(`[data-value="${t}"]`);if(!e)return!1;e.remove()}buildOriginalOption(t,e,i,n,o,l){const a=(0,s.fc)("");a.setAttribute("value",e),n&&a.setAttribute("disabled","disabled"),o&&a.setAttribute("selected","selected"),i&&a.setAttribute("data-id",i),a.setAttribute("data-hs-select-option",JSON.stringify(l)),a.innerText=t,this.el.append(a)}destroyOriginalOption(t){const e=this.el.querySelector(`[value="${t}"]`);if(!e)return!1;e.remove()}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)}calculateInputWidth(){this.tagsInputHelper.textContent=this.tagsInput.value||this.tagsInput.placeholder;const 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),i=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=`${Math.min(i,s)+2}px`}adjustInputWidth(){this.buildTagsInputHelper(),this.calculateInputWidth()}onSelectOption(t){if(this.clearSelections(),this.isMultiple?(this.value=this.value.includes(t)?Array.from(this.value).filter((e=>e!==t)):[...Array.from(this.value),t],this.selectMultipleItems(),this.setNewValue()):(this.value=t,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),(0,s.JD)("change.hs.select",this.el,this.value),"tags"===this.mode){const t=this.selectedItems.filter((t=>!this.value.includes(t)));t.length&&t.forEach((t=>{this.selectedItems=this.selectedItems.filter((e=>e!==t)),this.wrapper.querySelector(`[data-tag-value="${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(),this.triggerChangeEventForNativeSelect()}triggerChangeEventForNativeSelect(){const t=new Event("change",{bubbles:!0});this.el.dispatchEvent(t)}addSelectOption(t,e,i,s,n){this.selectOptions=[...this.selectOptions,{title:t,val:e,disabled:i,selected:s,options:n}]}removeSelectOption(t,e=!1){if(!!!this.selectOptions.some((e=>e.val===t)))return!1;this.selectOptions=this.selectOptions.filter((e=>e.val!==t)),this.value=e?this.value.filter((e=>e!==t)):t}resetTagsInputField(){this.tagsInput.value="",this.reassignTagsInputPlaceholder(""),this.searchOptions("")}clearSelections(){Array.from(this.dropdown.children).forEach((t=>{t.classList.contains("selected")&&t.classList.remove("selected")})),Array.from(this.el.children).forEach((t=>{t.selected&&(t.selected=!1)}))}setNewValue(){var t;"tags"===this.mode?this.setTagsItems():(null===(t=this.value)||void 0===t?void 0:t.length)?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder}stringFromValueBasic(t){const e=[];let i="";if(t.forEach((t=>{this.isMultiple?this.value.includes(t.val)&&e.push(t.title):this.value===t.val&&e.push(t.title)})),this.toggleCountText&&""!==this.toggleCountText&&e.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){const t=e.slice(0,this.toggleCountTextMinItems-1);i=`${t.join(this.toggleSeparators.items)} ${this.toggleSeparators.betweenItemsAndCounter} ${e.length-t.length} ${this.toggleCountText}`}else i=`${e.length} ${this.toggleCountText}`;else i=e.join(this.toggleSeparators.items);return i}stringFromValueRemoteData(){const t=this.dropdown.querySelectorAll("[data-title-value]"),e=[];let i="";if(t.forEach((t=>{const i=t.getAttribute("data-value");this.isMultiple?this.value.includes(i)&&e.push(i):this.value===i&&e.push(i)})),this.toggleCountText&&""!==this.toggleCountText&&e.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){const t=e.slice(0,this.toggleCountTextMinItems-1);i=`${t.join(this.toggleSeparators.items)} ${this.toggleSeparators.betweenItemsAndCounter} ${e.length-t.length} ${this.toggleCountText}`}else i=`${e.length} ${this.toggleCountText}`;else i=e.join(this.toggleSeparators.items);return i}stringFromValue(){return this.apiUrl?this.stringFromValueRemoteData():this.stringFromValueBasic(this.selectOptions)}selectSingleItem(){Array.from(this.el.children).find((t=>this.value===t.value)).selected=!0;const t=Array.from(this.dropdown.children).find((t=>this.value===t.getAttribute("data-value")));t&&t.classList.add("selected")}selectMultipleItems(){Array.from(this.dropdown.children).filter((t=>this.value.includes(t.getAttribute("data-value")))).forEach((t=>t.classList.add("selected"))),Array.from(this.el.children).filter((t=>this.value.includes(t.value))).forEach((t=>t.selected=!0))}unselectMultipleItems(){Array.from(this.dropdown.children).forEach((t=>t.classList.remove("selected"))),Array.from(this.el.children).forEach((t=>t.selected=!1))}searchOptions(t){this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,s.fc)(this.searchNoResultTemplate),this.searchNoResult.innerText=this.searchNoResultText,(0,s.en)(this.searchNoResultClasses,this.searchNoResult);const e=this.dropdown.querySelectorAll("[data-value]");let i,n=!1;this.searchLimit&&(i=0),e.forEach((e=>{const s=e.getAttribute("data-title-value").toLocaleLowerCase(),o=t?t.split("").map((t=>t.match(/\w/)?`${t}[\\W_]*`:"\\W*")).join(""):"",l=new RegExp(o,"i"),a=this.isSearchDirectMatch,r=s.trim();(t?a?!r.toLowerCase().includes(t.toLowerCase())||i>=this.searchLimit:!l.test(r)||i>=this.searchLimit:!l.test(r))?e.classList.add("hidden"):(e.classList.remove("hidden"),n=!0,this.searchLimit&&i++)})),n||this.dropdown.append(this.searchNoResult)}eraseToggleIcon(){const t=this.toggle.querySelector("[data-icon]");t&&(t.innerHTML=null,t.classList.add("hidden"))}eraseToggleTitle(){const t=this.toggle.querySelector("[data-title]");t?t.innerHTML=this.placeholder:this.toggleTextWrapper.innerHTML=this.placeholder}toggleFn(){this.isOpened?this.close():this.open()}destroy(){const 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}open(){var t;const e=(null===(t=null===window||void 0===window?void 0:window.$hsSelectCollection)||void 0===t?void 0:t.find((t=>t.element.isOpened)))||null;if(e&&e.element.close(),this.animationInProcess)return!1;this.animationInProcess=!0,"window"===this.dropdownScope&&this.dropdown.classList.add("invisible"),this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((()=>{var t;(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.wrapper.classList.add("active"),this.dropdown.classList.add("opened"),this.dropdown.classList.contains("w-full")&&"window"===this.dropdownScope&&this.updateDropdownWidth(),this.popperInstance&&"window"===this.dropdownScope&&(this.popperInstance.update(),this.dropdown.classList.remove("invisible")),this.hasSearch&&!this.preventSearchFocus&&this.search.focus(),this.animationInProcess=!1})),this.isOpened=!0}close(){var t,e,i,n;if(this.animationInProcess)return!1;this.animationInProcess=!0,(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(i=this.dropdownDirectionClasses)||void 0===i?void 0:i.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,s.yd)(this.dropdown,(()=>{this.dropdown.classList.add("hidden"),this.hasSearch&&(this.search.value="",this.search.dispatchEvent(new Event("input",{bubbles:!0})),this.search.blur()),this.animationInProcess=!1})),null===(n=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===n||n.classList.remove("hs-select-option-highlighted"),this.isOpened=!1}addOption(t){let e=`${this.selectOptions.length}`;const i=t=>{const{title:i,val:s,disabled:n,selected:o,options:l}=t;!!this.selectOptions.some((t=>t.val===s))||(this.addSelectOption(i,s,n,o,l),this.buildOption(i,s,n,o,l,e),this.buildOriginalOption(i,s,null,n,o,l),o&&!this.isMultiple&&this.onSelectOption(s))};Array.isArray(t)?t.forEach((t=>{i(t)})):i(t)}removeOption(t){const e=(t,e=!1)=>{!!this.selectOptions.some((e=>e.val===t))&&(this.removeSelectOption(t,e),this.destroyOption(t),this.destroyOriginalOption(t),this.value===t&&(this.value=null,this.eraseToggleTitle(),this.eraseToggleIcon()))};Array.isArray(t)?t.forEach((t=>{e(t,this.isMultiple)})):e(t,this.isMultiple),this.setNewValue()}recalculateDirection(){var t,e,i,n;(0,s.PR)(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=`${this.dropdownSpace}px`):(this.dropdown.classList.remove("top-full"),(null===(i=this.dropdownDirectionClasses)||void 0===i?void 0:i.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.classList.add("bottom-full"),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.bottom)&&this.dropdown.classList.add(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom=`${this.dropdownSpace}px`)}static getInstance(t,e){const i=window.$hsSelectCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element:null}static autoInit(){window.$hsSelectCollection||(window.$hsSelectCollection=[]),document.querySelectorAll("[data-hs-select]:not(.--prevent-on-load-init)").forEach((t=>{if(!window.$hsSelectCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))){const e=t.getAttribute("data-hs-select"),i=e?JSON.parse(e):{};new a(t,i)}})),window.$hsSelectCollection&&(window.addEventListener("click",(t=>{const e=t.target;a.closeCurrentlyOpened(e)})),document.addEventListener("keydown",(t=>a.accessibility(t))))}static open(t){const e=window.$hsSelectCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));e&&!e.element.isOpened&&e.element.open()}static close(t){const e=window.$hsSelectCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));e&&e.element.isOpened&&e.element.close()}static closeCurrentlyOpened(t=null){if(!t.closest(".hs-select.active")&&!t.closest("[data-hs-select-dropdown].opened")){const t=window.$hsSelectCollection.filter((t=>t.element.isOpened))||null;t&&t.forEach((t=>{t.element.close()}))}}static accessibility(t){if(window.$hsSelectCollection.find((t=>t.element.isOpened))&&o.fp.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Tab":t.preventDefault(),t.stopImmediatePropagation(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}}static onEscape(){const t=window.$hsSelectCollection.find((t=>t.element.isOpened));t&&t.element.close()}static onArrow(t=!0){const e=window.$hsSelectCollection.find((t=>t.element.isOpened));if(e){const i=e.element.dropdown;if(!i)return!1;const s=(t?Array.from(i.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(i.querySelectorAll(":scope > *:not(.hidden)"))).filter((t=>!t.classList.contains("disabled"))),n=i.querySelector(".hs-select-option-highlighted")||i.querySelector(".selected");n||s[0].classList.add("hs-select-option-highlighted");let o=s.findIndex((t=>t===n));o+1t.element.isOpened));if(e){const i=e.element.dropdown;if(!i)return!1;const s=(t?Array.from(i.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(i.querySelectorAll(":scope > *:not(.hidden)"))).filter((t=>!t.classList.contains("disabled"))),n=i.querySelector(".hs-select-option-highlighted")||i.querySelector(".selected");n||s[0].classList.add("hs-select-option-highlighted");let o=s.findIndex((t=>t===n));if(!(o+1t.element.isOpened));if(e){const i=e.element.dropdown;if(!i)return!1;const s=(t?Array.from(i.querySelectorAll(":scope > *:not(.hidden)")):Array.from(i.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((t=>!t.classList.contains("disabled"))),n=i.querySelector(".hs-select-option-highlighted");s.length&&(s[0].focus(),n&&n.classList.remove("hs-select-option-highlighted"),s[0].classList.add("hs-select-option-highlighted"))}}static onEnter(t){const e=t.target.previousSibling;if(window.$hsSelectCollection.find((t=>t.element.el===e))){const t=window.$hsSelectCollection.find((t=>t.element.isOpened)),i=window.$hsSelectCollection.find((t=>t.element.el===e));t.element.close(),i.element.open()}else{const e=window.$hsSelectCollection.find((t=>t.element.isOpened));e&&e.element.onSelectOption(t.target.dataset.value||"")}}}window.addEventListener("load",(()=>{a.autoInit()})),document.addEventListener("scroll",(()=>{if(!window.$hsSelectCollection)return!1;const t=window.$hsSelectCollection.find((t=>t.element.isOpened));t&&t.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSSelect=a);const r=a},797:(t,e,i)=>{i.d(e,{A:()=>l});var s=i(926),n=i(615); +/* + * HSStepper + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class o extends n.A{constructor(t,e){super(t,e);const i=t.getAttribute("data-hs-stepper"),s=i?JSON.parse(i):{},n=Object.assign(Object.assign({},s),e);this.currentIndex=(null==n?void 0:n.currentIndex)||1,this.mode=(null==n?void 0:n.mode)||"linear",this.isCompleted=void 0!==(null==n?void 0:n.isCompleted)&&(null==n?void 0:n.isCompleted),this.totalSteps=1,this.navItems=[],this.contentItems=[],this.init()}init(){this.createCollection(window.$hsStepperCollection,this),this.buildNav(),this.buildContent(),this.buildButtons(),this.setTotalSteps()}getUncompletedSteps(t=!1){return this.navItems.filter((({isCompleted:e,isSkip:i})=>t?!e||i:!e&&!i))}setTotalSteps(){this.navItems.forEach((t=>{const{index:e}=t;e>this.totalSteps&&(this.totalSteps=e)}))}buildNav(){this.el.querySelectorAll("[data-hs-stepper-nav-item]").forEach((t=>this.addNavItem(t))),this.navItems.forEach((t=>this.buildNavItem(t)))}buildNavItem(t){const{index:e,isDisabled:i,el:s}=t;e===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||i)&&s.addEventListener("click",(()=>this.handleNavItemClick(t)))}addNavItem(t){const{index:e,isFinal:i=!1,isCompleted:s=!1,isSkip:n=!1,isOptional:o=!1,isDisabled:l=!1,isProcessed:a=!1,hasError:r=!1}=JSON.parse(t.getAttribute("data-hs-stepper-nav-item"));s&&t.classList.add("success"),n&&t.classList.add("skipped"),l&&("BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")),r&&t.classList.add("error"),this.navItems.push({index:e,isFinal:i,isCompleted:s,isSkip:n,isOptional:o,isDisabled:l,isProcessed:a,hasError:r,el:t})}setCurrentNavItem(){this.navItems.forEach((t=>{const{index:e,el:i}=t;e===this.currentIndex?this.setCurrentNavItemActions(i):this.unsetCurrentNavItemActions(i)}))}setCurrentNavItemActions(t){t.classList.add("active"),this.fireEvent("active",this.currentIndex),(0,s.JD)("active.hs.stepper",this.el,this.currentIndex)}getNavItem(t=this.currentIndex){return this.navItems.find((({index:e})=>e===t))}setProcessedNavItemActions(t){t.isProcessed=!0,t.el.classList.add("processed")}setErrorNavItemActions(t){t.hasError=!0,t.el.classList.add("error")}unsetCurrentNavItemActions(t){t.classList.remove("active")}handleNavItemClick(t){const{index:e}=t;this.currentIndex=e,this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep()}buildContent(){this.el.querySelectorAll("[data-hs-stepper-content-item]").forEach((t=>this.addContentItem(t))),this.navItems.forEach((t=>this.buildContentItem(t)))}buildContentItem(t){const{index:e}=t;e===this.currentIndex&&this.setCurrentContentItem()}addContentItem(t){const{index:e,isFinal:i=!1,isCompleted:s=!1,isSkip:n=!1}=JSON.parse(t.getAttribute("data-hs-stepper-content-item"));s&&t.classList.add("success"),n&&t.classList.add("skipped"),this.contentItems.push({index:e,isFinal:i,isCompleted:s,isSkip:n,el:t})}setCurrentContentItem(){if(this.isCompleted){const t=this.contentItems.find((({isFinal:t})=>t)),e=this.contentItems.filter((({isFinal:t})=>!t));return t.el.style.display="",e.forEach((({el:t})=>t.style.display="none")),!1}this.contentItems.forEach((t=>{const{index:e,el:i}=t;e===this.currentIndex?this.setCurrentContentItemActions(i):this.unsetCurrentContentItemActions(i)}))}hideAllContentItems(){this.contentItems.forEach((({el:t})=>t.style.display="none"))}setCurrentContentItemActions(t){t.style.display=""}unsetCurrentContentItemActions(t){t.style.display="none"}disableAll(){const t=this.getNavItem(this.currentIndex);t.hasError=!1,t.isCompleted=!1,t.isDisabled=!1,t.el.classList.remove("error","success"),this.disableButtons()}disableNavItemActions(t){t.isDisabled=!0,t.el.classList.add("disabled")}enableNavItemActions(t){t.isDisabled=!1,t.el.classList.remove("disabled")}buildButtons(){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()}buildBackButton(){this.backBtn&&(this.checkForTheFirstStep(),this.backBtn.addEventListener("click",(()=>{if(this.handleBackButtonClick(),"linear"===this.mode){const t=this.navItems.find((({index:t})=>t===this.currentIndex)),e=this.contentItems.find((({index:t})=>t===this.currentIndex));if(!t||!e)return;t.isCompleted&&(t.isCompleted=!1,t.isSkip=!1,t.el.classList.remove("success","skipped")),e.isCompleted&&(e.isCompleted=!1,e.isSkip=!1,e.el.classList.remove("success","skipped")),"linear"===this.mode&&this.currentIndex!==this.totalSteps&&(this.nextBtn&&(this.nextBtn.style.display=""),this.completeStepBtn&&(this.completeStepBtn.style.display="")),this.showSkipButton(),this.showFinishButton(),this.showCompleteStepButton()}})))}handleBackButtonClick(){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.JD)("back.hs.stepper",this.el,this.currentIndex))}checkForTheFirstStep(){1===this.currentIndex?this.setToDisabled(this.backBtn):this.setToNonDisabled(this.backBtn)}setToDisabled(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")}setToNonDisabled(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled"),t.classList.remove("disabled")}buildNextButton(){this.nextBtn&&this.nextBtn.addEventListener("click",(()=>{var t;if(this.fireEvent("beforeNext",this.currentIndex),(0,s.JD)("beforeNext.hs.stepper",this.el,this.currentIndex),null===(t=this.getNavItem(this.currentIndex))||void 0===t?void 0:t.isProcessed)return this.disableAll(),!1;this.goToNext()}))}unsetProcessedNavItemActions(t){t.isProcessed=!1,t.el.classList.remove("processed")}handleNextButtonClick(t=!0){if(t)this.currentIndex===this.totalSteps?this.currentIndex=1:this.currentIndex++;else{const t=this.getUncompletedSteps();if(1===t.length){const{index:e}=t[0];this.currentIndex=e}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.JD)("next.hs.stepper",this.el,this.currentIndex)}removeOptionalClasses(){const t=this.navItems.find((({index:t})=>t===this.currentIndex)),e=this.contentItems.find((({index:t})=>t===this.currentIndex));t.isSkip=!1,t.hasError=!1,t.isDisabled=!1,e.isSkip=!1,t.el.classList.remove("skipped","success","error"),e.el.classList.remove("skipped","success","error")}buildSkipButton(){this.skipBtn&&(this.showSkipButton(),this.skipBtn.addEventListener("click",(()=>{this.handleSkipButtonClick(),"linear"===this.mode&&this.currentIndex===this.totalSteps&&(this.nextBtn&&(this.nextBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"),this.finishBtn&&(this.finishBtn.style.display=""))})))}setSkipItem(t){const e=this.navItems.find((({index:e})=>e===(t||this.currentIndex))),i=this.contentItems.find((({index:e})=>e===(t||this.currentIndex)));e&&i&&(this.setSkipItemActions(e),this.setSkipItemActions(i))}setSkipItemActions(t){t.isSkip=!0,t.el.classList.add("skipped")}showSkipButton(){if(!this.skipBtn)return;const{isOptional:t}=this.navItems.find((({index:t})=>t===this.currentIndex));this.skipBtn.style.display=t?"":"none"}handleSkipButtonClick(){this.setSkipItem(),this.handleNextButtonClick(),this.fireEvent("skip",this.currentIndex),(0,s.JD)("skip.hs.stepper",this.el,this.currentIndex)}buildCompleteStepButton(){this.completeStepBtn&&(this.completeStepBtnDefaultText=this.completeStepBtn.innerText,this.completeStepBtn.addEventListener("click",(()=>this.handleCompleteStepButtonClick())))}changeTextAndDisableCompleteButtonIfStepCompleted(){const t=this.navItems.find((({index:t})=>t===this.currentIndex)),{completedText:e}=JSON.parse(this.completeStepBtn.getAttribute("data-hs-stepper-complete-step-btn"));t&&(t.isCompleted?(this.completeStepBtn.innerText=e||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")))}setCompleteItem(t){const e=this.navItems.find((({index:e})=>e===(t||this.currentIndex))),i=this.contentItems.find((({index:e})=>e===(t||this.currentIndex)));e&&i&&(this.setCompleteItemActions(e),this.setCompleteItemActions(i))}setCompleteItemActions(t){t.isCompleted=!0,t.el.classList.add("success")}showCompleteStepButton(){if(!this.completeStepBtn)return;1===this.getUncompletedSteps().length?this.completeStepBtn.style.display="none":this.completeStepBtn.style.display=""}handleCompleteStepButtonClick(){this.setCompleteItem(),this.fireEvent("complete",this.currentIndex),(0,s.JD)("complete.hs.stepper",this.el,this.currentIndex),this.handleNextButtonClick(!1),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton()}buildFinishButton(){this.finishBtn&&(this.isCompleted&&this.setCompleted(),this.finishBtn.addEventListener("click",(()=>this.handleFinishButtonClick())))}setCompleted(){this.el.classList.add("completed")}unsetCompleted(){this.el.classList.remove("completed")}showFinishButton(){if(!this.finishBtn)return;1===this.getUncompletedSteps().length?this.finishBtn.style.display="":this.finishBtn.style.display="none"}handleFinishButtonClick(){const t=this.getUncompletedSteps(),e=this.getUncompletedSteps(!0),{el:i}=this.contentItems.find((({isFinal:t})=>t));t.length&&t.forEach((({index:t})=>this.setCompleteItem(t))),this.currentIndex=this.totalSteps,this.setCurrentNavItem(),this.hideAllContentItems();const n=this.navItems.find((({index:t})=>t===this.currentIndex));(n?n.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=""),e.length<=1&&(this.isCompleted=!0,this.setCompleted()),this.fireEvent("finish",this.currentIndex),(0,s.JD)("finish.hs.stepper",this.el,this.currentIndex)}buildResetButton(){this.resetBtn&&this.resetBtn.addEventListener("click",(()=>this.handleResetButtonClick()))}handleResetButtonClick(){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((t=>{const{el:e}=t;t.isSkip=!1,t.isCompleted=!1,this.unsetCurrentNavItemActions(e),e.classList.remove("success","skipped")})),this.contentItems.forEach((t=>{const{el:e}=t;t.isSkip=!1,t.isCompleted=!1,this.unsetCurrentContentItemActions(e),e.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.JD)("reset.hs.stepper",this.el,this.currentIndex)}setProcessedNavItem(t){const e=this.getNavItem(t);e&&this.setProcessedNavItemActions(e)}unsetProcessedNavItem(t){const e=this.getNavItem(t);e&&this.unsetProcessedNavItemActions(e)}goToNext(){"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"))}disableButtons(){this.backBtn&&this.setToDisabled(this.backBtn),this.nextBtn&&this.setToDisabled(this.nextBtn)}enableButtons(){this.backBtn&&this.setToNonDisabled(this.backBtn),this.nextBtn&&this.setToNonDisabled(this.nextBtn)}setErrorNavItem(t){const e=this.getNavItem(t);e&&this.setErrorNavItemActions(e)}static getInstance(t,e){const i=window.$hsStepperCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element:null}static autoInit(){window.$hsStepperCollection||(window.$hsStepperCollection=[]),document.querySelectorAll("[data-hs-stepper]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsStepperCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new o(t)}))}}window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=o);const l=o},319:(t,e,i)=>{i.d(e,{A:()=>l});var s=i(926),n=i(615); +/* + * HSStrongPassword + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class o extends n.A{constructor(t,e){super(t,e),this.isOpened=!1,this.strength=0,this.passedRules=new Set;const i=t.getAttribute("data-hs-strong-password"),s=i?JSON.parse(i):{},n=Object.assign(Object.assign({},s),e);this.target=(null==n?void 0:n.target)?"string"==typeof(null==n?void 0:n.target)?document.querySelector(n.target):n.target:null,this.hints=(null==n?void 0:n.hints)?"string"==typeof(null==n?void 0:n.hints)?document.querySelector(n.hints):n.hints:null,this.stripClasses=(null==n?void 0:n.stripClasses)||null,this.minLength=(null==n?void 0:n.minLength)||6,this.mode=(null==n?void 0:n.mode)||"default",this.popoverSpace=(null==n?void 0:n.popoverSpace)||10,this.checksExclude=(null==n?void 0:n.checksExclude)||[],this.availableChecks=["lowercase","uppercase","numbers","special-characters","min-length"].filter((t=>!this.checksExclude.includes(t))),this.specialCharactersSet=(null==n?void 0:n.specialCharactersSet)||"!\"#$%&'()*+,-./:;<=>?@[\\\\\\]^_`{|}~",this.target&&this.init()}init(){this.createCollection(window.$hsStrongPasswordCollection,this),this.availableChecks.length&&this.build()}build(){this.buildStrips(),this.hints&&this.buildHints(),this.setStrength(this.target.value),this.target.addEventListener("input",(t=>{this.setStrength(t.target.value)}))}buildStrips(){if(this.el.innerHTML="",this.stripClasses)for(let t=0;t");(0,s.en)(this.stripClasses,t),this.el.append(t)}}buildHints(){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((t=>{var e;const i=t.getAttribute("data-hs-strong-password-hints-rule-text");(null===(e=this.checksExclude)||void 0===e?void 0:e.includes(i))&&t.remove()})),this.weakness&&this.buildWeakness(),this.rules&&this.buildRules(),"popover"===this.mode&&(this.target.addEventListener("focus",(()=>{this.isOpened=!0,this.hints.classList.remove("hidden"),this.hints.classList.add("block"),this.recalculateDirection()})),this.target.addEventListener("blur",(()=>{this.isOpened=!1,this.hints.classList.remove("block","bottom-full","top-full"),this.hints.classList.add("hidden"),this.hints.style.marginTop="",this.hints.style.marginBottom=""})))}buildWeakness(){this.checkStrength(this.target.value),this.setWeaknessText(),this.target.addEventListener("input",(()=>setTimeout((()=>this.setWeaknessText()))))}buildRules(){this.setRulesText(),this.target.addEventListener("input",(()=>setTimeout((()=>this.setRulesText()))))}setWeaknessText(){const t=this.weakness.getAttribute("data-hs-strong-password-hints-weakness-text"),e=JSON.parse(t);this.weakness.textContent=e[this.strength]}setRulesText(){this.rules.forEach((t=>{const e=t.getAttribute("data-hs-strong-password-hints-rule-text");this.checkIfPassed(t,this.passedRules.has(e))}))}togglePopover(){const t=this.el.querySelector(".popover");t&&t.classList.toggle("show")}checkStrength(t){const e=new Set,i={lowercase:/[a-z]+/,uppercase:/[A-Z]+/,numbers:/[0-9]+/,"special-characters":new RegExp(`[${this.specialCharactersSet}]`)};let s=0;return this.availableChecks.includes("lowercase")&&t.match(i.lowercase)&&(s+=1,e.add("lowercase")),this.availableChecks.includes("uppercase")&&t.match(i.uppercase)&&(s+=1,e.add("uppercase")),this.availableChecks.includes("numbers")&&t.match(i.numbers)&&(s+=1,e.add("numbers")),this.availableChecks.includes("special-characters")&&t.match(i["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}}checkIfPassed(t,e=!1){const i=t.querySelector("[data-check]"),s=t.querySelector("[data-uncheck]");e?(t.classList.add("active"),i.classList.remove("hidden"),s.classList.add("hidden")):(t.classList.remove("active"),i.classList.add("hidden"),s.classList.remove("hidden"))}setStrength(t){const{strength:e,rules:i}=this.checkStrength(t),n={strength:e,rules:i};this.hideStrips(e),this.fireEvent("change",n),(0,s.JD)("change.hs.strongPassword",this.el,n)}hideStrips(t){Array.from(this.el.children).forEach(((e,i)=>{ie.element.el===("string"==typeof t?document.querySelector(t):t)));return e?e.element:null}static autoInit(){window.$hsStrongPasswordCollection||(window.$hsStrongPasswordCollection=[]),document.querySelectorAll("[data-hs-strong-password]:not(.--prevent-on-load-init)").forEach((t=>{if(!window.$hsStrongPasswordCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))){const e=t.getAttribute("data-hs-strong-password"),i=e?JSON.parse(e):{};new o(t,i)}}))}}window.addEventListener("load",(()=>{o.autoInit()})),document.addEventListener("scroll",(()=>{if(!window.$hsStrongPasswordCollection)return!1;const t=window.$hsStrongPasswordCollection.find((t=>t.element.isOpened));t&&t.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSStrongPassword=o);const l=o},728:(t,e,i)=>{i.d(e,{A:()=>a});var s=i(926),n=i(615),o=i(189); +/* + * HSTabs + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class l extends n.A{constructor(t,e,i){super(t,e,i),this.toggles=this.el.querySelectorAll("[data-hs-tab]"),this.extraToggleId=this.el.getAttribute("data-hs-tab-select"),this.extraToggle=document.querySelector(this.extraToggleId),this.current=Array.from(this.toggles).find((t=>t.classList.contains("active"))),this.currentContentId=this.current.getAttribute("data-hs-tab"),this.currentContent=document.querySelector(this.currentContentId),this.prev=null,this.prevContentId=null,this.prevContent=null,this.init()}init(){this.createCollection(window.$hsTabsCollection,this),this.toggles.forEach((t=>{t.addEventListener("click",(()=>this.open(t)))})),this.extraToggle&&this.extraToggle.addEventListener("change",(t=>this.change(t)))}open(t){var e,i;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),(null===(e=null==this?void 0:this.prev)||void 0===e?void 0:e.ariaSelected)&&(this.prev.ariaSelected="false"),this.prev.classList.remove("active"),this.prevContent.classList.add("hidden"),(null===(i=null==this?void 0:this.current)||void 0===i?void 0:i.ariaSelected)&&(this.current.ariaSelected="true"),this.current.classList.add("active"),this.currentContent.classList.remove("hidden"),this.fireEvent("change",{el:t,prev:this.prevContentId,current:this.currentContentId}),(0,s.JD)("change.hs.tab",t,{el:t,prev:this.prevContentId,current:this.currentContentId})}change(t){const e=document.querySelector(`[data-hs-tab="${t.target.value}"]`);e&&e.click()}static getInstance(t,e){const i=window.$hsTabsCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element:null}static autoInit(){window.$hsTabsCollection||(window.$hsTabsCollection=[]),document.querySelectorAll('[role="tablist"]:not(select):not(.--prevent-on-load-init)').forEach((t=>{window.$hsTabsCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new l(t)})),window.$hsTabsCollection&&document.addEventListener("keydown",(t=>l.accessibility(t)))}static open(t){const e=window.$hsTabsCollection.find((e=>Array.from(e.element.toggles).includes("string"==typeof t?document.querySelector(t):t))),i=Array.from(e.element.toggles).find((e=>e===("string"==typeof t?document.querySelector(t):t)));i&&!i.classList.contains("active")&&e.element.open(i)}static accessibility(t){const e=document.querySelector("[data-hs-tab]:focus");if(e&&o.Fy.includes(t.code)&&!t.metaKey){const i=e.closest('[role="tablist"]').getAttribute("data-hs-tabs-vertical");switch(t.preventDefault(),t.code){case"true"===i?"ArrowUp":"ArrowLeft":this.onArrow();break;case"true"===i?"ArrowDown":"ArrowRight":this.onArrow(!1);break;case"Home":this.onStartEnd();break;case"End":this.onStartEnd(!1)}}}static onArrow(t=!0){const e=document.querySelector("[data-hs-tab]:focus").closest('[role="tablist"]'),i=window.$hsTabsCollection.find((t=>t.element.el===e));if(i){const e=t?Array.from(i.element.toggles).reverse():Array.from(i.element.toggles),s=e.find((t=>document.activeElement===t));let n=e.findIndex((t=>t===s));n=n+1t.element.el===e));if(i){const e=t?Array.from(i.element.toggles):Array.from(i.element.toggles).reverse();e.length&&(e[0].focus(),e[0].click())}}static on(t,e,i){const s=window.$hsTabsCollection.find((t=>Array.from(t.element.toggles).includes("string"==typeof e?document.querySelector(e):e)));s&&(s.element.events[t]=i)}}window.addEventListener("load",(()=>{l.autoInit()})),"undefined"!=typeof window&&(window.HSTabs=l);const a=l},830:(t,e,i)=>{i.d(e,{A:()=>o});var s=i(615); +/* + * HSTextareaAutoHeight + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */class n extends s.A{constructor(t,e){super(t,e);const i=t.getAttribute("data-hs-copy-markup"),s=i?JSON.parse(i):{},n=Object.assign(Object.assign({},s),e);this.defaultHeight=(null==n?void 0:n.defaultHeight)||0,this.init()}init(){this.createCollection(window.$hsTextareaAutoHeightCollection,this),this.setAutoHeight()}setAutoHeight(){this.isParentHidden()?this.callbackAccordingToType():this.textareaSetHeight(3),this.el.addEventListener("input",(()=>this.textareaSetHeight(3)))}textareaSetHeight(t=0){this.el.style.height="auto",this.el.style.height=this.checkIfOneLine()&&this.defaultHeight?`${this.defaultHeight}px`:`${this.el.scrollHeight+t}px`}checkIfOneLine(){const t=this.el.clientHeight;return!(this.el.scrollHeight>t)}isParentHidden(){return this.el.closest(".hs-collapse")||this.el.closest(".hs-overlay")}parentType(){return this.el.closest(".hs-collapse")?"collapse":!!this.el.closest(".hs-overlay")&&"overlay"}callbackAccordingToType(){if("collapse"===this.parentType()){const t=this.el.closest(".hs-collapse").id,{element:e}=window.HSCollapse.getInstance(`[data-hs-collapse="#${t}"]`,!0);e.on("beforeOpen",(()=>{if(!this.el)return!1;this.textareaSetHeight(3)}))}else{if("overlay"!==this.parentType())return!1;{const{element:t}=window.HSOverlay.getInstance(this.el.closest(".hs-overlay"),!0);t.on("open",(()=>{if(!this.el)return!1;this.textareaSetHeight(3)}))}}}static getInstance(t,e){const i=window.$hsTextareaAutoHeightCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element:null}static autoInit(){window.$hsTextareaAutoHeightCollection||(window.$hsTextareaAutoHeightCollection=[]),document.querySelectorAll("[data-hs-textarea-auto-height]:not(.--prevent-on-load-init)").forEach((t=>{if(!window.$hsTextareaAutoHeightCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))){const e=t.getAttribute("data-hs-textarea-auto-height"),i=e?JSON.parse(e):{};new n(t,i)}}))}}window.addEventListener("load",(()=>{n.autoInit()})),"undefined"!=typeof window&&(window.HSTextareaAutoHeight=n);const o=n},52:(t,e,i)=>{i.d(e,{A:()=>o});var s=i(615);class n extends s.A{constructor(t,e){super(t,e);const i=t.getAttribute("data-hs-theme-switch"),s=i?JSON.parse(i):{},n=Object.assign(Object.assign({},s),e);this.theme=(null==n?void 0:n.theme)||localStorage.getItem("hs_theme")||"default",this.themeSet=["light","dark","default"],this.init()}init(){this.createCollection(window.$hsThemeSwitchCollection,this),"default"!==this.theme&&this.setAppearance()}setResetStyles(){const t=document.createElement("style");return t.innerText="*{transition: unset !important;}",t.setAttribute("data-hs-appearance-onload-styles",""),document.head.appendChild(t),t}addSystemThemeObserver(){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(({matches:t})=>{t?this.setAppearance("dark",!1):this.setAppearance("default",!1)}))}removeSystemThemeObserver(){window.matchMedia("(prefers-color-scheme: dark)").removeEventListener}setAppearance(t=this.theme,e=!0,i=!0){const s=document.querySelector("html"),n=this.setResetStyles();e&&localStorage.setItem("hs_theme",t),"auto"===t&&(t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"default"),s.classList.remove("light","dark","default","auto"),s.classList.add(t),setTimeout((()=>n.remove())),i&&window.dispatchEvent(new CustomEvent("on-hs-appearance-change",{detail:t}))}static getInstance(t){const e=window.$hsThemeSwitchCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return e?e.element:null}static autoInit(){window.$hsThemeSwitchCollection||(window.$hsThemeSwitchCollection=[]);const t=t=>{"auto"===localStorage.getItem("hs_theme")?t.addSystemThemeObserver():t.removeSystemThemeObserver()};document.querySelectorAll("[data-hs-theme-switch]:not(.--prevent-on-load-init)").forEach((e=>{if(!window.$hsThemeSwitchCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))){const i=new n(e);i.el.checked="dark"===i.theme,t(i),i.el.addEventListener("change",(e=>{const s=e.target.checked?"dark":"default";i.setAppearance(s),t(i)}))}})),document.querySelectorAll("[data-hs-theme-click-value]:not(.--prevent-on-load-init)").forEach((e=>{const i=e.getAttribute("data-hs-theme-click-value"),s=new n(e);t(s),s.el.addEventListener("click",(()=>{s.setAppearance(i),t(s)}))}))}}window.addEventListener("load",(()=>{n.autoInit()})),window.$hsThemeSwitchCollection&&window.addEventListener("on-hs-appearance-change",(t=>{window.$hsThemeSwitchCollection.forEach((e=>{e.element.el.checked="dark"===t.detail}))})),"undefined"!=typeof window&&(window.HSThemeSwitch=n);const o=n},246:(t,e,i)=>{i.d(e,{A:()=>o});var s=i(615); +/* + * HSToggleCount + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */class n extends s.A{constructor(t,e){super(t,e);const i=t.getAttribute("data-hs-toggle-count"),s=i?JSON.parse(i):{},n=Object.assign(Object.assign({},s),e);this.target=(null==n?void 0:n.target)?"string"==typeof(null==n?void 0:n.target)?document.querySelector(n.target):n.target:null,this.min=(null==n?void 0:n.min)||0,this.max=(null==n?void 0:n.max)||0,this.duration=(null==n?void 0:n.duration)||700,this.isChecked=this.target.checked||!1,this.target&&this.init()}init(){this.createCollection(window.$hsToggleCountCollection,this),this.isChecked&&(this.el.innerText=String(this.max)),this.target.addEventListener("change",(()=>{this.isChecked=!this.isChecked,this.toggle()}))}toggle(){this.isChecked?this.countUp():this.countDown()}animate(t,e){let i=0;const s=n=>{i||(i=n);const o=Math.min((n-i)/this.duration,1);this.el.innerText=String(Math.floor(o*(e-t)+t)),o<1&&window.requestAnimationFrame(s)};window.requestAnimationFrame(s)}countUp(){this.animate(this.min,this.max)}countDown(){this.animate(this.max,this.min)}static getInstance(t,e){const i=window.$hsToggleCountCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element:null}static autoInit(){window.$hsToggleCountCollection||(window.$hsToggleCountCollection=[]),document.querySelectorAll("[data-hs-toggle-count]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsToggleCountCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new n(t)}))}}window.addEventListener("load",(()=>{n.autoInit()})),"undefined"!=typeof window&&(window.HSToggleCount=n);const o=n},730:(t,e,i)=>{i.d(e,{A:()=>l});var s=i(926),n=i(615); +/* + * HSTogglePassword + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class o extends n.A{constructor(t,e){super(t,e);const i=t.getAttribute("data-hs-toggle-password"),n=i?JSON.parse(i):{},o=Object.assign(Object.assign({},n),e),l=[];if((null==o?void 0:o.target)&&"string"==typeof(null==o?void 0:o.target)){(null==o?void 0:o.target.split(",")).forEach((t=>{l.push(document.querySelector(t))}))}else(null==o?void 0:o.target)&&"object"==typeof(null==o?void 0:o.target)?o.target.forEach((t=>l.push(document.querySelector(t)))):o.target.forEach((t=>l.push(t)));this.target=l,this.isShown=!!this.el.hasAttribute("type")&&this.el.checked,this.eventType=(0,s.V6)(this.el)?"change":"click",this.isMultiple=this.target.length>1&&!!this.el.closest("[data-hs-toggle-password-group]"),this.target&&this.init()}init(){this.createCollection(window.$hsTogglePasswordCollection,this),this.isShown?this.show():this.hide(),this.el.addEventListener(this.eventType,(()=>{this.isShown?this.hide():this.show(),this.fireEvent("toggle",this.target),(0,s.JD)("toggle.hs.toggle-select",this.el,this.target)}))}getMultipleToggles(){const t=this.el.closest("[data-hs-toggle-password-group]").querySelectorAll("[data-hs-toggle-password]"),e=[];return t.forEach((t=>{e.push(o.getInstance(t))})),e}show(){if(this.isMultiple){this.getMultipleToggles().forEach((t=>!!t&&(t.isShown=!0))),this.el.closest("[data-hs-toggle-password-group]").classList.add("active")}else this.isShown=!0,this.el.classList.add("active");this.target.forEach((t=>{t.type="text"}))}hide(){if(this.isMultiple){this.getMultipleToggles().forEach((t=>!!t&&(t.isShown=!1))),this.el.closest("[data-hs-toggle-password-group]").classList.remove("active")}else this.isShown=!1,this.el.classList.remove("active");this.target.forEach((t=>{t.type="password"}))}static getInstance(t,e){const i=window.$hsTogglePasswordCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element:null}static autoInit(){window.$hsTogglePasswordCollection||(window.$hsTogglePasswordCollection=[]),document.querySelectorAll("[data-hs-toggle-password]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsTogglePasswordCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new o(t)}))}}window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=o);const l=o},711:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(316),n=i(926),o=i(615),l=i(189); +/* + * HSTooltip + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class a extends o.A{constructor(t,e,i){super(t,e,i),this.el&&(this.toggle=this.el.querySelector(".hs-tooltip-toggle")||this.el,this.content=this.el.querySelector(".hs-tooltip-content"),this.eventMode=(0,n.gj)(this.el,"--trigger")||"hover",this.preventPopper=(0,n.gj)(this.el,"--prevent-popper","false"),this.placement=(0,n.gj)(this.el,"--placement"),this.strategy=(0,n.gj)(this.el,"--strategy")),this.el&&this.toggle&&this.content&&this.init()}init(){this.createCollection(window.$hsTooltipCollection,this),"click"===this.eventMode?this.toggle.addEventListener("click",(()=>this.click())):"focus"===this.eventMode?this.toggle.addEventListener("click",(()=>this.focus())):"hover"===this.eventMode&&(this.toggle.addEventListener("mouseenter",(()=>this.enter())),this.toggle.addEventListener("mouseleave",(()=>this.leave()))),"false"===this.preventPopper&&this.buildPopper()}enter(){this.show()}leave(){this.hide()}click(){if(this.el.classList.contains("show"))return!1;this.show();const t=()=>{setTimeout((()=>{this.hide(),this.toggle.removeEventListener("click",t,!0),this.toggle.removeEventListener("blur",t,!0)}))};this.toggle.addEventListener("click",t,!0),this.toggle.addEventListener("blur",t,!0)}focus(){this.show();const t=()=>{this.hide(),this.toggle.removeEventListener("blur",t,!0)};this.toggle.addEventListener("blur",t,!0)}buildPopper(){this.popperInstance=(0,s.n4)(this.toggle,this.content,{placement:l.lP[this.placement]||"top",strategy:this.strategy||"fixed",modifiers:[{name:"offset",options:{offset:[0,5]}}]})}show(){this.content.classList.remove("hidden"),"false"===this.preventPopper&&(this.popperInstance.setOptions((t=>Object.assign(Object.assign({},t),{modifiers:[...t.modifiers,{name:"eventListeners",enabled:!0}]}))),this.popperInstance.update()),setTimeout((()=>{this.el.classList.add("show"),this.fireEvent("show",this.el),(0,n.JD)("show.hs.tooltip",this.el,this.el)}))}hide(){this.el.classList.remove("show"),"false"===this.preventPopper&&this.popperInstance.setOptions((t=>Object.assign(Object.assign({},t),{modifiers:[...t.modifiers,{name:"eventListeners",enabled:!1}]}))),this.fireEvent("hide",this.el),(0,n.JD)("hide.hs.tooltip",this.el,this.el),(0,n.yd)(this.content,(()=>{if(this.el.classList.contains("show"))return!1;this.content.classList.add("hidden")}))}static getInstance(t,e=!1){const i=window.$hsTooltipCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element.el:null}static autoInit(){window.$hsTooltipCollection||(window.$hsTooltipCollection=[]),document.querySelectorAll(".hs-tooltip").forEach((t=>{window.$hsTooltipCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new a(t)}))}static show(t){const e=window.$hsTooltipCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));if(e)switch(e.element.eventMode){case"click":e.element.click();break;case"focus":e.element.focus();break;default:e.element.enter()}}static hide(t){const e=window.$hsTooltipCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));e&&e.element.hide()}static on(t,e,i){const s=window.$hsTooltipCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));s&&(s.element.events[t]=i)}}window.addEventListener("load",(()=>{a.autoInit()})),"undefined"!=typeof window&&(window.HSTooltip=a);const r=a},230:(t,e,i)=>{i.d(e,{A:()=>l});var s=i(926),n=i(615); +/* + * HSTreeView + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class o extends n.A{constructor(t,e,i){super(t,e,i),this.items=[];const s=t.getAttribute("data-hs-tree-view"),n=s?JSON.parse(s):{},o=Object.assign(Object.assign({},n),e);this.controlBy=(null==o?void 0:o.controlBy)||"button",this.autoSelectChildren=(null==o?void 0:o.autoSelectChildren)||!1,this.isIndeterminate=(null==o?void 0:o.isIndeterminate)||!0,this.init()}init(){this.createCollection(window.$hsTreeViewCollection,this),o.group+=1,this.initItems()}initItems(){this.el.querySelectorAll("[data-hs-tree-view-item]").forEach(((t,e)=>{var i,s;const n=JSON.parse(t.getAttribute("data-hs-tree-view-item"));t.id||(t.id=`tree-view-item-${o.group}-${e}`);const l=Object.assign(Object.assign({},n),{id:null!==(i=n.id)&&void 0!==i?i:t.id,path:this.getPath(t),isSelected:null!==(s=n.isSelected)&&void 0!==s&&s});this.items.push(l),"checkbox"===this.controlBy?this.controlByCheckbox(t,l):this.controlByButton(t,l)}))}controlByButton(t,e){t.addEventListener("click",(i=>{if(i.stopPropagation(),t.classList.contains("disabled"))return!1;i.metaKey||i.shiftKey||this.unselectItem(e),this.selectItem(t,e),this.fireEvent("click",{el:t,data:e}),(0,s.JD)("click.hs.treeView",this.el,{el:t,data:e})}))}controlByCheckbox(t,e){const i=t.querySelector(`input[value="${e.value}"]`);i&&i.addEventListener("change",(()=>{this.autoSelectChildren?(this.selectItem(t,e),e.isDir&&this.selectChildren(t,e),this.toggleParent(t)):this.selectItem(t,e)}))}getItem(t){return this.items.find((e=>e.id===t))}getPath(t){var e;const i=[];let s=t.closest("[data-hs-tree-view-item]");for(;s;){const t=JSON.parse(s.getAttribute("data-hs-tree-view-item"));i.push(t.value),s=null===(e=s.parentElement)||void 0===e?void 0:e.closest("[data-hs-tree-view-item]")}return i.reverse().join("/")}unselectItem(t=null){let e=this.getSelectedItems();t&&(e=e.filter((e=>e.id!==t.id))),e.length&&e.forEach((t=>{document.querySelector(`#${t.id}`).classList.remove("selected"),this.changeItemProp(t.id,"isSelected",!1)}))}selectItem(t,e){e.isSelected?(t.classList.remove("selected"),this.changeItemProp(e.id,"isSelected",!1)):(t.classList.add("selected"),this.changeItemProp(e.id,"isSelected",!0))}selectChildren(t,e){const i=t.querySelectorAll("[data-hs-tree-view-item]");Array.from(i).filter((t=>!t.classList.contains("disabled"))).forEach((t=>{const i=t.id?this.getItem(t.id):null;if(!i)return!1;e.isSelected?(t.classList.add("selected"),this.changeItemProp(i.id,"isSelected",!0)):(t.classList.remove("selected"),this.changeItemProp(i.id,"isSelected",!1));const s=this.getItem(t.id),n=t.querySelector(`input[value="${s.value}"]`);this.isIndeterminate&&(n.indeterminate=!1),s.isSelected?n.checked=!0:n.checked=!1}))}toggleParent(t){var e,i;let s=null===(e=t.parentElement)||void 0===e?void 0:e.closest("[data-hs-tree-view-item]");for(;s;){const t=s.querySelectorAll("[data-hs-tree-view-item]:not(.disabled)"),e=JSON.parse(s.getAttribute("data-hs-tree-view-item")),n=s.querySelector(`input[value="${e.value}"]`);let o=!1,l=0;t.forEach((t=>{const e=this.getItem(t.id);e.isSelected&&(l+=1),e.isSelected||(o=!0)})),o?(s.classList.remove("selected"),this.changeItemProp(s.id,"isSelected",!1),n.checked=!1):(s.classList.add("selected"),this.changeItemProp(s.id,"isSelected",!0),n.checked=!0),this.isIndeterminate&&(l>0&&l{const e=document.querySelector(`#${t.id}`);return t.path!==this.getPath(e)&&(t.path=this.getPath(e)),t}))}getSelectedItems(){return this.items.filter((t=>t.isSelected))}changeItemProp(t,e,i){this.items.map((s=>(s.id===t&&(s[e]=i),s)))}static getInstance(t,e){const i=window.$hsTreeViewCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element.el:null}static autoInit(){window.$hsTreeViewCollection||(window.$hsTreeViewCollection=[]),document.querySelectorAll("[data-hs-tree-view]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsTreeViewCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new o(t)}))}static on(t,e,i){const s=window.$hsTreeViewCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));s&&(s.element.events[t]=i)}}o.group=0,window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSTreeView=o);const l=o},926:(t,e,i)=>{i.d(e,{BF:()=>o,IM:()=>f,JD:()=>p,PK:()=>s,PR:()=>d,V6:()=>h,en:()=>v,fc:()=>g,gj:()=>n,sH:()=>c,sg:()=>u,un:()=>l,wC:()=>r,yd:()=>m,zG:()=>a}); +/* + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +const s=t=>"true"===t,n=(t,e,i="")=>(window.getComputedStyle(t).getPropertyValue(e)||i).replace(" ",""),o=(t,e,i="")=>{let s="";return t.classList.forEach((t=>{t.includes(e)&&(s=t)})),s.match(/:(.*)]/)?s.match(/:(.*)]/)[1]:i};const l=()=>!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),a=()=>navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),r=(t,e)=>{const i=t.children;for(let t=0;t{const o=e.getBoundingClientRect(),l=n?n.getBoundingClientRect():null,a=window.innerHeight,r=l?o.top-l.top:o.top,d=(n?l.bottom:a)-o.bottom,h=t.clientHeight+s;return"bottom"===i?d>=h:"top"===i?r>=h:r>=h||d>=h},h=t=>t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement,c=t=>{if(!t)return!1;return"none"===window.getComputedStyle(t).display||c(t.parentElement)},u=(t,e=200)=>{let i;return(...s)=>{clearTimeout(i),i=setTimeout((()=>{t.apply(void 0,s)}),e)}},p=(t,e,i=null)=>{const s=new CustomEvent(t,{detail:{payload:i},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(s)},m=(t,e)=>{const i=()=>{e(),t.removeEventListener("transitionend",i,!0)},s=window.getComputedStyle(t),n=s.getPropertyValue("transition-duration");"none"!==s.getPropertyValue("transition-property")&&parseFloat(n)>0?t.addEventListener("transitionend",i,!0):e()},g=t=>{const e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild},v=(t,e,i=" ",s="add")=>{t.split(i).forEach((t=>"add"===s?e.classList.add(t):e.classList.remove(t)))},f={historyIndex:-1,addHistory(t){this.historyIndex=t},existsInHistory(t){return t>this.historyIndex},clearHistory(){this.historyIndex=-1}}}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var o=e[s]={exports:{}};return t[s](o,o.exports,i),o.exports}i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var s={};i.d(s,{ax:()=>o.A,Wl:()=>l.A,Zr:()=>a.A,HA:()=>r.A,r$:()=>n.A,Af:()=>P,ZK:()=>d.A,jM:()=>D,DH:()=>h.A,wX:()=>c.A,Pd:()=>u.A,cf:()=>q,Sy:()=>p.A,hO:()=>m.A,g5:()=>g.A,KC:()=>$,jv:()=>v.A,cU:()=>f.A,S6:()=>y.A,Cv:()=>w.A,Vy:()=>b.A,Lq:()=>C.A,zx:()=>S.A,pX:()=>x.A,$h:()=>I.A});var n=i(588),o=i(290),l=i(238),a=i(883),r=i(459),d=i(249),h=i(542),c=i(252),u=i(698),p=i(89),m=i(817),g=i(236),v=i(797),f=i(319),y=i(728),w=i(830),b=i(52),C=i(246),S=i(730),x=i(711),I=i(230),A=i(926),L=i(784),T=i(872),E=i(161); +/* + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +const k=[{key:"copy-markup",fn:n.A,collection:"$hsCopyMarkupCollection"},{key:"accordion",fn:o.A,collection:"$hsAccordionCollection"},{key:"carousel",fn:l.A,collection:"$hsCarouselCollection"},{key:"collapse",fn:a.A,collection:"$hsCollapseCollection"},{key:"combobox",fn:r.A,collection:"$hsComboBoxCollection"},{key:"datatable",fn:L.A,collection:"$hsDataTableCollection"},{key:"dropdown",fn:d.A,collection:"$hsDropdownCollection"},{key:"file-upload",fn:T.A,collection:"$hsFileUploadCollection"},{key:"input-number",fn:h.A,collection:"$hsInputNumberCollection"},{key:"overlay",fn:c.A,collection:"$hsOverlayCollection"},{key:"pin-input",fn:u.A,collection:"$hsPinInputCollection"},{key:"range-slider",fn:E.A,collection:"$hsRangeSliderCollection"},{key:"remove-element",fn:p.A,collection:"$hsRemoveElementCollection"},{key:"scrollspy",fn:m.A,collection:"$hsScrollspyCollection"},{key:"select",fn:g.A,collection:"$hsSelectCollection"},{key:"stepper",fn:v.A,collection:"$hsStepperCollection"},{key:"strong-password",fn:f.A,collection:"$hsStrongPasswordCollection"},{key:"tabs",fn:y.A,collection:"$hsTabsCollection"},{key:"textarea-auto-height",fn:w.A,collection:"$hsTextareaAutoHeightCollection"},{key:"theme-switch",fn:b.A,collection:"$hsThemeSwitchCollection"},{key:"toggle-count",fn:C.A,collection:"$hsToggleCountCollection"},{key:"toggle-password",fn:S.A,collection:"$hsTogglePasswordCollection"},{key:"tooltip",fn:x.A,collection:"$hsTooltipCollection"},{key:"tree-view",fn:I.A,collection:"$hsTreeViewCollection"}],O={getClassProperty:A.gj,afterTransition:A.yd,autoInit(t="all"){"all"===t?k.forEach((({fn:t})=>{null==t||t.autoInit()})):k.forEach((({key:e,fn:i})=>{t.includes(e)&&(null==i||i.autoInit())}))},cleanCollection(t="all"){"all"===t?k.forEach((({collection:t})=>{window[t]instanceof Array&&(window[t]=[])})):k.forEach((({key:e,collection:i})=>{t.includes(e)&&window[i]instanceof Array&&(window[i]=[])}))}};"undefined"!=typeof window&&(window.HSStaticMethods=O);const $=O; +/* + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +let P,D,q;P="undefined"!=typeof DataTable&&"undefined"!=typeof jQuery?i(784).A:null,D="undefined"!=typeof _&&"undefined"!=typeof Dropzone?i(872).A:null,q=void 0!==typeof noUiSlider?i(161).A:null;var B=s.ax,H=s.Wl,N=s.Zr,M=s.HA,V=s.r$,R=s.Af,F=s.ZK,j=s.jM,W=s.DH,U=s.wX,z=s.Pd,J=s.cf,Q=s.Sy,X=s.hO,Z=s.g5,G=s.KC,K=s.jv,Y=s.cU,tt=s.S6,et=s.Cv,it=s.Vy,st=s.Lq,nt=s.zx,ot=s.pX,lt=s.$h;export{B as HSAccordion,H as HSCarousel,N as HSCollapse,M as HSComboBox,V as HSCopyMarkup,R as HSDataTable,F as HSDropdown,j as HSFileUpload,W as HSInputNumber,U as HSOverlay,z as HSPinInput,J as HSRangeSlider,Q as HSRemoveElement,X as HSScrollspy,Z as HSSelect,G as HSStaticMethods,K as HSStepper,Y as HSStrongPassword,tt as HSTabs,et as HSTextareaAutoHeight,it as HSThemeSwitch,st as HSToggleCount,nt as HSTogglePassword,ot as HSTooltip,lt as HSTreeView}; \ No newline at end of file diff --git a/dist/input-number.js b/dist/input-number.js index 14b7273..4b6d233 100644 --- a/dist/input-number.js +++ b/dist/input-number.js @@ -1,17 +1,16 @@ -!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={961:(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 i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(self,(()=>(()=>{"use strict";var t={961:(t,e)=>{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},332:function(t,e,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSInputNumber + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},332:function(t,e,n){ +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)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0?u.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.checkIsNumberAndConvert=function(){var t=this.input.value.trim(),e=this.cleanAndExtractNumber(t);null!==e?(this.inputValue=e,this.input.value=e.toString()):(this.inputValue=0,this.input.value="0")},e.prototype.cleanAndExtractNumber=function(t){var e=[],n=!1;t.split("").forEach((function(t){t>="0"&&t<="9"?e.push(t):"."!==t||n||(e.push(t),n=!0)}));var i=e.join(""),r=parseFloat(i);return isNaN(r)?null:r},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,o=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 s=this.inputValue+this.step;this.inputValue=s>=r&&s<=o?s:o,this.input.value=this.inputValue.toString();break;case"decrement":var a=this.inputValue-this.step;this.inputValue=a>=r&&a<=o?a:r,this.input.value=this.inputValue.toString();break;default:var l=isNaN(parseInt(this.input.value))?0:parseInt(this.input.value);this.inputValue=l>=o?o: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===o?(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,u.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=a),e.default=a},292:function(t,e){ /* - * HSInputNumber - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0?u.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.checkIsNumberAndConvert=function(){var t=this.input.value.trim(),e=this.cleanAndExtractNumber(t);null!==e?(this.inputValue=e,this.input.value=e.toString()):(this.inputValue=0,this.input.value="0")},e.prototype.cleanAndExtractNumber=function(t){var e=[],n=!1;t.split("").forEach((function(t){t>="0"&&t<="9"?e.push(t):"."!==t||n||(e.push(t),n=!0)}));var i=e.join(""),r=parseFloat(i);return isNaN(r)?null:r},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,o=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 s=this.inputValue+this.step;this.inputValue=s>=r&&s<=o?s:o,this.input.value=this.inputValue.toString();break;case"decrement":var a=this.inputValue-this.step;this.inputValue=a>=r&&a<=o?a:r,this.input.value=this.inputValue.toString();break;default:var l=isNaN(parseInt(this.input.value))?0:parseInt(this.input.value);this.inputValue=l>=o?o: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===o?(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,u.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=a),e.default=a},292: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.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=i(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var i=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=i;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 o=e.getBoundingClientRect(),s=r?r.getBoundingClientRect():null,u=window.innerHeight,a=s?o.top-s.top:o.top,l=(r?s.bottom:u)-o.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 r=function(t){return!!t&&("none"===window.getComputedStyle(t).display||r(t.parentElement))};e.isParentOrElementHidden=r;e.debounce=function(t,e){var i;return void 0===e&&(e=200),function(){for(var r=[],o=0;o0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,i){void 0===n&&(n=" "),void 0===i&&(i="add"),t.split(n).forEach((function(t){return"add"===i?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}(332);return n})())); \ No newline at end of file +var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=i(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var i=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=i;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.isDirectChild=function(t,e){for(var n=t.children,i=0;i=c:"top"===n?a>=c:a>=c||l>=c};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var r=function(t){return!!t&&("none"===window.getComputedStyle(t).display||r(t.parentElement))};e.isParentOrElementHidden=r;e.debounce=function(t,e){var i;return void 0===e&&(e=200),function(){for(var r=[],o=0;o0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,i){void 0===n&&(n=" "),void 0===i&&(i="add"),t.split(n).forEach((function(t){return"add"===i?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var n=function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}(332);return n})())); \ No newline at end of file diff --git a/dist/input-number.mjs b/dist/input-number.mjs new file mode 100644 index 0000000..670ba5b --- /dev/null +++ b/dist/input-number.mjs @@ -0,0 +1,9 @@ +var t={615:(t,e,i)=>{i.d(e,{A:()=>n});class n{constructor(t,e,i){this.el=t,this.options=e,this.events=i,this.el=t,this.options=e,this.events={}}createCollection(t,e){var i;t.push({id:(null===(i=null==e?void 0:e.el)||void 0===i?void 0:i.id)||t.length+1,element:e})}fireEvent(t,e=null){if(this.events.hasOwnProperty(t))return this.events[t](e)}on(t,e){this.events[t]=e}}},926:(t,e,i)=>{i.d(e,{JD:()=>n});const n=(t,e,i=null)=>{const n=new CustomEvent(t,{detail:{payload:i},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(n)}}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,i),a.exports}i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};i.d(n,{A:()=>l});var s=i(926),a=i(615); +/* + * HSInputNumber + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class u extends a.A{constructor(t,e){super(t,e),this.input=this.el.querySelector("[data-hs-input-number-input]")||null,this.increment=this.el.querySelector("[data-hs-input-number-increment]")||null,this.decrement=this.el.querySelector("[data-hs-input-number-decrement]")||null,this.input&&this.checkIsNumberAndConvert();const i=this.el.dataset.hsInputNumber,n=i?JSON.parse(i):{step:1},s=Object.assign(Object.assign({},n),e);this.minInputValue="min"in s?s.min:0,this.maxInputValue="max"in s?s.max:null,this.step="step"in s&&s.step>0?s.step:1,this.init()}init(){this.createCollection(window.$hsInputNumberCollection,this),this.input&&this.increment&&this.build()}checkIsNumberAndConvert(){const t=this.input.value.trim(),e=this.cleanAndExtractNumber(t);null!==e?(this.inputValue=e,this.input.value=e.toString()):(this.inputValue=0,this.input.value="0")}cleanAndExtractNumber(t){const e=[];let i=!1;t.split("").forEach((t=>{t>="0"&&t<="9"?e.push(t):"."!==t||i||(e.push(t),i=!0)}));const n=e.join(""),s=parseFloat(n);return isNaN(s)?null:s}build(){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()}buildInput(){this.input.addEventListener("input",(()=>this.changeValue()))}buildIncrement(){this.increment.addEventListener("click",(()=>{this.changeValue("increment")}))}buildDecrement(){this.decrement.addEventListener("click",(()=>{this.changeValue("decrement")}))}changeValue(t="none"){var e,i;const n={inputValue:this.inputValue},a=null!==(e=this.minInputValue)&&void 0!==e?e:Number.MIN_SAFE_INTEGER,u=null!==(i=this.maxInputValue)&&void 0!==i?i:Number.MAX_SAFE_INTEGER;switch(this.inputValue=isNaN(this.inputValue)?0:this.inputValue,t){case"increment":const t=this.inputValue+this.step;this.inputValue=t>=a&&t<=u?t:u,this.input.value=this.inputValue.toString();break;case"decrement":const e=this.inputValue-this.step;this.inputValue=e>=a&&e<=u?e:a,this.input.value=this.inputValue.toString();break;default:const i=isNaN(parseInt(this.input.value))?0:parseInt(this.input.value);this.inputValue=i>=u?u:i<=a?a:i,this.inputValue<=a&&(this.input.value=this.inputValue.toString())}n.inputValue=this.inputValue,this.inputValue===a?(this.el.classList.add("disabled"),this.decrement&&this.disableButtons("decrement")):(this.el.classList.remove("disabled"),this.decrement&&this.enableButtons("decrement")),this.inputValue===u?(this.el.classList.add("disabled"),this.increment&&this.disableButtons("increment")):(this.el.classList.remove("disabled"),this.increment&&this.enableButtons("increment")),this.fireEvent("change",n),(0,s.JD)("change.hs.inputNumber",this.el,n)}disableButtons(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"))}enableButtons(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"))}static getInstance(t,e){const i=window.$hsInputNumberCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element:null}static autoInit(){window.$hsInputNumberCollection||(window.$hsInputNumberCollection=[]),document.querySelectorAll("[data-hs-input-number]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsInputNumberCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new u(t)}))}}window.addEventListener("load",(()=>{u.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=u);const l=u;var r=n.A;export{r as default}; \ No newline at end of file diff --git a/dist/overlay.d.ts b/dist/overlay.d.ts index 5290625..e74955b 100644 --- a/dist/overlay.d.ts +++ b/dist/overlay.d.ts @@ -22,6 +22,7 @@ export interface IOverlayOptions { isClosePrev?: boolean; backdropClasses?: string | null; backdropExtraClasses?: string | null; + moveOverlayToBody?: number | null; } export interface IOverlay { options?: IOverlayOptions; @@ -39,6 +40,7 @@ declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private autoHide; private readonly overlayId; overlay: HTMLElement | null; + initContainer: HTMLElement | null; isCloseWhenClickInside: boolean; isTabAccessibilityLimited: boolean; isLayoutAffect: boolean; @@ -46,6 +48,7 @@ declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { hasAbilityToCloseOnBackdropClick: boolean; openedBreakpoint: number | null; autoClose: number | null; + moveOverlayToBody: number | null; constructor(el: HTMLElement, options?: IOverlayOptions, events?: {}); private init; private hideAuto; diff --git a/dist/overlay.js b/dist/overlay.js index 9ce3951..0595b24 100644 --- a/dist/overlay.js +++ b/dist/overlay.js @@ -1,17 +1,16 @@ -!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={223:(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}},961:(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={223:(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={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},961:(e,t)=>{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},850:function(e,t,o){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSOverlay + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},850:function(e,t,o){ +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"])'),l=[];(null==i?void 0:i.length)&&i.forEach((function(e){(0,a.isParentOrElementHidden)(e)||l.push(e)}));var s=r&&!e.metaKey;if(s&&!r.element.isTabAccessibilityLimited&&"Tab"===e.code)return!1;s&&l.length&&"Tab"===e.code&&(e.preventDefault(),this.onTab(r,l)),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}(l(o(961)).default),d=function(){if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((function(e){return e.element.moveOverlayToBody})))return!1;window.$hsOverlayCollection.filter((function(e){return e.element.moveOverlayToBody})).forEach((function(e){var t=e.element.moveOverlayToBody,o=e.element.initContainer,n=document.querySelector("body"),r=e.element.overlay;if(!o&&r)return!1;document.body.clientWidth<=t&&!(0,a.isDirectChild)(n,r)?n.appendChild(r):document.body.clientWidth>t&&!o.contains(r)&&o.appendChild(r)}))};window.addEventListener("load",(function(){c.autoInit(),d()})),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)}))}(),d(),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.overlay.classList.contains("opened")})))return!1;window.$hsOverlayCollection.filter((function(e){return e.element.overlay.classList.contains("opened")})).forEach((function(e){var t=parseInt(window.getComputedStyle(e.element.overlay).getPropertyValue("z-index")),o=document.querySelector("#".concat(e.element.overlay.id,"-backdrop"));if(t===parseInt(window.getComputedStyle(o).getPropertyValue("z-index"))+1)return!1;"style"in o&&(o.style.zIndex="".concat(t-1)),document.body.classList.add("hs-overlay-body-open")}))}()})),"undefined"!=typeof window&&(window.HSOverlay=c),t.default=c},292:function(e,t){ /* - * HSOverlay - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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"])'),l=[];(null==i?void 0:i.length)&&i.forEach((function(e){(0,a.isParentOrElementHidden)(e)||l.push(e)}));var s=r&&!e.metaKey;if(s&&!r.element.isTabAccessibilityLimited&&"Tab"===e.code)return!1;s&&l.length&&"Tab"===e.code&&(e.preventDefault(),this.onTab(r,l)),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}(l(o(961)).default);window.addEventListener("load",(function(){c.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.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.overlay.classList.contains("opened")})))return!1;window.$hsOverlayCollection.filter((function(e){return e.element.overlay.classList.contains("opened")})).forEach((function(e){var t=parseInt(window.getComputedStyle(e.element.overlay).getPropertyValue("z-index")),o=document.querySelector("#".concat(e.element.overlay.id,"-backdrop"));if(t===parseInt(window.getComputedStyle(o).getPropertyValue("z-index"))+1)return!1;"style"in o&&(o.style.zIndex="".concat(t-1)),document.body.classList.add("hs-overlay-body-open")}))}()})),"undefined"!=typeof window&&(window.HSOverlay=c),t.default=c},292: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.getZIndex=t.getClassPropertyAlt=t.getClassProperty=t.stringToBoolean=void 0,t.getHighestZIndex=function(e){var t=Number.NEGATIVE_INFINITY;return e.forEach((function(e){var o=n(e);"auto"!==o&&(o=parseInt(o,10))>t&&(t=o)})),t};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};var n=function(e){return window.getComputedStyle(e).getPropertyValue("z-index")};t.getZIndex=n;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,d=e.clientHeight+n;return"bottom"===o?c>=d:"top"===o?s>=d:s>=d||c>=d};t.isFormElement=function(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement};var r=function(e){return!!e&&("none"===window.getComputedStyle(e).display||r(e.parentElement))};t.isParentOrElementHidden=r;t.debounce=function(e,t){var n;return void 0===t&&(t=200),function(){for(var r=[],i=0;i0?e.addEventListener("transitionend",o,!0):t()};t.htmlToElement=function(e){var t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild};t.classToClassList=function(e,t,o,n){void 0===o&&(o=" "),void 0===n&&(n="add"),e.split(o).forEach((function(e){return"add"===n?t.classList.add(e):t.classList.remove(e)}))};t.menuSearchHistory={historyIndex:-1,addHistory:function(e){this.historyIndex=e},existsInHistory:function(e){return e>this.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}(850);return o})())); \ No newline at end of file +var o=this;Object.defineProperty(t,"__esModule",{value:!0}),t.menuSearchHistory=t.classToClassList=t.htmlToElement=t.afterTransition=t.dispatch=t.debounce=t.isDirectChild=t.isFormElement=t.isParentOrElementHidden=t.isEnoughSpace=t.isIpadOS=t.isIOS=t.getZIndex=t.getClassPropertyAlt=t.getClassProperty=t.stringToBoolean=void 0,t.getHighestZIndex=function(e){var t=Number.NEGATIVE_INFINITY;return e.forEach((function(e){var o=n(e);"auto"!==o&&(o=parseInt(o,10))>t&&(t=o)})),t};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};var n=function(e){return window.getComputedStyle(e).getPropertyValue("z-index")};t.getZIndex=n;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.isDirectChild=function(e,t){for(var o=e.children,n=0;n=d:"top"===o?s>=d:s>=d||c>=d};t.isFormElement=function(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement};var r=function(e){return!!e&&("none"===window.getComputedStyle(e).display||r(e.parentElement))};t.isParentOrElementHidden=r;t.debounce=function(e,t){var n;return void 0===t&&(t=200),function(){for(var r=[],i=0;i0?e.addEventListener("transitionend",o,!0):t()};t.htmlToElement=function(e){var t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild};t.classToClassList=function(e,t,o,n){void 0===o&&(o=" "),void 0===n&&(n="add"),e.split(o).forEach((function(e){return"add"===n?t.classList.add(e):t.classList.remove(e)}))};t.menuSearchHistory={historyIndex:-1,addHistory:function(e){this.historyIndex=e},existsInHistory:function(e){return e>this.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}(850);return o})())); \ No newline at end of file diff --git a/dist/overlay.mjs b/dist/overlay.mjs new file mode 100644 index 0000000..a35d61c --- /dev/null +++ b/dist/overlay.mjs @@ -0,0 +1,16 @@ +var e={189:(e,t,o)=>{o.d(t,{LO:()=>l});const l={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},615:(e,t,o)=>{o.d(t,{A:()=>l});class l{constructor(e,t,o){this.el=e,this.options=t,this.events=o,this.el=e,this.options=t,this.events={}}createCollection(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})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},926:(e,t,o)=>{o.d(t,{JD:()=>a,PK:()=>l,gj:()=>i,sH:()=>n,wC:()=>s,yd:()=>r}); +/* + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +const l=e=>"true"===e,i=(e,t,o="")=>(window.getComputedStyle(e).getPropertyValue(t)||o).replace(" ","");const s=(e,t)=>{const o=e.children;for(let e=0;e{if(!e)return!1;return"none"===window.getComputedStyle(e).display||n(e.parentElement)},a=(e,t,o=null)=>{const l=new CustomEvent(e,{detail:{payload:o},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(l)},r=(e,t)=>{const o=()=>{t(),e.removeEventListener("transitionend",o,!0)},l=window.getComputedStyle(e),i=l.getPropertyValue("transition-duration");"none"!==l.getPropertyValue("transition-property")&&parseFloat(i)>0?e.addEventListener("transitionend",o,!0):t()}}},t={};function o(l){var i=t[l];if(void 0!==i)return i.exports;var s=t[l]={exports:{}};return e[l](s,s.exports,o),s.exports}o.d=(e,t)=>{for(var l in t)o.o(t,l)&&!o.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var l={};o.d(l,{A:()=>d});var i=o(926),s=o(189),n=o(615); +/* + * HSOverlay + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class a extends n.A{constructor(e,t,o){var l,n,a,r,d;super(e,t,o);const c=e.getAttribute("data-hs-overlay-options"),h=c?JSON.parse(c):{},y=Object.assign(Object.assign({},h),t);if(this.hiddenClass=(null==y?void 0:y.hiddenClass)||"hidden",this.emulateScrollbarSpace=(null==y?void 0:y.emulateScrollbarSpace)||!1,this.isClosePrev=null===(l=null==y?void 0:y.isClosePrev)||void 0===l||l,this.backdropClasses=null!==(n=null==y?void 0:y.backdropClasses)&&void 0!==n?n:"hs-overlay-backdrop transition duration fixed inset-0 bg-gray-900 bg-opacity-50 dark:bg-opacity-80 dark:bg-neutral-900",this.backdropExtraClasses=null!==(a=null==y?void 0:y.backdropExtraClasses)&&void 0!==a?a:"",this.moveOverlayToBody=(null==y?void 0:y.moveOverlayToBody)||null,this.openNextOverlay=!1,this.autoHide=null,this.overlayId=this.el.getAttribute("data-hs-overlay"),this.overlay=document.querySelector(this.overlayId),this.initContainer=(null===(r=this.overlay)||void 0===r?void 0:r.parentElement)||null,this.overlay){this.isCloseWhenClickInside=(0,i.PK)((0,i.gj)(this.overlay,"--close-when-click-inside","false")||"false"),this.isTabAccessibilityLimited=(0,i.PK)((0,i.gj)(this.overlay,"--tab-accessibility-limited","true")||"true"),this.isLayoutAffect=(0,i.PK)((0,i.gj)(this.overlay,"--is-layout-affect","false")||"false"),this.hasAutofocus=(0,i.PK)((0,i.gj)(this.overlay,"--has-autofocus","true")||"true"),this.hasAbilityToCloseOnBackdropClick=(0,i.PK)(this.overlay.getAttribute("data-hs-overlay-keyboard")||"true");const e=(0,i.gj)(this.overlay,"--auto-close");this.autoClose=!isNaN(+e)&&isFinite(+e)?+e:s.LO[e]||null;const t=(0,i.gj)(this.overlay,"--opened");this.openedBreakpoint=(!isNaN(+t)&&isFinite(+t)?+t:s.LO[t])||null}this.animationTarget=(null===(d=null==this?void 0:this.overlay)||void 0===d?void 0:d.querySelector(".hs-overlay-animation-target"))||this.overlay,this.overlay&&this.init()}init(){var e;if(this.createCollection(window.$hsOverlayCollection,this),this.isLayoutAffect&&this.openedBreakpoint){const e=a.getInstance(this.el,!0);a.setOpened(this.openedBreakpoint,e)}(null===(e=null==this?void 0:this.el)||void 0===e?void 0:e.ariaExpanded)&&(this.overlay.classList.contains("opened")?this.el.ariaExpanded="true":this.el.ariaExpanded="false"),this.el.addEventListener("click",(()=>{this.overlay.classList.contains("opened")?this.close():this.open()})),this.overlay.addEventListener("click",(e=>{e.target.id&&`#${e.target.id}`===this.overlayId&&this.isCloseWhenClickInside&&this.hasAbilityToCloseOnBackdropClick&&this.close()}))}hideAuto(){const e=parseInt((0,i.gj)(this.overlay,"--auto-hide","0"));e&&(this.autoHide=setTimeout((()=>{this.close()}),e))}checkTimer(){this.autoHide&&(clearTimeout(this.autoHide),this.autoHide=null)}buildBackdrop(){const e=this.overlay.classList.value.split(" "),t=parseInt(window.getComputedStyle(this.overlay).getPropertyValue("z-index")),o=this.overlay.getAttribute("data-hs-overlay-backdrop-container")||!1;let l=document.createElement("div"),s=`${this.backdropClasses} ${this.backdropExtraClasses}`;const n="static"!==(0,i.gj)(this.overlay,"--overlay-backdrop","true"),a="false"===(0,i.gj)(this.overlay,"--overlay-backdrop","true");l.id=`${this.overlay.id}-backdrop`,"style"in l&&(l.style.zIndex=""+(t-1));for(const t of e)(t.startsWith("hs-overlay-backdrop-open:")||t.includes(":hs-overlay-backdrop-open:"))&&(s+=` ${t}`);a||(o&&(l=document.querySelector(o).cloneNode(!0),l.classList.remove("hidden"),s=`${l.classList.toString()}`,l.classList.value=""),n&&l.addEventListener("click",(()=>this.close()),!0),l.setAttribute("data-hs-overlay-backdrop-template",""),document.body.appendChild(l),setTimeout((()=>{l.classList.value=s})))}destroyBackdrop(){const e=document.querySelector(`#${this.overlay.id}-backdrop`);e&&(this.openNextOverlay&&(e.style.transitionDuration=1.8*parseFloat(window.getComputedStyle(e).transitionDuration.replace(/[^\d.-]/g,""))+"s"),e.classList.add("opacity-0"),(0,i.yd)(e,(()=>{e.remove()})))}focusElement(){const e=this.overlay.querySelector("[autofocus]");if(!e)return!1;e.focus()}getScrollbarSize(){let e=document.createElement("div");e.style.overflow="scroll",e.style.width="100px",e.style.height="100px",document.body.appendChild(e);let t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}open(){if(!this.overlay)return!1;const e=document.querySelectorAll(".hs-overlay.open"),t=window.$hsOverlayCollection.find((t=>Array.from(e).includes(t.element.overlay)&&!t.element.isLayoutAffect)),o=document.querySelectorAll(`[data-hs-overlay="#${this.overlay.id}"]`),l="true"!==(0,i.gj)(this.overlay,"--body-scroll","false");if(this.isClosePrev&&t)return this.openNextOverlay=!0,t.element.close().then((()=>{this.open(),this.openNextOverlay=!1}));l&&(document.body.style.overflow="hidden",this.emulateScrollbarSpace&&(document.body.style.paddingRight=`${this.getScrollbarSize()}px`)),this.buildBackdrop(),this.checkTimer(),this.hideAuto(),o.forEach((e=>{e.ariaExpanded&&(e.ariaExpanded="true")})),this.overlay.classList.remove(this.hiddenClass),this.overlay.setAttribute("aria-overlay","true"),this.overlay.setAttribute("tabindex","-1"),setTimeout((()=>{if(this.overlay.classList.contains("opened"))return!1;this.overlay.classList.add("open","opened"),this.isLayoutAffect&&document.body.classList.add("hs-overlay-body-open"),this.fireEvent("open",this.el),(0,i.JD)("open.hs.overlay",this.el,this.el),this.hasAutofocus&&this.focusElement()}),50)}close(e=!1){this.isLayoutAffect&&document.body.classList.remove("hs-overlay-body-open");const t=e=>{if(this.overlay.classList.contains("open"))return!1;document.querySelectorAll(`[data-hs-overlay="#${this.overlay.id}"]`).forEach((e=>{e.ariaExpanded&&(e.ariaExpanded="false")})),this.overlay.classList.add(this.hiddenClass),this.destroyBackdrop(),this.fireEvent("close",this.el),(0,i.JD)("close.hs.overlay",this.el,this.el),document.querySelector(".hs-overlay.opened")||(document.body.style.overflow="",this.emulateScrollbarSpace&&(document.body.style.paddingRight="")),e(this.overlay)};return new Promise((o=>{if(!this.overlay)return!1;this.overlay.classList.remove("open","opened"),this.overlay.removeAttribute("aria-overlay"),this.overlay.removeAttribute("tabindex"),e?t(o):(0,i.yd)(this.animationTarget,(()=>t(o)))}))}static getInstance(e,t){const o=window.$hsOverlayCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)||t.element.overlay===("string"==typeof e?document.querySelector(e):e)));return o?t?o:o.element.el:null}static autoInit(){window.$hsOverlayCollection||(window.$hsOverlayCollection=[]),document.querySelectorAll("[data-hs-overlay]:not(.--prevent-on-load-init)").forEach((e=>{window.$hsOverlayCollection.find((t=>{var o;return(null===(o=null==t?void 0:t.element)||void 0===o?void 0:o.el)===e}))||new a(e)})),window.$hsOverlayCollection&&document.addEventListener("keydown",(e=>a.accessibility(e)))}static open(e){const t=window.$hsOverlayCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)||t.element.overlay===("string"==typeof e?document.querySelector(e):e)));t&&t.element.overlay.classList.contains(t.element.hiddenClass)&&t.element.open()}static close(e){const t=window.$hsOverlayCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)||t.element.overlay===("string"==typeof e?document.querySelector(e):e)));t&&!t.element.overlay.classList.contains(t.element.hiddenClass)&&t.element.close()}static setOpened(e,t){document.body.clientWidth>=e?(document.body.classList.add("hs-overlay-body-open"),t.element.overlay.classList.add("opened")):t.element.close(!0)}static accessibility(e){var t,o;const l=window.$hsOverlayCollection.filter((e=>e.element.overlay.classList.contains("open"))),s=l[l.length-1],n=null===(o=null===(t=null==s?void 0:s.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==n?void 0:n.length)&&n.forEach((e=>{(0,i.sH)(e)||a.push(e)}));const r=s&&!e.metaKey;if(r&&!s.element.isTabAccessibilityLimited&&"Tab"===e.code)return!1;r&&a.length&&"Tab"===e.code&&(e.preventDefault(),this.onTab(s,a)),r&&"Escape"===e.code&&(e.preventDefault(),this.onEscape(s))}static onEscape(e){e&&e.element.hasAbilityToCloseOnBackdropClick&&e.element.close()}static onTab(e,t){if(!t.length)return!1;const o=e.element.overlay.querySelector(":focus"),l=Array.from(t).indexOf(o);if(l>-1){t[(l+1)%t.length].focus()}else t[0].focus()}static on(e,t,o){const l=window.$hsOverlayCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)||e.element.overlay===("string"==typeof t?document.querySelector(t):t)));l&&(l.element.events[e]=o)}}const r=()=>{if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((e=>e.element.moveOverlayToBody)))return!1;window.$hsOverlayCollection.filter((e=>e.element.moveOverlayToBody)).forEach((e=>{const t=e.element.moveOverlayToBody,o=e.element.initContainer,l=document.querySelector("body"),s=e.element.overlay;if(!o&&s)return!1;document.body.clientWidth<=t&&!(0,i.wC)(l,s)?l.appendChild(s):document.body.clientWidth>t&&!o.contains(s)&&o.appendChild(s)}))};window.addEventListener("load",(()=>{a.autoInit(),r()})),window.addEventListener("resize",(()=>{(()=>{if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((e=>e.element.autoClose)))return!1;window.$hsOverlayCollection.filter((e=>e.element.autoClose)).forEach((e=>{document.body.clientWidth>=e.element.autoClose&&e.element.close(!0)}))})(),r(),(()=>{if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((e=>e.element.autoClose)))return!1;window.$hsOverlayCollection.filter((e=>e.element.autoClose)).forEach((e=>{document.body.clientWidth>=e.element.autoClose&&e.element.close(!0)}))})(),(()=>{if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((e=>e.element.overlay.classList.contains("opened"))))return!1;window.$hsOverlayCollection.filter((e=>e.element.overlay.classList.contains("opened"))).forEach((e=>{const t=parseInt(window.getComputedStyle(e.element.overlay).getPropertyValue("z-index")),o=document.querySelector(`#${e.element.overlay.id}-backdrop`);if(t===parseInt(window.getComputedStyle(o).getPropertyValue("z-index"))+1)return!1;"style"in o&&(o.style.zIndex=""+(t-1)),document.body.classList.add("hs-overlay-body-open")}))})()})),"undefined"!=typeof window&&(window.HSOverlay=a);const d=a;var c=l.A;export{c as default}; \ No newline at end of file diff --git a/dist/pin-input.js b/dist/pin-input.js index 86b375c..8ba18ce 100644 --- a/dist/pin-input.js +++ b/dist/pin-input.js @@ -1,17 +1,16 @@ -!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={961:(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 i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(self,(()=>(()=>{"use strict";var t={961:(t,e)=>{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},60:function(t,e,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSPinInput + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},60:function(t,e,n){ +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}(u(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=a),e.default=a},292:function(t,e){ /* - * HSPinInput - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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}(u(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=a),e.default=a},292: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.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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(),u=i?i.getBoundingClientRect():null,s=window.innerHeight,a=u?r.top-u.top:r.top,l=(i?u.bottom:s)-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 i=function(t){return!!t&&("none"===window.getComputedStyle(t).display||i(t.parentElement))};e.isParentOrElementHidden=i;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(60);return n})())); \ No newline at end of file +var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=i(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var i=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=i;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.isDirectChild=function(t,e){for(var n=t.children,i=0;i=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 i;return void 0===e&&(e=200),function(){for(var o=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,i){void 0===n&&(n=" "),void 0===i&&(i="add"),t.split(n).forEach((function(t){return"add"===i?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(60);return n})())); \ No newline at end of file diff --git a/dist/pin-input.mjs b/dist/pin-input.mjs new file mode 100644 index 0000000..85a838f --- /dev/null +++ b/dist/pin-input.mjs @@ -0,0 +1,9 @@ +var t={615:(t,e,i)=>{i.d(e,{A:()=>s});class s{constructor(t,e,i){this.el=t,this.options=e,this.events=i,this.el=t,this.options=e,this.events={}}createCollection(t,e){var i;t.push({id:(null===(i=null==e?void 0:e.el)||void 0===i?void 0:i.id)||t.length+1,element:e})}fireEvent(t,e=null){if(this.events.hasOwnProperty(t))return this.events[t](e)}on(t,e){this.events[t]=e}}},926:(t,e,i)=>{i.d(e,{JD:()=>s});const s=(t,e,i=null)=>{const s=new CustomEvent(t,{detail:{payload:i},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(s)}}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var l=e[s]={exports:{}};return t[s](l,l.exports,i),l.exports}i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var s={};i.d(s,{A:()=>r});var n=i(926),l=i(615); +/* + * HSPinInput + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class o extends l.A{constructor(t,e){super(t,e);const i=t.getAttribute("data-hs-pin-input"),s=i?JSON.parse(i):{},n=Object.assign(Object.assign({},s),e);this.items=this.el.querySelectorAll("[data-hs-pin-input-item]"),this.currentItem=null,this.currentValue=new Array(this.items.length).fill(""),this.placeholders=[],this.availableCharsRE=new RegExp((null==n?void 0:n.availableCharsRE)||"^[a-zA-Z0-9]+$"),this.init()}init(){this.createCollection(window.$hsPinInputCollection,this),this.items.length&&this.build()}build(){this.buildInputItems()}buildInputItems(){this.items.forEach(((t,e)=>{this.placeholders.push(t.getAttribute("placeholder")||""),t.hasAttribute("autofocus")&&this.onFocusIn(e),t.addEventListener("input",(t=>this.onInput(t,e))),t.addEventListener("paste",(t=>this.onPaste(t))),t.addEventListener("keydown",(t=>this.onKeydown(t,e))),t.addEventListener("focusin",(()=>this.onFocusIn(e))),t.addEventListener("focusout",(()=>this.onFocusOut(e)))}))}checkIfNumber(t){return t.match(this.availableCharsRE)}autoFillAll(t){Array.from(t).forEach(((t,e)=>{if(!(null==this?void 0:this.items[e]))return!1;this.items[e].value=t,this.items[e].dispatchEvent(new Event("input",{bubbles:!0}))}))}setCurrentValue(){this.currentValue=Array.from(this.items).map((t=>t.value))}toggleCompleted(){this.currentValue.includes("")?this.el.classList.remove("active"):this.el.classList.add("active")}onInput(t,e){const i=t.target.value;if(this.currentItem=t.target,this.currentItem.value="",this.currentItem.value=i[i.length-1],!this.checkIfNumber(this.currentItem.value))return this.currentItem.value=this.currentValue[e]||"",!1;if(this.setCurrentValue(),this.currentItem.value){if(e0&&this.items[e-1].focus()}onKeydown(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()}onFocusIn(t){this.items[t].setAttribute("placeholder","")}onFocusOut(t){this.items[t].setAttribute("placeholder",this.placeholders[t])}onPaste(t){t.preventDefault(),this.items.forEach((e=>{document.activeElement===e&&this.autoFillAll(t.clipboardData.getData("text"))}))}static getInstance(t,e){const i=window.$hsPinInputCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return i?e?i:i.element:null}static autoInit(){window.$hsPinInputCollection||(window.$hsPinInputCollection=[]),document.querySelectorAll("[data-hs-pin-input]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsPinInputCollection.find((e=>{var i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))||new o(t)}))}}window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=o);const r=o;var u=s.A;export{u as default}; \ No newline at end of file diff --git a/dist/preline.d.ts b/dist/preline.d.ts index 3fd3f92..96d2c9e 100644 --- a/dist/preline.d.ts +++ b/dist/preline.d.ts @@ -58,13 +58,14 @@ export interface IAccordion { export declare class HSAccordion extends HSBasePlugin implements IAccordion { private readonly toggle; content: HTMLElement | null; - private readonly group; - private readonly isAlwaysOpened; + private group; + private isAlwaysOpened; static selectable: IAccordionTreeView[]; constructor(el: HTMLElement, options?: IAccordionOptions, events?: {}); private init; show(): boolean; hide(): boolean; + update(): boolean; static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem; static show(target: HTMLElement): void; static hide(target: HTMLElement): void; @@ -73,13 +74,24 @@ export declare class HSAccordion extends HSBasePlugin impleme static toggleSelected(root: IAccordionTreeView, item: HTMLElement): void; static on(evt: string, target: HTMLElement, cb: Function): void; } +export type TCarouselOptionsSlidesQty = { + [key: string]: number; +}; export interface ICarouselOptions { currentIndex: number; loadingClasses?: string | string[]; + dotsItemClasses?: string; + isAutoHeight?: boolean; isAutoPlay?: boolean; - speed?: number; + isCentered?: boolean; + isDraggable?: boolean; isInfiniteLoop?: boolean; isRTL?: boolean; + isSnap?: boolean; + hasSnapSpacers?: boolean; + slidesQty?: TCarouselOptionsSlidesQty | number; + speed?: number; + updateDelay?: number; } export interface ICarousel { options?: ICarouselOptions; @@ -89,28 +101,69 @@ export interface ICarousel { goTo(i: number): void; } export declare class HSCarousel extends HSBasePlugin implements ICarousel { + private currentIndex; + private readonly loadingClasses; + private readonly dotsItemClasses; + private readonly isAutoHeight; + private readonly isAutoPlay; + private readonly isCentered; + private readonly isDraggable; + private readonly isInfiniteLoop; + private readonly isRTL; + private readonly isSnap; + private readonly hasSnapSpacers; + private readonly slidesQty; + private readonly speed; + private readonly updateDelay; + private readonly loadingClassesRemove; + private readonly loadingClassesAdd; + private readonly afterLoadingClassesAdd; + private readonly container; private readonly inner; private readonly slides; private readonly prev; private readonly next; private readonly dots; + private dotsItems; + private readonly info; + private readonly infoTotal; + private readonly infoCurrent; private sliderWidth; - private currentIndex; - private readonly loadingClasses; - private readonly loadingClassesRemove; - private readonly loadingClassesAdd; - private readonly afterLoadingClassesAdd; - private readonly isAutoPlay; - private readonly isRTL; - private readonly speed; - private readonly isInfiniteLoop; private timer; + private isScrolling; + private isDragging; + private dragStartX; + private initialTranslateX; private readonly touchX; + private resizeContainer; + resizeContainerWidth: number; constructor(el: HTMLElement, options?: ICarouselOptions); + private setIsSnap; private init; + private initDragHandling; + private getTranslateXValue; + private removeClickEventWhileDragging; + private handleDragStart; + private handleDragMove; + private handleDragEnd; + private getEventX; + private getCurrentSlidesQty; + private buildSnapSpacers; + private initDots; + private buildDots; + private setDots; + private goToCurrentDot; + private buildInfo; + private setInfoTotal; + private setInfoCurrent; + private buildSingleDot; + private singleDotEvents; private observeResize; private calculateWidth; private addCurrentClass; + private setCurrentDot; + private setElementToDisabled; + private unsetElementToDisabled; private addDisabledClass; private autoPlay; private setTimer; @@ -118,9 +171,11 @@ export declare class HSCarousel extends HSBasePlugin implement private detectDirection; recalculateWidth(): void; private calculateTransform; + private setTranslate; goToPrev(): void; goToNext(): void; goTo(i: number): void; + private setIndex; static getInstance(target: HTMLElement | string, isInstance?: boolean): HSCarousel | ICollectionItem; static autoInit(): void; } @@ -341,6 +396,7 @@ export interface IOverlayOptions { isClosePrev?: boolean; backdropClasses?: string | null; backdropExtraClasses?: string | null; + moveOverlayToBody?: number | null; } export interface IOverlay { options?: IOverlayOptions; @@ -358,6 +414,7 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private autoHide; private readonly overlayId; overlay: HTMLElement | null; + initContainer: HTMLElement | null; isCloseWhenClickInside: boolean; isTabAccessibilityLimited: boolean; isLayoutAffect: boolean; @@ -365,6 +422,7 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { hasAbilityToCloseOnBackdropClick: boolean; openedBreakpoint: number | null; autoClose: number | null; + moveOverlayToBody: number | null; constructor(el: HTMLElement, options?: IOverlayOptions, events?: {}); private init; private hideAuto; @@ -457,6 +515,13 @@ export interface ISingleOption { selected?: boolean; options?: ISingleOptionOptions | null; } +export interface IApiFieldMap { + id: string; + title: string; + icon?: string | null; + description?: string | null; + [key: string]: unknown; +} export interface ISelectOptions { value?: string | string[]; isOpened?: boolean; @@ -466,6 +531,13 @@ export interface ISelectOptions { mode?: string; viewport?: string; wrapperClasses?: string; + apiUrl?: string | null; + apiQuery?: string | null; + apiOptions?: RequestInit | null; + apiDataPart?: string | null; + apiSearchQueryKey?: string | null; + apiFieldsMap?: IApiFieldMap | null; + apiIconTag?: string | null; toggleTag?: string; toggleClasses?: string; toggleSeparators?: { @@ -477,6 +549,7 @@ export interface ISelectOptions { toggleCountTextMode?: string; tagsItemTemplate?: string; tagsItemClasses?: string; + tagsInputId?: string; tagsInputClasses?: string; dropdownTag?: string; dropdownClasses?: string; @@ -485,11 +558,18 @@ export interface ISelectOptions { bottom?: string; }; dropdownSpace: number; + dropdownPlacement: string | null; + dropdownScope: "window" | "parent"; extraMarkup?: string | string[] | null; + searchTemplate?: string; searchWrapperTemplate?: string; + searchId?: string; + searchLimit?: number | typeof Infinity; + isSearchDirectMatch?: boolean; searchClasses?: string; searchWrapperClasses?: string; searchPlaceholder?: string; + searchNoResultTemplate?: string | null; searchNoResultText?: string | null; searchNoResultClasses?: string | null; optionTemplate?: string; @@ -519,6 +599,13 @@ export declare class HSSelect extends HSBasePlugin implements IS isMultiple: boolean | null; isDisabled: boolean | null; selectedItems: string[]; + private readonly apiUrl; + private readonly apiQuery; + private readonly apiOptions; + private readonly apiDataPart; + private readonly apiSearchQueryKey; + private readonly apiFieldsMap; + private readonly apiIconTag; private readonly toggleTag; private readonly toggleClasses; private readonly toggleSeparators; @@ -528,15 +615,23 @@ export declare class HSSelect extends HSBasePlugin implements IS private readonly wrapperClasses; private readonly tagsItemTemplate; private readonly tagsItemClasses; + private readonly tagsInputId; private readonly tagsInputClasses; private readonly dropdownTag; private readonly dropdownClasses; private readonly dropdownDirectionClasses; dropdownSpace: number | null; + readonly dropdownPlacement: string | null; + readonly dropdownScope: "window" | "parent"; + private readonly searchTemplate; private readonly searchWrapperTemplate; private readonly searchPlaceholder; + private readonly searchId; + private readonly searchLimit; + private readonly isSearchDirectMatch; private readonly searchClasses; private readonly searchWrapperClasses; + private readonly searchNoResultTemplate; private readonly searchNoResultText; private readonly searchNoResultClasses; private readonly optionTag; @@ -550,6 +645,7 @@ export declare class HSSelect extends HSBasePlugin implements IS private toggleTextWrapper; private tagsInput; private dropdown; + private popperInstance; private searchWrapper; private search; private searchNoResult; @@ -557,6 +653,8 @@ export declare class HSSelect extends HSBasePlugin implements IS private extraMarkup; private readonly isAddTagOnEnter; private tagsInputHelper; + private remoteOptions; + private optionId; constructor(el: HTMLElement, options?: ISelectOptions); setValue(val: string | string[]): void; private init; @@ -573,8 +671,16 @@ export declare class HSSelect extends HSBasePlugin implements IS private setTagsItems; private buildTagsInput; private buildDropdown; + private buildPopper; + private updateDropdownWidth; private buildSearch; private buildOption; + private buildOptionFromRemoteData; + private buildOptionsFromRemoteData; + private optionsFromRemoteData; + private apiRequest; + private sortElements; + private remoteSearch; private destroyOption; private buildOriginalOption; private destroyOriginalOption; @@ -588,6 +694,8 @@ export declare class HSSelect extends HSBasePlugin implements IS private resetTagsInputField; private clearSelections; private setNewValue; + private stringFromValueBasic; + private stringFromValueRemoteData; private stringFromValue; private selectSingleItem; private selectMultipleItems; @@ -595,6 +703,7 @@ export declare class HSSelect extends HSBasePlugin implements IS private searchOptions; private eraseToggleIcon; private eraseToggleTitle; + private toggleFn; destroy(): void; open(): boolean; close(): boolean; @@ -774,6 +883,25 @@ export declare class HSTabs extends HSBasePlugin<{}> implements ITabs { static onStartEnd(isOpposite?: boolean): void; static on(evt: string, target: HTMLElement, cb: Function): void; } +export interface ITextareaAutoHeightOptions { + defaultHeight: number; +} +export interface ITextareaAutoHeight { + options?: ITextareaAutoHeightOptions; +} +export declare class HSTextareaAutoHeight extends HSBasePlugin implements ITextareaAutoHeight { + private readonly defaultHeight; + constructor(el: HTMLTextAreaElement, options?: ITextareaAutoHeightOptions); + private init; + private setAutoHeight; + private textareaSetHeight; + private checkIfOneLine; + private isParentHidden; + private parentType; + private callbackAccordingToType; + static getInstance(target: HTMLTextAreaElement | string, isInstance?: boolean): HSTextareaAutoHeight | ICollectionItem; + static autoInit(): void; +} export interface IThemeSwitchOptions { theme?: "dark" | "light" | "default"; } @@ -868,6 +996,47 @@ export declare class HSTooltip extends HSBasePlugin<{}> implements ITooltip { static hide(target: HTMLElement): void; static on(evt: string, target: HTMLElement, cb: Function): void; } +export type ITreeViewOptionsControlBy = "checkbox" | "button"; +export interface ITreeViewItem { + id: string; + value: string; + isDir: boolean; + path: string; + isSelected?: boolean; +} +export interface ITreeViewOptions { + items: ITreeViewItem[] | null; + controlBy?: ITreeViewOptionsControlBy; + autoSelectChildren?: boolean; + isIndeterminate?: boolean; +} +export interface ITreeView { + options?: ITreeViewOptions; +} +export declare class HSTreeView extends HSBasePlugin implements ITreeView { + private items; + private readonly controlBy; + private readonly autoSelectChildren; + private readonly isIndeterminate; + static group: number; + constructor(el: HTMLElement, options?: ITreeViewOptions, events?: {}); + private init; + private initItems; + private controlByButton; + private controlByCheckbox; + private getItem; + private getPath; + private unselectItem; + private selectItem; + private selectChildren; + private toggleParent; + update(): void; + getSelectedItems(): ITreeViewItem[]; + changeItemProp(id: string, prop: string, val: any): void; + static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem; + static autoInit(): void; + static on(evt: string, target: HTMLElement, cb: Function): void; +} export interface IStaticMethods { getClassProperty(el: HTMLElement, prop?: string, val?: string): string; afterTransition(el: HTMLElement, cb: Function): void; @@ -877,10 +1046,12 @@ export interface IStaticMethods { export declare const HSStaticMethods: IStaticMethods; declare let HSDataTableModule: any; declare let HSFileUploadModule: any; +declare let HSRangeSliderModule: any; export { HSDataTableModule as HSDataTable, HSFileUploadModule as HSFileUpload, + HSRangeSliderModule as HSRangeSlider, }; export {}; diff --git a/dist/preline.js b/dist/preline.js index 3e4f2f8..cb4963a 100644 --- a/dist/preline.js +++ b/dist/preline.js @@ -1,177 +1,214 @@ -!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={170:(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:()=>g,beforeWrite:()=>x,bottom:()=>i,clippingParents:()=>d,computeStyles:()=>nt,createPopper:()=>Pt,createPopperBase:()=>kt,createPopperLite:()=>Bt,detectOverflow:()=>yt,end:()=>u,eventListeners:()=>it,flip:()=>wt,hide:()=>St,left:()=>s,main:()=>C,modifierPhases:()=>E,offset:()=>xt,placements:()=>m,popper:()=>h,popperGenerator:()=>_t,popperOffsets:()=>It,preventOverflow:()=>Tt,read:()=>y,reference:()=>f,right:()=>r,start:()=>c,top:()=>o,variationPlacements:()=>v,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",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])}),[]),g="beforeRead",y="read",w="afterRead",b="beforeMain",C="main",S="afterMain",x="beforeWrite",I="write",T="afterWrite",E=[g,y,w,b,C,S,x,I,T];function L(t){return t?(t.nodeName||"").toLowerCase():null}function O(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 O(t).Element||t instanceof Element}function _(t){return t instanceof O(t).HTMLElement||t instanceof HTMLElement}function k(t){return"undefined"!=typeof ShadowRoot&&(t instanceof O(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)&&L(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)&&L(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,H=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 M(){return!/^((?!chrome|android).)*safari/i.test(D())}function j(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&&H(o.width)/t.offsetWidth||1,r=t.offsetHeight>0&&H(o.height)/t.offsetHeight||1);var s=(A(t)?O(t):window).visualViewport,l=!M()&&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 $(t){var e=j(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 V(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 R(t){return O(t).getComputedStyle(t)}function F(t){return["table","td","th"].indexOf(L(t))>=0}function W(t){return((A(t)?t.ownerDocument:t.document)||window.document).documentElement}function z(t){return"html"===L(t)?t:t.assignedSlot||t.parentNode||(k(t)?t.host:null)||W(t)}function U(t){return _(t)&&"fixed"!==R(t).position?t.offsetParent:null}function J(t){for(var e=O(t),n=U(t);n&&F(n)&&"static"===R(n).position;)n=U(n);return n&&("html"===L(n)||"body"===L(n)&&"static"===R(n).position)?e:n||function(t){var e=/firefox/i.test(D());if(/Trident/i.test(D())&&_(t)&&"fixed"===R(t).position)return null;var n=z(t);for(k(n)&&(n=n.host);_(n)&&["html","body"].indexOf(L(n))<0;){var o=R(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 Y(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Z(t,e,n){return q(t,N(e,n))}function K(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function G(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=Y(p),f=[s,r].indexOf(p)>=0?"height":"width";if(u&&d){var v=function(t,e){return K("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:G(t,a))}(c.padding,n),m=$(u),g="y"===h?o:s,y="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,x=w/2-b/2,I=v[g],T=S-m[f]-v[y],E=S/2-m[f]/2+x,L=Z(I,E,T),O=h;n.modifiersData[l]=((e={})[O]=L,e.centerOffset=L-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)))&&V(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function X(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,g=d.x,y=void 0===g?0:g,w=d.y,b=void 0===w?0:w,C="function"==typeof v?v({x:y,y:b}):{x:y,y:b};y=C.x,b=C.y;var S=d.hasOwnProperty("x"),x=d.hasOwnProperty("y"),I=s,T=o,E=window;if(f){var L=J(n),A="clientHeight",_="clientWidth";if(L===O(n)&&"static"!==R(L=W(n)).position&&"absolute"===p&&(A="scrollHeight",_="scrollWidth"),a===o||(a===s||a===r)&&c===u)T=i,b-=(m&&L===E&&E.visualViewport?E.visualViewport.height:L[A])-l.height,b*=h?1:-1;if(a===s||(a===o||a===i)&&c===u)I=r,y-=(m&&L===E&&E.visualViewport?E.visualViewport.width:L[_])-l.width,y*=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:H(n*i)/i||0,y:H(o*i)/i||0}}({x:y,y:b},O(n)):{x:y,y:b};return y=B.x,b=B.y,h?Object.assign({},P,((k={})[T]=x?"0":"",k[I]=S?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",k)):Object.assign({},P,((e={})[T]=x?b+"px":"",e[I]=S?y+"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:X(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=O(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=O(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ut(t){return j(W(t)).left+ct(t).scrollLeft}function dt(t){var e=R(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(L(t))>=0?t.ownerDocument.body:_(t)&&dt(t)?t:pt(z(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=O(o),s=i?[r].concat(r.visualViewport||[],dt(o)?o:[]):o,l=e.concat(s);return i?l:l.concat(ht(z(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=O(t),o=W(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;var c=M();(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=j(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=W(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"===R(i||n).direction&&(l+=q(n.clientWidth,i?i.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}(W(t)))}function mt(t,e,n,o){var i="clippingParents"===e?function(t){var e=ht(z(t)),n=["absolute","fixed"].indexOf(R(t).position)>=0&&_(t)?J(t):t;return A(n)?e.filter((function(t){return A(t)&&V(t,n)&&"body"!==L(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=N(i.right,e.right),e.bottom=N(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 gt(t){var e,n=t.reference,l=t.element,a=t.placement,d=a?B(a):null,p=a?X(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?Y(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 yt(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,g=n.rootBoundary,y=void 0===g?p:g,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=K("number"!=typeof I?I:G(I,a)),E=b===h?f:h,L=t.rects.popper,O=t.elements[S?E:b],_=mt(A(O)?O:O.contextElement||W(t.elements.popper),m,y,u),k=j(t.elements.reference),P=gt({reference:k,element:L,strategy:"absolute",placement:l}),B=ft(Object.assign({},L,P)),q=b===h?B:k,N={top:_.top-q.top+T.top,bottom:q.bottom-_.bottom+T.bottom,left:_.left-q.left+T.left,right:q.right-_.right+T.right},H=t.modifiersData.offset;if(b===h&&H){var D=H[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]+=D[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,g=n.fallbackPlacements,y=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),L=g||(E===T||!x?[st(T)]:function(t){if(B(t)===l)return[];var e=st(t);return[at(t),e,at(e)]}(T)),O=[T].concat(L).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=X(o),p=d?l?v:v.filter((function(t){return X(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]=yt(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:y,flipVariations:x,allowedAutoPlacements:I}):n)}),[]),A=e.rects.reference,_=e.rects.popper,k=new Map,P=!0,q=O[0],N=0;N=0,$=j?"width":"height",V=yt(e,{placement:H,boundary:w,rootBoundary:b,altBoundary:C,padding:y}),R=j?M?r:s:M?i:o;A[$]>_[$]&&(R=st(R));var F=st(R),W=[];if(p&&W.push(V[D]<=0),f&&W.push(V[R]<=0,V[F]<=0),W.every((function(t){return t}))){q=H,P=!1;break}k.set(H,W)}if(P)for(var z=function(t){var e=O.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"},U=x?3:1;U>0;U--){if("break"===z(U))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=yt(e,{elementContext:"reference"}),l=yt(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=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 It={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=gt({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,v=n.altBoundary,m=n.padding,g=n.tether,y=void 0===g||g,w=n.tetherOffset,b=void 0===w?0:w,C=yt(e,{boundary:h,rootBoundary:f,padding:m,altBoundary:v}),S=B(e.placement),x=X(e.placement),I=!x,T=Y(S),E="x"===T?"y":"x",L=e.modifiersData.popperOffsets,O=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,H={x:0,y:0};if(L){if(u){var D,M="y"===T?o:s,j="y"===T?i:r,V="y"===T?"height":"width",R=L[T],F=R+C[M],W=R-C[j],z=y?-A[V]/2:0,U=x===c?O[V]:A[V],K=x===c?-A[V]:-O[V],G=e.elements.arrow,Q=y&&G?$(G):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[M],nt=tt[j],ot=Z(0,O[V],Q[V]),it=I?O[V]/2-z-ot-et-k.mainAxis:U-ot-et-k.mainAxis,rt=I?-O[V]/2+z+ot+nt+k.mainAxis:K+ot+nt+k.mainAxis,st=e.elements.arrow&&J(e.elements.arrow),lt=st?"y"===T?st.clientTop||0:st.clientLeft||0:0,at=null!=(D=null==P?void 0:P[T])?D:0,ct=R+rt-at,ut=Z(y?N(F,R+it-at-lt):F,R,y?q(W,ct):W);L[T]=ut,H[T]=ut-R}if(p){var dt,pt="x"===T?o:s,ht="x"===T?i:r,ft=L[E],vt="y"===E?"height":"width",mt=ft+C[pt],gt=ft-C[ht],wt=-1!==[o,s].indexOf(S),bt=null!=(dt=null==P?void 0:P[E])?dt:0,Ct=wt?mt:ft-O[vt]-A[vt]-bt+k.altAxis,St=wt?ft+O[vt]+A[vt]-bt-k.altAxis:gt,xt=y&&wt?function(t,e,n){var o=Z(t,e,n);return o>n?n:o}(Ct,ft,St):Z(y?Ct:mt,ft,y?St:gt);L[E]=xt,H[E]=xt-ft}e.modifiersData[l]=H}},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=H(e.width)/t.offsetWidth||1,o=H(e.height)/t.offsetHeight||1;return 1!==n||1!==o}(e),l=W(e),a=j(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==L(e)||dt(l))&&(c=(o=e)!==O(o)&&_(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:ct(o)),_(e)?((u=j(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 Lt(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 Ot={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}},158:function(t,e,n){var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.HSFileUpload=e.HSDataTable=e.HSStaticMethods=e.HSTooltip=e.HSTogglePassword=e.HSToggleCount=e.HSThemeSwitch=e.HSTabs=e.HSStrongPassword=e.HSStepper=e.HSSelect=e.HSScrollspy=e.HSRemoveElement=e.HSPinInput=e.HSOverlay=e.HSInputNumber=e.HSDropdown=e.HSComboBox=e.HSCollapse=e.HSCarousel=e.HSAccordion=e.HSCopyMarkup=void 0;var i=n(406);Object.defineProperty(e,"HSCopyMarkup",{enumerable:!0,get:function(){return o(i).default}});var r=n(740);Object.defineProperty(e,"HSAccordion",{enumerable:!0,get:function(){return o(r).default}});var s=n(268);Object.defineProperty(e,"HSCarousel",{enumerable:!0,get:function(){return o(s).default}});var l=n(485);Object.defineProperty(e,"HSCollapse",{enumerable:!0,get:function(){return o(l).default}});var a=n(809);Object.defineProperty(e,"HSComboBox",{enumerable:!0,get:function(){return o(a).default}});var c=n(891);Object.defineProperty(e,"HSDropdown",{enumerable:!0,get:function(){return o(c).default}});var u=n(332);Object.defineProperty(e,"HSInputNumber",{enumerable:!0,get:function(){return o(u).default}});var d=n(850);Object.defineProperty(e,"HSOverlay",{enumerable:!0,get:function(){return o(d).default}});var p=n(60);Object.defineProperty(e,"HSPinInput",{enumerable:!0,get:function(){return o(p).default}});var h=n(911);Object.defineProperty(e,"HSRemoveElement",{enumerable:!0,get:function(){return o(h).default}});var f=n(751);Object.defineProperty(e,"HSScrollspy",{enumerable:!0,get:function(){return o(f).default}});var v=n(442);Object.defineProperty(e,"HSSelect",{enumerable:!0,get:function(){return o(v).default}});var m=n(887);Object.defineProperty(e,"HSStepper",{enumerable:!0,get:function(){return o(m).default}});var g=n(97);Object.defineProperty(e,"HSStrongPassword",{enumerable:!0,get:function(){return o(g).default}});var y=n(166);Object.defineProperty(e,"HSTabs",{enumerable:!0,get:function(){return o(y).default}});var w=n(502);Object.defineProperty(e,"HSThemeSwitch",{enumerable:!0,get:function(){return o(w).default}});var b=n(684);Object.defineProperty(e,"HSToggleCount",{enumerable:!0,get:function(){return o(b).default}});var C=n(100);Object.defineProperty(e,"HSTogglePassword",{enumerable:!0,get:function(){return o(C).default}});var S=n(969);Object.defineProperty(e,"HSTooltip",{enumerable:!0,get:function(){return o(S).default}});var x=n(957);Object.defineProperty(e,"HSStaticMethods",{enumerable:!0,get:function(){return o(x).default}}),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery?e.HSDataTable=n(814).default:e.HSDataTable=null,"undefined"!=typeof _&&"undefined"!=typeof Dropzone?e.HSFileUpload=n(234).default:e.HSFileUpload=null},740: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 i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(self,(()=>(()=>{"use strict";var t={170:(t,e,n)=>{n.r(e),n.d(e,{afterMain:()=>C,afterRead:()=>w,afterWrite:()=>T,applyStyles:()=>P,arrow:()=>Z,auto:()=>l,basePlacements:()=>a,beforeMain:()=>b,beforeRead:()=>g,beforeWrite:()=>x,bottom:()=>o,clippingParents:()=>d,computeStyles:()=>nt,createPopper:()=>Pt,createPopperBase:()=>kt,createPopperLite:()=>Dt,detectOverflow:()=>yt,end:()=>u,eventListeners:()=>ot,flip:()=>wt,hide:()=>Ct,left:()=>s,main:()=>S,modifierPhases:()=>E,offset:()=>xt,placements:()=>m,popper:()=>h,popperGenerator:()=>_t,popperOffsets:()=>It,preventOverflow:()=>Tt,read:()=>y,reference:()=>f,right:()=>r,start:()=>c,top:()=>i,variationPlacements:()=>v,viewport:()=>p,write:()=>I});var i="top",o="bottom",r="right",s="left",l="auto",a=[i,o,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])}),[]),g="beforeRead",y="read",w="afterRead",b="beforeMain",S="main",C="afterMain",x="beforeWrite",I="write",T="afterWrite",E=[g,y,w,b,S,C,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 _(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]||{},i=e.attributes[t]||{},o=e.elements[t];_(o)&&O(o)&&(Object.assign(o.style,n),Object.keys(i).forEach((function(t){var e=i[t];!1===e?o.removeAttribute(t):o.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 i=e.elements[t],o=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});_(i)&&O(i)&&(Object.assign(i.style,r),Object.keys(o).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]};function D(t){return t.split("-")[0]}var B=Math.max,q=Math.min,H=Math.round;function M(){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 N(){return!/^((?!chrome|android).)*safari/i.test(M())}function j(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var i=t.getBoundingClientRect(),o=1,r=1;e&&_(t)&&(o=t.offsetWidth>0&&H(i.width)/t.offsetWidth||1,r=t.offsetHeight>0&&H(i.height)/t.offsetHeight||1);var s=(A(t)?L(t):window).visualViewport,l=!N()&&n,a=(i.left+(l&&s?s.offsetLeft:0))/o,c=(i.top+(l&&s?s.offsetTop:0))/r,u=i.width/o,d=i.height/r;return{width:u,height:d,top:c,right:a+u,bottom:c+d,left:a,x:a,y:c}}function $(t){var e=j(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function V(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&k(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function R(t){return L(t).getComputedStyle(t)}function F(t){return["table","td","th"].indexOf(O(t))>=0}function W(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)||W(t)}function z(t){return _(t)&&"fixed"!==R(t).position?t.offsetParent:null}function Q(t){for(var e=L(t),n=z(t);n&&F(n)&&"static"===R(n).position;)n=z(n);return n&&("html"===O(n)||"body"===O(n)&&"static"===R(n).position)?e:n||function(t){var e=/firefox/i.test(M());if(/Trident/i.test(M())&&_(t)&&"fixed"===R(t).position)return null;var n=U(t);for(k(n)&&(n=n.host);_(n)&&["html","body"].indexOf(O(n))<0;){var i=R(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(t)||e}function J(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function K(t,e,n){return B(t,q(e,n))}function Y(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 Z={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=D(n.placement),h=J(p),f=[s,r].indexOf(p)>=0?"height":"width";if(u&&d){var v=function(t,e){return Y("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:X(t,a))}(c.padding,n),m=$(u),g="y"===h?i:s,y="y"===h?o:r,w=n.rects.reference[f]+n.rects.reference[h]-d[h]-n.rects.popper[f],b=d[h]-n.rects.reference[h],S=Q(u),C=S?"y"===h?S.clientHeight||0:S.clientWidth||0:0,x=w/2-b/2,I=v[g],T=C-m[f]-v[y],E=C/2-m[f]/2+x,O=K(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,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&V(e.elements.popper,i)&&(e.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function G(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,g=d.x,y=void 0===g?0:g,w=d.y,b=void 0===w?0:w,S="function"==typeof v?v({x:y,y:b}):{x:y,y:b};y=S.x,b=S.y;var C=d.hasOwnProperty("x"),x=d.hasOwnProperty("y"),I=s,T=i,E=window;if(f){var O=Q(n),A="clientHeight",_="clientWidth";if(O===L(n)&&"static"!==R(O=W(n)).position&&"absolute"===p&&(A="scrollHeight",_="scrollWidth"),a===i||(a===s||a===r)&&c===u)T=o,b-=(m&&O===E&&E.visualViewport?E.visualViewport.height:O[A])-l.height,b*=h?1:-1;if(a===s||(a===i||a===o)&&c===u)I=r,y-=(m&&O===E&&E.visualViewport?E.visualViewport.width:O[_])-l.width,y*=h?1:-1}var k,P=Object.assign({position:p},f&&tt),D=!0===v?function(t,e){var n=t.x,i=t.y,o=e.devicePixelRatio||1;return{x:H(n*o)/o||0,y:H(i*o)/o||0}}({x:y,y:b},L(n)):{x:y,y:b};return y=D.x,b=D.y,h?Object.assign({},P,((k={})[T]=x?"0":"",k[I]=C?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",k)):Object.assign({},P,((e={})[T]=x?b+"px":"",e[I]=C?y+"px":"",e.transform="",e))}const nt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,i=n.gpuAcceleration,o=void 0===i||i,r=n.adaptive,s=void 0===r||r,l=n.roundOffsets,a=void 0===l||l,c={placement:D(e.placement),variation:G(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,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 it={passive:!0};const ot={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,i=t.options,o=i.scroll,r=void 0===o||o,s=i.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,it)})),l&&a.addEventListener("resize",n.update,it),function(){r&&c.forEach((function(t){t.removeEventListener("scroll",n.update,it)})),l&&a.removeEventListener("resize",n.update,it)}},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 j(W(t)).left+ct(t).scrollLeft}function dt(t){var e=R(t),n=e.overflow,i=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+i)}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 i=pt(t),o=i===(null==(n=t.ownerDocument)?void 0:n.body),r=L(i),s=o?[r].concat(r.visualViewport||[],dt(i)?i:[]):i,l=e.concat(s);return o?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),i=W(t),o=n.visualViewport,r=i.clientWidth,s=i.clientHeight,l=0,a=0;if(o){r=o.width,s=o.height;var c=N();(c||!c&&"fixed"===e)&&(l=o.offsetLeft,a=o.offsetTop)}return{width:r,height:s,x:l+ut(t),y:a}}(t,n)):A(e)?function(t,e){var n=j(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=W(t),i=ct(t),o=null==(e=t.ownerDocument)?void 0:e.body,r=B(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=B(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-i.scrollLeft+ut(t),a=-i.scrollTop;return"rtl"===R(o||n).direction&&(l+=B(n.clientWidth,o?o.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}(W(t)))}function mt(t,e,n,i){var o="clippingParents"===e?function(t){var e=ht(U(t)),n=["absolute","fixed"].indexOf(R(t).position)>=0&&_(t)?Q(t):t;return A(n)?e.filter((function(t){return A(t)&&V(t,n)&&"body"!==O(t)})):[]}(t):[].concat(e),r=[].concat(o,[n]),s=r[0],l=r.reduce((function(e,n){var o=vt(t,n,i);return e.top=B(o.top,e.top),e.right=q(o.right,e.right),e.bottom=q(o.bottom,e.bottom),e.left=B(o.left,e.left),e}),vt(t,s,i));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function gt(t){var e,n=t.reference,l=t.element,a=t.placement,d=a?D(a):null,p=a?G(a):null,h=n.x+n.width/2-l.width/2,f=n.y+n.height/2-l.height/2;switch(d){case i:e={x:h,y:n.y-l.height};break;case o: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?J(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 yt(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,g=n.rootBoundary,y=void 0===g?p:g,w=n.elementContext,b=void 0===w?h:w,S=n.altBoundary,C=void 0!==S&&S,x=n.padding,I=void 0===x?0:x,T=Y("number"!=typeof I?I:X(I,a)),E=b===h?f:h,O=t.rects.popper,L=t.elements[C?E:b],_=mt(A(L)?L:L.contextElement||W(t.elements.popper),m,y,u),k=j(t.elements.reference),P=gt({reference:k,element:O,strategy:"absolute",placement:l}),D=ft(Object.assign({},O,P)),B=b===h?D:k,q={top:_.top-B.top+T.top,bottom:B.bottom-_.bottom+T.bottom,left:_.left-B.left+T.left,right:B.right-_.right+T.right},H=t.modifiersData.offset;if(b===h&&H){var M=H[l];Object.keys(q).forEach((function(t){var e=[r,o].indexOf(t)>=0?1:-1,n=[i,o].indexOf(t)>=0?"y":"x";q[t]+=M[n]*e}))}return q}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,g=n.fallbackPlacements,y=n.padding,w=n.boundary,b=n.rootBoundary,S=n.altBoundary,C=n.flipVariations,x=void 0===C||C,I=n.allowedAutoPlacements,T=e.options.placement,E=D(T),O=g||(E===T||!x?[st(T)]:function(t){if(D(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(D(n)===l?function(t,e){void 0===e&&(e={});var n=e,i=n.placement,o=n.boundary,r=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=void 0===c?m:c,d=G(i),p=d?l?v:v.filter((function(t){return G(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]=yt(t,{placement:n,boundary:o,rootBoundary:r,padding:s})[D(n)],e}),{});return Object.keys(f).sort((function(t,e){return f[t]-f[e]}))}(e,{placement:n,boundary:w,rootBoundary:b,padding:y,flipVariations:x,allowedAutoPlacements:I}):n)}),[]),A=e.rects.reference,_=e.rects.popper,k=new Map,P=!0,B=L[0],q=0;q=0,$=j?"width":"height",V=yt(e,{placement:H,boundary:w,rootBoundary:b,altBoundary:S,padding:y}),R=j?N?r:s:N?o:i;A[$]>_[$]&&(R=st(R));var F=st(R),W=[];if(p&&W.push(V[M]<=0),f&&W.push(V[R]<=0,V[F]<=0),W.every((function(t){return t}))){B=H,P=!1;break}k.set(H,W)}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 B=e,"break"},z=x?3:1;z>0;z--){if("break"===U(z))break}e.placement!==B&&(e.modifiersData[u]._skip=!0,e.placement=B,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 St(t){return[i,r,o,s].some((function(e){return t[e]>=0}))}const Ct={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,i=e.rects.reference,o=e.rects.popper,r=e.modifiersData.preventOverflow,s=yt(e,{elementContext:"reference"}),l=yt(e,{altBoundary:!0}),a=bt(s,i),c=bt(l,o,r),u=St(a),d=St(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,o=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 o=D(t),l=[s,i].indexOf(o)>=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(o)>=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[o]=c}};const It={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=gt({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,v=n.altBoundary,m=n.padding,g=n.tether,y=void 0===g||g,w=n.tetherOffset,b=void 0===w?0:w,S=yt(e,{boundary:h,rootBoundary:f,padding:m,altBoundary:v}),C=D(e.placement),x=G(e.placement),I=!x,T=J(C),E="x"===T?"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,H={x:0,y:0};if(O){if(u){var M,N="y"===T?i:s,j="y"===T?o:r,V="y"===T?"height":"width",R=O[T],F=R+S[N],W=R-S[j],U=y?-A[V]/2:0,z=x===c?L[V]:A[V],Y=x===c?-A[V]:-L[V],X=e.elements.arrow,Z=y&&X?$(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[N],nt=tt[j],it=K(0,L[V],Z[V]),ot=I?L[V]/2-U-it-et-k.mainAxis:z-it-et-k.mainAxis,rt=I?-L[V]/2+U+it+nt+k.mainAxis:Y+it+nt+k.mainAxis,st=e.elements.arrow&&Q(e.elements.arrow),lt=st?"y"===T?st.clientTop||0:st.clientLeft||0:0,at=null!=(M=null==P?void 0:P[T])?M:0,ct=R+rt-at,ut=K(y?q(F,R+ot-at-lt):F,R,y?B(W,ct):W);O[T]=ut,H[T]=ut-R}if(p){var dt,pt="x"===T?i:s,ht="x"===T?o:r,ft=O[E],vt="y"===E?"height":"width",mt=ft+S[pt],gt=ft-S[ht],wt=-1!==[i,s].indexOf(C),bt=null!=(dt=null==P?void 0:P[E])?dt:0,St=wt?mt:ft-L[vt]-A[vt]-bt+k.altAxis,Ct=wt?ft+L[vt]+A[vt]-bt-k.altAxis:gt,xt=y&&wt?function(t,e,n){var i=K(t,e,n);return i>n?n:i}(St,ft,Ct):K(y?St:mt,ft,y?Ct:gt);O[E]=xt,H[E]=xt-ft}e.modifiersData[l]=H}},requiresIfExists:["offset"]};function Et(t,e,n){void 0===n&&(n=!1);var i,o,r=_(e),s=_(e)&&function(t){var e=t.getBoundingClientRect(),n=H(e.width)/t.offsetWidth||1,i=H(e.height)/t.offsetHeight||1;return 1!==n||1!==i}(e),l=W(e),a=j(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==O(e)||dt(l))&&(c=(i=e)!==L(i)&&_(i)?{scrollLeft:(o=i).scrollLeft,scrollTop:o.scrollTop}:ct(i)),_(e)?((u=j(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,i=[];function o(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var i=e.get(t);i&&o(i)}})),i.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||o(t)})),i}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={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},158:function(t,e,n){ /* - * HSAccordion - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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 .hs-accordion.active")&&this.group.querySelector(":scope > .hs-accordion.active")!==this.el&&window.$hsAccordionCollection.find((function(t){return t.element.el===e.group.querySelector(":scope > .hs-accordion.active")})).element.hide();if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.content.style.display="block",this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px")})),(0,l.afterTransition)(this.content,(function(){e.content.style.display="block",e.content.style.height="",e.fireEvent("open",e.el),(0,l.dispatch)("open.hs.accordion",e.el,e.el)}))},e.prototype.hide=function(){var t,e=this;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),(0,l.afterTransition)(this.content,(function(){e.content.style.display="",e.content.style.height="0",e.fireEvent("close",e.el),(0,l.dispatch)("close.hs.accordion",e.el,e.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.treeView=function(){var t=this;if(!document.querySelectorAll(".hs-accordion-treeview-root").length)return!1;this.selectable=[],document.querySelectorAll(".hs-accordion-treeview-root").forEach((function(e){var n=null==e?void 0:e.getAttribute("data-hs-accordion-options"),o=n?JSON.parse(n):{};t.selectable.push({el:e,options:r({},o)})})),this.selectable.length&&this.selectable.forEach((function(e){e.el.querySelectorAll(".hs-accordion-selectable").forEach((function(n){n.addEventListener("click",(function(o){o.stopPropagation(),t.toggleSelected(e,n)}))}))}))},e.toggleSelected=function(t,e){e.classList.contains("selected")?e.classList.remove("selected"):(t.el.querySelectorAll(".hs-accordion-selectable").forEach((function(t){return t.classList.remove("selected")})),e.classList.add("selected"))},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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit(),document.querySelectorAll(".hs-accordion-treeview-root").length&&a.treeView()})),"undefined"!=typeof window&&(window.HSAccordion=a),e.default=a},961:(t,e)=>{ +var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.HSRangeSlider=e.HSFileUpload=e.HSDataTable=e.HSStaticMethods=e.HSTreeView=e.HSTooltip=e.HSTogglePassword=e.HSToggleCount=e.HSThemeSwitch=e.HSTextareaAutoHeight=e.HSTabs=e.HSStrongPassword=e.HSStepper=e.HSSelect=e.HSScrollspy=e.HSRemoveElement=e.HSPinInput=e.HSOverlay=e.HSInputNumber=e.HSDropdown=e.HSComboBox=e.HSCollapse=e.HSCarousel=e.HSAccordion=e.HSCopyMarkup=void 0;var o=n(406);Object.defineProperty(e,"HSCopyMarkup",{enumerable:!0,get:function(){return i(o).default}});var r=n(740);Object.defineProperty(e,"HSAccordion",{enumerable:!0,get:function(){return i(r).default}});var s=n(268);Object.defineProperty(e,"HSCarousel",{enumerable:!0,get:function(){return i(s).default}});var l=n(485);Object.defineProperty(e,"HSCollapse",{enumerable:!0,get:function(){return i(l).default}});var a=n(809);Object.defineProperty(e,"HSComboBox",{enumerable:!0,get:function(){return i(a).default}});var c=n(891);Object.defineProperty(e,"HSDropdown",{enumerable:!0,get:function(){return i(c).default}});var u=n(332);Object.defineProperty(e,"HSInputNumber",{enumerable:!0,get:function(){return i(u).default}});var d=n(850);Object.defineProperty(e,"HSOverlay",{enumerable:!0,get:function(){return i(d).default}});var p=n(60);Object.defineProperty(e,"HSPinInput",{enumerable:!0,get:function(){return i(p).default}});var h=n(911);Object.defineProperty(e,"HSRemoveElement",{enumerable:!0,get:function(){return i(h).default}});var f=n(751);Object.defineProperty(e,"HSScrollspy",{enumerable:!0,get:function(){return i(f).default}});var v=n(442);Object.defineProperty(e,"HSSelect",{enumerable:!0,get:function(){return i(v).default}});var m=n(887);Object.defineProperty(e,"HSStepper",{enumerable:!0,get:function(){return i(m).default}});var g=n(97);Object.defineProperty(e,"HSStrongPassword",{enumerable:!0,get:function(){return i(g).default}});var y=n(166);Object.defineProperty(e,"HSTabs",{enumerable:!0,get:function(){return i(y).default}});var w=n(144);Object.defineProperty(e,"HSTextareaAutoHeight",{enumerable:!0,get:function(){return i(w).default}});var b=n(502);Object.defineProperty(e,"HSThemeSwitch",{enumerable:!0,get:function(){return i(b).default}});var S=n(684);Object.defineProperty(e,"HSToggleCount",{enumerable:!0,get:function(){return i(S).default}});var C=n(100);Object.defineProperty(e,"HSTogglePassword",{enumerable:!0,get:function(){return i(C).default}});var x=n(969);Object.defineProperty(e,"HSTooltip",{enumerable:!0,get:function(){return i(x).default}});var I=n(772);Object.defineProperty(e,"HSTreeView",{enumerable:!0,get:function(){return i(I).default}});var T=n(957);Object.defineProperty(e,"HSStaticMethods",{enumerable:!0,get:function(){return i(T).default}}),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery?e.HSDataTable=n(814).default:e.HSDataTable=null,"undefined"!=typeof _&&"undefined"!=typeof Dropzone?e.HSFileUpload=n(234).default:e.HSFileUpload=null,void 0!==typeof noUiSlider?e.HSRangeSlider=n(347).default:e.HSRangeSlider=null},740:function(t,e,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSAccordion + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},268:function(t,e,n){ +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;n .hs-accordion.active")&&this.group.querySelector(":scope > .hs-accordion.active")!==this.el&&window.$hsAccordionCollection.find((function(t){return t.element.el===e.group.querySelector(":scope > .hs-accordion.active")})).element.hide();if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.content.style.display="block",this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px")})),(0,l.afterTransition)(this.content,(function(){e.content.style.display="block",e.content.style.height="",e.fireEvent("open",e.el),(0,l.dispatch)("open.hs.accordion",e.el,e.el)}))},e.prototype.hide=function(){var t,e=this;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),(0,l.afterTransition)(this.content,(function(){e.content.style.display="",e.content.style.height="0",e.fireEvent("close",e.el),(0,l.dispatch)("close.hs.accordion",e.el,e.el)}))},e.prototype.update=function(){var t=this;if(this.group=this.el.closest(".hs-accordion-group")||null,!this.group)return!1;this.isAlwaysOpened=this.group.hasAttribute("data-hs-accordion-always-open")||!1,window.$hsAccordionCollection.map((function(e){return e.id===t.el.id&&(e.element.group=t.group,e.element.isAlwaysOpened=t.isAlwaysOpened),e}))},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.treeView=function(){var t=this;if(!document.querySelectorAll(".hs-accordion-treeview-root").length)return!1;this.selectable=[],document.querySelectorAll(".hs-accordion-treeview-root").forEach((function(e){var n=null==e?void 0:e.getAttribute("data-hs-accordion-options"),i=n?JSON.parse(n):{};t.selectable.push({el:e,options:r({},i)})})),this.selectable.length&&this.selectable.forEach((function(e){e.el.querySelectorAll(".hs-accordion-selectable").forEach((function(n){n.addEventListener("click",(function(i){i.stopPropagation(),t.toggleSelected(e,n)}))}))}))},e.toggleSelected=function(t,e){e.classList.contains("selected")?e.classList.remove("selected"):(t.el.querySelectorAll(".hs-accordion-selectable").forEach((function(t){return t.classList.remove("selected")})),e.classList.add("selected"))},e.on=function(t,e,n){var i=window.$hsAccordionCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));i&&(i.element.events[t]=n)},e}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit(),document.querySelectorAll(".hs-accordion-treeview-root").length&&a.treeView()})),"undefined"!=typeof window&&(window.HSAccordion=a),e.default=a},961:(t,e)=>{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},268:function(t,e,n){ /* * HSCarousel - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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=this.calculateTransform(),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.calculateTransform=function(){var t=this.currentIndex*this.sliderWidth;return this.isRTL?"translate(".concat(t,"px, 0px)"):"translate(-".concat(t,"px, 0px)")},e.prototype.goToPrev=function(){0===this.currentIndex&&this.isInfiniteLoop?(this.currentIndex=this.slides.length-1,this.inner.style.transform=this.calculateTransform(),this.addCurrentClass()):0!==this.currentIndex&&(this.currentIndex-=1,this.inner.style.transform=this.calculateTransform(),this.addCurrentClass(),this.addDisabledClass())},e.prototype.goToNext=function(){this.currentIndex===this.slides.length-1&&this.isInfiniteLoop?(this.currentIndex=0,this.inner.style.transform=this.calculateTransform(),this.addCurrentClass()):this.currentIndext?s:-i:i>r?r:i<-t?s:i}())}},e.prototype.handleDragEnd=function(){var t=this;if(this.isDragging){this.isDragging=!1;var e=this.sliderWidth/this.getCurrentSlidesQty(),n=this.getTranslateXValue(),i=Math.round(n/e);this.isRTL&&(i=Math.round(n/e)),this.inner.classList.remove("dragging"),setTimeout((function(){t.calculateTransform(i),t.dots&&t.setCurrentDot(),t.dragStartX=null,t.initialTranslateX=null,t.inner.querySelectorAll("a.prevented-click").forEach((function(e){e.classList.remove("prevented-click"),e.removeEventListener("click",t.removeClickEventWhileDragging)}))}))}},e.prototype.getEventX=function(t){return t instanceof MouseEvent?t.clientX:t.touches[0].clientX},e.prototype.getCurrentSlidesQty=function(){var t=this;if("object"==typeof this.slidesQty){var e=document.body.clientWidth,n=0;return Object.keys(this.slidesQty).forEach((function(i){e>=(typeof i+1=="number"?t.slidesQty[i]:c.BREAKPOINTS[i])&&(n=t.slidesQty[i])})),n}return this.slidesQty},e.prototype.buildSnapSpacers=function(){var t=this.inner.querySelector(".hs-snap-before"),e=this.inner.querySelector(".hs-snap-after");t&&t.remove(),e&&e.remove();var n=this.sliderWidth,i=n/2-n/this.getCurrentSlidesQty()/2,o=(0,l.htmlToElement)('
')),r=(0,l.htmlToElement)('
'));this.inner.prepend(o),this.inner.appendChild(r)},e.prototype.initDots=function(){this.el.querySelectorAll(".hs-carousel-pagination-item").length?this.setDots():this.buildDots(),this.dots&&this.setCurrentDot()},e.prototype.buildDots=function(){this.dots.innerHTML="";for(var t=!this.isCentered&&this.slidesQty?this.slides.length-(this.getCurrentSlidesQty()-1):this.slides.length,e=0;en+o)&&(p=c-o),(ui+r)&&(h=d-r),t.scrollTo({left:p,top:h,behavior:"smooth"})},e.prototype.buildInfo=function(){this.infoTotal&&this.setInfoTotal(),this.infoCurrent&&this.setInfoCurrent()},e.prototype.setInfoTotal=function(){this.infoTotal.innerText="".concat(this.slides.length)},e.prototype.setInfoCurrent=function(){this.infoCurrent.innerText="".concat(this.currentIndex+1)},e.prototype.buildSingleDot=function(t){var e=(0,l.htmlToElement)("");return this.dotsItemClasses&&(0,l.classToClassList)(this.dotsItemClasses,e),this.singleDotEvents(e,t),e},e.prototype.singleDotEvents=function(t,e){var n=this;t.addEventListener("click",(function(){n.goTo(e),n.isAutoPlay&&(n.resetTimer(),n.setTimer())}))},e.prototype.observeResize=function(){var t=this;new ResizeObserver((0,l.debounce)((function(e){for(var n=0,i=e;n=this.currentIndex-e?i.classList.add("active"):i.classList.remove("active")}else{var o=this.isCentered?this.currentIndex+this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.currentIndex+this.getCurrentSlidesQty();this.slides.forEach((function(e,n){n>=t.currentIndex&&n *").forEach((function(t,n){return e(t,n)}))},e.prototype.setElementToDisabled=function(t){t.classList.add("disabled"),"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled")},e.prototype.unsetElementToDisabled=function(t){t.classList.remove("disabled"),"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled")},e.prototype.addDisabledClass=function(){if(!this.prev||!this.next)return!1;var t=getComputedStyle(this.inner).getPropertyValue("gap"),e=Math.floor(this.getCurrentSlidesQty()/2),n=0,i=0,o=!1,r=!1;this.isSnap?(n=this.currentIndex,i=this.hasSnapSpacers?this.slides.length-1:this.slides.length-e-1,o=this.hasSnapSpacers?0===n:this.getCurrentSlidesQty()%2==0?n-e<0:n-e==0,r=n>=i&&this.container.scrollLeft+this.container.clientWidth+(parseFloat(t)||0)>=this.container.scrollWidth):(o=0===(n=this.currentIndex),r=n>=(i=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty())),o?(this.unsetElementToDisabled(this.next),this.setElementToDisabled(this.prev)):r?(this.unsetElementToDisabled(this.prev),this.setElementToDisabled(this.next)):(this.unsetElementToDisabled(this.prev),this.unsetElementToDisabled(this.next))},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.getBoundingClientRect().width,this.calculateWidth(),this.sliderWidth!==this.inner.parentElement.getBoundingClientRect().width&&this.recalculateWidth()},e.prototype.calculateTransform=function(t){void 0!==t&&(this.currentIndex=t),this.currentIndex>this.slides.length-this.getCurrentSlidesQty()&&!this.isCentered&&(this.currentIndex=this.slides.length-this.getCurrentSlidesQty());var e=this.sliderWidth,n=e/this.getCurrentSlidesQty(),i=this.currentIndex*n;if(this.isSnap&&!this.isCentered&&this.container.scrollLefte&&(this.container.scrollLeft=this.container.scrollWidth),this.isCentered&&!this.isSnap){var o=(e-n)/2;if(0===this.currentIndex)i=-o;else if(this.currentIndex>=this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1)){i=this.slides.length*n-e+o}else i=this.currentIndex*n-o}this.isSnap||(this.inner.style.transform=this.isRTL?"translate(".concat(i,"px, 0px)"):"translate(".concat(-i,"px, 0px)")),this.isAutoHeight&&(this.inner.style.height="".concat(this.slides[this.currentIndex].clientHeight,"px")),this.dotsItems&&this.goToCurrentDot(),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass(),this.isSnap&&this.hasSnapSpacers&&this.buildSnapSpacers(),this.infoCurrent&&this.setInfoCurrent()},e.prototype.setTranslate=function(t){this.inner.style.transform=this.isRTL?"translate(".concat(-t,"px, 0px)"):"translate(".concat(t,"px, 0px)")},e.prototype.goToPrev=function(){if(this.currentIndex>0?this.currentIndex--:this.currentIndex=this.slides.length-this.getCurrentSlidesQty(),this.isSnap){var t=this.sliderWidth/this.getCurrentSlidesQty();this.container.scrollBy({left:Math.max(-this.container.scrollLeft,-t),behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()},e.prototype.goToNext=function(){var t=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty();if(this.currentIndexthis.currentIndex?e-this.currentIndex:this.currentIndex-e,o=e>this.currentIndex?-n*i:n*i;this.container.scrollBy({left:o,behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()},e.prototype.setIndex=function(t){this.currentIndex=t,this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()},e.getInstance=function(t,e){var n=window.$hsCarouselCollection.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.$hsCarouselCollection||(window.$hsCarouselCollection=[]),document.querySelectorAll("[data-hs-carousel]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsCarouselCollection.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}(a.default);window.addEventListener("load",(function(){u.autoInit()})),"undefined"!=typeof window&&(window.HSCarousel=u),e.default=u},485:function(t,e,n){ /* * HSCollapse - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(292),l=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,e=this;this.createCollection(window.$hsCollapseCollection,this),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.el.ariaExpanded="true":this.el.ariaExpanded="false"),this.el.addEventListener("click",(function(){e.content.classList.contains("open")?e.hide():e.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,e=this;if(this.animationInProcess||this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.add("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="true"),this.content.classList.add("open"),this.content.classList.remove("hidden"),this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px"),e.fireEvent("beforeOpen",e.el),(0,s.dispatch)("beforeOpen.hs.collapse",e.el,e.el)})),(0,s.afterTransition)(this.content,(function(){e.content.style.height="",e.fireEvent("open",e.el),(0,s.dispatch)("open.hs.collapse",e.el,e.el),e.animationInProcess=!1}))},e.prototype.hide=function(){var t,e=this;if(this.animationInProcess||!this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.remove("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),this.content.classList.remove("open"),(0,s.afterTransition)(this.content,(function(){e.content.classList.add("hidden"),e.content.style.height="",e.fireEvent("hide",e.el),(0,s.dispatch)("hide.hs.collapse",e.el,e.el),e.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}(r(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSCollapse=l),e.default=l},809:function(t,e,n){ +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.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(292),l=function(t){function e(e,n,i){var o=t.call(this,e,n,i)||this;return o.contentId=o.el.dataset.hsCollapse,o.content=document.querySelector(o.contentId),o.animationInProcess=!1,o.content&&o.init(),o}return o(e,t),e.prototype.init=function(){var t,e=this;this.createCollection(window.$hsCollapseCollection,this),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.el.ariaExpanded="true":this.el.ariaExpanded="false"),this.el.addEventListener("click",(function(){e.content.classList.contains("open")?e.hide():e.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,e=this;if(this.animationInProcess||this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.add("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="true"),this.content.classList.add("open"),this.content.classList.remove("hidden"),this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px"),e.fireEvent("beforeOpen",e.el),(0,s.dispatch)("beforeOpen.hs.collapse",e.el,e.el)})),(0,s.afterTransition)(this.content,(function(){e.content.style.height="",e.fireEvent("open",e.el),(0,s.dispatch)("open.hs.collapse",e.el,e.el),e.animationInProcess=!1}))},e.prototype.hide=function(){var t,e=this;if(this.animationInProcess||!this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.remove("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),this.content.classList.remove("open"),(0,s.afterTransition)(this.content,(function(){e.content.classList.add("hidden"),e.content.style.height="",e.fireEvent("hide",e.el),(0,s.dispatch)("hide.hs.collapse",e.el,e.el),e.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 i=window.$hsCollapseCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));i&&(i.element.events[t]=n)},e}(r(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSCollapse=l),e.default=l},809:function(t,e,n){ /* * HSComboBox - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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]\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t',_.outputEmptyTemplate=null!==(f=null==B?void 0:B.outputEmptyTemplate)&&void 0!==f?f:'
Nothing found...
',_.outputLoaderTemplate=null!==(v=null==B?void 0:B.outputLoaderTemplate)&&void 0!==v?v:'
\n\t\t\t\t
\n\t\t\t\t\tLoading...\n\t\t\t\t
\n\t\t\t
',_.groupingType=null!==(m=null==B?void 0:B.groupingType)&&void 0!==m?m:null,_.groupingTitleTemplate=null!==(g=null==B?void 0:B.groupingTitleTemplate)&&void 0!==g?g:"default"===_.groupingType?'
':'',_.tabsWrapperTemplate=null!==(y=null==B?void 0:B.tabsWrapperTemplate)&&void 0!==y?y:'
',_.preventSelection=null!==(w=null==B?void 0:B.preventSelection)&&void 0!==w&&w,_.preventAutoPosition=null!==(b=null==B?void 0:B.preventAutoPosition)&&void 0!==b&&b,_.isOpenOnFocus=null!==(C=null==B?void 0:B.isOpenOnFocus)&&void 0!==C&&C,_.input=null!==(S=_.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==S?S:null,_.output=null!==(x=_.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==x?x:null,_.itemsWrapper=null!==(I=_.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==I?I:null,_.items=null!==(T=Array.from(_.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==T?T:[],_.tabs=[],_.toggle=null!==(E=_.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==E?E:null,_.toggleClose=null!==(L=_.el.querySelector("[data-hs-combo-box-close]"))&&void 0!==L?L:null,_.toggleOpen=null!==(O=_.el.querySelector("[data-hs-combo-box-open]"))&&void 0!==O?O:null,_.outputPlaceholder=null,_.selected=_.value=null!==(A=_.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==A?A:"",_.isOpened=!1,_.isCurrent=!1,_.animationInProcess=!1,_.selectedGroup="all",_.init(),_}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.preventAutoPosition||this.recalculateDirection()),this.toggle&&this.buildToggle(),this.toggleClose&&this.buildToggleClose(),this.toggleOpen&&this.buildToggleOpen()},e.prototype.setResultAndRender=function(t){void 0===t&&(t="");var e=this.preventVisibility?this.input.value:t;this.setResults(e),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.input.value?t.el.classList.add("has-value"):t.el.classList.remove("has-value"),t.isOpened||t.open()})))},e.prototype.buildItems=function(){this.output.role="listbox",this.output.tabIndex=-1,this.output.ariaOrientation="vertical",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){var n,o,i,r=null!==(n=e.getAttribute("data-hs-combo-box-output-item-group-field"))&&void 0!==n?n:null,s=null!==(o=JSON.parse(e.getAttribute("data-hs-combo-box-output-item")))&&void 0!==o?o:null,l=null;return r&&(null===(i=null==s?void 0:s.group)||void 0===i?void 0:i.name)&&(l=t[r]),Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(e){var n;return(null===(n=null==s?void 0:s.group)||void 0===n?void 0:n.name)&&l?l===s.group.name&&e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]: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,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,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,u.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){var o=(0,u.htmlToElement)(e.outputItemTemplate);o.querySelectorAll("[data-hs-combo-box-output-item-field]").forEach((function(e){var n=t[e.getAttribute("data-hs-combo-box-output-item-field")],o=e.hasAttribute("data-hs-combo-box-output-item-hide-if-empty");e.textContent=null!=n?n:"",!n&&o&&(e.style.display="none")})),o.querySelectorAll("[data-hs-combo-box-search-text]").forEach((function(e){var n;e.setAttribute("data-hs-combo-box-search-text",null!==(n=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==n?n:"")})),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,u.htmlToElement)(this.tabsWrapperTemplate),n=(0,u.htmlToElement)('
');e.append(n),this.output.insertBefore(e,this.output.firstChild);var o=(0,u.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,u.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,u.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,e,n,o,i=this;this.isOpened?((null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="true")):((null===(n=null==this?void 0:this.toggle)||void 0===n?void 0:n.ariaExpanded)&&(this.toggle.ariaExpanded="false"),(null===(o=null==this?void 0:this.input)||void 0===o?void 0:o.ariaExpanded)&&(this.input.ariaExpanded="false")),this.toggle.addEventListener("click",(function(){i.isOpened?i.close():i.open(i.toggle.getAttribute("data-hs-combo-box-toggle"))}))},e.prototype.buildToggleClose=function(){var t=this;this.toggleClose.addEventListener("click",(function(){return t.close()}))},e.prototype.buildToggleOpen=function(){var t=this;this.toggleOpen.addEventListener("click",(function(){return t.open()}))},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,this.fireEvent("select",this.el),(0,u.dispatch)("select.hs.combobox",this.el,this.value)},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,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.preventAutoPosition||this.recalculateDirection(),setTimeout((function(){var t,n;(null===(t=null==e?void 0:e.input)||void 0===t?void 0:t.ariaExpanded)&&(e.input.ariaExpanded="true"),(null===(n=null==e?void 0:e.toggle)||void 0===n?void 0:n.ariaExpanded)&&(e.toggle.ariaExpanded="true"),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,n,o=this;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),!1):(this.animationInProcess=!0,(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="false"),(null===(n=null==this?void 0:this.toggle)||void 0===n?void 0:n.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.el.classList.remove("active"),this.preventAutoPosition||(this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom=""),(0,u.afterTransition)(this.output,(function(){o.output.style.display="none",o.setValueAndClear(t),o.animationInProcess=!1})),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),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 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.preventVisibility?t.element.isCurrent: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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+10&&o[o.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t',_.outputEmptyTemplate=null!==(f=null==D?void 0:D.outputEmptyTemplate)&&void 0!==f?f:'
Nothing found...
',_.outputLoaderTemplate=null!==(v=null==D?void 0:D.outputLoaderTemplate)&&void 0!==v?v:'
\n\t\t\t\t
\n\t\t\t\t\tLoading...\n\t\t\t\t
\n\t\t\t
',_.groupingType=null!==(m=null==D?void 0:D.groupingType)&&void 0!==m?m:null,_.groupingTitleTemplate=null!==(g=null==D?void 0:D.groupingTitleTemplate)&&void 0!==g?g:"default"===_.groupingType?'
':'',_.tabsWrapperTemplate=null!==(y=null==D?void 0:D.tabsWrapperTemplate)&&void 0!==y?y:'
',_.preventSelection=null!==(w=null==D?void 0:D.preventSelection)&&void 0!==w&&w,_.preventAutoPosition=null!==(b=null==D?void 0:D.preventAutoPosition)&&void 0!==b&&b,_.isOpenOnFocus=null!==(S=null==D?void 0:D.isOpenOnFocus)&&void 0!==S&&S,_.input=null!==(C=_.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==C?C:null,_.output=null!==(x=_.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==x?x:null,_.itemsWrapper=null!==(I=_.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==I?I:null,_.items=null!==(T=Array.from(_.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==T?T:[],_.tabs=[],_.toggle=null!==(E=_.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==E?E:null,_.toggleClose=null!==(O=_.el.querySelector("[data-hs-combo-box-close]"))&&void 0!==O?O:null,_.toggleOpen=null!==(L=_.el.querySelector("[data-hs-combo-box-open]"))&&void 0!==L?L:null,_.outputPlaceholder=null,_.selected=_.value=null!==(A=_.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==A?A:"",_.isOpened=!1,_.isCurrent=!1,_.animationInProcess=!1,_.selectedGroup="all",_.init(),_}return o(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.preventAutoPosition||this.recalculateDirection()),this.toggle&&this.buildToggle(),this.toggleClose&&this.buildToggleClose(),this.toggleOpen&&this.buildToggleOpen()},e.prototype.setResultAndRender=function(t){void 0===t&&(t="");var e=this.preventVisibility?this.input.value:t;this.setResults(e),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.input.value?t.el.classList.add("has-value"):t.el.classList.remove("has-value"),t.isOpened||t.open()})))},e.prototype.buildItems=function(){this.output.role="listbox",this.output.tabIndex=-1,this.output.ariaOrientation="vertical",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){var n,i,o,r=null!==(n=e.getAttribute("data-hs-combo-box-output-item-group-field"))&&void 0!==n?n:null,s=null!==(i=JSON.parse(e.getAttribute("data-hs-combo-box-output-item")))&&void 0!==i?i:null,l=null;return r&&(null===(o=null==s?void 0:s.group)||void 0===o?void 0:o.name)&&(l=t[r]),Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(e){var n;return(null===(n=null==s?void 0:s.group)||void 0===n?void 0:n.name)&&l?l===s.group.name&&e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]: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,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,n,i,o,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 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 n=i.filter((function(e){return e[r.apiGroupField]===t.name}));r.itemsWrapper?r.itemsWrapper.append(e):r.output.append(e),r.jsonItemsRender(n)}))):this.jsonItemsRender(i),this.setResults(this.input.value),[3,5];case 4:return o=s.sent(),console.error(o),[3,5];case 5:return this.destroyOutputLoader(),[2]}}))}))},e.prototype.jsonItemsRender=function(t){var e=this;t.forEach((function(t,n){var i=(0,u.htmlToElement)(e.outputItemTemplate);i.querySelectorAll("[data-hs-combo-box-output-item-field]").forEach((function(e){var n=t[e.getAttribute("data-hs-combo-box-output-item-field")],i=e.hasAttribute("data-hs-combo-box-output-item-hide-if-empty");e.textContent=null!=n?n:"",!n&&i&&(e.style.display="none")})),i.querySelectorAll("[data-hs-combo-box-search-text]").forEach((function(e){var n;e.setAttribute("data-hs-combo-box-search-text",null!==(n=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==n?n:"")})),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(n){e.setAttribute(n.attr,t[n.valueFrom])}))})),i.setAttribute("tabIndex","".concat(n)),"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 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 i=t[e.apiGroupField];n.some((function(t){return t.name===i}))||n.push({name:i,title:i})})),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"),i=e.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text");return ni?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,u.htmlToElement)(this.tabsWrapperTemplate),n=(0,u.htmlToElement)('
');e.append(n),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),n.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),n.append(i),i.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,u.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 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,e,n,i,o=this;this.isOpened?((null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="true")):((null===(n=null==this?void 0:this.toggle)||void 0===n?void 0:n.ariaExpanded)&&(this.toggle.ariaExpanded="false"),(null===(i=null==this?void 0:this.input)||void 0===i?void 0:i.ariaExpanded)&&(this.input.ariaExpanded="false")),this.toggle.addEventListener("click",(function(){o.isOpened?o.close():o.open(o.toggle.getAttribute("data-hs-combo-box-toggle"))}))},e.prototype.buildToggleClose=function(){var t=this;this.toggleClose.addEventListener("click",(function(){return t.close()}))},e.prototype.buildToggleOpen=function(){var t=this;this.toggleOpen.addEventListener("click",(function(){return t.open()}))},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,this.fireEvent("select",this.el),(0,u.dispatch)("select.hs.combobox",this.el,this.value)},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,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.preventAutoPosition||this.recalculateDirection(),setTimeout((function(){var t,n;(null===(t=null==e?void 0:e.input)||void 0===t?void 0:t.ariaExpanded)&&(e.input.ariaExpanded="true"),(null===(n=null==e?void 0:e.toggle)||void 0===n?void 0:n.ariaExpanded)&&(e.toggle.ariaExpanded="true"),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,n,i=this;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),!1):(this.animationInProcess=!0,(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="false"),(null===(n=null==this?void 0:this.toggle)||void 0===n?void 0:n.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.el.classList.remove("active"),this.preventAutoPosition||(this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom=""),(0,u.afterTransition)(this.output,(function(){i.output.style.display="none",i.setValueAndClear(t),i.animationInProcess=!1})),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),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 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"),i=n?JSON.parse(n):{};new e(t,i)}})),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.preventVisibility?t.element.isCurrent: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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 i=window.$hsComboBoxCollection.find((function(t){return t.element.preventVisibility?t.element.isCurrent:t.element.isOpened}));if(i){var o=null!==(n=i.element.itemsWrapper)&&void 0!==n?n:i.element.output;if(!o)return!1;var r,s=e.getPreparedItems(t,o),l=o.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,l.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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=a),e.default=a},814:function(t,e,n){ +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;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,l.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,l.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"),i=n?JSON.parse(n):{};new e(t,i)}}))},e}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=a),e.default=a},814:function(t,e,n){ /* * HSDataTable - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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&&(this.buildPagingPage(1),l>2&&this.pagingPages.appendChild((0,a.htmlToElement)('...')));for(var u=l;u<=c;u++)this.buildPagingPage(u);c...')),this.buildPagingPage(r)),this.disablePagingArrow(this.pagingPrev,0===e),this.disablePagingArrow(this.pagingNext,e===n-1),this.hidePagingIfSinglePage()},e.prototype.buildPagingPage=function(t){var e=this,n=this.dataTable.page.info().page,o=(0,a.htmlToElement)('');o.innerText="".concat(t),o.setAttribute("data-page","".concat(t)),this.pageBtnClasses&&(0,a.classToClassList)(this.pageBtnClasses,o),n===t-1&&o.classList.add("active"),o.addEventListener("click",(function(){return e.onPageClick(t)})),this.pagingPages.append(o)},e.prototype.onPageClick=function(t){this.dataTable.page(t-1).draw("page")},e.prototype.initRowSelecting=function(){var t=this;this.rowSelectingAll.addEventListener("change",(function(){return t.onSelectAllChange()}))},e.prototype.triggerChangeEventToRow=function(){var t=this;this.table.querySelectorAll("tbody ".concat(this.rowSelectingIndividual)).forEach((function(e){e.addEventListener("change",(function(){t.updateSelectAllCheckbox()}))}))},e.prototype.onSelectAllChange=function(){var t=this,e=this.rowSelectingAll.checked;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var o=n.querySelector(t.rowSelectingIndividual);o&&(o.checked=e)})),this.updateSelectAllCheckbox()},e.prototype.updateSelectAllCheckbox=function(){var t=this;if(!this.dataTable.rows({search:"applied"}).count())return this.rowSelectingAll.checked=!1,!1;var e=!0;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var o=n.querySelector(t.rowSelectingIndividual);if(o&&!o.checked)return e=!1,!1})),this.rowSelectingAll.checked=e},e.getInstance=function(t,e){var n=window.$hsDataTableCollection.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.$hsDataTableCollection||(window.$hsDataTableCollection=[]),document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDataTableCollection.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}(l(n(961)).default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").length&&("undefined"==typeof jQuery&&console.error("HSDataTable: jQuery is not available, please add it to the page."),"undefined"==typeof DataTable&&console.error("HSDataTable: DataTable is not available, please add it to the page.")),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery&&c.autoInit()})),"undefined"!=typeof window&&(window.HSDataTable=c),e.default=c},891:function(t,e,n){ +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;n1&&(this.buildPagingPage(1),l>2&&this.pagingPages.appendChild((0,a.htmlToElement)('...')));for(var u=l;u<=c;u++)this.buildPagingPage(u);c...')),this.buildPagingPage(r)),this.disablePagingArrow(this.pagingPrev,0===e),this.disablePagingArrow(this.pagingNext,e===n-1),this.hidePagingIfSinglePage()},e.prototype.buildPagingPage=function(t){var e=this,n=this.dataTable.page.info().page,i=(0,a.htmlToElement)('');i.innerText="".concat(t),i.setAttribute("data-page","".concat(t)),this.pageBtnClasses&&(0,a.classToClassList)(this.pageBtnClasses,i),n===t-1&&i.classList.add("active"),i.addEventListener("click",(function(){return e.onPageClick(t)})),this.pagingPages.append(i)},e.prototype.onPageClick=function(t){this.dataTable.page(t-1).draw("page")},e.prototype.initRowSelecting=function(){var t=this;this.rowSelectingAll.addEventListener("change",(function(){return t.onSelectAllChange()}))},e.prototype.triggerChangeEventToRow=function(){var t=this;this.table.querySelectorAll("tbody ".concat(this.rowSelectingIndividual)).forEach((function(e){e.addEventListener("change",(function(){t.updateSelectAllCheckbox()}))}))},e.prototype.onSelectAllChange=function(){var t=this,e=this.rowSelectingAll.checked;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var i=n.querySelector(t.rowSelectingIndividual);i&&(i.checked=e)})),this.updateSelectAllCheckbox()},e.prototype.updateSelectAllCheckbox=function(){var t=this;if(!this.dataTable.rows({search:"applied"}).count())return this.rowSelectingAll.checked=!1,!1;var e=!0;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var i=n.querySelector(t.rowSelectingIndividual);if(i&&!i.checked)return e=!1,!1})),this.rowSelectingAll.checked=e},e.getInstance=function(t,e){var n=window.$hsDataTableCollection.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.$hsDataTableCollection||(window.$hsDataTableCollection=[]),document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDataTableCollection.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}(l(n(961)).default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").length&&("undefined"==typeof jQuery&&console.error("HSDataTable: jQuery is not available, please add it to the page."),"undefined"==typeof DataTable&&console.error("HSDataTable: DataTable is not available, please add it to the page.")),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery&&c.autoInit()})),"undefined"!=typeof window&&(window.HSDataTable=c),e.default=c},891:function(t,e,n){ /* * HSDropdown - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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.querySelector(":scope > .hs-dropdown-toggle-wrapper > .hs-dropdown-toggle")||i.el.children[0],i.closers=Array.from(i.el.querySelectorAll(":scope .hs-dropdown-close"))||null,i.menu=i.el.querySelector(":scope > .hs-dropdown-menu"),i.eventMode=(0,l.getClassProperty)(i.el,"--trigger","click"),i.closeMode=(0,l.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&&this.buildToggle(),this.menu&&this.buildMenu(),this.closers&&this.buildClosers(),(0,l.isIOS)()||(0,l.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return t.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return t.onMouseLeaveHandler()})))},e.prototype.resizeHandler=function(){this.eventMode=(0,l.getClassProperty)(this.el,"--trigger","click"),this.closeMode=(0,l.getClassProperty)(this.el,"--auto-close","true")},e.prototype.buildToggle=function(){var t,e=this;(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(t){return e.onClickHandler(t)}))},e.prototype.buildMenu=function(){this.menu.role="menu"},e.prototype.buildClosers=function(){var t=this;this.closers.forEach((function(e){e.addEventListener("click",(function(){return t.close()}))}))},e.prototype.onClickHandler=function(t){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}}]},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(" ","")),s=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ","");"static"!==o&&(this.el._popper=(0,a.createPopper)(this.el,this.menu,{placement:u.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]}},{name:"computeStyles",options:{adaptive:"fixed"===o,gpuAcceleration:"true"===s}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){var e;(null===(e=null==t?void 0:t.toggle)||void 0===e?void 0:e.ariaExpanded)&&(t.toggle.ariaExpanded="true"),t.el.classList.add("open"),t.animationInProcess=!1})),this.fireEvent("open",this.el),(0,l.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;var n;if(this.animationInProcess=!0,t){var o=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,l.afterTransition)(o,(function(){return e.destroyPopper()}))}else this.destroyPopper();e.menu.style.margin=null,(null===(n=null==e?void 0:e.toggle)||void 0===n?void 0:n.ariaExpanded)&&(e.toggle.ariaExpanded="false"),e.el.classList.remove("open"),e.fireEvent("close",e.el),(0,l.dispatch)("close.hs.dropdown",e.el,e.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=l.menuSearchHistory;var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e&&(u.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")&&!e.element.menu.querySelector("textarea: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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")||o.el.querySelector(":scope > .hs-dropdown-toggle-wrapper > .hs-dropdown-toggle")||o.el.children[0],o.closers=Array.from(o.el.querySelectorAll(":scope .hs-dropdown-close"))||null,o.menu=o.el.querySelector(":scope > .hs-dropdown-menu"),o.eventMode=(0,l.getClassProperty)(o.el,"--trigger","click"),o.closeMode=(0,l.getClassProperty)(o.el,"--auto-close","true"),o.animationInProcess=!1,o.toggle&&o.menu&&o.init(),o}return o(e,t),e.prototype.init=function(){var t=this;if(this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle&&this.buildToggle(),this.menu&&this.buildMenu(),this.closers&&this.buildClosers(),(0,l.isIOS)()||(0,l.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return t.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return t.onMouseLeaveHandler()})))},e.prototype.resizeHandler=function(){this.eventMode=(0,l.getClassProperty)(this.el,"--trigger","click"),this.closeMode=(0,l.getClassProperty)(this.el,"--auto-close","true")},e.prototype.buildToggle=function(){var t,e=this;(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(t){return e.onClickHandler(t)}))},e.prototype.buildMenu=function(){this.menu.role="menu"},e.prototype.buildClosers=function(){var t=this;this.closers.forEach((function(e){e.addEventListener("click",(function(){return t.close()}))}))},e.prototype.onClickHandler=function(t){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(" ",""),i=(window.getComputedStyle(t.el).getPropertyValue("--adaptive")||"adaptive").replace(" ","");e.state.elements.popper.style.position=n,e.state.elements.popper.style.transform="adaptive"===i?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}}]},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(" ",""),i=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),o=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ","")),s=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ","");"static"!==i&&(this.el._popper=(0,a.createPopper)(this.el,this.menu,{placement:u.POSITIONS[e]||"bottom-start",strategy:i,modifiers:r(r([],"fixed"!==i?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===n},{name:"offset",options:{offset:[0,o]}},{name:"computeStyles",options:{adaptive:"fixed"===i,gpuAcceleration:"true"===s}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){var e;(null===(e=null==t?void 0:t.toggle)||void 0===e?void 0:e.ariaExpanded)&&(t.toggle.ariaExpanded="true"),t.el.classList.add("open"),t.animationInProcess=!1})),this.fireEvent("open",this.el),(0,l.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;var n;if(this.animationInProcess=!0,t){var i=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,l.afterTransition)(i,(function(){return e.destroyPopper()}))}else this.destroyPopper();e.menu.style.margin=null,(null===(n=null==e?void 0:e.toggle)||void 0===n?void 0:n.ariaExpanded)&&(e.toggle.ariaExpanded="false"),e.el.classList.remove("open"),e.fireEvent("close",e.el),(0,l.dispatch)("close.hs.dropdown",e.el,e.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=l.menuSearchHistory;var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e&&(u.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")&&!e.element.menu.querySelector("textarea: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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 i=(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")})),o=n.querySelector("a:focus, button:focus"),r=i.findIndex((function(t){return t===o}));r+1\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t.\n\t\t\t\t\t\t

\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t0%\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t',s.extensions=_.merge({default:{icon:'',class:"size-5"},xls:{icon:'',class:"size-5"},doc:{icon:'',class:"size-5"},zip:{icon:'',class:"size-5"}},a.extensions),s.singleton=a.singleton,s.concatOptions=r(r({clickable:s.el.querySelector("[data-hs-file-upload-trigger]"),previewsContainer:s.el.querySelector("[data-hs-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:s.previewTemplate,autoHideTrigger:!1},a),n),s.init(),s}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsFileUploadCollection,this),this.initDropzone()},e.prototype.initDropzone=function(){var t=this,e=this.el.querySelector("[data-hs-file-upload-clear]"),n=Array.from(this.el.querySelectorAll("[data-hs-file-upload-pseudo-trigger]"));this.dropzone=new Dropzone(this.el,this.concatOptions),this.dropzone.on("addedfile",(function(e){return t.onAddFile(e)})),this.dropzone.on("removedfile",(function(){return t.onRemoveFile()})),this.dropzone.on("uploadprogress",(function(e,n){return t.onUploadProgress(e,n)})),this.dropzone.on("complete",(function(e){return t.onComplete(e)})),e&&(e.onclick=function(){t.dropzone.files.length&&t.dropzone.removeAllFiles(!0)}),n.length&&n.forEach((function(e){e.onclick=function(){var e,n;(null===(e=t.concatOptions)||void 0===e?void 0:e.clickable)&&(null===(n=t.concatOptions)||void 0===n?void 0:n.clickable).click()}}))},e.prototype.onAddFile=function(t){var e=this,n=t.previewElement,o=t.previewElement.querySelector("[data-hs-file-upload-reload]");if(!n)return!1;this.singleton&&this.dropzone.files.length>1&&this.dropzone.removeFile(this.dropzone.files[0]),o&&o.addEventListener("click",(function(n){n.preventDefault(),n.stopPropagation();var o=document.createElement("input");o.type="file",o.click(),o.addEventListener("change",(function(n){var o,i=null===(o=n.target.files)||void 0===o?void 0:o[0];if(i){var r=i;r.status=Dropzone.ADDED,r.accepted=!0,r.previewElement=t.previewElement,r.previewTemplate=t.previewTemplate,r.previewsContainer=t.previewsContainer,e.dropzone.removeFile(t),e.dropzone.addFile(r)}}))})),this.previewAccepted(t)},e.prototype.previewAccepted=function(t){var e=this,n=t.previewElement,o=this.splitFileName(t.name),i=n.querySelector("[data-hs-file-upload-file-name]"),r=n.querySelector("[data-hs-file-upload-file-ext]"),s=n.querySelector("[data-hs-file-upload-file-size]"),l=n.querySelector("[data-hs-file-upload-file-icon]"),a=this.el.querySelector("[data-hs-file-upload-trigger]"),c=n.querySelector("[data-dz-thumbnail]"),u=n.querySelector("[data-hs-file-upload-remove]");i&&(i.textContent=o.name),r&&(r.textContent=o.extension),s&&(s.textContent=this.formatFileSize(t.size)),c&&(t.type.includes("image/")?c.classList.remove("hidden"):this.setIcon(o.extension,l)),this.dropzone.files.length>0&&this.concatOptions.autoHideTrigger&&(a.style.display="none"),u&&(u.onclick=function(){return e.dropzone.removeFile(t)})},e.prototype.onRemoveFile=function(){var t=this.el.querySelector("[data-hs-file-upload-trigger]");0===this.dropzone.files.length&&this.concatOptions.autoHideTrigger&&(t.style.display="")},e.prototype.onUploadProgress=function(t,e){var n=t.previewElement;if(!n)return!1;var o=n.querySelector("[data-hs-file-upload-progress-bar]"),i=n.querySelector("[data-hs-file-upload-progress-bar-pane]"),r=n.querySelector("[data-hs-file-upload-progress-bar-value]"),s=Math.floor(e);o&&o.setAttribute("aria-valuenow","".concat(s)),i&&(i.style.width="".concat(s,"%")),r&&(r.innerText="".concat(s))},e.prototype.onComplete=function(t){var e=t.previewElement;if(!e)return!1;e.classList.add("complete")},e.prototype.setIcon=function(t,e){var n=this.createIcon(t);e.append(n)},e.prototype.createIcon=function(t){var e,n,o=(null===(e=this.extensions[t])||void 0===e?void 0:e.icon)?(0,l.htmlToElement)(this.extensions[t].icon):(0,l.htmlToElement)(this.extensions.default.icon);return(0,l.classToClassList)((null===(n=this.extensions[t])||void 0===n?void 0:n.class)?this.extensions[t].class:this.extensions.default.class,o),o},e.prototype.formatFileSize=function(t){return t<1024?t.toFixed(2)+" B":t<1048576?(t/1024).toFixed(2)+" KB":t<1073741824?(t/1048576).toFixed(2)+" MB":t<1099511627776?(t/1073741824).toFixed(2)+" GB":(t/1099511627776).toFixed(2)+" TB"},e.prototype.splitFileName=function(t){var e=t.lastIndexOf(".");return-1==e?{name:t,extension:""}:{name:t.substring(0,e),extension:t.substring(e+1)}},e.getInstance=function(t,e){var n=window.$hsFileUploadCollection.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.$hsFileUploadCollection||(window.$hsFileUploadCollection=[]),document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsFileUploadCollection.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}(a.default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").length&&("undefined"==typeof _&&console.error("HSFileUpload: Lodash is not available, please add it to the page."),"undefined"==typeof Dropzone&&console.error("HSFileUpload: Dropzone is not available, please add it to the page.")),"undefined"!=typeof _&&"undefined"!=typeof Dropzone&&c.autoInit()})),"undefined"!=typeof window&&(window.HSFileUpload=c),e.default=c},332:function(t,e,n){ +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;n\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t.\n\t\t\t\t\t\t

\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t0%\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t',s.extensions=_.merge({default:{icon:'',class:"size-5"},xls:{icon:'',class:"size-5"},doc:{icon:'',class:"size-5"},zip:{icon:'',class:"size-5"}},a.extensions),s.singleton=a.singleton,s.concatOptions=r(r({clickable:s.el.querySelector("[data-hs-file-upload-trigger]"),previewsContainer:s.el.querySelector("[data-hs-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:s.previewTemplate,autoHideTrigger:!1},a),n),s.init(),s}return o(e,t),e.prototype.init=function(){this.createCollection(window.$hsFileUploadCollection,this),this.initDropzone()},e.prototype.initDropzone=function(){var t=this,e=this.el.querySelector("[data-hs-file-upload-clear]"),n=Array.from(this.el.querySelectorAll("[data-hs-file-upload-pseudo-trigger]"));this.dropzone=new Dropzone(this.el,this.concatOptions),this.dropzone.on("addedfile",(function(e){return t.onAddFile(e)})),this.dropzone.on("removedfile",(function(){return t.onRemoveFile()})),this.dropzone.on("uploadprogress",(function(e,n){return t.onUploadProgress(e,n)})),this.dropzone.on("complete",(function(e){return t.onComplete(e)})),e&&(e.onclick=function(){t.dropzone.files.length&&t.dropzone.removeAllFiles(!0)}),n.length&&n.forEach((function(e){e.onclick=function(){var e,n;(null===(e=t.concatOptions)||void 0===e?void 0:e.clickable)&&(null===(n=t.concatOptions)||void 0===n?void 0:n.clickable).click()}}))},e.prototype.onAddFile=function(t){var e=this,n=t.previewElement,i=t.previewElement.querySelector("[data-hs-file-upload-reload]");if(!n)return!1;this.singleton&&this.dropzone.files.length>1&&this.dropzone.removeFile(this.dropzone.files[0]),i&&i.addEventListener("click",(function(n){n.preventDefault(),n.stopPropagation();var i=document.createElement("input");i.type="file",i.click(),i.addEventListener("change",(function(n){var i,o=null===(i=n.target.files)||void 0===i?void 0:i[0];if(o){var r=o;r.status=Dropzone.ADDED,r.accepted=!0,r.previewElement=t.previewElement,r.previewTemplate=t.previewTemplate,r.previewsContainer=t.previewsContainer,e.dropzone.removeFile(t),e.dropzone.addFile(r)}}))})),this.previewAccepted(t)},e.prototype.previewAccepted=function(t){var e=this,n=t.previewElement,i=this.splitFileName(t.name),o=n.querySelector("[data-hs-file-upload-file-name]"),r=n.querySelector("[data-hs-file-upload-file-ext]"),s=n.querySelector("[data-hs-file-upload-file-size]"),l=n.querySelector("[data-hs-file-upload-file-icon]"),a=this.el.querySelector("[data-hs-file-upload-trigger]"),c=n.querySelector("[data-dz-thumbnail]"),u=n.querySelector("[data-hs-file-upload-remove]");o&&(o.textContent=i.name),r&&(r.textContent=i.extension),s&&(s.textContent=this.formatFileSize(t.size)),c&&(t.type.includes("image/")?c.classList.remove("hidden"):this.setIcon(i.extension,l)),this.dropzone.files.length>0&&this.concatOptions.autoHideTrigger&&(a.style.display="none"),u&&(u.onclick=function(){return e.dropzone.removeFile(t)})},e.prototype.onRemoveFile=function(){var t=this.el.querySelector("[data-hs-file-upload-trigger]");0===this.dropzone.files.length&&this.concatOptions.autoHideTrigger&&(t.style.display="")},e.prototype.onUploadProgress=function(t,e){var n=t.previewElement;if(!n)return!1;var i=n.querySelector("[data-hs-file-upload-progress-bar]"),o=n.querySelector("[data-hs-file-upload-progress-bar-pane]"),r=n.querySelector("[data-hs-file-upload-progress-bar-value]"),s=Math.floor(e);i&&i.setAttribute("aria-valuenow","".concat(s)),o&&(o.style.width="".concat(s,"%")),r&&(r.innerText="".concat(s))},e.prototype.onComplete=function(t){var e=t.previewElement;if(!e)return!1;e.classList.add("complete")},e.prototype.setIcon=function(t,e){var n=this.createIcon(t);e.append(n)},e.prototype.createIcon=function(t){var e,n,i=(null===(e=this.extensions[t])||void 0===e?void 0:e.icon)?(0,l.htmlToElement)(this.extensions[t].icon):(0,l.htmlToElement)(this.extensions.default.icon);return(0,l.classToClassList)((null===(n=this.extensions[t])||void 0===n?void 0:n.class)?this.extensions[t].class:this.extensions.default.class,i),i},e.prototype.formatFileSize=function(t){return t<1024?t.toFixed(2)+" B":t<1048576?(t/1024).toFixed(2)+" KB":t<1073741824?(t/1048576).toFixed(2)+" MB":t<1099511627776?(t/1073741824).toFixed(2)+" GB":(t/1099511627776).toFixed(2)+" TB"},e.prototype.splitFileName=function(t){var e=t.lastIndexOf(".");return-1==e?{name:t,extension:""}:{name:t.substring(0,e),extension:t.substring(e+1)}},e.getInstance=function(t,e){var n=window.$hsFileUploadCollection.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.$hsFileUploadCollection||(window.$hsFileUploadCollection=[]),document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsFileUploadCollection.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}(a.default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").length&&("undefined"==typeof _&&console.error("HSFileUpload: Lodash is not available, please add it to the page."),"undefined"==typeof Dropzone&&console.error("HSFileUpload: Dropzone is not available, please add it to the page.")),"undefined"!=typeof _&&"undefined"!=typeof Dropzone&&c.autoInit()})),"undefined"!=typeof window&&(window.HSFileUpload=c),e.default=c},332:function(t,e,n){ /* * HSInputNumber - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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?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.checkIsNumberAndConvert=function(){var t=this.input.value.trim(),e=this.cleanAndExtractNumber(t);null!==e?(this.inputValue=e,this.input.value=e.toString()):(this.inputValue=0,this.input.value="0")},e.prototype.cleanAndExtractNumber=function(t){var e=[],n=!1;t.split("").forEach((function(t){t>="0"&&t<="9"?e.push(t):"."!==t||n||(e.push(t),n=!0)}));var o=e.join(""),i=parseFloat(o);return isNaN(i)?null:i},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 s=this.inputValue+this.step;this.inputValue=s>=i&&s<=r?s: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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=a),e.default=a},850:function(t,e,n){ +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?l.step:1,i.init(),i}return o(e,t),e.prototype.init=function(){this.createCollection(window.$hsInputNumberCollection,this),this.input&&this.increment&&this.build()},e.prototype.checkIsNumberAndConvert=function(){var t=this.input.value.trim(),e=this.cleanAndExtractNumber(t);null!==e?(this.inputValue=e,this.input.value=e.toString()):(this.inputValue=0,this.input.value="0")},e.prototype.cleanAndExtractNumber=function(t){var e=[],n=!1;t.split("").forEach((function(t){t>="0"&&t<="9"?e.push(t):"."!==t||n||(e.push(t),n=!0)}));var i=e.join(""),o=parseFloat(i);return isNaN(o)?null:o},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},o=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 s=this.inputValue+this.step;this.inputValue=s>=o&&s<=r?s:r,this.input.value=this.inputValue.toString();break;case"decrement":var a=this.inputValue-this.step;this.inputValue=a>=o&&a<=r?a:o,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<=o?o:c,this.inputValue<=o&&(this.input.value=this.inputValue.toString())}i.inputValue=this.inputValue,this.inputValue===o?(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",i),(0,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=a),e.default=a},850:function(t,e,n){ /* * HSOverlay - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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"])'),s=[];(null==r?void 0:r.length)&&r.forEach((function(t){(0,l.isParentOrElementHidden)(t)||s.push(t)}));var a=i&&!t.metaKey;if(a&&!i.element.isTabAccessibilityLimited&&"Tab"===t.code)return!1;a&&s.length&&"Tab"===t.code&&(t.preventDefault(),this.onTab(i,s)),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}(s(n(961)).default);window.addEventListener("load",(function(){c.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.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.overlay.classList.contains("opened")})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.overlay.classList.contains("opened")})).forEach((function(t){var e=parseInt(window.getComputedStyle(t.element.overlay).getPropertyValue("z-index")),n=document.querySelector("#".concat(t.element.overlay.id,"-backdrop"));if(e===parseInt(window.getComputedStyle(n).getPropertyValue("z-index"))+1)return!1;"style"in n&&(n.style.zIndex="".concat(e-1)),document.body.classList.add("hs-overlay-body-open")}))}()})),"undefined"!=typeof window&&(window.HSOverlay=c),e.default=c},60:function(t,e,n){ +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;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,i=window.$hsOverlayCollection.filter((function(t){return t.element.overlay.classList.contains("open")})),o=i[i.length-1],r=null===(n=null===(e=null==o?void 0:o.element)||void 0===e?void 0:e.overlay)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=[];(null==r?void 0:r.length)&&r.forEach((function(t){(0,l.isParentOrElementHidden)(t)||s.push(t)}));var a=o&&!t.metaKey;if(a&&!o.element.isTabAccessibilityLimited&&"Tab"===t.code)return!1;a&&s.length&&"Tab"===t.code&&(t.preventDefault(),this.onTab(o,s)),a&&"Escape"===t.code&&(t.preventDefault(),this.onEscape(o))},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"),i=Array.from(e).indexOf(n);i>-1?e[(i+1)%e.length].focus():e[0].focus()},e.on=function(t,e,n){var i=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)}));i&&(i.element.events[t]=n)},e}(s(n(961)).default),u=function(){if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((function(t){return t.element.moveOverlayToBody})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.moveOverlayToBody})).forEach((function(t){var e=t.element.moveOverlayToBody,n=t.element.initContainer,i=document.querySelector("body"),o=t.element.overlay;if(!n&&o)return!1;document.body.clientWidth<=e&&!(0,l.isDirectChild)(i,o)?i.appendChild(o):document.body.clientWidth>e&&!n.contains(o)&&n.appendChild(o)}))};window.addEventListener("load",(function(){c.autoInit(),u()})),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)}))}(),u(),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.overlay.classList.contains("opened")})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.overlay.classList.contains("opened")})).forEach((function(t){var e=parseInt(window.getComputedStyle(t.element.overlay).getPropertyValue("z-index")),n=document.querySelector("#".concat(t.element.overlay.id,"-backdrop"));if(e===parseInt(window.getComputedStyle(n).getPropertyValue("z-index"))+1)return!1;"style"in n&&(n.style.zIndex="".concat(e-1)),document.body.classList.add("hs-overlay-body-open")}))}()})),"undefined"!=typeof window&&(window.HSOverlay=c),e.default=c},60:function(t,e,n){ /* * HSPinInput - * @version: 2.4.1 + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=a),e.default=a},347:function(t,e,n){ +/* + * HSRangeSlider + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=a),e.default=a},911:function(t,e,n){ +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){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,s.getClassProperty)(this.el,"--scrollspy-offset","0")),i=parseInt((0,s.getClassProperty)(n,"--scrollspy-offset"))||o,r=this.scrollable===document?0:this.scrollable.offsetTop,l=n.offsetTop-i-r,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,s.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}(r(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=l),e.default=l},442:function(t,e,n){ +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.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(292),l=function(t){function e(e,n){void 0===n&&(n={});var i=t.call(this,e,n)||this;return i.activeSection=null,i.contentId=i.el.getAttribute("data-hs-scrollspy"),i.content=document.querySelector(i.contentId),i.links=i.el.querySelectorAll("[href]"),i.sections=[],i.scrollableId=i.el.getAttribute("data-hs-scrollspy-scrollable-parent"),i.scrollable=i.scrollableId?document.querySelector(i.scrollableId):document,i.init(),i}return o(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,s.getClassProperty)(this.el,"--scrollspy-offset","0")),i=parseInt((0,s.getClassProperty)(e,"--scrollspy-offset"))||n,o=t.target===document?0:parseInt(String(t.target.getBoundingClientRect().top)),r=parseInt(String(e.getBoundingClientRect().top))-i-o,l=e.offsetHeight;if(r<=0&&r+l>0){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),i=parseInt((0,s.getClassProperty)(this.el,"--scrollspy-offset","0")),o=parseInt((0,s.getClassProperty)(n,"--scrollspy-offset"))||i,r=this.scrollable===document?0:this.scrollable.offsetTop,l=n.offsetTop-o-r,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,s.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}(r(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=l),e.default=l},442:function(t,e,n){ /* * HSSelect - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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"),n=this.toggle.querySelector("[data-icon]"),o=this.toggle.querySelector("[data-title]"),!this.isMultiple&&n&&this.setToggleIcon(),!this.isMultiple&&o&&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,o||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,a.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),(null===(e=this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.isOpened?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(){if(i.isDisabled)return!1;i.isOpened?i.close():i.open()}))},e.prototype.setToggleIcon=function(){var t,e,n=this.toggle.querySelector("[data-icon]");if(n.innerHTML="",n){var o=(0,a.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.isDisabled&&this.wrapper.classList.add("disabled"),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,l,c=this,u=this.getItemByValue(t),d=document.createElement("div");if(d.setAttribute("data-tag-value",t),this.tagsItemClasses&&(0,a.classToClassList)(this.tagsItemClasses,d),this.tagsItemTemplate&&(i=(0,a.htmlToElement)(this.tagsItemTemplate),d.append(i)),null===(e=null==u?void 0:u.options)||void 0===e?void 0:e.icon){var p=(0,a.htmlToElement)(null===(n=null==u?void 0:u.options)||void 0===n?void 0:n.icon);(l=i?i.querySelector("[data-icon]"):document.createElement("span")).append(p),i||d.append(l)}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,a.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,a.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,a.htmlToElement)(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),this.dropdown.classList.add("absolute","top-full"),this.dropdown.role="listbox",this.dropdown.tabIndex=-1,this.dropdown.ariaOrientation="vertical",this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,a.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.disabled,e.selected,e.options,"".concat(n))}))},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,a.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,a.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]"),this.search=(0,a.htmlToElement)(''),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,a.classToClassList)(this.searchClasses,this.search),this.search.addEventListener("input",(0,a.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,i,r){var l=this;void 0===n&&(n=!1),void 0===o&&(o=!1),void 0===r&&(r="1");var c=null,u=(0,a.htmlToElement)(this.optionTag||"
");if(u.setAttribute("data-value",e),u.setAttribute("data-title-value",t),u.setAttribute("tabIndex",r),u.classList.add("cursor-pointer"),n&&u.classList.add("disabled"),o&&(this.isMultiple?this.value=s(s([],this.value,!0),[e],!1):this.value=e),this.optionTemplate&&(c=(0,a.htmlToElement)(this.optionTemplate),u.append(c)),c?c.querySelector("[data-title]").textContent=t||"":u.textContent=t||"",i){if(i.icon){var d=(0,a.htmlToElement)(i.icon);if(d.classList.add("max-w-full"),c)c.querySelector("[data-icon]").append(d);else{var p=(0,a.htmlToElement)("
");this.iconClasses&&(0,a.classToClassList)(this.iconClasses,p),p.append(d),u.append(p)}}if(i.description)if(c)c.querySelector("[data-description]").append(i.description);else{var h=(0,a.htmlToElement)("
");h.textContent=i.description,this.descriptionClasses&&(0,a.classToClassList)(this.descriptionClasses,h),u.append(h)}}c&&c.querySelector("[data-icon]")&&!i&&!(null==i?void 0:i.icon)&&c.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&u.classList.add("selected"),n||u.addEventListener("click",(function(){return l.onSelectOption(e)})),this.optionClasses&&(0,a.classToClassList)(this.optionClasses,u),this.dropdown&&this.dropdown.append(u),o&&this.setNewValue()},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,o,i){var r=(0,a.htmlToElement)("");r.setAttribute("value",e),n&&r.setAttribute("disabled","disabled"),o&&r.setAttribute("selected","selected"),r.setAttribute("data-hs-select-option",JSON.stringify(i)),r.innerText=t,this.el.append(r)},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,a.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(),this.triggerChangeEventForNativeSelect()},e.prototype.triggerChangeEventForNativeSelect=function(){var t=new Event("change",{bubbles:!0});this.el.dispatchEvent(t)},e.prototype.addSelectOption=function(t,e,n,o,i){this.selectOptions=s(s([],this.selectOptions,!0),[{title:t,val:e,disabled:n,selected:o,options:i}],!1)},e.prototype.removeSelectOption=function(t,e){if(void 0===e&&(e=!1),!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t})),console.log(e),this.value=e?this.value.filter((function(e){return e!==t})):t,console.log(this.value)},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():(console.log(),this.value.length?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder)},e.prototype.stringFromValue=function(){var t=this,e=[],n="";if(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)if("nItemsAndCount"===this.toggleCountTextMode){var o=e.slice(0,this.toggleCountTextMinItems-1);n="".concat(o.join(this.toggleSeparators.items)," ").concat(this.toggleSeparators.betweenItemsAndCounter," ").concat(e.length-o.length," ").concat(this.toggleCountText)}else n="".concat(e.length," ").concat(this.toggleCountText);else n=e.join(this.toggleSeparators.items);return n},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0;var e=Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")}));e&&e.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,a.htmlToElement)(""),this.searchNoResult.innerText=this.searchNoResultText,(0,a.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,e=this,n=(null===(t=null===window||void 0===window?void 0:window.$hsSelectCollection)||void 0===t?void 0:t.find((function(t){return t.element.isOpened})))||null;if(n&&n.element.close(),this.animationInProcess)return!1;this.animationInProcess=!0,this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){var t;(null===(t=null==e?void 0:e.toggle)||void 0===t?void 0:t.ariaExpanded)&&(e.toggle.ariaExpanded="true"),e.wrapper.classList.add("active"),e.dropdown.classList.add("opened"),e.hasSearch&&!e.preventSearchFocus&&e.search.focus(),e.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,n,o,i=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,a.afterTransition)(this.dropdown,(function(){i.dropdown.classList.add("hidden"),i.hasSearch&&(i.search.value="",i.search.dispatchEvent(new Event("input",{bubbles:!0})),i.search.blur()),i.animationInProcess=!1})),null===(o=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===o||o.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.disabled,s=t.selected,l=t.options;!!e.selectOptions.some((function(t){return t.val===i}))||(e.addSelectOption(o,i,r,s,l),e.buildOption(o,i,r,s,l,n),e.buildOriginalOption(o,i,r,s,l),s&&!e.isMultiple&&e.onSelectOption(i))};Array.isArray(t)?t.forEach((function(t){o(t)})):o(t)},e.prototype.removeOption=function(t){var e=this,n=function(t,n){void 0===n&&(n=!1),!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t,n),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,e.isMultiple)})):n(t,this.isMultiple),this.setNewValue()},e.prototype.recalculateDirection=function(){var t,e,n,o;(0,a.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.open=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.open()},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}))&&u.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Tab":t.preventDefault(),t.stopImmediatePropagation(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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")||n.querySelector(".selected");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")||n.querySelector(".selected");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}(c.default);window.addEventListener("load",(function(){d.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=d),e.default=d},887:function(t,e,n){ +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&&o[o.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]",s.searchNoResultText=(null==c?void 0:c.searchNoResultText)||"No results found",s.searchNoResultClasses=(null==c?void 0:c.searchNoResultClasses)||"px-4 text-sm text-gray-800 dark:text-neutral-200",s.optionTemplate=(null==c?void 0:c.optionTemplate)||null,s.optionTag=(null==c?void 0:c.optionTag)||null,s.optionClasses=(null==c?void 0:c.optionClasses)||null,s.extraMarkup=(null==c?void 0:c.extraMarkup)||null,s.descriptionClasses=(null==c?void 0:c.descriptionClasses)||null,s.iconClasses=(null==c?void 0:c.iconClasses)||null,s.isAddTagOnEnter=null===(o=null==c?void 0:c.isAddTagOnEnter)||void 0===o||o,s.animationInProcess=!1,s.selectOptions=[],s.remoteOptions=[],s.tagsInputHelper=null,s.init(),s}return o(e,t),e.prototype.setValue=function(t){this.value=t,this.clearSelections(),Array.isArray(t)?(this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder,this.unselectMultipleItems(),this.selectMultipleItems()):(this.setToggleTitle(),this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.selectSingleItem())},e.prototype.init=function(){this.createCollection(window.$hsSelectCollection,this),this.build()},e.prototype.build=function(){var t=this;if(this.el.style.display="none",this.el.children&&Array.from(this.el.children).filter((function(t){return t.value&&""!==t.value})).forEach((function(e){var n=e.getAttribute("data-hs-select-option");t.selectOptions=a(a([],t.selectOptions,!0),[{title:e.textContent,val:e.value,disabled:e.disabled,options:"undefined"!==n?JSON.parse(n):null}],!1)})),this.isMultiple){var e=Array.from(this.el.children).filter((function(t){return t.selected}));if(e){var n=[];e.forEach((function(t){n.push(t.value)})),this.value=n}}this.buildWrapper(),"tags"===this.mode?this.buildTags():this.buildToggle(),this.buildDropdown(),this.extraMarkup&&this.buildExtraMarkup()},e.prototype.buildWrapper=function(){var t=this;this.wrapper=document.createElement("div"),this.wrapper.classList.add("hs-select","relative"),"tags"===this.mode&&this.wrapper.addEventListener("click",(function(e){e.target.closest("[data-hs-select-dropdown]")||e.target.closest("[data-tag-value]")||t.tagsInput.focus()})),this.wrapperClasses&&(0,u.classToClassList)(this.wrapperClasses,this.wrapper),this.el.before(this.wrapper),this.wrapper.append(this.el)},e.prototype.buildExtraMarkup=function(){var t=this,e=function(e){var n=(0,u.htmlToElement)(e);return t.wrapper.append(n),n},n=function(e){e.classList.contains("--prevent-click")||e.addEventListener("click",(function(e){e.stopPropagation(),t.toggleFn()}))};if(Array.isArray(this.extraMarkup))this.extraMarkup.forEach((function(t){var i=e(t);n(i)}));else{var i=e(this.extraMarkup);n(i)}},e.prototype.buildToggle=function(){var t,e,n,i,o=this;this.toggleTextWrapper=document.createElement("span"),this.toggleTextWrapper.classList.add("truncate"),this.toggle=(0,u.htmlToElement)(this.toggleTag||"
"),n=this.toggle.querySelector("[data-icon]"),i=this.toggle.querySelector("[data-title]"),!this.isMultiple&&n&&this.setToggleIcon(),!this.isMultiple&&i&&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,i||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,u.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),(null===(e=this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.isOpened?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(){if(o.isDisabled)return!1;o.toggleFn()}))},e.prototype.setToggleIcon=function(){var t,e=this.getItemByValue(this.value),n=this.toggle.querySelector("[data-icon]");if(n.innerHTML="",n){var i=(0,u.htmlToElement)(this.apiUrl&&this.apiIconTag?this.apiIconTag||"":(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.icon)||"");this.value&&this.apiUrl&&this.apiIconTag&&e[this.apiFieldsMap.icon]&&(i.src=e[this.apiFieldsMap.icon]||""),n.append(i),i&&(null==i?void 0:i.src)?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.isDisabled&&this.wrapper.classList.add("disabled"),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,i,o,r,s,l,a,c=this,d=this.getItemByValue(t),p=document.createElement("div");if(p.setAttribute("data-tag-value",t),this.tagsItemClasses&&(0,u.classToClassList)(this.tagsItemClasses,p),this.tagsItemTemplate&&(r=(0,u.htmlToElement)(this.tagsItemTemplate),p.append(r)),(null===(e=null==d?void 0:d.options)||void 0===e?void 0:e.icon)||this.apiIconTag){var h=(0,u.htmlToElement)(this.apiUrl&&this.apiIconTag?this.apiIconTag:null===(n=null==d?void 0:d.options)||void 0===n?void 0:n.icon);this.apiUrl&&this.apiIconTag&&d[this.apiFieldsMap.icon]&&(h.src=d[this.apiFieldsMap.icon]||""),(a=r?r.querySelector("[data-icon]"):document.createElement("span")).append(h),r||p.append(a)}!r||!r.querySelector("[data-icon]")||(null===(i=null==d?void 0:d.options)||void 0===i?void 0:i.icon)||this.apiUrl||this.apiIconTag||d[null===(o=this.apiFieldsMap)||void 0===o?void 0:o.icon]||r.querySelector("[data-icon]").classList.add("hidden"),(s=r?r.querySelector("[data-title]"):document.createElement("span")).textContent=d.title||"",r||p.append(s),r?l=r.querySelector("[data-remove]"):((l=document.createElement("span")).textContent="X",p.append(l)),l.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(),p.remove()})),this.wrapper.append(p)},e.prototype.getItemByValue=function(t){var e=this;return this.apiUrl?this.remoteOptions.find((function(n){return n[e.apiFieldsMap.title]===t})):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:a(a([],t.selectedItems,!0),[e],!1)}))},e.prototype.buildTagsInput=function(){var t=this;this.tagsInput=document.createElement("input"),this.tagsInputId&&(this.tagsInput.id=this.tagsInputId),this.tagsInputClasses&&(0,u.classToClassList)(this.tagsInputClasses,this.tagsInput),this.tagsInput.addEventListener("focus",(function(){t.isOpened||t.open()})),this.tagsInput.addEventListener("input",(function(){return t.calculateInputWidth()})),this.tagsInput.addEventListener("input",(0,u.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,u.htmlToElement)(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),"parent"===this.dropdownScope&&this.dropdown.classList.add("absolute","top-full"),this.dropdown.role="listbox",this.dropdown.tabIndex=-1,this.dropdown.ariaOrientation="vertical",this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,u.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.disabled,e.selected,e.options,"".concat(n))})),this.apiUrl&&this.optionsFromRemoteData(),"window"===this.dropdownScope&&this.buildPopper()},e.prototype.buildPopper=function(){"undefined"!=typeof Popper&&Popper.createPopper&&(document.body.appendChild(this.dropdown),this.popperInstance=Popper.createPopper("tags"===this.mode?this.wrapper:this.toggle,this.dropdown,{placement:p.POSITIONS[this.dropdownPlacement]||"bottom",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,5]}}]}))},e.prototype.updateDropdownWidth=function(){var t="tags"===this.mode?this.wrapper:this.toggle;this.dropdown.style.width="".concat(t.clientWidth,"px")},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,u.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,u.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]");var n=(0,u.htmlToElement)(this.searchTemplate||'');this.search="INPUT"===n.tagName?n:n.querySelector(":scope input"),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,u.classToClassList)(this.searchClasses,this.search),this.searchId&&(this.search.id=this.searchId),this.search.addEventListener("input",(0,u.debounce)((function(t){e.apiUrl?e.remoteSearch(t.target.value):e.searchOptions(t.target.value)}))),t?t.append(n):this.searchWrapper.append(n),this.dropdown.append(this.searchWrapper)},e.prototype.buildOption=function(t,e,n,i,o,r,s){var l,c=this;void 0===n&&(n=!1),void 0===i&&(i=!1),void 0===r&&(r="1");var d=null,p=null,h=(0,u.htmlToElement)(this.optionTag||"
");if(h.setAttribute("data-value",e),h.setAttribute("data-title-value",t),h.setAttribute("tabIndex",r),h.classList.add("cursor-pointer"),h.setAttribute("data-id",s||"".concat(this.optionId)),s||this.optionId++,n&&h.classList.add("disabled"),i&&(this.isMultiple?this.value=a(a([],this.value,!0),[e],!1):this.value=e),this.optionTemplate&&(d=(0,u.htmlToElement)(this.optionTemplate),h.append(d)),d?d.querySelector("[data-title]").textContent=t||"":h.textContent=t||"",o){if(o.icon){var f=(0,u.htmlToElement)(null!==(l=this.apiIconTag)&&void 0!==l?l:o.icon);if(f.classList.add("max-w-full"),this.apiUrl&&(f.setAttribute("alt",t),f.setAttribute("src",o.icon)),d)d.querySelector("[data-icon]").append(f);else{var v=(0,u.htmlToElement)("
");this.iconClasses&&(0,u.classToClassList)(this.iconClasses,v),v.append(f),h.append(v)}}if(o.description)if(d)(p=d.querySelector("[data-description]"))&&p.append(o.description);else{var m=(0,u.htmlToElement)("
");m.textContent=o.description,this.descriptionClasses&&(0,u.classToClassList)(this.descriptionClasses,m),h.append(m)}}d&&d.querySelector("[data-icon]")&&!o&&!(null==o?void 0:o.icon)&&d.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&h.classList.add("selected"),n||h.addEventListener("click",(function(){return c.onSelectOption(e)})),this.optionClasses&&(0,u.classToClassList)(this.optionClasses,h),this.dropdown&&this.dropdown.append(h),i&&this.setNewValue()},e.prototype.buildOptionFromRemoteData=function(t,e,n,i,o,r,s){void 0===n&&(n=!1),void 0===i&&(i=!1),void 0===o&&(o="1"),o?this.buildOption(t,e,n,i,s,o,r):alert("ID parameter is required for generating remote options! Please check your API endpoint have it.")},e.prototype.buildOptionsFromRemoteData=function(t){var e=this;t.forEach((function(t,n){var i=null,o="",r={id:"",title:"",icon:null,description:null,rest:{}};Object.keys(t).forEach((function(n){var s;t[e.apiFieldsMap.id]&&(i=t[e.apiFieldsMap.id]),t[e.apiFieldsMap.title]&&(o=t[e.apiFieldsMap.title]),t[e.apiFieldsMap.icon]&&(r.icon=t[e.apiFieldsMap.icon]),t[null===(s=e.apiFieldsMap)||void 0===s?void 0:s.description]&&(r.description=t[e.apiFieldsMap.description]),r.rest[n]=t[n]})),e.buildOriginalOption(o,o,i,!1,!1,r),e.buildOptionFromRemoteData(o,o,!1,!1,"".concat(n),i,r)})),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")},e.prototype.optionsFromRemoteData=function(){return s(this,arguments,void 0,(function(t){var e;return void 0===t&&(t=""),l(this,(function(n){switch(n.label){case 0:return[4,this.apiRequest(t)];case 1:return e=n.sent(),this.remoteOptions=e,e.length?this.buildOptionsFromRemoteData(this.remoteOptions):console.log("There is no data were responded!"),[2]}}))}))},e.prototype.apiRequest=function(){return s(this,arguments,void 0,(function(t){var e,n,i,o,r,s;return void 0===t&&(t=""),l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=this.apiUrl,n=this.apiSearchQueryKey?"".concat(this.apiSearchQueryKey,"=").concat(t.toLowerCase()):null,i="".concat(this.apiQuery),o=this.apiOptions||{},n&&(e+="?".concat(n)),this.apiQuery&&(e+="".concat(n?"&":"?").concat(i)),[4,fetch(e,o)];case 1:return[4,l.sent().json()];case 2:return r=l.sent(),[2,this.apiDataPart?r[this.apiDataPart]:r];case 3:return s=l.sent(),console.error(s),[3,4];case 4:return[2]}}))}))},e.prototype.sortElements=function(t,e){var n=Array.from(t.querySelectorAll(e));n.sort((function(t,e){var n=t.classList.contains("selected")||t.hasAttribute("selected"),i=e.classList.contains("selected")||e.hasAttribute("selected");return n&&!i?-1:!n&&i?1:0})),n.forEach((function(e){return t.appendChild(e)}))},e.prototype.remoteSearch=function(t){return s(this,void 0,void 0,(function(){var e,n,i,o,r=this;return l(this,(function(s){switch(s.label){case 0:return[4,this.apiRequest(t)];case 1:return e=s.sent(),this.remoteOptions=e,n=e.map((function(t){return"".concat(t.id)})),null,o=this.dropdown.querySelectorAll("[data-value]"),this.el.querySelectorAll("[data-hs-select-option]").forEach((function(t){var e,i=t.getAttribute("data-id");n.includes(i)||(null===(e=r.value)||void 0===e?void 0:e.includes(t.value))||r.destroyOriginalOption(t.value)})),o.forEach((function(t){var e,i=t.getAttribute("data-id");n.includes(i)||(null===(e=r.value)||void 0===e?void 0:e.includes(t.getAttribute("data-value")))?n=n.filter((function(t){return t!==i})):r.destroyOption(t.getAttribute("data-value"))})),(i=e.filter((function(t){return n.includes("".concat(t.id))}))).length?this.buildOptionsFromRemoteData(i):console.log("There is no data were responded!"),[2]}}))}))},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,i,o,r){var s=(0,u.htmlToElement)("");s.setAttribute("value",e),i&&s.setAttribute("disabled","disabled"),o&&s.setAttribute("selected","selected"),n&&s.setAttribute("data-id",n),s.setAttribute("data-hs-select-option",JSON.stringify(r)),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,i=this.wrapper.offsetWidth-(parseInt(window.getComputedStyle(this.wrapper).paddingLeft)+parseInt(window.getComputedStyle(this.wrapper).paddingRight));this.tagsInput.style.width="".concat(Math.min(n,i)+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})):a(a([],Array.from(this.value),!0),[t],!1),this.selectMultipleItems(),this.setNewValue()):(this.value=t,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),(0,u.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(),this.triggerChangeEventForNativeSelect()},e.prototype.triggerChangeEventForNativeSelect=function(){var t=new Event("change",{bubbles:!0});this.el.dispatchEvent(t)},e.prototype.addSelectOption=function(t,e,n,i,o){this.selectOptions=a(a([],this.selectOptions,!0),[{title:t,val:e,disabled:n,selected:i,options:o}],!1)},e.prototype.removeSelectOption=function(t,e){if(void 0===e&&(e=!1),!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t})),this.value=e?this.value.filter((function(e){return e!==t})):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(){var t;"tags"===this.mode?this.setTagsItems():(null===(t=this.value)||void 0===t?void 0:t.length)?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.stringFromValueBasic=function(t){var e=this,n=[],i="";if(t.forEach((function(t){e.isMultiple?e.value.includes(t.val)&&n.push(t.title):e.value===t.val&&n.push(t.title)})),this.toggleCountText&&""!==this.toggleCountText&&n.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){var o=n.slice(0,this.toggleCountTextMinItems-1);i="".concat(o.join(this.toggleSeparators.items)," ").concat(this.toggleSeparators.betweenItemsAndCounter," ").concat(n.length-o.length," ").concat(this.toggleCountText)}else i="".concat(n.length," ").concat(this.toggleCountText);else i=n.join(this.toggleSeparators.items);return i},e.prototype.stringFromValueRemoteData=function(){var t=this,e=this.dropdown.querySelectorAll("[data-title-value]"),n=[],i="";if(e.forEach((function(e){var i=e.getAttribute("data-value");t.isMultiple?t.value.includes(i)&&n.push(i):t.value===i&&n.push(i)})),this.toggleCountText&&""!==this.toggleCountText&&n.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){var o=n.slice(0,this.toggleCountTextMinItems-1);i="".concat(o.join(this.toggleSeparators.items)," ").concat(this.toggleSeparators.betweenItemsAndCounter," ").concat(n.length-o.length," ").concat(this.toggleCountText)}else i="".concat(n.length," ").concat(this.toggleCountText);else i=n.join(this.toggleSeparators.items);return i},e.prototype.stringFromValue=function(){return this.apiUrl?this.stringFromValueRemoteData():this.stringFromValueBasic(this.selectOptions)},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0;var e=Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")}));e&&e.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){var e=this;this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,u.htmlToElement)(this.searchNoResultTemplate),this.searchNoResult.innerText=this.searchNoResultText,(0,u.classToClassList)(this.searchNoResultClasses,this.searchNoResult);var n,i=this.dropdown.querySelectorAll("[data-value]"),o=!1;this.searchLimit&&(n=0),i.forEach((function(i){var r=i.getAttribute("data-title-value").toLocaleLowerCase(),s=t?t.split("").map((function(t){return t.match(/\w/)?"".concat(t,"[\\W_]*"):"\\W*"})).join(""):"",l=new RegExp(s,"i"),a=e.isSearchDirectMatch,c=r.trim();(t?a?!c.toLowerCase().includes(t.toLowerCase())||n>=e.searchLimit:!l.test(c)||n>=e.searchLimit:!l.test(c))?i.classList.add("hidden"):(i.classList.remove("hidden"),o=!0,e.searchLimit&&n++)})),o||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.toggleFn=function(){this.isOpened?this.close():this.open()},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,e=this,n=(null===(t=null===window||void 0===window?void 0:window.$hsSelectCollection)||void 0===t?void 0:t.find((function(t){return t.element.isOpened})))||null;if(n&&n.element.close(),this.animationInProcess)return!1;this.animationInProcess=!0,"window"===this.dropdownScope&&this.dropdown.classList.add("invisible"),this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){var t;(null===(t=null==e?void 0:e.toggle)||void 0===t?void 0:t.ariaExpanded)&&(e.toggle.ariaExpanded="true"),e.wrapper.classList.add("active"),e.dropdown.classList.add("opened"),e.dropdown.classList.contains("w-full")&&"window"===e.dropdownScope&&e.updateDropdownWidth(),e.popperInstance&&"window"===e.dropdownScope&&(e.popperInstance.update(),e.dropdown.classList.remove("invisible")),e.hasSearch&&!e.preventSearchFocus&&e.search.focus(),e.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,n,i,o=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,u.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===(i=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===i||i.classList.remove("hs-select-option-highlighted"),this.isOpened=!1},e.prototype.addOption=function(t){var e=this,n="".concat(this.selectOptions.length),i=function(t){var i=t.title,o=t.val,r=t.disabled,s=t.selected,l=t.options;!!e.selectOptions.some((function(t){return t.val===o}))||(e.addSelectOption(i,o,r,s,l),e.buildOption(i,o,r,s,l,n),e.buildOriginalOption(i,o,null,r,s,l),s&&!e.isMultiple&&e.onSelectOption(o))};Array.isArray(t)?t.forEach((function(t){i(t)})):i(t)},e.prototype.removeOption=function(t){var e=this,n=function(t,n){void 0===n&&(n=!1),!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t,n),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,e.isMultiple)})):n(t,this.isMultiple),this.setNewValue()},e.prototype.recalculateDirection=function(){var t,e,n,i;(0,u.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===(i=this.dropdownDirectionClasses)||void 0===i?void 0:i.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"),i=n?JSON.parse(n):{};new e(t,i)}})),window.$hsSelectCollection&&(window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.open=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.open()},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")&&!t.closest("[data-hs-select-dropdown].opened")){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}))&&p.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Tab":t.preventDefault(),t.stopImmediatePropagation(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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 i=(t?Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),o=n.querySelector(".hs-select-option-highlighted")||n.querySelector(".selected");o||i[0].classList.add("hs-select-option-highlighted");var r=i.findIndex((function(t){return t===o}));r+1 *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),o=n.querySelector(".hs-select-option-highlighted")||n.querySelector(".selected");o||i[0].classList.add("hs-select-option-highlighted");var r=i.findIndex((function(t){return t===o}));if(!(r+1 *:not(.hidden)")):Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((function(t){return!t.classList.contains("disabled")})),o=n.querySelector(".hs-select-option-highlighted");i.length&&(i[0].focus(),o&&o.classList.remove("hs-select-option-highlighted"),i[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})),i=window.$hsSelectCollection.find((function(t){return t.element.el===e}));n.element.close(),i.element.open()}else{(i=window.$hsSelectCollection.find((function(t){return t.element.isOpened})))&&i.element.onSelectOption(t.target.dataset.value||"")}},e}(d.default);window.addEventListener("load",(function(){h.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=h),e.default=h},887:function(t,e,n){ /* * HSStepper - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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,l.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,l.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,l.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,l.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,l.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,l.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,l.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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=a),e.default=a},97:function(t,e,n){ +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;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,o=t.el;n===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||i)&&o.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,o=void 0!==i&&i,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:o,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,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,l.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,o=void 0!==i&&i,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:o,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,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,l.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,l.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,l.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,l.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,l.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 o=this.navItems.find((function(e){return e.index===t.currentIndex}));(o?o.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,l.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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=a),e.default=a},97:function(t,e,n){ /* * HSStrongPassword - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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,l.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,l.dispatch)("change.hs.strongPassword",this.el,o)},e.prototype.hideStrips=function(t){Array.from(this.el.children).forEach((function(e,n){n?@[\\\\\\]^_`{|}~",i.target&&i.init(),i}return o(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,l.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,i=e.getAttribute("data-hs-strong-password-hints-rule-text");(null===(n=t.checksExclude)||void 0===n?void 0:n.includes(i))&&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,"]"))},i=0;return this.availableChecks.includes("lowercase")&&t.match(n.lowercase)&&(i+=1,e.add("lowercase")),this.availableChecks.includes("uppercase")&&t.match(n.uppercase)&&(i+=1,e.add("uppercase")),this.availableChecks.includes("numbers")&&t.match(n.numbers)&&(i+=1,e.add("numbers")),this.availableChecks.includes("special-characters")&&t.match(n["special-characters"])&&(i+=1,e.add("special-characters")),this.availableChecks.includes("min-length")&&t.length>=this.minLength&&(i+=1,e.add("min-length")),t.length||(i=0),i===this.availableChecks.length?this.el.classList.add("accepted"):this.el.classList.remove("accepted"),this.strength=i,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]"),i=t.querySelector("[data-uncheck]");e?(t.classList.add("active"),n.classList.remove("hidden"),i.classList.add("hidden")):(t.classList.remove("active"),n.classList.add("hidden"),i.classList.remove("hidden"))},e.prototype.setStrength=function(t){var e=this.checkStrength(t),n=e.strength,i={strength:n,rules:e.rules};this.hideStrips(n),this.fireEvent("change",i),(0,l.dispatch)("change.hs.strongPassword",this.el,i)},e.prototype.hideStrips=function(t){Array.from(this.el.children).forEach((function(e,n){nt)},e.prototype.isParentHidden=function(){return this.el.closest(".hs-collapse")||this.el.closest(".hs-overlay")},e.prototype.parentType=function(){return this.el.closest(".hs-collapse")?"collapse":!!this.el.closest(".hs-overlay")&&"overlay"},e.prototype.callbackAccordingToType=function(){var t=this;if("collapse"===this.parentType()){var e=this.el.closest(".hs-collapse").id;window.HSCollapse.getInstance('[data-hs-collapse="#'.concat(e,'"]'),!0).element.on("beforeOpen",(function(){if(!t.el)return!1;t.textareaSetHeight(3)}))}else{if("overlay"!==this.parentType())return!1;window.HSOverlay.getInstance(this.el.closest(".hs-overlay"),!0).element.on("open",(function(){if(!t.el)return!1;t.textareaSetHeight(3)}))}},e.getInstance=function(t,e){var n=window.$hsTextareaAutoHeightCollection.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.$hsTextareaAutoHeightCollection||(window.$hsTextareaAutoHeightCollection=[]),document.querySelectorAll("[data-hs-textarea-auto-height]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsTextareaAutoHeightCollection.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-textarea-auto-height"),i=n?JSON.parse(n):{};new e(t,i)}}))},e}(s(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSTextareaAutoHeight=l),e.default=l},502:function(t,e,n){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;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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=a),e.default=a},969:function(t,e,n){ +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;n1&&!!i.el.closest("[data-hs-toggle-password-group]"),i.target&&i.init(),i}return o(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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=a),e.default=a},969:function(t,e,n){ /* * HSTooltip - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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{ +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&&a{ /* * HSStaticMethods - * @version: 2.4.1 + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +Object.defineProperty(e,"__esModule",{value:!0});var i=n(292),o=n(255),r={getClassProperty:i.getClassProperty,afterTransition:i.afterTransition,autoInit:function(t){void 0===t&&(t="all"),"all"===t?o.COLLECTIONS.forEach((function(t){var e=t.fn;null==e||e.autoInit()})):o.COLLECTIONS.forEach((function(e){var n=e.key,i=e.fn;t.includes(n)&&(null==i||i.autoInit())}))},cleanCollection:function(t){void 0===t&&(t="all"),"all"===t?o.COLLECTIONS.forEach((function(t){var e=t.collection;window[e]instanceof Array&&(window[e]=[])})):o.COLLECTIONS.forEach((function(e){var n=e.key,i=e.collection;t.includes(n)&&window[i]instanceof Array&&(window[i]=[])}))}};"undefined"!=typeof window&&(window.HSStaticMethods=r),e.default=r},292:function(t,e){ +/* + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -Object.defineProperty(e,"__esModule",{value:!0});var o=n(292),i=n(255),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())}))},cleanCollection:function(t){void 0===t&&(t="all"),"all"===t?i.COLLECTIONS.forEach((function(t){var e=t.collection;window[e]instanceof Array&&(window[e]=[])})):i.COLLECTIONS.forEach((function(e){var n=e.key,o=e.collection;t.includes(n)&&window[o]instanceof Array&&(window[o]=[])}))}};"undefined"!=typeof window&&(window.HSStaticMethods=r),e.default=r},292: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.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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 i=function(t){return!!t&&("none"===window.getComputedStyle(t).display||i(t.parentElement))};e.isParentOrElementHidden=i;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}return 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})},n(158)})())); \ No newline at end of file +var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=i(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var i=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=i;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.isDirectChild=function(t,e){for(var n=t.children,i=0;i=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 i;return void 0===e&&(e=200),function(){for(var o=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,i){void 0===n&&(n=" "),void 0===i&&(i="add"),t.split(n).forEach((function(t){return"add"===i?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};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}return n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},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})},n(158)})())); \ No newline at end of file diff --git a/dist/range-slider.d.ts b/dist/range-slider.d.ts new file mode 100644 index 0000000..3d77230 --- /dev/null +++ b/dist/range-slider.d.ts @@ -0,0 +1,55 @@ +import { Options } from 'nouislider'; + +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 type TRangeSliderOptionsFormatterType = "integer" | "thousandsSeparatorAndDecimalPoints" | null; +export interface IRangeSliderOptionsFormatterOptions { + type?: TRangeSliderOptionsFormatterType; + prefix?: string; + postfix?: string; +} +export interface IRangeSliderOptions extends Options { + disabled?: boolean; + formatter?: IRangeSliderOptionsFormatterOptions | TRangeSliderOptionsFormatterType; +} +export interface IRangeSlider { + options?: IRangeSliderOptions; +} +declare class HSRangeSlider extends HSBasePlugin implements IRangeSlider { + private readonly concatOptions; + private format; + constructor(el: HTMLElement, options?: IRangeSliderOptions, events?: {}); + get formattedValue(): any; + private processClasses; + private init; + private formatValue; + private integerFormatter; + private prefixOrPostfixFormatter; + private thousandsSeparatorAndDecimalPointsFormatter; + private setDisabled; + static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem; + static autoInit(): void; + static on(evt: string, target: HTMLElement, cb: Function): void; +} + +export { + HSRangeSlider as default, +}; + +export {}; diff --git a/dist/range-slider.js b/dist/range-slider.js new file mode 100644 index 0000000..2a58566 --- /dev/null +++ b/dist/range-slider.js @@ -0,0 +1,9 @@ +!function(t,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o();else if("function"==typeof define&&define.amd)define([],o);else{var n=o();for(var e in n)("object"==typeof exports?exports:t)[e]=n[e]}}(self,(()=>(()=>{"use strict";var t={961:(t,o)=>{Object.defineProperty(o,"__esModule",{value:!0});var n=function(){function t(t,o,n){this.el=t,this.options=o,this.events=n,this.el=t,this.options=o,this.events={}}return t.prototype.createCollection=function(t,o){var n;t.push({id:(null===(n=null==o?void 0:o.el)||void 0===n?void 0:n.id)||t.length+1,element:o})},t.prototype.fireEvent=function(t,o){if(void 0===o&&(o=null),this.events.hasOwnProperty(t))return this.events[t](o)},t.prototype.on=function(t,o){this.events[t]=o},t}();o.default=n},347:function(t,o,n){ +/* + * HSRangeSlider + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +var e,i=this&&this.__extends||(e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])},e(t,o)},function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var o,n=1,e=arguments.length;n{i.d(o,{A:()=>e});class e{constructor(t,o,i){this.el=t,this.options=o,this.events=i,this.el=t,this.options=o,this.events={}}createCollection(t,o){var i;t.push({id:(null===(i=null==o?void 0:o.el)||void 0===i?void 0:i.id)||t.length+1,element:o})}fireEvent(t,o=null){if(this.events.hasOwnProperty(t))return this.events[t](o)}on(t,o){this.events[t]=o}}}},o={};function i(e){var s=o[e];if(void 0!==s)return s.exports;var n=o[e]={exports:{}};return t[e](n,n.exports,i),n.exports}i.d=(t,o)=>{for(var e in o)i.o(o,e)&&!i.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:o[e]})},i.o=(t,o)=>Object.prototype.hasOwnProperty.call(t,o);var e={};i.d(e,{A:()=>r});var s=i(615); +/* + * HSRangeSlider + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */class n extends s.A{constructor(t,o,i){super(t,o,i);const e=t.getAttribute("data-hs-range-slider"),s=e?JSON.parse(e):{};this.concatOptions=Object.assign(Object.assign(Object.assign({},s),o),{cssClasses:Object.assign(Object.assign({},noUiSlider.cssClasses),this.processClasses(s.cssClasses))}),this.init()}get formattedValue(){const t=this.el.noUiSlider.get();if(Array.isArray(t)&&this.format){const o=[];return t.forEach((t=>{o.push(this.format.to(t))})),o}return this.format?this.format.to(t):t}processClasses(t){const o={};return Object.keys(t).forEach((i=>{i&&(o[i]=`${noUiSlider.cssClasses[i]} ${t[i]}`)})),o}init(){var t,o,i,e,s,n,r,a,l,d,c,v,h;this.createCollection(window.$hsRangeSliderCollection,this),("object"==typeof(null===(t=this.concatOptions)||void 0===t?void 0:t.formatter)?"thousandsSeparatorAndDecimalPoints"===(null===(i=null===(o=this.concatOptions)||void 0===o?void 0:o.formatter)||void 0===i?void 0:i.type):"thousandsSeparatorAndDecimalPoints"===(null===(e=this.concatOptions)||void 0===e?void 0:e.formatter))?this.thousandsSeparatorAndDecimalPointsFormatter():("object"==typeof(null===(s=this.concatOptions)||void 0===s?void 0:s.formatter)?"integer"===(null===(r=null===(n=this.concatOptions)||void 0===n?void 0:n.formatter)||void 0===r?void 0:r.type):"integer"===(null===(a=this.concatOptions)||void 0===a?void 0:a.formatter))?this.integerFormatter():"object"==typeof(null===(l=this.concatOptions)||void 0===l?void 0:l.formatter)&&((null===(c=null===(d=this.concatOptions)||void 0===d?void 0:d.formatter)||void 0===c?void 0:c.prefix)||(null===(h=null===(v=this.concatOptions)||void 0===v?void 0:v.formatter)||void 0===h?void 0:h.postfix))&&this.prefixOrPostfixFormatter(),noUiSlider.create(this.el,this.concatOptions),this.concatOptions.disabled&&this.setDisabled()}formatValue(t){var o,i,e,s,n,r,a,l,d;let c="";return"object"==typeof(null===(o=this.concatOptions)||void 0===o?void 0:o.formatter)?((null===(e=null===(i=this.concatOptions)||void 0===i?void 0:i.formatter)||void 0===e?void 0:e.prefix)&&(c+=null===(n=null===(s=this.concatOptions)||void 0===s?void 0:s.formatter)||void 0===n?void 0:n.prefix),c+=t,(null===(a=null===(r=this.concatOptions)||void 0===r?void 0:r.formatter)||void 0===a?void 0:a.postfix)&&(c+=null===(d=null===(l=this.concatOptions)||void 0===l?void 0:l.formatter)||void 0===d?void 0:d.postfix)):c+=t,c}integerFormatter(){var t;this.format={to:t=>this.formatValue(Math.round(t)),from:t=>Math.round(+t)},(null===(t=this.concatOptions)||void 0===t?void 0:t.tooltips)&&(this.concatOptions.tooltips=this.format)}prefixOrPostfixFormatter(){var t;this.format={to:t=>this.formatValue(t),from:t=>+t},(null===(t=this.concatOptions)||void 0===t?void 0:t.tooltips)&&(this.concatOptions.tooltips=this.format)}thousandsSeparatorAndDecimalPointsFormatter(){var t;this.format={to:t=>this.formatValue(new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}).format(t)),from:t=>parseFloat(t.replace(/,/g,""))},(null===(t=this.concatOptions)||void 0===t?void 0:t.tooltips)&&(this.concatOptions.tooltips=this.format)}setDisabled(){this.el.setAttribute("disabled","disabled"),this.el.classList.add("disabled")}static getInstance(t,o=!1){const i=window.$hsRangeSliderCollection.find((o=>o.element.el===("string"==typeof t?document.querySelector(t):t)));return i?o?i:i.element.el:null}static autoInit(){window.$hsRangeSliderCollection||(window.$hsRangeSliderCollection=[]),document.querySelectorAll("[data-hs-range-slider]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsRangeSliderCollection.find((o=>{var i;return(null===(i=null==o?void 0:o.element)||void 0===i?void 0:i.el)===t}))||new n(t)}))}static on(t,o,i){const e=window.$hsRangeSliderCollection.find((t=>t.element.el===("string"==typeof o?document.querySelector(o):o)));e&&(e.element.events[t]=i)}}window.addEventListener("load",(()=>{n.autoInit()})),"undefined"!=typeof window&&(window.HSRangeSlider=n);const r=n;var a=e.A;export{a as default}; \ No newline at end of file diff --git a/dist/remove-element.js b/dist/remove-element.js index d80da53..ed0d2fd 100644 --- a/dist/remove-element.js +++ b/dist/remove-element.js @@ -1,17 +1,16 @@ -!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={961:(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={961:(t,e)=>{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},911:function(t,e,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSRemoveElement + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},911:function(t,e,n){ +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)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,o=arguments.length;ne&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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(),a=r?r.getBoundingClientRect():null,s=window.innerHeight,l=a?i.top-a.top:i.top,u=(r?a.bottom:s)-i.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 r=function(t){return!!t&&("none"===window.getComputedStyle(t).display||r(t.parentElement))};e.isParentOrElementHidden=r;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var r=[],i=0;i0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(911);return n})())); \ No newline at end of file +var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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.isDirectChild=function(t,e){for(var n=t.children,o=0;o=c:"top"===n?u>=c:u>=c||l>=c};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var r=function(t){return!!t&&("none"===window.getComputedStyle(t).display||r(t.parentElement))};e.isParentOrElementHidden=r;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var r=[],i=0;i0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(911);return n})())); \ No newline at end of file diff --git a/dist/remove-element.mjs b/dist/remove-element.mjs new file mode 100644 index 0000000..01693f1 --- /dev/null +++ b/dist/remove-element.mjs @@ -0,0 +1,9 @@ +var e={615:(e,t,o)=>{o.d(t,{A:()=>n});class n{constructor(e,t,o){this.el=e,this.options=t,this.events=o,this.el=e,this.options=t,this.events={}}createCollection(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})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},926:(e,t,o)=>{o.d(t,{yd:()=>n});const n=(e,t)=>{const o=()=>{t(),e.removeEventListener("transitionend",o,!0)},n=window.getComputedStyle(e),i=n.getPropertyValue("transition-duration");"none"!==n.getPropertyValue("transition-property")&&parseFloat(i)>0?e.addEventListener("transitionend",o,!0):t()}}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,o),r.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};o.d(n,{A:()=>a});var i=o(926),r=o(615); +/* + * HSRemoveElement + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class s extends r.A{constructor(e,t){super(e,t);const o=e.getAttribute("data-hs-remove-element-options"),n=o?JSON.parse(o):{},i=Object.assign(Object.assign({},n),t);this.removeTargetId=this.el.getAttribute("data-hs-remove-element"),this.removeTarget=document.querySelector(this.removeTargetId),this.removeTargetAnimationClass=(null==i?void 0:i.removeTargetAnimationClass)||"hs-removing",this.removeTarget&&this.init()}init(){this.createCollection(window.$hsRemoveElementCollection,this),this.el.addEventListener("click",(()=>this.remove()))}remove(){if(!this.removeTarget)return!1;this.removeTarget.classList.add(this.removeTargetAnimationClass),(0,i.yd)(this.removeTarget,(()=>setTimeout((()=>this.removeTarget.remove()))))}static autoInit(){window.$hsRemoveElementCollection||(window.$hsRemoveElementCollection=[]),document.querySelectorAll("[data-hs-remove-element]:not(.--prevent-on-load-init)").forEach((e=>{window.$hsRemoveElementCollection.find((t=>{var o;return(null===(o=null==t?void 0:t.element)||void 0===o?void 0:o.el)===e}))||new s(e)}))}}window.addEventListener("load",(()=>{s.autoInit()})),"undefined"!=typeof window&&(window.HSRemoveElement=s);const a=s;var l=n.A;export{l as default}; \ No newline at end of file diff --git a/dist/scrollspy.js b/dist/scrollspy.js index b13ee3e..211cfd0 100644 --- a/dist/scrollspy.js +++ b/dist/scrollspy.js @@ -1,17 +1,16 @@ -!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={961:(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={961:(t,e)=>{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},751:function(t,e,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSScrollspy + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},751:function(t,e,n){ +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)}),i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(292),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,s.getClassProperty)(this.el,"--scrollspy-offset","0")),o=parseInt((0,s.getClassProperty)(e,"--scrollspy-offset"))||n,r=t.target===document?0:parseInt(String(t.target.getBoundingClientRect().top)),i=parseInt(String(e.getBoundingClientRect().top))-o-r,l=e.offsetHeight;if(i<=0&&i+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,s.getClassProperty)(this.el,"--scrollspy-offset","0")),r=parseInt((0,s.getClassProperty)(n,"--scrollspy-offset"))||o,i=this.scrollable===document?0:this.scrollable.offsetTop,l=n.offsetTop-r-i,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,s.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}(i(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=l),e.default=l},292:function(t,e){ /* - * HSScrollspy - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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)}),i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(292),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,s.getClassProperty)(this.el,"--scrollspy-offset","0")),o=parseInt((0,s.getClassProperty)(e,"--scrollspy-offset"))||n,r=t.target===document?0:parseInt(String(t.target.getBoundingClientRect().top)),i=parseInt(String(e.getBoundingClientRect().top))-o-r,l=e.offsetHeight;if(i<=0&&i+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,s.getClassProperty)(this.el,"--scrollspy-offset","0")),r=parseInt((0,s.getClassProperty)(n,"--scrollspy-offset"))||o,i=this.scrollable===document?0:this.scrollable.offsetTop,l=n.offsetTop-r-i,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,s.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}(i(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=l),e.default=l},292: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.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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 r=function(t){return!!t&&("none"===window.getComputedStyle(t).display||r(t.parentElement))};e.isParentOrElementHidden=r;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var r=[],i=0;i0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(751);return n})())); \ No newline at end of file +var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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.isDirectChild=function(t,e){for(var n=t.children,o=0;o=u:"top"===n?c>=u:c>=u||a>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var r=function(t){return!!t&&("none"===window.getComputedStyle(t).display||r(t.parentElement))};e.isParentOrElementHidden=r;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var r=[],i=0;i0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(751);return n})())); \ No newline at end of file diff --git a/dist/scrollspy.mjs b/dist/scrollspy.mjs new file mode 100644 index 0000000..da38fcc --- /dev/null +++ b/dist/scrollspy.mjs @@ -0,0 +1,16 @@ +var t={615:(t,e,s)=>{s.d(e,{A:()=>o});class o{constructor(t,e,s){this.el=t,this.options=e,this.events=s,this.el=t,this.options=e,this.events={}}createCollection(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})}fireEvent(t,e=null){if(this.events.hasOwnProperty(t))return this.events[t](e)}on(t,e){this.events[t]=e}}},926:(t,e,s)=>{s.d(e,{JD:()=>l,gj:()=>o}); +/* + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +const o=(t,e,s="")=>(window.getComputedStyle(t).getPropertyValue(e)||s).replace(" ","");const l=(t,e,s=null)=>{const o=new CustomEvent(t,{detail:{payload:s},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(o)}}},e={};function s(o){var l=e[o];if(void 0!==l)return l.exports;var i=e[o]={exports:{}};return t[o](i,i.exports,s),i.exports}s.d=(t,e)=>{for(var o in e)s.o(e,o)&&!s.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var o={};s.d(o,{A:()=>n});var l=s(926),i=s(615); +/* + * HSScrollspy + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class r extends i.A{constructor(t,e={}){super(t,e),this.activeSection=null,this.contentId=this.el.getAttribute("data-hs-scrollspy"),this.content=document.querySelector(this.contentId),this.links=this.el.querySelectorAll("[href]"),this.sections=[],this.scrollableId=this.el.getAttribute("data-hs-scrollspy-scrollable-parent"),this.scrollable=this.scrollableId?document.querySelector(this.scrollableId):document,this.init()}init(){this.createCollection(window.$hsScrollspyCollection,this),this.links.forEach((t=>{this.sections.push(this.scrollable.querySelector(t.getAttribute("href")))})),Array.from(this.sections).forEach((t=>{if(!t.getAttribute("id"))return!1;this.scrollable.addEventListener("scroll",(e=>this.update(e,t)))})),this.links.forEach((t=>{t.addEventListener("click",(e=>{if(e.preventDefault(),"javascript:;"===t.getAttribute("href"))return!1;this.scrollTo(t)}))}))}update(t,e){const s=parseInt((0,l.gj)(this.el,"--scrollspy-offset","0")),o=parseInt((0,l.gj)(e,"--scrollspy-offset"))||s,i=t.target===document?0:parseInt(String(t.target.getBoundingClientRect().top)),r=parseInt(String(e.getBoundingClientRect().top))-o-i,n=e.offsetHeight;if(r<=0&&r+n>0){if(this.activeSection===e)return!1;this.links.forEach((t=>{t.classList.remove("active")}));const t=this.el.querySelector(`[href="#${e.getAttribute("id")}"]`);if(t){t.classList.add("active");const e=t.closest("[data-hs-scrollspy-group]");if(e){const t=e.querySelector("[href]");t&&t.classList.add("active")}}this.activeSection=e}}scrollTo(t){const e=t.getAttribute("href"),s=document.querySelector(e),o=parseInt((0,l.gj)(this.el,"--scrollspy-offset","0")),i=parseInt((0,l.gj)(s,"--scrollspy-offset"))||o,r=this.scrollable===document?0:this.scrollable.offsetTop,n=s.offsetTop-i-r,c=this.scrollable===document?window:this.scrollable,a=()=>{window.history.replaceState(null,null,t.getAttribute("href")),"scrollTo"in c&&c.scrollTo({top:n,left:0,behavior:"smooth"})},h=this.fireEvent("beforeScroll",this.el);(0,l.JD)("beforeScroll.hs.scrollspy",this.el,this.el),h instanceof Promise?h.then((()=>a())):a()}static getInstance(t,e=!1){const s=window.$hsScrollspyCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return s?e?s:s.element.el:null}static autoInit(){window.$hsScrollspyCollection||(window.$hsScrollspyCollection=[]),document.querySelectorAll("[data-hs-scrollspy]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsScrollspyCollection.find((e=>{var s;return(null===(s=null==e?void 0:e.element)||void 0===s?void 0:s.el)===t}))||new r(t)}))}}window.addEventListener("load",(()=>{r.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=r);const n=r;var c=o.A;export{c as default}; \ No newline at end of file diff --git a/dist/search-by-json.d.ts b/dist/search-by-json.d.ts deleted file mode 100644 index bc2e52f..0000000 --- a/dist/search-by-json.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -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; -} -export interface ISearchByJsonOptions { - jsonUrl: string; - minChars?: number; - dropdownTemplate?: string; - dropdownClasses?: string; - dropdownItemTemplate?: string; - dropdownItemTemplatesByType?: ISearchItemTemplate[]; - dropdownItemClasses?: string; - highlightedTextTagName?: string; - highlightedTextClasses?: string; -} -export interface ISearchByJson { - options?: ISearchByJsonOptions; -} -declare class HSSearchByJson extends HSBasePlugin implements ISearchByJson { - private readonly jsonUrl; - private readonly minChars; - private json; - private result; - private val; - private readonly dropdownTemplate; - private readonly dropdownClasses; - private readonly dropdownItemTemplate; - private readonly dropdownItemTemplatesByType; - private readonly dropdownItemClasses; - private readonly highlightedTextTagName; - private readonly highlightedTextClasses; - private dropdown; - constructor(el: HTMLInputElement, options?: ISearchByJsonOptions); - private init; - private fetchData; - private searchData; - private buildDropdown; - private buildItems; - private itemTemplate; - static getInstance(target: HTMLElement | string): HSSearchByJson; - static autoInit(): void; -} - -export { - HSSearchByJson as default, -}; - -export {}; diff --git a/dist/select.d.ts b/dist/select.d.ts index 35d975f..cd1e58f 100644 --- a/dist/select.d.ts +++ b/dist/select.d.ts @@ -27,6 +27,13 @@ export interface ISingleOption { selected?: boolean; options?: ISingleOptionOptions | null; } +export interface IApiFieldMap { + id: string; + title: string; + icon?: string | null; + description?: string | null; + [key: string]: unknown; +} export interface ISelectOptions { value?: string | string[]; isOpened?: boolean; @@ -36,6 +43,13 @@ export interface ISelectOptions { mode?: string; viewport?: string; wrapperClasses?: string; + apiUrl?: string | null; + apiQuery?: string | null; + apiOptions?: RequestInit | null; + apiDataPart?: string | null; + apiSearchQueryKey?: string | null; + apiFieldsMap?: IApiFieldMap | null; + apiIconTag?: string | null; toggleTag?: string; toggleClasses?: string; toggleSeparators?: { @@ -47,6 +61,7 @@ export interface ISelectOptions { toggleCountTextMode?: string; tagsItemTemplate?: string; tagsItemClasses?: string; + tagsInputId?: string; tagsInputClasses?: string; dropdownTag?: string; dropdownClasses?: string; @@ -55,11 +70,18 @@ export interface ISelectOptions { bottom?: string; }; dropdownSpace: number; + dropdownPlacement: string | null; + dropdownScope: "window" | "parent"; extraMarkup?: string | string[] | null; + searchTemplate?: string; searchWrapperTemplate?: string; + searchId?: string; + searchLimit?: number | typeof Infinity; + isSearchDirectMatch?: boolean; searchClasses?: string; searchWrapperClasses?: string; searchPlaceholder?: string; + searchNoResultTemplate?: string | null; searchNoResultText?: string | null; searchNoResultClasses?: string | null; optionTemplate?: string; @@ -89,6 +111,13 @@ declare class HSSelect extends HSBasePlugin implements ISelect { isMultiple: boolean | null; isDisabled: boolean | null; selectedItems: string[]; + private readonly apiUrl; + private readonly apiQuery; + private readonly apiOptions; + private readonly apiDataPart; + private readonly apiSearchQueryKey; + private readonly apiFieldsMap; + private readonly apiIconTag; private readonly toggleTag; private readonly toggleClasses; private readonly toggleSeparators; @@ -98,15 +127,23 @@ declare class HSSelect extends HSBasePlugin implements ISelect { private readonly wrapperClasses; private readonly tagsItemTemplate; private readonly tagsItemClasses; + private readonly tagsInputId; private readonly tagsInputClasses; private readonly dropdownTag; private readonly dropdownClasses; private readonly dropdownDirectionClasses; dropdownSpace: number | null; + readonly dropdownPlacement: string | null; + readonly dropdownScope: "window" | "parent"; + private readonly searchTemplate; private readonly searchWrapperTemplate; private readonly searchPlaceholder; + private readonly searchId; + private readonly searchLimit; + private readonly isSearchDirectMatch; private readonly searchClasses; private readonly searchWrapperClasses; + private readonly searchNoResultTemplate; private readonly searchNoResultText; private readonly searchNoResultClasses; private readonly optionTag; @@ -120,6 +157,7 @@ declare class HSSelect extends HSBasePlugin implements ISelect { private toggleTextWrapper; private tagsInput; private dropdown; + private popperInstance; private searchWrapper; private search; private searchNoResult; @@ -127,6 +165,8 @@ declare class HSSelect extends HSBasePlugin implements ISelect { private extraMarkup; private readonly isAddTagOnEnter; private tagsInputHelper; + private remoteOptions; + private optionId; constructor(el: HTMLElement, options?: ISelectOptions); setValue(val: string | string[]): void; private init; @@ -143,8 +183,16 @@ declare class HSSelect extends HSBasePlugin implements ISelect { private setTagsItems; private buildTagsInput; private buildDropdown; + private buildPopper; + private updateDropdownWidth; private buildSearch; private buildOption; + private buildOptionFromRemoteData; + private buildOptionsFromRemoteData; + private optionsFromRemoteData; + private apiRequest; + private sortElements; + private remoteSearch; private destroyOption; private buildOriginalOption; private destroyOriginalOption; @@ -158,6 +206,8 @@ declare class HSSelect extends HSBasePlugin implements ISelect { private resetTagsInputField; private clearSelections; private setNewValue; + private stringFromValueBasic; + private stringFromValueRemoteData; private stringFromValue; private selectSingleItem; private selectMultipleItems; @@ -165,6 +215,7 @@ declare class HSSelect extends HSBasePlugin implements ISelect { private searchOptions; private eraseToggleIcon; private eraseToggleTitle; + private toggleFn; destroy(): void; open(): boolean; close(): boolean; diff --git a/dist/select.js b/dist/select.js index 27bd730..9258b56 100644 --- a/dist/select.js +++ b/dist/select.js @@ -1,17 +1,16 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(self,(()=>(()=>{"use strict";var t={223:(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}},961:(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 i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(self,(()=>(()=>{"use strict";var t={223:(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={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},961:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e,i){this.el=t,this.options=e,this.events=i,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var i;t.push({id:(null===(i=null==e?void 0:e.el)||void 0===i?void 0:i.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=i},442:function(t,e,i){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSSelect + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e,i){this.el=t,this.options=e,this.events=i,this.el=t,this.options=e,this.events={}}return t.prototype.createCollection=function(t,e){var i;t.push({id:(null===(i=null==e?void 0:e.el)||void 0===i?void 0:i.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=i},442:function(t,e,i){ +var n,o=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 i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},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 i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0&&o[o.length-1])||6!==l[0]&&2!==l[0])){r=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]",r.searchNoResultText=(null==d?void 0:d.searchNoResultText)||"No results found",r.searchNoResultClasses=(null==d?void 0:d.searchNoResultClasses)||"px-4 text-sm text-gray-800 dark:text-neutral-200",r.optionTemplate=(null==d?void 0:d.optionTemplate)||null,r.optionTag=(null==d?void 0:d.optionTag)||null,r.optionClasses=(null==d?void 0:d.optionClasses)||null,r.extraMarkup=(null==d?void 0:d.extraMarkup)||null,r.descriptionClasses=(null==d?void 0:d.descriptionClasses)||null,r.iconClasses=(null==d?void 0:d.iconClasses)||null,r.isAddTagOnEnter=null===(o=null==d?void 0:d.isAddTagOnEnter)||void 0===o||o,r.animationInProcess=!1,r.selectOptions=[],r.remoteOptions=[],r.tagsInputHelper=null,r.init(),r}return o(e,t),e.prototype.setValue=function(t){this.value=t,this.clearSelections(),Array.isArray(t)?(this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder,this.unselectMultipleItems(),this.selectMultipleItems()):(this.setToggleTitle(),this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.selectSingleItem())},e.prototype.init=function(){this.createCollection(window.$hsSelectCollection,this),this.build()},e.prototype.build=function(){var t=this;if(this.el.style.display="none",this.el.children&&Array.from(this.el.children).filter((function(t){return t.value&&""!==t.value})).forEach((function(e){var i=e.getAttribute("data-hs-select-option");t.selectOptions=a(a([],t.selectOptions,!0),[{title:e.textContent,val:e.value,disabled:e.disabled,options:"undefined"!==i?JSON.parse(i):null}],!1)})),this.isMultiple){var e=Array.from(this.el.children).filter((function(t){return t.selected}));if(e){var i=[];e.forEach((function(t){i.push(t.value)})),this.value=i}}this.buildWrapper(),"tags"===this.mode?this.buildTags():this.buildToggle(),this.buildDropdown(),this.extraMarkup&&this.buildExtraMarkup()},e.prototype.buildWrapper=function(){var t=this;this.wrapper=document.createElement("div"),this.wrapper.classList.add("hs-select","relative"),"tags"===this.mode&&this.wrapper.addEventListener("click",(function(e){e.target.closest("[data-hs-select-dropdown]")||e.target.closest("[data-tag-value]")||t.tagsInput.focus()})),this.wrapperClasses&&(0,c.classToClassList)(this.wrapperClasses,this.wrapper),this.el.before(this.wrapper),this.wrapper.append(this.el)},e.prototype.buildExtraMarkup=function(){var t=this,e=function(e){var i=(0,c.htmlToElement)(e);return t.wrapper.append(i),i},i=function(e){e.classList.contains("--prevent-click")||e.addEventListener("click",(function(e){e.stopPropagation(),t.toggleFn()}))};if(Array.isArray(this.extraMarkup))this.extraMarkup.forEach((function(t){var n=e(t);i(n)}));else{var n=e(this.extraMarkup);i(n)}},e.prototype.buildToggle=function(){var t,e,i,n,o=this;this.toggleTextWrapper=document.createElement("span"),this.toggleTextWrapper.classList.add("truncate"),this.toggle=(0,c.htmlToElement)(this.toggleTag||"
"),i=this.toggle.querySelector("[data-icon]"),n=this.toggle.querySelector("[data-title]"),!this.isMultiple&&i&&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,c.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),(null===(e=this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.isOpened?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(){if(o.isDisabled)return!1;o.toggleFn()}))},e.prototype.setToggleIcon=function(){var t,e=this.getItemByValue(this.value),i=this.toggle.querySelector("[data-icon]");if(i.innerHTML="",i){var n=(0,c.htmlToElement)(this.apiUrl&&this.apiIconTag?this.apiIconTag||"":(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.icon)||"");this.value&&this.apiUrl&&this.apiIconTag&&e[this.apiFieldsMap.icon]&&(n.src=e[this.apiFieldsMap.icon]||""),i.append(n),n&&(null==n?void 0:n.src)?i.classList.remove("hidden"):i.classList.add("hidden")}},e.prototype.setToggleTitle=function(){var t,e=this.toggle.querySelector("[data-title]");if(e.classList.add("truncate"),e.innerHTML="",e){var i=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder;e.innerHTML=i,this.toggle.append(e)}},e.prototype.buildTags=function(){this.isDisabled&&this.wrapper.classList.add("disabled"),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,i,n,o,s,r,l,a,d=this,u=this.getItemByValue(t),p=document.createElement("div");if(p.setAttribute("data-tag-value",t),this.tagsItemClasses&&(0,c.classToClassList)(this.tagsItemClasses,p),this.tagsItemTemplate&&(s=(0,c.htmlToElement)(this.tagsItemTemplate),p.append(s)),(null===(e=null==u?void 0:u.options)||void 0===e?void 0:e.icon)||this.apiIconTag){var h=(0,c.htmlToElement)(this.apiUrl&&this.apiIconTag?this.apiIconTag:null===(i=null==u?void 0:u.options)||void 0===i?void 0:i.icon);this.apiUrl&&this.apiIconTag&&u[this.apiFieldsMap.icon]&&(h.src=u[this.apiFieldsMap.icon]||""),(a=s?s.querySelector("[data-icon]"):document.createElement("span")).append(h),s||p.append(a)}!s||!s.querySelector("[data-icon]")||(null===(n=null==u?void 0:u.options)||void 0===n?void 0:n.icon)||this.apiUrl||this.apiIconTag||u[null===(o=this.apiFieldsMap)||void 0===o?void 0:o.icon]||s.querySelector("[data-icon]").classList.add("hidden"),(r=s?s.querySelector("[data-title]"):document.createElement("span")).textContent=u.title||"",s||p.append(r),s?l=s.querySelector("[data-remove]"):((l=document.createElement("span")).textContent="X",p.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(),p.remove()})),this.wrapper.append(p)},e.prototype.getItemByValue=function(t){var e=this;return this.apiUrl?this.remoteOptions.find((function(i){return i[e.apiFieldsMap.title]===t})):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:a(a([],t.selectedItems,!0),[e],!1)}))},e.prototype.buildTagsInput=function(){var t=this;this.tagsInput=document.createElement("input"),this.tagsInputId&&(this.tagsInput.id=this.tagsInputId),this.tagsInputClasses&&(0,c.classToClassList)(this.tagsInputClasses,this.tagsInput),this.tagsInput.addEventListener("focus",(function(){t.isOpened||t.open()})),this.tagsInput.addEventListener("input",(function(){return t.calculateInputWidth()})),this.tagsInput.addEventListener("input",(0,c.debounce)((function(e){return t.searchOptions(e.target.value)}))),this.tagsInput.addEventListener("keydown",(function(e){if("Enter"===e.key&&t.isAddTagOnEnter){var i=e.target.value;if(t.selectOptions.find((function(t){return t.val===i})))return!1;t.addSelectOption(i,i),t.buildOption(i,i),t.dropdown.querySelector('[data-value="'.concat(i,'"]')).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,c.htmlToElement)(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),"parent"===this.dropdownScope&&this.dropdown.classList.add("absolute","top-full"),this.dropdown.role="listbox",this.dropdown.tabIndex=-1,this.dropdown.ariaOrientation="vertical",this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,c.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,i){return t.buildOption(e.title,e.val,e.disabled,e.selected,e.options,"".concat(i))})),this.apiUrl&&this.optionsFromRemoteData(),"window"===this.dropdownScope&&this.buildPopper()},e.prototype.buildPopper=function(){"undefined"!=typeof Popper&&Popper.createPopper&&(document.body.appendChild(this.dropdown),this.popperInstance=Popper.createPopper("tags"===this.mode?this.wrapper:this.toggle,this.dropdown,{placement:p.POSITIONS[this.dropdownPlacement]||"bottom",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,5]}}]}))},e.prototype.updateDropdownWidth=function(){var t="tags"===this.mode?this.wrapper:this.toggle;this.dropdown.style.width="".concat(t.clientWidth,"px")},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,c.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,c.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]");var i=(0,c.htmlToElement)(this.searchTemplate||'');this.search="INPUT"===i.tagName?i:i.querySelector(":scope input"),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,c.classToClassList)(this.searchClasses,this.search),this.searchId&&(this.search.id=this.searchId),this.search.addEventListener("input",(0,c.debounce)((function(t){e.apiUrl?e.remoteSearch(t.target.value):e.searchOptions(t.target.value)}))),t?t.append(i):this.searchWrapper.append(i),this.dropdown.append(this.searchWrapper)},e.prototype.buildOption=function(t,e,i,n,o,s,r){var l,d=this;void 0===i&&(i=!1),void 0===n&&(n=!1),void 0===s&&(s="1");var u=null,p=null,h=(0,c.htmlToElement)(this.optionTag||"
");if(h.setAttribute("data-value",e),h.setAttribute("data-title-value",t),h.setAttribute("tabIndex",s),h.classList.add("cursor-pointer"),h.setAttribute("data-id",r||"".concat(this.optionId)),r||this.optionId++,i&&h.classList.add("disabled"),n&&(this.isMultiple?this.value=a(a([],this.value,!0),[e],!1):this.value=e),this.optionTemplate&&(u=(0,c.htmlToElement)(this.optionTemplate),h.append(u)),u?u.querySelector("[data-title]").textContent=t||"":h.textContent=t||"",o){if(o.icon){var g=(0,c.htmlToElement)(null!==(l=this.apiIconTag)&&void 0!==l?l:o.icon);if(g.classList.add("max-w-full"),this.apiUrl&&(g.setAttribute("alt",t),g.setAttribute("src",o.icon)),u)u.querySelector("[data-icon]").append(g);else{var v=(0,c.htmlToElement)("
");this.iconClasses&&(0,c.classToClassList)(this.iconClasses,v),v.append(g),h.append(v)}}if(o.description)if(u)(p=u.querySelector("[data-description]"))&&p.append(o.description);else{var f=(0,c.htmlToElement)("
");f.textContent=o.description,this.descriptionClasses&&(0,c.classToClassList)(this.descriptionClasses,f),h.append(f)}}u&&u.querySelector("[data-icon]")&&!o&&!(null==o?void 0:o.icon)&&u.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&h.classList.add("selected"),i||h.addEventListener("click",(function(){return d.onSelectOption(e)})),this.optionClasses&&(0,c.classToClassList)(this.optionClasses,h),this.dropdown&&this.dropdown.append(h),n&&this.setNewValue()},e.prototype.buildOptionFromRemoteData=function(t,e,i,n,o,s,r){void 0===i&&(i=!1),void 0===n&&(n=!1),void 0===o&&(o="1"),o?this.buildOption(t,e,i,n,r,o,s):alert("ID parameter is required for generating remote options! Please check your API endpoint have it.")},e.prototype.buildOptionsFromRemoteData=function(t){var e=this;t.forEach((function(t,i){var n=null,o="",s={id:"",title:"",icon:null,description:null,rest:{}};Object.keys(t).forEach((function(i){var r;t[e.apiFieldsMap.id]&&(n=t[e.apiFieldsMap.id]),t[e.apiFieldsMap.title]&&(o=t[e.apiFieldsMap.title]),t[e.apiFieldsMap.icon]&&(s.icon=t[e.apiFieldsMap.icon]),t[null===(r=e.apiFieldsMap)||void 0===r?void 0:r.description]&&(s.description=t[e.apiFieldsMap.description]),s.rest[i]=t[i]})),e.buildOriginalOption(o,o,n,!1,!1,s),e.buildOptionFromRemoteData(o,o,!1,!1,"".concat(i),n,s)})),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")},e.prototype.optionsFromRemoteData=function(){return r(this,arguments,void 0,(function(t){var e;return void 0===t&&(t=""),l(this,(function(i){switch(i.label){case 0:return[4,this.apiRequest(t)];case 1:return e=i.sent(),this.remoteOptions=e,e.length?this.buildOptionsFromRemoteData(this.remoteOptions):console.log("There is no data were responded!"),[2]}}))}))},e.prototype.apiRequest=function(){return r(this,arguments,void 0,(function(t){var e,i,n,o,s,r;return void 0===t&&(t=""),l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=this.apiUrl,i=this.apiSearchQueryKey?"".concat(this.apiSearchQueryKey,"=").concat(t.toLowerCase()):null,n="".concat(this.apiQuery),o=this.apiOptions||{},i&&(e+="?".concat(i)),this.apiQuery&&(e+="".concat(i?"&":"?").concat(n)),[4,fetch(e,o)];case 1:return[4,l.sent().json()];case 2:return s=l.sent(),[2,this.apiDataPart?s[this.apiDataPart]:s];case 3:return r=l.sent(),console.error(r),[3,4];case 4:return[2]}}))}))},e.prototype.sortElements=function(t,e){var i=Array.from(t.querySelectorAll(e));i.sort((function(t,e){var i=t.classList.contains("selected")||t.hasAttribute("selected"),n=e.classList.contains("selected")||e.hasAttribute("selected");return i&&!n?-1:!i&&n?1:0})),i.forEach((function(e){return t.appendChild(e)}))},e.prototype.remoteSearch=function(t){return r(this,void 0,void 0,(function(){var e,i,n,o,s=this;return l(this,(function(r){switch(r.label){case 0:return[4,this.apiRequest(t)];case 1:return e=r.sent(),this.remoteOptions=e,i=e.map((function(t){return"".concat(t.id)})),null,o=this.dropdown.querySelectorAll("[data-value]"),this.el.querySelectorAll("[data-hs-select-option]").forEach((function(t){var e,n=t.getAttribute("data-id");i.includes(n)||(null===(e=s.value)||void 0===e?void 0:e.includes(t.value))||s.destroyOriginalOption(t.value)})),o.forEach((function(t){var e,n=t.getAttribute("data-id");i.includes(n)||(null===(e=s.value)||void 0===e?void 0:e.includes(t.getAttribute("data-value")))?i=i.filter((function(t){return t!==n})):s.destroyOption(t.getAttribute("data-value"))})),(n=e.filter((function(t){return i.includes("".concat(t.id))}))).length?this.buildOptionsFromRemoteData(n):console.log("There is no data were responded!"),[2]}}))}))},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,i,n,o,s){var r=(0,c.htmlToElement)("");r.setAttribute("value",e),n&&r.setAttribute("disabled","disabled"),o&&r.setAttribute("selected","selected"),i&&r.setAttribute("data-id",i),r.setAttribute("data-hs-select-option",JSON.stringify(s)),r.innerText=t,this.el.append(r)},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),i=this.tagsInputHelper.offsetWidth+t+e,n=this.wrapper.offsetWidth-(parseInt(window.getComputedStyle(this.wrapper).paddingLeft)+parseInt(window.getComputedStyle(this.wrapper).paddingRight));this.tagsInput.style.width="".concat(Math.min(i,n)+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})):a(a([],Array.from(this.value),!0),[t],!1),this.selectMultipleItems(),this.setNewValue()):(this.value=t,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),(0,c.dispatch)("change.hs.select",this.el,this.value),"tags"===this.mode){var i=this.selectedItems.filter((function(t){return!e.value.includes(t)}));i.length&&i.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(),this.triggerChangeEventForNativeSelect()},e.prototype.triggerChangeEventForNativeSelect=function(){var t=new Event("change",{bubbles:!0});this.el.dispatchEvent(t)},e.prototype.addSelectOption=function(t,e,i,n,o){this.selectOptions=a(a([],this.selectOptions,!0),[{title:t,val:e,disabled:i,selected:n,options:o}],!1)},e.prototype.removeSelectOption=function(t,e){if(void 0===e&&(e=!1),!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t})),this.value=e?this.value.filter((function(e){return e!==t})):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(){var t;"tags"===this.mode?this.setTagsItems():(null===(t=this.value)||void 0===t?void 0:t.length)?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.stringFromValueBasic=function(t){var e=this,i=[],n="";if(t.forEach((function(t){e.isMultiple?e.value.includes(t.val)&&i.push(t.title):e.value===t.val&&i.push(t.title)})),this.toggleCountText&&""!==this.toggleCountText&&i.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){var o=i.slice(0,this.toggleCountTextMinItems-1);n="".concat(o.join(this.toggleSeparators.items)," ").concat(this.toggleSeparators.betweenItemsAndCounter," ").concat(i.length-o.length," ").concat(this.toggleCountText)}else n="".concat(i.length," ").concat(this.toggleCountText);else n=i.join(this.toggleSeparators.items);return n},e.prototype.stringFromValueRemoteData=function(){var t=this,e=this.dropdown.querySelectorAll("[data-title-value]"),i=[],n="";if(e.forEach((function(e){var n=e.getAttribute("data-value");t.isMultiple?t.value.includes(n)&&i.push(n):t.value===n&&i.push(n)})),this.toggleCountText&&""!==this.toggleCountText&&i.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){var o=i.slice(0,this.toggleCountTextMinItems-1);n="".concat(o.join(this.toggleSeparators.items)," ").concat(this.toggleSeparators.betweenItemsAndCounter," ").concat(i.length-o.length," ").concat(this.toggleCountText)}else n="".concat(i.length," ").concat(this.toggleCountText);else n=i.join(this.toggleSeparators.items);return n},e.prototype.stringFromValue=function(){return this.apiUrl?this.stringFromValueRemoteData():this.stringFromValueBasic(this.selectOptions)},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0;var e=Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")}));e&&e.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){var e=this;this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,c.htmlToElement)(this.searchNoResultTemplate),this.searchNoResult.innerText=this.searchNoResultText,(0,c.classToClassList)(this.searchNoResultClasses,this.searchNoResult);var i,n=this.dropdown.querySelectorAll("[data-value]"),o=!1;this.searchLimit&&(i=0),n.forEach((function(n){var s=n.getAttribute("data-title-value").toLocaleLowerCase(),r=t?t.split("").map((function(t){return t.match(/\w/)?"".concat(t,"[\\W_]*"):"\\W*"})).join(""):"",l=new RegExp(r,"i"),a=e.isSearchDirectMatch,d=s.trim();(t?a?!d.toLowerCase().includes(t.toLowerCase())||i>=e.searchLimit:!l.test(d)||i>=e.searchLimit:!l.test(d))?n.classList.add("hidden"):(n.classList.remove("hidden"),o=!0,e.searchLimit&&i++)})),o||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.toggleFn=function(){this.isOpened?this.close():this.open()},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,e=this,i=(null===(t=null===window||void 0===window?void 0:window.$hsSelectCollection)||void 0===t?void 0:t.find((function(t){return t.element.isOpened})))||null;if(i&&i.element.close(),this.animationInProcess)return!1;this.animationInProcess=!0,"window"===this.dropdownScope&&this.dropdown.classList.add("invisible"),this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){var t;(null===(t=null==e?void 0:e.toggle)||void 0===t?void 0:t.ariaExpanded)&&(e.toggle.ariaExpanded="true"),e.wrapper.classList.add("active"),e.dropdown.classList.add("opened"),e.dropdown.classList.contains("w-full")&&"window"===e.dropdownScope&&e.updateDropdownWidth(),e.popperInstance&&"window"===e.dropdownScope&&(e.popperInstance.update(),e.dropdown.classList.remove("invisible")),e.hasSearch&&!e.preventSearchFocus&&e.search.focus(),e.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,i,n,o=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(i=this.dropdownDirectionClasses)||void 0===i?void 0:i.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,c.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,i="".concat(this.selectOptions.length),n=function(t){var n=t.title,o=t.val,s=t.disabled,r=t.selected,l=t.options;!!e.selectOptions.some((function(t){return t.val===o}))||(e.addSelectOption(n,o,s,r,l),e.buildOption(n,o,s,r,l,i),e.buildOriginalOption(n,o,null,s,r,l),r&&!e.isMultiple&&e.onSelectOption(o))};Array.isArray(t)?t.forEach((function(t){n(t)})):n(t)},e.prototype.removeOption=function(t){var e=this,i=function(t,i){void 0===i&&(i=!1),!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t,i),e.destroyOption(t),e.destroyOriginalOption(t),e.value===t&&(e.value=null,e.eraseToggleTitle(),e.eraseToggleIcon()))};Array.isArray(t)?t.forEach((function(t){i(t,e.isMultiple)})):i(t,this.isMultiple),this.setNewValue()},e.prototype.recalculateDirection=function(){var t,e,i,n;(0,c.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===(i=this.dropdownDirectionClasses)||void 0===i?void 0:i.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.classList.add("bottom-full"),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.bottom)&&this.dropdown.classList.add(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="".concat(this.dropdownSpace,"px"))},e.getInstance=function(t,e){var i=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return i?e?i:i.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 i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))){var i=t.getAttribute("data-hs-select"),n=i?JSON.parse(i):{};new e(t,n)}})),window.$hsSelectCollection&&(window.addEventListener("click",(function(t){var i=t.target;e.closeCurrentlyOpened(i)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.open=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.open()},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")&&!t.closest("[data-hs-select-dropdown].opened")){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}))&&p.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Tab":t.preventDefault(),t.stopImmediatePropagation(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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 i=e.element.dropdown;if(!i)return!1;var n=(t?Array.from(i.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(i.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),o=i.querySelector(".hs-select-option-highlighted")||i.querySelector(".selected");o||n[0].classList.add("hs-select-option-highlighted");var s=n.findIndex((function(t){return t===o}));s+1 *:not(.hidden)")).reverse():Array.from(i.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),o=i.querySelector(".hs-select-option-highlighted")||i.querySelector(".selected");o||n[0].classList.add("hs-select-option-highlighted");var s=n.findIndex((function(t){return t===o}));if(!(s+1 *:not(.hidden)")):Array.from(i.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((function(t){return!t.classList.contains("disabled")})),o=i.querySelector(".hs-select-option-highlighted");n.length&&(n[0].focus(),o&&o.classList.remove("hs-select-option-highlighted"),n[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 i=window.$hsSelectCollection.find((function(t){return t.element.isOpened})),n=window.$hsSelectCollection.find((function(t){return t.element.el===e}));i.element.close(),n.element.open()}else{(n=window.$hsSelectCollection.find((function(t){return t.element.isOpened})))&&n.element.onSelectOption(t.target.dataset.value||"")}},e}(u.default);window.addEventListener("load",(function(){h.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=h),e.default=h},292:function(t,e){ /* - * HSSelect - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -var n,s=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 i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},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 i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,i=1,n=arguments.length;i"),i=this.toggle.querySelector("[data-icon]"),n=this.toggle.querySelector("[data-title]"),!this.isMultiple&&i&&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,a.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),(null===(e=this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.isOpened?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(){if(s.isDisabled)return!1;s.isOpened?s.close():s.open()}))},e.prototype.setToggleIcon=function(){var t,e,i=this.toggle.querySelector("[data-icon]");if(i.innerHTML="",i){var n=(0,a.htmlToElement)((null===(e=null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.options)||void 0===e?void 0:e.icon)||"");i.append(n),n?i.classList.remove("hidden"):i.classList.add("hidden")}},e.prototype.setToggleTitle=function(){var t,e=this.toggle.querySelector("[data-title]");if(e.classList.add("truncate"),e.innerHTML="",e){var i=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder;e.innerHTML=i,this.toggle.append(e)}},e.prototype.buildTags=function(){this.isDisabled&&this.wrapper.classList.add("disabled"),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,i,n,s,o,l,r,d=this,c=this.getItemByValue(t),u=document.createElement("div");if(u.setAttribute("data-tag-value",t),this.tagsItemClasses&&(0,a.classToClassList)(this.tagsItemClasses,u),this.tagsItemTemplate&&(s=(0,a.htmlToElement)(this.tagsItemTemplate),u.append(s)),null===(e=null==c?void 0:c.options)||void 0===e?void 0:e.icon){var p=(0,a.htmlToElement)(null===(i=null==c?void 0:c.options)||void 0===i?void 0:i.icon);(r=s?s.querySelector("[data-icon]"):document.createElement("span")).append(p),s||u.append(r)}s&&s.querySelector("[data-icon]")&&!(null===(n=null==c?void 0:c.options)||void 0===n?void 0:n.icon)&&s.querySelector("[data-icon]").classList.add("hidden"),(o=s?s.querySelector("[data-title]"):document.createElement("span")).textContent=c.title||"",s||u.append(o),s?l=s.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,a.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,a.debounce)((function(e){return t.searchOptions(e.target.value)}))),this.tagsInput.addEventListener("keydown",(function(e){if("Enter"===e.key&&t.isAddTagOnEnter){var i=e.target.value;if(t.selectOptions.find((function(t){return t.val===i})))return!1;t.addSelectOption(i,i),t.buildOption(i,i),t.dropdown.querySelector('[data-value="'.concat(i,'"]')).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,a.htmlToElement)(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),this.dropdown.classList.add("absolute","top-full"),this.dropdown.role="listbox",this.dropdown.tabIndex=-1,this.dropdown.ariaOrientation="vertical",this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,a.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,i){return t.buildOption(e.title,e.val,e.disabled,e.selected,e.options,"".concat(i))}))},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,a.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,a.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]"),this.search=(0,a.htmlToElement)(''),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,a.classToClassList)(this.searchClasses,this.search),this.search.addEventListener("input",(0,a.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,i,n,s,o){var r=this;void 0===i&&(i=!1),void 0===n&&(n=!1),void 0===o&&(o="1");var d=null,c=(0,a.htmlToElement)(this.optionTag||"
");if(c.setAttribute("data-value",e),c.setAttribute("data-title-value",t),c.setAttribute("tabIndex",o),c.classList.add("cursor-pointer"),i&&c.classList.add("disabled"),n&&(this.isMultiple?this.value=l(l([],this.value,!0),[e],!1):this.value=e),this.optionTemplate&&(d=(0,a.htmlToElement)(this.optionTemplate),c.append(d)),d?d.querySelector("[data-title]").textContent=t||"":c.textContent=t||"",s){if(s.icon){var u=(0,a.htmlToElement)(s.icon);if(u.classList.add("max-w-full"),d)d.querySelector("[data-icon]").append(u);else{var p=(0,a.htmlToElement)("
");this.iconClasses&&(0,a.classToClassList)(this.iconClasses,p),p.append(u),c.append(p)}}if(s.description)if(d)d.querySelector("[data-description]").append(s.description);else{var h=(0,a.htmlToElement)("
");h.textContent=s.description,this.descriptionClasses&&(0,a.classToClassList)(this.descriptionClasses,h),c.append(h)}}d&&d.querySelector("[data-icon]")&&!s&&!(null==s?void 0:s.icon)&&d.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&c.classList.add("selected"),i||c.addEventListener("click",(function(){return r.onSelectOption(e)})),this.optionClasses&&(0,a.classToClassList)(this.optionClasses,c),this.dropdown&&this.dropdown.append(c),n&&this.setNewValue()},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,i,n,s){var o=(0,a.htmlToElement)("");o.setAttribute("value",e),i&&o.setAttribute("disabled","disabled"),n&&o.setAttribute("selected","selected"),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.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),i=this.tagsInputHelper.offsetWidth+t+e,n=this.wrapper.offsetWidth-(parseInt(window.getComputedStyle(this.wrapper).paddingLeft)+parseInt(window.getComputedStyle(this.wrapper).paddingRight));this.tagsInput.style.width="".concat(Math.min(i,n)+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,a.dispatch)("change.hs.select",this.el,this.value),"tags"===this.mode){var i=this.selectedItems.filter((function(t){return!e.value.includes(t)}));i.length&&i.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(),this.triggerChangeEventForNativeSelect()},e.prototype.triggerChangeEventForNativeSelect=function(){var t=new Event("change",{bubbles:!0});this.el.dispatchEvent(t)},e.prototype.addSelectOption=function(t,e,i,n,s){this.selectOptions=l(l([],this.selectOptions,!0),[{title:t,val:e,disabled:i,selected:n,options:s}],!1)},e.prototype.removeSelectOption=function(t,e){if(void 0===e&&(e=!1),!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t})),console.log(e),this.value=e?this.value.filter((function(e){return e!==t})):t,console.log(this.value)},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():(console.log(),this.value.length?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder)},e.prototype.stringFromValue=function(){var t=this,e=[],i="";if(this.selectOptions.forEach((function(i){t.isMultiple?t.value.includes(i.val)&&e.push(i.title):t.value===i.val&&e.push(i.title)})),this.toggleCountText&&""!==this.toggleCountText&&e.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){var n=e.slice(0,this.toggleCountTextMinItems-1);i="".concat(n.join(this.toggleSeparators.items)," ").concat(this.toggleSeparators.betweenItemsAndCounter," ").concat(e.length-n.length," ").concat(this.toggleCountText)}else i="".concat(e.length," ").concat(this.toggleCountText);else i=e.join(this.toggleSeparators.items);return i},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0;var e=Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")}));e&&e.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,a.htmlToElement)(""),this.searchNoResult.innerText=this.searchNoResultText,(0,a.classToClassList)(this.searchNoResultClasses,this.searchNoResult);var e=this.dropdown.querySelectorAll("[data-value]"),i=!1;e.forEach((function(e){e.getAttribute("data-title-value").toLocaleLowerCase().includes(t.toLocaleLowerCase())?(e.classList.remove("hidden"),i=!0):e.classList.add("hidden")})),i||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,e=this,i=(null===(t=null===window||void 0===window?void 0:window.$hsSelectCollection)||void 0===t?void 0:t.find((function(t){return t.element.isOpened})))||null;if(i&&i.element.close(),this.animationInProcess)return!1;this.animationInProcess=!0,this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){var t;(null===(t=null==e?void 0:e.toggle)||void 0===t?void 0:t.ariaExpanded)&&(e.toggle.ariaExpanded="true"),e.wrapper.classList.add("active"),e.dropdown.classList.add("opened"),e.hasSearch&&!e.preventSearchFocus&&e.search.focus(),e.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,i,n,s=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(i=this.dropdownDirectionClasses)||void 0===i?void 0:i.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,a.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,i="".concat(this.selectOptions.length),n=function(t){var n=t.title,s=t.val,o=t.disabled,l=t.selected,r=t.options;!!e.selectOptions.some((function(t){return t.val===s}))||(e.addSelectOption(n,s,o,l,r),e.buildOption(n,s,o,l,r,i),e.buildOriginalOption(n,s,o,l,r),l&&!e.isMultiple&&e.onSelectOption(s))};Array.isArray(t)?t.forEach((function(t){n(t)})):n(t)},e.prototype.removeOption=function(t){var e=this,i=function(t,i){void 0===i&&(i=!1),!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t,i),e.destroyOption(t),e.destroyOriginalOption(t),e.value===t&&(e.value=null,e.eraseToggleTitle(),e.eraseToggleIcon()))};Array.isArray(t)?t.forEach((function(t){i(t,e.isMultiple)})):i(t,this.isMultiple),this.setNewValue()},e.prototype.recalculateDirection=function(){var t,e,i,n;(0,a.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===(i=this.dropdownDirectionClasses)||void 0===i?void 0:i.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.classList.add("bottom-full"),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.bottom)&&this.dropdown.classList.add(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="".concat(this.dropdownSpace,"px"))},e.getInstance=function(t,e){var i=window.$hsSelectCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));return i?e?i:i.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 i;return(null===(i=null==e?void 0:e.element)||void 0===i?void 0:i.el)===t}))){var i=t.getAttribute("data-hs-select"),n=i?JSON.parse(i):{};new e(t,n)}})),window.$hsSelectCollection&&(window.addEventListener("click",(function(t){var i=t.target;e.closeCurrentlyOpened(i)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.open=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.open()},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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Tab":t.preventDefault(),t.stopImmediatePropagation(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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 i=e.element.dropdown;if(!i)return!1;var n=(t?Array.from(i.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(i.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),s=i.querySelector(".hs-select-option-highlighted")||i.querySelector(".selected");s||n[0].classList.add("hs-select-option-highlighted");var o=n.findIndex((function(t){return t===s}));o+1 *:not(.hidden)")).reverse():Array.from(i.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),s=i.querySelector(".hs-select-option-highlighted")||i.querySelector(".selected");s||n[0].classList.add("hs-select-option-highlighted");var o=n.findIndex((function(t){return t===s}));if(!(o+1 *:not(.hidden)")):Array.from(i.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((function(t){return!t.classList.contains("disabled")})),s=i.querySelector(".hs-select-option-highlighted");n.length&&(n[0].focus(),s&&s.classList.remove("hs-select-option-highlighted"),n[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 i=window.$hsSelectCollection.find((function(t){return t.element.isOpened})),n=window.$hsSelectCollection.find((function(t){return t.element.el===e}));i.element.close(),n.element.open()}else{(n=window.$hsSelectCollection.find((function(t){return t.element.isOpened})))&&n.element.onSelectOption(t.target.dataset.value||"")}},e}(d.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},292:function(t,e){var i=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.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var i=n(t);"auto"!==i&&(i=parseInt(i,10))>e&&(e=i)})),e};e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,i){return void 0===i&&(i=""),(window.getComputedStyle(t).getPropertyValue(e)||i).replace(" ","")};e.getClassPropertyAlt=function(t,e,i){void 0===i&&(i="");var n="";return t.classList.forEach((function(t){t.includes(e)&&(n=t)})),n.match(/:(.*)]/)?n.match(/:(.*)]/)[1]:i};var n=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=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,i,n,s){void 0===i&&(i="auto"),void 0===n&&(n=10),void 0===s&&(s=null);var o=e.getBoundingClientRect(),l=s?s.getBoundingClientRect():null,r=window.innerHeight,a=l?o.top-l.top:o.top,d=(s?l.bottom:r)-o.bottom,c=t.clientHeight+n;return"bottom"===i?d>=c:"top"===i?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 n;return void 0===e&&(e=200),function(){for(var s=[],o=0;o0?t.addEventListener("transitionend",i,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,i,n){void 0===i&&(i=" "),void 0===n&&(n="add"),t.split(i).forEach((function(t){return"add"===n?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var i=function i(n){var s=e[n];if(void 0!==s)return s.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,i),o.exports}(442);return i})())); \ No newline at end of file +var i=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var i=n(t);"auto"!==i&&(i=parseInt(i,10))>e&&(e=i)})),e};e.stringToBoolean=function(t){return"true"===t};e.getClassProperty=function(t,e,i){return void 0===i&&(i=""),(window.getComputedStyle(t).getPropertyValue(e)||i).replace(" ","")};e.getClassPropertyAlt=function(t,e,i){void 0===i&&(i="");var n="";return t.classList.forEach((function(t){t.includes(e)&&(n=t)})),n.match(/:(.*)]/)?n.match(/:(.*)]/)[1]:i};var n=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=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.isDirectChild=function(t,e){for(var i=t.children,n=0;n=c:"top"===i?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 n;return void 0===e&&(e=200),function(){for(var o=[],s=0;s0?t.addEventListener("transitionend",i,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,i,n){void 0===i&&(i=" "),void 0===n&&(n="add"),t.split(i).forEach((function(t){return"add"===n?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};var i=function i(n){var o=e[n];if(void 0!==o)return o.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,i),s.exports}(442);return i})())); \ No newline at end of file diff --git a/dist/select.mjs b/dist/select.mjs new file mode 100644 index 0000000..ec8b838 --- /dev/null +++ b/dist/select.mjs @@ -0,0 +1 @@ +var t={189:(t,e,s)=>{s.d(e,{fp:()=>l,lP:()=>i});const i={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"},l=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Tab"]},615:(t,e,s)=>{s.d(e,{A:()=>i});class i{constructor(t,e,s){this.el=t,this.options=e,this.events=s,this.el=t,this.options=e,this.events={}}createCollection(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})}fireEvent(t,e=null){if(this.events.hasOwnProperty(t))return this.events[t](e)}on(t,e){this.events[t]=e}}},926:(t,e,s)=>{s.d(e,{JD:()=>o,PR:()=>i,en:()=>r,fc:()=>a,sg:()=>l,yd:()=>n});const i=(t,e,s="auto",i=10,l=null)=>{const o=e.getBoundingClientRect(),n=l?l.getBoundingClientRect():null,a=window.innerHeight,r=n?o.top-n.top:o.top,d=(l?n.bottom:a)-o.bottom,h=t.clientHeight+i;return"bottom"===s?d>=h:"top"===s?r>=h:r>=h||d>=h},l=(t,e=200)=>{let s;return(...i)=>{clearTimeout(s),s=setTimeout((()=>{t.apply(void 0,i)}),e)}},o=(t,e,s=null)=>{const i=new CustomEvent(t,{detail:{payload:s},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(i)},n=(t,e)=>{const s=()=>{e(),t.removeEventListener("transitionend",s,!0)},i=window.getComputedStyle(t),l=i.getPropertyValue("transition-duration");"none"!==i.getPropertyValue("transition-property")&&parseFloat(l)>0?t.addEventListener("transitionend",s,!0):e()},a=t=>{const e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild},r=(t,e,s=" ",i="add")=>{t.split(s).forEach((t=>"add"===i?e.classList.add(t):e.classList.remove(t)))}}},e={};function s(i){var l=e[i];if(void 0!==l)return l.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,s),o.exports}s.d=(t,e)=>{for(var i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var i={};s.d(i,{A:()=>d});var l=s(926),o=s(615),n=s(189),a=function(t,e,s,i){return new(s||(s=Promise))((function(l,o){function n(t){try{r(i.next(t))}catch(t){o(t)}}function a(t){try{r(i.throw(t))}catch(t){o(t)}}function r(t){var e;t.done?l(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(n,a)}r((i=i.apply(t,e||[])).next())}))};class r extends o.A{constructor(t,e){var s,i;super(t,e),this.optionId=0;const l=t.getAttribute("data-hs-select"),o=l?JSON.parse(l):{},n=Object.assign(Object.assign({},o),e),a={items:", ",betweenItemsAndCounter:"and"};this.value=(null==n?void 0:n.value)||this.el.value||null,this.placeholder=(null==n?void 0:n.placeholder)||"Select...",this.hasSearch=(null==n?void 0:n.hasSearch)||!1,this.preventSearchFocus=(null==n?void 0:n.preventSearchFocus)||!1,this.mode=(null==n?void 0:n.mode)||"default",this.viewport=void 0!==(null==n?void 0:n.viewport)?document.querySelector(null==n?void 0:n.viewport):null,this.isOpened=Boolean(null==n?void 0:n.isOpened)||!1,this.isMultiple=this.el.hasAttribute("multiple")||!1,this.isDisabled=this.el.hasAttribute("disabled")||!1,this.selectedItems=[],this.apiUrl=(null==n?void 0:n.apiUrl)||null,this.apiQuery=(null==n?void 0:n.apiQuery)||null,this.apiOptions=(null==n?void 0:n.apiOptions)||null,this.apiSearchQueryKey=(null==n?void 0:n.apiSearchQueryKey)||null,this.apiDataPart=(null==n?void 0:n.apiDataPart)||null,this.apiFieldsMap=(null==n?void 0:n.apiFieldsMap)||null,this.apiIconTag=(null==n?void 0:n.apiIconTag)||null,this.wrapperClasses=(null==n?void 0:n.wrapperClasses)||null,this.toggleTag=(null==n?void 0:n.toggleTag)||null,this.toggleClasses=(null==n?void 0:n.toggleClasses)||null,this.toggleSeparators=null!==(s=Object.assign(Object.assign({},a),null==n?void 0:n.toggleSeparators))&&void 0!==s?s:a,this.toggleCountText=(null==n?void 0:n.toggleCountText)||null,this.toggleCountTextMinItems=(null==n?void 0:n.toggleCountTextMinItems)||1,this.toggleCountTextMode=(null==n?void 0:n.toggleCountTextMode)||"countAfterLimit",this.tagsItemTemplate=(null==n?void 0:n.tagsItemTemplate)||null,this.tagsItemClasses=(null==n?void 0:n.tagsItemClasses)||null,this.tagsInputId=(null==n?void 0:n.tagsInputId)||null,this.tagsInputClasses=(null==n?void 0:n.tagsInputClasses)||null,this.dropdownTag=(null==n?void 0:n.dropdownTag)||null,this.dropdownClasses=(null==n?void 0:n.dropdownClasses)||null,this.dropdownDirectionClasses=(null==n?void 0:n.dropdownDirectionClasses)||null,this.dropdownSpace=(null==n?void 0:n.dropdownSpace)||10,this.dropdownPlacement=(null==n?void 0:n.dropdownPlacement)||null,this.dropdownScope=(null==n?void 0:n.dropdownScope)||"parent",this.searchTemplate=(null==n?void 0:n.searchTemplate)||null,this.searchWrapperTemplate=(null==n?void 0:n.searchWrapperTemplate)||null,this.searchWrapperClasses=(null==n?void 0:n.searchWrapperClasses)||"bg-white p-2 sticky top-0",this.searchId=(null==n?void 0:n.searchId)||null,this.searchLimit=(null==n?void 0:n.searchLimit)||1/0,this.isSearchDirectMatch=void 0===(null==n?void 0:n.isSearchDirectMatch)||(null==n?void 0:n.isSearchDirectMatch),this.searchClasses=(null==n?void 0:n.searchClasses)||"block w-[calc(100%-2rem)] text-sm border-gray-200 rounded-md focus:border-blue-500 focus:ring-blue-500 dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 py-2 px-3 my-2 mx-4",this.searchPlaceholder=(null==n?void 0:n.searchPlaceholder)||"Search...",this.searchNoResultTemplate=(null==n?void 0:n.searchNoResultTemplate)||"",this.searchNoResultText=(null==n?void 0:n.searchNoResultText)||"No results found",this.searchNoResultClasses=(null==n?void 0:n.searchNoResultClasses)||"px-4 text-sm text-gray-800 dark:text-neutral-200",this.optionTemplate=(null==n?void 0:n.optionTemplate)||null,this.optionTag=(null==n?void 0:n.optionTag)||null,this.optionClasses=(null==n?void 0:n.optionClasses)||null,this.extraMarkup=(null==n?void 0:n.extraMarkup)||null,this.descriptionClasses=(null==n?void 0:n.descriptionClasses)||null,this.iconClasses=(null==n?void 0:n.iconClasses)||null,this.isAddTagOnEnter=null===(i=null==n?void 0:n.isAddTagOnEnter)||void 0===i||i,this.animationInProcess=!1,this.selectOptions=[],this.remoteOptions=[],this.tagsInputHelper=null,this.init()}setValue(t){this.value=t,this.clearSelections(),Array.isArray(t)?(this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder,this.unselectMultipleItems(),this.selectMultipleItems()):(this.setToggleTitle(),this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.selectSingleItem())}init(){this.createCollection(window.$hsSelectCollection,this),this.build()}build(){if(this.el.style.display="none",this.el.children&&Array.from(this.el.children).filter((t=>t.value&&""!==t.value)).forEach((t=>{const e=t.getAttribute("data-hs-select-option");this.selectOptions=[...this.selectOptions,{title:t.textContent,val:t.value,disabled:t.disabled,options:"undefined"!==e?JSON.parse(e):null}]})),this.isMultiple){const t=Array.from(this.el.children).filter((t=>t.selected));if(t){const e=[];t.forEach((t=>{e.push(t.value)})),this.value=e}}this.buildWrapper(),"tags"===this.mode?this.buildTags():this.buildToggle(),this.buildDropdown(),this.extraMarkup&&this.buildExtraMarkup()}buildWrapper(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("hs-select","relative"),"tags"===this.mode&&this.wrapper.addEventListener("click",(t=>{t.target.closest("[data-hs-select-dropdown]")||t.target.closest("[data-tag-value]")||this.tagsInput.focus()})),this.wrapperClasses&&(0,l.en)(this.wrapperClasses,this.wrapper),this.el.before(this.wrapper),this.wrapper.append(this.el)}buildExtraMarkup(){const t=t=>{const e=(0,l.fc)(t);return this.wrapper.append(e),e},e=t=>{t.classList.contains("--prevent-click")||t.addEventListener("click",(t=>{t.stopPropagation(),this.toggleFn()}))};if(Array.isArray(this.extraMarkup))this.extraMarkup.forEach((s=>{const i=t(s);e(i)}));else{const s=t(this.extraMarkup);e(s)}}buildToggle(){var t,e;let s,i;this.toggleTextWrapper=document.createElement("span"),this.toggleTextWrapper.classList.add("truncate"),this.toggle=(0,l.fc)(this.toggleTag||"
"),s=this.toggle.querySelector("[data-icon]"),i=this.toggle.querySelector("[data-title]"),!this.isMultiple&&s&&this.setToggleIcon(),!this.isMultiple&&i&&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,i||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,l.en)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),(null===(e=this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.isOpened?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(()=>{if(this.isDisabled)return!1;this.toggleFn()}))}setToggleIcon(){var t;const e=this.getItemByValue(this.value),s=this.toggle.querySelector("[data-icon]");if(s.innerHTML="",s){const i=(0,l.fc)(this.apiUrl&&this.apiIconTag?this.apiIconTag||"":(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.icon)||"");this.value&&this.apiUrl&&this.apiIconTag&&e[this.apiFieldsMap.icon]&&(i.src=e[this.apiFieldsMap.icon]||""),s.append(i),i&&(null==i?void 0:i.src)?s.classList.remove("hidden"):s.classList.add("hidden")}}setToggleTitle(){var t;const e=this.toggle.querySelector("[data-title]");if(e.classList.add("truncate"),e.innerHTML="",e){const s=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder;e.innerHTML=s,this.toggle.append(e)}}buildTags(){this.isDisabled&&this.wrapper.classList.add("disabled"),this.buildTagsInput(),this.setTagsItems()}reassignTagsInputPlaceholder(t){this.tagsInput.placeholder=t,this.tagsInputHelper.innerHTML=t,this.calculateInputWidth()}buildTagsItem(t){var e,s,i,o;const n=this.getItemByValue(t);let a,r,d,h;const p=document.createElement("div");if(p.setAttribute("data-tag-value",t),this.tagsItemClasses&&(0,l.en)(this.tagsItemClasses,p),this.tagsItemTemplate&&(a=(0,l.fc)(this.tagsItemTemplate),p.append(a)),(null===(e=null==n?void 0:n.options)||void 0===e?void 0:e.icon)||this.apiIconTag){const t=(0,l.fc)(this.apiUrl&&this.apiIconTag?this.apiIconTag:null===(s=null==n?void 0:n.options)||void 0===s?void 0:s.icon);this.apiUrl&&this.apiIconTag&&n[this.apiFieldsMap.icon]&&(t.src=n[this.apiFieldsMap.icon]||""),h=a?a.querySelector("[data-icon]"):document.createElement("span"),h.append(t),a||p.append(h)}!a||!a.querySelector("[data-icon]")||(null===(i=null==n?void 0:n.options)||void 0===i?void 0:i.icon)||this.apiUrl||this.apiIconTag||n[null===(o=this.apiFieldsMap)||void 0===o?void 0:o.icon]||a.querySelector("[data-icon]").classList.add("hidden"),r=a?a.querySelector("[data-title]"):document.createElement("span"),r.textContent=n.title||"",a||p.append(r),a?d=a.querySelector("[data-remove]"):(d=document.createElement("span"),d.textContent="X",p.append(d)),d.addEventListener("click",(()=>{this.value=this.value.filter((e=>e!==t)),this.selectedItems=this.selectedItems.filter((e=>e!==t)),this.value.length||this.reassignTagsInputPlaceholder(this.placeholder),this.unselectMultipleItems(),this.selectMultipleItems(),p.remove()})),this.wrapper.append(p)}getItemByValue(t){return this.apiUrl?this.remoteOptions.find((e=>e[this.apiFieldsMap.title]===t)):this.selectOptions.find((e=>e.val===t))}setTagsItems(){this.value&&this.value.forEach((t=>{this.selectedItems.includes(t)||this.buildTagsItem(t),this.selectedItems=this.selectedItems.includes(t)?this.selectedItems:[...this.selectedItems,t]}))}buildTagsInput(){this.tagsInput=document.createElement("input"),this.tagsInputId&&(this.tagsInput.id=this.tagsInputId),this.tagsInputClasses&&(0,l.en)(this.tagsInputClasses,this.tagsInput),this.tagsInput.addEventListener("focus",(()=>{this.isOpened||this.open()})),this.tagsInput.addEventListener("input",(()=>this.calculateInputWidth())),this.tagsInput.addEventListener("input",(0,l.sg)((t=>this.searchOptions(t.target.value)))),this.tagsInput.addEventListener("keydown",(t=>{if("Enter"===t.key&&this.isAddTagOnEnter){const e=t.target.value;if(this.selectOptions.find((t=>t.val===e)))return!1;this.addSelectOption(e,e),this.buildOption(e,e),this.dropdown.querySelector(`[data-value="${e}"]`).click(),this.resetTagsInputField()}})),this.wrapper.append(this.tagsInput),setTimeout((()=>{this.adjustInputWidth(),this.reassignTagsInputPlaceholder(this.value.length?"":this.placeholder)}))}buildDropdown(){this.dropdown=(0,l.fc)(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),"parent"===this.dropdownScope&&this.dropdown.classList.add("absolute","top-full"),this.dropdown.role="listbox",this.dropdown.tabIndex=-1,this.dropdown.ariaOrientation="vertical",this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,l.en)(this.dropdownClasses,this.dropdown),this.wrapper&&this.wrapper.append(this.dropdown),this.dropdown&&this.hasSearch&&this.buildSearch(),this.selectOptions&&this.selectOptions.forEach(((t,e)=>this.buildOption(t.title,t.val,t.disabled,t.selected,t.options,`${e}`))),this.apiUrl&&this.optionsFromRemoteData(),"window"===this.dropdownScope&&this.buildPopper()}buildPopper(){"undefined"!=typeof Popper&&Popper.createPopper&&(document.body.appendChild(this.dropdown),this.popperInstance=Popper.createPopper("tags"===this.mode?this.wrapper:this.toggle,this.dropdown,{placement:n.lP[this.dropdownPlacement]||"bottom",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,5]}}]}))}updateDropdownWidth(){const t="tags"===this.mode?this.wrapper:this.toggle;this.dropdown.style.width=`${t.clientWidth}px`}buildSearch(){let t;this.searchWrapper=(0,l.fc)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,l.en)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]");const e=(0,l.fc)(this.searchTemplate||'');this.search="INPUT"===e.tagName?e:e.querySelector(":scope input"),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,l.en)(this.searchClasses,this.search),this.searchId&&(this.search.id=this.searchId),this.search.addEventListener("input",(0,l.sg)((t=>{this.apiUrl?this.remoteSearch(t.target.value):this.searchOptions(t.target.value)}))),t?t.append(e):this.searchWrapper.append(e),this.dropdown.append(this.searchWrapper)}buildOption(t,e,s=!1,i=!1,o,n="1",a){var r;let d=null,h=null,p=null,c=null;const u=(0,l.fc)(this.optionTag||"
");if(u.setAttribute("data-value",e),u.setAttribute("data-title-value",t),u.setAttribute("tabIndex",n),u.classList.add("cursor-pointer"),u.setAttribute("data-id",a||`${this.optionId}`),a||this.optionId++,s&&u.classList.add("disabled"),i&&(this.isMultiple?this.value=[...this.value,e]:this.value=e),this.optionTemplate&&(d=(0,l.fc)(this.optionTemplate),u.append(d)),d?(h=d.querySelector("[data-title]"),h.textContent=t||""):u.textContent=t||"",o){if(o.icon){const e=(0,l.fc)(null!==(r=this.apiIconTag)&&void 0!==r?r:o.icon);if(e.classList.add("max-w-full"),this.apiUrl&&(e.setAttribute("alt",t),e.setAttribute("src",o.icon)),d)p=d.querySelector("[data-icon]"),p.append(e);else{const t=(0,l.fc)("
");this.iconClasses&&(0,l.en)(this.iconClasses,t),t.append(e),u.append(t)}}if(o.description)if(d)c=d.querySelector("[data-description]"),c&&c.append(o.description);else{const t=(0,l.fc)("
");t.textContent=o.description,this.descriptionClasses&&(0,l.en)(this.descriptionClasses,t),u.append(t)}}d&&d.querySelector("[data-icon]")&&!o&&!(null==o?void 0:o.icon)&&d.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&u.classList.add("selected"),s||u.addEventListener("click",(()=>this.onSelectOption(e))),this.optionClasses&&(0,l.en)(this.optionClasses,u),this.dropdown&&this.dropdown.append(u),i&&this.setNewValue()}buildOptionFromRemoteData(t,e,s=!1,i=!1,l="1",o,n){l?this.buildOption(t,e,s,i,n,l,o):alert("ID parameter is required for generating remote options! Please check your API endpoint have it.")}buildOptionsFromRemoteData(t){t.forEach(((t,e)=>{let s=null,i="";const l={id:"",title:"",icon:null,description:null,rest:{}};Object.keys(t).forEach((e=>{var o;t[this.apiFieldsMap.id]&&(s=t[this.apiFieldsMap.id]),t[this.apiFieldsMap.title]&&(i=t[this.apiFieldsMap.title]),t[this.apiFieldsMap.icon]&&(l.icon=t[this.apiFieldsMap.icon]),t[null===(o=this.apiFieldsMap)||void 0===o?void 0:o.description]&&(l.description=t[this.apiFieldsMap.description]),l.rest[e]=t[e]})),this.buildOriginalOption(i,i,s,!1,!1,l),this.buildOptionFromRemoteData(i,i,!1,!1,`${e}`,s,l)})),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")}optionsFromRemoteData(){return a(this,arguments,void 0,(function*(t=""){const e=yield this.apiRequest(t);this.remoteOptions=e,e.length?this.buildOptionsFromRemoteData(this.remoteOptions):console.log("There is no data were responded!")}))}apiRequest(){return a(this,arguments,void 0,(function*(t=""){try{let e=this.apiUrl;const s=this.apiSearchQueryKey?`${this.apiSearchQueryKey}=${t.toLowerCase()}`:null,i=`${this.apiQuery}`,l=this.apiOptions||{};s&&(e+=`?${s}`),this.apiQuery&&(e+=`${s?"&":"?"}${i}`);const o=yield fetch(e,l),n=yield o.json();return this.apiDataPart?n[this.apiDataPart]:n}catch(t){console.error(t)}}))}sortElements(t,e){const s=Array.from(t.querySelectorAll(e));s.sort(((t,e)=>{const s=t.classList.contains("selected")||t.hasAttribute("selected"),i=e.classList.contains("selected")||e.hasAttribute("selected");return s&&!i?-1:!s&&i?1:0})),s.forEach((e=>t.appendChild(e)))}remoteSearch(t){return a(this,void 0,void 0,(function*(){const e=yield this.apiRequest(t);this.remoteOptions=e;let s=e.map((t=>`${t.id}`)),i=null;const l=this.dropdown.querySelectorAll("[data-value]");this.el.querySelectorAll("[data-hs-select-option]").forEach((t=>{var e;const i=t.getAttribute("data-id");s.includes(i)||(null===(e=this.value)||void 0===e?void 0:e.includes(t.value))||this.destroyOriginalOption(t.value)})),l.forEach((t=>{var e;const i=t.getAttribute("data-id");s.includes(i)||(null===(e=this.value)||void 0===e?void 0:e.includes(t.getAttribute("data-value")))?s=s.filter((t=>t!==i)):this.destroyOption(t.getAttribute("data-value"))})),i=e.filter((t=>s.includes(`${t.id}`))),i.length?this.buildOptionsFromRemoteData(i):console.log("There is no data were responded!")}))}destroyOption(t){const e=this.dropdown.querySelector(`[data-value="${t}"]`);if(!e)return!1;e.remove()}buildOriginalOption(t,e,s,i,o,n){const a=(0,l.fc)("");a.setAttribute("value",e),i&&a.setAttribute("disabled","disabled"),o&&a.setAttribute("selected","selected"),s&&a.setAttribute("data-id",s),a.setAttribute("data-hs-select-option",JSON.stringify(n)),a.innerText=t,this.el.append(a)}destroyOriginalOption(t){const e=this.el.querySelector(`[value="${t}"]`);if(!e)return!1;e.remove()}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)}calculateInputWidth(){this.tagsInputHelper.textContent=this.tagsInput.value||this.tagsInput.placeholder;const 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),s=this.tagsInputHelper.offsetWidth+t+e,i=this.wrapper.offsetWidth-(parseInt(window.getComputedStyle(this.wrapper).paddingLeft)+parseInt(window.getComputedStyle(this.wrapper).paddingRight));this.tagsInput.style.width=`${Math.min(s,i)+2}px`}adjustInputWidth(){this.buildTagsInputHelper(),this.calculateInputWidth()}onSelectOption(t){if(this.clearSelections(),this.isMultiple?(this.value=this.value.includes(t)?Array.from(this.value).filter((e=>e!==t)):[...Array.from(this.value),t],this.selectMultipleItems(),this.setNewValue()):(this.value=t,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),(0,l.JD)("change.hs.select",this.el,this.value),"tags"===this.mode){const t=this.selectedItems.filter((t=>!this.value.includes(t)));t.length&&t.forEach((t=>{this.selectedItems=this.selectedItems.filter((e=>e!==t)),this.wrapper.querySelector(`[data-tag-value="${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(),this.triggerChangeEventForNativeSelect()}triggerChangeEventForNativeSelect(){const t=new Event("change",{bubbles:!0});this.el.dispatchEvent(t)}addSelectOption(t,e,s,i,l){this.selectOptions=[...this.selectOptions,{title:t,val:e,disabled:s,selected:i,options:l}]}removeSelectOption(t,e=!1){if(!!!this.selectOptions.some((e=>e.val===t)))return!1;this.selectOptions=this.selectOptions.filter((e=>e.val!==t)),this.value=e?this.value.filter((e=>e!==t)):t}resetTagsInputField(){this.tagsInput.value="",this.reassignTagsInputPlaceholder(""),this.searchOptions("")}clearSelections(){Array.from(this.dropdown.children).forEach((t=>{t.classList.contains("selected")&&t.classList.remove("selected")})),Array.from(this.el.children).forEach((t=>{t.selected&&(t.selected=!1)}))}setNewValue(){var t;"tags"===this.mode?this.setTagsItems():(null===(t=this.value)||void 0===t?void 0:t.length)?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder}stringFromValueBasic(t){const e=[];let s="";if(t.forEach((t=>{this.isMultiple?this.value.includes(t.val)&&e.push(t.title):this.value===t.val&&e.push(t.title)})),this.toggleCountText&&""!==this.toggleCountText&&e.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){const t=e.slice(0,this.toggleCountTextMinItems-1);s=`${t.join(this.toggleSeparators.items)} ${this.toggleSeparators.betweenItemsAndCounter} ${e.length-t.length} ${this.toggleCountText}`}else s=`${e.length} ${this.toggleCountText}`;else s=e.join(this.toggleSeparators.items);return s}stringFromValueRemoteData(){const t=this.dropdown.querySelectorAll("[data-title-value]"),e=[];let s="";if(t.forEach((t=>{const s=t.getAttribute("data-value");this.isMultiple?this.value.includes(s)&&e.push(s):this.value===s&&e.push(s)})),this.toggleCountText&&""!==this.toggleCountText&&e.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){const t=e.slice(0,this.toggleCountTextMinItems-1);s=`${t.join(this.toggleSeparators.items)} ${this.toggleSeparators.betweenItemsAndCounter} ${e.length-t.length} ${this.toggleCountText}`}else s=`${e.length} ${this.toggleCountText}`;else s=e.join(this.toggleSeparators.items);return s}stringFromValue(){return this.apiUrl?this.stringFromValueRemoteData():this.stringFromValueBasic(this.selectOptions)}selectSingleItem(){Array.from(this.el.children).find((t=>this.value===t.value)).selected=!0;const t=Array.from(this.dropdown.children).find((t=>this.value===t.getAttribute("data-value")));t&&t.classList.add("selected")}selectMultipleItems(){Array.from(this.dropdown.children).filter((t=>this.value.includes(t.getAttribute("data-value")))).forEach((t=>t.classList.add("selected"))),Array.from(this.el.children).filter((t=>this.value.includes(t.value))).forEach((t=>t.selected=!0))}unselectMultipleItems(){Array.from(this.dropdown.children).forEach((t=>t.classList.remove("selected"))),Array.from(this.el.children).forEach((t=>t.selected=!1))}searchOptions(t){this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,l.fc)(this.searchNoResultTemplate),this.searchNoResult.innerText=this.searchNoResultText,(0,l.en)(this.searchNoResultClasses,this.searchNoResult);const e=this.dropdown.querySelectorAll("[data-value]");let s,i=!1;this.searchLimit&&(s=0),e.forEach((e=>{const l=e.getAttribute("data-title-value").toLocaleLowerCase(),o=t?t.split("").map((t=>t.match(/\w/)?`${t}[\\W_]*`:"\\W*")).join(""):"",n=new RegExp(o,"i"),a=this.isSearchDirectMatch,r=l.trim();(t?a?!r.toLowerCase().includes(t.toLowerCase())||s>=this.searchLimit:!n.test(r)||s>=this.searchLimit:!n.test(r))?e.classList.add("hidden"):(e.classList.remove("hidden"),i=!0,this.searchLimit&&s++)})),i||this.dropdown.append(this.searchNoResult)}eraseToggleIcon(){const t=this.toggle.querySelector("[data-icon]");t&&(t.innerHTML=null,t.classList.add("hidden"))}eraseToggleTitle(){const t=this.toggle.querySelector("[data-title]");t?t.innerHTML=this.placeholder:this.toggleTextWrapper.innerHTML=this.placeholder}toggleFn(){this.isOpened?this.close():this.open()}destroy(){const 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}open(){var t;const e=(null===(t=null===window||void 0===window?void 0:window.$hsSelectCollection)||void 0===t?void 0:t.find((t=>t.element.isOpened)))||null;if(e&&e.element.close(),this.animationInProcess)return!1;this.animationInProcess=!0,"window"===this.dropdownScope&&this.dropdown.classList.add("invisible"),this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((()=>{var t;(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.wrapper.classList.add("active"),this.dropdown.classList.add("opened"),this.dropdown.classList.contains("w-full")&&"window"===this.dropdownScope&&this.updateDropdownWidth(),this.popperInstance&&"window"===this.dropdownScope&&(this.popperInstance.update(),this.dropdown.classList.remove("invisible")),this.hasSearch&&!this.preventSearchFocus&&this.search.focus(),this.animationInProcess=!1})),this.isOpened=!0}close(){var t,e,s,i;if(this.animationInProcess)return!1;this.animationInProcess=!0,(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(s=this.dropdownDirectionClasses)||void 0===s?void 0:s.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,l.yd)(this.dropdown,(()=>{this.dropdown.classList.add("hidden"),this.hasSearch&&(this.search.value="",this.search.dispatchEvent(new Event("input",{bubbles:!0})),this.search.blur()),this.animationInProcess=!1})),null===(i=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===i||i.classList.remove("hs-select-option-highlighted"),this.isOpened=!1}addOption(t){let e=`${this.selectOptions.length}`;const s=t=>{const{title:s,val:i,disabled:l,selected:o,options:n}=t;!!this.selectOptions.some((t=>t.val===i))||(this.addSelectOption(s,i,l,o,n),this.buildOption(s,i,l,o,n,e),this.buildOriginalOption(s,i,null,l,o,n),o&&!this.isMultiple&&this.onSelectOption(i))};Array.isArray(t)?t.forEach((t=>{s(t)})):s(t)}removeOption(t){const e=(t,e=!1)=>{!!this.selectOptions.some((e=>e.val===t))&&(this.removeSelectOption(t,e),this.destroyOption(t),this.destroyOriginalOption(t),this.value===t&&(this.value=null,this.eraseToggleTitle(),this.eraseToggleIcon()))};Array.isArray(t)?t.forEach((t=>{e(t,this.isMultiple)})):e(t,this.isMultiple),this.setNewValue()}recalculateDirection(){var t,e,s,i;(0,l.PR)(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=`${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===(i=this.dropdownDirectionClasses)||void 0===i?void 0:i.bottom)&&this.dropdown.classList.add(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom=`${this.dropdownSpace}px`)}static getInstance(t,e){const s=window.$hsSelectCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return s?e?s:s.element:null}static autoInit(){window.$hsSelectCollection||(window.$hsSelectCollection=[]),document.querySelectorAll("[data-hs-select]:not(.--prevent-on-load-init)").forEach((t=>{if(!window.$hsSelectCollection.find((e=>{var s;return(null===(s=null==e?void 0:e.element)||void 0===s?void 0:s.el)===t}))){const e=t.getAttribute("data-hs-select"),s=e?JSON.parse(e):{};new r(t,s)}})),window.$hsSelectCollection&&(window.addEventListener("click",(t=>{const e=t.target;r.closeCurrentlyOpened(e)})),document.addEventListener("keydown",(t=>r.accessibility(t))))}static open(t){const e=window.$hsSelectCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));e&&!e.element.isOpened&&e.element.open()}static close(t){const e=window.$hsSelectCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));e&&e.element.isOpened&&e.element.close()}static closeCurrentlyOpened(t=null){if(!t.closest(".hs-select.active")&&!t.closest("[data-hs-select-dropdown].opened")){const t=window.$hsSelectCollection.filter((t=>t.element.isOpened))||null;t&&t.forEach((t=>{t.element.close()}))}}static accessibility(t){if(window.$hsSelectCollection.find((t=>t.element.isOpened))&&n.fp.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Tab":t.preventDefault(),t.stopImmediatePropagation(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd(!1);break;case"Enter":t.preventDefault(),this.onEnter(t)}}static onEscape(){const t=window.$hsSelectCollection.find((t=>t.element.isOpened));t&&t.element.close()}static onArrow(t=!0){const e=window.$hsSelectCollection.find((t=>t.element.isOpened));if(e){const s=e.element.dropdown;if(!s)return!1;const i=(t?Array.from(s.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(s.querySelectorAll(":scope > *:not(.hidden)"))).filter((t=>!t.classList.contains("disabled"))),l=s.querySelector(".hs-select-option-highlighted")||s.querySelector(".selected");l||i[0].classList.add("hs-select-option-highlighted");let o=i.findIndex((t=>t===l));o+1t.element.isOpened));if(e){const s=e.element.dropdown;if(!s)return!1;const i=(t?Array.from(s.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(s.querySelectorAll(":scope > *:not(.hidden)"))).filter((t=>!t.classList.contains("disabled"))),l=s.querySelector(".hs-select-option-highlighted")||s.querySelector(".selected");l||i[0].classList.add("hs-select-option-highlighted");let o=i.findIndex((t=>t===l));if(!(o+1t.element.isOpened));if(e){const s=e.element.dropdown;if(!s)return!1;const i=(t?Array.from(s.querySelectorAll(":scope > *:not(.hidden)")):Array.from(s.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((t=>!t.classList.contains("disabled"))),l=s.querySelector(".hs-select-option-highlighted");i.length&&(i[0].focus(),l&&l.classList.remove("hs-select-option-highlighted"),i[0].classList.add("hs-select-option-highlighted"))}}static onEnter(t){const e=t.target.previousSibling;if(window.$hsSelectCollection.find((t=>t.element.el===e))){const t=window.$hsSelectCollection.find((t=>t.element.isOpened)),s=window.$hsSelectCollection.find((t=>t.element.el===e));t.element.close(),s.element.open()}else{const e=window.$hsSelectCollection.find((t=>t.element.isOpened));e&&e.element.onSelectOption(t.target.dataset.value||"")}}}window.addEventListener("load",(()=>{r.autoInit()})),document.addEventListener("scroll",(()=>{if(!window.$hsSelectCollection)return!1;const t=window.$hsSelectCollection.find((t=>t.element.isOpened));t&&t.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSSelect=r);const d=r;var h=i.A;export{h as default}; \ No newline at end of file diff --git a/dist/stepper.js b/dist/stepper.js index 519ed07..a54332b 100644 --- a/dist/stepper.js +++ b/dist/stepper.js @@ -1,17 +1,16 @@ -!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={961:(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 i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(self,(()=>(()=>{"use strict";var t={961:(t,e)=>{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},887:function(t,e,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSStepper + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},887:function(t,e,n){ +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,l.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,l.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,l.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,l.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,l.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,l.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,l.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,l.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}(r(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=a),e.default=a},292:function(t,e){ /* - * HSStepper - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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,l.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,l.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,l.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,l.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,l.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,l.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,l.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,l.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}(r(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=a),e.default=a},292: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.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=i(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var i=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=i;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 s=function(t){return!!t&&("none"===window.getComputedStyle(t).display||s(t.parentElement))};e.isParentOrElementHidden=s;e.debounce=function(t,e){var i;return void 0===e&&(e=200),function(){for(var s=[],o=0;o0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,i){void 0===n&&(n=" "),void 0===i&&(i="add"),t.split(n).forEach((function(t){return"add"===i?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(887);return n})())); \ No newline at end of file +var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=i(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var i=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=i;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.isDirectChild=function(t,e){for(var n=t.children,i=0;i=c:"top"===n?a>=c:a>=c||p>=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 i;return void 0===e&&(e=200),function(){for(var s=[],o=0;o0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,i){void 0===n&&(n=" "),void 0===i&&(i="add"),t.split(n).forEach((function(t){return"add"===i?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(887);return n})())); \ No newline at end of file diff --git a/dist/stepper.mjs b/dist/stepper.mjs new file mode 100644 index 0000000..f254e93 --- /dev/null +++ b/dist/stepper.mjs @@ -0,0 +1,9 @@ +var t={615:(t,e,s)=>{s.d(e,{A:()=>i});class i{constructor(t,e,s){this.el=t,this.options=e,this.events=s,this.el=t,this.options=e,this.events={}}createCollection(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})}fireEvent(t,e=null){if(this.events.hasOwnProperty(t))return this.events[t](e)}on(t,e){this.events[t]=e}}},926:(t,e,s)=>{s.d(e,{JD:()=>i});const i=(t,e,s=null)=>{const i=new CustomEvent(t,{detail:{payload:s},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(i)}}},e={};function s(i){var n=e[i];if(void 0!==n)return n.exports;var l=e[i]={exports:{}};return t[i](l,l.exports,s),l.exports}s.d=(t,e)=>{for(var i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var i={};s.d(i,{A:()=>h});var n=s(926),l=s(615); +/* + * HSStepper + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class o extends l.A{constructor(t,e){super(t,e);const s=t.getAttribute("data-hs-stepper"),i=s?JSON.parse(s):{},n=Object.assign(Object.assign({},i),e);this.currentIndex=(null==n?void 0:n.currentIndex)||1,this.mode=(null==n?void 0:n.mode)||"linear",this.isCompleted=void 0!==(null==n?void 0:n.isCompleted)&&(null==n?void 0:n.isCompleted),this.totalSteps=1,this.navItems=[],this.contentItems=[],this.init()}init(){this.createCollection(window.$hsStepperCollection,this),this.buildNav(),this.buildContent(),this.buildButtons(),this.setTotalSteps()}getUncompletedSteps(t=!1){return this.navItems.filter((({isCompleted:e,isSkip:s})=>t?!e||s:!e&&!s))}setTotalSteps(){this.navItems.forEach((t=>{const{index:e}=t;e>this.totalSteps&&(this.totalSteps=e)}))}buildNav(){this.el.querySelectorAll("[data-hs-stepper-nav-item]").forEach((t=>this.addNavItem(t))),this.navItems.forEach((t=>this.buildNavItem(t)))}buildNavItem(t){const{index:e,isDisabled:s,el:i}=t;e===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||s)&&i.addEventListener("click",(()=>this.handleNavItemClick(t)))}addNavItem(t){const{index:e,isFinal:s=!1,isCompleted:i=!1,isSkip:n=!1,isOptional:l=!1,isDisabled:o=!1,isProcessed:h=!1,hasError:r=!1}=JSON.parse(t.getAttribute("data-hs-stepper-nav-item"));i&&t.classList.add("success"),n&&t.classList.add("skipped"),o&&("BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")),r&&t.classList.add("error"),this.navItems.push({index:e,isFinal:s,isCompleted:i,isSkip:n,isOptional:l,isDisabled:o,isProcessed:h,hasError:r,el:t})}setCurrentNavItem(){this.navItems.forEach((t=>{const{index:e,el:s}=t;e===this.currentIndex?this.setCurrentNavItemActions(s):this.unsetCurrentNavItemActions(s)}))}setCurrentNavItemActions(t){t.classList.add("active"),this.fireEvent("active",this.currentIndex),(0,n.JD)("active.hs.stepper",this.el,this.currentIndex)}getNavItem(t=this.currentIndex){return this.navItems.find((({index:e})=>e===t))}setProcessedNavItemActions(t){t.isProcessed=!0,t.el.classList.add("processed")}setErrorNavItemActions(t){t.hasError=!0,t.el.classList.add("error")}unsetCurrentNavItemActions(t){t.classList.remove("active")}handleNavItemClick(t){const{index:e}=t;this.currentIndex=e,this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep()}buildContent(){this.el.querySelectorAll("[data-hs-stepper-content-item]").forEach((t=>this.addContentItem(t))),this.navItems.forEach((t=>this.buildContentItem(t)))}buildContentItem(t){const{index:e}=t;e===this.currentIndex&&this.setCurrentContentItem()}addContentItem(t){const{index:e,isFinal:s=!1,isCompleted:i=!1,isSkip:n=!1}=JSON.parse(t.getAttribute("data-hs-stepper-content-item"));i&&t.classList.add("success"),n&&t.classList.add("skipped"),this.contentItems.push({index:e,isFinal:s,isCompleted:i,isSkip:n,el:t})}setCurrentContentItem(){if(this.isCompleted){const t=this.contentItems.find((({isFinal:t})=>t)),e=this.contentItems.filter((({isFinal:t})=>!t));return t.el.style.display="",e.forEach((({el:t})=>t.style.display="none")),!1}this.contentItems.forEach((t=>{const{index:e,el:s}=t;e===this.currentIndex?this.setCurrentContentItemActions(s):this.unsetCurrentContentItemActions(s)}))}hideAllContentItems(){this.contentItems.forEach((({el:t})=>t.style.display="none"))}setCurrentContentItemActions(t){t.style.display=""}unsetCurrentContentItemActions(t){t.style.display="none"}disableAll(){const t=this.getNavItem(this.currentIndex);t.hasError=!1,t.isCompleted=!1,t.isDisabled=!1,t.el.classList.remove("error","success"),this.disableButtons()}disableNavItemActions(t){t.isDisabled=!0,t.el.classList.add("disabled")}enableNavItemActions(t){t.isDisabled=!1,t.el.classList.remove("disabled")}buildButtons(){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()}buildBackButton(){this.backBtn&&(this.checkForTheFirstStep(),this.backBtn.addEventListener("click",(()=>{if(this.handleBackButtonClick(),"linear"===this.mode){const t=this.navItems.find((({index:t})=>t===this.currentIndex)),e=this.contentItems.find((({index:t})=>t===this.currentIndex));if(!t||!e)return;t.isCompleted&&(t.isCompleted=!1,t.isSkip=!1,t.el.classList.remove("success","skipped")),e.isCompleted&&(e.isCompleted=!1,e.isSkip=!1,e.el.classList.remove("success","skipped")),"linear"===this.mode&&this.currentIndex!==this.totalSteps&&(this.nextBtn&&(this.nextBtn.style.display=""),this.completeStepBtn&&(this.completeStepBtn.style.display="")),this.showSkipButton(),this.showFinishButton(),this.showCompleteStepButton()}})))}handleBackButtonClick(){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,n.JD)("back.hs.stepper",this.el,this.currentIndex))}checkForTheFirstStep(){1===this.currentIndex?this.setToDisabled(this.backBtn):this.setToNonDisabled(this.backBtn)}setToDisabled(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")}setToNonDisabled(t){"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled"),t.classList.remove("disabled")}buildNextButton(){this.nextBtn&&this.nextBtn.addEventListener("click",(()=>{var t;if(this.fireEvent("beforeNext",this.currentIndex),(0,n.JD)("beforeNext.hs.stepper",this.el,this.currentIndex),null===(t=this.getNavItem(this.currentIndex))||void 0===t?void 0:t.isProcessed)return this.disableAll(),!1;this.goToNext()}))}unsetProcessedNavItemActions(t){t.isProcessed=!1,t.el.classList.remove("processed")}handleNextButtonClick(t=!0){if(t)this.currentIndex===this.totalSteps?this.currentIndex=1:this.currentIndex++;else{const t=this.getUncompletedSteps();if(1===t.length){const{index:e}=t[0];this.currentIndex=e}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,n.JD)("next.hs.stepper",this.el,this.currentIndex)}removeOptionalClasses(){const t=this.navItems.find((({index:t})=>t===this.currentIndex)),e=this.contentItems.find((({index:t})=>t===this.currentIndex));t.isSkip=!1,t.hasError=!1,t.isDisabled=!1,e.isSkip=!1,t.el.classList.remove("skipped","success","error"),e.el.classList.remove("skipped","success","error")}buildSkipButton(){this.skipBtn&&(this.showSkipButton(),this.skipBtn.addEventListener("click",(()=>{this.handleSkipButtonClick(),"linear"===this.mode&&this.currentIndex===this.totalSteps&&(this.nextBtn&&(this.nextBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"),this.finishBtn&&(this.finishBtn.style.display=""))})))}setSkipItem(t){const e=this.navItems.find((({index:e})=>e===(t||this.currentIndex))),s=this.contentItems.find((({index:e})=>e===(t||this.currentIndex)));e&&s&&(this.setSkipItemActions(e),this.setSkipItemActions(s))}setSkipItemActions(t){t.isSkip=!0,t.el.classList.add("skipped")}showSkipButton(){if(!this.skipBtn)return;const{isOptional:t}=this.navItems.find((({index:t})=>t===this.currentIndex));this.skipBtn.style.display=t?"":"none"}handleSkipButtonClick(){this.setSkipItem(),this.handleNextButtonClick(),this.fireEvent("skip",this.currentIndex),(0,n.JD)("skip.hs.stepper",this.el,this.currentIndex)}buildCompleteStepButton(){this.completeStepBtn&&(this.completeStepBtnDefaultText=this.completeStepBtn.innerText,this.completeStepBtn.addEventListener("click",(()=>this.handleCompleteStepButtonClick())))}changeTextAndDisableCompleteButtonIfStepCompleted(){const t=this.navItems.find((({index:t})=>t===this.currentIndex)),{completedText:e}=JSON.parse(this.completeStepBtn.getAttribute("data-hs-stepper-complete-step-btn"));t&&(t.isCompleted?(this.completeStepBtn.innerText=e||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")))}setCompleteItem(t){const e=this.navItems.find((({index:e})=>e===(t||this.currentIndex))),s=this.contentItems.find((({index:e})=>e===(t||this.currentIndex)));e&&s&&(this.setCompleteItemActions(e),this.setCompleteItemActions(s))}setCompleteItemActions(t){t.isCompleted=!0,t.el.classList.add("success")}showCompleteStepButton(){if(!this.completeStepBtn)return;1===this.getUncompletedSteps().length?this.completeStepBtn.style.display="none":this.completeStepBtn.style.display=""}handleCompleteStepButtonClick(){this.setCompleteItem(),this.fireEvent("complete",this.currentIndex),(0,n.JD)("complete.hs.stepper",this.el,this.currentIndex),this.handleNextButtonClick(!1),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton()}buildFinishButton(){this.finishBtn&&(this.isCompleted&&this.setCompleted(),this.finishBtn.addEventListener("click",(()=>this.handleFinishButtonClick())))}setCompleted(){this.el.classList.add("completed")}unsetCompleted(){this.el.classList.remove("completed")}showFinishButton(){if(!this.finishBtn)return;1===this.getUncompletedSteps().length?this.finishBtn.style.display="":this.finishBtn.style.display="none"}handleFinishButtonClick(){const t=this.getUncompletedSteps(),e=this.getUncompletedSteps(!0),{el:s}=this.contentItems.find((({isFinal:t})=>t));t.length&&t.forEach((({index:t})=>this.setCompleteItem(t))),this.currentIndex=this.totalSteps,this.setCurrentNavItem(),this.hideAllContentItems();const i=this.navItems.find((({index:t})=>t===this.currentIndex));(i?i.el:null).classList.remove("active"),s.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=""),e.length<=1&&(this.isCompleted=!0,this.setCompleted()),this.fireEvent("finish",this.currentIndex),(0,n.JD)("finish.hs.stepper",this.el,this.currentIndex)}buildResetButton(){this.resetBtn&&this.resetBtn.addEventListener("click",(()=>this.handleResetButtonClick()))}handleResetButtonClick(){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((t=>{const{el:e}=t;t.isSkip=!1,t.isCompleted=!1,this.unsetCurrentNavItemActions(e),e.classList.remove("success","skipped")})),this.contentItems.forEach((t=>{const{el:e}=t;t.isSkip=!1,t.isCompleted=!1,this.unsetCurrentContentItemActions(e),e.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,n.JD)("reset.hs.stepper",this.el,this.currentIndex)}setProcessedNavItem(t){const e=this.getNavItem(t);e&&this.setProcessedNavItemActions(e)}unsetProcessedNavItem(t){const e=this.getNavItem(t);e&&this.unsetProcessedNavItemActions(e)}goToNext(){"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"))}disableButtons(){this.backBtn&&this.setToDisabled(this.backBtn),this.nextBtn&&this.setToDisabled(this.nextBtn)}enableButtons(){this.backBtn&&this.setToNonDisabled(this.backBtn),this.nextBtn&&this.setToNonDisabled(this.nextBtn)}setErrorNavItem(t){const e=this.getNavItem(t);e&&this.setErrorNavItemActions(e)}static getInstance(t,e){const s=window.$hsStepperCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return s?e?s:s.element:null}static autoInit(){window.$hsStepperCollection||(window.$hsStepperCollection=[]),document.querySelectorAll("[data-hs-stepper]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsStepperCollection.find((e=>{var s;return(null===(s=null==e?void 0:e.element)||void 0===s?void 0:s.el)===t}))||new o(t)}))}}window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=o);const h=o;var r=i.A;export{r as default}; \ No newline at end of file diff --git a/dist/strong-password.js b/dist/strong-password.js index 90204c8..f7b22b8 100644 --- a/dist/strong-password.js +++ b/dist/strong-password.js @@ -1,17 +1,16 @@ -!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={961:(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={961:(t,e)=>{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},97:function(t,e,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSStrongPassword + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},97:function(t,e,n){ +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,a.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,a.dispatch)("change.hs.strongPassword",this.el,s)},e.prototype.hideStrips=function(t){Array.from(this.el.children).forEach((function(e,n){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,a.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,a.dispatch)("change.hs.strongPassword",this.el,s)},e.prototype.hideStrips=function(t){Array.from(this.el.children).forEach((function(e,n){ne&&(e=n)})),e};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};var s=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=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,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 i=function(t){return!!t&&("none"===window.getComputedStyle(t).display||i(t.parentElement))};e.isParentOrElementHidden=i;e.debounce=function(t,e){var s;return void 0===e&&(e=200),function(){for(var i=[],o=0;o0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,s){void 0===n&&(n=" "),void 0===s&&(s="add"),t.split(n).forEach((function(t){return"add"===s?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(97);return n})())); \ No newline at end of file +var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=s(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var s=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=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.isDirectChild=function(t,e){for(var n=t.children,s=0;s=u:"top"===n?l>=u:l>=u||c>=u};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 s;return void 0===e&&(e=200),function(){for(var i=[],o=0;o0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,s){void 0===n&&(n=" "),void 0===s&&(s="add"),t.split(n).forEach((function(t){return"add"===s?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(97);return n})())); \ No newline at end of file diff --git a/dist/strong-password.mjs b/dist/strong-password.mjs new file mode 100644 index 0000000..4f7dbb9 --- /dev/null +++ b/dist/strong-password.mjs @@ -0,0 +1,9 @@ +var t={615:(t,e,s)=>{s.d(e,{A:()=>i});class i{constructor(t,e,s){this.el=t,this.options=e,this.events=s,this.el=t,this.options=e,this.events={}}createCollection(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})}fireEvent(t,e=null){if(this.events.hasOwnProperty(t))return this.events[t](e)}on(t,e){this.events[t]=e}}},926:(t,e,s)=>{s.d(e,{JD:()=>n,PR:()=>i,en:()=>l,fc:()=>a});const i=(t,e,s="auto",i=10,n=null)=>{const a=e.getBoundingClientRect(),l=n?n.getBoundingClientRect():null,r=window.innerHeight,o=l?a.top-l.top:a.top,h=(n?l.bottom:r)-a.bottom,c=t.clientHeight+i;return"bottom"===s?h>=c:"top"===s?o>=c:o>=c||h>=c},n=(t,e,s=null)=>{const i=new CustomEvent(t,{detail:{payload:s},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(i)},a=t=>{const e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild},l=(t,e,s=" ",i="add")=>{t.split(s).forEach((t=>"add"===i?e.classList.add(t):e.classList.remove(t)))}}},e={};function s(i){var n=e[i];if(void 0!==n)return n.exports;var a=e[i]={exports:{}};return t[i](a,a.exports,s),a.exports}s.d=(t,e)=>{for(var i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var i={};s.d(i,{A:()=>r});var n=s(926),a=s(615); +/* + * HSStrongPassword + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class l extends a.A{constructor(t,e){super(t,e),this.isOpened=!1,this.strength=0,this.passedRules=new Set;const s=t.getAttribute("data-hs-strong-password"),i=s?JSON.parse(s):{},n=Object.assign(Object.assign({},i),e);this.target=(null==n?void 0:n.target)?"string"==typeof(null==n?void 0:n.target)?document.querySelector(n.target):n.target:null,this.hints=(null==n?void 0:n.hints)?"string"==typeof(null==n?void 0:n.hints)?document.querySelector(n.hints):n.hints:null,this.stripClasses=(null==n?void 0:n.stripClasses)||null,this.minLength=(null==n?void 0:n.minLength)||6,this.mode=(null==n?void 0:n.mode)||"default",this.popoverSpace=(null==n?void 0:n.popoverSpace)||10,this.checksExclude=(null==n?void 0:n.checksExclude)||[],this.availableChecks=["lowercase","uppercase","numbers","special-characters","min-length"].filter((t=>!this.checksExclude.includes(t))),this.specialCharactersSet=(null==n?void 0:n.specialCharactersSet)||"!\"#$%&'()*+,-./:;<=>?@[\\\\\\]^_`{|}~",this.target&&this.init()}init(){this.createCollection(window.$hsStrongPasswordCollection,this),this.availableChecks.length&&this.build()}build(){this.buildStrips(),this.hints&&this.buildHints(),this.setStrength(this.target.value),this.target.addEventListener("input",(t=>{this.setStrength(t.target.value)}))}buildStrips(){if(this.el.innerHTML="",this.stripClasses)for(let t=0;t");(0,n.en)(this.stripClasses,t),this.el.append(t)}}buildHints(){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((t=>{var e;const s=t.getAttribute("data-hs-strong-password-hints-rule-text");(null===(e=this.checksExclude)||void 0===e?void 0:e.includes(s))&&t.remove()})),this.weakness&&this.buildWeakness(),this.rules&&this.buildRules(),"popover"===this.mode&&(this.target.addEventListener("focus",(()=>{this.isOpened=!0,this.hints.classList.remove("hidden"),this.hints.classList.add("block"),this.recalculateDirection()})),this.target.addEventListener("blur",(()=>{this.isOpened=!1,this.hints.classList.remove("block","bottom-full","top-full"),this.hints.classList.add("hidden"),this.hints.style.marginTop="",this.hints.style.marginBottom=""})))}buildWeakness(){this.checkStrength(this.target.value),this.setWeaknessText(),this.target.addEventListener("input",(()=>setTimeout((()=>this.setWeaknessText()))))}buildRules(){this.setRulesText(),this.target.addEventListener("input",(()=>setTimeout((()=>this.setRulesText()))))}setWeaknessText(){const t=this.weakness.getAttribute("data-hs-strong-password-hints-weakness-text"),e=JSON.parse(t);this.weakness.textContent=e[this.strength]}setRulesText(){this.rules.forEach((t=>{const e=t.getAttribute("data-hs-strong-password-hints-rule-text");this.checkIfPassed(t,this.passedRules.has(e))}))}togglePopover(){const t=this.el.querySelector(".popover");t&&t.classList.toggle("show")}checkStrength(t){const e=new Set,s={lowercase:/[a-z]+/,uppercase:/[A-Z]+/,numbers:/[0-9]+/,"special-characters":new RegExp(`[${this.specialCharactersSet}]`)};let i=0;return this.availableChecks.includes("lowercase")&&t.match(s.lowercase)&&(i+=1,e.add("lowercase")),this.availableChecks.includes("uppercase")&&t.match(s.uppercase)&&(i+=1,e.add("uppercase")),this.availableChecks.includes("numbers")&&t.match(s.numbers)&&(i+=1,e.add("numbers")),this.availableChecks.includes("special-characters")&&t.match(s["special-characters"])&&(i+=1,e.add("special-characters")),this.availableChecks.includes("min-length")&&t.length>=this.minLength&&(i+=1,e.add("min-length")),t.length||(i=0),i===this.availableChecks.length?this.el.classList.add("accepted"):this.el.classList.remove("accepted"),this.strength=i,this.passedRules=e,{strength:this.strength,rules:this.passedRules}}checkIfPassed(t,e=!1){const s=t.querySelector("[data-check]"),i=t.querySelector("[data-uncheck]");e?(t.classList.add("active"),s.classList.remove("hidden"),i.classList.add("hidden")):(t.classList.remove("active"),s.classList.add("hidden"),i.classList.remove("hidden"))}setStrength(t){const{strength:e,rules:s}=this.checkStrength(t),i={strength:e,rules:s};this.hideStrips(e),this.fireEvent("change",i),(0,n.JD)("change.hs.strongPassword",this.el,i)}hideStrips(t){Array.from(this.el.children).forEach(((e,s)=>{se.element.el===("string"==typeof t?document.querySelector(t):t)));return e?e.element:null}static autoInit(){window.$hsStrongPasswordCollection||(window.$hsStrongPasswordCollection=[]),document.querySelectorAll("[data-hs-strong-password]:not(.--prevent-on-load-init)").forEach((t=>{if(!window.$hsStrongPasswordCollection.find((e=>{var s;return(null===(s=null==e?void 0:e.element)||void 0===s?void 0:s.el)===t}))){const e=t.getAttribute("data-hs-strong-password"),s=e?JSON.parse(e):{};new l(t,s)}}))}}window.addEventListener("load",(()=>{l.autoInit()})),document.addEventListener("scroll",(()=>{if(!window.$hsStrongPasswordCollection)return!1;const t=window.$hsStrongPasswordCollection.find((t=>t.element.isOpened));t&&t.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSStrongPassword=l);const r=l;var o=i.A;export{o as default}; \ No newline at end of file diff --git a/dist/tabs.js b/dist/tabs.js index 5bb6a18..4c1bba8 100644 --- a/dist/tabs.js +++ b/dist/tabs.js @@ -1,17 +1,16 @@ -!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={223:(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}},961:(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={223:(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={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},961:(t,e)=>{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},166:function(t,e,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSTabs + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},166:function(t,e,n){ +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)}),i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(292),a=i(n(961)),l=n(223),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("data-hs-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){var e,n;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),(null===(e=null==this?void 0:this.prev)||void 0===e?void 0:e.ariaSelected)&&(this.prev.ariaSelected="false"),this.prev.classList.remove("active"),this.prevContent.classList.add("hidden"),(null===(n=null==this?void 0:this.current)||void 0===n?void 0:n.ariaSelected)&&(this.current.ariaSelected="true"),this.current.classList.add("active"),this.currentContent.classList.remove("hidden"),this.fireEvent("change",{el:t,prev:this.prevContentId,current:this.currentContentId}),(0,s.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&&l.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+1e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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,a=window.innerHeight,l=s?i.top-s.top:i.top,c=(r?s.bottom:a)-i.bottom,u=t.clientHeight+o;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 r=function(t){return!!t&&("none"===window.getComputedStyle(t).display||r(t.parentElement))};e.isParentOrElementHidden=r;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var r=[],i=0;i0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(166);return n})())); \ No newline at end of file +var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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.isDirectChild=function(t,e){for(var n=t.children,o=0;o=u:"top"===n?l>=u:l>=u||c>=u};e.isFormElement=function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement};var r=function(t){return!!t&&("none"===window.getComputedStyle(t).display||r(t.parentElement))};e.isParentOrElementHidden=r;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var r=[],i=0;i0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(166);return n})())); \ No newline at end of file diff --git a/dist/tabs.mjs b/dist/tabs.mjs new file mode 100644 index 0000000..7819b9b --- /dev/null +++ b/dist/tabs.mjs @@ -0,0 +1,9 @@ +var t={189:(t,e,n)=>{n.d(e,{Fy:()=>o});const o=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"]},615:(t,e,n)=>{n.d(e,{A:()=>o});class o{constructor(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}createCollection(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})}fireEvent(t,e=null){if(this.events.hasOwnProperty(t))return this.events[t](e)}on(t,e){this.events[t]=e}}},926:(t,e,n)=>{n.d(e,{JD:()=>o});const o=(t,e,n=null)=>{const o=new CustomEvent(t,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(o)}}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var s=e[o]={exports:{}};return t[o](s,s.exports,n),s.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);var o={};n.d(o,{A:()=>c});var r=n(926),s=n(615),i=n(189); +/* + * HSTabs + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class l extends s.A{constructor(t,e,n){super(t,e,n),this.toggles=this.el.querySelectorAll("[data-hs-tab]"),this.extraToggleId=this.el.getAttribute("data-hs-tab-select"),this.extraToggle=document.querySelector(this.extraToggleId),this.current=Array.from(this.toggles).find((t=>t.classList.contains("active"))),this.currentContentId=this.current.getAttribute("data-hs-tab"),this.currentContent=document.querySelector(this.currentContentId),this.prev=null,this.prevContentId=null,this.prevContent=null,this.init()}init(){this.createCollection(window.$hsTabsCollection,this),this.toggles.forEach((t=>{t.addEventListener("click",(()=>this.open(t)))})),this.extraToggle&&this.extraToggle.addEventListener("change",(t=>this.change(t)))}open(t){var e,n;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),(null===(e=null==this?void 0:this.prev)||void 0===e?void 0:e.ariaSelected)&&(this.prev.ariaSelected="false"),this.prev.classList.remove("active"),this.prevContent.classList.add("hidden"),(null===(n=null==this?void 0:this.current)||void 0===n?void 0:n.ariaSelected)&&(this.current.ariaSelected="true"),this.current.classList.add("active"),this.currentContent.classList.remove("hidden"),this.fireEvent("change",{el:t,prev:this.prevContentId,current:this.currentContentId}),(0,r.JD)("change.hs.tab",t,{el:t,prev:this.prevContentId,current:this.currentContentId})}change(t){const e=document.querySelector(`[data-hs-tab="${t.target.value}"]`);e&&e.click()}static getInstance(t,e){const n=window.$hsTabsCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return n?e?n:n.element:null}static autoInit(){window.$hsTabsCollection||(window.$hsTabsCollection=[]),document.querySelectorAll('[role="tablist"]:not(select):not(.--prevent-on-load-init)').forEach((t=>{window.$hsTabsCollection.find((e=>{var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new l(t)})),window.$hsTabsCollection&&document.addEventListener("keydown",(t=>l.accessibility(t)))}static open(t){const e=window.$hsTabsCollection.find((e=>Array.from(e.element.toggles).includes("string"==typeof t?document.querySelector(t):t))),n=Array.from(e.element.toggles).find((e=>e===("string"==typeof t?document.querySelector(t):t)));n&&!n.classList.contains("active")&&e.element.open(n)}static accessibility(t){const e=document.querySelector("[data-hs-tab]:focus");if(e&&i.Fy.includes(t.code)&&!t.metaKey){const 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)}}}static onArrow(t=!0){const e=document.querySelector("[data-hs-tab]:focus").closest('[role="tablist"]'),n=window.$hsTabsCollection.find((t=>t.element.el===e));if(n){const e=t?Array.from(n.element.toggles).reverse():Array.from(n.element.toggles),o=e.find((t=>document.activeElement===t));let r=e.findIndex((t=>t===o));r=r+1t.element.el===e));if(n){const e=t?Array.from(n.element.toggles):Array.from(n.element.toggles).reverse();e.length&&(e[0].focus(),e[0].click())}}static on(t,e,n){const o=window.$hsTabsCollection.find((t=>Array.from(t.element.toggles).includes("string"==typeof e?document.querySelector(e):e)));o&&(o.element.events[t]=n)}}window.addEventListener("load",(()=>{l.autoInit()})),"undefined"!=typeof window&&(window.HSTabs=l);const c=l;var a=o.A;export{a as default}; \ No newline at end of file diff --git a/dist/textarea-auto-height.d.ts b/dist/textarea-auto-height.d.ts new file mode 100644 index 0000000..fcd20e5 --- /dev/null +++ b/dist/textarea-auto-height.d.ts @@ -0,0 +1,43 @@ +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 ITextareaAutoHeightOptions { + defaultHeight: number; +} +export interface ITextareaAutoHeight { + options?: ITextareaAutoHeightOptions; +} +declare class HSTextareaAutoHeight extends HSBasePlugin implements ITextareaAutoHeight { + private readonly defaultHeight; + constructor(el: HTMLTextAreaElement, options?: ITextareaAutoHeightOptions); + private init; + private setAutoHeight; + private textareaSetHeight; + private checkIfOneLine; + private isParentHidden; + private parentType; + private callbackAccordingToType; + static getInstance(target: HTMLTextAreaElement | string, isInstance?: boolean): HSTextareaAutoHeight | ICollectionItem; + static autoInit(): void; +} + +export { + HSTextareaAutoHeight as default, +}; + +export {}; diff --git a/dist/textarea-auto-height.js b/dist/textarea-auto-height.js new file mode 100644 index 0000000..c920934 --- /dev/null +++ b/dist/textarea-auto-height.js @@ -0,0 +1,9 @@ +!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={961:(t,e)=>{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},144:function(t,e,n){ +/* + * HSTextareaAutoHeight + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +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)},e.prototype.isParentHidden=function(){return this.el.closest(".hs-collapse")||this.el.closest(".hs-overlay")},e.prototype.parentType=function(){return this.el.closest(".hs-collapse")?"collapse":!!this.el.closest(".hs-overlay")&&"overlay"},e.prototype.callbackAccordingToType=function(){var t=this;if("collapse"===this.parentType()){var e=this.el.closest(".hs-collapse").id;window.HSCollapse.getInstance('[data-hs-collapse="#'.concat(e,'"]'),!0).element.on("beforeOpen",(function(){if(!t.el)return!1;t.textareaSetHeight(3)}))}else{if("overlay"!==this.parentType())return!1;window.HSOverlay.getInstance(this.el.closest(".hs-overlay"),!0).element.on("open",(function(){if(!t.el)return!1;t.textareaSetHeight(3)}))}},e.getInstance=function(t,e){var n=window.$hsTextareaAutoHeightCollection.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.$hsTextareaAutoHeightCollection||(window.$hsTextareaAutoHeightCollection=[]),document.querySelectorAll("[data-hs-textarea-auto-height]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsTextareaAutoHeightCollection.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-textarea-auto-height"),o=n?JSON.parse(n):{};new e(t,o)}}))},e}(s(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSTextareaAutoHeight=l),e.default=l}},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}(144);return n})())); \ No newline at end of file diff --git a/dist/textarea-auto-height.mjs b/dist/textarea-auto-height.mjs new file mode 100644 index 0000000..9b04f15 --- /dev/null +++ b/dist/textarea-auto-height.mjs @@ -0,0 +1,8 @@ +var e={615:(e,t,i)=>{i.d(t,{A:()=>s});class s{constructor(e,t,i){this.el=e,this.options=t,this.events=i,this.el=e,this.options=t,this.events={}}createCollection(e,t){var i;e.push({id:(null===(i=null==t?void 0:t.el)||void 0===i?void 0:i.id)||e.length+1,element:t})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}}},t={};function i(s){var o=t[s];if(void 0!==o)return o.exports;var n=t[s]={exports:{}};return e[s](n,n.exports,i),n.exports}i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var s={};i.d(s,{A:()=>l});var o=i(615); +/* + * HSTextareaAutoHeight + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */class n extends o.A{constructor(e,t){super(e,t);const i=e.getAttribute("data-hs-copy-markup"),s=i?JSON.parse(i):{},o=Object.assign(Object.assign({},s),t);this.defaultHeight=(null==o?void 0:o.defaultHeight)||0,this.init()}init(){this.createCollection(window.$hsTextareaAutoHeightCollection,this),this.setAutoHeight()}setAutoHeight(){this.isParentHidden()?this.callbackAccordingToType():this.textareaSetHeight(3),this.el.addEventListener("input",(()=>this.textareaSetHeight(3)))}textareaSetHeight(e=0){this.el.style.height="auto",this.el.style.height=this.checkIfOneLine()&&this.defaultHeight?`${this.defaultHeight}px`:`${this.el.scrollHeight+e}px`}checkIfOneLine(){const e=this.el.clientHeight;return!(this.el.scrollHeight>e)}isParentHidden(){return this.el.closest(".hs-collapse")||this.el.closest(".hs-overlay")}parentType(){return this.el.closest(".hs-collapse")?"collapse":!!this.el.closest(".hs-overlay")&&"overlay"}callbackAccordingToType(){if("collapse"===this.parentType()){const e=this.el.closest(".hs-collapse").id,{element:t}=window.HSCollapse.getInstance(`[data-hs-collapse="#${e}"]`,!0);t.on("beforeOpen",(()=>{if(!this.el)return!1;this.textareaSetHeight(3)}))}else{if("overlay"!==this.parentType())return!1;{const{element:e}=window.HSOverlay.getInstance(this.el.closest(".hs-overlay"),!0);e.on("open",(()=>{if(!this.el)return!1;this.textareaSetHeight(3)}))}}}static getInstance(e,t){const i=window.$hsTextareaAutoHeightCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element:null}static autoInit(){window.$hsTextareaAutoHeightCollection||(window.$hsTextareaAutoHeightCollection=[]),document.querySelectorAll("[data-hs-textarea-auto-height]:not(.--prevent-on-load-init)").forEach((e=>{if(!window.$hsTextareaAutoHeightCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))){const t=e.getAttribute("data-hs-textarea-auto-height"),i=t?JSON.parse(t):{};new n(e,i)}}))}}window.addEventListener("load",(()=>{n.autoInit()})),"undefined"!=typeof window&&(window.HSTextareaAutoHeight=n);const l=n;var a=s.A;export{a as default}; \ No newline at end of file diff --git a/dist/theme-switch.js b/dist/theme-switch.js index 86e8290..44e6f2d 100644 --- a/dist/theme-switch.js +++ b/dist/theme-switch.js @@ -1,9 +1 @@ -!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={961:(e,t)=>{ -/* - * HSBasePlugin - * @version: 2.4.1 - * @author: Preline Labs Ltd. - * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) - * Copyright 2024 Preline Labs Ltd. - */ -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},502:function(e,t,n){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;n(()=>{"use strict";var e={961:(e,t)=>{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},502:function(e,t,n){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;n{n.d(t,{A:()=>s});class s{constructor(e,t,n){this.el=e,this.options=t,this.events=n,this.el=e,this.options=t,this.events={}}createCollection(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})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}}},t={};function n(s){var o=t[s];if(void 0!==o)return o.exports;var a=t[s]={exports:{}};return e[s](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var s={};n.d(s,{A:()=>i});var o=n(615);class a extends o.A{constructor(e,t){super(e,t);const n=e.getAttribute("data-hs-theme-switch"),s=n?JSON.parse(n):{},o=Object.assign(Object.assign({},s),t);this.theme=(null==o?void 0:o.theme)||localStorage.getItem("hs_theme")||"default",this.themeSet=["light","dark","default"],this.init()}init(){this.createCollection(window.$hsThemeSwitchCollection,this),"default"!==this.theme&&this.setAppearance()}setResetStyles(){const e=document.createElement("style");return e.innerText="*{transition: unset !important;}",e.setAttribute("data-hs-appearance-onload-styles",""),document.head.appendChild(e),e}addSystemThemeObserver(){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(({matches:e})=>{e?this.setAppearance("dark",!1):this.setAppearance("default",!1)}))}removeSystemThemeObserver(){window.matchMedia("(prefers-color-scheme: dark)").removeEventListener}setAppearance(e=this.theme,t=!0,n=!0){const s=document.querySelector("html"),o=this.setResetStyles();t&&localStorage.setItem("hs_theme",e),"auto"===e&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"default"),s.classList.remove("light","dark","default","auto"),s.classList.add(e),setTimeout((()=>o.remove())),n&&window.dispatchEvent(new CustomEvent("on-hs-appearance-change",{detail:e}))}static getInstance(e){const t=window.$hsThemeSwitchCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return t?t.element:null}static autoInit(){window.$hsThemeSwitchCollection||(window.$hsThemeSwitchCollection=[]);const e=e=>{"auto"===localStorage.getItem("hs_theme")?e.addSystemThemeObserver():e.removeSystemThemeObserver()};document.querySelectorAll("[data-hs-theme-switch]:not(.--prevent-on-load-init)").forEach((t=>{if(!window.$hsThemeSwitchCollection.find((e=>{var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))){const n=new a(t);n.el.checked="dark"===n.theme,e(n),n.el.addEventListener("change",(t=>{const s=t.target.checked?"dark":"default";n.setAppearance(s),e(n)}))}})),document.querySelectorAll("[data-hs-theme-click-value]:not(.--prevent-on-load-init)").forEach((t=>{const n=t.getAttribute("data-hs-theme-click-value"),s=new a(t);e(s),s.el.addEventListener("click",(()=>{s.setAppearance(n),e(s)}))}))}}window.addEventListener("load",(()=>{a.autoInit()})),window.$hsThemeSwitchCollection&&window.addEventListener("on-hs-appearance-change",(e=>{window.$hsThemeSwitchCollection.forEach((t=>{t.element.el.checked="dark"===e.detail}))})),"undefined"!=typeof window&&(window.HSThemeSwitch=a);const i=a;var r=s.A;export{r as default}; \ No newline at end of file diff --git a/dist/toggle-count.js b/dist/toggle-count.js index 53e83bb..65d6399 100644 --- a/dist/toggle-count.js +++ b/dist/toggle-count.js @@ -1,15 +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={961:(t,e)=>{ -/* - * HSBasePlugin - * @version: 2.4.1 - * @author: Preline Labs Ltd. - * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) - * Copyright 2024 Preline Labs Ltd. - */ -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},684: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={961:(t,e)=>{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},684:function(t,e,n){ /* * HSToggleCount - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. diff --git a/dist/toggle-count.mjs b/dist/toggle-count.mjs new file mode 100644 index 0000000..a872ffd --- /dev/null +++ b/dist/toggle-count.mjs @@ -0,0 +1,8 @@ +var t={615:(t,e,n)=>{n.d(e,{A:()=>i});class i{constructor(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}createCollection(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})}fireEvent(t,e=null){if(this.events.hasOwnProperty(t))return this.events[t](e)}on(t,e){this.events[t]=e}}}},e={};function n(i){var o=e[i];if(void 0!==o)return o.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,n),s.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var i={};n.d(i,{A:()=>l});var o=n(615); +/* + * HSToggleCount + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */class s extends o.A{constructor(t,e){super(t,e);const n=t.getAttribute("data-hs-toggle-count"),i=n?JSON.parse(n):{},o=Object.assign(Object.assign({},i),e);this.target=(null==o?void 0:o.target)?"string"==typeof(null==o?void 0:o.target)?document.querySelector(o.target):o.target:null,this.min=(null==o?void 0:o.min)||0,this.max=(null==o?void 0:o.max)||0,this.duration=(null==o?void 0:o.duration)||700,this.isChecked=this.target.checked||!1,this.target&&this.init()}init(){this.createCollection(window.$hsToggleCountCollection,this),this.isChecked&&(this.el.innerText=String(this.max)),this.target.addEventListener("change",(()=>{this.isChecked=!this.isChecked,this.toggle()}))}toggle(){this.isChecked?this.countUp():this.countDown()}animate(t,e){let n=0;const i=o=>{n||(n=o);const s=Math.min((o-n)/this.duration,1);this.el.innerText=String(Math.floor(s*(e-t)+t)),s<1&&window.requestAnimationFrame(i)};window.requestAnimationFrame(i)}countUp(){this.animate(this.min,this.max)}countDown(){this.animate(this.max,this.min)}static getInstance(t,e){const n=window.$hsToggleCountCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return n?e?n:n.element:null}static autoInit(){window.$hsToggleCountCollection||(window.$hsToggleCountCollection=[]),document.querySelectorAll("[data-hs-toggle-count]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsToggleCountCollection.find((e=>{var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new s(t)}))}}window.addEventListener("load",(()=>{s.autoInit()})),"undefined"!=typeof window&&(window.HSToggleCount=s);const l=s;var r=i.A;export{r as default}; \ No newline at end of file diff --git a/dist/toggle-password.js b/dist/toggle-password.js index 2ab5386..4725c24 100644 --- a/dist/toggle-password.js +++ b/dist/toggle-password.js @@ -1,17 +1,16 @@ -!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={961:(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={961:(t,e)=>{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},100:function(t,e,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSTogglePassword + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},100: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;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,a.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}(s(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=l),e.default=l},292:function(t,e){ /* - * HSTogglePassword - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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,a.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}(s(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=l),e.default=l},292: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.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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 i=function(t){return!!t&&("none"===window.getComputedStyle(t).display||i(t.parentElement))};e.isParentOrElementHidden=i;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(100);return n})())); \ No newline at end of file +var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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.isDirectChild=function(t,e){for(var n=t.children,o=0;o=c:"top"===n?l>=c:l>=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 o;return void 0===e&&(e=200),function(){for(var i=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}(100);return n})())); \ No newline at end of file diff --git a/dist/toggle-password.mjs b/dist/toggle-password.mjs new file mode 100644 index 0000000..7048613 --- /dev/null +++ b/dist/toggle-password.mjs @@ -0,0 +1,9 @@ +var t={615:(t,e,s)=>{s.d(e,{A:()=>o});class o{constructor(t,e,s){this.el=t,this.options=e,this.events=s,this.el=t,this.options=e,this.events={}}createCollection(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})}fireEvent(t,e=null){if(this.events.hasOwnProperty(t))return this.events[t](e)}on(t,e){this.events[t]=e}}},926:(t,e,s)=>{s.d(e,{JD:()=>i,V6:()=>o});const o=t=>t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement,i=(t,e,s=null)=>{const o=new CustomEvent(t,{detail:{payload:s},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(o)}}},e={};function s(o){var i=e[o];if(void 0!==i)return i.exports;var l=e[o]={exports:{}};return t[o](l,l.exports,s),l.exports}s.d=(t,e)=>{for(var o in e)s.o(e,o)&&!s.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var o={};s.d(o,{A:()=>r});var i=s(926),l=s(615); +/* + * HSTogglePassword + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class n extends l.A{constructor(t,e){super(t,e);const s=t.getAttribute("data-hs-toggle-password"),o=s?JSON.parse(s):{},l=Object.assign(Object.assign({},o),e),n=[];if((null==l?void 0:l.target)&&"string"==typeof(null==l?void 0:l.target)){(null==l?void 0:l.target.split(",")).forEach((t=>{n.push(document.querySelector(t))}))}else(null==l?void 0:l.target)&&"object"==typeof(null==l?void 0:l.target)?l.target.forEach((t=>n.push(document.querySelector(t)))):l.target.forEach((t=>n.push(t)));this.target=n,this.isShown=!!this.el.hasAttribute("type")&&this.el.checked,this.eventType=(0,i.V6)(this.el)?"change":"click",this.isMultiple=this.target.length>1&&!!this.el.closest("[data-hs-toggle-password-group]"),this.target&&this.init()}init(){this.createCollection(window.$hsTogglePasswordCollection,this),this.isShown?this.show():this.hide(),this.el.addEventListener(this.eventType,(()=>{this.isShown?this.hide():this.show(),this.fireEvent("toggle",this.target),(0,i.JD)("toggle.hs.toggle-select",this.el,this.target)}))}getMultipleToggles(){const t=this.el.closest("[data-hs-toggle-password-group]").querySelectorAll("[data-hs-toggle-password]"),e=[];return t.forEach((t=>{e.push(n.getInstance(t))})),e}show(){if(this.isMultiple){this.getMultipleToggles().forEach((t=>!!t&&(t.isShown=!0))),this.el.closest("[data-hs-toggle-password-group]").classList.add("active")}else this.isShown=!0,this.el.classList.add("active");this.target.forEach((t=>{t.type="text"}))}hide(){if(this.isMultiple){this.getMultipleToggles().forEach((t=>!!t&&(t.isShown=!1))),this.el.closest("[data-hs-toggle-password-group]").classList.remove("active")}else this.isShown=!1,this.el.classList.remove("active");this.target.forEach((t=>{t.type="password"}))}static getInstance(t,e){const s=window.$hsTogglePasswordCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return s?e?s:s.element:null}static autoInit(){window.$hsTogglePasswordCollection||(window.$hsTogglePasswordCollection=[]),document.querySelectorAll("[data-hs-toggle-password]:not(.--prevent-on-load-init)").forEach((t=>{window.$hsTogglePasswordCollection.find((e=>{var s;return(null===(s=null==e?void 0:e.element)||void 0===s?void 0:s.el)===t}))||new n(t)}))}}window.addEventListener("load",(()=>{n.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=n);const r=n;var a=o.A;export{a as default}; \ No newline at end of file diff --git a/dist/tooltip.js b/dist/tooltip.js index bd2a3ec..4d26fa9 100644 --- a/dist/tooltip.js +++ b/dist/tooltip.js @@ -1,17 +1,16 @@ -!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={170:(e,t,n)=>{n.r(t),n.d(t,{afterMain:()=>O,afterRead:()=>b,afterWrite:()=>T,applyStyles:()=>j,arrow:()=>J,auto:()=>s,basePlacements:()=>f,beforeMain:()=>w,beforeRead:()=>g,beforeWrite:()=>E,bottom:()=>r,clippingParents:()=>u,computeStyles:()=>ne,createPopper:()=>je,createPopperBase:()=>Ce,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:()=>_e,popperOffsets:()=>Se,preventOverflow:()=>Te,read:()=>y,reference:()=>h,right:()=>i,start:()=>c,top:()=>o,variationPlacements:()=>m,viewport:()=>p,write:()=>S});var o="top",r="bottom",i="right",a="left",s="auto",f=[o,r,i,a],c="start",l="end",u="clippingParents",p="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",P=[g,y,b,w,x,O,E,S,T];function I(e){return e?(e.nodeName||"").toLowerCase():null}function L(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function A(e){return e instanceof L(e).Element||e instanceof Element}function _(e){return e instanceof L(e).HTMLElement||e instanceof HTMLElement}function C(e){return"undefined"!=typeof ShadowRoot&&(e instanceof L(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];_(r)&&I(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}),{});_(o)&&I(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 Y(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&_(e)&&(r=e.offsetWidth>0&&H(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&H(o.height)/e.offsetHeight||1);var a=(A(e)?L(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,u=o.height/i;return{width:l,height:u,top:c,right:f+l,bottom:c+u,left:f,x:f,y:c}}function W(e){var t=Y(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 N(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&C(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 L(e).getComputedStyle(e)}function q(e){return["table","td","th"].indexOf(I(e))>=0}function K(e){return((A(e)?e.ownerDocument:e.document)||window.document).documentElement}function F(e){return"html"===I(e)?e:e.assignedSlot||e.parentNode||(C(e)?e.host:null)||K(e)}function U(e){return _(e)&&"fixed"!==V(e).position?e.offsetParent:null}function $(e){for(var t=L(e),n=U(e);n&&q(n)&&"static"===V(n).position;)n=U(n);return n&&("html"===I(n)||"body"===I(n)&&"static"===V(n).position)?t:n||function(e){var t=/firefox/i.test(k());if(/Trident/i.test(k())&&_(e)&&"fixed"===V(e).position)return null;var n=F(e);for(C(n)&&(n=n.host);_(n)&&["html","body"].indexOf(I(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 z(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function X(e,t,n){return B(e,D(t,n))}function Z(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function G(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,s=e.name,c=e.options,l=n.elements.arrow,u=n.modifiersData.popperOffsets,p=M(n.placement),d=z(p),h=[a,i].indexOf(p)>=0?"height":"width";if(l&&u){var m=function(e,t){return Z("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:G(e,f))}(c.padding,n),v=W(l),g="y"===d?o:a,y="y"===d?r:i,b=n.rects.reference[h]+n.rects.reference[d]-u[d]-n.rects.popper[h],w=u[d]-n.rects.reference[d],x=$(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,I=X(S,P,T),L=d;n.modifiersData[s]=((t={})[L]=I,t.centerOffset=I-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)))&&N(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,s=e.popperRect,f=e.placement,c=e.variation,u=e.offsets,p=e.position,d=e.gpuAcceleration,h=e.adaptive,m=e.roundOffsets,v=e.isFixed,g=u.x,y=void 0===g?0:g,b=u.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=u.hasOwnProperty("x"),E=u.hasOwnProperty("y"),S=a,T=o,P=window;if(h){var I=$(n),A="clientHeight",_="clientWidth";if(I===L(n)&&"static"!==V(I=K(n)).position&&"absolute"===p&&(A="scrollHeight",_="scrollWidth"),f===o||(f===a||f===i)&&c===l)T=r,w-=(v&&I===P&&P.visualViewport?P.visualViewport.height:I[A])-s.height,w*=d?1:-1;if(f===a||(f===o||f===r)&&c===l)S=i,y-=(v&&I===P&&P.visualViewport?P.visualViewport.width:I[_])-s.width,y*=d?1:-1}var C,j=Object.assign({position:p},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},L(n)):{x:y,y:w};return y=M.x,w=M.y,d?Object.assign({},j,((C={})[T]=E?"0":"",C[S]=O?"0":"",C.transform=(P.devicePixelRatio||1)<=1?"translate("+y+"px, "+w+"px)":"translate3d("+y+"px, "+w+"px, 0)",C)):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: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: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=L(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=L(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function le(e){return Y(K(e)).left+ce(e).scrollLeft}function ue(e){var t=V(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(I(e))>=0?e.ownerDocument.body:_(e)&&ue(e)?e:pe(F(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=L(o),a=r?[i].concat(i.visualViewport||[],ue(o)?o:[]):o,s=t.concat(a);return r?s:s.concat(de(F(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===p?he(function(e,t){var n=L(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)):A(t)?function(e,t){var n=Y(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=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),f=-o.scrollTop;return"rtl"===V(r||n).direction&&(s+=B(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(F(e)),n=["absolute","fixed"].indexOf(V(e).position)>=0&&_(e)?$(e):e;return A(n)?t.filter((function(e){return A(e)&&N(e,n)&&"body"!==I(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,f=e.placement,u=f?M(f):null,p=f?Q(f):null,d=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2;switch(u){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=u?z(u):null;if(null!=m){var v="y"===m?"height":"width";switch(p){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?u:m,g=n.rootBoundary,y=void 0===g?p: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=Z("number"!=typeof S?S:G(S,f)),P=w===d?h:d,I=e.rects.popper,L=e.elements[O?P:w],_=ve(A(L)?L:L.contextElement||K(e.elements.popper),v,y,l),C=Y(e.elements.reference),j=ge({reference:C,element:I,strategy:"absolute",placement:s}),M=he(Object.assign({},I,j)),B=w===d?M:C,D={top:_.top-B.top+T.top,bottom:B.bottom-_.bottom+T.bottom,left:_.left-B.left+T.left,right:B.right-_.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 u=n.mainAxis,p=void 0===u||u,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),I=g||(P===T||!E?[ae(T)]:function(e){if(M(e)===s)return[];var t=ae(e);return[fe(e),t,fe(t)]}(T)),L=[T].concat(I).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,u=Q(o),p=u?s?m:m.filter((function(e){return Q(e)===u})):f,d=p.filter((function(e){return l.indexOf(e)>=0}));0===d.length&&(d=p);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)}),[]),A=t.rects.reference,_=t.rects.popper,C=new Map,j=!0,B=L[0],D=0;D=0,W=Y?"width":"height",N=ye(t,{placement:H,boundary:b,rootBoundary:w,altBoundary:x,padding:y}),V=Y?R?i:a:R?r:o;A[W]>_[W]&&(V=ae(V));var q=ae(V),K=[];if(p&&K.push(N[k]<=0),h&&K.push(N[V]<=0,N[q]<=0),K.every((function(e){return e}))){B=H,j=!1;break}C.set(H,K)}if(j)for(var F=function(e){var t=L.find((function(t){var n=C.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return B=t,"break"},U=E?3:1;U>0;U--){if("break"===F(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}),f=we(a,o),c=we(s,r,i),l=xe(f),u=xe(c);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":u})}};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],u=l.x,p=l.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]=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,u=n.altAxis,p=void 0!==u&&u,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=Q(t.placement),S=!E,T=z(O),P="x"===T?"y":"x",I=t.modifiersData.popperOffsets,L=t.rects.reference,A=t.rects.popper,_="function"==typeof w?w(Object.assign({},t.rects,{placement:t.placement})):w,C="number"==typeof _?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,H={x:0,y:0};if(I){if(l){var k,R="y"===T?o:a,Y="y"===T?r:i,N="y"===T?"height":"width",V=I[T],q=V+x[R],K=V-x[Y],F=y?-A[N]/2:0,U=E===c?L[N]:A[N],Z=E===c?-A[N]:-L[N],G=t.elements.arrow,J=y&&G?W(G):{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[Y],oe=X(0,L[N],J[N]),re=S?L[N]/2-F-oe-te-C.mainAxis:U-oe-te-C.mainAxis,ie=S?-L[N]/2+F+oe+ne+C.mainAxis:Z+oe+ne+C.mainAxis,ae=t.elements.arrow&&$(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=X(y?D(q,V+re-fe-se):q,V,y?B(K,ce):K);I[T]=le,H[T]=le-V}if(p){var ue,pe="x"===T?o:a,de="x"===T?r:i,he=I[P],me="y"===P?"height":"width",ve=he+x[pe],ge=he-x[de],be=-1!==[o,a].indexOf(O),we=null!=(ue=null==j?void 0:j[P])?ue:0,xe=be?ve:he-L[me]-A[me]-we+C.altAxis,Oe=be?he+L[me]+A[me]-we-C.altAxis:ge,Ee=y&&be?function(e,t,n){var o=X(e,t,n);return o>n?n:o}(xe,he,Oe):X(y?xe:ve,he,y?Oe:ge);I[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=_(t),a=_(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=Y(e,a,n),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&(("body"!==I(t)||ue(s))&&(c=(o=t)!==L(o)&&_(o)?{scrollLeft:(r=o).scrollLeft,scrollTop:r.scrollTop}:ce(o)),_(t)?((l=Y(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 Ie(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 Le={placement:"bottom",modifiers:[],strategy:"absolute"};function Ae(){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}},961:(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={170:(e,t,n)=>{n.r(t),n.d(t,{afterMain:()=>O,afterRead:()=>b,afterWrite:()=>T,applyStyles:()=>j,arrow:()=>J,auto:()=>s,basePlacements:()=>f,beforeMain:()=>w,beforeRead:()=>g,beforeWrite:()=>E,bottom:()=>r,clippingParents:()=>u,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:()=>Ce,popperOffsets:()=>Se,preventOverflow:()=>Te,read:()=>y,reference:()=>h,right:()=>i,start:()=>c,top:()=>o,variationPlacements:()=>m,viewport:()=>p,write:()=>S});var o="top",r="bottom",i="right",a="left",s="auto",f=[o,r,i,a],c="start",l="end",u="clippingParents",p="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",P=[g,y,b,w,x,O,E,S,T];function I(e){return e?(e.nodeName||"").toLowerCase():null}function L(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function A(e){return e instanceof L(e).Element||e instanceof Element}function C(e){return e instanceof L(e).HTMLElement||e instanceof HTMLElement}function _(e){return"undefined"!=typeof ShadowRoot&&(e instanceof L(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];C(r)&&I(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}),{});C(o)&&I(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 Y(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&C(e)&&(r=e.offsetWidth>0&&H(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&H(o.height)/e.offsetHeight||1);var a=(A(e)?L(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,u=o.height/i;return{width:l,height:u,top:c,right:f+l,bottom:c+u,left:f,x:f,y:c}}function W(e){var t=Y(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 N(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 L(e).getComputedStyle(e)}function q(e){return["table","td","th"].indexOf(I(e))>=0}function K(e){return((A(e)?e.ownerDocument:e.document)||window.document).documentElement}function F(e){return"html"===I(e)?e:e.assignedSlot||e.parentNode||(_(e)?e.host:null)||K(e)}function U(e){return C(e)&&"fixed"!==V(e).position?e.offsetParent:null}function $(e){for(var t=L(e),n=U(e);n&&q(n)&&"static"===V(n).position;)n=U(n);return n&&("html"===I(n)||"body"===I(n)&&"static"===V(n).position)?t:n||function(e){var t=/firefox/i.test(k());if(/Trident/i.test(k())&&C(e)&&"fixed"===V(e).position)return null;var n=F(e);for(_(n)&&(n=n.host);C(n)&&["html","body"].indexOf(I(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 z(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function X(e,t,n){return D(e,B(t,n))}function Z(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function G(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,s=e.name,c=e.options,l=n.elements.arrow,u=n.modifiersData.popperOffsets,p=M(n.placement),d=z(p),h=[a,i].indexOf(p)>=0?"height":"width";if(l&&u){var m=function(e,t){return Z("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:G(e,f))}(c.padding,n),v=W(l),g="y"===d?o:a,y="y"===d?r:i,b=n.rects.reference[h]+n.rects.reference[d]-u[d]-n.rects.popper[h],w=u[d]-n.rects.reference[d],x=$(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,I=X(S,P,T),L=d;n.modifiersData[s]=((t={})[L]=I,t.centerOffset=I-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)))&&N(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,s=e.popperRect,f=e.placement,c=e.variation,u=e.offsets,p=e.position,d=e.gpuAcceleration,h=e.adaptive,m=e.roundOffsets,v=e.isFixed,g=u.x,y=void 0===g?0:g,b=u.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=u.hasOwnProperty("x"),E=u.hasOwnProperty("y"),S=a,T=o,P=window;if(h){var I=$(n),A="clientHeight",C="clientWidth";if(I===L(n)&&"static"!==V(I=K(n)).position&&"absolute"===p&&(A="scrollHeight",C="scrollWidth"),f===o||(f===a||f===i)&&c===l)T=r,w-=(v&&I===P&&P.visualViewport?P.visualViewport.height:I[A])-s.height,w*=d?1:-1;if(f===a||(f===o||f===r)&&c===l)S=i,y-=(v&&I===P&&P.visualViewport?P.visualViewport.width:I[C])-s.width,y*=d?1:-1}var _,j=Object.assign({position:p},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},L(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,f=void 0===s||s,c={placement:M(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: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=L(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=L(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function le(e){return Y(K(e)).left+ce(e).scrollLeft}function ue(e){var t=V(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(I(e))>=0?e.ownerDocument.body:C(e)&&ue(e)?e:pe(F(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=L(o),a=r?[i].concat(i.visualViewport||[],ue(o)?o:[]):o,s=t.concat(a);return r?s:s.concat(de(F(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===p?he(function(e,t){var n=L(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)):A(t)?function(e,t){var n=Y(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(F(e)),n=["absolute","fixed"].indexOf(V(e).position)>=0&&C(e)?$(e):e;return A(n)?t.filter((function(e){return A(e)&&N(e,n)&&"body"!==I(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,u=f?M(f):null,p=f?Q(f):null,d=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2;switch(u){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=u?z(u):null;if(null!=m){var v="y"===m?"height":"width";switch(p){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?u:m,g=n.rootBoundary,y=void 0===g?p: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=Z("number"!=typeof S?S:G(S,f)),P=w===d?h:d,I=e.rects.popper,L=e.elements[O?P:w],C=ve(A(L)?L:L.contextElement||K(e.elements.popper),v,y,l),_=Y(e.elements.reference),j=ge({reference:_,element:I,strategy:"absolute",placement:s}),M=he(Object.assign({},I,j)),D=w===d?M:_,B={top:C.top-D.top+T.top,bottom:D.bottom-C.bottom+T.bottom,left:C.left-D.left+T.left,right:D.right-C.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 u=n.mainAxis,p=void 0===u||u,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),I=g||(P===T||!E?[ae(T)]:function(e){if(M(e)===s)return[];var t=ae(e);return[fe(e),t,fe(t)]}(T)),L=[T].concat(I).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,u=Q(o),p=u?s?m:m.filter((function(e){return Q(e)===u})):f,d=p.filter((function(e){return l.indexOf(e)>=0}));0===d.length&&(d=p);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)}),[]),A=t.rects.reference,C=t.rects.popper,_=new Map,j=!0,D=L[0],B=0;B=0,W=Y?"width":"height",N=ye(t,{placement:H,boundary:b,rootBoundary:w,altBoundary:x,padding:y}),V=Y?R?i:a:R?r:o;A[W]>C[W]&&(V=ae(V));var q=ae(V),K=[];if(p&&K.push(N[k]<=0),h&&K.push(N[V]<=0,N[q]<=0),K.every((function(e){return e}))){D=H,j=!1;break}_.set(H,K)}if(j)for(var F=function(e){var t=L.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"},U=E?3:1;U>0;U--){if("break"===F(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),u=xe(c);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":u})}};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],u=l.x,p=l.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]=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,u=n.altAxis,p=void 0!==u&&u,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=Q(t.placement),S=!E,T=z(O),P="x"===T?"y":"x",I=t.modifiersData.popperOffsets,L=t.rects.reference,A=t.rects.popper,C="function"==typeof w?w(Object.assign({},t.rects,{placement:t.placement})):w,_="number"==typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,H={x:0,y:0};if(I){if(l){var k,R="y"===T?o:a,Y="y"===T?r:i,N="y"===T?"height":"width",V=I[T],q=V+x[R],K=V-x[Y],F=y?-A[N]/2:0,U=E===c?L[N]:A[N],Z=E===c?-A[N]:-L[N],G=t.elements.arrow,J=y&&G?W(G):{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[Y],oe=X(0,L[N],J[N]),re=S?L[N]/2-F-oe-te-_.mainAxis:U-oe-te-_.mainAxis,ie=S?-L[N]/2+F+oe+ne+_.mainAxis:Z+oe+ne+_.mainAxis,ae=t.elements.arrow&&$(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=X(y?B(q,V+re-fe-se):q,V,y?D(K,ce):K);I[T]=le,H[T]=le-V}if(p){var ue,pe="x"===T?o:a,de="x"===T?r:i,he=I[P],me="y"===P?"height":"width",ve=he+x[pe],ge=he-x[de],be=-1!==[o,a].indexOf(O),we=null!=(ue=null==j?void 0:j[P])?ue:0,xe=be?ve:he-L[me]-A[me]-we+_.altAxis,Oe=be?he+L[me]+A[me]-we-_.altAxis:ge,Ee=y&&be?function(e,t,n){var o=X(e,t,n);return o>n?n:o}(xe,he,Oe):X(y?xe:ve,he,y?Oe:ge);I[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=C(t),a=C(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=Y(e,a,n),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&(("body"!==I(t)||ue(s))&&(c=(o=t)!==L(o)&&C(o)?{scrollLeft:(r=o).scrollLeft,scrollTop:r.scrollTop}:ce(o)),C(t)?((l=Y(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 Ie(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 Le={placement:"bottom",modifiers:[],strategy:"absolute"};function Ae(){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={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},961:(e,t)=>{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},969:function(e,t,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSTooltip + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},969:function(e,t,n){ +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;nt&&(t=n)})),t};t.stringToBoolean=function(e){return"true"===e};t.getClassProperty=function(e,t,n){return void 0===n&&(n=""),(window.getComputedStyle(e).getPropertyValue(t)||n).replace(" ","")};t.getClassPropertyAlt=function(e,t,n){void 0===n&&(n="");var o="";return e.classList.forEach((function(e){e.includes(t)&&(o=e)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};var o=function(e){return window.getComputedStyle(e).getPropertyValue("z-index")};t.getZIndex=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,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 r=function(e){return!!e&&("none"===window.getComputedStyle(e).display||r(e.parentElement))};t.isParentOrElementHidden=r;t.debounce=function(e,t){var o;return void 0===t&&(t=200),function(){for(var r=[],i=0;i0?e.addEventListener("transitionend",n,!0):t()};t.htmlToElement=function(e){var t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild};t.classToClassList=function(e,t,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),e.split(n).forEach((function(e){return"add"===o?t.classList.add(e):t.classList.remove(e)}))};t.menuSearchHistory={historyIndex:-1,addHistory:function(e){this.historyIndex=e},existsInHistory:function(e){return e>this.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(969)})())); \ No newline at end of file +var n=this;Object.defineProperty(t,"__esModule",{value:!0}),t.menuSearchHistory=t.classToClassList=t.htmlToElement=t.afterTransition=t.dispatch=t.debounce=t.isDirectChild=t.isFormElement=t.isParentOrElementHidden=t.isEnoughSpace=t.isIpadOS=t.isIOS=t.getZIndex=t.getClassPropertyAlt=t.getClassProperty=t.stringToBoolean=void 0,t.getHighestZIndex=function(e){var t=Number.NEGATIVE_INFINITY;return e.forEach((function(e){var n=o(e);"auto"!==n&&(n=parseInt(n,10))>t&&(t=n)})),t};t.stringToBoolean=function(e){return"true"===e};t.getClassProperty=function(e,t,n){return void 0===n&&(n=""),(window.getComputedStyle(e).getPropertyValue(t)||n).replace(" ","")};t.getClassPropertyAlt=function(e,t,n){void 0===n&&(n="");var o="";return e.classList.forEach((function(e){e.includes(t)&&(o=e)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};var o=function(e){return window.getComputedStyle(e).getPropertyValue("z-index")};t.getZIndex=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.isDirectChild=function(e,t){for(var n=e.children,o=0;o=l:"top"===n?f>=l:f>=l||c>=l};t.isFormElement=function(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement};var r=function(e){return!!e&&("none"===window.getComputedStyle(e).display||r(e.parentElement))};t.isParentOrElementHidden=r;t.debounce=function(e,t){var o;return void 0===t&&(t=200),function(){for(var r=[],i=0;i0?e.addEventListener("transitionend",n,!0):t()};t.htmlToElement=function(e){var t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild};t.classToClassList=function(e,t,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),e.split(n).forEach((function(e){return"add"===o?t.classList.add(e):t.classList.remove(e)}))};t.menuSearchHistory={historyIndex:-1,addHistory:function(e){this.historyIndex=e},existsInHistory:function(e){return e>this.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(969)})())); \ No newline at end of file diff --git a/dist/tooltip.mjs b/dist/tooltip.mjs new file mode 100644 index 0000000..10790cd --- /dev/null +++ b/dist/tooltip.mjs @@ -0,0 +1,16 @@ +var e={316:(e,t,n)=>{function o(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 o(e).Element||e instanceof Element}function r(e){return e instanceof o(e).HTMLElement||e instanceof HTMLElement}function s(e){return"undefined"!=typeof ShadowRoot&&(e instanceof o(e).ShadowRoot||e instanceof ShadowRoot)}n.d(t,{n4:()=>ve});var a=Math.max,c=Math.min,f=Math.round;function l(){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 p(){return!/^((?!chrome|android).)*safari/i.test(l())}function d(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var s=e.getBoundingClientRect(),a=1,c=1;t&&r(e)&&(a=e.offsetWidth>0&&f(s.width)/e.offsetWidth||1,c=e.offsetHeight>0&&f(s.height)/e.offsetHeight||1);var l=(i(e)?o(e):window).visualViewport,d=!p()&&n,u=(s.left+(d&&l?l.offsetLeft:0))/a,h=(s.top+(d&&l?l.offsetTop:0))/c,m=s.width/a,v=s.height/c;return{width:m,height:v,top:h,right:u+m,bottom:h+v,left:u,x:u,y:h}}function u(e){var t=o(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function h(e){return e?(e.nodeName||"").toLowerCase():null}function m(e){return((i(e)?e.ownerDocument:e.document)||window.document).documentElement}function v(e){return d(m(e)).left+u(e).scrollLeft}function g(e){return o(e).getComputedStyle(e)}function y(e){var t=g(e),n=t.overflow,o=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+o)}function b(e,t,n){void 0===n&&(n=!1);var i,s,a=r(t),c=r(t)&&function(e){var t=e.getBoundingClientRect(),n=f(t.width)/e.offsetWidth||1,o=f(t.height)/e.offsetHeight||1;return 1!==n||1!==o}(t),l=m(t),p=d(e,c,n),g={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(a||!a&&!n)&&(("body"!==h(t)||y(l))&&(g=(i=t)!==o(i)&&r(i)?{scrollLeft:(s=i).scrollLeft,scrollTop:s.scrollTop}:u(i)),r(t)?((b=d(t,!0)).x+=t.clientLeft,b.y+=t.clientTop):l&&(b.x=v(l))),{x:p.left+g.scrollLeft-b.x,y:p.top+g.scrollTop-b.y,width:p.width,height:p.height}}function w(e){var t=d(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 x(e){return"html"===h(e)?e:e.assignedSlot||e.parentNode||(s(e)?e.host:null)||m(e)}function O(e){return["html","body","#document"].indexOf(h(e))>=0?e.ownerDocument.body:r(e)&&y(e)?e:O(x(e))}function E(e,t){var n;void 0===t&&(t=[]);var i=O(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),s=o(i),a=r?[s].concat(s.visualViewport||[],y(i)?i:[]):i,c=t.concat(a);return r?c:c.concat(E(x(a)))}function j(e){return["table","td","th"].indexOf(h(e))>=0}function L(e){return r(e)&&"fixed"!==g(e).position?e.offsetParent:null}function A(e){for(var t=o(e),n=L(e);n&&j(n)&&"static"===g(n).position;)n=L(n);return n&&("html"===h(n)||"body"===h(n)&&"static"===g(n).position)?t:n||function(e){var t=/firefox/i.test(l());if(/Trident/i.test(l())&&r(e)&&"fixed"===g(e).position)return null;var n=x(e);for(s(n)&&(n=n.host);r(n)&&["html","body"].indexOf(h(n))<0;){var o=g(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}var D="top",P="bottom",k="right",T="left",M="auto",C=[D,P,k,T],S="start",W="end",H="clippingParents",q="viewport",B="popper",R="reference",V=C.reduce((function(e,t){return e.concat([t+"-"+S,t+"-"+W])}),[]),I=[].concat(C,[M]).reduce((function(e,t){return e.concat([t,t+"-"+S,t+"-"+W])}),[]),$=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function N(e){var t=new Map,n=new Set,o=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var o=t.get(e);o&&i(o)}})),o.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),o}var F={placement:"bottom",modifiers:[],strategy:"absolute"};function U(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function G(e){var t,n=e.reference,o=e.element,i=e.placement,r=i?_(i):null,s=i?X(i):null,a=n.x+n.width/2-o.width/2,c=n.y+n.height/2-o.height/2;switch(r){case D:t={x:a,y:n.y-o.height};break;case P:t={x:a,y:n.y+n.height};break;case k:t={x:n.x+n.width,y:c};break;case T:t={x:n.x-o.width,y:c};break;default:t={x:n.x,y:n.y}}var f=r?Y(r):null;if(null!=f){var l="y"===f?"height":"width";switch(s){case S:t[f]=t[f]-(n[l]/2-o[l]/2);break;case W:t[f]=t[f]+(n[l]/2-o[l]/2)}}return t}var K={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Q(e){var t,n=e.popper,i=e.popperRect,r=e.placement,s=e.variation,a=e.offsets,c=e.position,l=e.gpuAcceleration,p=e.adaptive,d=e.roundOffsets,u=e.isFixed,h=a.x,v=void 0===h?0:h,y=a.y,b=void 0===y?0:y,w="function"==typeof d?d({x:v,y:b}):{x:v,y:b};v=w.x,b=w.y;var x=a.hasOwnProperty("x"),O=a.hasOwnProperty("y"),E=T,j=D,L=window;if(p){var M=A(n),C="clientHeight",S="clientWidth";if(M===o(n)&&"static"!==g(M=m(n)).position&&"absolute"===c&&(C="scrollHeight",S="scrollWidth"),r===D||(r===T||r===k)&&s===W)j=P,b-=(u&&M===L&&L.visualViewport?L.visualViewport.height:M[C])-i.height,b*=l?1:-1;if(r===T||(r===D||r===P)&&s===W)E=k,v-=(u&&M===L&&L.visualViewport?L.visualViewport.width:M[S])-i.width,v*=l?1:-1}var H,q=Object.assign({position:c},p&&K),B=!0===d?function(e,t){var n=e.x,o=e.y,i=t.devicePixelRatio||1;return{x:f(n*i)/i||0,y:f(o*i)/i||0}}({x:v,y:b},o(n)):{x:v,y:b};return v=B.x,b=B.y,l?Object.assign({},q,((H={})[j]=O?"0":"",H[E]=x?"0":"",H.transform=(L.devicePixelRatio||1)<=1?"translate("+v+"px, "+b+"px)":"translate3d("+v+"px, "+b+"px, 0)",H)):Object.assign({},q,((t={})[j]=O?b+"px":"",t[E]=x?v+"px":"",t.transform="",t))}const Z={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,o=e.name,i=n.offset,r=void 0===i?[0,0]:i,s=I.reduce((function(e,n){return e[n]=function(e,t,n){var o=_(e),i=[T,D].indexOf(o)>=0?-1:1,r="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=r[0],a=r[1];return s=s||0,a=(a||0)*i,[T,k].indexOf(o)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,r),e}),{}),a=s[t.placement],c=a.x,f=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=f),t.modifiersData[o]=s}};var ee={left:"right",right:"left",bottom:"top",top:"bottom"};function te(e){return e.replace(/left|right|bottom|top/g,(function(e){return ee[e]}))}var ne={start:"end",end:"start"};function oe(e){return e.replace(/start|end/g,(function(e){return ne[e]}))}function ie(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&s(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function re(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function se(e,t,n){return t===q?re(function(e,t){var n=o(e),i=m(e),r=n.visualViewport,s=i.clientWidth,a=i.clientHeight,c=0,f=0;if(r){s=r.width,a=r.height;var l=p();(l||!l&&"fixed"===t)&&(c=r.offsetLeft,f=r.offsetTop)}return{width:s,height:a,x:c+v(e),y:f}}(e,n)):i(t)?function(e,t){var n=d(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):re(function(e){var t,n=m(e),o=u(e),i=null==(t=e.ownerDocument)?void 0:t.body,r=a(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=a(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),c=-o.scrollLeft+v(e),f=-o.scrollTop;return"rtl"===g(i||n).direction&&(c+=a(n.clientWidth,i?i.clientWidth:0)-r),{width:r,height:s,x:c,y:f}}(m(e)))}function ae(e,t,n,o){var s="clippingParents"===t?function(e){var t=E(x(e)),n=["absolute","fixed"].indexOf(g(e).position)>=0&&r(e)?A(e):e;return i(n)?t.filter((function(e){return i(e)&&ie(e,n)&&"body"!==h(e)})):[]}(e):[].concat(t),f=[].concat(s,[n]),l=f[0],p=f.reduce((function(t,n){var i=se(e,n,o);return t.top=a(i.top,t.top),t.right=c(i.right,t.right),t.bottom=c(i.bottom,t.bottom),t.left=a(i.left,t.left),t}),se(e,l,o));return p.width=p.right-p.left,p.height=p.bottom-p.top,p.x=p.left,p.y=p.top,p}function ce(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function fe(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function le(e,t){void 0===t&&(t={});var n=t,o=n.placement,r=void 0===o?e.placement:o,s=n.strategy,a=void 0===s?e.strategy:s,c=n.boundary,f=void 0===c?H:c,l=n.rootBoundary,p=void 0===l?q:l,u=n.elementContext,h=void 0===u?B:u,v=n.altBoundary,g=void 0!==v&&v,y=n.padding,b=void 0===y?0:y,w=ce("number"!=typeof b?b:fe(b,C)),x=h===B?R:B,O=e.rects.popper,E=e.elements[g?x:h],j=ae(i(E)?E:E.contextElement||m(e.elements.popper),f,p,a),L=d(e.elements.reference),A=G({reference:L,element:O,strategy:"absolute",placement:r}),T=re(Object.assign({},O,A)),M=h===B?T:L,S={top:j.top-M.top+w.top,bottom:M.bottom-j.bottom+w.bottom,left:j.left-M.left+w.left,right:M.right-j.right+w.right},W=e.modifiersData.offset;if(h===B&&W){var V=W[r];Object.keys(S).forEach((function(e){var t=[k,P].indexOf(e)>=0?1:-1,n=[D,P].indexOf(e)>=0?"y":"x";S[e]+=V[n]*t}))}return S}function pe(e,t,n){return a(e,c(t,n))}const de={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name,i=n.mainAxis,r=void 0===i||i,s=n.altAxis,f=void 0!==s&&s,l=n.boundary,p=n.rootBoundary,d=n.altBoundary,u=n.padding,h=n.tether,m=void 0===h||h,v=n.tetherOffset,g=void 0===v?0:v,y=le(t,{boundary:l,rootBoundary:p,padding:u,altBoundary:d}),b=_(t.placement),x=X(t.placement),O=!x,E=Y(b),j="x"===E?"y":"x",L=t.modifiersData.popperOffsets,M=t.rects.reference,C=t.rects.popper,W="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,H="number"==typeof W?{mainAxis:W,altAxis:W}:Object.assign({mainAxis:0,altAxis:0},W),q=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,B={x:0,y:0};if(L){if(r){var R,V="y"===E?D:T,I="y"===E?P:k,$="y"===E?"height":"width",N=L[E],F=N+y[V],U=N-y[I],z=m?-C[$]/2:0,J=x===S?M[$]:C[$],G=x===S?-C[$]:-M[$],K=t.elements.arrow,Q=m&&K?w(K):{width:0,height:0},Z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},ee=Z[V],te=Z[I],ne=pe(0,M[$],Q[$]),oe=O?M[$]/2-z-ne-ee-H.mainAxis:J-ne-ee-H.mainAxis,ie=O?-M[$]/2+z+ne+te+H.mainAxis:G+ne+te+H.mainAxis,re=t.elements.arrow&&A(t.elements.arrow),se=re?"y"===E?re.clientTop||0:re.clientLeft||0:0,ae=null!=(R=null==q?void 0:q[E])?R:0,ce=N+ie-ae,fe=pe(m?c(F,N+oe-ae-se):F,N,m?a(U,ce):U);L[E]=fe,B[E]=fe-N}if(f){var de,ue="x"===E?D:T,he="x"===E?P:k,me=L[j],ve="y"===j?"height":"width",ge=me+y[ue],ye=me-y[he],be=-1!==[D,T].indexOf(b),we=null!=(de=null==q?void 0:q[j])?de:0,xe=be?ge:me-M[ve]-C[ve]-we+H.altAxis,Oe=be?me+M[ve]+C[ve]-we-H.altAxis:ye,Ee=m&&be?function(e,t,n){var o=pe(e,t,n);return o>n?n:o}(xe,me,Oe):pe(m?xe:ge,me,m?Oe:ye);L[j]=Ee,B[j]=Ee-me}t.modifiersData[o]=B}},requiresIfExists:["offset"]};const ue={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,o=e.name,i=e.options,r=n.elements.arrow,s=n.modifiersData.popperOffsets,a=_(n.placement),c=Y(a),f=[T,k].indexOf(a)>=0?"height":"width";if(r&&s){var l=function(e,t){return ce("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:fe(e,C))}(i.padding,n),p=w(r),d="y"===c?D:T,u="y"===c?P:k,h=n.rects.reference[f]+n.rects.reference[c]-s[c]-n.rects.popper[f],m=s[c]-n.rects.reference[c],v=A(r),g=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=h/2-m/2,b=l[d],x=g-p[f]-l[u],O=g/2-p[f]/2+y,E=pe(b,O,x),j=c;n.modifiersData[o]=((t={})[j]=E,t.centerOffset=E-O,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)))&&ie(t.elements.popper,o)&&(t.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function he(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 me(e){return[D,k,P,T].some((function(t){return e[t]>=0}))}var ve=z({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,i=e.options,r=i.scroll,s=void 0===r||r,a=i.resize,c=void 0===a||a,f=o(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&l.forEach((function(e){e.addEventListener("scroll",n.update,J)})),c&&f.addEventListener("resize",n.update,J),function(){s&&l.forEach((function(e){e.removeEventListener("scroll",n.update,J)})),c&&f.removeEventListener("resize",n.update,J)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=G({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,o=n.gpuAcceleration,i=void 0===o||o,r=n.adaptive,s=void 0===r||r,a=n.roundOffsets,c=void 0===a||a,f={placement:_(t.placement),variation:X(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Q(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Q(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:{}},{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]||{},i=t.elements[e];r(i)&&h(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?i.removeAttribute(e):i.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],i=t.attributes[e]||{},s=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});r(o)&&h(o)&&(Object.assign(o.style,s),Object.keys(i).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]},Z,{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var i=n.mainAxis,r=void 0===i||i,s=n.altAxis,a=void 0===s||s,c=n.fallbackPlacements,f=n.padding,l=n.boundary,p=n.rootBoundary,d=n.altBoundary,u=n.flipVariations,h=void 0===u||u,m=n.allowedAutoPlacements,v=t.options.placement,g=_(v),y=c||(g===v||!h?[te(v)]:function(e){if(_(e)===M)return[];var t=te(e);return[oe(e),t,oe(t)]}(v)),b=[v].concat(y).reduce((function(e,n){return e.concat(_(n)===M?function(e,t){void 0===t&&(t={});var n=t,o=n.placement,i=n.boundary,r=n.rootBoundary,s=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,f=void 0===c?I:c,l=X(o),p=l?a?V:V.filter((function(e){return X(e)===l})):C,d=p.filter((function(e){return f.indexOf(e)>=0}));0===d.length&&(d=p);var u=d.reduce((function(t,n){return t[n]=le(e,{placement:n,boundary:i,rootBoundary:r,padding:s})[_(n)],t}),{});return Object.keys(u).sort((function(e,t){return u[e]-u[t]}))}(t,{placement:n,boundary:l,rootBoundary:p,padding:f,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,x=t.rects.popper,O=new Map,E=!0,j=b[0],L=0;L=0,B=q?"width":"height",R=le(t,{placement:A,boundary:l,rootBoundary:p,altBoundary:d,padding:f}),$=q?H?k:T:H?P:D;w[B]>x[B]&&($=te($));var N=te($),F=[];if(r&&F.push(R[W]<=0),a&&F.push(R[$]<=0,R[N]<=0),F.every((function(e){return e}))){j=A,E=!1;break}O.set(A,F)}if(E)for(var U=function(e){var t=b.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return j=t,"break"},z=h?3:1;z>0;z--){if("break"===U(z))break}t.placement!==j&&(t.modifiersData[o]._skip=!0,t.placement=j,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},de,ue,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,o=t.rects.reference,i=t.rects.popper,r=t.modifiersData.preventOverflow,s=le(t,{elementContext:"reference"}),a=le(t,{altBoundary:!0}),c=he(s,o),f=he(a,i,r),l=me(c),p=me(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})}}]})},189:(e,t,n)=>{n.d(t,{lP:()=>o});const o={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"}},615:(e,t,n)=>{n.d(t,{A:()=>o});class o{constructor(e,t,n){this.el=e,this.options=t,this.events=n,this.el=e,this.options=t,this.events={}}createCollection(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})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},926:(e,t,n)=>{n.d(t,{JD:()=>i,gj:()=>o,yd:()=>r}); +/* + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +const o=(e,t,n="")=>(window.getComputedStyle(e).getPropertyValue(t)||n).replace(" ","");const i=(e,t,n=null)=>{const o=new CustomEvent(e,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(o)},r=(e,t)=>{const n=()=>{t(),e.removeEventListener("transitionend",n,!0)},o=window.getComputedStyle(e),i=o.getPropertyValue("transition-duration");"none"!==o.getPropertyValue("transition-property")&&parseFloat(i)>0?e.addEventListener("transitionend",n,!0):t()}}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}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);var o={};n.d(o,{A:()=>f});var i=n(316),r=n(926),s=n(615),a=n(189); +/* + * HSTooltip + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class c extends s.A{constructor(e,t,n){super(e,t,n),this.el&&(this.toggle=this.el.querySelector(".hs-tooltip-toggle")||this.el,this.content=this.el.querySelector(".hs-tooltip-content"),this.eventMode=(0,r.gj)(this.el,"--trigger")||"hover",this.preventPopper=(0,r.gj)(this.el,"--prevent-popper","false"),this.placement=(0,r.gj)(this.el,"--placement"),this.strategy=(0,r.gj)(this.el,"--strategy")),this.el&&this.toggle&&this.content&&this.init()}init(){this.createCollection(window.$hsTooltipCollection,this),"click"===this.eventMode?this.toggle.addEventListener("click",(()=>this.click())):"focus"===this.eventMode?this.toggle.addEventListener("click",(()=>this.focus())):"hover"===this.eventMode&&(this.toggle.addEventListener("mouseenter",(()=>this.enter())),this.toggle.addEventListener("mouseleave",(()=>this.leave()))),"false"===this.preventPopper&&this.buildPopper()}enter(){this.show()}leave(){this.hide()}click(){if(this.el.classList.contains("show"))return!1;this.show();const e=()=>{setTimeout((()=>{this.hide(),this.toggle.removeEventListener("click",e,!0),this.toggle.removeEventListener("blur",e,!0)}))};this.toggle.addEventListener("click",e,!0),this.toggle.addEventListener("blur",e,!0)}focus(){this.show();const e=()=>{this.hide(),this.toggle.removeEventListener("blur",e,!0)};this.toggle.addEventListener("blur",e,!0)}buildPopper(){this.popperInstance=(0,i.n4)(this.toggle,this.content,{placement:a.lP[this.placement]||"top",strategy:this.strategy||"fixed",modifiers:[{name:"offset",options:{offset:[0,5]}}]})}show(){this.content.classList.remove("hidden"),"false"===this.preventPopper&&(this.popperInstance.setOptions((e=>Object.assign(Object.assign({},e),{modifiers:[...e.modifiers,{name:"eventListeners",enabled:!0}]}))),this.popperInstance.update()),setTimeout((()=>{this.el.classList.add("show"),this.fireEvent("show",this.el),(0,r.JD)("show.hs.tooltip",this.el,this.el)}))}hide(){this.el.classList.remove("show"),"false"===this.preventPopper&&this.popperInstance.setOptions((e=>Object.assign(Object.assign({},e),{modifiers:[...e.modifiers,{name:"eventListeners",enabled:!1}]}))),this.fireEvent("hide",this.el),(0,r.JD)("hide.hs.tooltip",this.el,this.el),(0,r.yd)(this.content,(()=>{if(this.el.classList.contains("show"))return!1;this.content.classList.add("hidden")}))}static getInstance(e,t=!1){const n=window.$hsTooltipCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return n?t?n:n.element.el:null}static autoInit(){window.$hsTooltipCollection||(window.$hsTooltipCollection=[]),document.querySelectorAll(".hs-tooltip").forEach((e=>{window.$hsTooltipCollection.find((t=>{var n;return(null===(n=null==t?void 0:t.element)||void 0===n?void 0:n.el)===e}))||new c(e)}))}static show(e){const t=window.$hsTooltipCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));if(t)switch(t.element.eventMode){case"click":t.element.click();break;case"focus":t.element.focus();break;default:t.element.enter()}}static hide(e){const t=window.$hsTooltipCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));t&&t.element.hide()}static on(e,t,n){const o=window.$hsTooltipCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));o&&(o.element.events[e]=n)}}window.addEventListener("load",(()=>{c.autoInit()})),"undefined"!=typeof window&&(window.HSTooltip=c);const f=c;var l=o.A;export{l as default}; \ No newline at end of file diff --git a/dist/tree-view.d.ts b/dist/tree-view.d.ts new file mode 100644 index 0000000..f1eea66 --- /dev/null +++ b/dist/tree-view.d.ts @@ -0,0 +1,65 @@ +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 type ITreeViewOptionsControlBy = "checkbox" | "button"; +export interface ITreeViewItem { + id: string; + value: string; + isDir: boolean; + path: string; + isSelected?: boolean; +} +export interface ITreeViewOptions { + items: ITreeViewItem[] | null; + controlBy?: ITreeViewOptionsControlBy; + autoSelectChildren?: boolean; + isIndeterminate?: boolean; +} +export interface ITreeView { + options?: ITreeViewOptions; +} +declare class HSTreeView extends HSBasePlugin implements ITreeView { + private items; + private readonly controlBy; + private readonly autoSelectChildren; + private readonly isIndeterminate; + static group: number; + constructor(el: HTMLElement, options?: ITreeViewOptions, events?: {}); + private init; + private initItems; + private controlByButton; + private controlByCheckbox; + private getItem; + private getPath; + private unselectItem; + private selectItem; + private selectChildren; + private toggleParent; + update(): void; + getSelectedItems(): ITreeViewItem[]; + changeItemProp(id: string, prop: string, val: any): void; + static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem; + static autoInit(): void; + static on(evt: string, target: HTMLElement, cb: Function): void; +} + +export { + HSTreeView as default, +}; + +export {}; diff --git a/dist/tree-view.js b/dist/tree-view.js new file mode 100644 index 0000000..6265c28 --- /dev/null +++ b/dist/tree-view.js @@ -0,0 +1,16 @@ +!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 i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(self,(()=>(()=>{"use strict";var e={961:(e,t)=>{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},772:function(e,t,n){ +/* + * HSTreeView + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +var i,o=this&&this.__extends||(i=function(e,t){return i=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])},i(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}i(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,i=arguments.length;n0&&ct&&(t=n)})),t};t.stringToBoolean=function(e){return"true"===e};t.getClassProperty=function(e,t,n){return void 0===n&&(n=""),(window.getComputedStyle(e).getPropertyValue(t)||n).replace(" ","")};t.getClassPropertyAlt=function(e,t,n){void 0===n&&(n="");var i="";return e.classList.forEach((function(e){e.includes(t)&&(i=e)})),i.match(/:(.*)]/)?i.match(/:(.*)]/)[1]:n};var i=function(e){return window.getComputedStyle(e).getPropertyValue("z-index")};t.getZIndex=i;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.isDirectChild=function(e,t){for(var n=e.children,i=0;i=u:"top"===n?c>=u:c>=u||l>=u};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 i;return void 0===t&&(t=200),function(){for(var o=[],r=0;r0?e.addEventListener("transitionend",n,!0):t()};t.htmlToElement=function(e){var t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild};t.classToClassList=function(e,t,n,i){void 0===n&&(n=" "),void 0===i&&(i="add"),e.split(n).forEach((function(e){return"add"===i?t.classList.add(e):t.classList.remove(e)}))};t.menuSearchHistory={historyIndex:-1,addHistory:function(e){this.historyIndex=e},existsInHistory:function(e){return e>this.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},t={};var n=function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i].call(r.exports,r,r.exports,n),r.exports}(772);return n})())); \ No newline at end of file diff --git a/dist/tree-view.mjs b/dist/tree-view.mjs new file mode 100644 index 0000000..2ea3064 --- /dev/null +++ b/dist/tree-view.mjs @@ -0,0 +1,9 @@ +var e={615:(e,t,i)=>{i.d(t,{A:()=>s});class s{constructor(e,t,i){this.el=e,this.options=t,this.events=i,this.el=e,this.options=t,this.events={}}createCollection(e,t){var i;e.push({id:(null===(i=null==t?void 0:t.el)||void 0===i?void 0:i.id)||e.length+1,element:t})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},926:(e,t,i)=>{i.d(t,{JD:()=>s});const s=(e,t,i=null)=>{const s=new CustomEvent(e,{detail:{payload:i},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(s)}}},t={};function i(s){var n=t[s];if(void 0!==n)return n.exports;var l=t[s]={exports:{}};return e[s](l,l.exports,i),l.exports}i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var s={};i.d(s,{A:()=>r});var n=i(926),l=i(615); +/* + * HSTreeView + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +class o extends l.A{constructor(e,t,i){super(e,t,i),this.items=[];const s=e.getAttribute("data-hs-tree-view"),n=s?JSON.parse(s):{},l=Object.assign(Object.assign({},n),t);this.controlBy=(null==l?void 0:l.controlBy)||"button",this.autoSelectChildren=(null==l?void 0:l.autoSelectChildren)||!1,this.isIndeterminate=(null==l?void 0:l.isIndeterminate)||!0,this.init()}init(){this.createCollection(window.$hsTreeViewCollection,this),o.group+=1,this.initItems()}initItems(){this.el.querySelectorAll("[data-hs-tree-view-item]").forEach(((e,t)=>{var i,s;const n=JSON.parse(e.getAttribute("data-hs-tree-view-item"));e.id||(e.id=`tree-view-item-${o.group}-${t}`);const l=Object.assign(Object.assign({},n),{id:null!==(i=n.id)&&void 0!==i?i:e.id,path:this.getPath(e),isSelected:null!==(s=n.isSelected)&&void 0!==s&&s});this.items.push(l),"checkbox"===this.controlBy?this.controlByCheckbox(e,l):this.controlByButton(e,l)}))}controlByButton(e,t){e.addEventListener("click",(i=>{if(i.stopPropagation(),e.classList.contains("disabled"))return!1;i.metaKey||i.shiftKey||this.unselectItem(t),this.selectItem(e,t),this.fireEvent("click",{el:e,data:t}),(0,n.JD)("click.hs.treeView",this.el,{el:e,data:t})}))}controlByCheckbox(e,t){const i=e.querySelector(`input[value="${t.value}"]`);i&&i.addEventListener("change",(()=>{this.autoSelectChildren?(this.selectItem(e,t),t.isDir&&this.selectChildren(e,t),this.toggleParent(e)):this.selectItem(e,t)}))}getItem(e){return this.items.find((t=>t.id===e))}getPath(e){var t;const i=[];let s=e.closest("[data-hs-tree-view-item]");for(;s;){const e=JSON.parse(s.getAttribute("data-hs-tree-view-item"));i.push(e.value),s=null===(t=s.parentElement)||void 0===t?void 0:t.closest("[data-hs-tree-view-item]")}return i.reverse().join("/")}unselectItem(e=null){let t=this.getSelectedItems();e&&(t=t.filter((t=>t.id!==e.id))),t.length&&t.forEach((e=>{document.querySelector(`#${e.id}`).classList.remove("selected"),this.changeItemProp(e.id,"isSelected",!1)}))}selectItem(e,t){t.isSelected?(e.classList.remove("selected"),this.changeItemProp(t.id,"isSelected",!1)):(e.classList.add("selected"),this.changeItemProp(t.id,"isSelected",!0))}selectChildren(e,t){const i=e.querySelectorAll("[data-hs-tree-view-item]");Array.from(i).filter((e=>!e.classList.contains("disabled"))).forEach((e=>{const i=e.id?this.getItem(e.id):null;if(!i)return!1;t.isSelected?(e.classList.add("selected"),this.changeItemProp(i.id,"isSelected",!0)):(e.classList.remove("selected"),this.changeItemProp(i.id,"isSelected",!1));const s=this.getItem(e.id),n=e.querySelector(`input[value="${s.value}"]`);this.isIndeterminate&&(n.indeterminate=!1),s.isSelected?n.checked=!0:n.checked=!1}))}toggleParent(e){var t,i;let s=null===(t=e.parentElement)||void 0===t?void 0:t.closest("[data-hs-tree-view-item]");for(;s;){const e=s.querySelectorAll("[data-hs-tree-view-item]:not(.disabled)"),t=JSON.parse(s.getAttribute("data-hs-tree-view-item")),n=s.querySelector(`input[value="${t.value}"]`);let l=!1,o=0;e.forEach((e=>{const t=this.getItem(e.id);t.isSelected&&(o+=1),t.isSelected||(l=!0)})),l?(s.classList.remove("selected"),this.changeItemProp(s.id,"isSelected",!1),n.checked=!1):(s.classList.add("selected"),this.changeItemProp(s.id,"isSelected",!0),n.checked=!0),this.isIndeterminate&&(o>0&&o{const t=document.querySelector(`#${e.id}`);return e.path!==this.getPath(t)&&(e.path=this.getPath(t)),e}))}getSelectedItems(){return this.items.filter((e=>e.isSelected))}changeItemProp(e,t,i){this.items.map((s=>(s.id===e&&(s[t]=i),s)))}static getInstance(e,t){const i=window.$hsTreeViewCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element.el:null}static autoInit(){window.$hsTreeViewCollection||(window.$hsTreeViewCollection=[]),document.querySelectorAll("[data-hs-tree-view]:not(.--prevent-on-load-init)").forEach((e=>{window.$hsTreeViewCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))||new o(e)}))}static on(e,t,i){const s=window.$hsTreeViewCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));s&&(s.element.events[e]=i)}}o.group=0,window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSTreeView=o);const r=o;var c=s.A;export{c as default}; \ No newline at end of file diff --git a/dts-config.js b/dts-config.js index 93919e1..366b482 100644 --- a/dts-config.js +++ b/dts-config.js @@ -1,8 +1,9 @@ const fs = require('fs'); const pluginsDir = './src/plugins'; +const helpersDir = './src/helpers'; const distDir = './dist'; -const excludePlugins = ['base-plugin']; +const excludePlugins = ['base-plugin', 'docs-scrollspy']; const outputConfig = { noBanner: true }; @@ -18,22 +19,28 @@ const config = { }, ...fs .readdirSync(pluginsDir) - .map((pluginName) => { - if ( - !fs.lstatSync(`${pluginsDir}/${pluginName}`).isDirectory() || - excludePlugins.includes(pluginName) - ) { - return null; - } - - return { - filePath: `${pluginsDir}/${pluginName}/index.ts`, - outFile: `${distDir}/${pluginName}.d.ts`, - output: outputConfig, - }; - }) + .map((pluginName) => writeFile(pluginsDir, pluginName)) + .filter(Boolean), + ...fs + .readdirSync(helpersDir) + .map((pluginName) => writeFile(helpersDir, pluginName, 'helper-')) .filter(Boolean), ], }; +function writeFile(dir, plugin, prefix = '') { + if ( + !fs.lstatSync(`${dir}/${plugin}`).isDirectory() || + excludePlugins.includes(plugin) + ) { + return null; + } + + return { + filePath: `${dir}/${plugin}/index.ts`, + outFile: `${distDir}/${prefix}${plugin}.d.ts`, + output: outputConfig, + }; +} + module.exports = config; diff --git a/global.d.ts b/global.d.ts new file mode 100644 index 0000000..54e2ba2 --- /dev/null +++ b/global.d.ts @@ -0,0 +1,74 @@ +import type INoUiSlider from 'nouislider'; + +import { ICollectionItem } from './src/interfaces'; + +import { IStaticMethods } from './src/static/interfaces'; + +import type HSCopyMarkup from './src/plugins/copy-markup'; +import type HSAccordion from './src/plugins/accordion'; +import type HSCarousel from './src/plugins/carousel'; +import type HSCollapse from './src/plugins/collapse'; +import type HSComboBox from './src/plugins/combobox'; +import type HSDataTable from './src/plugins/datatable'; +import type HSDropdown from './src/plugins/dropdown'; +import type HSFileUpload from './src/plugins/file-upload'; +import type HSInputNumber from './src/plugins/input-number'; +import type HSOverlay from './src/plugins/overlay'; +import type HSPinInput from './src/plugins/pin-input'; +import type HSRangeSlider from './src/plugins/range-slider'; +import type HSRemoveElement from './src/plugins/remove-element'; +import type HSScrollspy from './src/plugins/scrollspy'; +import type HSSelect from './src/plugins/select'; +import type HSStepper from './src/plugins/stepper'; +import type HSStrongPassword from './src/plugins/strong-password'; +import type HSTabs from './src/plugins/tabs'; +import type HSTextareaAutoHeight from './src/plugins/textarea-auto-height'; +import type HSThemeSwitch from './src/plugins/theme-switch'; +import type HSToggleCount from './src/plugins/toggle-count'; +import type HSTogglePassword from './src/plugins/toggle-password'; +import type HSTooltip from './src/plugins/tooltip'; +import type HSTreeView from './src/plugins/tree-view'; + +declare global { + var noUiSlider: typeof INoUiSlider; + var Popper: { + createPopper: ( + referenceEl: Element, + popperEl: HTMLElement, + options?: any, + ) => any; + }; + + interface Window { + HS_CLIPBOARD_SELECTOR: string; + + HSStaticMethods: IStaticMethods; + + $hsCopyMarkupCollection: ICollectionItem[]; + $hsAccordionCollection: ICollectionItem[]; + $hsCarouselCollection: ICollectionItem[]; + $hsCollapseCollection: ICollectionItem[]; + $hsComboBoxCollection: ICollectionItem[]; + $hsDataTableCollection: ICollectionItem[]; + $hsDropdownCollection: ICollectionItem[]; + $hsFileUploadCollection: ICollectionItem[]; + $hsInputNumberCollection: { id: number; element: HSInputNumber }[]; + $hsOverlayCollection: ICollectionItem[]; + $hsPinInputCollection: ICollectionItem[]; + $hsRemoveElementCollection: ICollectionItem[]; + $hsRangeSliderCollection: ICollectionItem[]; + $hsScrollspyCollection: ICollectionItem[]; + $hsSelectCollection: ICollectionItem[]; + $hsStepperCollection: ICollectionItem[]; + $hsStrongPasswordCollection: ICollectionItem[]; + $hsTabsCollection: ICollectionItem[]; + $hsTextareaAutoHeightCollection: ICollectionItem[]; + $hsThemeSwitchCollection: ICollectionItem[]; + $hsToggleCountCollection: ICollectionItem[]; + $hsTogglePasswordCollection: ICollectionItem[]; + $hsTooltipCollection: ICollectionItem[]; + $hsTreeViewCollection: ICollectionItem[]; + } +} + +export {}; diff --git a/index.d.ts b/index.d.ts index 3fd3f92..96d2c9e 100644 --- a/index.d.ts +++ b/index.d.ts @@ -58,13 +58,14 @@ export interface IAccordion { export declare class HSAccordion extends HSBasePlugin implements IAccordion { private readonly toggle; content: HTMLElement | null; - private readonly group; - private readonly isAlwaysOpened; + private group; + private isAlwaysOpened; static selectable: IAccordionTreeView[]; constructor(el: HTMLElement, options?: IAccordionOptions, events?: {}); private init; show(): boolean; hide(): boolean; + update(): boolean; static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem; static show(target: HTMLElement): void; static hide(target: HTMLElement): void; @@ -73,13 +74,24 @@ export declare class HSAccordion extends HSBasePlugin impleme static toggleSelected(root: IAccordionTreeView, item: HTMLElement): void; static on(evt: string, target: HTMLElement, cb: Function): void; } +export type TCarouselOptionsSlidesQty = { + [key: string]: number; +}; export interface ICarouselOptions { currentIndex: number; loadingClasses?: string | string[]; + dotsItemClasses?: string; + isAutoHeight?: boolean; isAutoPlay?: boolean; - speed?: number; + isCentered?: boolean; + isDraggable?: boolean; isInfiniteLoop?: boolean; isRTL?: boolean; + isSnap?: boolean; + hasSnapSpacers?: boolean; + slidesQty?: TCarouselOptionsSlidesQty | number; + speed?: number; + updateDelay?: number; } export interface ICarousel { options?: ICarouselOptions; @@ -89,28 +101,69 @@ export interface ICarousel { goTo(i: number): void; } export declare class HSCarousel extends HSBasePlugin implements ICarousel { + private currentIndex; + private readonly loadingClasses; + private readonly dotsItemClasses; + private readonly isAutoHeight; + private readonly isAutoPlay; + private readonly isCentered; + private readonly isDraggable; + private readonly isInfiniteLoop; + private readonly isRTL; + private readonly isSnap; + private readonly hasSnapSpacers; + private readonly slidesQty; + private readonly speed; + private readonly updateDelay; + private readonly loadingClassesRemove; + private readonly loadingClassesAdd; + private readonly afterLoadingClassesAdd; + private readonly container; private readonly inner; private readonly slides; private readonly prev; private readonly next; private readonly dots; + private dotsItems; + private readonly info; + private readonly infoTotal; + private readonly infoCurrent; private sliderWidth; - private currentIndex; - private readonly loadingClasses; - private readonly loadingClassesRemove; - private readonly loadingClassesAdd; - private readonly afterLoadingClassesAdd; - private readonly isAutoPlay; - private readonly isRTL; - private readonly speed; - private readonly isInfiniteLoop; private timer; + private isScrolling; + private isDragging; + private dragStartX; + private initialTranslateX; private readonly touchX; + private resizeContainer; + resizeContainerWidth: number; constructor(el: HTMLElement, options?: ICarouselOptions); + private setIsSnap; private init; + private initDragHandling; + private getTranslateXValue; + private removeClickEventWhileDragging; + private handleDragStart; + private handleDragMove; + private handleDragEnd; + private getEventX; + private getCurrentSlidesQty; + private buildSnapSpacers; + private initDots; + private buildDots; + private setDots; + private goToCurrentDot; + private buildInfo; + private setInfoTotal; + private setInfoCurrent; + private buildSingleDot; + private singleDotEvents; private observeResize; private calculateWidth; private addCurrentClass; + private setCurrentDot; + private setElementToDisabled; + private unsetElementToDisabled; private addDisabledClass; private autoPlay; private setTimer; @@ -118,9 +171,11 @@ export declare class HSCarousel extends HSBasePlugin implement private detectDirection; recalculateWidth(): void; private calculateTransform; + private setTranslate; goToPrev(): void; goToNext(): void; goTo(i: number): void; + private setIndex; static getInstance(target: HTMLElement | string, isInstance?: boolean): HSCarousel | ICollectionItem; static autoInit(): void; } @@ -341,6 +396,7 @@ export interface IOverlayOptions { isClosePrev?: boolean; backdropClasses?: string | null; backdropExtraClasses?: string | null; + moveOverlayToBody?: number | null; } export interface IOverlay { options?: IOverlayOptions; @@ -358,6 +414,7 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private autoHide; private readonly overlayId; overlay: HTMLElement | null; + initContainer: HTMLElement | null; isCloseWhenClickInside: boolean; isTabAccessibilityLimited: boolean; isLayoutAffect: boolean; @@ -365,6 +422,7 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { hasAbilityToCloseOnBackdropClick: boolean; openedBreakpoint: number | null; autoClose: number | null; + moveOverlayToBody: number | null; constructor(el: HTMLElement, options?: IOverlayOptions, events?: {}); private init; private hideAuto; @@ -457,6 +515,13 @@ export interface ISingleOption { selected?: boolean; options?: ISingleOptionOptions | null; } +export interface IApiFieldMap { + id: string; + title: string; + icon?: string | null; + description?: string | null; + [key: string]: unknown; +} export interface ISelectOptions { value?: string | string[]; isOpened?: boolean; @@ -466,6 +531,13 @@ export interface ISelectOptions { mode?: string; viewport?: string; wrapperClasses?: string; + apiUrl?: string | null; + apiQuery?: string | null; + apiOptions?: RequestInit | null; + apiDataPart?: string | null; + apiSearchQueryKey?: string | null; + apiFieldsMap?: IApiFieldMap | null; + apiIconTag?: string | null; toggleTag?: string; toggleClasses?: string; toggleSeparators?: { @@ -477,6 +549,7 @@ export interface ISelectOptions { toggleCountTextMode?: string; tagsItemTemplate?: string; tagsItemClasses?: string; + tagsInputId?: string; tagsInputClasses?: string; dropdownTag?: string; dropdownClasses?: string; @@ -485,11 +558,18 @@ export interface ISelectOptions { bottom?: string; }; dropdownSpace: number; + dropdownPlacement: string | null; + dropdownScope: "window" | "parent"; extraMarkup?: string | string[] | null; + searchTemplate?: string; searchWrapperTemplate?: string; + searchId?: string; + searchLimit?: number | typeof Infinity; + isSearchDirectMatch?: boolean; searchClasses?: string; searchWrapperClasses?: string; searchPlaceholder?: string; + searchNoResultTemplate?: string | null; searchNoResultText?: string | null; searchNoResultClasses?: string | null; optionTemplate?: string; @@ -519,6 +599,13 @@ export declare class HSSelect extends HSBasePlugin implements IS isMultiple: boolean | null; isDisabled: boolean | null; selectedItems: string[]; + private readonly apiUrl; + private readonly apiQuery; + private readonly apiOptions; + private readonly apiDataPart; + private readonly apiSearchQueryKey; + private readonly apiFieldsMap; + private readonly apiIconTag; private readonly toggleTag; private readonly toggleClasses; private readonly toggleSeparators; @@ -528,15 +615,23 @@ export declare class HSSelect extends HSBasePlugin implements IS private readonly wrapperClasses; private readonly tagsItemTemplate; private readonly tagsItemClasses; + private readonly tagsInputId; private readonly tagsInputClasses; private readonly dropdownTag; private readonly dropdownClasses; private readonly dropdownDirectionClasses; dropdownSpace: number | null; + readonly dropdownPlacement: string | null; + readonly dropdownScope: "window" | "parent"; + private readonly searchTemplate; private readonly searchWrapperTemplate; private readonly searchPlaceholder; + private readonly searchId; + private readonly searchLimit; + private readonly isSearchDirectMatch; private readonly searchClasses; private readonly searchWrapperClasses; + private readonly searchNoResultTemplate; private readonly searchNoResultText; private readonly searchNoResultClasses; private readonly optionTag; @@ -550,6 +645,7 @@ export declare class HSSelect extends HSBasePlugin implements IS private toggleTextWrapper; private tagsInput; private dropdown; + private popperInstance; private searchWrapper; private search; private searchNoResult; @@ -557,6 +653,8 @@ export declare class HSSelect extends HSBasePlugin implements IS private extraMarkup; private readonly isAddTagOnEnter; private tagsInputHelper; + private remoteOptions; + private optionId; constructor(el: HTMLElement, options?: ISelectOptions); setValue(val: string | string[]): void; private init; @@ -573,8 +671,16 @@ export declare class HSSelect extends HSBasePlugin implements IS private setTagsItems; private buildTagsInput; private buildDropdown; + private buildPopper; + private updateDropdownWidth; private buildSearch; private buildOption; + private buildOptionFromRemoteData; + private buildOptionsFromRemoteData; + private optionsFromRemoteData; + private apiRequest; + private sortElements; + private remoteSearch; private destroyOption; private buildOriginalOption; private destroyOriginalOption; @@ -588,6 +694,8 @@ export declare class HSSelect extends HSBasePlugin implements IS private resetTagsInputField; private clearSelections; private setNewValue; + private stringFromValueBasic; + private stringFromValueRemoteData; private stringFromValue; private selectSingleItem; private selectMultipleItems; @@ -595,6 +703,7 @@ export declare class HSSelect extends HSBasePlugin implements IS private searchOptions; private eraseToggleIcon; private eraseToggleTitle; + private toggleFn; destroy(): void; open(): boolean; close(): boolean; @@ -774,6 +883,25 @@ export declare class HSTabs extends HSBasePlugin<{}> implements ITabs { static onStartEnd(isOpposite?: boolean): void; static on(evt: string, target: HTMLElement, cb: Function): void; } +export interface ITextareaAutoHeightOptions { + defaultHeight: number; +} +export interface ITextareaAutoHeight { + options?: ITextareaAutoHeightOptions; +} +export declare class HSTextareaAutoHeight extends HSBasePlugin implements ITextareaAutoHeight { + private readonly defaultHeight; + constructor(el: HTMLTextAreaElement, options?: ITextareaAutoHeightOptions); + private init; + private setAutoHeight; + private textareaSetHeight; + private checkIfOneLine; + private isParentHidden; + private parentType; + private callbackAccordingToType; + static getInstance(target: HTMLTextAreaElement | string, isInstance?: boolean): HSTextareaAutoHeight | ICollectionItem; + static autoInit(): void; +} export interface IThemeSwitchOptions { theme?: "dark" | "light" | "default"; } @@ -868,6 +996,47 @@ export declare class HSTooltip extends HSBasePlugin<{}> implements ITooltip { static hide(target: HTMLElement): void; static on(evt: string, target: HTMLElement, cb: Function): void; } +export type ITreeViewOptionsControlBy = "checkbox" | "button"; +export interface ITreeViewItem { + id: string; + value: string; + isDir: boolean; + path: string; + isSelected?: boolean; +} +export interface ITreeViewOptions { + items: ITreeViewItem[] | null; + controlBy?: ITreeViewOptionsControlBy; + autoSelectChildren?: boolean; + isIndeterminate?: boolean; +} +export interface ITreeView { + options?: ITreeViewOptions; +} +export declare class HSTreeView extends HSBasePlugin implements ITreeView { + private items; + private readonly controlBy; + private readonly autoSelectChildren; + private readonly isIndeterminate; + static group: number; + constructor(el: HTMLElement, options?: ITreeViewOptions, events?: {}); + private init; + private initItems; + private controlByButton; + private controlByCheckbox; + private getItem; + private getPath; + private unselectItem; + private selectItem; + private selectChildren; + private toggleParent; + update(): void; + getSelectedItems(): ITreeViewItem[]; + changeItemProp(id: string, prop: string, val: any): void; + static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem; + static autoInit(): void; + static on(evt: string, target: HTMLElement, cb: Function): void; +} export interface IStaticMethods { getClassProperty(el: HTMLElement, prop?: string, val?: string): string; afterTransition(el: HTMLElement, cb: Function): void; @@ -877,10 +1046,12 @@ export interface IStaticMethods { export declare const HSStaticMethods: IStaticMethods; declare let HSDataTableModule: any; declare let HSFileUploadModule: any; +declare let HSRangeSliderModule: any; export { HSDataTableModule as HSDataTable, HSFileUploadModule as HSFileUpload, + HSRangeSliderModule as HSRangeSlider, }; export {}; diff --git a/index.js b/index.js index 3e4f2f8..cb4963a 100644 --- a/index.js +++ b/index.js @@ -1,177 +1,214 @@ -!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={170:(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:()=>g,beforeWrite:()=>x,bottom:()=>i,clippingParents:()=>d,computeStyles:()=>nt,createPopper:()=>Pt,createPopperBase:()=>kt,createPopperLite:()=>Bt,detectOverflow:()=>yt,end:()=>u,eventListeners:()=>it,flip:()=>wt,hide:()=>St,left:()=>s,main:()=>C,modifierPhases:()=>E,offset:()=>xt,placements:()=>m,popper:()=>h,popperGenerator:()=>_t,popperOffsets:()=>It,preventOverflow:()=>Tt,read:()=>y,reference:()=>f,right:()=>r,start:()=>c,top:()=>o,variationPlacements:()=>v,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",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])}),[]),g="beforeRead",y="read",w="afterRead",b="beforeMain",C="main",S="afterMain",x="beforeWrite",I="write",T="afterWrite",E=[g,y,w,b,C,S,x,I,T];function L(t){return t?(t.nodeName||"").toLowerCase():null}function O(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 O(t).Element||t instanceof Element}function _(t){return t instanceof O(t).HTMLElement||t instanceof HTMLElement}function k(t){return"undefined"!=typeof ShadowRoot&&(t instanceof O(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)&&L(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)&&L(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,H=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 M(){return!/^((?!chrome|android).)*safari/i.test(D())}function j(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&&H(o.width)/t.offsetWidth||1,r=t.offsetHeight>0&&H(o.height)/t.offsetHeight||1);var s=(A(t)?O(t):window).visualViewport,l=!M()&&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 $(t){var e=j(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 V(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 R(t){return O(t).getComputedStyle(t)}function F(t){return["table","td","th"].indexOf(L(t))>=0}function W(t){return((A(t)?t.ownerDocument:t.document)||window.document).documentElement}function z(t){return"html"===L(t)?t:t.assignedSlot||t.parentNode||(k(t)?t.host:null)||W(t)}function U(t){return _(t)&&"fixed"!==R(t).position?t.offsetParent:null}function J(t){for(var e=O(t),n=U(t);n&&F(n)&&"static"===R(n).position;)n=U(n);return n&&("html"===L(n)||"body"===L(n)&&"static"===R(n).position)?e:n||function(t){var e=/firefox/i.test(D());if(/Trident/i.test(D())&&_(t)&&"fixed"===R(t).position)return null;var n=z(t);for(k(n)&&(n=n.host);_(n)&&["html","body"].indexOf(L(n))<0;){var o=R(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 Y(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Z(t,e,n){return q(t,N(e,n))}function K(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function G(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=Y(p),f=[s,r].indexOf(p)>=0?"height":"width";if(u&&d){var v=function(t,e){return K("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:G(t,a))}(c.padding,n),m=$(u),g="y"===h?o:s,y="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,x=w/2-b/2,I=v[g],T=S-m[f]-v[y],E=S/2-m[f]/2+x,L=Z(I,E,T),O=h;n.modifiersData[l]=((e={})[O]=L,e.centerOffset=L-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)))&&V(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function X(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,g=d.x,y=void 0===g?0:g,w=d.y,b=void 0===w?0:w,C="function"==typeof v?v({x:y,y:b}):{x:y,y:b};y=C.x,b=C.y;var S=d.hasOwnProperty("x"),x=d.hasOwnProperty("y"),I=s,T=o,E=window;if(f){var L=J(n),A="clientHeight",_="clientWidth";if(L===O(n)&&"static"!==R(L=W(n)).position&&"absolute"===p&&(A="scrollHeight",_="scrollWidth"),a===o||(a===s||a===r)&&c===u)T=i,b-=(m&&L===E&&E.visualViewport?E.visualViewport.height:L[A])-l.height,b*=h?1:-1;if(a===s||(a===o||a===i)&&c===u)I=r,y-=(m&&L===E&&E.visualViewport?E.visualViewport.width:L[_])-l.width,y*=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:H(n*i)/i||0,y:H(o*i)/i||0}}({x:y,y:b},O(n)):{x:y,y:b};return y=B.x,b=B.y,h?Object.assign({},P,((k={})[T]=x?"0":"",k[I]=S?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",k)):Object.assign({},P,((e={})[T]=x?b+"px":"",e[I]=S?y+"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:X(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=O(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=O(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ut(t){return j(W(t)).left+ct(t).scrollLeft}function dt(t){var e=R(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(L(t))>=0?t.ownerDocument.body:_(t)&&dt(t)?t:pt(z(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=O(o),s=i?[r].concat(r.visualViewport||[],dt(o)?o:[]):o,l=e.concat(s);return i?l:l.concat(ht(z(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=O(t),o=W(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;var c=M();(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=j(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=W(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"===R(i||n).direction&&(l+=q(n.clientWidth,i?i.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}(W(t)))}function mt(t,e,n,o){var i="clippingParents"===e?function(t){var e=ht(z(t)),n=["absolute","fixed"].indexOf(R(t).position)>=0&&_(t)?J(t):t;return A(n)?e.filter((function(t){return A(t)&&V(t,n)&&"body"!==L(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=N(i.right,e.right),e.bottom=N(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 gt(t){var e,n=t.reference,l=t.element,a=t.placement,d=a?B(a):null,p=a?X(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?Y(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 yt(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,g=n.rootBoundary,y=void 0===g?p:g,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=K("number"!=typeof I?I:G(I,a)),E=b===h?f:h,L=t.rects.popper,O=t.elements[S?E:b],_=mt(A(O)?O:O.contextElement||W(t.elements.popper),m,y,u),k=j(t.elements.reference),P=gt({reference:k,element:L,strategy:"absolute",placement:l}),B=ft(Object.assign({},L,P)),q=b===h?B:k,N={top:_.top-q.top+T.top,bottom:q.bottom-_.bottom+T.bottom,left:_.left-q.left+T.left,right:q.right-_.right+T.right},H=t.modifiersData.offset;if(b===h&&H){var D=H[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]+=D[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,g=n.fallbackPlacements,y=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),L=g||(E===T||!x?[st(T)]:function(t){if(B(t)===l)return[];var e=st(t);return[at(t),e,at(e)]}(T)),O=[T].concat(L).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=X(o),p=d?l?v:v.filter((function(t){return X(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]=yt(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:y,flipVariations:x,allowedAutoPlacements:I}):n)}),[]),A=e.rects.reference,_=e.rects.popper,k=new Map,P=!0,q=O[0],N=0;N=0,$=j?"width":"height",V=yt(e,{placement:H,boundary:w,rootBoundary:b,altBoundary:C,padding:y}),R=j?M?r:s:M?i:o;A[$]>_[$]&&(R=st(R));var F=st(R),W=[];if(p&&W.push(V[D]<=0),f&&W.push(V[R]<=0,V[F]<=0),W.every((function(t){return t}))){q=H,P=!1;break}k.set(H,W)}if(P)for(var z=function(t){var e=O.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"},U=x?3:1;U>0;U--){if("break"===z(U))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=yt(e,{elementContext:"reference"}),l=yt(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=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 It={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=gt({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,v=n.altBoundary,m=n.padding,g=n.tether,y=void 0===g||g,w=n.tetherOffset,b=void 0===w?0:w,C=yt(e,{boundary:h,rootBoundary:f,padding:m,altBoundary:v}),S=B(e.placement),x=X(e.placement),I=!x,T=Y(S),E="x"===T?"y":"x",L=e.modifiersData.popperOffsets,O=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,H={x:0,y:0};if(L){if(u){var D,M="y"===T?o:s,j="y"===T?i:r,V="y"===T?"height":"width",R=L[T],F=R+C[M],W=R-C[j],z=y?-A[V]/2:0,U=x===c?O[V]:A[V],K=x===c?-A[V]:-O[V],G=e.elements.arrow,Q=y&&G?$(G):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[M],nt=tt[j],ot=Z(0,O[V],Q[V]),it=I?O[V]/2-z-ot-et-k.mainAxis:U-ot-et-k.mainAxis,rt=I?-O[V]/2+z+ot+nt+k.mainAxis:K+ot+nt+k.mainAxis,st=e.elements.arrow&&J(e.elements.arrow),lt=st?"y"===T?st.clientTop||0:st.clientLeft||0:0,at=null!=(D=null==P?void 0:P[T])?D:0,ct=R+rt-at,ut=Z(y?N(F,R+it-at-lt):F,R,y?q(W,ct):W);L[T]=ut,H[T]=ut-R}if(p){var dt,pt="x"===T?o:s,ht="x"===T?i:r,ft=L[E],vt="y"===E?"height":"width",mt=ft+C[pt],gt=ft-C[ht],wt=-1!==[o,s].indexOf(S),bt=null!=(dt=null==P?void 0:P[E])?dt:0,Ct=wt?mt:ft-O[vt]-A[vt]-bt+k.altAxis,St=wt?ft+O[vt]+A[vt]-bt-k.altAxis:gt,xt=y&&wt?function(t,e,n){var o=Z(t,e,n);return o>n?n:o}(Ct,ft,St):Z(y?Ct:mt,ft,y?St:gt);L[E]=xt,H[E]=xt-ft}e.modifiersData[l]=H}},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=H(e.width)/t.offsetWidth||1,o=H(e.height)/t.offsetHeight||1;return 1!==n||1!==o}(e),l=W(e),a=j(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==L(e)||dt(l))&&(c=(o=e)!==O(o)&&_(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:ct(o)),_(e)?((u=j(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 Lt(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 Ot={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}},158:function(t,e,n){var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.HSFileUpload=e.HSDataTable=e.HSStaticMethods=e.HSTooltip=e.HSTogglePassword=e.HSToggleCount=e.HSThemeSwitch=e.HSTabs=e.HSStrongPassword=e.HSStepper=e.HSSelect=e.HSScrollspy=e.HSRemoveElement=e.HSPinInput=e.HSOverlay=e.HSInputNumber=e.HSDropdown=e.HSComboBox=e.HSCollapse=e.HSCarousel=e.HSAccordion=e.HSCopyMarkup=void 0;var i=n(406);Object.defineProperty(e,"HSCopyMarkup",{enumerable:!0,get:function(){return o(i).default}});var r=n(740);Object.defineProperty(e,"HSAccordion",{enumerable:!0,get:function(){return o(r).default}});var s=n(268);Object.defineProperty(e,"HSCarousel",{enumerable:!0,get:function(){return o(s).default}});var l=n(485);Object.defineProperty(e,"HSCollapse",{enumerable:!0,get:function(){return o(l).default}});var a=n(809);Object.defineProperty(e,"HSComboBox",{enumerable:!0,get:function(){return o(a).default}});var c=n(891);Object.defineProperty(e,"HSDropdown",{enumerable:!0,get:function(){return o(c).default}});var u=n(332);Object.defineProperty(e,"HSInputNumber",{enumerable:!0,get:function(){return o(u).default}});var d=n(850);Object.defineProperty(e,"HSOverlay",{enumerable:!0,get:function(){return o(d).default}});var p=n(60);Object.defineProperty(e,"HSPinInput",{enumerable:!0,get:function(){return o(p).default}});var h=n(911);Object.defineProperty(e,"HSRemoveElement",{enumerable:!0,get:function(){return o(h).default}});var f=n(751);Object.defineProperty(e,"HSScrollspy",{enumerable:!0,get:function(){return o(f).default}});var v=n(442);Object.defineProperty(e,"HSSelect",{enumerable:!0,get:function(){return o(v).default}});var m=n(887);Object.defineProperty(e,"HSStepper",{enumerable:!0,get:function(){return o(m).default}});var g=n(97);Object.defineProperty(e,"HSStrongPassword",{enumerable:!0,get:function(){return o(g).default}});var y=n(166);Object.defineProperty(e,"HSTabs",{enumerable:!0,get:function(){return o(y).default}});var w=n(502);Object.defineProperty(e,"HSThemeSwitch",{enumerable:!0,get:function(){return o(w).default}});var b=n(684);Object.defineProperty(e,"HSToggleCount",{enumerable:!0,get:function(){return o(b).default}});var C=n(100);Object.defineProperty(e,"HSTogglePassword",{enumerable:!0,get:function(){return o(C).default}});var S=n(969);Object.defineProperty(e,"HSTooltip",{enumerable:!0,get:function(){return o(S).default}});var x=n(957);Object.defineProperty(e,"HSStaticMethods",{enumerable:!0,get:function(){return o(x).default}}),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery?e.HSDataTable=n(814).default:e.HSDataTable=null,"undefined"!=typeof _&&"undefined"!=typeof Dropzone?e.HSFileUpload=n(234).default:e.HSFileUpload=null},740: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 i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(self,(()=>(()=>{"use strict";var t={170:(t,e,n)=>{n.r(e),n.d(e,{afterMain:()=>C,afterRead:()=>w,afterWrite:()=>T,applyStyles:()=>P,arrow:()=>Z,auto:()=>l,basePlacements:()=>a,beforeMain:()=>b,beforeRead:()=>g,beforeWrite:()=>x,bottom:()=>o,clippingParents:()=>d,computeStyles:()=>nt,createPopper:()=>Pt,createPopperBase:()=>kt,createPopperLite:()=>Dt,detectOverflow:()=>yt,end:()=>u,eventListeners:()=>ot,flip:()=>wt,hide:()=>Ct,left:()=>s,main:()=>S,modifierPhases:()=>E,offset:()=>xt,placements:()=>m,popper:()=>h,popperGenerator:()=>_t,popperOffsets:()=>It,preventOverflow:()=>Tt,read:()=>y,reference:()=>f,right:()=>r,start:()=>c,top:()=>i,variationPlacements:()=>v,viewport:()=>p,write:()=>I});var i="top",o="bottom",r="right",s="left",l="auto",a=[i,o,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])}),[]),g="beforeRead",y="read",w="afterRead",b="beforeMain",S="main",C="afterMain",x="beforeWrite",I="write",T="afterWrite",E=[g,y,w,b,S,C,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 _(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]||{},i=e.attributes[t]||{},o=e.elements[t];_(o)&&O(o)&&(Object.assign(o.style,n),Object.keys(i).forEach((function(t){var e=i[t];!1===e?o.removeAttribute(t):o.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 i=e.elements[t],o=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});_(i)&&O(i)&&(Object.assign(i.style,r),Object.keys(o).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]};function D(t){return t.split("-")[0]}var B=Math.max,q=Math.min,H=Math.round;function M(){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 N(){return!/^((?!chrome|android).)*safari/i.test(M())}function j(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var i=t.getBoundingClientRect(),o=1,r=1;e&&_(t)&&(o=t.offsetWidth>0&&H(i.width)/t.offsetWidth||1,r=t.offsetHeight>0&&H(i.height)/t.offsetHeight||1);var s=(A(t)?L(t):window).visualViewport,l=!N()&&n,a=(i.left+(l&&s?s.offsetLeft:0))/o,c=(i.top+(l&&s?s.offsetTop:0))/r,u=i.width/o,d=i.height/r;return{width:u,height:d,top:c,right:a+u,bottom:c+d,left:a,x:a,y:c}}function $(t){var e=j(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function V(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&k(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function R(t){return L(t).getComputedStyle(t)}function F(t){return["table","td","th"].indexOf(O(t))>=0}function W(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)||W(t)}function z(t){return _(t)&&"fixed"!==R(t).position?t.offsetParent:null}function Q(t){for(var e=L(t),n=z(t);n&&F(n)&&"static"===R(n).position;)n=z(n);return n&&("html"===O(n)||"body"===O(n)&&"static"===R(n).position)?e:n||function(t){var e=/firefox/i.test(M());if(/Trident/i.test(M())&&_(t)&&"fixed"===R(t).position)return null;var n=U(t);for(k(n)&&(n=n.host);_(n)&&["html","body"].indexOf(O(n))<0;){var i=R(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(t)||e}function J(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function K(t,e,n){return B(t,q(e,n))}function Y(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 Z={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=D(n.placement),h=J(p),f=[s,r].indexOf(p)>=0?"height":"width";if(u&&d){var v=function(t,e){return Y("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:X(t,a))}(c.padding,n),m=$(u),g="y"===h?i:s,y="y"===h?o:r,w=n.rects.reference[f]+n.rects.reference[h]-d[h]-n.rects.popper[f],b=d[h]-n.rects.reference[h],S=Q(u),C=S?"y"===h?S.clientHeight||0:S.clientWidth||0:0,x=w/2-b/2,I=v[g],T=C-m[f]-v[y],E=C/2-m[f]/2+x,O=K(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,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&V(e.elements.popper,i)&&(e.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function G(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,g=d.x,y=void 0===g?0:g,w=d.y,b=void 0===w?0:w,S="function"==typeof v?v({x:y,y:b}):{x:y,y:b};y=S.x,b=S.y;var C=d.hasOwnProperty("x"),x=d.hasOwnProperty("y"),I=s,T=i,E=window;if(f){var O=Q(n),A="clientHeight",_="clientWidth";if(O===L(n)&&"static"!==R(O=W(n)).position&&"absolute"===p&&(A="scrollHeight",_="scrollWidth"),a===i||(a===s||a===r)&&c===u)T=o,b-=(m&&O===E&&E.visualViewport?E.visualViewport.height:O[A])-l.height,b*=h?1:-1;if(a===s||(a===i||a===o)&&c===u)I=r,y-=(m&&O===E&&E.visualViewport?E.visualViewport.width:O[_])-l.width,y*=h?1:-1}var k,P=Object.assign({position:p},f&&tt),D=!0===v?function(t,e){var n=t.x,i=t.y,o=e.devicePixelRatio||1;return{x:H(n*o)/o||0,y:H(i*o)/o||0}}({x:y,y:b},L(n)):{x:y,y:b};return y=D.x,b=D.y,h?Object.assign({},P,((k={})[T]=x?"0":"",k[I]=C?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",k)):Object.assign({},P,((e={})[T]=x?b+"px":"",e[I]=C?y+"px":"",e.transform="",e))}const nt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,i=n.gpuAcceleration,o=void 0===i||i,r=n.adaptive,s=void 0===r||r,l=n.roundOffsets,a=void 0===l||l,c={placement:D(e.placement),variation:G(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,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 it={passive:!0};const ot={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,i=t.options,o=i.scroll,r=void 0===o||o,s=i.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,it)})),l&&a.addEventListener("resize",n.update,it),function(){r&&c.forEach((function(t){t.removeEventListener("scroll",n.update,it)})),l&&a.removeEventListener("resize",n.update,it)}},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 j(W(t)).left+ct(t).scrollLeft}function dt(t){var e=R(t),n=e.overflow,i=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+i)}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 i=pt(t),o=i===(null==(n=t.ownerDocument)?void 0:n.body),r=L(i),s=o?[r].concat(r.visualViewport||[],dt(i)?i:[]):i,l=e.concat(s);return o?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),i=W(t),o=n.visualViewport,r=i.clientWidth,s=i.clientHeight,l=0,a=0;if(o){r=o.width,s=o.height;var c=N();(c||!c&&"fixed"===e)&&(l=o.offsetLeft,a=o.offsetTop)}return{width:r,height:s,x:l+ut(t),y:a}}(t,n)):A(e)?function(t,e){var n=j(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=W(t),i=ct(t),o=null==(e=t.ownerDocument)?void 0:e.body,r=B(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=B(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-i.scrollLeft+ut(t),a=-i.scrollTop;return"rtl"===R(o||n).direction&&(l+=B(n.clientWidth,o?o.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}(W(t)))}function mt(t,e,n,i){var o="clippingParents"===e?function(t){var e=ht(U(t)),n=["absolute","fixed"].indexOf(R(t).position)>=0&&_(t)?Q(t):t;return A(n)?e.filter((function(t){return A(t)&&V(t,n)&&"body"!==O(t)})):[]}(t):[].concat(e),r=[].concat(o,[n]),s=r[0],l=r.reduce((function(e,n){var o=vt(t,n,i);return e.top=B(o.top,e.top),e.right=q(o.right,e.right),e.bottom=q(o.bottom,e.bottom),e.left=B(o.left,e.left),e}),vt(t,s,i));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function gt(t){var e,n=t.reference,l=t.element,a=t.placement,d=a?D(a):null,p=a?G(a):null,h=n.x+n.width/2-l.width/2,f=n.y+n.height/2-l.height/2;switch(d){case i:e={x:h,y:n.y-l.height};break;case o: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?J(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 yt(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,g=n.rootBoundary,y=void 0===g?p:g,w=n.elementContext,b=void 0===w?h:w,S=n.altBoundary,C=void 0!==S&&S,x=n.padding,I=void 0===x?0:x,T=Y("number"!=typeof I?I:X(I,a)),E=b===h?f:h,O=t.rects.popper,L=t.elements[C?E:b],_=mt(A(L)?L:L.contextElement||W(t.elements.popper),m,y,u),k=j(t.elements.reference),P=gt({reference:k,element:O,strategy:"absolute",placement:l}),D=ft(Object.assign({},O,P)),B=b===h?D:k,q={top:_.top-B.top+T.top,bottom:B.bottom-_.bottom+T.bottom,left:_.left-B.left+T.left,right:B.right-_.right+T.right},H=t.modifiersData.offset;if(b===h&&H){var M=H[l];Object.keys(q).forEach((function(t){var e=[r,o].indexOf(t)>=0?1:-1,n=[i,o].indexOf(t)>=0?"y":"x";q[t]+=M[n]*e}))}return q}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,g=n.fallbackPlacements,y=n.padding,w=n.boundary,b=n.rootBoundary,S=n.altBoundary,C=n.flipVariations,x=void 0===C||C,I=n.allowedAutoPlacements,T=e.options.placement,E=D(T),O=g||(E===T||!x?[st(T)]:function(t){if(D(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(D(n)===l?function(t,e){void 0===e&&(e={});var n=e,i=n.placement,o=n.boundary,r=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=void 0===c?m:c,d=G(i),p=d?l?v:v.filter((function(t){return G(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]=yt(t,{placement:n,boundary:o,rootBoundary:r,padding:s})[D(n)],e}),{});return Object.keys(f).sort((function(t,e){return f[t]-f[e]}))}(e,{placement:n,boundary:w,rootBoundary:b,padding:y,flipVariations:x,allowedAutoPlacements:I}):n)}),[]),A=e.rects.reference,_=e.rects.popper,k=new Map,P=!0,B=L[0],q=0;q=0,$=j?"width":"height",V=yt(e,{placement:H,boundary:w,rootBoundary:b,altBoundary:S,padding:y}),R=j?N?r:s:N?o:i;A[$]>_[$]&&(R=st(R));var F=st(R),W=[];if(p&&W.push(V[M]<=0),f&&W.push(V[R]<=0,V[F]<=0),W.every((function(t){return t}))){B=H,P=!1;break}k.set(H,W)}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 B=e,"break"},z=x?3:1;z>0;z--){if("break"===U(z))break}e.placement!==B&&(e.modifiersData[u]._skip=!0,e.placement=B,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 St(t){return[i,r,o,s].some((function(e){return t[e]>=0}))}const Ct={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,i=e.rects.reference,o=e.rects.popper,r=e.modifiersData.preventOverflow,s=yt(e,{elementContext:"reference"}),l=yt(e,{altBoundary:!0}),a=bt(s,i),c=bt(l,o,r),u=St(a),d=St(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,o=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 o=D(t),l=[s,i].indexOf(o)>=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(o)>=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[o]=c}};const It={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=gt({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,v=n.altBoundary,m=n.padding,g=n.tether,y=void 0===g||g,w=n.tetherOffset,b=void 0===w?0:w,S=yt(e,{boundary:h,rootBoundary:f,padding:m,altBoundary:v}),C=D(e.placement),x=G(e.placement),I=!x,T=J(C),E="x"===T?"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,H={x:0,y:0};if(O){if(u){var M,N="y"===T?i:s,j="y"===T?o:r,V="y"===T?"height":"width",R=O[T],F=R+S[N],W=R-S[j],U=y?-A[V]/2:0,z=x===c?L[V]:A[V],Y=x===c?-A[V]:-L[V],X=e.elements.arrow,Z=y&&X?$(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[N],nt=tt[j],it=K(0,L[V],Z[V]),ot=I?L[V]/2-U-it-et-k.mainAxis:z-it-et-k.mainAxis,rt=I?-L[V]/2+U+it+nt+k.mainAxis:Y+it+nt+k.mainAxis,st=e.elements.arrow&&Q(e.elements.arrow),lt=st?"y"===T?st.clientTop||0:st.clientLeft||0:0,at=null!=(M=null==P?void 0:P[T])?M:0,ct=R+rt-at,ut=K(y?q(F,R+ot-at-lt):F,R,y?B(W,ct):W);O[T]=ut,H[T]=ut-R}if(p){var dt,pt="x"===T?i:s,ht="x"===T?o:r,ft=O[E],vt="y"===E?"height":"width",mt=ft+S[pt],gt=ft-S[ht],wt=-1!==[i,s].indexOf(C),bt=null!=(dt=null==P?void 0:P[E])?dt:0,St=wt?mt:ft-L[vt]-A[vt]-bt+k.altAxis,Ct=wt?ft+L[vt]+A[vt]-bt-k.altAxis:gt,xt=y&&wt?function(t,e,n){var i=K(t,e,n);return i>n?n:i}(St,ft,Ct):K(y?St:mt,ft,y?Ct:gt);O[E]=xt,H[E]=xt-ft}e.modifiersData[l]=H}},requiresIfExists:["offset"]};function Et(t,e,n){void 0===n&&(n=!1);var i,o,r=_(e),s=_(e)&&function(t){var e=t.getBoundingClientRect(),n=H(e.width)/t.offsetWidth||1,i=H(e.height)/t.offsetHeight||1;return 1!==n||1!==i}(e),l=W(e),a=j(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==O(e)||dt(l))&&(c=(i=e)!==L(i)&&_(i)?{scrollLeft:(o=i).scrollLeft,scrollTop:o.scrollTop}:ct(i)),_(e)?((u=j(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,i=[];function o(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var i=e.get(t);i&&o(i)}})),i.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||o(t)})),i}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={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},158:function(t,e,n){ /* - * HSAccordion - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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 .hs-accordion.active")&&this.group.querySelector(":scope > .hs-accordion.active")!==this.el&&window.$hsAccordionCollection.find((function(t){return t.element.el===e.group.querySelector(":scope > .hs-accordion.active")})).element.hide();if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.content.style.display="block",this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px")})),(0,l.afterTransition)(this.content,(function(){e.content.style.display="block",e.content.style.height="",e.fireEvent("open",e.el),(0,l.dispatch)("open.hs.accordion",e.el,e.el)}))},e.prototype.hide=function(){var t,e=this;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),(0,l.afterTransition)(this.content,(function(){e.content.style.display="",e.content.style.height="0",e.fireEvent("close",e.el),(0,l.dispatch)("close.hs.accordion",e.el,e.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.treeView=function(){var t=this;if(!document.querySelectorAll(".hs-accordion-treeview-root").length)return!1;this.selectable=[],document.querySelectorAll(".hs-accordion-treeview-root").forEach((function(e){var n=null==e?void 0:e.getAttribute("data-hs-accordion-options"),o=n?JSON.parse(n):{};t.selectable.push({el:e,options:r({},o)})})),this.selectable.length&&this.selectable.forEach((function(e){e.el.querySelectorAll(".hs-accordion-selectable").forEach((function(n){n.addEventListener("click",(function(o){o.stopPropagation(),t.toggleSelected(e,n)}))}))}))},e.toggleSelected=function(t,e){e.classList.contains("selected")?e.classList.remove("selected"):(t.el.querySelectorAll(".hs-accordion-selectable").forEach((function(t){return t.classList.remove("selected")})),e.classList.add("selected"))},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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit(),document.querySelectorAll(".hs-accordion-treeview-root").length&&a.treeView()})),"undefined"!=typeof window&&(window.HSAccordion=a),e.default=a},961:(t,e)=>{ +var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.HSRangeSlider=e.HSFileUpload=e.HSDataTable=e.HSStaticMethods=e.HSTreeView=e.HSTooltip=e.HSTogglePassword=e.HSToggleCount=e.HSThemeSwitch=e.HSTextareaAutoHeight=e.HSTabs=e.HSStrongPassword=e.HSStepper=e.HSSelect=e.HSScrollspy=e.HSRemoveElement=e.HSPinInput=e.HSOverlay=e.HSInputNumber=e.HSDropdown=e.HSComboBox=e.HSCollapse=e.HSCarousel=e.HSAccordion=e.HSCopyMarkup=void 0;var o=n(406);Object.defineProperty(e,"HSCopyMarkup",{enumerable:!0,get:function(){return i(o).default}});var r=n(740);Object.defineProperty(e,"HSAccordion",{enumerable:!0,get:function(){return i(r).default}});var s=n(268);Object.defineProperty(e,"HSCarousel",{enumerable:!0,get:function(){return i(s).default}});var l=n(485);Object.defineProperty(e,"HSCollapse",{enumerable:!0,get:function(){return i(l).default}});var a=n(809);Object.defineProperty(e,"HSComboBox",{enumerable:!0,get:function(){return i(a).default}});var c=n(891);Object.defineProperty(e,"HSDropdown",{enumerable:!0,get:function(){return i(c).default}});var u=n(332);Object.defineProperty(e,"HSInputNumber",{enumerable:!0,get:function(){return i(u).default}});var d=n(850);Object.defineProperty(e,"HSOverlay",{enumerable:!0,get:function(){return i(d).default}});var p=n(60);Object.defineProperty(e,"HSPinInput",{enumerable:!0,get:function(){return i(p).default}});var h=n(911);Object.defineProperty(e,"HSRemoveElement",{enumerable:!0,get:function(){return i(h).default}});var f=n(751);Object.defineProperty(e,"HSScrollspy",{enumerable:!0,get:function(){return i(f).default}});var v=n(442);Object.defineProperty(e,"HSSelect",{enumerable:!0,get:function(){return i(v).default}});var m=n(887);Object.defineProperty(e,"HSStepper",{enumerable:!0,get:function(){return i(m).default}});var g=n(97);Object.defineProperty(e,"HSStrongPassword",{enumerable:!0,get:function(){return i(g).default}});var y=n(166);Object.defineProperty(e,"HSTabs",{enumerable:!0,get:function(){return i(y).default}});var w=n(144);Object.defineProperty(e,"HSTextareaAutoHeight",{enumerable:!0,get:function(){return i(w).default}});var b=n(502);Object.defineProperty(e,"HSThemeSwitch",{enumerable:!0,get:function(){return i(b).default}});var S=n(684);Object.defineProperty(e,"HSToggleCount",{enumerable:!0,get:function(){return i(S).default}});var C=n(100);Object.defineProperty(e,"HSTogglePassword",{enumerable:!0,get:function(){return i(C).default}});var x=n(969);Object.defineProperty(e,"HSTooltip",{enumerable:!0,get:function(){return i(x).default}});var I=n(772);Object.defineProperty(e,"HSTreeView",{enumerable:!0,get:function(){return i(I).default}});var T=n(957);Object.defineProperty(e,"HSStaticMethods",{enumerable:!0,get:function(){return i(T).default}}),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery?e.HSDataTable=n(814).default:e.HSDataTable=null,"undefined"!=typeof _&&"undefined"!=typeof Dropzone?e.HSFileUpload=n(234).default:e.HSFileUpload=null,void 0!==typeof noUiSlider?e.HSRangeSlider=n(347).default:e.HSRangeSlider=null},740:function(t,e,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSAccordion + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},268:function(t,e,n){ +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;n .hs-accordion.active")&&this.group.querySelector(":scope > .hs-accordion.active")!==this.el&&window.$hsAccordionCollection.find((function(t){return t.element.el===e.group.querySelector(":scope > .hs-accordion.active")})).element.hide();if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.content.style.display="block",this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px")})),(0,l.afterTransition)(this.content,(function(){e.content.style.display="block",e.content.style.height="",e.fireEvent("open",e.el),(0,l.dispatch)("open.hs.accordion",e.el,e.el)}))},e.prototype.hide=function(){var t,e=this;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),(0,l.afterTransition)(this.content,(function(){e.content.style.display="",e.content.style.height="0",e.fireEvent("close",e.el),(0,l.dispatch)("close.hs.accordion",e.el,e.el)}))},e.prototype.update=function(){var t=this;if(this.group=this.el.closest(".hs-accordion-group")||null,!this.group)return!1;this.isAlwaysOpened=this.group.hasAttribute("data-hs-accordion-always-open")||!1,window.$hsAccordionCollection.map((function(e){return e.id===t.el.id&&(e.element.group=t.group,e.element.isAlwaysOpened=t.isAlwaysOpened),e}))},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.treeView=function(){var t=this;if(!document.querySelectorAll(".hs-accordion-treeview-root").length)return!1;this.selectable=[],document.querySelectorAll(".hs-accordion-treeview-root").forEach((function(e){var n=null==e?void 0:e.getAttribute("data-hs-accordion-options"),i=n?JSON.parse(n):{};t.selectable.push({el:e,options:r({},i)})})),this.selectable.length&&this.selectable.forEach((function(e){e.el.querySelectorAll(".hs-accordion-selectable").forEach((function(n){n.addEventListener("click",(function(i){i.stopPropagation(),t.toggleSelected(e,n)}))}))}))},e.toggleSelected=function(t,e){e.classList.contains("selected")?e.classList.remove("selected"):(t.el.querySelectorAll(".hs-accordion-selectable").forEach((function(t){return t.classList.remove("selected")})),e.classList.add("selected"))},e.on=function(t,e,n){var i=window.$hsAccordionCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));i&&(i.element.events[t]=n)},e}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit(),document.querySelectorAll(".hs-accordion-treeview-root").length&&a.treeView()})),"undefined"!=typeof window&&(window.HSAccordion=a),e.default=a},961:(t,e)=>{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},268:function(t,e,n){ /* * HSCarousel - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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=this.calculateTransform(),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.calculateTransform=function(){var t=this.currentIndex*this.sliderWidth;return this.isRTL?"translate(".concat(t,"px, 0px)"):"translate(-".concat(t,"px, 0px)")},e.prototype.goToPrev=function(){0===this.currentIndex&&this.isInfiniteLoop?(this.currentIndex=this.slides.length-1,this.inner.style.transform=this.calculateTransform(),this.addCurrentClass()):0!==this.currentIndex&&(this.currentIndex-=1,this.inner.style.transform=this.calculateTransform(),this.addCurrentClass(),this.addDisabledClass())},e.prototype.goToNext=function(){this.currentIndex===this.slides.length-1&&this.isInfiniteLoop?(this.currentIndex=0,this.inner.style.transform=this.calculateTransform(),this.addCurrentClass()):this.currentIndext?s:-i:i>r?r:i<-t?s:i}())}},e.prototype.handleDragEnd=function(){var t=this;if(this.isDragging){this.isDragging=!1;var e=this.sliderWidth/this.getCurrentSlidesQty(),n=this.getTranslateXValue(),i=Math.round(n/e);this.isRTL&&(i=Math.round(n/e)),this.inner.classList.remove("dragging"),setTimeout((function(){t.calculateTransform(i),t.dots&&t.setCurrentDot(),t.dragStartX=null,t.initialTranslateX=null,t.inner.querySelectorAll("a.prevented-click").forEach((function(e){e.classList.remove("prevented-click"),e.removeEventListener("click",t.removeClickEventWhileDragging)}))}))}},e.prototype.getEventX=function(t){return t instanceof MouseEvent?t.clientX:t.touches[0].clientX},e.prototype.getCurrentSlidesQty=function(){var t=this;if("object"==typeof this.slidesQty){var e=document.body.clientWidth,n=0;return Object.keys(this.slidesQty).forEach((function(i){e>=(typeof i+1=="number"?t.slidesQty[i]:c.BREAKPOINTS[i])&&(n=t.slidesQty[i])})),n}return this.slidesQty},e.prototype.buildSnapSpacers=function(){var t=this.inner.querySelector(".hs-snap-before"),e=this.inner.querySelector(".hs-snap-after");t&&t.remove(),e&&e.remove();var n=this.sliderWidth,i=n/2-n/this.getCurrentSlidesQty()/2,o=(0,l.htmlToElement)('
')),r=(0,l.htmlToElement)('
'));this.inner.prepend(o),this.inner.appendChild(r)},e.prototype.initDots=function(){this.el.querySelectorAll(".hs-carousel-pagination-item").length?this.setDots():this.buildDots(),this.dots&&this.setCurrentDot()},e.prototype.buildDots=function(){this.dots.innerHTML="";for(var t=!this.isCentered&&this.slidesQty?this.slides.length-(this.getCurrentSlidesQty()-1):this.slides.length,e=0;en+o)&&(p=c-o),(ui+r)&&(h=d-r),t.scrollTo({left:p,top:h,behavior:"smooth"})},e.prototype.buildInfo=function(){this.infoTotal&&this.setInfoTotal(),this.infoCurrent&&this.setInfoCurrent()},e.prototype.setInfoTotal=function(){this.infoTotal.innerText="".concat(this.slides.length)},e.prototype.setInfoCurrent=function(){this.infoCurrent.innerText="".concat(this.currentIndex+1)},e.prototype.buildSingleDot=function(t){var e=(0,l.htmlToElement)("");return this.dotsItemClasses&&(0,l.classToClassList)(this.dotsItemClasses,e),this.singleDotEvents(e,t),e},e.prototype.singleDotEvents=function(t,e){var n=this;t.addEventListener("click",(function(){n.goTo(e),n.isAutoPlay&&(n.resetTimer(),n.setTimer())}))},e.prototype.observeResize=function(){var t=this;new ResizeObserver((0,l.debounce)((function(e){for(var n=0,i=e;n=this.currentIndex-e?i.classList.add("active"):i.classList.remove("active")}else{var o=this.isCentered?this.currentIndex+this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.currentIndex+this.getCurrentSlidesQty();this.slides.forEach((function(e,n){n>=t.currentIndex&&n *").forEach((function(t,n){return e(t,n)}))},e.prototype.setElementToDisabled=function(t){t.classList.add("disabled"),"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled")},e.prototype.unsetElementToDisabled=function(t){t.classList.remove("disabled"),"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled")},e.prototype.addDisabledClass=function(){if(!this.prev||!this.next)return!1;var t=getComputedStyle(this.inner).getPropertyValue("gap"),e=Math.floor(this.getCurrentSlidesQty()/2),n=0,i=0,o=!1,r=!1;this.isSnap?(n=this.currentIndex,i=this.hasSnapSpacers?this.slides.length-1:this.slides.length-e-1,o=this.hasSnapSpacers?0===n:this.getCurrentSlidesQty()%2==0?n-e<0:n-e==0,r=n>=i&&this.container.scrollLeft+this.container.clientWidth+(parseFloat(t)||0)>=this.container.scrollWidth):(o=0===(n=this.currentIndex),r=n>=(i=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty())),o?(this.unsetElementToDisabled(this.next),this.setElementToDisabled(this.prev)):r?(this.unsetElementToDisabled(this.prev),this.setElementToDisabled(this.next)):(this.unsetElementToDisabled(this.prev),this.unsetElementToDisabled(this.next))},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.getBoundingClientRect().width,this.calculateWidth(),this.sliderWidth!==this.inner.parentElement.getBoundingClientRect().width&&this.recalculateWidth()},e.prototype.calculateTransform=function(t){void 0!==t&&(this.currentIndex=t),this.currentIndex>this.slides.length-this.getCurrentSlidesQty()&&!this.isCentered&&(this.currentIndex=this.slides.length-this.getCurrentSlidesQty());var e=this.sliderWidth,n=e/this.getCurrentSlidesQty(),i=this.currentIndex*n;if(this.isSnap&&!this.isCentered&&this.container.scrollLefte&&(this.container.scrollLeft=this.container.scrollWidth),this.isCentered&&!this.isSnap){var o=(e-n)/2;if(0===this.currentIndex)i=-o;else if(this.currentIndex>=this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1)){i=this.slides.length*n-e+o}else i=this.currentIndex*n-o}this.isSnap||(this.inner.style.transform=this.isRTL?"translate(".concat(i,"px, 0px)"):"translate(".concat(-i,"px, 0px)")),this.isAutoHeight&&(this.inner.style.height="".concat(this.slides[this.currentIndex].clientHeight,"px")),this.dotsItems&&this.goToCurrentDot(),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass(),this.isSnap&&this.hasSnapSpacers&&this.buildSnapSpacers(),this.infoCurrent&&this.setInfoCurrent()},e.prototype.setTranslate=function(t){this.inner.style.transform=this.isRTL?"translate(".concat(-t,"px, 0px)"):"translate(".concat(t,"px, 0px)")},e.prototype.goToPrev=function(){if(this.currentIndex>0?this.currentIndex--:this.currentIndex=this.slides.length-this.getCurrentSlidesQty(),this.isSnap){var t=this.sliderWidth/this.getCurrentSlidesQty();this.container.scrollBy({left:Math.max(-this.container.scrollLeft,-t),behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()},e.prototype.goToNext=function(){var t=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty();if(this.currentIndexthis.currentIndex?e-this.currentIndex:this.currentIndex-e,o=e>this.currentIndex?-n*i:n*i;this.container.scrollBy({left:o,behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()},e.prototype.setIndex=function(t){this.currentIndex=t,this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()},e.getInstance=function(t,e){var n=window.$hsCarouselCollection.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.$hsCarouselCollection||(window.$hsCarouselCollection=[]),document.querySelectorAll("[data-hs-carousel]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsCarouselCollection.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}(a.default);window.addEventListener("load",(function(){u.autoInit()})),"undefined"!=typeof window&&(window.HSCarousel=u),e.default=u},485:function(t,e,n){ /* * HSCollapse - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(292),l=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,e=this;this.createCollection(window.$hsCollapseCollection,this),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.el.ariaExpanded="true":this.el.ariaExpanded="false"),this.el.addEventListener("click",(function(){e.content.classList.contains("open")?e.hide():e.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,e=this;if(this.animationInProcess||this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.add("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="true"),this.content.classList.add("open"),this.content.classList.remove("hidden"),this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px"),e.fireEvent("beforeOpen",e.el),(0,s.dispatch)("beforeOpen.hs.collapse",e.el,e.el)})),(0,s.afterTransition)(this.content,(function(){e.content.style.height="",e.fireEvent("open",e.el),(0,s.dispatch)("open.hs.collapse",e.el,e.el),e.animationInProcess=!1}))},e.prototype.hide=function(){var t,e=this;if(this.animationInProcess||!this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.remove("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),this.content.classList.remove("open"),(0,s.afterTransition)(this.content,(function(){e.content.classList.add("hidden"),e.content.style.height="",e.fireEvent("hide",e.el),(0,s.dispatch)("hide.hs.collapse",e.el,e.el),e.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}(r(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSCollapse=l),e.default=l},809:function(t,e,n){ +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.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(292),l=function(t){function e(e,n,i){var o=t.call(this,e,n,i)||this;return o.contentId=o.el.dataset.hsCollapse,o.content=document.querySelector(o.contentId),o.animationInProcess=!1,o.content&&o.init(),o}return o(e,t),e.prototype.init=function(){var t,e=this;this.createCollection(window.$hsCollapseCollection,this),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.el.ariaExpanded="true":this.el.ariaExpanded="false"),this.el.addEventListener("click",(function(){e.content.classList.contains("open")?e.hide():e.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,e=this;if(this.animationInProcess||this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.add("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="true"),this.content.classList.add("open"),this.content.classList.remove("hidden"),this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px"),e.fireEvent("beforeOpen",e.el),(0,s.dispatch)("beforeOpen.hs.collapse",e.el,e.el)})),(0,s.afterTransition)(this.content,(function(){e.content.style.height="",e.fireEvent("open",e.el),(0,s.dispatch)("open.hs.collapse",e.el,e.el),e.animationInProcess=!1}))},e.prototype.hide=function(){var t,e=this;if(this.animationInProcess||!this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.remove("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),this.content.classList.remove("open"),(0,s.afterTransition)(this.content,(function(){e.content.classList.add("hidden"),e.content.style.height="",e.fireEvent("hide",e.el),(0,s.dispatch)("hide.hs.collapse",e.el,e.el),e.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 i=window.$hsCollapseCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));i&&(i.element.events[t]=n)},e}(r(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSCollapse=l),e.default=l},809:function(t,e,n){ /* * HSComboBox - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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]\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t',_.outputEmptyTemplate=null!==(f=null==B?void 0:B.outputEmptyTemplate)&&void 0!==f?f:'
Nothing found...
',_.outputLoaderTemplate=null!==(v=null==B?void 0:B.outputLoaderTemplate)&&void 0!==v?v:'
\n\t\t\t\t
\n\t\t\t\t\tLoading...\n\t\t\t\t
\n\t\t\t
',_.groupingType=null!==(m=null==B?void 0:B.groupingType)&&void 0!==m?m:null,_.groupingTitleTemplate=null!==(g=null==B?void 0:B.groupingTitleTemplate)&&void 0!==g?g:"default"===_.groupingType?'
':'',_.tabsWrapperTemplate=null!==(y=null==B?void 0:B.tabsWrapperTemplate)&&void 0!==y?y:'
',_.preventSelection=null!==(w=null==B?void 0:B.preventSelection)&&void 0!==w&&w,_.preventAutoPosition=null!==(b=null==B?void 0:B.preventAutoPosition)&&void 0!==b&&b,_.isOpenOnFocus=null!==(C=null==B?void 0:B.isOpenOnFocus)&&void 0!==C&&C,_.input=null!==(S=_.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==S?S:null,_.output=null!==(x=_.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==x?x:null,_.itemsWrapper=null!==(I=_.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==I?I:null,_.items=null!==(T=Array.from(_.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==T?T:[],_.tabs=[],_.toggle=null!==(E=_.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==E?E:null,_.toggleClose=null!==(L=_.el.querySelector("[data-hs-combo-box-close]"))&&void 0!==L?L:null,_.toggleOpen=null!==(O=_.el.querySelector("[data-hs-combo-box-open]"))&&void 0!==O?O:null,_.outputPlaceholder=null,_.selected=_.value=null!==(A=_.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==A?A:"",_.isOpened=!1,_.isCurrent=!1,_.animationInProcess=!1,_.selectedGroup="all",_.init(),_}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.preventAutoPosition||this.recalculateDirection()),this.toggle&&this.buildToggle(),this.toggleClose&&this.buildToggleClose(),this.toggleOpen&&this.buildToggleOpen()},e.prototype.setResultAndRender=function(t){void 0===t&&(t="");var e=this.preventVisibility?this.input.value:t;this.setResults(e),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.input.value?t.el.classList.add("has-value"):t.el.classList.remove("has-value"),t.isOpened||t.open()})))},e.prototype.buildItems=function(){this.output.role="listbox",this.output.tabIndex=-1,this.output.ariaOrientation="vertical",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){var n,o,i,r=null!==(n=e.getAttribute("data-hs-combo-box-output-item-group-field"))&&void 0!==n?n:null,s=null!==(o=JSON.parse(e.getAttribute("data-hs-combo-box-output-item")))&&void 0!==o?o:null,l=null;return r&&(null===(i=null==s?void 0:s.group)||void 0===i?void 0:i.name)&&(l=t[r]),Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(e){var n;return(null===(n=null==s?void 0:s.group)||void 0===n?void 0:n.name)&&l?l===s.group.name&&e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]: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,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,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,u.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){var o=(0,u.htmlToElement)(e.outputItemTemplate);o.querySelectorAll("[data-hs-combo-box-output-item-field]").forEach((function(e){var n=t[e.getAttribute("data-hs-combo-box-output-item-field")],o=e.hasAttribute("data-hs-combo-box-output-item-hide-if-empty");e.textContent=null!=n?n:"",!n&&o&&(e.style.display="none")})),o.querySelectorAll("[data-hs-combo-box-search-text]").forEach((function(e){var n;e.setAttribute("data-hs-combo-box-search-text",null!==(n=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==n?n:"")})),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,u.htmlToElement)(this.tabsWrapperTemplate),n=(0,u.htmlToElement)('
');e.append(n),this.output.insertBefore(e,this.output.firstChild);var o=(0,u.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,u.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,u.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,e,n,o,i=this;this.isOpened?((null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="true")):((null===(n=null==this?void 0:this.toggle)||void 0===n?void 0:n.ariaExpanded)&&(this.toggle.ariaExpanded="false"),(null===(o=null==this?void 0:this.input)||void 0===o?void 0:o.ariaExpanded)&&(this.input.ariaExpanded="false")),this.toggle.addEventListener("click",(function(){i.isOpened?i.close():i.open(i.toggle.getAttribute("data-hs-combo-box-toggle"))}))},e.prototype.buildToggleClose=function(){var t=this;this.toggleClose.addEventListener("click",(function(){return t.close()}))},e.prototype.buildToggleOpen=function(){var t=this;this.toggleOpen.addEventListener("click",(function(){return t.open()}))},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,this.fireEvent("select",this.el),(0,u.dispatch)("select.hs.combobox",this.el,this.value)},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,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.preventAutoPosition||this.recalculateDirection(),setTimeout((function(){var t,n;(null===(t=null==e?void 0:e.input)||void 0===t?void 0:t.ariaExpanded)&&(e.input.ariaExpanded="true"),(null===(n=null==e?void 0:e.toggle)||void 0===n?void 0:n.ariaExpanded)&&(e.toggle.ariaExpanded="true"),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,n,o=this;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),!1):(this.animationInProcess=!0,(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="false"),(null===(n=null==this?void 0:this.toggle)||void 0===n?void 0:n.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.el.classList.remove("active"),this.preventAutoPosition||(this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom=""),(0,u.afterTransition)(this.output,(function(){o.output.style.display="none",o.setValueAndClear(t),o.animationInProcess=!1})),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),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 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.preventVisibility?t.element.isCurrent: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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+10&&o[o.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t',_.outputEmptyTemplate=null!==(f=null==D?void 0:D.outputEmptyTemplate)&&void 0!==f?f:'
Nothing found...
',_.outputLoaderTemplate=null!==(v=null==D?void 0:D.outputLoaderTemplate)&&void 0!==v?v:'
\n\t\t\t\t
\n\t\t\t\t\tLoading...\n\t\t\t\t
\n\t\t\t
',_.groupingType=null!==(m=null==D?void 0:D.groupingType)&&void 0!==m?m:null,_.groupingTitleTemplate=null!==(g=null==D?void 0:D.groupingTitleTemplate)&&void 0!==g?g:"default"===_.groupingType?'
':'',_.tabsWrapperTemplate=null!==(y=null==D?void 0:D.tabsWrapperTemplate)&&void 0!==y?y:'
',_.preventSelection=null!==(w=null==D?void 0:D.preventSelection)&&void 0!==w&&w,_.preventAutoPosition=null!==(b=null==D?void 0:D.preventAutoPosition)&&void 0!==b&&b,_.isOpenOnFocus=null!==(S=null==D?void 0:D.isOpenOnFocus)&&void 0!==S&&S,_.input=null!==(C=_.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==C?C:null,_.output=null!==(x=_.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==x?x:null,_.itemsWrapper=null!==(I=_.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==I?I:null,_.items=null!==(T=Array.from(_.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==T?T:[],_.tabs=[],_.toggle=null!==(E=_.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==E?E:null,_.toggleClose=null!==(O=_.el.querySelector("[data-hs-combo-box-close]"))&&void 0!==O?O:null,_.toggleOpen=null!==(L=_.el.querySelector("[data-hs-combo-box-open]"))&&void 0!==L?L:null,_.outputPlaceholder=null,_.selected=_.value=null!==(A=_.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==A?A:"",_.isOpened=!1,_.isCurrent=!1,_.animationInProcess=!1,_.selectedGroup="all",_.init(),_}return o(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.preventAutoPosition||this.recalculateDirection()),this.toggle&&this.buildToggle(),this.toggleClose&&this.buildToggleClose(),this.toggleOpen&&this.buildToggleOpen()},e.prototype.setResultAndRender=function(t){void 0===t&&(t="");var e=this.preventVisibility?this.input.value:t;this.setResults(e),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.input.value?t.el.classList.add("has-value"):t.el.classList.remove("has-value"),t.isOpened||t.open()})))},e.prototype.buildItems=function(){this.output.role="listbox",this.output.tabIndex=-1,this.output.ariaOrientation="vertical",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){var n,i,o,r=null!==(n=e.getAttribute("data-hs-combo-box-output-item-group-field"))&&void 0!==n?n:null,s=null!==(i=JSON.parse(e.getAttribute("data-hs-combo-box-output-item")))&&void 0!==i?i:null,l=null;return r&&(null===(o=null==s?void 0:s.group)||void 0===o?void 0:o.name)&&(l=t[r]),Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(e){var n;return(null===(n=null==s?void 0:s.group)||void 0===n?void 0:n.name)&&l?l===s.group.name&&e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]: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,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,n,i,o,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 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 n=i.filter((function(e){return e[r.apiGroupField]===t.name}));r.itemsWrapper?r.itemsWrapper.append(e):r.output.append(e),r.jsonItemsRender(n)}))):this.jsonItemsRender(i),this.setResults(this.input.value),[3,5];case 4:return o=s.sent(),console.error(o),[3,5];case 5:return this.destroyOutputLoader(),[2]}}))}))},e.prototype.jsonItemsRender=function(t){var e=this;t.forEach((function(t,n){var i=(0,u.htmlToElement)(e.outputItemTemplate);i.querySelectorAll("[data-hs-combo-box-output-item-field]").forEach((function(e){var n=t[e.getAttribute("data-hs-combo-box-output-item-field")],i=e.hasAttribute("data-hs-combo-box-output-item-hide-if-empty");e.textContent=null!=n?n:"",!n&&i&&(e.style.display="none")})),i.querySelectorAll("[data-hs-combo-box-search-text]").forEach((function(e){var n;e.setAttribute("data-hs-combo-box-search-text",null!==(n=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==n?n:"")})),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(n){e.setAttribute(n.attr,t[n.valueFrom])}))})),i.setAttribute("tabIndex","".concat(n)),"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 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 i=t[e.apiGroupField];n.some((function(t){return t.name===i}))||n.push({name:i,title:i})})),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"),i=e.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text");return ni?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,u.htmlToElement)(this.tabsWrapperTemplate),n=(0,u.htmlToElement)('
');e.append(n),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),n.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),n.append(i),i.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,u.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 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,e,n,i,o=this;this.isOpened?((null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="true")):((null===(n=null==this?void 0:this.toggle)||void 0===n?void 0:n.ariaExpanded)&&(this.toggle.ariaExpanded="false"),(null===(i=null==this?void 0:this.input)||void 0===i?void 0:i.ariaExpanded)&&(this.input.ariaExpanded="false")),this.toggle.addEventListener("click",(function(){o.isOpened?o.close():o.open(o.toggle.getAttribute("data-hs-combo-box-toggle"))}))},e.prototype.buildToggleClose=function(){var t=this;this.toggleClose.addEventListener("click",(function(){return t.close()}))},e.prototype.buildToggleOpen=function(){var t=this;this.toggleOpen.addEventListener("click",(function(){return t.open()}))},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,this.fireEvent("select",this.el),(0,u.dispatch)("select.hs.combobox",this.el,this.value)},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,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.preventAutoPosition||this.recalculateDirection(),setTimeout((function(){var t,n;(null===(t=null==e?void 0:e.input)||void 0===t?void 0:t.ariaExpanded)&&(e.input.ariaExpanded="true"),(null===(n=null==e?void 0:e.toggle)||void 0===n?void 0:n.ariaExpanded)&&(e.toggle.ariaExpanded="true"),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,n,i=this;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),!1):(this.animationInProcess=!0,(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="false"),(null===(n=null==this?void 0:this.toggle)||void 0===n?void 0:n.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.el.classList.remove("active"),this.preventAutoPosition||(this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom=""),(0,u.afterTransition)(this.output,(function(){i.output.style.display="none",i.setValueAndClear(t),i.animationInProcess=!1})),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),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 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"),i=n?JSON.parse(n):{};new e(t,i)}})),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.preventVisibility?t.element.isCurrent: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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 i=window.$hsComboBoxCollection.find((function(t){return t.element.preventVisibility?t.element.isCurrent:t.element.isOpened}));if(i){var o=null!==(n=i.element.itemsWrapper)&&void 0!==n?n:i.element.output;if(!o)return!1;var r,s=e.getPreparedItems(t,o),l=o.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,l.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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=a),e.default=a},814:function(t,e,n){ +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;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,l.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,l.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"),i=n?JSON.parse(n):{};new e(t,i)}}))},e}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=a),e.default=a},814:function(t,e,n){ /* * HSDataTable - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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&&(this.buildPagingPage(1),l>2&&this.pagingPages.appendChild((0,a.htmlToElement)('...')));for(var u=l;u<=c;u++)this.buildPagingPage(u);c...')),this.buildPagingPage(r)),this.disablePagingArrow(this.pagingPrev,0===e),this.disablePagingArrow(this.pagingNext,e===n-1),this.hidePagingIfSinglePage()},e.prototype.buildPagingPage=function(t){var e=this,n=this.dataTable.page.info().page,o=(0,a.htmlToElement)('');o.innerText="".concat(t),o.setAttribute("data-page","".concat(t)),this.pageBtnClasses&&(0,a.classToClassList)(this.pageBtnClasses,o),n===t-1&&o.classList.add("active"),o.addEventListener("click",(function(){return e.onPageClick(t)})),this.pagingPages.append(o)},e.prototype.onPageClick=function(t){this.dataTable.page(t-1).draw("page")},e.prototype.initRowSelecting=function(){var t=this;this.rowSelectingAll.addEventListener("change",(function(){return t.onSelectAllChange()}))},e.prototype.triggerChangeEventToRow=function(){var t=this;this.table.querySelectorAll("tbody ".concat(this.rowSelectingIndividual)).forEach((function(e){e.addEventListener("change",(function(){t.updateSelectAllCheckbox()}))}))},e.prototype.onSelectAllChange=function(){var t=this,e=this.rowSelectingAll.checked;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var o=n.querySelector(t.rowSelectingIndividual);o&&(o.checked=e)})),this.updateSelectAllCheckbox()},e.prototype.updateSelectAllCheckbox=function(){var t=this;if(!this.dataTable.rows({search:"applied"}).count())return this.rowSelectingAll.checked=!1,!1;var e=!0;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var o=n.querySelector(t.rowSelectingIndividual);if(o&&!o.checked)return e=!1,!1})),this.rowSelectingAll.checked=e},e.getInstance=function(t,e){var n=window.$hsDataTableCollection.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.$hsDataTableCollection||(window.$hsDataTableCollection=[]),document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDataTableCollection.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}(l(n(961)).default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").length&&("undefined"==typeof jQuery&&console.error("HSDataTable: jQuery is not available, please add it to the page."),"undefined"==typeof DataTable&&console.error("HSDataTable: DataTable is not available, please add it to the page.")),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery&&c.autoInit()})),"undefined"!=typeof window&&(window.HSDataTable=c),e.default=c},891:function(t,e,n){ +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;n1&&(this.buildPagingPage(1),l>2&&this.pagingPages.appendChild((0,a.htmlToElement)('...')));for(var u=l;u<=c;u++)this.buildPagingPage(u);c...')),this.buildPagingPage(r)),this.disablePagingArrow(this.pagingPrev,0===e),this.disablePagingArrow(this.pagingNext,e===n-1),this.hidePagingIfSinglePage()},e.prototype.buildPagingPage=function(t){var e=this,n=this.dataTable.page.info().page,i=(0,a.htmlToElement)('');i.innerText="".concat(t),i.setAttribute("data-page","".concat(t)),this.pageBtnClasses&&(0,a.classToClassList)(this.pageBtnClasses,i),n===t-1&&i.classList.add("active"),i.addEventListener("click",(function(){return e.onPageClick(t)})),this.pagingPages.append(i)},e.prototype.onPageClick=function(t){this.dataTable.page(t-1).draw("page")},e.prototype.initRowSelecting=function(){var t=this;this.rowSelectingAll.addEventListener("change",(function(){return t.onSelectAllChange()}))},e.prototype.triggerChangeEventToRow=function(){var t=this;this.table.querySelectorAll("tbody ".concat(this.rowSelectingIndividual)).forEach((function(e){e.addEventListener("change",(function(){t.updateSelectAllCheckbox()}))}))},e.prototype.onSelectAllChange=function(){var t=this,e=this.rowSelectingAll.checked;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var i=n.querySelector(t.rowSelectingIndividual);i&&(i.checked=e)})),this.updateSelectAllCheckbox()},e.prototype.updateSelectAllCheckbox=function(){var t=this;if(!this.dataTable.rows({search:"applied"}).count())return this.rowSelectingAll.checked=!1,!1;var e=!0;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var i=n.querySelector(t.rowSelectingIndividual);if(i&&!i.checked)return e=!1,!1})),this.rowSelectingAll.checked=e},e.getInstance=function(t,e){var n=window.$hsDataTableCollection.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.$hsDataTableCollection||(window.$hsDataTableCollection=[]),document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDataTableCollection.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}(l(n(961)).default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").length&&("undefined"==typeof jQuery&&console.error("HSDataTable: jQuery is not available, please add it to the page."),"undefined"==typeof DataTable&&console.error("HSDataTable: DataTable is not available, please add it to the page.")),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery&&c.autoInit()})),"undefined"!=typeof window&&(window.HSDataTable=c),e.default=c},891:function(t,e,n){ /* * HSDropdown - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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.querySelector(":scope > .hs-dropdown-toggle-wrapper > .hs-dropdown-toggle")||i.el.children[0],i.closers=Array.from(i.el.querySelectorAll(":scope .hs-dropdown-close"))||null,i.menu=i.el.querySelector(":scope > .hs-dropdown-menu"),i.eventMode=(0,l.getClassProperty)(i.el,"--trigger","click"),i.closeMode=(0,l.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&&this.buildToggle(),this.menu&&this.buildMenu(),this.closers&&this.buildClosers(),(0,l.isIOS)()||(0,l.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return t.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return t.onMouseLeaveHandler()})))},e.prototype.resizeHandler=function(){this.eventMode=(0,l.getClassProperty)(this.el,"--trigger","click"),this.closeMode=(0,l.getClassProperty)(this.el,"--auto-close","true")},e.prototype.buildToggle=function(){var t,e=this;(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(t){return e.onClickHandler(t)}))},e.prototype.buildMenu=function(){this.menu.role="menu"},e.prototype.buildClosers=function(){var t=this;this.closers.forEach((function(e){e.addEventListener("click",(function(){return t.close()}))}))},e.prototype.onClickHandler=function(t){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}}]},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(" ","")),s=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ","");"static"!==o&&(this.el._popper=(0,a.createPopper)(this.el,this.menu,{placement:u.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]}},{name:"computeStyles",options:{adaptive:"fixed"===o,gpuAcceleration:"true"===s}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){var e;(null===(e=null==t?void 0:t.toggle)||void 0===e?void 0:e.ariaExpanded)&&(t.toggle.ariaExpanded="true"),t.el.classList.add("open"),t.animationInProcess=!1})),this.fireEvent("open",this.el),(0,l.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;var n;if(this.animationInProcess=!0,t){var o=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,l.afterTransition)(o,(function(){return e.destroyPopper()}))}else this.destroyPopper();e.menu.style.margin=null,(null===(n=null==e?void 0:e.toggle)||void 0===n?void 0:n.ariaExpanded)&&(e.toggle.ariaExpanded="false"),e.el.classList.remove("open"),e.fireEvent("close",e.el),(0,l.dispatch)("close.hs.dropdown",e.el,e.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=l.menuSearchHistory;var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e&&(u.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")&&!e.element.menu.querySelector("textarea: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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")||o.el.querySelector(":scope > .hs-dropdown-toggle-wrapper > .hs-dropdown-toggle")||o.el.children[0],o.closers=Array.from(o.el.querySelectorAll(":scope .hs-dropdown-close"))||null,o.menu=o.el.querySelector(":scope > .hs-dropdown-menu"),o.eventMode=(0,l.getClassProperty)(o.el,"--trigger","click"),o.closeMode=(0,l.getClassProperty)(o.el,"--auto-close","true"),o.animationInProcess=!1,o.toggle&&o.menu&&o.init(),o}return o(e,t),e.prototype.init=function(){var t=this;if(this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle&&this.buildToggle(),this.menu&&this.buildMenu(),this.closers&&this.buildClosers(),(0,l.isIOS)()||(0,l.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return t.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return t.onMouseLeaveHandler()})))},e.prototype.resizeHandler=function(){this.eventMode=(0,l.getClassProperty)(this.el,"--trigger","click"),this.closeMode=(0,l.getClassProperty)(this.el,"--auto-close","true")},e.prototype.buildToggle=function(){var t,e=this;(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(t){return e.onClickHandler(t)}))},e.prototype.buildMenu=function(){this.menu.role="menu"},e.prototype.buildClosers=function(){var t=this;this.closers.forEach((function(e){e.addEventListener("click",(function(){return t.close()}))}))},e.prototype.onClickHandler=function(t){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(" ",""),i=(window.getComputedStyle(t.el).getPropertyValue("--adaptive")||"adaptive").replace(" ","");e.state.elements.popper.style.position=n,e.state.elements.popper.style.transform="adaptive"===i?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}}]},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(" ",""),i=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),o=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ","")),s=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ","");"static"!==i&&(this.el._popper=(0,a.createPopper)(this.el,this.menu,{placement:u.POSITIONS[e]||"bottom-start",strategy:i,modifiers:r(r([],"fixed"!==i?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===n},{name:"offset",options:{offset:[0,o]}},{name:"computeStyles",options:{adaptive:"fixed"===i,gpuAcceleration:"true"===s}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){var e;(null===(e=null==t?void 0:t.toggle)||void 0===e?void 0:e.ariaExpanded)&&(t.toggle.ariaExpanded="true"),t.el.classList.add("open"),t.animationInProcess=!1})),this.fireEvent("open",this.el),(0,l.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;var n;if(this.animationInProcess=!0,t){var i=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,l.afterTransition)(i,(function(){return e.destroyPopper()}))}else this.destroyPopper();e.menu.style.margin=null,(null===(n=null==e?void 0:e.toggle)||void 0===n?void 0:n.ariaExpanded)&&(e.toggle.ariaExpanded="false"),e.el.classList.remove("open"),e.fireEvent("close",e.el),(0,l.dispatch)("close.hs.dropdown",e.el,e.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=l.menuSearchHistory;var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e&&(u.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")&&!e.element.menu.querySelector("textarea: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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 i=(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")})),o=n.querySelector("a:focus, button:focus"),r=i.findIndex((function(t){return t===o}));r+1\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t.\n\t\t\t\t\t\t

\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t0%\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t',s.extensions=_.merge({default:{icon:'',class:"size-5"},xls:{icon:'',class:"size-5"},doc:{icon:'',class:"size-5"},zip:{icon:'',class:"size-5"}},a.extensions),s.singleton=a.singleton,s.concatOptions=r(r({clickable:s.el.querySelector("[data-hs-file-upload-trigger]"),previewsContainer:s.el.querySelector("[data-hs-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:s.previewTemplate,autoHideTrigger:!1},a),n),s.init(),s}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsFileUploadCollection,this),this.initDropzone()},e.prototype.initDropzone=function(){var t=this,e=this.el.querySelector("[data-hs-file-upload-clear]"),n=Array.from(this.el.querySelectorAll("[data-hs-file-upload-pseudo-trigger]"));this.dropzone=new Dropzone(this.el,this.concatOptions),this.dropzone.on("addedfile",(function(e){return t.onAddFile(e)})),this.dropzone.on("removedfile",(function(){return t.onRemoveFile()})),this.dropzone.on("uploadprogress",(function(e,n){return t.onUploadProgress(e,n)})),this.dropzone.on("complete",(function(e){return t.onComplete(e)})),e&&(e.onclick=function(){t.dropzone.files.length&&t.dropzone.removeAllFiles(!0)}),n.length&&n.forEach((function(e){e.onclick=function(){var e,n;(null===(e=t.concatOptions)||void 0===e?void 0:e.clickable)&&(null===(n=t.concatOptions)||void 0===n?void 0:n.clickable).click()}}))},e.prototype.onAddFile=function(t){var e=this,n=t.previewElement,o=t.previewElement.querySelector("[data-hs-file-upload-reload]");if(!n)return!1;this.singleton&&this.dropzone.files.length>1&&this.dropzone.removeFile(this.dropzone.files[0]),o&&o.addEventListener("click",(function(n){n.preventDefault(),n.stopPropagation();var o=document.createElement("input");o.type="file",o.click(),o.addEventListener("change",(function(n){var o,i=null===(o=n.target.files)||void 0===o?void 0:o[0];if(i){var r=i;r.status=Dropzone.ADDED,r.accepted=!0,r.previewElement=t.previewElement,r.previewTemplate=t.previewTemplate,r.previewsContainer=t.previewsContainer,e.dropzone.removeFile(t),e.dropzone.addFile(r)}}))})),this.previewAccepted(t)},e.prototype.previewAccepted=function(t){var e=this,n=t.previewElement,o=this.splitFileName(t.name),i=n.querySelector("[data-hs-file-upload-file-name]"),r=n.querySelector("[data-hs-file-upload-file-ext]"),s=n.querySelector("[data-hs-file-upload-file-size]"),l=n.querySelector("[data-hs-file-upload-file-icon]"),a=this.el.querySelector("[data-hs-file-upload-trigger]"),c=n.querySelector("[data-dz-thumbnail]"),u=n.querySelector("[data-hs-file-upload-remove]");i&&(i.textContent=o.name),r&&(r.textContent=o.extension),s&&(s.textContent=this.formatFileSize(t.size)),c&&(t.type.includes("image/")?c.classList.remove("hidden"):this.setIcon(o.extension,l)),this.dropzone.files.length>0&&this.concatOptions.autoHideTrigger&&(a.style.display="none"),u&&(u.onclick=function(){return e.dropzone.removeFile(t)})},e.prototype.onRemoveFile=function(){var t=this.el.querySelector("[data-hs-file-upload-trigger]");0===this.dropzone.files.length&&this.concatOptions.autoHideTrigger&&(t.style.display="")},e.prototype.onUploadProgress=function(t,e){var n=t.previewElement;if(!n)return!1;var o=n.querySelector("[data-hs-file-upload-progress-bar]"),i=n.querySelector("[data-hs-file-upload-progress-bar-pane]"),r=n.querySelector("[data-hs-file-upload-progress-bar-value]"),s=Math.floor(e);o&&o.setAttribute("aria-valuenow","".concat(s)),i&&(i.style.width="".concat(s,"%")),r&&(r.innerText="".concat(s))},e.prototype.onComplete=function(t){var e=t.previewElement;if(!e)return!1;e.classList.add("complete")},e.prototype.setIcon=function(t,e){var n=this.createIcon(t);e.append(n)},e.prototype.createIcon=function(t){var e,n,o=(null===(e=this.extensions[t])||void 0===e?void 0:e.icon)?(0,l.htmlToElement)(this.extensions[t].icon):(0,l.htmlToElement)(this.extensions.default.icon);return(0,l.classToClassList)((null===(n=this.extensions[t])||void 0===n?void 0:n.class)?this.extensions[t].class:this.extensions.default.class,o),o},e.prototype.formatFileSize=function(t){return t<1024?t.toFixed(2)+" B":t<1048576?(t/1024).toFixed(2)+" KB":t<1073741824?(t/1048576).toFixed(2)+" MB":t<1099511627776?(t/1073741824).toFixed(2)+" GB":(t/1099511627776).toFixed(2)+" TB"},e.prototype.splitFileName=function(t){var e=t.lastIndexOf(".");return-1==e?{name:t,extension:""}:{name:t.substring(0,e),extension:t.substring(e+1)}},e.getInstance=function(t,e){var n=window.$hsFileUploadCollection.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.$hsFileUploadCollection||(window.$hsFileUploadCollection=[]),document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsFileUploadCollection.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}(a.default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").length&&("undefined"==typeof _&&console.error("HSFileUpload: Lodash is not available, please add it to the page."),"undefined"==typeof Dropzone&&console.error("HSFileUpload: Dropzone is not available, please add it to the page.")),"undefined"!=typeof _&&"undefined"!=typeof Dropzone&&c.autoInit()})),"undefined"!=typeof window&&(window.HSFileUpload=c),e.default=c},332:function(t,e,n){ +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;n\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t.\n\t\t\t\t\t\t

\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t0%\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t',s.extensions=_.merge({default:{icon:'',class:"size-5"},xls:{icon:'',class:"size-5"},doc:{icon:'',class:"size-5"},zip:{icon:'',class:"size-5"}},a.extensions),s.singleton=a.singleton,s.concatOptions=r(r({clickable:s.el.querySelector("[data-hs-file-upload-trigger]"),previewsContainer:s.el.querySelector("[data-hs-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:s.previewTemplate,autoHideTrigger:!1},a),n),s.init(),s}return o(e,t),e.prototype.init=function(){this.createCollection(window.$hsFileUploadCollection,this),this.initDropzone()},e.prototype.initDropzone=function(){var t=this,e=this.el.querySelector("[data-hs-file-upload-clear]"),n=Array.from(this.el.querySelectorAll("[data-hs-file-upload-pseudo-trigger]"));this.dropzone=new Dropzone(this.el,this.concatOptions),this.dropzone.on("addedfile",(function(e){return t.onAddFile(e)})),this.dropzone.on("removedfile",(function(){return t.onRemoveFile()})),this.dropzone.on("uploadprogress",(function(e,n){return t.onUploadProgress(e,n)})),this.dropzone.on("complete",(function(e){return t.onComplete(e)})),e&&(e.onclick=function(){t.dropzone.files.length&&t.dropzone.removeAllFiles(!0)}),n.length&&n.forEach((function(e){e.onclick=function(){var e,n;(null===(e=t.concatOptions)||void 0===e?void 0:e.clickable)&&(null===(n=t.concatOptions)||void 0===n?void 0:n.clickable).click()}}))},e.prototype.onAddFile=function(t){var e=this,n=t.previewElement,i=t.previewElement.querySelector("[data-hs-file-upload-reload]");if(!n)return!1;this.singleton&&this.dropzone.files.length>1&&this.dropzone.removeFile(this.dropzone.files[0]),i&&i.addEventListener("click",(function(n){n.preventDefault(),n.stopPropagation();var i=document.createElement("input");i.type="file",i.click(),i.addEventListener("change",(function(n){var i,o=null===(i=n.target.files)||void 0===i?void 0:i[0];if(o){var r=o;r.status=Dropzone.ADDED,r.accepted=!0,r.previewElement=t.previewElement,r.previewTemplate=t.previewTemplate,r.previewsContainer=t.previewsContainer,e.dropzone.removeFile(t),e.dropzone.addFile(r)}}))})),this.previewAccepted(t)},e.prototype.previewAccepted=function(t){var e=this,n=t.previewElement,i=this.splitFileName(t.name),o=n.querySelector("[data-hs-file-upload-file-name]"),r=n.querySelector("[data-hs-file-upload-file-ext]"),s=n.querySelector("[data-hs-file-upload-file-size]"),l=n.querySelector("[data-hs-file-upload-file-icon]"),a=this.el.querySelector("[data-hs-file-upload-trigger]"),c=n.querySelector("[data-dz-thumbnail]"),u=n.querySelector("[data-hs-file-upload-remove]");o&&(o.textContent=i.name),r&&(r.textContent=i.extension),s&&(s.textContent=this.formatFileSize(t.size)),c&&(t.type.includes("image/")?c.classList.remove("hidden"):this.setIcon(i.extension,l)),this.dropzone.files.length>0&&this.concatOptions.autoHideTrigger&&(a.style.display="none"),u&&(u.onclick=function(){return e.dropzone.removeFile(t)})},e.prototype.onRemoveFile=function(){var t=this.el.querySelector("[data-hs-file-upload-trigger]");0===this.dropzone.files.length&&this.concatOptions.autoHideTrigger&&(t.style.display="")},e.prototype.onUploadProgress=function(t,e){var n=t.previewElement;if(!n)return!1;var i=n.querySelector("[data-hs-file-upload-progress-bar]"),o=n.querySelector("[data-hs-file-upload-progress-bar-pane]"),r=n.querySelector("[data-hs-file-upload-progress-bar-value]"),s=Math.floor(e);i&&i.setAttribute("aria-valuenow","".concat(s)),o&&(o.style.width="".concat(s,"%")),r&&(r.innerText="".concat(s))},e.prototype.onComplete=function(t){var e=t.previewElement;if(!e)return!1;e.classList.add("complete")},e.prototype.setIcon=function(t,e){var n=this.createIcon(t);e.append(n)},e.prototype.createIcon=function(t){var e,n,i=(null===(e=this.extensions[t])||void 0===e?void 0:e.icon)?(0,l.htmlToElement)(this.extensions[t].icon):(0,l.htmlToElement)(this.extensions.default.icon);return(0,l.classToClassList)((null===(n=this.extensions[t])||void 0===n?void 0:n.class)?this.extensions[t].class:this.extensions.default.class,i),i},e.prototype.formatFileSize=function(t){return t<1024?t.toFixed(2)+" B":t<1048576?(t/1024).toFixed(2)+" KB":t<1073741824?(t/1048576).toFixed(2)+" MB":t<1099511627776?(t/1073741824).toFixed(2)+" GB":(t/1099511627776).toFixed(2)+" TB"},e.prototype.splitFileName=function(t){var e=t.lastIndexOf(".");return-1==e?{name:t,extension:""}:{name:t.substring(0,e),extension:t.substring(e+1)}},e.getInstance=function(t,e){var n=window.$hsFileUploadCollection.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.$hsFileUploadCollection||(window.$hsFileUploadCollection=[]),document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsFileUploadCollection.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}(a.default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").length&&("undefined"==typeof _&&console.error("HSFileUpload: Lodash is not available, please add it to the page."),"undefined"==typeof Dropzone&&console.error("HSFileUpload: Dropzone is not available, please add it to the page.")),"undefined"!=typeof _&&"undefined"!=typeof Dropzone&&c.autoInit()})),"undefined"!=typeof window&&(window.HSFileUpload=c),e.default=c},332:function(t,e,n){ /* * HSInputNumber - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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?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.checkIsNumberAndConvert=function(){var t=this.input.value.trim(),e=this.cleanAndExtractNumber(t);null!==e?(this.inputValue=e,this.input.value=e.toString()):(this.inputValue=0,this.input.value="0")},e.prototype.cleanAndExtractNumber=function(t){var e=[],n=!1;t.split("").forEach((function(t){t>="0"&&t<="9"?e.push(t):"."!==t||n||(e.push(t),n=!0)}));var o=e.join(""),i=parseFloat(o);return isNaN(i)?null:i},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 s=this.inputValue+this.step;this.inputValue=s>=i&&s<=r?s: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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=a),e.default=a},850:function(t,e,n){ +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?l.step:1,i.init(),i}return o(e,t),e.prototype.init=function(){this.createCollection(window.$hsInputNumberCollection,this),this.input&&this.increment&&this.build()},e.prototype.checkIsNumberAndConvert=function(){var t=this.input.value.trim(),e=this.cleanAndExtractNumber(t);null!==e?(this.inputValue=e,this.input.value=e.toString()):(this.inputValue=0,this.input.value="0")},e.prototype.cleanAndExtractNumber=function(t){var e=[],n=!1;t.split("").forEach((function(t){t>="0"&&t<="9"?e.push(t):"."!==t||n||(e.push(t),n=!0)}));var i=e.join(""),o=parseFloat(i);return isNaN(o)?null:o},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},o=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 s=this.inputValue+this.step;this.inputValue=s>=o&&s<=r?s:r,this.input.value=this.inputValue.toString();break;case"decrement":var a=this.inputValue-this.step;this.inputValue=a>=o&&a<=r?a:o,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<=o?o:c,this.inputValue<=o&&(this.input.value=this.inputValue.toString())}i.inputValue=this.inputValue,this.inputValue===o?(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",i),(0,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=a),e.default=a},850:function(t,e,n){ /* * HSOverlay - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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"])'),s=[];(null==r?void 0:r.length)&&r.forEach((function(t){(0,l.isParentOrElementHidden)(t)||s.push(t)}));var a=i&&!t.metaKey;if(a&&!i.element.isTabAccessibilityLimited&&"Tab"===t.code)return!1;a&&s.length&&"Tab"===t.code&&(t.preventDefault(),this.onTab(i,s)),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}(s(n(961)).default);window.addEventListener("load",(function(){c.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.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.overlay.classList.contains("opened")})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.overlay.classList.contains("opened")})).forEach((function(t){var e=parseInt(window.getComputedStyle(t.element.overlay).getPropertyValue("z-index")),n=document.querySelector("#".concat(t.element.overlay.id,"-backdrop"));if(e===parseInt(window.getComputedStyle(n).getPropertyValue("z-index"))+1)return!1;"style"in n&&(n.style.zIndex="".concat(e-1)),document.body.classList.add("hs-overlay-body-open")}))}()})),"undefined"!=typeof window&&(window.HSOverlay=c),e.default=c},60:function(t,e,n){ +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;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,i=window.$hsOverlayCollection.filter((function(t){return t.element.overlay.classList.contains("open")})),o=i[i.length-1],r=null===(n=null===(e=null==o?void 0:o.element)||void 0===e?void 0:e.overlay)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=[];(null==r?void 0:r.length)&&r.forEach((function(t){(0,l.isParentOrElementHidden)(t)||s.push(t)}));var a=o&&!t.metaKey;if(a&&!o.element.isTabAccessibilityLimited&&"Tab"===t.code)return!1;a&&s.length&&"Tab"===t.code&&(t.preventDefault(),this.onTab(o,s)),a&&"Escape"===t.code&&(t.preventDefault(),this.onEscape(o))},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"),i=Array.from(e).indexOf(n);i>-1?e[(i+1)%e.length].focus():e[0].focus()},e.on=function(t,e,n){var i=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)}));i&&(i.element.events[t]=n)},e}(s(n(961)).default),u=function(){if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((function(t){return t.element.moveOverlayToBody})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.moveOverlayToBody})).forEach((function(t){var e=t.element.moveOverlayToBody,n=t.element.initContainer,i=document.querySelector("body"),o=t.element.overlay;if(!n&&o)return!1;document.body.clientWidth<=e&&!(0,l.isDirectChild)(i,o)?i.appendChild(o):document.body.clientWidth>e&&!n.contains(o)&&n.appendChild(o)}))};window.addEventListener("load",(function(){c.autoInit(),u()})),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)}))}(),u(),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.overlay.classList.contains("opened")})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.overlay.classList.contains("opened")})).forEach((function(t){var e=parseInt(window.getComputedStyle(t.element.overlay).getPropertyValue("z-index")),n=document.querySelector("#".concat(t.element.overlay.id,"-backdrop"));if(e===parseInt(window.getComputedStyle(n).getPropertyValue("z-index"))+1)return!1;"style"in n&&(n.style.zIndex="".concat(e-1)),document.body.classList.add("hs-overlay-body-open")}))}()})),"undefined"!=typeof window&&(window.HSOverlay=c),e.default=c},60:function(t,e,n){ /* * HSPinInput - * @version: 2.4.1 + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=a),e.default=a},347:function(t,e,n){ +/* + * HSRangeSlider + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=a),e.default=a},911:function(t,e,n){ +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){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,s.getClassProperty)(this.el,"--scrollspy-offset","0")),i=parseInt((0,s.getClassProperty)(n,"--scrollspy-offset"))||o,r=this.scrollable===document?0:this.scrollable.offsetTop,l=n.offsetTop-i-r,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,s.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}(r(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=l),e.default=l},442:function(t,e,n){ +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.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(292),l=function(t){function e(e,n){void 0===n&&(n={});var i=t.call(this,e,n)||this;return i.activeSection=null,i.contentId=i.el.getAttribute("data-hs-scrollspy"),i.content=document.querySelector(i.contentId),i.links=i.el.querySelectorAll("[href]"),i.sections=[],i.scrollableId=i.el.getAttribute("data-hs-scrollspy-scrollable-parent"),i.scrollable=i.scrollableId?document.querySelector(i.scrollableId):document,i.init(),i}return o(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,s.getClassProperty)(this.el,"--scrollspy-offset","0")),i=parseInt((0,s.getClassProperty)(e,"--scrollspy-offset"))||n,o=t.target===document?0:parseInt(String(t.target.getBoundingClientRect().top)),r=parseInt(String(e.getBoundingClientRect().top))-i-o,l=e.offsetHeight;if(r<=0&&r+l>0){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),i=parseInt((0,s.getClassProperty)(this.el,"--scrollspy-offset","0")),o=parseInt((0,s.getClassProperty)(n,"--scrollspy-offset"))||i,r=this.scrollable===document?0:this.scrollable.offsetTop,l=n.offsetTop-o-r,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,s.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}(r(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=l),e.default=l},442:function(t,e,n){ /* * HSSelect - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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"),n=this.toggle.querySelector("[data-icon]"),o=this.toggle.querySelector("[data-title]"),!this.isMultiple&&n&&this.setToggleIcon(),!this.isMultiple&&o&&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,o||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,a.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),(null===(e=this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.isOpened?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(){if(i.isDisabled)return!1;i.isOpened?i.close():i.open()}))},e.prototype.setToggleIcon=function(){var t,e,n=this.toggle.querySelector("[data-icon]");if(n.innerHTML="",n){var o=(0,a.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.isDisabled&&this.wrapper.classList.add("disabled"),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,l,c=this,u=this.getItemByValue(t),d=document.createElement("div");if(d.setAttribute("data-tag-value",t),this.tagsItemClasses&&(0,a.classToClassList)(this.tagsItemClasses,d),this.tagsItemTemplate&&(i=(0,a.htmlToElement)(this.tagsItemTemplate),d.append(i)),null===(e=null==u?void 0:u.options)||void 0===e?void 0:e.icon){var p=(0,a.htmlToElement)(null===(n=null==u?void 0:u.options)||void 0===n?void 0:n.icon);(l=i?i.querySelector("[data-icon]"):document.createElement("span")).append(p),i||d.append(l)}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,a.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,a.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,a.htmlToElement)(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),this.dropdown.classList.add("absolute","top-full"),this.dropdown.role="listbox",this.dropdown.tabIndex=-1,this.dropdown.ariaOrientation="vertical",this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,a.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.disabled,e.selected,e.options,"".concat(n))}))},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,a.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,a.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]"),this.search=(0,a.htmlToElement)(''),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,a.classToClassList)(this.searchClasses,this.search),this.search.addEventListener("input",(0,a.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,i,r){var l=this;void 0===n&&(n=!1),void 0===o&&(o=!1),void 0===r&&(r="1");var c=null,u=(0,a.htmlToElement)(this.optionTag||"
");if(u.setAttribute("data-value",e),u.setAttribute("data-title-value",t),u.setAttribute("tabIndex",r),u.classList.add("cursor-pointer"),n&&u.classList.add("disabled"),o&&(this.isMultiple?this.value=s(s([],this.value,!0),[e],!1):this.value=e),this.optionTemplate&&(c=(0,a.htmlToElement)(this.optionTemplate),u.append(c)),c?c.querySelector("[data-title]").textContent=t||"":u.textContent=t||"",i){if(i.icon){var d=(0,a.htmlToElement)(i.icon);if(d.classList.add("max-w-full"),c)c.querySelector("[data-icon]").append(d);else{var p=(0,a.htmlToElement)("
");this.iconClasses&&(0,a.classToClassList)(this.iconClasses,p),p.append(d),u.append(p)}}if(i.description)if(c)c.querySelector("[data-description]").append(i.description);else{var h=(0,a.htmlToElement)("
");h.textContent=i.description,this.descriptionClasses&&(0,a.classToClassList)(this.descriptionClasses,h),u.append(h)}}c&&c.querySelector("[data-icon]")&&!i&&!(null==i?void 0:i.icon)&&c.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&u.classList.add("selected"),n||u.addEventListener("click",(function(){return l.onSelectOption(e)})),this.optionClasses&&(0,a.classToClassList)(this.optionClasses,u),this.dropdown&&this.dropdown.append(u),o&&this.setNewValue()},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,o,i){var r=(0,a.htmlToElement)("");r.setAttribute("value",e),n&&r.setAttribute("disabled","disabled"),o&&r.setAttribute("selected","selected"),r.setAttribute("data-hs-select-option",JSON.stringify(i)),r.innerText=t,this.el.append(r)},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,a.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(),this.triggerChangeEventForNativeSelect()},e.prototype.triggerChangeEventForNativeSelect=function(){var t=new Event("change",{bubbles:!0});this.el.dispatchEvent(t)},e.prototype.addSelectOption=function(t,e,n,o,i){this.selectOptions=s(s([],this.selectOptions,!0),[{title:t,val:e,disabled:n,selected:o,options:i}],!1)},e.prototype.removeSelectOption=function(t,e){if(void 0===e&&(e=!1),!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t})),console.log(e),this.value=e?this.value.filter((function(e){return e!==t})):t,console.log(this.value)},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():(console.log(),this.value.length?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder)},e.prototype.stringFromValue=function(){var t=this,e=[],n="";if(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)if("nItemsAndCount"===this.toggleCountTextMode){var o=e.slice(0,this.toggleCountTextMinItems-1);n="".concat(o.join(this.toggleSeparators.items)," ").concat(this.toggleSeparators.betweenItemsAndCounter," ").concat(e.length-o.length," ").concat(this.toggleCountText)}else n="".concat(e.length," ").concat(this.toggleCountText);else n=e.join(this.toggleSeparators.items);return n},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0;var e=Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")}));e&&e.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,a.htmlToElement)(""),this.searchNoResult.innerText=this.searchNoResultText,(0,a.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,e=this,n=(null===(t=null===window||void 0===window?void 0:window.$hsSelectCollection)||void 0===t?void 0:t.find((function(t){return t.element.isOpened})))||null;if(n&&n.element.close(),this.animationInProcess)return!1;this.animationInProcess=!0,this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){var t;(null===(t=null==e?void 0:e.toggle)||void 0===t?void 0:t.ariaExpanded)&&(e.toggle.ariaExpanded="true"),e.wrapper.classList.add("active"),e.dropdown.classList.add("opened"),e.hasSearch&&!e.preventSearchFocus&&e.search.focus(),e.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,n,o,i=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,a.afterTransition)(this.dropdown,(function(){i.dropdown.classList.add("hidden"),i.hasSearch&&(i.search.value="",i.search.dispatchEvent(new Event("input",{bubbles:!0})),i.search.blur()),i.animationInProcess=!1})),null===(o=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===o||o.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.disabled,s=t.selected,l=t.options;!!e.selectOptions.some((function(t){return t.val===i}))||(e.addSelectOption(o,i,r,s,l),e.buildOption(o,i,r,s,l,n),e.buildOriginalOption(o,i,r,s,l),s&&!e.isMultiple&&e.onSelectOption(i))};Array.isArray(t)?t.forEach((function(t){o(t)})):o(t)},e.prototype.removeOption=function(t){var e=this,n=function(t,n){void 0===n&&(n=!1),!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t,n),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,e.isMultiple)})):n(t,this.isMultiple),this.setNewValue()},e.prototype.recalculateDirection=function(){var t,e,n,o;(0,a.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.open=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.open()},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}))&&u.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Tab":t.preventDefault(),t.stopImmediatePropagation(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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")||n.querySelector(".selected");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")||n.querySelector(".selected");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}(c.default);window.addEventListener("load",(function(){d.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=d),e.default=d},887:function(t,e,n){ +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&&o[o.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]",s.searchNoResultText=(null==c?void 0:c.searchNoResultText)||"No results found",s.searchNoResultClasses=(null==c?void 0:c.searchNoResultClasses)||"px-4 text-sm text-gray-800 dark:text-neutral-200",s.optionTemplate=(null==c?void 0:c.optionTemplate)||null,s.optionTag=(null==c?void 0:c.optionTag)||null,s.optionClasses=(null==c?void 0:c.optionClasses)||null,s.extraMarkup=(null==c?void 0:c.extraMarkup)||null,s.descriptionClasses=(null==c?void 0:c.descriptionClasses)||null,s.iconClasses=(null==c?void 0:c.iconClasses)||null,s.isAddTagOnEnter=null===(o=null==c?void 0:c.isAddTagOnEnter)||void 0===o||o,s.animationInProcess=!1,s.selectOptions=[],s.remoteOptions=[],s.tagsInputHelper=null,s.init(),s}return o(e,t),e.prototype.setValue=function(t){this.value=t,this.clearSelections(),Array.isArray(t)?(this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder,this.unselectMultipleItems(),this.selectMultipleItems()):(this.setToggleTitle(),this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.selectSingleItem())},e.prototype.init=function(){this.createCollection(window.$hsSelectCollection,this),this.build()},e.prototype.build=function(){var t=this;if(this.el.style.display="none",this.el.children&&Array.from(this.el.children).filter((function(t){return t.value&&""!==t.value})).forEach((function(e){var n=e.getAttribute("data-hs-select-option");t.selectOptions=a(a([],t.selectOptions,!0),[{title:e.textContent,val:e.value,disabled:e.disabled,options:"undefined"!==n?JSON.parse(n):null}],!1)})),this.isMultiple){var e=Array.from(this.el.children).filter((function(t){return t.selected}));if(e){var n=[];e.forEach((function(t){n.push(t.value)})),this.value=n}}this.buildWrapper(),"tags"===this.mode?this.buildTags():this.buildToggle(),this.buildDropdown(),this.extraMarkup&&this.buildExtraMarkup()},e.prototype.buildWrapper=function(){var t=this;this.wrapper=document.createElement("div"),this.wrapper.classList.add("hs-select","relative"),"tags"===this.mode&&this.wrapper.addEventListener("click",(function(e){e.target.closest("[data-hs-select-dropdown]")||e.target.closest("[data-tag-value]")||t.tagsInput.focus()})),this.wrapperClasses&&(0,u.classToClassList)(this.wrapperClasses,this.wrapper),this.el.before(this.wrapper),this.wrapper.append(this.el)},e.prototype.buildExtraMarkup=function(){var t=this,e=function(e){var n=(0,u.htmlToElement)(e);return t.wrapper.append(n),n},n=function(e){e.classList.contains("--prevent-click")||e.addEventListener("click",(function(e){e.stopPropagation(),t.toggleFn()}))};if(Array.isArray(this.extraMarkup))this.extraMarkup.forEach((function(t){var i=e(t);n(i)}));else{var i=e(this.extraMarkup);n(i)}},e.prototype.buildToggle=function(){var t,e,n,i,o=this;this.toggleTextWrapper=document.createElement("span"),this.toggleTextWrapper.classList.add("truncate"),this.toggle=(0,u.htmlToElement)(this.toggleTag||"
"),n=this.toggle.querySelector("[data-icon]"),i=this.toggle.querySelector("[data-title]"),!this.isMultiple&&n&&this.setToggleIcon(),!this.isMultiple&&i&&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,i||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,u.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),(null===(e=this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.isOpened?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(){if(o.isDisabled)return!1;o.toggleFn()}))},e.prototype.setToggleIcon=function(){var t,e=this.getItemByValue(this.value),n=this.toggle.querySelector("[data-icon]");if(n.innerHTML="",n){var i=(0,u.htmlToElement)(this.apiUrl&&this.apiIconTag?this.apiIconTag||"":(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.icon)||"");this.value&&this.apiUrl&&this.apiIconTag&&e[this.apiFieldsMap.icon]&&(i.src=e[this.apiFieldsMap.icon]||""),n.append(i),i&&(null==i?void 0:i.src)?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.isDisabled&&this.wrapper.classList.add("disabled"),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,i,o,r,s,l,a,c=this,d=this.getItemByValue(t),p=document.createElement("div");if(p.setAttribute("data-tag-value",t),this.tagsItemClasses&&(0,u.classToClassList)(this.tagsItemClasses,p),this.tagsItemTemplate&&(r=(0,u.htmlToElement)(this.tagsItemTemplate),p.append(r)),(null===(e=null==d?void 0:d.options)||void 0===e?void 0:e.icon)||this.apiIconTag){var h=(0,u.htmlToElement)(this.apiUrl&&this.apiIconTag?this.apiIconTag:null===(n=null==d?void 0:d.options)||void 0===n?void 0:n.icon);this.apiUrl&&this.apiIconTag&&d[this.apiFieldsMap.icon]&&(h.src=d[this.apiFieldsMap.icon]||""),(a=r?r.querySelector("[data-icon]"):document.createElement("span")).append(h),r||p.append(a)}!r||!r.querySelector("[data-icon]")||(null===(i=null==d?void 0:d.options)||void 0===i?void 0:i.icon)||this.apiUrl||this.apiIconTag||d[null===(o=this.apiFieldsMap)||void 0===o?void 0:o.icon]||r.querySelector("[data-icon]").classList.add("hidden"),(s=r?r.querySelector("[data-title]"):document.createElement("span")).textContent=d.title||"",r||p.append(s),r?l=r.querySelector("[data-remove]"):((l=document.createElement("span")).textContent="X",p.append(l)),l.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(),p.remove()})),this.wrapper.append(p)},e.prototype.getItemByValue=function(t){var e=this;return this.apiUrl?this.remoteOptions.find((function(n){return n[e.apiFieldsMap.title]===t})):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:a(a([],t.selectedItems,!0),[e],!1)}))},e.prototype.buildTagsInput=function(){var t=this;this.tagsInput=document.createElement("input"),this.tagsInputId&&(this.tagsInput.id=this.tagsInputId),this.tagsInputClasses&&(0,u.classToClassList)(this.tagsInputClasses,this.tagsInput),this.tagsInput.addEventListener("focus",(function(){t.isOpened||t.open()})),this.tagsInput.addEventListener("input",(function(){return t.calculateInputWidth()})),this.tagsInput.addEventListener("input",(0,u.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,u.htmlToElement)(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),"parent"===this.dropdownScope&&this.dropdown.classList.add("absolute","top-full"),this.dropdown.role="listbox",this.dropdown.tabIndex=-1,this.dropdown.ariaOrientation="vertical",this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,u.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.disabled,e.selected,e.options,"".concat(n))})),this.apiUrl&&this.optionsFromRemoteData(),"window"===this.dropdownScope&&this.buildPopper()},e.prototype.buildPopper=function(){"undefined"!=typeof Popper&&Popper.createPopper&&(document.body.appendChild(this.dropdown),this.popperInstance=Popper.createPopper("tags"===this.mode?this.wrapper:this.toggle,this.dropdown,{placement:p.POSITIONS[this.dropdownPlacement]||"bottom",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,5]}}]}))},e.prototype.updateDropdownWidth=function(){var t="tags"===this.mode?this.wrapper:this.toggle;this.dropdown.style.width="".concat(t.clientWidth,"px")},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,u.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,u.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]");var n=(0,u.htmlToElement)(this.searchTemplate||'');this.search="INPUT"===n.tagName?n:n.querySelector(":scope input"),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,u.classToClassList)(this.searchClasses,this.search),this.searchId&&(this.search.id=this.searchId),this.search.addEventListener("input",(0,u.debounce)((function(t){e.apiUrl?e.remoteSearch(t.target.value):e.searchOptions(t.target.value)}))),t?t.append(n):this.searchWrapper.append(n),this.dropdown.append(this.searchWrapper)},e.prototype.buildOption=function(t,e,n,i,o,r,s){var l,c=this;void 0===n&&(n=!1),void 0===i&&(i=!1),void 0===r&&(r="1");var d=null,p=null,h=(0,u.htmlToElement)(this.optionTag||"
");if(h.setAttribute("data-value",e),h.setAttribute("data-title-value",t),h.setAttribute("tabIndex",r),h.classList.add("cursor-pointer"),h.setAttribute("data-id",s||"".concat(this.optionId)),s||this.optionId++,n&&h.classList.add("disabled"),i&&(this.isMultiple?this.value=a(a([],this.value,!0),[e],!1):this.value=e),this.optionTemplate&&(d=(0,u.htmlToElement)(this.optionTemplate),h.append(d)),d?d.querySelector("[data-title]").textContent=t||"":h.textContent=t||"",o){if(o.icon){var f=(0,u.htmlToElement)(null!==(l=this.apiIconTag)&&void 0!==l?l:o.icon);if(f.classList.add("max-w-full"),this.apiUrl&&(f.setAttribute("alt",t),f.setAttribute("src",o.icon)),d)d.querySelector("[data-icon]").append(f);else{var v=(0,u.htmlToElement)("
");this.iconClasses&&(0,u.classToClassList)(this.iconClasses,v),v.append(f),h.append(v)}}if(o.description)if(d)(p=d.querySelector("[data-description]"))&&p.append(o.description);else{var m=(0,u.htmlToElement)("
");m.textContent=o.description,this.descriptionClasses&&(0,u.classToClassList)(this.descriptionClasses,m),h.append(m)}}d&&d.querySelector("[data-icon]")&&!o&&!(null==o?void 0:o.icon)&&d.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&h.classList.add("selected"),n||h.addEventListener("click",(function(){return c.onSelectOption(e)})),this.optionClasses&&(0,u.classToClassList)(this.optionClasses,h),this.dropdown&&this.dropdown.append(h),i&&this.setNewValue()},e.prototype.buildOptionFromRemoteData=function(t,e,n,i,o,r,s){void 0===n&&(n=!1),void 0===i&&(i=!1),void 0===o&&(o="1"),o?this.buildOption(t,e,n,i,s,o,r):alert("ID parameter is required for generating remote options! Please check your API endpoint have it.")},e.prototype.buildOptionsFromRemoteData=function(t){var e=this;t.forEach((function(t,n){var i=null,o="",r={id:"",title:"",icon:null,description:null,rest:{}};Object.keys(t).forEach((function(n){var s;t[e.apiFieldsMap.id]&&(i=t[e.apiFieldsMap.id]),t[e.apiFieldsMap.title]&&(o=t[e.apiFieldsMap.title]),t[e.apiFieldsMap.icon]&&(r.icon=t[e.apiFieldsMap.icon]),t[null===(s=e.apiFieldsMap)||void 0===s?void 0:s.description]&&(r.description=t[e.apiFieldsMap.description]),r.rest[n]=t[n]})),e.buildOriginalOption(o,o,i,!1,!1,r),e.buildOptionFromRemoteData(o,o,!1,!1,"".concat(n),i,r)})),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")},e.prototype.optionsFromRemoteData=function(){return s(this,arguments,void 0,(function(t){var e;return void 0===t&&(t=""),l(this,(function(n){switch(n.label){case 0:return[4,this.apiRequest(t)];case 1:return e=n.sent(),this.remoteOptions=e,e.length?this.buildOptionsFromRemoteData(this.remoteOptions):console.log("There is no data were responded!"),[2]}}))}))},e.prototype.apiRequest=function(){return s(this,arguments,void 0,(function(t){var e,n,i,o,r,s;return void 0===t&&(t=""),l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=this.apiUrl,n=this.apiSearchQueryKey?"".concat(this.apiSearchQueryKey,"=").concat(t.toLowerCase()):null,i="".concat(this.apiQuery),o=this.apiOptions||{},n&&(e+="?".concat(n)),this.apiQuery&&(e+="".concat(n?"&":"?").concat(i)),[4,fetch(e,o)];case 1:return[4,l.sent().json()];case 2:return r=l.sent(),[2,this.apiDataPart?r[this.apiDataPart]:r];case 3:return s=l.sent(),console.error(s),[3,4];case 4:return[2]}}))}))},e.prototype.sortElements=function(t,e){var n=Array.from(t.querySelectorAll(e));n.sort((function(t,e){var n=t.classList.contains("selected")||t.hasAttribute("selected"),i=e.classList.contains("selected")||e.hasAttribute("selected");return n&&!i?-1:!n&&i?1:0})),n.forEach((function(e){return t.appendChild(e)}))},e.prototype.remoteSearch=function(t){return s(this,void 0,void 0,(function(){var e,n,i,o,r=this;return l(this,(function(s){switch(s.label){case 0:return[4,this.apiRequest(t)];case 1:return e=s.sent(),this.remoteOptions=e,n=e.map((function(t){return"".concat(t.id)})),null,o=this.dropdown.querySelectorAll("[data-value]"),this.el.querySelectorAll("[data-hs-select-option]").forEach((function(t){var e,i=t.getAttribute("data-id");n.includes(i)||(null===(e=r.value)||void 0===e?void 0:e.includes(t.value))||r.destroyOriginalOption(t.value)})),o.forEach((function(t){var e,i=t.getAttribute("data-id");n.includes(i)||(null===(e=r.value)||void 0===e?void 0:e.includes(t.getAttribute("data-value")))?n=n.filter((function(t){return t!==i})):r.destroyOption(t.getAttribute("data-value"))})),(i=e.filter((function(t){return n.includes("".concat(t.id))}))).length?this.buildOptionsFromRemoteData(i):console.log("There is no data were responded!"),[2]}}))}))},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,i,o,r){var s=(0,u.htmlToElement)("");s.setAttribute("value",e),i&&s.setAttribute("disabled","disabled"),o&&s.setAttribute("selected","selected"),n&&s.setAttribute("data-id",n),s.setAttribute("data-hs-select-option",JSON.stringify(r)),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,i=this.wrapper.offsetWidth-(parseInt(window.getComputedStyle(this.wrapper).paddingLeft)+parseInt(window.getComputedStyle(this.wrapper).paddingRight));this.tagsInput.style.width="".concat(Math.min(n,i)+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})):a(a([],Array.from(this.value),!0),[t],!1),this.selectMultipleItems(),this.setNewValue()):(this.value=t,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),(0,u.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(),this.triggerChangeEventForNativeSelect()},e.prototype.triggerChangeEventForNativeSelect=function(){var t=new Event("change",{bubbles:!0});this.el.dispatchEvent(t)},e.prototype.addSelectOption=function(t,e,n,i,o){this.selectOptions=a(a([],this.selectOptions,!0),[{title:t,val:e,disabled:n,selected:i,options:o}],!1)},e.prototype.removeSelectOption=function(t,e){if(void 0===e&&(e=!1),!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t})),this.value=e?this.value.filter((function(e){return e!==t})):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(){var t;"tags"===this.mode?this.setTagsItems():(null===(t=this.value)||void 0===t?void 0:t.length)?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.stringFromValueBasic=function(t){var e=this,n=[],i="";if(t.forEach((function(t){e.isMultiple?e.value.includes(t.val)&&n.push(t.title):e.value===t.val&&n.push(t.title)})),this.toggleCountText&&""!==this.toggleCountText&&n.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){var o=n.slice(0,this.toggleCountTextMinItems-1);i="".concat(o.join(this.toggleSeparators.items)," ").concat(this.toggleSeparators.betweenItemsAndCounter," ").concat(n.length-o.length," ").concat(this.toggleCountText)}else i="".concat(n.length," ").concat(this.toggleCountText);else i=n.join(this.toggleSeparators.items);return i},e.prototype.stringFromValueRemoteData=function(){var t=this,e=this.dropdown.querySelectorAll("[data-title-value]"),n=[],i="";if(e.forEach((function(e){var i=e.getAttribute("data-value");t.isMultiple?t.value.includes(i)&&n.push(i):t.value===i&&n.push(i)})),this.toggleCountText&&""!==this.toggleCountText&&n.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){var o=n.slice(0,this.toggleCountTextMinItems-1);i="".concat(o.join(this.toggleSeparators.items)," ").concat(this.toggleSeparators.betweenItemsAndCounter," ").concat(n.length-o.length," ").concat(this.toggleCountText)}else i="".concat(n.length," ").concat(this.toggleCountText);else i=n.join(this.toggleSeparators.items);return i},e.prototype.stringFromValue=function(){return this.apiUrl?this.stringFromValueRemoteData():this.stringFromValueBasic(this.selectOptions)},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0;var e=Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")}));e&&e.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){var e=this;this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,u.htmlToElement)(this.searchNoResultTemplate),this.searchNoResult.innerText=this.searchNoResultText,(0,u.classToClassList)(this.searchNoResultClasses,this.searchNoResult);var n,i=this.dropdown.querySelectorAll("[data-value]"),o=!1;this.searchLimit&&(n=0),i.forEach((function(i){var r=i.getAttribute("data-title-value").toLocaleLowerCase(),s=t?t.split("").map((function(t){return t.match(/\w/)?"".concat(t,"[\\W_]*"):"\\W*"})).join(""):"",l=new RegExp(s,"i"),a=e.isSearchDirectMatch,c=r.trim();(t?a?!c.toLowerCase().includes(t.toLowerCase())||n>=e.searchLimit:!l.test(c)||n>=e.searchLimit:!l.test(c))?i.classList.add("hidden"):(i.classList.remove("hidden"),o=!0,e.searchLimit&&n++)})),o||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.toggleFn=function(){this.isOpened?this.close():this.open()},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,e=this,n=(null===(t=null===window||void 0===window?void 0:window.$hsSelectCollection)||void 0===t?void 0:t.find((function(t){return t.element.isOpened})))||null;if(n&&n.element.close(),this.animationInProcess)return!1;this.animationInProcess=!0,"window"===this.dropdownScope&&this.dropdown.classList.add("invisible"),this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){var t;(null===(t=null==e?void 0:e.toggle)||void 0===t?void 0:t.ariaExpanded)&&(e.toggle.ariaExpanded="true"),e.wrapper.classList.add("active"),e.dropdown.classList.add("opened"),e.dropdown.classList.contains("w-full")&&"window"===e.dropdownScope&&e.updateDropdownWidth(),e.popperInstance&&"window"===e.dropdownScope&&(e.popperInstance.update(),e.dropdown.classList.remove("invisible")),e.hasSearch&&!e.preventSearchFocus&&e.search.focus(),e.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,n,i,o=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,u.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===(i=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===i||i.classList.remove("hs-select-option-highlighted"),this.isOpened=!1},e.prototype.addOption=function(t){var e=this,n="".concat(this.selectOptions.length),i=function(t){var i=t.title,o=t.val,r=t.disabled,s=t.selected,l=t.options;!!e.selectOptions.some((function(t){return t.val===o}))||(e.addSelectOption(i,o,r,s,l),e.buildOption(i,o,r,s,l,n),e.buildOriginalOption(i,o,null,r,s,l),s&&!e.isMultiple&&e.onSelectOption(o))};Array.isArray(t)?t.forEach((function(t){i(t)})):i(t)},e.prototype.removeOption=function(t){var e=this,n=function(t,n){void 0===n&&(n=!1),!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t,n),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,e.isMultiple)})):n(t,this.isMultiple),this.setNewValue()},e.prototype.recalculateDirection=function(){var t,e,n,i;(0,u.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===(i=this.dropdownDirectionClasses)||void 0===i?void 0:i.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"),i=n?JSON.parse(n):{};new e(t,i)}})),window.$hsSelectCollection&&(window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.open=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.open()},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")&&!t.closest("[data-hs-select-dropdown].opened")){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}))&&p.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Tab":t.preventDefault(),t.stopImmediatePropagation(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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 i=(t?Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),o=n.querySelector(".hs-select-option-highlighted")||n.querySelector(".selected");o||i[0].classList.add("hs-select-option-highlighted");var r=i.findIndex((function(t){return t===o}));r+1 *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),o=n.querySelector(".hs-select-option-highlighted")||n.querySelector(".selected");o||i[0].classList.add("hs-select-option-highlighted");var r=i.findIndex((function(t){return t===o}));if(!(r+1 *:not(.hidden)")):Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((function(t){return!t.classList.contains("disabled")})),o=n.querySelector(".hs-select-option-highlighted");i.length&&(i[0].focus(),o&&o.classList.remove("hs-select-option-highlighted"),i[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})),i=window.$hsSelectCollection.find((function(t){return t.element.el===e}));n.element.close(),i.element.open()}else{(i=window.$hsSelectCollection.find((function(t){return t.element.isOpened})))&&i.element.onSelectOption(t.target.dataset.value||"")}},e}(d.default);window.addEventListener("load",(function(){h.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=h),e.default=h},887:function(t,e,n){ /* * HSStepper - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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,l.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,l.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,l.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,l.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,l.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,l.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,l.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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=a),e.default=a},97:function(t,e,n){ +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;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,o=t.el;n===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||i)&&o.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,o=void 0!==i&&i,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:o,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,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,l.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,o=void 0!==i&&i,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:o,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,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,l.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,l.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,l.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,l.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,l.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 o=this.navItems.find((function(e){return e.index===t.currentIndex}));(o?o.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,l.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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=a),e.default=a},97:function(t,e,n){ /* * HSStrongPassword - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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,l.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,l.dispatch)("change.hs.strongPassword",this.el,o)},e.prototype.hideStrips=function(t){Array.from(this.el.children).forEach((function(e,n){n?@[\\\\\\]^_`{|}~",i.target&&i.init(),i}return o(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,l.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,i=e.getAttribute("data-hs-strong-password-hints-rule-text");(null===(n=t.checksExclude)||void 0===n?void 0:n.includes(i))&&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,"]"))},i=0;return this.availableChecks.includes("lowercase")&&t.match(n.lowercase)&&(i+=1,e.add("lowercase")),this.availableChecks.includes("uppercase")&&t.match(n.uppercase)&&(i+=1,e.add("uppercase")),this.availableChecks.includes("numbers")&&t.match(n.numbers)&&(i+=1,e.add("numbers")),this.availableChecks.includes("special-characters")&&t.match(n["special-characters"])&&(i+=1,e.add("special-characters")),this.availableChecks.includes("min-length")&&t.length>=this.minLength&&(i+=1,e.add("min-length")),t.length||(i=0),i===this.availableChecks.length?this.el.classList.add("accepted"):this.el.classList.remove("accepted"),this.strength=i,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]"),i=t.querySelector("[data-uncheck]");e?(t.classList.add("active"),n.classList.remove("hidden"),i.classList.add("hidden")):(t.classList.remove("active"),n.classList.add("hidden"),i.classList.remove("hidden"))},e.prototype.setStrength=function(t){var e=this.checkStrength(t),n=e.strength,i={strength:n,rules:e.rules};this.hideStrips(n),this.fireEvent("change",i),(0,l.dispatch)("change.hs.strongPassword",this.el,i)},e.prototype.hideStrips=function(t){Array.from(this.el.children).forEach((function(e,n){nt)},e.prototype.isParentHidden=function(){return this.el.closest(".hs-collapse")||this.el.closest(".hs-overlay")},e.prototype.parentType=function(){return this.el.closest(".hs-collapse")?"collapse":!!this.el.closest(".hs-overlay")&&"overlay"},e.prototype.callbackAccordingToType=function(){var t=this;if("collapse"===this.parentType()){var e=this.el.closest(".hs-collapse").id;window.HSCollapse.getInstance('[data-hs-collapse="#'.concat(e,'"]'),!0).element.on("beforeOpen",(function(){if(!t.el)return!1;t.textareaSetHeight(3)}))}else{if("overlay"!==this.parentType())return!1;window.HSOverlay.getInstance(this.el.closest(".hs-overlay"),!0).element.on("open",(function(){if(!t.el)return!1;t.textareaSetHeight(3)}))}},e.getInstance=function(t,e){var n=window.$hsTextareaAutoHeightCollection.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.$hsTextareaAutoHeightCollection||(window.$hsTextareaAutoHeightCollection=[]),document.querySelectorAll("[data-hs-textarea-auto-height]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsTextareaAutoHeightCollection.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-textarea-auto-height"),i=n?JSON.parse(n):{};new e(t,i)}}))},e}(s(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSTextareaAutoHeight=l),e.default=l},502:function(t,e,n){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;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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=a),e.default=a},969:function(t,e,n){ +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;n1&&!!i.el.closest("[data-hs-toggle-password-group]"),i.target&&i.init(),i}return o(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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=a),e.default=a},969:function(t,e,n){ /* * HSTooltip - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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{ +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&&a{ /* * HSStaticMethods - * @version: 2.4.1 + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +Object.defineProperty(e,"__esModule",{value:!0});var i=n(292),o=n(255),r={getClassProperty:i.getClassProperty,afterTransition:i.afterTransition,autoInit:function(t){void 0===t&&(t="all"),"all"===t?o.COLLECTIONS.forEach((function(t){var e=t.fn;null==e||e.autoInit()})):o.COLLECTIONS.forEach((function(e){var n=e.key,i=e.fn;t.includes(n)&&(null==i||i.autoInit())}))},cleanCollection:function(t){void 0===t&&(t="all"),"all"===t?o.COLLECTIONS.forEach((function(t){var e=t.collection;window[e]instanceof Array&&(window[e]=[])})):o.COLLECTIONS.forEach((function(e){var n=e.key,i=e.collection;t.includes(n)&&window[i]instanceof Array&&(window[i]=[])}))}};"undefined"!=typeof window&&(window.HSStaticMethods=r),e.default=r},292:function(t,e){ +/* + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -Object.defineProperty(e,"__esModule",{value:!0});var o=n(292),i=n(255),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())}))},cleanCollection:function(t){void 0===t&&(t="all"),"all"===t?i.COLLECTIONS.forEach((function(t){var e=t.collection;window[e]instanceof Array&&(window[e]=[])})):i.COLLECTIONS.forEach((function(e){var n=e.key,o=e.collection;t.includes(n)&&window[o]instanceof Array&&(window[o]=[])}))}};"undefined"!=typeof window&&(window.HSStaticMethods=r),e.default=r},292: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.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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 i=function(t){return!!t&&("none"===window.getComputedStyle(t).display||i(t.parentElement))};e.isParentOrElementHidden=i;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}return 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})},n(158)})())); \ No newline at end of file +var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=i(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var i=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=i;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.isDirectChild=function(t,e){for(var n=t.children,i=0;i=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 i;return void 0===e&&(e=200),function(){for(var o=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,i){void 0===n&&(n=" "),void 0===i&&(i="add"),t.split(n).forEach((function(t){return"add"===i?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};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}return n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},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})},n(158)})())); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 426c9d7..49eba12 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,25 +1,31 @@ { "name": "preline", - "version": "2.4.1", + "version": "2.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "preline", - "version": "2.4.1", - "license": "MIT", + "version": "2.5.0", + "license": "Licensed under MIT and Preline UI Fair Use License", "dependencies": { "@popperjs/core": "^2.11.2" }, "devDependencies": { + "@types/clipboard": "^2.0.7", "@types/datatables.net": "^1.12.0", "@types/dropzone": "^5.7.8", + "@types/jquery": "^3.5.30", + "@types/lodash": "^4.17.6", + "@types/nouislider": "^15.0.0", + "@types/prismjs": "^1.26.4", + "@types/vinyl": "^2.0.12", "dts-bundle-generator": "^9.0.0", "prettier": "^3.0.0", "source-map-loader": "^4.0.1", "terser-webpack-plugin": "^5.3.9", - "ts-loader": "^9.4.2", - "typescript": "^5.0.2", + "ts-loader": "^9.5.1", + "typescript": "^5.5.3", "webpack-cli": "^5.0.1" } }, @@ -99,6 +105,16 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/@types/clipboard": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/clipboard/-/clipboard-2.0.7.tgz", + "integrity": "sha512-VwVFUHlneOsWfv/GaaY7Kwk4XasDqkAlyFQtsHxnOw0yyBYWTrlEXtmb9RtC+VFBCdtuOeIXECmELNd5RrKp/g==", + "deprecated": "This is a stub types definition. clipboard provides its own type definitions, so you do not need this installed.", + "dev": true, + "dependencies": { + "clipboard": "*" + } + }, "node_modules/@types/datatables.net": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/@types/datatables.net/-/datatables.net-1.12.0.tgz", @@ -147,6 +163,12 @@ "dev": true, "peer": true }, + "node_modules/@types/expect": { + "version": "1.20.4", + "resolved": "https://registry.npmjs.org/@types/expect/-/expect-1.20.4.tgz", + "integrity": "sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==", + "dev": true + }, "node_modules/@types/jquery": { "version": "3.5.30", "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.30.tgz", @@ -162,21 +184,53 @@ "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, + "node_modules/@types/lodash": { + "version": "4.17.6", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.6.tgz", + "integrity": "sha512-OpXEVoCKSS3lQqjx9GGGOapBeuW5eUboYHRlHP9urXPX25IKZ6AnP5ZRxtVf63iieUbsHxLn8NQ5Nlftc6yzAA==", + "dev": true + }, "node_modules/@types/node": { - "version": "20.12.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", - "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", + "version": "20.14.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz", + "integrity": "sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==", "dev": true, "dependencies": { "undici-types": "~5.26.4" } }, + "node_modules/@types/nouislider": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/@types/nouislider/-/nouislider-15.0.0.tgz", + "integrity": "sha512-CgBRRaaoR09F+yIp3y222atrs8+e2fDv0sFJmhhgJP9fvKfoZsKHX10oBMe/Y3toZ4obIY+CMirfGeli+aoKwg==", + "deprecated": "This is a stub types definition. nouislider provides its own type definitions, so you do not need this installed.", + "dev": true, + "dependencies": { + "nouislider": "*" + } + }, + "node_modules/@types/prismjs": { + "version": "1.26.4", + "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.4.tgz", + "integrity": "sha512-rlAnzkW2sZOjbqZ743IHUhFcvzaGbqijwOu8QZnZCjfQzBqFE3s4lOTJEsxikImav9uzz/42I+O7YUs1mWgMlg==", + "dev": true + }, "node_modules/@types/sizzle": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==", "dev": true }, + "node_modules/@types/vinyl": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@types/vinyl/-/vinyl-2.0.12.tgz", + "integrity": "sha512-Sr2fYMBUVGYq8kj3UthXFAu5UN6ZW+rYr4NACjZQJvHvj+c8lYv0CahmZ2P/r7iUkN44gGUBwqxZkrKXYPb7cw==", + "dev": true, + "dependencies": { + "@types/expect": "^1.20.4", + "@types/node": "*" + } + }, "node_modules/@webassemblyjs/ast": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", @@ -397,9 +451,9 @@ "peer": true }, "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -408,10 +462,10 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-assertions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", - "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, "peer": true, "peerDependencies": { @@ -480,9 +534,9 @@ } }, "node_modules/browserslist": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", - "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", + "version": "4.23.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz", + "integrity": "sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==", "dev": true, "funding": [ { @@ -500,10 +554,10 @@ ], "peer": true, "dependencies": { - "caniuse-lite": "^1.0.30001587", - "electron-to-chromium": "^1.4.668", + "caniuse-lite": "^1.0.30001629", + "electron-to-chromium": "^1.4.796", "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.13" + "update-browserslist-db": "^1.0.16" }, "bin": { "browserslist": "cli.js" @@ -519,9 +573,9 @@ "dev": true }, "node_modules/caniuse-lite": { - "version": "1.0.30001621", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001621.tgz", - "integrity": "sha512-+NLXZiviFFKX0fk8Piwv3PfLPGtRqJeq2TiNoUff/qB5KJgwecJTvCXDpmlyP/eCI/GUEmp/h/y5j0yckiiZrA==", + "version": "1.0.30001640", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001640.tgz", + "integrity": "sha512-lA4VMpW0PSUrFnkmVuEKBUovSWKhj7puyCg8StBChgu298N1AtuF1sKWEvfDuimSEDbhlb/KqPKC3fs1HbuQUA==", "dev": true, "funding": [ { @@ -568,15 +622,26 @@ } }, "node_modules/chrome-trace-event": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", + "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", "dev": true, "peer": true, "engines": { "node": ">=6.0" } }, + "node_modules/clipboard": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.11.tgz", + "integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==", + "dev": true, + "dependencies": { + "good-listener": "^1.2.2", + "select": "^1.1.2", + "tiny-emitter": "^2.0.0" + } + }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -650,14 +715,20 @@ } }, "node_modules/datatables.net": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/datatables.net/-/datatables.net-2.0.7.tgz", - "integrity": "sha512-cyW+HZwkMzb4bLrao/SS9/i64ZHiw5nYhXl+OwuOPgddG+R9O11iOEke8wYsdiyOQmjv2mE6xkEmRMZwHZc8zw==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/datatables.net/-/datatables.net-2.0.8.tgz", + "integrity": "sha512-4/2dYx4vl975zQqZbyoVEm0huPe61qffjBRby7K7V+y9E+ORq4R8KavkgrNMmIgO6cl85Pg4AvCbVjvPCIT1Yg==", "dev": true, "dependencies": { "jquery": ">=1.7" } }, + "node_modules/delegate": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", + "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==", + "dev": true + }, "node_modules/dts-bundle-generator": { "version": "9.5.1", "resolved": "https://registry.npmjs.org/dts-bundle-generator/-/dts-bundle-generator-9.5.1.tgz", @@ -675,9 +746,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.782", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.782.tgz", - "integrity": "sha512-JUfU61e8tr+i5Y1FKXcKs+Xe+rJ+CEqm4cgv1kMihPE2EvYHmYyVr3Im/+1+Z5B29Be2EEGCZCwAc6Tazdl1Yg==", + "version": "1.4.816", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.816.tgz", + "integrity": "sha512-EKH5X5oqC6hLmiS7/vYtZHZFTNdhsYG5NVPRN6Yn0kQHNBlT59+xSM8HBy66P5fxWpKgZbPqb+diC64ng295Jw==", "dev": true, "peer": true }, @@ -688,9 +759,9 @@ "dev": true }, "node_modules/enhanced-resolve": { - "version": "5.16.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.1.tgz", - "integrity": "sha512-4U5pNsuDl0EhuZpq46M5xPslstkviJuhrdobaRDBk2Jy2KO37FDAJl4lb2KlNabxT0m4MTK2UHNrsAcphE8nyw==", + "version": "5.17.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz", + "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -713,9 +784,9 @@ } }, "node_modules/es-module-lexer": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.3.tgz", - "integrity": "sha512-i1gCgmR9dCl6Vil6UKPI/trA69s08g/syhiDK9TG0Nf1RJjjFI+AzoWW7sPufzkgYAn861skuCwJa0pIIHYxvg==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", + "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", "dev": true, "peer": true }, @@ -865,6 +936,15 @@ "dev": true, "peer": true }, + "node_modules/good-listener": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", + "integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==", + "dev": true, + "dependencies": { + "delegate": "^3.1.2" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -933,12 +1013,15 @@ } }, "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", + "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", "dev": true, "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1109,6 +1192,12 @@ "dev": true, "peer": true }, + "node_modules/nouislider": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/nouislider/-/nouislider-15.8.1.tgz", + "integrity": "sha512-93TweAi8kqntHJSPiSWQ1o/uZ29VWOmal9YKb6KKGGlCkugaNfAupT7o1qTHqdJvNQ7S0su5rO6qRFCjP8fxtw==", + "dev": true + }, "node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -1201,9 +1290,9 @@ } }, "node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -1336,6 +1425,12 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/select": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", + "integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==", + "dev": true + }, "node_modules/semver": { "version": "7.6.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", @@ -1501,9 +1596,9 @@ } }, "node_modules/terser": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.0.tgz", - "integrity": "sha512-Q1JFAoUKE5IMfI4Z/lkE/E6+SwgzO+x4tq4v1AyBLRj8VSYvRO6A/rQrPg1yud4g0En9EKI1TvFRF2tQFcoUkg==", + "version": "5.31.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.1.tgz", + "integrity": "sha512-37upzU1+viGvuFtBo9NPufCb9dwM0+l9hMxYyWfBA+fbwrPqNJAhbZ6W47bBFnZHKHTUBnMvi87434qq+qnxOg==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -1552,6 +1647,12 @@ } } }, + "node_modules/tiny-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", + "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", + "dev": true + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -1594,9 +1695,9 @@ } }, "node_modules/typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", + "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -1613,9 +1714,9 @@ "dev": true }, "node_modules/update-browserslist-db": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz", - "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", + "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", "dev": true, "funding": [ { @@ -1667,9 +1768,9 @@ } }, "node_modules/webpack": { - "version": "5.91.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.91.0.tgz", - "integrity": "sha512-rzVwlLeBWHJbmgTC/8TvAcu5vpJNII+MelQpylD4jNERPwpBJOE2lEcko1zJX3QJeLjTTAnQxn/OJ8bjDzVQaw==", + "version": "5.92.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.92.1.tgz", + "integrity": "sha512-JECQ7IwJb+7fgUFBlrJzbyu3GEuNBcdqr1LD7IbSzwkSmIevTm8PF+wej3Oxuz/JFBUZ6O1o43zsPkwm1C4TmA==", "dev": true, "peer": true, "dependencies": { @@ -1679,10 +1780,10 @@ "@webassemblyjs/wasm-edit": "^1.12.1", "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", + "acorn-import-attributes": "^1.9.5", "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.16.0", + "enhanced-resolve": "^5.17.0", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", @@ -1928,6 +2029,15 @@ "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==" }, + "@types/clipboard": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/clipboard/-/clipboard-2.0.7.tgz", + "integrity": "sha512-VwVFUHlneOsWfv/GaaY7Kwk4XasDqkAlyFQtsHxnOw0yyBYWTrlEXtmb9RtC+VFBCdtuOeIXECmELNd5RrKp/g==", + "dev": true, + "requires": { + "clipboard": "*" + } + }, "@types/datatables.net": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/@types/datatables.net/-/datatables.net-1.12.0.tgz", @@ -1975,6 +2085,12 @@ "dev": true, "peer": true }, + "@types/expect": { + "version": "1.20.4", + "resolved": "https://registry.npmjs.org/@types/expect/-/expect-1.20.4.tgz", + "integrity": "sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==", + "dev": true + }, "@types/jquery": { "version": "3.5.30", "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.30.tgz", @@ -1990,21 +2106,52 @@ "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, + "@types/lodash": { + "version": "4.17.6", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.6.tgz", + "integrity": "sha512-OpXEVoCKSS3lQqjx9GGGOapBeuW5eUboYHRlHP9urXPX25IKZ6AnP5ZRxtVf63iieUbsHxLn8NQ5Nlftc6yzAA==", + "dev": true + }, "@types/node": { - "version": "20.12.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", - "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", + "version": "20.14.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz", + "integrity": "sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==", "dev": true, "requires": { "undici-types": "~5.26.4" } }, + "@types/nouislider": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/@types/nouislider/-/nouislider-15.0.0.tgz", + "integrity": "sha512-CgBRRaaoR09F+yIp3y222atrs8+e2fDv0sFJmhhgJP9fvKfoZsKHX10oBMe/Y3toZ4obIY+CMirfGeli+aoKwg==", + "dev": true, + "requires": { + "nouislider": "*" + } + }, + "@types/prismjs": { + "version": "1.26.4", + "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.4.tgz", + "integrity": "sha512-rlAnzkW2sZOjbqZ743IHUhFcvzaGbqijwOu8QZnZCjfQzBqFE3s4lOTJEsxikImav9uzz/42I+O7YUs1mWgMlg==", + "dev": true + }, "@types/sizzle": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==", "dev": true }, + "@types/vinyl": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@types/vinyl/-/vinyl-2.0.12.tgz", + "integrity": "sha512-Sr2fYMBUVGYq8kj3UthXFAu5UN6ZW+rYr4NACjZQJvHvj+c8lYv0CahmZ2P/r7iUkN44gGUBwqxZkrKXYPb7cw==", + "dev": true, + "requires": { + "@types/expect": "^1.20.4", + "@types/node": "*" + } + }, "@webassemblyjs/ast": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", @@ -2202,15 +2349,15 @@ "peer": true }, "acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true }, - "acorn-import-assertions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", - "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, "peer": true, "requires": {} @@ -2259,16 +2406,16 @@ } }, "browserslist": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", - "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", + "version": "4.23.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz", + "integrity": "sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==", "dev": true, "peer": true, "requires": { - "caniuse-lite": "^1.0.30001587", - "electron-to-chromium": "^1.4.668", + "caniuse-lite": "^1.0.30001629", + "electron-to-chromium": "^1.4.796", "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.13" + "update-browserslist-db": "^1.0.16" } }, "buffer-from": { @@ -2278,9 +2425,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001621", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001621.tgz", - "integrity": "sha512-+NLXZiviFFKX0fk8Piwv3PfLPGtRqJeq2TiNoUff/qB5KJgwecJTvCXDpmlyP/eCI/GUEmp/h/y5j0yckiiZrA==", + "version": "1.0.30001640", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001640.tgz", + "integrity": "sha512-lA4VMpW0PSUrFnkmVuEKBUovSWKhj7puyCg8StBChgu298N1AtuF1sKWEvfDuimSEDbhlb/KqPKC3fs1HbuQUA==", "dev": true, "peer": true }, @@ -2306,12 +2453,23 @@ } }, "chrome-trace-event": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", + "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", "dev": true, "peer": true }, + "clipboard": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.11.tgz", + "integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==", + "dev": true, + "requires": { + "good-listener": "^1.2.2", + "select": "^1.1.2", + "tiny-emitter": "^2.0.0" + } + }, "cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -2373,14 +2531,20 @@ } }, "datatables.net": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/datatables.net/-/datatables.net-2.0.7.tgz", - "integrity": "sha512-cyW+HZwkMzb4bLrao/SS9/i64ZHiw5nYhXl+OwuOPgddG+R9O11iOEke8wYsdiyOQmjv2mE6xkEmRMZwHZc8zw==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/datatables.net/-/datatables.net-2.0.8.tgz", + "integrity": "sha512-4/2dYx4vl975zQqZbyoVEm0huPe61qffjBRby7K7V+y9E+ORq4R8KavkgrNMmIgO6cl85Pg4AvCbVjvPCIT1Yg==", "dev": true, "requires": { "jquery": ">=1.7" } }, + "delegate": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", + "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==", + "dev": true + }, "dts-bundle-generator": { "version": "9.5.1", "resolved": "https://registry.npmjs.org/dts-bundle-generator/-/dts-bundle-generator-9.5.1.tgz", @@ -2392,9 +2556,9 @@ } }, "electron-to-chromium": { - "version": "1.4.782", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.782.tgz", - "integrity": "sha512-JUfU61e8tr+i5Y1FKXcKs+Xe+rJ+CEqm4cgv1kMihPE2EvYHmYyVr3Im/+1+Z5B29Be2EEGCZCwAc6Tazdl1Yg==", + "version": "1.4.816", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.816.tgz", + "integrity": "sha512-EKH5X5oqC6hLmiS7/vYtZHZFTNdhsYG5NVPRN6Yn0kQHNBlT59+xSM8HBy66P5fxWpKgZbPqb+diC64ng295Jw==", "dev": true, "peer": true }, @@ -2405,9 +2569,9 @@ "dev": true }, "enhanced-resolve": { - "version": "5.16.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.1.tgz", - "integrity": "sha512-4U5pNsuDl0EhuZpq46M5xPslstkviJuhrdobaRDBk2Jy2KO37FDAJl4lb2KlNabxT0m4MTK2UHNrsAcphE8nyw==", + "version": "5.17.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz", + "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==", "dev": true, "requires": { "graceful-fs": "^4.2.4", @@ -2421,9 +2585,9 @@ "dev": true }, "es-module-lexer": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.3.tgz", - "integrity": "sha512-i1gCgmR9dCl6Vil6UKPI/trA69s08g/syhiDK9TG0Nf1RJjjFI+AzoWW7sPufzkgYAn861skuCwJa0pIIHYxvg==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", + "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", "dev": true, "peer": true }, @@ -2539,6 +2703,15 @@ "dev": true, "peer": true }, + "good-listener": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", + "integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==", + "dev": true, + "requires": { + "delegate": "^3.1.2" + } + }, "graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -2586,12 +2759,12 @@ "dev": true }, "is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", + "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", "dev": true, "requires": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" } }, "is-fullwidth-code-point": { @@ -2726,6 +2899,12 @@ "dev": true, "peer": true }, + "nouislider": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/nouislider/-/nouislider-15.8.1.tgz", + "integrity": "sha512-93TweAi8kqntHJSPiSWQ1o/uZ29VWOmal9YKb6KKGGlCkugaNfAupT7o1qTHqdJvNQ7S0su5rO6qRFCjP8fxtw==", + "dev": true + }, "p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -2791,9 +2970,9 @@ } }, "prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", "dev": true }, "punycode": { @@ -2875,6 +3054,12 @@ "ajv-keywords": "^3.5.2" } }, + "select": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", + "integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==", + "dev": true + }, "semver": { "version": "7.6.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", @@ -2988,9 +3173,9 @@ "dev": true }, "terser": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.0.tgz", - "integrity": "sha512-Q1JFAoUKE5IMfI4Z/lkE/E6+SwgzO+x4tq4v1AyBLRj8VSYvRO6A/rQrPg1yud4g0En9EKI1TvFRF2tQFcoUkg==", + "version": "5.31.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.1.tgz", + "integrity": "sha512-37upzU1+viGvuFtBo9NPufCb9dwM0+l9hMxYyWfBA+fbwrPqNJAhbZ6W47bBFnZHKHTUBnMvi87434qq+qnxOg==", "dev": true, "requires": { "@jridgewell/source-map": "^0.3.3", @@ -3012,6 +3197,12 @@ "terser": "^5.26.0" } }, + "tiny-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", + "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", + "dev": true + }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -3043,9 +3234,9 @@ } }, "typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", + "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", "dev": true }, "undici-types": { @@ -3055,9 +3246,9 @@ "dev": true }, "update-browserslist-db": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz", - "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", + "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", "dev": true, "peer": true, "requires": { @@ -3086,9 +3277,9 @@ } }, "webpack": { - "version": "5.91.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.91.0.tgz", - "integrity": "sha512-rzVwlLeBWHJbmgTC/8TvAcu5vpJNII+MelQpylD4jNERPwpBJOE2lEcko1zJX3QJeLjTTAnQxn/OJ8bjDzVQaw==", + "version": "5.92.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.92.1.tgz", + "integrity": "sha512-JECQ7IwJb+7fgUFBlrJzbyu3GEuNBcdqr1LD7IbSzwkSmIevTm8PF+wej3Oxuz/JFBUZ6O1o43zsPkwm1C4TmA==", "dev": true, "peer": true, "requires": { @@ -3098,10 +3289,10 @@ "@webassemblyjs/wasm-edit": "^1.12.1", "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", + "acorn-import-attributes": "^1.9.5", "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.16.0", + "enhanced-resolve": "^5.17.0", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", diff --git a/package.json b/package.json index 9f22c39..2937702 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "preline", - "version": "2.4.1", + "version": "2.5.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", @@ -40,22 +40,31 @@ "access": "public" }, "scripts": { - "watch": "webpack", + "watch": "webpack --config webpack.config.js --watch", + "watch:mjs": "webpack --config webpack.config.mjs.js --watch", + "build": "webpack --config webpack.config.js", + "build:mjs": "webpack --config webpack.config.mjs.js", "pretty": "prettier --write \"./**/*.{js,jsx,ts,tsx,json}\"", "generate-dts": "dts-bundle-generator --config dts-config.js" }, "devDependencies": { + "@types/clipboard": "^2.0.7", "@types/datatables.net": "^1.12.0", "@types/dropzone": "^5.7.8", + "@types/jquery": "^3.5.30", + "@types/lodash": "^4.17.6", + "@types/nouislider": "^15.0.0", + "@types/prismjs": "^1.26.4", + "@types/vinyl": "^2.0.12", "dts-bundle-generator": "^9.0.0", "prettier": "^3.0.0", "source-map-loader": "^4.0.1", "terser-webpack-plugin": "^5.3.9", - "ts-loader": "^9.4.2", - "typescript": "^5.0.2", + "ts-loader": "^9.5.1", + "typescript": "^5.5.3", "webpack-cli": "^5.0.1" }, "dependencies": { "@popperjs/core": "^2.11.2" } -} \ No newline at end of file +} diff --git a/plugin.js b/plugin.js index 55e52ad..3f5ad71 100644 --- a/plugin.js +++ b/plugin.js @@ -1,6 +1,6 @@ /* * Plugin - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @requires: tailwindcss ^3.4.1 * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) @@ -101,6 +101,36 @@ module.exports = plugin(function ({ addVariant, e }) { }); }); + addVariant('hs-tree-view-selected', [ + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `[data-hs-tree-view-item].selected > .${e( + `hs-tree-view-selected${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `[data-hs-tree-view-item].selected.${e( + `hs-tree-view-selected${separator}${className}`, + )}`; + }); + } + ]); + + addVariant('hs-tree-view-disabled', [ + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `[data-hs-tree-view-item].disabled.${e(`hs-tree-view-disabled${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `[data-hs-tree-view-item].disabled > .${e(`hs-tree-view-disabled${separator}${className}`)}`; + }); + }, + ]); + addVariant('hs-collapse-open', [ ({ modifySelectors, separator }) => { modifySelectors(({ className }) => { @@ -219,14 +249,31 @@ module.exports = plugin(function ({ addVariant, e }) { ({ modifySelectors, separator }) => { modifySelectors(({ className }) => { return `.disabled.${e( - `hs-carousel${separator}disabled${separator}${className}`, + `hs-carousel-disabled${separator}${className}`, )}`; }); }, ({ modifySelectors, separator }) => { modifySelectors(({ className }) => { return `.disabled .${e( - `hs-carousel${separator}disabled${separator}${className}`, + `hs-carousel-disabled${separator}${className}`, + )}`; + }); + }, + ]); + + addVariant('hs-carousel-dragging', [ + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `.dragging.${e( + `hs-carousel-dragging${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `.dragging .${e( + `hs-carousel-dragging${separator}${className}`, )}`; }); }, @@ -577,6 +624,41 @@ module.exports = plugin(function ({ addVariant, e }) { }, ]); + // Sortable.js + addVariant('hs-dragged', ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `.dragged.${e(`hs-dragged${separator}${className}`)}`; + }); + }); + + // noUiSlider + addVariant('hs-range-slider-disabled', [ + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `.disabled .${e(`hs-range-slider-disabled${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `.disabled.${e(`hs-range-slider-disabled${separator}${className}`)}`; + }); + }, + ]); + + // Dropzone + addVariant('hs-file-upload-complete', [ + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `.complete .${e(`hs-file-upload-complete${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `.complete.${e(`hs-file-upload-complete${separator}${className}`)}`; + }); + }, + ]); + // Modes addVariant('hs-default-mode-active', ({ modifySelectors, separator }) => { modifySelectors(({ className }) => { diff --git a/plugin.ts b/plugin.ts new file mode 100644 index 0000000..c3af1ea --- /dev/null +++ b/plugin.ts @@ -0,0 +1,676 @@ +/* + * Plugin + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @requires: tailwindcss ^3.4.1 + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ + +export type TStringFunc = () => string; + +export interface IModifySelectors { + className: string; +} + +export interface IAddVariantOptions { + modifySelectors: (callback: (options: IModifySelectors) => string) => string; + separator: string; +} + +import plugin from 'tailwindcss/plugin'; +import type { PluginAPI } from 'tailwindcss/types/config'; + +export default plugin(function ({ addVariant, e }: PluginAPI) { + addVariant('hs-dropdown-open', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-dropdown.open > .${e( + `hs-dropdown-open${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-dropdown.open .hs-dropdown-toggle .${e( + `hs-dropdown-open${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-dropdown.open > .hs-dropdown-menu > .${e( + `hs-dropdown-open${separator}${className}`, + )}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-removing', (({ + modifySelectors, + separator, + }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-removing.${e(`hs-removing${separator}${className}`)}`; + }); + }) as TStringFunc); + + addVariant('hs-tooltip-shown', (({ + modifySelectors, + separator, + }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-tooltip.show .${e( + `hs-tooltip-shown${separator}${className}`, + )}`; + }); + }) as TStringFunc); + + addVariant('hs-accordion-active', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-accordion.active.${e( + `hs-accordion-active${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-accordion.active > .${e( + `hs-accordion-active${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-accordion.active > .hs-accordion-toggle .${e( + `hs-accordion-active${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle .${e( + `hs-accordion-active${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-accordion.active > .hs-accordion-toggle.${e( + `hs-accordion-active${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle.${e( + `hs-accordion-active${separator}${className}`, + )}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-accordion-selected', (({ + modifySelectors, + separator, + }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-accordion .selected.${e( + `hs-accordion-selected${separator}${className}`, + )}`; + }); + }) as TStringFunc); + + addVariant('hs-collapse-open', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-collapse.open .${e( + `hs-collapse-open${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-collapse.open.${e( + `hs-collapse-open${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-collapse-toggle.open .${e( + `hs-collapse-open${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-collapse-toggle.open.${e( + `hs-collapse-open${separator}${className}`, + )}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-tab-active', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `[data-hs-tab].active.${e( + `hs-tab-active${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `[data-hs-tab].active .${e( + `hs-tab-active${separator}${className}`, + )}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-overlay-open', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.open.${e(`hs-overlay-open${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.open .${e(`hs-overlay-open${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-overlay-layout-open', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-overlay-body-open.${e( + `hs-overlay-layout-open${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-overlay-body-open .${e( + `hs-overlay-layout-open${separator}${className}`, + )}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-overlay-backdrop-open', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-overlay-backdrop.${e( + `hs-overlay-backdrop-open${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.hs-overlay-backdrop .${e( + `hs-overlay-backdrop-open${separator}${className}`, + )}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-scrollspy-active', (({ + modifySelectors, + separator, + }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.active.${e(`hs-scrollspy-active${separator}${className}`)}`; + }); + }) as TStringFunc); + + addVariant('hs-carousel-active', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.active.${e(`hs-carousel-active${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.active .${e(`hs-carousel-active${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-carousel-disabled', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.disabled.${e( + `hs-carousel-disabled${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.disabled .${e( + `hs-carousel-disabled${separator}${className}`, + )}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-carousel-dragging', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.dragging.${e( + `hs-carousel-dragging${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }) => { + modifySelectors(({ className }) => { + return `.dragging .${e( + `hs-carousel-dragging${separator}${className}`, + )}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-selected', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.selected.${e(`hs-selected${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.selected .${e(`hs-selected${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-select-disabled', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.disabled.${e(`hs-select-disabled${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.disabled .${e(`hs-select-disabled${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-select-active', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.active.${e(`hs-select-active${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.active .${e(`hs-select-active${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-input-number-disabled', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.disabled.${e( + `hs-input-number-disabled${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.disabled .${e( + `hs-input-number-disabled${separator}${className}`, + )}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-pin-input-active', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.active.${e(`hs-pin-input-active${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.active .${e(`hs-pin-input-active${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-select-opened', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.opened.${e(`hs-select-opened${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-password-active', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.active.${e(`hs-password-active${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.active .${e(`hs-password-active${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-stepper-active', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.active.${e(`hs-stepper-active${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.active .${e(`hs-stepper-active${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-stepper-success', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.success.${e(`hs-stepper-success${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.success .${e(`hs-stepper-success${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-stepper-completed', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.completed.${e( + `hs-stepper-completed${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.completed .${e( + `hs-stepper-completed${separator}${className}`, + )}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-stepper-error', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.error.${e(`hs-stepper-error${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.error .${e(`hs-stepper-error${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-stepper-processed', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.processed.${e( + `hs-stepper-processed${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.processed .${e( + `hs-stepper-processed${separator}${className}`, + )}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-stepper-disabled', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.disabled.${e(`hs-stepper-disabled${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.disabled .${e(`hs-stepper-disabled${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-stepper-skipped', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.skipped.${e(`hs-stepper-skipped${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.skipped .${e(`hs-stepper-skipped${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-strong-password', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.passed.${e(`hs-strong-password${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.passed .${e(`hs-strong-password${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-strong-password-accepted', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.accepted.${e( + `hs-strong-password-accepted${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.accepted .${e( + `hs-strong-password-accepted${separator}${className}`, + )}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-strong-password-active', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.active.${e( + `hs-strong-password-active${separator}${className}`, + )}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-combo-box-active', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.active .${e(`hs-combo-box-active${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.active.${e(`hs-combo-box-active${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-combo-box-has-value', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.has-value .${e(`hs-combo-box-has-value${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.has-value.${e(`hs-combo-box-has-value${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-combo-box-selected', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.selected .${e( + `hs-combo-box-selected${separator}${className}`, + )}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.selected.${e( + `hs-combo-box-selected${separator}${className}`, + )}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-combo-box-tab-active', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.active.${e( + `hs-combo-box-tab-active${separator}${className}`, + )}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-apexcharts-tooltip-dark', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.dark.${e( + `hs-apexcharts-tooltip-dark${separator}${className}`, + )}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-success', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.success .${e(`hs-success${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.success.${e(`hs-success${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-error', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.error .${e(`hs-error${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.error.${e(`hs-error${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + // Datatables.net + addVariant('hs-datatable-ordering-asc', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.dt-ordering-asc .${e(`hs-datatable-ordering-asc${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.dt-ordering-asc.${e(`hs-datatable-ordering-asc${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + addVariant('hs-datatable-ordering-desc', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.dt-ordering-desc .${e(`hs-datatable-ordering-desc${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.dt-ordering-desc.${e(`hs-datatable-ordering-desc${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + // noUiSlider + addVariant('hs-range-slider-disabled', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.disabled .${e(`hs-range-slider-disabled${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.disabled.${e(`hs-range-slider-disabled${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + // Dropzone + addVariant('hs-file-upload-complete', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.complete .${e(`hs-file-upload-complete${separator}${className}`)}`; + }); + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.complete.${e(`hs-file-upload-complete${separator}${className}`)}`; + }); + }, + ] as TStringFunc[]); + + // Modes + addVariant('hs-default-mode-active', (({ + modifySelectors, + separator, + }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.default .${e(`hs-default-mode-active${separator}${className}`)}`; + }); + }) as TStringFunc); + + addVariant('hs-dark-mode-active', (({ + modifySelectors, + separator, + }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.dark .${e(`hs-dark-mode-active${separator}${className}`)}`; + }); + }) as TStringFunc); + + addVariant('hs-auto-mode-active', (({ + modifySelectors, + separator, + }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.auto .${e(`hs-auto-mode-active${separator}${className}`)}`; + }); + }) as TStringFunc); +}); diff --git a/preline.d.ts b/preline.d.ts index 3fd3f92..96d2c9e 100644 --- a/preline.d.ts +++ b/preline.d.ts @@ -58,13 +58,14 @@ export interface IAccordion { export declare class HSAccordion extends HSBasePlugin implements IAccordion { private readonly toggle; content: HTMLElement | null; - private readonly group; - private readonly isAlwaysOpened; + private group; + private isAlwaysOpened; static selectable: IAccordionTreeView[]; constructor(el: HTMLElement, options?: IAccordionOptions, events?: {}); private init; show(): boolean; hide(): boolean; + update(): boolean; static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem; static show(target: HTMLElement): void; static hide(target: HTMLElement): void; @@ -73,13 +74,24 @@ export declare class HSAccordion extends HSBasePlugin impleme static toggleSelected(root: IAccordionTreeView, item: HTMLElement): void; static on(evt: string, target: HTMLElement, cb: Function): void; } +export type TCarouselOptionsSlidesQty = { + [key: string]: number; +}; export interface ICarouselOptions { currentIndex: number; loadingClasses?: string | string[]; + dotsItemClasses?: string; + isAutoHeight?: boolean; isAutoPlay?: boolean; - speed?: number; + isCentered?: boolean; + isDraggable?: boolean; isInfiniteLoop?: boolean; isRTL?: boolean; + isSnap?: boolean; + hasSnapSpacers?: boolean; + slidesQty?: TCarouselOptionsSlidesQty | number; + speed?: number; + updateDelay?: number; } export interface ICarousel { options?: ICarouselOptions; @@ -89,28 +101,69 @@ export interface ICarousel { goTo(i: number): void; } export declare class HSCarousel extends HSBasePlugin implements ICarousel { + private currentIndex; + private readonly loadingClasses; + private readonly dotsItemClasses; + private readonly isAutoHeight; + private readonly isAutoPlay; + private readonly isCentered; + private readonly isDraggable; + private readonly isInfiniteLoop; + private readonly isRTL; + private readonly isSnap; + private readonly hasSnapSpacers; + private readonly slidesQty; + private readonly speed; + private readonly updateDelay; + private readonly loadingClassesRemove; + private readonly loadingClassesAdd; + private readonly afterLoadingClassesAdd; + private readonly container; private readonly inner; private readonly slides; private readonly prev; private readonly next; private readonly dots; + private dotsItems; + private readonly info; + private readonly infoTotal; + private readonly infoCurrent; private sliderWidth; - private currentIndex; - private readonly loadingClasses; - private readonly loadingClassesRemove; - private readonly loadingClassesAdd; - private readonly afterLoadingClassesAdd; - private readonly isAutoPlay; - private readonly isRTL; - private readonly speed; - private readonly isInfiniteLoop; private timer; + private isScrolling; + private isDragging; + private dragStartX; + private initialTranslateX; private readonly touchX; + private resizeContainer; + resizeContainerWidth: number; constructor(el: HTMLElement, options?: ICarouselOptions); + private setIsSnap; private init; + private initDragHandling; + private getTranslateXValue; + private removeClickEventWhileDragging; + private handleDragStart; + private handleDragMove; + private handleDragEnd; + private getEventX; + private getCurrentSlidesQty; + private buildSnapSpacers; + private initDots; + private buildDots; + private setDots; + private goToCurrentDot; + private buildInfo; + private setInfoTotal; + private setInfoCurrent; + private buildSingleDot; + private singleDotEvents; private observeResize; private calculateWidth; private addCurrentClass; + private setCurrentDot; + private setElementToDisabled; + private unsetElementToDisabled; private addDisabledClass; private autoPlay; private setTimer; @@ -118,9 +171,11 @@ export declare class HSCarousel extends HSBasePlugin implement private detectDirection; recalculateWidth(): void; private calculateTransform; + private setTranslate; goToPrev(): void; goToNext(): void; goTo(i: number): void; + private setIndex; static getInstance(target: HTMLElement | string, isInstance?: boolean): HSCarousel | ICollectionItem; static autoInit(): void; } @@ -341,6 +396,7 @@ export interface IOverlayOptions { isClosePrev?: boolean; backdropClasses?: string | null; backdropExtraClasses?: string | null; + moveOverlayToBody?: number | null; } export interface IOverlay { options?: IOverlayOptions; @@ -358,6 +414,7 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private autoHide; private readonly overlayId; overlay: HTMLElement | null; + initContainer: HTMLElement | null; isCloseWhenClickInside: boolean; isTabAccessibilityLimited: boolean; isLayoutAffect: boolean; @@ -365,6 +422,7 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { hasAbilityToCloseOnBackdropClick: boolean; openedBreakpoint: number | null; autoClose: number | null; + moveOverlayToBody: number | null; constructor(el: HTMLElement, options?: IOverlayOptions, events?: {}); private init; private hideAuto; @@ -457,6 +515,13 @@ export interface ISingleOption { selected?: boolean; options?: ISingleOptionOptions | null; } +export interface IApiFieldMap { + id: string; + title: string; + icon?: string | null; + description?: string | null; + [key: string]: unknown; +} export interface ISelectOptions { value?: string | string[]; isOpened?: boolean; @@ -466,6 +531,13 @@ export interface ISelectOptions { mode?: string; viewport?: string; wrapperClasses?: string; + apiUrl?: string | null; + apiQuery?: string | null; + apiOptions?: RequestInit | null; + apiDataPart?: string | null; + apiSearchQueryKey?: string | null; + apiFieldsMap?: IApiFieldMap | null; + apiIconTag?: string | null; toggleTag?: string; toggleClasses?: string; toggleSeparators?: { @@ -477,6 +549,7 @@ export interface ISelectOptions { toggleCountTextMode?: string; tagsItemTemplate?: string; tagsItemClasses?: string; + tagsInputId?: string; tagsInputClasses?: string; dropdownTag?: string; dropdownClasses?: string; @@ -485,11 +558,18 @@ export interface ISelectOptions { bottom?: string; }; dropdownSpace: number; + dropdownPlacement: string | null; + dropdownScope: "window" | "parent"; extraMarkup?: string | string[] | null; + searchTemplate?: string; searchWrapperTemplate?: string; + searchId?: string; + searchLimit?: number | typeof Infinity; + isSearchDirectMatch?: boolean; searchClasses?: string; searchWrapperClasses?: string; searchPlaceholder?: string; + searchNoResultTemplate?: string | null; searchNoResultText?: string | null; searchNoResultClasses?: string | null; optionTemplate?: string; @@ -519,6 +599,13 @@ export declare class HSSelect extends HSBasePlugin implements IS isMultiple: boolean | null; isDisabled: boolean | null; selectedItems: string[]; + private readonly apiUrl; + private readonly apiQuery; + private readonly apiOptions; + private readonly apiDataPart; + private readonly apiSearchQueryKey; + private readonly apiFieldsMap; + private readonly apiIconTag; private readonly toggleTag; private readonly toggleClasses; private readonly toggleSeparators; @@ -528,15 +615,23 @@ export declare class HSSelect extends HSBasePlugin implements IS private readonly wrapperClasses; private readonly tagsItemTemplate; private readonly tagsItemClasses; + private readonly tagsInputId; private readonly tagsInputClasses; private readonly dropdownTag; private readonly dropdownClasses; private readonly dropdownDirectionClasses; dropdownSpace: number | null; + readonly dropdownPlacement: string | null; + readonly dropdownScope: "window" | "parent"; + private readonly searchTemplate; private readonly searchWrapperTemplate; private readonly searchPlaceholder; + private readonly searchId; + private readonly searchLimit; + private readonly isSearchDirectMatch; private readonly searchClasses; private readonly searchWrapperClasses; + private readonly searchNoResultTemplate; private readonly searchNoResultText; private readonly searchNoResultClasses; private readonly optionTag; @@ -550,6 +645,7 @@ export declare class HSSelect extends HSBasePlugin implements IS private toggleTextWrapper; private tagsInput; private dropdown; + private popperInstance; private searchWrapper; private search; private searchNoResult; @@ -557,6 +653,8 @@ export declare class HSSelect extends HSBasePlugin implements IS private extraMarkup; private readonly isAddTagOnEnter; private tagsInputHelper; + private remoteOptions; + private optionId; constructor(el: HTMLElement, options?: ISelectOptions); setValue(val: string | string[]): void; private init; @@ -573,8 +671,16 @@ export declare class HSSelect extends HSBasePlugin implements IS private setTagsItems; private buildTagsInput; private buildDropdown; + private buildPopper; + private updateDropdownWidth; private buildSearch; private buildOption; + private buildOptionFromRemoteData; + private buildOptionsFromRemoteData; + private optionsFromRemoteData; + private apiRequest; + private sortElements; + private remoteSearch; private destroyOption; private buildOriginalOption; private destroyOriginalOption; @@ -588,6 +694,8 @@ export declare class HSSelect extends HSBasePlugin implements IS private resetTagsInputField; private clearSelections; private setNewValue; + private stringFromValueBasic; + private stringFromValueRemoteData; private stringFromValue; private selectSingleItem; private selectMultipleItems; @@ -595,6 +703,7 @@ export declare class HSSelect extends HSBasePlugin implements IS private searchOptions; private eraseToggleIcon; private eraseToggleTitle; + private toggleFn; destroy(): void; open(): boolean; close(): boolean; @@ -774,6 +883,25 @@ export declare class HSTabs extends HSBasePlugin<{}> implements ITabs { static onStartEnd(isOpposite?: boolean): void; static on(evt: string, target: HTMLElement, cb: Function): void; } +export interface ITextareaAutoHeightOptions { + defaultHeight: number; +} +export interface ITextareaAutoHeight { + options?: ITextareaAutoHeightOptions; +} +export declare class HSTextareaAutoHeight extends HSBasePlugin implements ITextareaAutoHeight { + private readonly defaultHeight; + constructor(el: HTMLTextAreaElement, options?: ITextareaAutoHeightOptions); + private init; + private setAutoHeight; + private textareaSetHeight; + private checkIfOneLine; + private isParentHidden; + private parentType; + private callbackAccordingToType; + static getInstance(target: HTMLTextAreaElement | string, isInstance?: boolean): HSTextareaAutoHeight | ICollectionItem; + static autoInit(): void; +} export interface IThemeSwitchOptions { theme?: "dark" | "light" | "default"; } @@ -868,6 +996,47 @@ export declare class HSTooltip extends HSBasePlugin<{}> implements ITooltip { static hide(target: HTMLElement): void; static on(evt: string, target: HTMLElement, cb: Function): void; } +export type ITreeViewOptionsControlBy = "checkbox" | "button"; +export interface ITreeViewItem { + id: string; + value: string; + isDir: boolean; + path: string; + isSelected?: boolean; +} +export interface ITreeViewOptions { + items: ITreeViewItem[] | null; + controlBy?: ITreeViewOptionsControlBy; + autoSelectChildren?: boolean; + isIndeterminate?: boolean; +} +export interface ITreeView { + options?: ITreeViewOptions; +} +export declare class HSTreeView extends HSBasePlugin implements ITreeView { + private items; + private readonly controlBy; + private readonly autoSelectChildren; + private readonly isIndeterminate; + static group: number; + constructor(el: HTMLElement, options?: ITreeViewOptions, events?: {}); + private init; + private initItems; + private controlByButton; + private controlByCheckbox; + private getItem; + private getPath; + private unselectItem; + private selectItem; + private selectChildren; + private toggleParent; + update(): void; + getSelectedItems(): ITreeViewItem[]; + changeItemProp(id: string, prop: string, val: any): void; + static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem; + static autoInit(): void; + static on(evt: string, target: HTMLElement, cb: Function): void; +} export interface IStaticMethods { getClassProperty(el: HTMLElement, prop?: string, val?: string): string; afterTransition(el: HTMLElement, cb: Function): void; @@ -877,10 +1046,12 @@ export interface IStaticMethods { export declare const HSStaticMethods: IStaticMethods; declare let HSDataTableModule: any; declare let HSFileUploadModule: any; +declare let HSRangeSliderModule: any; export { HSDataTableModule as HSDataTable, HSFileUploadModule as HSFileUpload, + HSRangeSliderModule as HSRangeSlider, }; export {}; diff --git a/preline.js b/preline.js index 3e4f2f8..cb4963a 100644 --- a/preline.js +++ b/preline.js @@ -1,177 +1,214 @@ -!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={170:(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:()=>g,beforeWrite:()=>x,bottom:()=>i,clippingParents:()=>d,computeStyles:()=>nt,createPopper:()=>Pt,createPopperBase:()=>kt,createPopperLite:()=>Bt,detectOverflow:()=>yt,end:()=>u,eventListeners:()=>it,flip:()=>wt,hide:()=>St,left:()=>s,main:()=>C,modifierPhases:()=>E,offset:()=>xt,placements:()=>m,popper:()=>h,popperGenerator:()=>_t,popperOffsets:()=>It,preventOverflow:()=>Tt,read:()=>y,reference:()=>f,right:()=>r,start:()=>c,top:()=>o,variationPlacements:()=>v,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",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])}),[]),g="beforeRead",y="read",w="afterRead",b="beforeMain",C="main",S="afterMain",x="beforeWrite",I="write",T="afterWrite",E=[g,y,w,b,C,S,x,I,T];function L(t){return t?(t.nodeName||"").toLowerCase():null}function O(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 O(t).Element||t instanceof Element}function _(t){return t instanceof O(t).HTMLElement||t instanceof HTMLElement}function k(t){return"undefined"!=typeof ShadowRoot&&(t instanceof O(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)&&L(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)&&L(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,H=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 M(){return!/^((?!chrome|android).)*safari/i.test(D())}function j(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&&H(o.width)/t.offsetWidth||1,r=t.offsetHeight>0&&H(o.height)/t.offsetHeight||1);var s=(A(t)?O(t):window).visualViewport,l=!M()&&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 $(t){var e=j(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 V(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 R(t){return O(t).getComputedStyle(t)}function F(t){return["table","td","th"].indexOf(L(t))>=0}function W(t){return((A(t)?t.ownerDocument:t.document)||window.document).documentElement}function z(t){return"html"===L(t)?t:t.assignedSlot||t.parentNode||(k(t)?t.host:null)||W(t)}function U(t){return _(t)&&"fixed"!==R(t).position?t.offsetParent:null}function J(t){for(var e=O(t),n=U(t);n&&F(n)&&"static"===R(n).position;)n=U(n);return n&&("html"===L(n)||"body"===L(n)&&"static"===R(n).position)?e:n||function(t){var e=/firefox/i.test(D());if(/Trident/i.test(D())&&_(t)&&"fixed"===R(t).position)return null;var n=z(t);for(k(n)&&(n=n.host);_(n)&&["html","body"].indexOf(L(n))<0;){var o=R(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 Y(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Z(t,e,n){return q(t,N(e,n))}function K(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function G(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=Y(p),f=[s,r].indexOf(p)>=0?"height":"width";if(u&&d){var v=function(t,e){return K("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:G(t,a))}(c.padding,n),m=$(u),g="y"===h?o:s,y="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,x=w/2-b/2,I=v[g],T=S-m[f]-v[y],E=S/2-m[f]/2+x,L=Z(I,E,T),O=h;n.modifiersData[l]=((e={})[O]=L,e.centerOffset=L-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)))&&V(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function X(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,g=d.x,y=void 0===g?0:g,w=d.y,b=void 0===w?0:w,C="function"==typeof v?v({x:y,y:b}):{x:y,y:b};y=C.x,b=C.y;var S=d.hasOwnProperty("x"),x=d.hasOwnProperty("y"),I=s,T=o,E=window;if(f){var L=J(n),A="clientHeight",_="clientWidth";if(L===O(n)&&"static"!==R(L=W(n)).position&&"absolute"===p&&(A="scrollHeight",_="scrollWidth"),a===o||(a===s||a===r)&&c===u)T=i,b-=(m&&L===E&&E.visualViewport?E.visualViewport.height:L[A])-l.height,b*=h?1:-1;if(a===s||(a===o||a===i)&&c===u)I=r,y-=(m&&L===E&&E.visualViewport?E.visualViewport.width:L[_])-l.width,y*=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:H(n*i)/i||0,y:H(o*i)/i||0}}({x:y,y:b},O(n)):{x:y,y:b};return y=B.x,b=B.y,h?Object.assign({},P,((k={})[T]=x?"0":"",k[I]=S?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",k)):Object.assign({},P,((e={})[T]=x?b+"px":"",e[I]=S?y+"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:X(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=O(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=O(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ut(t){return j(W(t)).left+ct(t).scrollLeft}function dt(t){var e=R(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(L(t))>=0?t.ownerDocument.body:_(t)&&dt(t)?t:pt(z(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=O(o),s=i?[r].concat(r.visualViewport||[],dt(o)?o:[]):o,l=e.concat(s);return i?l:l.concat(ht(z(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=O(t),o=W(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;var c=M();(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=j(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=W(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"===R(i||n).direction&&(l+=q(n.clientWidth,i?i.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}(W(t)))}function mt(t,e,n,o){var i="clippingParents"===e?function(t){var e=ht(z(t)),n=["absolute","fixed"].indexOf(R(t).position)>=0&&_(t)?J(t):t;return A(n)?e.filter((function(t){return A(t)&&V(t,n)&&"body"!==L(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=N(i.right,e.right),e.bottom=N(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 gt(t){var e,n=t.reference,l=t.element,a=t.placement,d=a?B(a):null,p=a?X(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?Y(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 yt(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,g=n.rootBoundary,y=void 0===g?p:g,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=K("number"!=typeof I?I:G(I,a)),E=b===h?f:h,L=t.rects.popper,O=t.elements[S?E:b],_=mt(A(O)?O:O.contextElement||W(t.elements.popper),m,y,u),k=j(t.elements.reference),P=gt({reference:k,element:L,strategy:"absolute",placement:l}),B=ft(Object.assign({},L,P)),q=b===h?B:k,N={top:_.top-q.top+T.top,bottom:q.bottom-_.bottom+T.bottom,left:_.left-q.left+T.left,right:q.right-_.right+T.right},H=t.modifiersData.offset;if(b===h&&H){var D=H[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]+=D[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,g=n.fallbackPlacements,y=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),L=g||(E===T||!x?[st(T)]:function(t){if(B(t)===l)return[];var e=st(t);return[at(t),e,at(e)]}(T)),O=[T].concat(L).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=X(o),p=d?l?v:v.filter((function(t){return X(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]=yt(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:y,flipVariations:x,allowedAutoPlacements:I}):n)}),[]),A=e.rects.reference,_=e.rects.popper,k=new Map,P=!0,q=O[0],N=0;N=0,$=j?"width":"height",V=yt(e,{placement:H,boundary:w,rootBoundary:b,altBoundary:C,padding:y}),R=j?M?r:s:M?i:o;A[$]>_[$]&&(R=st(R));var F=st(R),W=[];if(p&&W.push(V[D]<=0),f&&W.push(V[R]<=0,V[F]<=0),W.every((function(t){return t}))){q=H,P=!1;break}k.set(H,W)}if(P)for(var z=function(t){var e=O.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"},U=x?3:1;U>0;U--){if("break"===z(U))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=yt(e,{elementContext:"reference"}),l=yt(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=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 It={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=gt({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,v=n.altBoundary,m=n.padding,g=n.tether,y=void 0===g||g,w=n.tetherOffset,b=void 0===w?0:w,C=yt(e,{boundary:h,rootBoundary:f,padding:m,altBoundary:v}),S=B(e.placement),x=X(e.placement),I=!x,T=Y(S),E="x"===T?"y":"x",L=e.modifiersData.popperOffsets,O=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,H={x:0,y:0};if(L){if(u){var D,M="y"===T?o:s,j="y"===T?i:r,V="y"===T?"height":"width",R=L[T],F=R+C[M],W=R-C[j],z=y?-A[V]/2:0,U=x===c?O[V]:A[V],K=x===c?-A[V]:-O[V],G=e.elements.arrow,Q=y&&G?$(G):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[M],nt=tt[j],ot=Z(0,O[V],Q[V]),it=I?O[V]/2-z-ot-et-k.mainAxis:U-ot-et-k.mainAxis,rt=I?-O[V]/2+z+ot+nt+k.mainAxis:K+ot+nt+k.mainAxis,st=e.elements.arrow&&J(e.elements.arrow),lt=st?"y"===T?st.clientTop||0:st.clientLeft||0:0,at=null!=(D=null==P?void 0:P[T])?D:0,ct=R+rt-at,ut=Z(y?N(F,R+it-at-lt):F,R,y?q(W,ct):W);L[T]=ut,H[T]=ut-R}if(p){var dt,pt="x"===T?o:s,ht="x"===T?i:r,ft=L[E],vt="y"===E?"height":"width",mt=ft+C[pt],gt=ft-C[ht],wt=-1!==[o,s].indexOf(S),bt=null!=(dt=null==P?void 0:P[E])?dt:0,Ct=wt?mt:ft-O[vt]-A[vt]-bt+k.altAxis,St=wt?ft+O[vt]+A[vt]-bt-k.altAxis:gt,xt=y&&wt?function(t,e,n){var o=Z(t,e,n);return o>n?n:o}(Ct,ft,St):Z(y?Ct:mt,ft,y?St:gt);L[E]=xt,H[E]=xt-ft}e.modifiersData[l]=H}},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=H(e.width)/t.offsetWidth||1,o=H(e.height)/t.offsetHeight||1;return 1!==n||1!==o}(e),l=W(e),a=j(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==L(e)||dt(l))&&(c=(o=e)!==O(o)&&_(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:ct(o)),_(e)?((u=j(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 Lt(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 Ot={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}},158:function(t,e,n){var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.HSFileUpload=e.HSDataTable=e.HSStaticMethods=e.HSTooltip=e.HSTogglePassword=e.HSToggleCount=e.HSThemeSwitch=e.HSTabs=e.HSStrongPassword=e.HSStepper=e.HSSelect=e.HSScrollspy=e.HSRemoveElement=e.HSPinInput=e.HSOverlay=e.HSInputNumber=e.HSDropdown=e.HSComboBox=e.HSCollapse=e.HSCarousel=e.HSAccordion=e.HSCopyMarkup=void 0;var i=n(406);Object.defineProperty(e,"HSCopyMarkup",{enumerable:!0,get:function(){return o(i).default}});var r=n(740);Object.defineProperty(e,"HSAccordion",{enumerable:!0,get:function(){return o(r).default}});var s=n(268);Object.defineProperty(e,"HSCarousel",{enumerable:!0,get:function(){return o(s).default}});var l=n(485);Object.defineProperty(e,"HSCollapse",{enumerable:!0,get:function(){return o(l).default}});var a=n(809);Object.defineProperty(e,"HSComboBox",{enumerable:!0,get:function(){return o(a).default}});var c=n(891);Object.defineProperty(e,"HSDropdown",{enumerable:!0,get:function(){return o(c).default}});var u=n(332);Object.defineProperty(e,"HSInputNumber",{enumerable:!0,get:function(){return o(u).default}});var d=n(850);Object.defineProperty(e,"HSOverlay",{enumerable:!0,get:function(){return o(d).default}});var p=n(60);Object.defineProperty(e,"HSPinInput",{enumerable:!0,get:function(){return o(p).default}});var h=n(911);Object.defineProperty(e,"HSRemoveElement",{enumerable:!0,get:function(){return o(h).default}});var f=n(751);Object.defineProperty(e,"HSScrollspy",{enumerable:!0,get:function(){return o(f).default}});var v=n(442);Object.defineProperty(e,"HSSelect",{enumerable:!0,get:function(){return o(v).default}});var m=n(887);Object.defineProperty(e,"HSStepper",{enumerable:!0,get:function(){return o(m).default}});var g=n(97);Object.defineProperty(e,"HSStrongPassword",{enumerable:!0,get:function(){return o(g).default}});var y=n(166);Object.defineProperty(e,"HSTabs",{enumerable:!0,get:function(){return o(y).default}});var w=n(502);Object.defineProperty(e,"HSThemeSwitch",{enumerable:!0,get:function(){return o(w).default}});var b=n(684);Object.defineProperty(e,"HSToggleCount",{enumerable:!0,get:function(){return o(b).default}});var C=n(100);Object.defineProperty(e,"HSTogglePassword",{enumerable:!0,get:function(){return o(C).default}});var S=n(969);Object.defineProperty(e,"HSTooltip",{enumerable:!0,get:function(){return o(S).default}});var x=n(957);Object.defineProperty(e,"HSStaticMethods",{enumerable:!0,get:function(){return o(x).default}}),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery?e.HSDataTable=n(814).default:e.HSDataTable=null,"undefined"!=typeof _&&"undefined"!=typeof Dropzone?e.HSFileUpload=n(234).default:e.HSFileUpload=null},740: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 i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(self,(()=>(()=>{"use strict";var t={170:(t,e,n)=>{n.r(e),n.d(e,{afterMain:()=>C,afterRead:()=>w,afterWrite:()=>T,applyStyles:()=>P,arrow:()=>Z,auto:()=>l,basePlacements:()=>a,beforeMain:()=>b,beforeRead:()=>g,beforeWrite:()=>x,bottom:()=>o,clippingParents:()=>d,computeStyles:()=>nt,createPopper:()=>Pt,createPopperBase:()=>kt,createPopperLite:()=>Dt,detectOverflow:()=>yt,end:()=>u,eventListeners:()=>ot,flip:()=>wt,hide:()=>Ct,left:()=>s,main:()=>S,modifierPhases:()=>E,offset:()=>xt,placements:()=>m,popper:()=>h,popperGenerator:()=>_t,popperOffsets:()=>It,preventOverflow:()=>Tt,read:()=>y,reference:()=>f,right:()=>r,start:()=>c,top:()=>i,variationPlacements:()=>v,viewport:()=>p,write:()=>I});var i="top",o="bottom",r="right",s="left",l="auto",a=[i,o,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])}),[]),g="beforeRead",y="read",w="afterRead",b="beforeMain",S="main",C="afterMain",x="beforeWrite",I="write",T="afterWrite",E=[g,y,w,b,S,C,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 _(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]||{},i=e.attributes[t]||{},o=e.elements[t];_(o)&&O(o)&&(Object.assign(o.style,n),Object.keys(i).forEach((function(t){var e=i[t];!1===e?o.removeAttribute(t):o.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 i=e.elements[t],o=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});_(i)&&O(i)&&(Object.assign(i.style,r),Object.keys(o).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]};function D(t){return t.split("-")[0]}var B=Math.max,q=Math.min,H=Math.round;function M(){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 N(){return!/^((?!chrome|android).)*safari/i.test(M())}function j(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var i=t.getBoundingClientRect(),o=1,r=1;e&&_(t)&&(o=t.offsetWidth>0&&H(i.width)/t.offsetWidth||1,r=t.offsetHeight>0&&H(i.height)/t.offsetHeight||1);var s=(A(t)?L(t):window).visualViewport,l=!N()&&n,a=(i.left+(l&&s?s.offsetLeft:0))/o,c=(i.top+(l&&s?s.offsetTop:0))/r,u=i.width/o,d=i.height/r;return{width:u,height:d,top:c,right:a+u,bottom:c+d,left:a,x:a,y:c}}function $(t){var e=j(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function V(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&k(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function R(t){return L(t).getComputedStyle(t)}function F(t){return["table","td","th"].indexOf(O(t))>=0}function W(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)||W(t)}function z(t){return _(t)&&"fixed"!==R(t).position?t.offsetParent:null}function Q(t){for(var e=L(t),n=z(t);n&&F(n)&&"static"===R(n).position;)n=z(n);return n&&("html"===O(n)||"body"===O(n)&&"static"===R(n).position)?e:n||function(t){var e=/firefox/i.test(M());if(/Trident/i.test(M())&&_(t)&&"fixed"===R(t).position)return null;var n=U(t);for(k(n)&&(n=n.host);_(n)&&["html","body"].indexOf(O(n))<0;){var i=R(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(t)||e}function J(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function K(t,e,n){return B(t,q(e,n))}function Y(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 Z={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=D(n.placement),h=J(p),f=[s,r].indexOf(p)>=0?"height":"width";if(u&&d){var v=function(t,e){return Y("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:X(t,a))}(c.padding,n),m=$(u),g="y"===h?i:s,y="y"===h?o:r,w=n.rects.reference[f]+n.rects.reference[h]-d[h]-n.rects.popper[f],b=d[h]-n.rects.reference[h],S=Q(u),C=S?"y"===h?S.clientHeight||0:S.clientWidth||0:0,x=w/2-b/2,I=v[g],T=C-m[f]-v[y],E=C/2-m[f]/2+x,O=K(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,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&V(e.elements.popper,i)&&(e.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function G(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,g=d.x,y=void 0===g?0:g,w=d.y,b=void 0===w?0:w,S="function"==typeof v?v({x:y,y:b}):{x:y,y:b};y=S.x,b=S.y;var C=d.hasOwnProperty("x"),x=d.hasOwnProperty("y"),I=s,T=i,E=window;if(f){var O=Q(n),A="clientHeight",_="clientWidth";if(O===L(n)&&"static"!==R(O=W(n)).position&&"absolute"===p&&(A="scrollHeight",_="scrollWidth"),a===i||(a===s||a===r)&&c===u)T=o,b-=(m&&O===E&&E.visualViewport?E.visualViewport.height:O[A])-l.height,b*=h?1:-1;if(a===s||(a===i||a===o)&&c===u)I=r,y-=(m&&O===E&&E.visualViewport?E.visualViewport.width:O[_])-l.width,y*=h?1:-1}var k,P=Object.assign({position:p},f&&tt),D=!0===v?function(t,e){var n=t.x,i=t.y,o=e.devicePixelRatio||1;return{x:H(n*o)/o||0,y:H(i*o)/o||0}}({x:y,y:b},L(n)):{x:y,y:b};return y=D.x,b=D.y,h?Object.assign({},P,((k={})[T]=x?"0":"",k[I]=C?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",k)):Object.assign({},P,((e={})[T]=x?b+"px":"",e[I]=C?y+"px":"",e.transform="",e))}const nt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,i=n.gpuAcceleration,o=void 0===i||i,r=n.adaptive,s=void 0===r||r,l=n.roundOffsets,a=void 0===l||l,c={placement:D(e.placement),variation:G(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,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 it={passive:!0};const ot={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,i=t.options,o=i.scroll,r=void 0===o||o,s=i.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,it)})),l&&a.addEventListener("resize",n.update,it),function(){r&&c.forEach((function(t){t.removeEventListener("scroll",n.update,it)})),l&&a.removeEventListener("resize",n.update,it)}},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 j(W(t)).left+ct(t).scrollLeft}function dt(t){var e=R(t),n=e.overflow,i=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+i)}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 i=pt(t),o=i===(null==(n=t.ownerDocument)?void 0:n.body),r=L(i),s=o?[r].concat(r.visualViewport||[],dt(i)?i:[]):i,l=e.concat(s);return o?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),i=W(t),o=n.visualViewport,r=i.clientWidth,s=i.clientHeight,l=0,a=0;if(o){r=o.width,s=o.height;var c=N();(c||!c&&"fixed"===e)&&(l=o.offsetLeft,a=o.offsetTop)}return{width:r,height:s,x:l+ut(t),y:a}}(t,n)):A(e)?function(t,e){var n=j(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=W(t),i=ct(t),o=null==(e=t.ownerDocument)?void 0:e.body,r=B(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=B(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-i.scrollLeft+ut(t),a=-i.scrollTop;return"rtl"===R(o||n).direction&&(l+=B(n.clientWidth,o?o.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}(W(t)))}function mt(t,e,n,i){var o="clippingParents"===e?function(t){var e=ht(U(t)),n=["absolute","fixed"].indexOf(R(t).position)>=0&&_(t)?Q(t):t;return A(n)?e.filter((function(t){return A(t)&&V(t,n)&&"body"!==O(t)})):[]}(t):[].concat(e),r=[].concat(o,[n]),s=r[0],l=r.reduce((function(e,n){var o=vt(t,n,i);return e.top=B(o.top,e.top),e.right=q(o.right,e.right),e.bottom=q(o.bottom,e.bottom),e.left=B(o.left,e.left),e}),vt(t,s,i));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function gt(t){var e,n=t.reference,l=t.element,a=t.placement,d=a?D(a):null,p=a?G(a):null,h=n.x+n.width/2-l.width/2,f=n.y+n.height/2-l.height/2;switch(d){case i:e={x:h,y:n.y-l.height};break;case o: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?J(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 yt(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,g=n.rootBoundary,y=void 0===g?p:g,w=n.elementContext,b=void 0===w?h:w,S=n.altBoundary,C=void 0!==S&&S,x=n.padding,I=void 0===x?0:x,T=Y("number"!=typeof I?I:X(I,a)),E=b===h?f:h,O=t.rects.popper,L=t.elements[C?E:b],_=mt(A(L)?L:L.contextElement||W(t.elements.popper),m,y,u),k=j(t.elements.reference),P=gt({reference:k,element:O,strategy:"absolute",placement:l}),D=ft(Object.assign({},O,P)),B=b===h?D:k,q={top:_.top-B.top+T.top,bottom:B.bottom-_.bottom+T.bottom,left:_.left-B.left+T.left,right:B.right-_.right+T.right},H=t.modifiersData.offset;if(b===h&&H){var M=H[l];Object.keys(q).forEach((function(t){var e=[r,o].indexOf(t)>=0?1:-1,n=[i,o].indexOf(t)>=0?"y":"x";q[t]+=M[n]*e}))}return q}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,g=n.fallbackPlacements,y=n.padding,w=n.boundary,b=n.rootBoundary,S=n.altBoundary,C=n.flipVariations,x=void 0===C||C,I=n.allowedAutoPlacements,T=e.options.placement,E=D(T),O=g||(E===T||!x?[st(T)]:function(t){if(D(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(D(n)===l?function(t,e){void 0===e&&(e={});var n=e,i=n.placement,o=n.boundary,r=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=void 0===c?m:c,d=G(i),p=d?l?v:v.filter((function(t){return G(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]=yt(t,{placement:n,boundary:o,rootBoundary:r,padding:s})[D(n)],e}),{});return Object.keys(f).sort((function(t,e){return f[t]-f[e]}))}(e,{placement:n,boundary:w,rootBoundary:b,padding:y,flipVariations:x,allowedAutoPlacements:I}):n)}),[]),A=e.rects.reference,_=e.rects.popper,k=new Map,P=!0,B=L[0],q=0;q=0,$=j?"width":"height",V=yt(e,{placement:H,boundary:w,rootBoundary:b,altBoundary:S,padding:y}),R=j?N?r:s:N?o:i;A[$]>_[$]&&(R=st(R));var F=st(R),W=[];if(p&&W.push(V[M]<=0),f&&W.push(V[R]<=0,V[F]<=0),W.every((function(t){return t}))){B=H,P=!1;break}k.set(H,W)}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 B=e,"break"},z=x?3:1;z>0;z--){if("break"===U(z))break}e.placement!==B&&(e.modifiersData[u]._skip=!0,e.placement=B,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 St(t){return[i,r,o,s].some((function(e){return t[e]>=0}))}const Ct={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,i=e.rects.reference,o=e.rects.popper,r=e.modifiersData.preventOverflow,s=yt(e,{elementContext:"reference"}),l=yt(e,{altBoundary:!0}),a=bt(s,i),c=bt(l,o,r),u=St(a),d=St(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,o=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 o=D(t),l=[s,i].indexOf(o)>=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(o)>=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[o]=c}};const It={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=gt({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,v=n.altBoundary,m=n.padding,g=n.tether,y=void 0===g||g,w=n.tetherOffset,b=void 0===w?0:w,S=yt(e,{boundary:h,rootBoundary:f,padding:m,altBoundary:v}),C=D(e.placement),x=G(e.placement),I=!x,T=J(C),E="x"===T?"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,H={x:0,y:0};if(O){if(u){var M,N="y"===T?i:s,j="y"===T?o:r,V="y"===T?"height":"width",R=O[T],F=R+S[N],W=R-S[j],U=y?-A[V]/2:0,z=x===c?L[V]:A[V],Y=x===c?-A[V]:-L[V],X=e.elements.arrow,Z=y&&X?$(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[N],nt=tt[j],it=K(0,L[V],Z[V]),ot=I?L[V]/2-U-it-et-k.mainAxis:z-it-et-k.mainAxis,rt=I?-L[V]/2+U+it+nt+k.mainAxis:Y+it+nt+k.mainAxis,st=e.elements.arrow&&Q(e.elements.arrow),lt=st?"y"===T?st.clientTop||0:st.clientLeft||0:0,at=null!=(M=null==P?void 0:P[T])?M:0,ct=R+rt-at,ut=K(y?q(F,R+ot-at-lt):F,R,y?B(W,ct):W);O[T]=ut,H[T]=ut-R}if(p){var dt,pt="x"===T?i:s,ht="x"===T?o:r,ft=O[E],vt="y"===E?"height":"width",mt=ft+S[pt],gt=ft-S[ht],wt=-1!==[i,s].indexOf(C),bt=null!=(dt=null==P?void 0:P[E])?dt:0,St=wt?mt:ft-L[vt]-A[vt]-bt+k.altAxis,Ct=wt?ft+L[vt]+A[vt]-bt-k.altAxis:gt,xt=y&&wt?function(t,e,n){var i=K(t,e,n);return i>n?n:i}(St,ft,Ct):K(y?St:mt,ft,y?Ct:gt);O[E]=xt,H[E]=xt-ft}e.modifiersData[l]=H}},requiresIfExists:["offset"]};function Et(t,e,n){void 0===n&&(n=!1);var i,o,r=_(e),s=_(e)&&function(t){var e=t.getBoundingClientRect(),n=H(e.width)/t.offsetWidth||1,i=H(e.height)/t.offsetHeight||1;return 1!==n||1!==i}(e),l=W(e),a=j(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==O(e)||dt(l))&&(c=(i=e)!==L(i)&&_(i)?{scrollLeft:(o=i).scrollLeft,scrollTop:o.scrollTop}:ct(i)),_(e)?((u=j(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,i=[];function o(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var i=e.get(t);i&&o(i)}})),i.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||o(t)})),i}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={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},158:function(t,e,n){ /* - * HSAccordion - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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 .hs-accordion.active")&&this.group.querySelector(":scope > .hs-accordion.active")!==this.el&&window.$hsAccordionCollection.find((function(t){return t.element.el===e.group.querySelector(":scope > .hs-accordion.active")})).element.hide();if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.content.style.display="block",this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px")})),(0,l.afterTransition)(this.content,(function(){e.content.style.display="block",e.content.style.height="",e.fireEvent("open",e.el),(0,l.dispatch)("open.hs.accordion",e.el,e.el)}))},e.prototype.hide=function(){var t,e=this;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),(0,l.afterTransition)(this.content,(function(){e.content.style.display="",e.content.style.height="0",e.fireEvent("close",e.el),(0,l.dispatch)("close.hs.accordion",e.el,e.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.treeView=function(){var t=this;if(!document.querySelectorAll(".hs-accordion-treeview-root").length)return!1;this.selectable=[],document.querySelectorAll(".hs-accordion-treeview-root").forEach((function(e){var n=null==e?void 0:e.getAttribute("data-hs-accordion-options"),o=n?JSON.parse(n):{};t.selectable.push({el:e,options:r({},o)})})),this.selectable.length&&this.selectable.forEach((function(e){e.el.querySelectorAll(".hs-accordion-selectable").forEach((function(n){n.addEventListener("click",(function(o){o.stopPropagation(),t.toggleSelected(e,n)}))}))}))},e.toggleSelected=function(t,e){e.classList.contains("selected")?e.classList.remove("selected"):(t.el.querySelectorAll(".hs-accordion-selectable").forEach((function(t){return t.classList.remove("selected")})),e.classList.add("selected"))},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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit(),document.querySelectorAll(".hs-accordion-treeview-root").length&&a.treeView()})),"undefined"!=typeof window&&(window.HSAccordion=a),e.default=a},961:(t,e)=>{ +var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.HSRangeSlider=e.HSFileUpload=e.HSDataTable=e.HSStaticMethods=e.HSTreeView=e.HSTooltip=e.HSTogglePassword=e.HSToggleCount=e.HSThemeSwitch=e.HSTextareaAutoHeight=e.HSTabs=e.HSStrongPassword=e.HSStepper=e.HSSelect=e.HSScrollspy=e.HSRemoveElement=e.HSPinInput=e.HSOverlay=e.HSInputNumber=e.HSDropdown=e.HSComboBox=e.HSCollapse=e.HSCarousel=e.HSAccordion=e.HSCopyMarkup=void 0;var o=n(406);Object.defineProperty(e,"HSCopyMarkup",{enumerable:!0,get:function(){return i(o).default}});var r=n(740);Object.defineProperty(e,"HSAccordion",{enumerable:!0,get:function(){return i(r).default}});var s=n(268);Object.defineProperty(e,"HSCarousel",{enumerable:!0,get:function(){return i(s).default}});var l=n(485);Object.defineProperty(e,"HSCollapse",{enumerable:!0,get:function(){return i(l).default}});var a=n(809);Object.defineProperty(e,"HSComboBox",{enumerable:!0,get:function(){return i(a).default}});var c=n(891);Object.defineProperty(e,"HSDropdown",{enumerable:!0,get:function(){return i(c).default}});var u=n(332);Object.defineProperty(e,"HSInputNumber",{enumerable:!0,get:function(){return i(u).default}});var d=n(850);Object.defineProperty(e,"HSOverlay",{enumerable:!0,get:function(){return i(d).default}});var p=n(60);Object.defineProperty(e,"HSPinInput",{enumerable:!0,get:function(){return i(p).default}});var h=n(911);Object.defineProperty(e,"HSRemoveElement",{enumerable:!0,get:function(){return i(h).default}});var f=n(751);Object.defineProperty(e,"HSScrollspy",{enumerable:!0,get:function(){return i(f).default}});var v=n(442);Object.defineProperty(e,"HSSelect",{enumerable:!0,get:function(){return i(v).default}});var m=n(887);Object.defineProperty(e,"HSStepper",{enumerable:!0,get:function(){return i(m).default}});var g=n(97);Object.defineProperty(e,"HSStrongPassword",{enumerable:!0,get:function(){return i(g).default}});var y=n(166);Object.defineProperty(e,"HSTabs",{enumerable:!0,get:function(){return i(y).default}});var w=n(144);Object.defineProperty(e,"HSTextareaAutoHeight",{enumerable:!0,get:function(){return i(w).default}});var b=n(502);Object.defineProperty(e,"HSThemeSwitch",{enumerable:!0,get:function(){return i(b).default}});var S=n(684);Object.defineProperty(e,"HSToggleCount",{enumerable:!0,get:function(){return i(S).default}});var C=n(100);Object.defineProperty(e,"HSTogglePassword",{enumerable:!0,get:function(){return i(C).default}});var x=n(969);Object.defineProperty(e,"HSTooltip",{enumerable:!0,get:function(){return i(x).default}});var I=n(772);Object.defineProperty(e,"HSTreeView",{enumerable:!0,get:function(){return i(I).default}});var T=n(957);Object.defineProperty(e,"HSStaticMethods",{enumerable:!0,get:function(){return i(T).default}}),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery?e.HSDataTable=n(814).default:e.HSDataTable=null,"undefined"!=typeof _&&"undefined"!=typeof Dropzone?e.HSFileUpload=n(234).default:e.HSFileUpload=null,void 0!==typeof noUiSlider?e.HSRangeSlider=n(347).default:e.HSRangeSlider=null},740:function(t,e,n){ /* - * HSBasePlugin - * @version: 2.4.1 + * HSAccordion + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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},268:function(t,e,n){ +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;n .hs-accordion.active")&&this.group.querySelector(":scope > .hs-accordion.active")!==this.el&&window.$hsAccordionCollection.find((function(t){return t.element.el===e.group.querySelector(":scope > .hs-accordion.active")})).element.hide();if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.content.style.display="block",this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px")})),(0,l.afterTransition)(this.content,(function(){e.content.style.display="block",e.content.style.height="",e.fireEvent("open",e.el),(0,l.dispatch)("open.hs.accordion",e.el,e.el)}))},e.prototype.hide=function(){var t,e=this;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),(0,l.afterTransition)(this.content,(function(){e.content.style.display="",e.content.style.height="0",e.fireEvent("close",e.el),(0,l.dispatch)("close.hs.accordion",e.el,e.el)}))},e.prototype.update=function(){var t=this;if(this.group=this.el.closest(".hs-accordion-group")||null,!this.group)return!1;this.isAlwaysOpened=this.group.hasAttribute("data-hs-accordion-always-open")||!1,window.$hsAccordionCollection.map((function(e){return e.id===t.el.id&&(e.element.group=t.group,e.element.isAlwaysOpened=t.isAlwaysOpened),e}))},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.treeView=function(){var t=this;if(!document.querySelectorAll(".hs-accordion-treeview-root").length)return!1;this.selectable=[],document.querySelectorAll(".hs-accordion-treeview-root").forEach((function(e){var n=null==e?void 0:e.getAttribute("data-hs-accordion-options"),i=n?JSON.parse(n):{};t.selectable.push({el:e,options:r({},i)})})),this.selectable.length&&this.selectable.forEach((function(e){e.el.querySelectorAll(".hs-accordion-selectable").forEach((function(n){n.addEventListener("click",(function(i){i.stopPropagation(),t.toggleSelected(e,n)}))}))}))},e.toggleSelected=function(t,e){e.classList.contains("selected")?e.classList.remove("selected"):(t.el.querySelectorAll(".hs-accordion-selectable").forEach((function(t){return t.classList.remove("selected")})),e.classList.add("selected"))},e.on=function(t,e,n){var i=window.$hsAccordionCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));i&&(i.element.events[t]=n)},e}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit(),document.querySelectorAll(".hs-accordion-treeview-root").length&&a.treeView()})),"undefined"!=typeof window&&(window.HSAccordion=a),e.default=a},961:(t,e)=>{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},268:function(t,e,n){ /* * HSCarousel - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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=this.calculateTransform(),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.calculateTransform=function(){var t=this.currentIndex*this.sliderWidth;return this.isRTL?"translate(".concat(t,"px, 0px)"):"translate(-".concat(t,"px, 0px)")},e.prototype.goToPrev=function(){0===this.currentIndex&&this.isInfiniteLoop?(this.currentIndex=this.slides.length-1,this.inner.style.transform=this.calculateTransform(),this.addCurrentClass()):0!==this.currentIndex&&(this.currentIndex-=1,this.inner.style.transform=this.calculateTransform(),this.addCurrentClass(),this.addDisabledClass())},e.prototype.goToNext=function(){this.currentIndex===this.slides.length-1&&this.isInfiniteLoop?(this.currentIndex=0,this.inner.style.transform=this.calculateTransform(),this.addCurrentClass()):this.currentIndext?s:-i:i>r?r:i<-t?s:i}())}},e.prototype.handleDragEnd=function(){var t=this;if(this.isDragging){this.isDragging=!1;var e=this.sliderWidth/this.getCurrentSlidesQty(),n=this.getTranslateXValue(),i=Math.round(n/e);this.isRTL&&(i=Math.round(n/e)),this.inner.classList.remove("dragging"),setTimeout((function(){t.calculateTransform(i),t.dots&&t.setCurrentDot(),t.dragStartX=null,t.initialTranslateX=null,t.inner.querySelectorAll("a.prevented-click").forEach((function(e){e.classList.remove("prevented-click"),e.removeEventListener("click",t.removeClickEventWhileDragging)}))}))}},e.prototype.getEventX=function(t){return t instanceof MouseEvent?t.clientX:t.touches[0].clientX},e.prototype.getCurrentSlidesQty=function(){var t=this;if("object"==typeof this.slidesQty){var e=document.body.clientWidth,n=0;return Object.keys(this.slidesQty).forEach((function(i){e>=(typeof i+1=="number"?t.slidesQty[i]:c.BREAKPOINTS[i])&&(n=t.slidesQty[i])})),n}return this.slidesQty},e.prototype.buildSnapSpacers=function(){var t=this.inner.querySelector(".hs-snap-before"),e=this.inner.querySelector(".hs-snap-after");t&&t.remove(),e&&e.remove();var n=this.sliderWidth,i=n/2-n/this.getCurrentSlidesQty()/2,o=(0,l.htmlToElement)('
')),r=(0,l.htmlToElement)('
'));this.inner.prepend(o),this.inner.appendChild(r)},e.prototype.initDots=function(){this.el.querySelectorAll(".hs-carousel-pagination-item").length?this.setDots():this.buildDots(),this.dots&&this.setCurrentDot()},e.prototype.buildDots=function(){this.dots.innerHTML="";for(var t=!this.isCentered&&this.slidesQty?this.slides.length-(this.getCurrentSlidesQty()-1):this.slides.length,e=0;en+o)&&(p=c-o),(ui+r)&&(h=d-r),t.scrollTo({left:p,top:h,behavior:"smooth"})},e.prototype.buildInfo=function(){this.infoTotal&&this.setInfoTotal(),this.infoCurrent&&this.setInfoCurrent()},e.prototype.setInfoTotal=function(){this.infoTotal.innerText="".concat(this.slides.length)},e.prototype.setInfoCurrent=function(){this.infoCurrent.innerText="".concat(this.currentIndex+1)},e.prototype.buildSingleDot=function(t){var e=(0,l.htmlToElement)("");return this.dotsItemClasses&&(0,l.classToClassList)(this.dotsItemClasses,e),this.singleDotEvents(e,t),e},e.prototype.singleDotEvents=function(t,e){var n=this;t.addEventListener("click",(function(){n.goTo(e),n.isAutoPlay&&(n.resetTimer(),n.setTimer())}))},e.prototype.observeResize=function(){var t=this;new ResizeObserver((0,l.debounce)((function(e){for(var n=0,i=e;n=this.currentIndex-e?i.classList.add("active"):i.classList.remove("active")}else{var o=this.isCentered?this.currentIndex+this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.currentIndex+this.getCurrentSlidesQty();this.slides.forEach((function(e,n){n>=t.currentIndex&&n *").forEach((function(t,n){return e(t,n)}))},e.prototype.setElementToDisabled=function(t){t.classList.add("disabled"),"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled")},e.prototype.unsetElementToDisabled=function(t){t.classList.remove("disabled"),"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled")},e.prototype.addDisabledClass=function(){if(!this.prev||!this.next)return!1;var t=getComputedStyle(this.inner).getPropertyValue("gap"),e=Math.floor(this.getCurrentSlidesQty()/2),n=0,i=0,o=!1,r=!1;this.isSnap?(n=this.currentIndex,i=this.hasSnapSpacers?this.slides.length-1:this.slides.length-e-1,o=this.hasSnapSpacers?0===n:this.getCurrentSlidesQty()%2==0?n-e<0:n-e==0,r=n>=i&&this.container.scrollLeft+this.container.clientWidth+(parseFloat(t)||0)>=this.container.scrollWidth):(o=0===(n=this.currentIndex),r=n>=(i=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty())),o?(this.unsetElementToDisabled(this.next),this.setElementToDisabled(this.prev)):r?(this.unsetElementToDisabled(this.prev),this.setElementToDisabled(this.next)):(this.unsetElementToDisabled(this.prev),this.unsetElementToDisabled(this.next))},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.getBoundingClientRect().width,this.calculateWidth(),this.sliderWidth!==this.inner.parentElement.getBoundingClientRect().width&&this.recalculateWidth()},e.prototype.calculateTransform=function(t){void 0!==t&&(this.currentIndex=t),this.currentIndex>this.slides.length-this.getCurrentSlidesQty()&&!this.isCentered&&(this.currentIndex=this.slides.length-this.getCurrentSlidesQty());var e=this.sliderWidth,n=e/this.getCurrentSlidesQty(),i=this.currentIndex*n;if(this.isSnap&&!this.isCentered&&this.container.scrollLefte&&(this.container.scrollLeft=this.container.scrollWidth),this.isCentered&&!this.isSnap){var o=(e-n)/2;if(0===this.currentIndex)i=-o;else if(this.currentIndex>=this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1)){i=this.slides.length*n-e+o}else i=this.currentIndex*n-o}this.isSnap||(this.inner.style.transform=this.isRTL?"translate(".concat(i,"px, 0px)"):"translate(".concat(-i,"px, 0px)")),this.isAutoHeight&&(this.inner.style.height="".concat(this.slides[this.currentIndex].clientHeight,"px")),this.dotsItems&&this.goToCurrentDot(),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass(),this.isSnap&&this.hasSnapSpacers&&this.buildSnapSpacers(),this.infoCurrent&&this.setInfoCurrent()},e.prototype.setTranslate=function(t){this.inner.style.transform=this.isRTL?"translate(".concat(-t,"px, 0px)"):"translate(".concat(t,"px, 0px)")},e.prototype.goToPrev=function(){if(this.currentIndex>0?this.currentIndex--:this.currentIndex=this.slides.length-this.getCurrentSlidesQty(),this.isSnap){var t=this.sliderWidth/this.getCurrentSlidesQty();this.container.scrollBy({left:Math.max(-this.container.scrollLeft,-t),behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()},e.prototype.goToNext=function(){var t=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty();if(this.currentIndexthis.currentIndex?e-this.currentIndex:this.currentIndex-e,o=e>this.currentIndex?-n*i:n*i;this.container.scrollBy({left:o,behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()},e.prototype.setIndex=function(t){this.currentIndex=t,this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()},e.getInstance=function(t,e){var n=window.$hsCarouselCollection.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.$hsCarouselCollection||(window.$hsCarouselCollection=[]),document.querySelectorAll("[data-hs-carousel]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsCarouselCollection.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}(a.default);window.addEventListener("load",(function(){u.autoInit()})),"undefined"!=typeof window&&(window.HSCarousel=u),e.default=u},485:function(t,e,n){ /* * HSCollapse - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(292),l=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,e=this;this.createCollection(window.$hsCollapseCollection,this),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.el.ariaExpanded="true":this.el.ariaExpanded="false"),this.el.addEventListener("click",(function(){e.content.classList.contains("open")?e.hide():e.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,e=this;if(this.animationInProcess||this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.add("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="true"),this.content.classList.add("open"),this.content.classList.remove("hidden"),this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px"),e.fireEvent("beforeOpen",e.el),(0,s.dispatch)("beforeOpen.hs.collapse",e.el,e.el)})),(0,s.afterTransition)(this.content,(function(){e.content.style.height="",e.fireEvent("open",e.el),(0,s.dispatch)("open.hs.collapse",e.el,e.el),e.animationInProcess=!1}))},e.prototype.hide=function(){var t,e=this;if(this.animationInProcess||!this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.remove("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),this.content.classList.remove("open"),(0,s.afterTransition)(this.content,(function(){e.content.classList.add("hidden"),e.content.style.height="",e.fireEvent("hide",e.el),(0,s.dispatch)("hide.hs.collapse",e.el,e.el),e.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}(r(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSCollapse=l),e.default=l},809:function(t,e,n){ +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.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(292),l=function(t){function e(e,n,i){var o=t.call(this,e,n,i)||this;return o.contentId=o.el.dataset.hsCollapse,o.content=document.querySelector(o.contentId),o.animationInProcess=!1,o.content&&o.init(),o}return o(e,t),e.prototype.init=function(){var t,e=this;this.createCollection(window.$hsCollapseCollection,this),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.el.ariaExpanded="true":this.el.ariaExpanded="false"),this.el.addEventListener("click",(function(){e.content.classList.contains("open")?e.hide():e.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,e=this;if(this.animationInProcess||this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.add("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="true"),this.content.classList.add("open"),this.content.classList.remove("hidden"),this.content.style.height="0",setTimeout((function(){e.content.style.height="".concat(e.content.scrollHeight,"px"),e.fireEvent("beforeOpen",e.el),(0,s.dispatch)("beforeOpen.hs.collapse",e.el,e.el)})),(0,s.afterTransition)(this.content,(function(){e.content.style.height="",e.fireEvent("open",e.el),(0,s.dispatch)("open.hs.collapse",e.el,e.el),e.animationInProcess=!1}))},e.prototype.hide=function(){var t,e=this;if(this.animationInProcess||!this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.remove("open"),(null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.ariaExpanded)&&(this.el.ariaExpanded="false"),this.content.style.height="".concat(this.content.scrollHeight,"px"),setTimeout((function(){e.content.style.height="0"})),this.content.classList.remove("open"),(0,s.afterTransition)(this.content,(function(){e.content.classList.add("hidden"),e.content.style.height="",e.fireEvent("hide",e.el),(0,s.dispatch)("hide.hs.collapse",e.el,e.el),e.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 i=window.$hsCollapseCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));i&&(i.element.events[t]=n)},e}(r(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSCollapse=l),e.default=l},809:function(t,e,n){ /* * HSComboBox - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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]\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t',_.outputEmptyTemplate=null!==(f=null==B?void 0:B.outputEmptyTemplate)&&void 0!==f?f:'
Nothing found...
',_.outputLoaderTemplate=null!==(v=null==B?void 0:B.outputLoaderTemplate)&&void 0!==v?v:'
\n\t\t\t\t
\n\t\t\t\t\tLoading...\n\t\t\t\t
\n\t\t\t
',_.groupingType=null!==(m=null==B?void 0:B.groupingType)&&void 0!==m?m:null,_.groupingTitleTemplate=null!==(g=null==B?void 0:B.groupingTitleTemplate)&&void 0!==g?g:"default"===_.groupingType?'
':'',_.tabsWrapperTemplate=null!==(y=null==B?void 0:B.tabsWrapperTemplate)&&void 0!==y?y:'
',_.preventSelection=null!==(w=null==B?void 0:B.preventSelection)&&void 0!==w&&w,_.preventAutoPosition=null!==(b=null==B?void 0:B.preventAutoPosition)&&void 0!==b&&b,_.isOpenOnFocus=null!==(C=null==B?void 0:B.isOpenOnFocus)&&void 0!==C&&C,_.input=null!==(S=_.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==S?S:null,_.output=null!==(x=_.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==x?x:null,_.itemsWrapper=null!==(I=_.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==I?I:null,_.items=null!==(T=Array.from(_.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==T?T:[],_.tabs=[],_.toggle=null!==(E=_.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==E?E:null,_.toggleClose=null!==(L=_.el.querySelector("[data-hs-combo-box-close]"))&&void 0!==L?L:null,_.toggleOpen=null!==(O=_.el.querySelector("[data-hs-combo-box-open]"))&&void 0!==O?O:null,_.outputPlaceholder=null,_.selected=_.value=null!==(A=_.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==A?A:"",_.isOpened=!1,_.isCurrent=!1,_.animationInProcess=!1,_.selectedGroup="all",_.init(),_}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.preventAutoPosition||this.recalculateDirection()),this.toggle&&this.buildToggle(),this.toggleClose&&this.buildToggleClose(),this.toggleOpen&&this.buildToggleOpen()},e.prototype.setResultAndRender=function(t){void 0===t&&(t="");var e=this.preventVisibility?this.input.value:t;this.setResults(e),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.input.value?t.el.classList.add("has-value"):t.el.classList.remove("has-value"),t.isOpened||t.open()})))},e.prototype.buildItems=function(){this.output.role="listbox",this.output.tabIndex=-1,this.output.ariaOrientation="vertical",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){var n,o,i,r=null!==(n=e.getAttribute("data-hs-combo-box-output-item-group-field"))&&void 0!==n?n:null,s=null!==(o=JSON.parse(e.getAttribute("data-hs-combo-box-output-item")))&&void 0!==o?o:null,l=null;return r&&(null===(i=null==s?void 0:s.group)||void 0===i?void 0:i.name)&&(l=t[r]),Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(e){var n;return(null===(n=null==s?void 0:s.group)||void 0===n?void 0:n.name)&&l?l===s.group.name&&e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]: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,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,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,u.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){var o=(0,u.htmlToElement)(e.outputItemTemplate);o.querySelectorAll("[data-hs-combo-box-output-item-field]").forEach((function(e){var n=t[e.getAttribute("data-hs-combo-box-output-item-field")],o=e.hasAttribute("data-hs-combo-box-output-item-hide-if-empty");e.textContent=null!=n?n:"",!n&&o&&(e.style.display="none")})),o.querySelectorAll("[data-hs-combo-box-search-text]").forEach((function(e){var n;e.setAttribute("data-hs-combo-box-search-text",null!==(n=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==n?n:"")})),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,u.htmlToElement)(this.tabsWrapperTemplate),n=(0,u.htmlToElement)('
');e.append(n),this.output.insertBefore(e,this.output.firstChild);var o=(0,u.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,u.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,u.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,e,n,o,i=this;this.isOpened?((null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="true")):((null===(n=null==this?void 0:this.toggle)||void 0===n?void 0:n.ariaExpanded)&&(this.toggle.ariaExpanded="false"),(null===(o=null==this?void 0:this.input)||void 0===o?void 0:o.ariaExpanded)&&(this.input.ariaExpanded="false")),this.toggle.addEventListener("click",(function(){i.isOpened?i.close():i.open(i.toggle.getAttribute("data-hs-combo-box-toggle"))}))},e.prototype.buildToggleClose=function(){var t=this;this.toggleClose.addEventListener("click",(function(){return t.close()}))},e.prototype.buildToggleOpen=function(){var t=this;this.toggleOpen.addEventListener("click",(function(){return t.open()}))},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,this.fireEvent("select",this.el),(0,u.dispatch)("select.hs.combobox",this.el,this.value)},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,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.preventAutoPosition||this.recalculateDirection(),setTimeout((function(){var t,n;(null===(t=null==e?void 0:e.input)||void 0===t?void 0:t.ariaExpanded)&&(e.input.ariaExpanded="true"),(null===(n=null==e?void 0:e.toggle)||void 0===n?void 0:n.ariaExpanded)&&(e.toggle.ariaExpanded="true"),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,n,o=this;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),!1):(this.animationInProcess=!0,(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="false"),(null===(n=null==this?void 0:this.toggle)||void 0===n?void 0:n.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.el.classList.remove("active"),this.preventAutoPosition||(this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom=""),(0,u.afterTransition)(this.output,(function(){o.output.style.display="none",o.setValueAndClear(t),o.animationInProcess=!1})),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),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 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.preventVisibility?t.element.isCurrent: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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+10&&o[o.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t',_.outputEmptyTemplate=null!==(f=null==D?void 0:D.outputEmptyTemplate)&&void 0!==f?f:'
Nothing found...
',_.outputLoaderTemplate=null!==(v=null==D?void 0:D.outputLoaderTemplate)&&void 0!==v?v:'
\n\t\t\t\t
\n\t\t\t\t\tLoading...\n\t\t\t\t
\n\t\t\t
',_.groupingType=null!==(m=null==D?void 0:D.groupingType)&&void 0!==m?m:null,_.groupingTitleTemplate=null!==(g=null==D?void 0:D.groupingTitleTemplate)&&void 0!==g?g:"default"===_.groupingType?'
':'',_.tabsWrapperTemplate=null!==(y=null==D?void 0:D.tabsWrapperTemplate)&&void 0!==y?y:'
',_.preventSelection=null!==(w=null==D?void 0:D.preventSelection)&&void 0!==w&&w,_.preventAutoPosition=null!==(b=null==D?void 0:D.preventAutoPosition)&&void 0!==b&&b,_.isOpenOnFocus=null!==(S=null==D?void 0:D.isOpenOnFocus)&&void 0!==S&&S,_.input=null!==(C=_.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==C?C:null,_.output=null!==(x=_.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==x?x:null,_.itemsWrapper=null!==(I=_.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==I?I:null,_.items=null!==(T=Array.from(_.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==T?T:[],_.tabs=[],_.toggle=null!==(E=_.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==E?E:null,_.toggleClose=null!==(O=_.el.querySelector("[data-hs-combo-box-close]"))&&void 0!==O?O:null,_.toggleOpen=null!==(L=_.el.querySelector("[data-hs-combo-box-open]"))&&void 0!==L?L:null,_.outputPlaceholder=null,_.selected=_.value=null!==(A=_.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==A?A:"",_.isOpened=!1,_.isCurrent=!1,_.animationInProcess=!1,_.selectedGroup="all",_.init(),_}return o(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.preventAutoPosition||this.recalculateDirection()),this.toggle&&this.buildToggle(),this.toggleClose&&this.buildToggleClose(),this.toggleOpen&&this.buildToggleOpen()},e.prototype.setResultAndRender=function(t){void 0===t&&(t="");var e=this.preventVisibility?this.input.value:t;this.setResults(e),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.input.value?t.el.classList.add("has-value"):t.el.classList.remove("has-value"),t.isOpened||t.open()})))},e.prototype.buildItems=function(){this.output.role="listbox",this.output.tabIndex=-1,this.output.ariaOrientation="vertical",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){var n,i,o,r=null!==(n=e.getAttribute("data-hs-combo-box-output-item-group-field"))&&void 0!==n?n:null,s=null!==(i=JSON.parse(e.getAttribute("data-hs-combo-box-output-item")))&&void 0!==i?i:null,l=null;return r&&(null===(o=null==s?void 0:s.group)||void 0===o?void 0:o.name)&&(l=t[r]),Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some((function(e){var n;return(null===(n=null==s?void 0:s.group)||void 0===n?void 0:n.name)&&l?l===s.group.name&&e.getAttribute("data-hs-combo-box-search-text")===t[e.getAttribute("data-hs-combo-box-output-item-field")]: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,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,n,i,o,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 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 n=i.filter((function(e){return e[r.apiGroupField]===t.name}));r.itemsWrapper?r.itemsWrapper.append(e):r.output.append(e),r.jsonItemsRender(n)}))):this.jsonItemsRender(i),this.setResults(this.input.value),[3,5];case 4:return o=s.sent(),console.error(o),[3,5];case 5:return this.destroyOutputLoader(),[2]}}))}))},e.prototype.jsonItemsRender=function(t){var e=this;t.forEach((function(t,n){var i=(0,u.htmlToElement)(e.outputItemTemplate);i.querySelectorAll("[data-hs-combo-box-output-item-field]").forEach((function(e){var n=t[e.getAttribute("data-hs-combo-box-output-item-field")],i=e.hasAttribute("data-hs-combo-box-output-item-hide-if-empty");e.textContent=null!=n?n:"",!n&&i&&(e.style.display="none")})),i.querySelectorAll("[data-hs-combo-box-search-text]").forEach((function(e){var n;e.setAttribute("data-hs-combo-box-search-text",null!==(n=t[e.getAttribute("data-hs-combo-box-output-item-field")])&&void 0!==n?n:"")})),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(n){e.setAttribute(n.attr,t[n.valueFrom])}))})),i.setAttribute("tabIndex","".concat(n)),"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 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 i=t[e.apiGroupField];n.some((function(t){return t.name===i}))||n.push({name:i,title:i})})),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"),i=e.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text");return ni?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,u.htmlToElement)(this.tabsWrapperTemplate),n=(0,u.htmlToElement)('
');e.append(n),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),n.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),n.append(i),i.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,u.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 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,e,n,i,o=this;this.isOpened?((null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="true")):((null===(n=null==this?void 0:this.toggle)||void 0===n?void 0:n.ariaExpanded)&&(this.toggle.ariaExpanded="false"),(null===(i=null==this?void 0:this.input)||void 0===i?void 0:i.ariaExpanded)&&(this.input.ariaExpanded="false")),this.toggle.addEventListener("click",(function(){o.isOpened?o.close():o.open(o.toggle.getAttribute("data-hs-combo-box-toggle"))}))},e.prototype.buildToggleClose=function(){var t=this;this.toggleClose.addEventListener("click",(function(){return t.close()}))},e.prototype.buildToggleOpen=function(){var t=this;this.toggleOpen.addEventListener("click",(function(){return t.open()}))},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,this.fireEvent("select",this.el),(0,u.dispatch)("select.hs.combobox",this.el,this.value)},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,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.preventAutoPosition||this.recalculateDirection(),setTimeout((function(){var t,n;(null===(t=null==e?void 0:e.input)||void 0===t?void 0:t.ariaExpanded)&&(e.input.ariaExpanded="true"),(null===(n=null==e?void 0:e.toggle)||void 0===n?void 0:n.ariaExpanded)&&(e.toggle.ariaExpanded="true"),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,n,i=this;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),!1):(this.animationInProcess=!0,(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="false"),(null===(n=null==this?void 0:this.toggle)||void 0===n?void 0:n.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.el.classList.remove("active"),this.preventAutoPosition||(this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom=""),(0,u.afterTransition)(this.output,(function(){i.output.style.display="none",i.setValueAndClear(t),i.animationInProcess=!1})),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),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 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"),i=n?JSON.parse(n):{};new e(t,i)}})),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.preventVisibility?t.element.isCurrent: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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 i=window.$hsComboBoxCollection.find((function(t){return t.element.preventVisibility?t.element.isCurrent:t.element.isOpened}));if(i){var o=null!==(n=i.element.itemsWrapper)&&void 0!==n?n:i.element.output;if(!o)return!1;var r,s=e.getPreparedItems(t,o),l=o.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,l.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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=a),e.default=a},814:function(t,e,n){ +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;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,l.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,l.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"),i=n?JSON.parse(n):{};new e(t,i)}}))},e}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=a),e.default=a},814:function(t,e,n){ /* * HSDataTable - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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&&(this.buildPagingPage(1),l>2&&this.pagingPages.appendChild((0,a.htmlToElement)('...')));for(var u=l;u<=c;u++)this.buildPagingPage(u);c...')),this.buildPagingPage(r)),this.disablePagingArrow(this.pagingPrev,0===e),this.disablePagingArrow(this.pagingNext,e===n-1),this.hidePagingIfSinglePage()},e.prototype.buildPagingPage=function(t){var e=this,n=this.dataTable.page.info().page,o=(0,a.htmlToElement)('');o.innerText="".concat(t),o.setAttribute("data-page","".concat(t)),this.pageBtnClasses&&(0,a.classToClassList)(this.pageBtnClasses,o),n===t-1&&o.classList.add("active"),o.addEventListener("click",(function(){return e.onPageClick(t)})),this.pagingPages.append(o)},e.prototype.onPageClick=function(t){this.dataTable.page(t-1).draw("page")},e.prototype.initRowSelecting=function(){var t=this;this.rowSelectingAll.addEventListener("change",(function(){return t.onSelectAllChange()}))},e.prototype.triggerChangeEventToRow=function(){var t=this;this.table.querySelectorAll("tbody ".concat(this.rowSelectingIndividual)).forEach((function(e){e.addEventListener("change",(function(){t.updateSelectAllCheckbox()}))}))},e.prototype.onSelectAllChange=function(){var t=this,e=this.rowSelectingAll.checked;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var o=n.querySelector(t.rowSelectingIndividual);o&&(o.checked=e)})),this.updateSelectAllCheckbox()},e.prototype.updateSelectAllCheckbox=function(){var t=this;if(!this.dataTable.rows({search:"applied"}).count())return this.rowSelectingAll.checked=!1,!1;var e=!0;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var o=n.querySelector(t.rowSelectingIndividual);if(o&&!o.checked)return e=!1,!1})),this.rowSelectingAll.checked=e},e.getInstance=function(t,e){var n=window.$hsDataTableCollection.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.$hsDataTableCollection||(window.$hsDataTableCollection=[]),document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDataTableCollection.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}(l(n(961)).default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").length&&("undefined"==typeof jQuery&&console.error("HSDataTable: jQuery is not available, please add it to the page."),"undefined"==typeof DataTable&&console.error("HSDataTable: DataTable is not available, please add it to the page.")),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery&&c.autoInit()})),"undefined"!=typeof window&&(window.HSDataTable=c),e.default=c},891:function(t,e,n){ +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;n1&&(this.buildPagingPage(1),l>2&&this.pagingPages.appendChild((0,a.htmlToElement)('...')));for(var u=l;u<=c;u++)this.buildPagingPage(u);c...')),this.buildPagingPage(r)),this.disablePagingArrow(this.pagingPrev,0===e),this.disablePagingArrow(this.pagingNext,e===n-1),this.hidePagingIfSinglePage()},e.prototype.buildPagingPage=function(t){var e=this,n=this.dataTable.page.info().page,i=(0,a.htmlToElement)('');i.innerText="".concat(t),i.setAttribute("data-page","".concat(t)),this.pageBtnClasses&&(0,a.classToClassList)(this.pageBtnClasses,i),n===t-1&&i.classList.add("active"),i.addEventListener("click",(function(){return e.onPageClick(t)})),this.pagingPages.append(i)},e.prototype.onPageClick=function(t){this.dataTable.page(t-1).draw("page")},e.prototype.initRowSelecting=function(){var t=this;this.rowSelectingAll.addEventListener("change",(function(){return t.onSelectAllChange()}))},e.prototype.triggerChangeEventToRow=function(){var t=this;this.table.querySelectorAll("tbody ".concat(this.rowSelectingIndividual)).forEach((function(e){e.addEventListener("change",(function(){t.updateSelectAllCheckbox()}))}))},e.prototype.onSelectAllChange=function(){var t=this,e=this.rowSelectingAll.checked;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var i=n.querySelector(t.rowSelectingIndividual);i&&(i.checked=e)})),this.updateSelectAllCheckbox()},e.prototype.updateSelectAllCheckbox=function(){var t=this;if(!this.dataTable.rows({search:"applied"}).count())return this.rowSelectingAll.checked=!1,!1;var e=!0;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((function(n){var i=n.querySelector(t.rowSelectingIndividual);if(i&&!i.checked)return e=!1,!1})),this.rowSelectingAll.checked=e},e.getInstance=function(t,e){var n=window.$hsDataTableCollection.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.$hsDataTableCollection||(window.$hsDataTableCollection=[]),document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsDataTableCollection.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}(l(n(961)).default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").length&&("undefined"==typeof jQuery&&console.error("HSDataTable: jQuery is not available, please add it to the page."),"undefined"==typeof DataTable&&console.error("HSDataTable: DataTable is not available, please add it to the page.")),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery&&c.autoInit()})),"undefined"!=typeof window&&(window.HSDataTable=c),e.default=c},891:function(t,e,n){ /* * HSDropdown - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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.querySelector(":scope > .hs-dropdown-toggle-wrapper > .hs-dropdown-toggle")||i.el.children[0],i.closers=Array.from(i.el.querySelectorAll(":scope .hs-dropdown-close"))||null,i.menu=i.el.querySelector(":scope > .hs-dropdown-menu"),i.eventMode=(0,l.getClassProperty)(i.el,"--trigger","click"),i.closeMode=(0,l.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&&this.buildToggle(),this.menu&&this.buildMenu(),this.closers&&this.buildClosers(),(0,l.isIOS)()||(0,l.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return t.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return t.onMouseLeaveHandler()})))},e.prototype.resizeHandler=function(){this.eventMode=(0,l.getClassProperty)(this.el,"--trigger","click"),this.closeMode=(0,l.getClassProperty)(this.el,"--auto-close","true")},e.prototype.buildToggle=function(){var t,e=this;(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(t){return e.onClickHandler(t)}))},e.prototype.buildMenu=function(){this.menu.role="menu"},e.prototype.buildClosers=function(){var t=this;this.closers.forEach((function(e){e.addEventListener("click",(function(){return t.close()}))}))},e.prototype.onClickHandler=function(t){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}}]},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(" ","")),s=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ","");"static"!==o&&(this.el._popper=(0,a.createPopper)(this.el,this.menu,{placement:u.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]}},{name:"computeStyles",options:{adaptive:"fixed"===o,gpuAcceleration:"true"===s}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){var e;(null===(e=null==t?void 0:t.toggle)||void 0===e?void 0:e.ariaExpanded)&&(t.toggle.ariaExpanded="true"),t.el.classList.add("open"),t.animationInProcess=!1})),this.fireEvent("open",this.el),(0,l.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;var n;if(this.animationInProcess=!0,t){var o=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,l.afterTransition)(o,(function(){return e.destroyPopper()}))}else this.destroyPopper();e.menu.style.margin=null,(null===(n=null==e?void 0:e.toggle)||void 0===n?void 0:n.ariaExpanded)&&(e.toggle.ariaExpanded="false"),e.el.classList.remove("open"),e.fireEvent("close",e.el),(0,l.dispatch)("close.hs.dropdown",e.el,e.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=l.menuSearchHistory;var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e&&(u.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")&&!e.element.menu.querySelector("textarea: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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")||o.el.querySelector(":scope > .hs-dropdown-toggle-wrapper > .hs-dropdown-toggle")||o.el.children[0],o.closers=Array.from(o.el.querySelectorAll(":scope .hs-dropdown-close"))||null,o.menu=o.el.querySelector(":scope > .hs-dropdown-menu"),o.eventMode=(0,l.getClassProperty)(o.el,"--trigger","click"),o.closeMode=(0,l.getClassProperty)(o.el,"--auto-close","true"),o.animationInProcess=!1,o.toggle&&o.menu&&o.init(),o}return o(e,t),e.prototype.init=function(){var t=this;if(this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle&&this.buildToggle(),this.menu&&this.buildMenu(),this.closers&&this.buildClosers(),(0,l.isIOS)()||(0,l.isIpadOS)()||(this.el.addEventListener("mouseenter",(function(){return t.onMouseEnterHandler()})),this.el.addEventListener("mouseleave",(function(){return t.onMouseLeaveHandler()})))},e.prototype.resizeHandler=function(){this.eventMode=(0,l.getClassProperty)(this.el,"--trigger","click"),this.closeMode=(0,l.getClassProperty)(this.el,"--auto-close","true")},e.prototype.buildToggle=function(){var t,e=this;(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.el.classList.contains("open")?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(t){return e.onClickHandler(t)}))},e.prototype.buildMenu=function(){this.menu.role="menu"},e.prototype.buildClosers=function(){var t=this;this.closers.forEach((function(e){e.addEventListener("click",(function(){return t.close()}))}))},e.prototype.onClickHandler=function(t){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(" ",""),i=(window.getComputedStyle(t.el).getPropertyValue("--adaptive")||"adaptive").replace(" ","");e.state.elements.popper.style.position=n,e.state.elements.popper.style.transform="adaptive"===i?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}}]},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(" ",""),i=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),o=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ","")),s=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ","");"static"!==i&&(this.el._popper=(0,a.createPopper)(this.el,this.menu,{placement:u.POSITIONS[e]||"bottom-start",strategy:i,modifiers:r(r([],"fixed"!==i?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===n},{name:"offset",options:{offset:[0,o]}},{name:"computeStyles",options:{adaptive:"fixed"===i,gpuAcceleration:"true"===s}}],!1)})),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout((function(){var e;(null===(e=null==t?void 0:t.toggle)||void 0===e?void 0:e.ariaExpanded)&&(t.toggle.ariaExpanded="true"),t.el.classList.add("open"),t.animationInProcess=!1})),this.fireEvent("open",this.el),(0,l.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;var n;if(this.animationInProcess=!0,t){var i=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;(0,l.afterTransition)(i,(function(){return e.destroyPopper()}))}else this.destroyPopper();e.menu.style.margin=null,(null===(n=null==e?void 0:e.toggle)||void 0===n?void 0:n.ariaExpanded)&&(e.toggle.ariaExpanded="false"),e.el.classList.remove("open"),e.fireEvent("close",e.el),(0,l.dispatch)("close.hs.dropdown",e.el,e.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=l.menuSearchHistory;var e=window.$hsDropdownCollection.find((function(t){return t.element.el.classList.contains("open")}));if(e&&(u.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")&&!e.element.menu.querySelector("textarea: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(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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 i=(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")})),o=n.querySelector("a:focus, button:focus"),r=i.findIndex((function(t){return t===o}));r+1\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t.\n\t\t\t\t\t\t

\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t0%\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t',s.extensions=_.merge({default:{icon:'',class:"size-5"},xls:{icon:'',class:"size-5"},doc:{icon:'',class:"size-5"},zip:{icon:'',class:"size-5"}},a.extensions),s.singleton=a.singleton,s.concatOptions=r(r({clickable:s.el.querySelector("[data-hs-file-upload-trigger]"),previewsContainer:s.el.querySelector("[data-hs-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:s.previewTemplate,autoHideTrigger:!1},a),n),s.init(),s}return i(e,t),e.prototype.init=function(){this.createCollection(window.$hsFileUploadCollection,this),this.initDropzone()},e.prototype.initDropzone=function(){var t=this,e=this.el.querySelector("[data-hs-file-upload-clear]"),n=Array.from(this.el.querySelectorAll("[data-hs-file-upload-pseudo-trigger]"));this.dropzone=new Dropzone(this.el,this.concatOptions),this.dropzone.on("addedfile",(function(e){return t.onAddFile(e)})),this.dropzone.on("removedfile",(function(){return t.onRemoveFile()})),this.dropzone.on("uploadprogress",(function(e,n){return t.onUploadProgress(e,n)})),this.dropzone.on("complete",(function(e){return t.onComplete(e)})),e&&(e.onclick=function(){t.dropzone.files.length&&t.dropzone.removeAllFiles(!0)}),n.length&&n.forEach((function(e){e.onclick=function(){var e,n;(null===(e=t.concatOptions)||void 0===e?void 0:e.clickable)&&(null===(n=t.concatOptions)||void 0===n?void 0:n.clickable).click()}}))},e.prototype.onAddFile=function(t){var e=this,n=t.previewElement,o=t.previewElement.querySelector("[data-hs-file-upload-reload]");if(!n)return!1;this.singleton&&this.dropzone.files.length>1&&this.dropzone.removeFile(this.dropzone.files[0]),o&&o.addEventListener("click",(function(n){n.preventDefault(),n.stopPropagation();var o=document.createElement("input");o.type="file",o.click(),o.addEventListener("change",(function(n){var o,i=null===(o=n.target.files)||void 0===o?void 0:o[0];if(i){var r=i;r.status=Dropzone.ADDED,r.accepted=!0,r.previewElement=t.previewElement,r.previewTemplate=t.previewTemplate,r.previewsContainer=t.previewsContainer,e.dropzone.removeFile(t),e.dropzone.addFile(r)}}))})),this.previewAccepted(t)},e.prototype.previewAccepted=function(t){var e=this,n=t.previewElement,o=this.splitFileName(t.name),i=n.querySelector("[data-hs-file-upload-file-name]"),r=n.querySelector("[data-hs-file-upload-file-ext]"),s=n.querySelector("[data-hs-file-upload-file-size]"),l=n.querySelector("[data-hs-file-upload-file-icon]"),a=this.el.querySelector("[data-hs-file-upload-trigger]"),c=n.querySelector("[data-dz-thumbnail]"),u=n.querySelector("[data-hs-file-upload-remove]");i&&(i.textContent=o.name),r&&(r.textContent=o.extension),s&&(s.textContent=this.formatFileSize(t.size)),c&&(t.type.includes("image/")?c.classList.remove("hidden"):this.setIcon(o.extension,l)),this.dropzone.files.length>0&&this.concatOptions.autoHideTrigger&&(a.style.display="none"),u&&(u.onclick=function(){return e.dropzone.removeFile(t)})},e.prototype.onRemoveFile=function(){var t=this.el.querySelector("[data-hs-file-upload-trigger]");0===this.dropzone.files.length&&this.concatOptions.autoHideTrigger&&(t.style.display="")},e.prototype.onUploadProgress=function(t,e){var n=t.previewElement;if(!n)return!1;var o=n.querySelector("[data-hs-file-upload-progress-bar]"),i=n.querySelector("[data-hs-file-upload-progress-bar-pane]"),r=n.querySelector("[data-hs-file-upload-progress-bar-value]"),s=Math.floor(e);o&&o.setAttribute("aria-valuenow","".concat(s)),i&&(i.style.width="".concat(s,"%")),r&&(r.innerText="".concat(s))},e.prototype.onComplete=function(t){var e=t.previewElement;if(!e)return!1;e.classList.add("complete")},e.prototype.setIcon=function(t,e){var n=this.createIcon(t);e.append(n)},e.prototype.createIcon=function(t){var e,n,o=(null===(e=this.extensions[t])||void 0===e?void 0:e.icon)?(0,l.htmlToElement)(this.extensions[t].icon):(0,l.htmlToElement)(this.extensions.default.icon);return(0,l.classToClassList)((null===(n=this.extensions[t])||void 0===n?void 0:n.class)?this.extensions[t].class:this.extensions.default.class,o),o},e.prototype.formatFileSize=function(t){return t<1024?t.toFixed(2)+" B":t<1048576?(t/1024).toFixed(2)+" KB":t<1073741824?(t/1048576).toFixed(2)+" MB":t<1099511627776?(t/1073741824).toFixed(2)+" GB":(t/1099511627776).toFixed(2)+" TB"},e.prototype.splitFileName=function(t){var e=t.lastIndexOf(".");return-1==e?{name:t,extension:""}:{name:t.substring(0,e),extension:t.substring(e+1)}},e.getInstance=function(t,e){var n=window.$hsFileUploadCollection.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.$hsFileUploadCollection||(window.$hsFileUploadCollection=[]),document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsFileUploadCollection.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}(a.default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").length&&("undefined"==typeof _&&console.error("HSFileUpload: Lodash is not available, please add it to the page."),"undefined"==typeof Dropzone&&console.error("HSFileUpload: Dropzone is not available, please add it to the page.")),"undefined"!=typeof _&&"undefined"!=typeof Dropzone&&c.autoInit()})),"undefined"!=typeof window&&(window.HSFileUpload=c),e.default=c},332:function(t,e,n){ +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;n\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t.\n\t\t\t\t\t\t

\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t0%\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t',s.extensions=_.merge({default:{icon:'',class:"size-5"},xls:{icon:'',class:"size-5"},doc:{icon:'',class:"size-5"},zip:{icon:'',class:"size-5"}},a.extensions),s.singleton=a.singleton,s.concatOptions=r(r({clickable:s.el.querySelector("[data-hs-file-upload-trigger]"),previewsContainer:s.el.querySelector("[data-hs-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:s.previewTemplate,autoHideTrigger:!1},a),n),s.init(),s}return o(e,t),e.prototype.init=function(){this.createCollection(window.$hsFileUploadCollection,this),this.initDropzone()},e.prototype.initDropzone=function(){var t=this,e=this.el.querySelector("[data-hs-file-upload-clear]"),n=Array.from(this.el.querySelectorAll("[data-hs-file-upload-pseudo-trigger]"));this.dropzone=new Dropzone(this.el,this.concatOptions),this.dropzone.on("addedfile",(function(e){return t.onAddFile(e)})),this.dropzone.on("removedfile",(function(){return t.onRemoveFile()})),this.dropzone.on("uploadprogress",(function(e,n){return t.onUploadProgress(e,n)})),this.dropzone.on("complete",(function(e){return t.onComplete(e)})),e&&(e.onclick=function(){t.dropzone.files.length&&t.dropzone.removeAllFiles(!0)}),n.length&&n.forEach((function(e){e.onclick=function(){var e,n;(null===(e=t.concatOptions)||void 0===e?void 0:e.clickable)&&(null===(n=t.concatOptions)||void 0===n?void 0:n.clickable).click()}}))},e.prototype.onAddFile=function(t){var e=this,n=t.previewElement,i=t.previewElement.querySelector("[data-hs-file-upload-reload]");if(!n)return!1;this.singleton&&this.dropzone.files.length>1&&this.dropzone.removeFile(this.dropzone.files[0]),i&&i.addEventListener("click",(function(n){n.preventDefault(),n.stopPropagation();var i=document.createElement("input");i.type="file",i.click(),i.addEventListener("change",(function(n){var i,o=null===(i=n.target.files)||void 0===i?void 0:i[0];if(o){var r=o;r.status=Dropzone.ADDED,r.accepted=!0,r.previewElement=t.previewElement,r.previewTemplate=t.previewTemplate,r.previewsContainer=t.previewsContainer,e.dropzone.removeFile(t),e.dropzone.addFile(r)}}))})),this.previewAccepted(t)},e.prototype.previewAccepted=function(t){var e=this,n=t.previewElement,i=this.splitFileName(t.name),o=n.querySelector("[data-hs-file-upload-file-name]"),r=n.querySelector("[data-hs-file-upload-file-ext]"),s=n.querySelector("[data-hs-file-upload-file-size]"),l=n.querySelector("[data-hs-file-upload-file-icon]"),a=this.el.querySelector("[data-hs-file-upload-trigger]"),c=n.querySelector("[data-dz-thumbnail]"),u=n.querySelector("[data-hs-file-upload-remove]");o&&(o.textContent=i.name),r&&(r.textContent=i.extension),s&&(s.textContent=this.formatFileSize(t.size)),c&&(t.type.includes("image/")?c.classList.remove("hidden"):this.setIcon(i.extension,l)),this.dropzone.files.length>0&&this.concatOptions.autoHideTrigger&&(a.style.display="none"),u&&(u.onclick=function(){return e.dropzone.removeFile(t)})},e.prototype.onRemoveFile=function(){var t=this.el.querySelector("[data-hs-file-upload-trigger]");0===this.dropzone.files.length&&this.concatOptions.autoHideTrigger&&(t.style.display="")},e.prototype.onUploadProgress=function(t,e){var n=t.previewElement;if(!n)return!1;var i=n.querySelector("[data-hs-file-upload-progress-bar]"),o=n.querySelector("[data-hs-file-upload-progress-bar-pane]"),r=n.querySelector("[data-hs-file-upload-progress-bar-value]"),s=Math.floor(e);i&&i.setAttribute("aria-valuenow","".concat(s)),o&&(o.style.width="".concat(s,"%")),r&&(r.innerText="".concat(s))},e.prototype.onComplete=function(t){var e=t.previewElement;if(!e)return!1;e.classList.add("complete")},e.prototype.setIcon=function(t,e){var n=this.createIcon(t);e.append(n)},e.prototype.createIcon=function(t){var e,n,i=(null===(e=this.extensions[t])||void 0===e?void 0:e.icon)?(0,l.htmlToElement)(this.extensions[t].icon):(0,l.htmlToElement)(this.extensions.default.icon);return(0,l.classToClassList)((null===(n=this.extensions[t])||void 0===n?void 0:n.class)?this.extensions[t].class:this.extensions.default.class,i),i},e.prototype.formatFileSize=function(t){return t<1024?t.toFixed(2)+" B":t<1048576?(t/1024).toFixed(2)+" KB":t<1073741824?(t/1048576).toFixed(2)+" MB":t<1099511627776?(t/1073741824).toFixed(2)+" GB":(t/1099511627776).toFixed(2)+" TB"},e.prototype.splitFileName=function(t){var e=t.lastIndexOf(".");return-1==e?{name:t,extension:""}:{name:t.substring(0,e),extension:t.substring(e+1)}},e.getInstance=function(t,e){var n=window.$hsFileUploadCollection.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.$hsFileUploadCollection||(window.$hsFileUploadCollection=[]),document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").forEach((function(t){window.$hsFileUploadCollection.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}(a.default);window.addEventListener("load",(function(){document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").length&&("undefined"==typeof _&&console.error("HSFileUpload: Lodash is not available, please add it to the page."),"undefined"==typeof Dropzone&&console.error("HSFileUpload: Dropzone is not available, please add it to the page.")),"undefined"!=typeof _&&"undefined"!=typeof Dropzone&&c.autoInit()})),"undefined"!=typeof window&&(window.HSFileUpload=c),e.default=c},332:function(t,e,n){ /* * HSInputNumber - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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?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.checkIsNumberAndConvert=function(){var t=this.input.value.trim(),e=this.cleanAndExtractNumber(t);null!==e?(this.inputValue=e,this.input.value=e.toString()):(this.inputValue=0,this.input.value="0")},e.prototype.cleanAndExtractNumber=function(t){var e=[],n=!1;t.split("").forEach((function(t){t>="0"&&t<="9"?e.push(t):"."!==t||n||(e.push(t),n=!0)}));var o=e.join(""),i=parseFloat(o);return isNaN(i)?null:i},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 s=this.inputValue+this.step;this.inputValue=s>=i&&s<=r?s: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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=a),e.default=a},850:function(t,e,n){ +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?l.step:1,i.init(),i}return o(e,t),e.prototype.init=function(){this.createCollection(window.$hsInputNumberCollection,this),this.input&&this.increment&&this.build()},e.prototype.checkIsNumberAndConvert=function(){var t=this.input.value.trim(),e=this.cleanAndExtractNumber(t);null!==e?(this.inputValue=e,this.input.value=e.toString()):(this.inputValue=0,this.input.value="0")},e.prototype.cleanAndExtractNumber=function(t){var e=[],n=!1;t.split("").forEach((function(t){t>="0"&&t<="9"?e.push(t):"."!==t||n||(e.push(t),n=!0)}));var i=e.join(""),o=parseFloat(i);return isNaN(o)?null:o},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},o=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 s=this.inputValue+this.step;this.inputValue=s>=o&&s<=r?s:r,this.input.value=this.inputValue.toString();break;case"decrement":var a=this.inputValue-this.step;this.inputValue=a>=o&&a<=r?a:o,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<=o?o:c,this.inputValue<=o&&(this.input.value=this.inputValue.toString())}i.inputValue=this.inputValue,this.inputValue===o?(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",i),(0,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=a),e.default=a},850:function(t,e,n){ /* * HSOverlay - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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"])'),s=[];(null==r?void 0:r.length)&&r.forEach((function(t){(0,l.isParentOrElementHidden)(t)||s.push(t)}));var a=i&&!t.metaKey;if(a&&!i.element.isTabAccessibilityLimited&&"Tab"===t.code)return!1;a&&s.length&&"Tab"===t.code&&(t.preventDefault(),this.onTab(i,s)),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}(s(n(961)).default);window.addEventListener("load",(function(){c.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.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.overlay.classList.contains("opened")})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.overlay.classList.contains("opened")})).forEach((function(t){var e=parseInt(window.getComputedStyle(t.element.overlay).getPropertyValue("z-index")),n=document.querySelector("#".concat(t.element.overlay.id,"-backdrop"));if(e===parseInt(window.getComputedStyle(n).getPropertyValue("z-index"))+1)return!1;"style"in n&&(n.style.zIndex="".concat(e-1)),document.body.classList.add("hs-overlay-body-open")}))}()})),"undefined"!=typeof window&&(window.HSOverlay=c),e.default=c},60:function(t,e,n){ +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;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,i=window.$hsOverlayCollection.filter((function(t){return t.element.overlay.classList.contains("open")})),o=i[i.length-1],r=null===(n=null===(e=null==o?void 0:o.element)||void 0===e?void 0:e.overlay)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=[];(null==r?void 0:r.length)&&r.forEach((function(t){(0,l.isParentOrElementHidden)(t)||s.push(t)}));var a=o&&!t.metaKey;if(a&&!o.element.isTabAccessibilityLimited&&"Tab"===t.code)return!1;a&&s.length&&"Tab"===t.code&&(t.preventDefault(),this.onTab(o,s)),a&&"Escape"===t.code&&(t.preventDefault(),this.onEscape(o))},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"),i=Array.from(e).indexOf(n);i>-1?e[(i+1)%e.length].focus():e[0].focus()},e.on=function(t,e,n){var i=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)}));i&&(i.element.events[t]=n)},e}(s(n(961)).default),u=function(){if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((function(t){return t.element.moveOverlayToBody})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.moveOverlayToBody})).forEach((function(t){var e=t.element.moveOverlayToBody,n=t.element.initContainer,i=document.querySelector("body"),o=t.element.overlay;if(!n&&o)return!1;document.body.clientWidth<=e&&!(0,l.isDirectChild)(i,o)?i.appendChild(o):document.body.clientWidth>e&&!n.contains(o)&&n.appendChild(o)}))};window.addEventListener("load",(function(){c.autoInit(),u()})),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)}))}(),u(),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.overlay.classList.contains("opened")})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.overlay.classList.contains("opened")})).forEach((function(t){var e=parseInt(window.getComputedStyle(t.element.overlay).getPropertyValue("z-index")),n=document.querySelector("#".concat(t.element.overlay.id,"-backdrop"));if(e===parseInt(window.getComputedStyle(n).getPropertyValue("z-index"))+1)return!1;"style"in n&&(n.style.zIndex="".concat(e-1)),document.body.classList.add("hs-overlay-body-open")}))}()})),"undefined"!=typeof window&&(window.HSOverlay=c),e.default=c},60:function(t,e,n){ /* * HSPinInput - * @version: 2.4.1 + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=a),e.default=a},347:function(t,e,n){ +/* + * HSRangeSlider + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=a),e.default=a},911:function(t,e,n){ +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){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,s.getClassProperty)(this.el,"--scrollspy-offset","0")),i=parseInt((0,s.getClassProperty)(n,"--scrollspy-offset"))||o,r=this.scrollable===document?0:this.scrollable.offsetTop,l=n.offsetTop-i-r,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,s.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}(r(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=l),e.default=l},442:function(t,e,n){ +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.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(292),l=function(t){function e(e,n){void 0===n&&(n={});var i=t.call(this,e,n)||this;return i.activeSection=null,i.contentId=i.el.getAttribute("data-hs-scrollspy"),i.content=document.querySelector(i.contentId),i.links=i.el.querySelectorAll("[href]"),i.sections=[],i.scrollableId=i.el.getAttribute("data-hs-scrollspy-scrollable-parent"),i.scrollable=i.scrollableId?document.querySelector(i.scrollableId):document,i.init(),i}return o(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,s.getClassProperty)(this.el,"--scrollspy-offset","0")),i=parseInt((0,s.getClassProperty)(e,"--scrollspy-offset"))||n,o=t.target===document?0:parseInt(String(t.target.getBoundingClientRect().top)),r=parseInt(String(e.getBoundingClientRect().top))-i-o,l=e.offsetHeight;if(r<=0&&r+l>0){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),i=parseInt((0,s.getClassProperty)(this.el,"--scrollspy-offset","0")),o=parseInt((0,s.getClassProperty)(n,"--scrollspy-offset"))||i,r=this.scrollable===document?0:this.scrollable.offsetTop,l=n.offsetTop-o-r,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,s.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}(r(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=l),e.default=l},442:function(t,e,n){ /* * HSSelect - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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"),n=this.toggle.querySelector("[data-icon]"),o=this.toggle.querySelector("[data-title]"),!this.isMultiple&&n&&this.setToggleIcon(),!this.isMultiple&&o&&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,o||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,a.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),(null===(e=this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.isOpened?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(){if(i.isDisabled)return!1;i.isOpened?i.close():i.open()}))},e.prototype.setToggleIcon=function(){var t,e,n=this.toggle.querySelector("[data-icon]");if(n.innerHTML="",n){var o=(0,a.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.isDisabled&&this.wrapper.classList.add("disabled"),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,l,c=this,u=this.getItemByValue(t),d=document.createElement("div");if(d.setAttribute("data-tag-value",t),this.tagsItemClasses&&(0,a.classToClassList)(this.tagsItemClasses,d),this.tagsItemTemplate&&(i=(0,a.htmlToElement)(this.tagsItemTemplate),d.append(i)),null===(e=null==u?void 0:u.options)||void 0===e?void 0:e.icon){var p=(0,a.htmlToElement)(null===(n=null==u?void 0:u.options)||void 0===n?void 0:n.icon);(l=i?i.querySelector("[data-icon]"):document.createElement("span")).append(p),i||d.append(l)}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,a.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,a.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,a.htmlToElement)(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),this.dropdown.classList.add("absolute","top-full"),this.dropdown.role="listbox",this.dropdown.tabIndex=-1,this.dropdown.ariaOrientation="vertical",this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,a.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.disabled,e.selected,e.options,"".concat(n))}))},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,a.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,a.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]"),this.search=(0,a.htmlToElement)(''),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,a.classToClassList)(this.searchClasses,this.search),this.search.addEventListener("input",(0,a.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,i,r){var l=this;void 0===n&&(n=!1),void 0===o&&(o=!1),void 0===r&&(r="1");var c=null,u=(0,a.htmlToElement)(this.optionTag||"
");if(u.setAttribute("data-value",e),u.setAttribute("data-title-value",t),u.setAttribute("tabIndex",r),u.classList.add("cursor-pointer"),n&&u.classList.add("disabled"),o&&(this.isMultiple?this.value=s(s([],this.value,!0),[e],!1):this.value=e),this.optionTemplate&&(c=(0,a.htmlToElement)(this.optionTemplate),u.append(c)),c?c.querySelector("[data-title]").textContent=t||"":u.textContent=t||"",i){if(i.icon){var d=(0,a.htmlToElement)(i.icon);if(d.classList.add("max-w-full"),c)c.querySelector("[data-icon]").append(d);else{var p=(0,a.htmlToElement)("
");this.iconClasses&&(0,a.classToClassList)(this.iconClasses,p),p.append(d),u.append(p)}}if(i.description)if(c)c.querySelector("[data-description]").append(i.description);else{var h=(0,a.htmlToElement)("
");h.textContent=i.description,this.descriptionClasses&&(0,a.classToClassList)(this.descriptionClasses,h),u.append(h)}}c&&c.querySelector("[data-icon]")&&!i&&!(null==i?void 0:i.icon)&&c.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&u.classList.add("selected"),n||u.addEventListener("click",(function(){return l.onSelectOption(e)})),this.optionClasses&&(0,a.classToClassList)(this.optionClasses,u),this.dropdown&&this.dropdown.append(u),o&&this.setNewValue()},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,o,i){var r=(0,a.htmlToElement)("");r.setAttribute("value",e),n&&r.setAttribute("disabled","disabled"),o&&r.setAttribute("selected","selected"),r.setAttribute("data-hs-select-option",JSON.stringify(i)),r.innerText=t,this.el.append(r)},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,a.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(),this.triggerChangeEventForNativeSelect()},e.prototype.triggerChangeEventForNativeSelect=function(){var t=new Event("change",{bubbles:!0});this.el.dispatchEvent(t)},e.prototype.addSelectOption=function(t,e,n,o,i){this.selectOptions=s(s([],this.selectOptions,!0),[{title:t,val:e,disabled:n,selected:o,options:i}],!1)},e.prototype.removeSelectOption=function(t,e){if(void 0===e&&(e=!1),!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t})),console.log(e),this.value=e?this.value.filter((function(e){return e!==t})):t,console.log(this.value)},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():(console.log(),this.value.length?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder)},e.prototype.stringFromValue=function(){var t=this,e=[],n="";if(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)if("nItemsAndCount"===this.toggleCountTextMode){var o=e.slice(0,this.toggleCountTextMinItems-1);n="".concat(o.join(this.toggleSeparators.items)," ").concat(this.toggleSeparators.betweenItemsAndCounter," ").concat(e.length-o.length," ").concat(this.toggleCountText)}else n="".concat(e.length," ").concat(this.toggleCountText);else n=e.join(this.toggleSeparators.items);return n},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0;var e=Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")}));e&&e.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,a.htmlToElement)(""),this.searchNoResult.innerText=this.searchNoResultText,(0,a.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,e=this,n=(null===(t=null===window||void 0===window?void 0:window.$hsSelectCollection)||void 0===t?void 0:t.find((function(t){return t.element.isOpened})))||null;if(n&&n.element.close(),this.animationInProcess)return!1;this.animationInProcess=!0,this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){var t;(null===(t=null==e?void 0:e.toggle)||void 0===t?void 0:t.ariaExpanded)&&(e.toggle.ariaExpanded="true"),e.wrapper.classList.add("active"),e.dropdown.classList.add("opened"),e.hasSearch&&!e.preventSearchFocus&&e.search.focus(),e.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,n,o,i=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,a.afterTransition)(this.dropdown,(function(){i.dropdown.classList.add("hidden"),i.hasSearch&&(i.search.value="",i.search.dispatchEvent(new Event("input",{bubbles:!0})),i.search.blur()),i.animationInProcess=!1})),null===(o=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===o||o.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.disabled,s=t.selected,l=t.options;!!e.selectOptions.some((function(t){return t.val===i}))||(e.addSelectOption(o,i,r,s,l),e.buildOption(o,i,r,s,l,n),e.buildOriginalOption(o,i,r,s,l),s&&!e.isMultiple&&e.onSelectOption(i))};Array.isArray(t)?t.forEach((function(t){o(t)})):o(t)},e.prototype.removeOption=function(t){var e=this,n=function(t,n){void 0===n&&(n=!1),!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t,n),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,e.isMultiple)})):n(t,this.isMultiple),this.setNewValue()},e.prototype.recalculateDirection=function(){var t,e,n,o;(0,a.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.open=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.open()},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}))&&u.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Tab":t.preventDefault(),t.stopImmediatePropagation(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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")||n.querySelector(".selected");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")||n.querySelector(".selected");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}(c.default);window.addEventListener("load",(function(){d.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=d),e.default=d},887:function(t,e,n){ +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&&o[o.length-1])||6!==l[0]&&2!==l[0])){s=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]",s.searchNoResultText=(null==c?void 0:c.searchNoResultText)||"No results found",s.searchNoResultClasses=(null==c?void 0:c.searchNoResultClasses)||"px-4 text-sm text-gray-800 dark:text-neutral-200",s.optionTemplate=(null==c?void 0:c.optionTemplate)||null,s.optionTag=(null==c?void 0:c.optionTag)||null,s.optionClasses=(null==c?void 0:c.optionClasses)||null,s.extraMarkup=(null==c?void 0:c.extraMarkup)||null,s.descriptionClasses=(null==c?void 0:c.descriptionClasses)||null,s.iconClasses=(null==c?void 0:c.iconClasses)||null,s.isAddTagOnEnter=null===(o=null==c?void 0:c.isAddTagOnEnter)||void 0===o||o,s.animationInProcess=!1,s.selectOptions=[],s.remoteOptions=[],s.tagsInputHelper=null,s.init(),s}return o(e,t),e.prototype.setValue=function(t){this.value=t,this.clearSelections(),Array.isArray(t)?(this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder,this.unselectMultipleItems(),this.selectMultipleItems()):(this.setToggleTitle(),this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.selectSingleItem())},e.prototype.init=function(){this.createCollection(window.$hsSelectCollection,this),this.build()},e.prototype.build=function(){var t=this;if(this.el.style.display="none",this.el.children&&Array.from(this.el.children).filter((function(t){return t.value&&""!==t.value})).forEach((function(e){var n=e.getAttribute("data-hs-select-option");t.selectOptions=a(a([],t.selectOptions,!0),[{title:e.textContent,val:e.value,disabled:e.disabled,options:"undefined"!==n?JSON.parse(n):null}],!1)})),this.isMultiple){var e=Array.from(this.el.children).filter((function(t){return t.selected}));if(e){var n=[];e.forEach((function(t){n.push(t.value)})),this.value=n}}this.buildWrapper(),"tags"===this.mode?this.buildTags():this.buildToggle(),this.buildDropdown(),this.extraMarkup&&this.buildExtraMarkup()},e.prototype.buildWrapper=function(){var t=this;this.wrapper=document.createElement("div"),this.wrapper.classList.add("hs-select","relative"),"tags"===this.mode&&this.wrapper.addEventListener("click",(function(e){e.target.closest("[data-hs-select-dropdown]")||e.target.closest("[data-tag-value]")||t.tagsInput.focus()})),this.wrapperClasses&&(0,u.classToClassList)(this.wrapperClasses,this.wrapper),this.el.before(this.wrapper),this.wrapper.append(this.el)},e.prototype.buildExtraMarkup=function(){var t=this,e=function(e){var n=(0,u.htmlToElement)(e);return t.wrapper.append(n),n},n=function(e){e.classList.contains("--prevent-click")||e.addEventListener("click",(function(e){e.stopPropagation(),t.toggleFn()}))};if(Array.isArray(this.extraMarkup))this.extraMarkup.forEach((function(t){var i=e(t);n(i)}));else{var i=e(this.extraMarkup);n(i)}},e.prototype.buildToggle=function(){var t,e,n,i,o=this;this.toggleTextWrapper=document.createElement("span"),this.toggleTextWrapper.classList.add("truncate"),this.toggle=(0,u.htmlToElement)(this.toggleTag||"
"),n=this.toggle.querySelector("[data-icon]"),i=this.toggle.querySelector("[data-title]"),!this.isMultiple&&n&&this.setToggleIcon(),!this.isMultiple&&i&&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,i||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,u.classToClassList)(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),(null===(e=this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.isOpened?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.toggle.addEventListener("click",(function(){if(o.isDisabled)return!1;o.toggleFn()}))},e.prototype.setToggleIcon=function(){var t,e=this.getItemByValue(this.value),n=this.toggle.querySelector("[data-icon]");if(n.innerHTML="",n){var i=(0,u.htmlToElement)(this.apiUrl&&this.apiIconTag?this.apiIconTag||"":(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.icon)||"");this.value&&this.apiUrl&&this.apiIconTag&&e[this.apiFieldsMap.icon]&&(i.src=e[this.apiFieldsMap.icon]||""),n.append(i),i&&(null==i?void 0:i.src)?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.isDisabled&&this.wrapper.classList.add("disabled"),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,i,o,r,s,l,a,c=this,d=this.getItemByValue(t),p=document.createElement("div");if(p.setAttribute("data-tag-value",t),this.tagsItemClasses&&(0,u.classToClassList)(this.tagsItemClasses,p),this.tagsItemTemplate&&(r=(0,u.htmlToElement)(this.tagsItemTemplate),p.append(r)),(null===(e=null==d?void 0:d.options)||void 0===e?void 0:e.icon)||this.apiIconTag){var h=(0,u.htmlToElement)(this.apiUrl&&this.apiIconTag?this.apiIconTag:null===(n=null==d?void 0:d.options)||void 0===n?void 0:n.icon);this.apiUrl&&this.apiIconTag&&d[this.apiFieldsMap.icon]&&(h.src=d[this.apiFieldsMap.icon]||""),(a=r?r.querySelector("[data-icon]"):document.createElement("span")).append(h),r||p.append(a)}!r||!r.querySelector("[data-icon]")||(null===(i=null==d?void 0:d.options)||void 0===i?void 0:i.icon)||this.apiUrl||this.apiIconTag||d[null===(o=this.apiFieldsMap)||void 0===o?void 0:o.icon]||r.querySelector("[data-icon]").classList.add("hidden"),(s=r?r.querySelector("[data-title]"):document.createElement("span")).textContent=d.title||"",r||p.append(s),r?l=r.querySelector("[data-remove]"):((l=document.createElement("span")).textContent="X",p.append(l)),l.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(),p.remove()})),this.wrapper.append(p)},e.prototype.getItemByValue=function(t){var e=this;return this.apiUrl?this.remoteOptions.find((function(n){return n[e.apiFieldsMap.title]===t})):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:a(a([],t.selectedItems,!0),[e],!1)}))},e.prototype.buildTagsInput=function(){var t=this;this.tagsInput=document.createElement("input"),this.tagsInputId&&(this.tagsInput.id=this.tagsInputId),this.tagsInputClasses&&(0,u.classToClassList)(this.tagsInputClasses,this.tagsInput),this.tagsInput.addEventListener("focus",(function(){t.isOpened||t.open()})),this.tagsInput.addEventListener("input",(function(){return t.calculateInputWidth()})),this.tagsInput.addEventListener("input",(0,u.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,u.htmlToElement)(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),"parent"===this.dropdownScope&&this.dropdown.classList.add("absolute","top-full"),this.dropdown.role="listbox",this.dropdown.tabIndex=-1,this.dropdown.ariaOrientation="vertical",this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&(0,u.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.disabled,e.selected,e.options,"".concat(n))})),this.apiUrl&&this.optionsFromRemoteData(),"window"===this.dropdownScope&&this.buildPopper()},e.prototype.buildPopper=function(){"undefined"!=typeof Popper&&Popper.createPopper&&(document.body.appendChild(this.dropdown),this.popperInstance=Popper.createPopper("tags"===this.mode?this.wrapper:this.toggle,this.dropdown,{placement:p.POSITIONS[this.dropdownPlacement]||"bottom",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,5]}}]}))},e.prototype.updateDropdownWidth=function(){var t="tags"===this.mode?this.wrapper:this.toggle;this.dropdown.style.width="".concat(t.clientWidth,"px")},e.prototype.buildSearch=function(){var t,e=this;this.searchWrapper=(0,u.htmlToElement)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,u.classToClassList)(this.searchWrapperClasses,this.searchWrapper),t=this.searchWrapper.querySelector("[data-input]");var n=(0,u.htmlToElement)(this.searchTemplate||'');this.search="INPUT"===n.tagName?n:n.querySelector(":scope input"),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,u.classToClassList)(this.searchClasses,this.search),this.searchId&&(this.search.id=this.searchId),this.search.addEventListener("input",(0,u.debounce)((function(t){e.apiUrl?e.remoteSearch(t.target.value):e.searchOptions(t.target.value)}))),t?t.append(n):this.searchWrapper.append(n),this.dropdown.append(this.searchWrapper)},e.prototype.buildOption=function(t,e,n,i,o,r,s){var l,c=this;void 0===n&&(n=!1),void 0===i&&(i=!1),void 0===r&&(r="1");var d=null,p=null,h=(0,u.htmlToElement)(this.optionTag||"
");if(h.setAttribute("data-value",e),h.setAttribute("data-title-value",t),h.setAttribute("tabIndex",r),h.classList.add("cursor-pointer"),h.setAttribute("data-id",s||"".concat(this.optionId)),s||this.optionId++,n&&h.classList.add("disabled"),i&&(this.isMultiple?this.value=a(a([],this.value,!0),[e],!1):this.value=e),this.optionTemplate&&(d=(0,u.htmlToElement)(this.optionTemplate),h.append(d)),d?d.querySelector("[data-title]").textContent=t||"":h.textContent=t||"",o){if(o.icon){var f=(0,u.htmlToElement)(null!==(l=this.apiIconTag)&&void 0!==l?l:o.icon);if(f.classList.add("max-w-full"),this.apiUrl&&(f.setAttribute("alt",t),f.setAttribute("src",o.icon)),d)d.querySelector("[data-icon]").append(f);else{var v=(0,u.htmlToElement)("
");this.iconClasses&&(0,u.classToClassList)(this.iconClasses,v),v.append(f),h.append(v)}}if(o.description)if(d)(p=d.querySelector("[data-description]"))&&p.append(o.description);else{var m=(0,u.htmlToElement)("
");m.textContent=o.description,this.descriptionClasses&&(0,u.classToClassList)(this.descriptionClasses,m),h.append(m)}}d&&d.querySelector("[data-icon]")&&!o&&!(null==o?void 0:o.icon)&&d.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(e):this.value===e)&&h.classList.add("selected"),n||h.addEventListener("click",(function(){return c.onSelectOption(e)})),this.optionClasses&&(0,u.classToClassList)(this.optionClasses,h),this.dropdown&&this.dropdown.append(h),i&&this.setNewValue()},e.prototype.buildOptionFromRemoteData=function(t,e,n,i,o,r,s){void 0===n&&(n=!1),void 0===i&&(i=!1),void 0===o&&(o="1"),o?this.buildOption(t,e,n,i,s,o,r):alert("ID parameter is required for generating remote options! Please check your API endpoint have it.")},e.prototype.buildOptionsFromRemoteData=function(t){var e=this;t.forEach((function(t,n){var i=null,o="",r={id:"",title:"",icon:null,description:null,rest:{}};Object.keys(t).forEach((function(n){var s;t[e.apiFieldsMap.id]&&(i=t[e.apiFieldsMap.id]),t[e.apiFieldsMap.title]&&(o=t[e.apiFieldsMap.title]),t[e.apiFieldsMap.icon]&&(r.icon=t[e.apiFieldsMap.icon]),t[null===(s=e.apiFieldsMap)||void 0===s?void 0:s.description]&&(r.description=t[e.apiFieldsMap.description]),r.rest[n]=t[n]})),e.buildOriginalOption(o,o,i,!1,!1,r),e.buildOptionFromRemoteData(o,o,!1,!1,"".concat(n),i,r)})),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")},e.prototype.optionsFromRemoteData=function(){return s(this,arguments,void 0,(function(t){var e;return void 0===t&&(t=""),l(this,(function(n){switch(n.label){case 0:return[4,this.apiRequest(t)];case 1:return e=n.sent(),this.remoteOptions=e,e.length?this.buildOptionsFromRemoteData(this.remoteOptions):console.log("There is no data were responded!"),[2]}}))}))},e.prototype.apiRequest=function(){return s(this,arguments,void 0,(function(t){var e,n,i,o,r,s;return void 0===t&&(t=""),l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=this.apiUrl,n=this.apiSearchQueryKey?"".concat(this.apiSearchQueryKey,"=").concat(t.toLowerCase()):null,i="".concat(this.apiQuery),o=this.apiOptions||{},n&&(e+="?".concat(n)),this.apiQuery&&(e+="".concat(n?"&":"?").concat(i)),[4,fetch(e,o)];case 1:return[4,l.sent().json()];case 2:return r=l.sent(),[2,this.apiDataPart?r[this.apiDataPart]:r];case 3:return s=l.sent(),console.error(s),[3,4];case 4:return[2]}}))}))},e.prototype.sortElements=function(t,e){var n=Array.from(t.querySelectorAll(e));n.sort((function(t,e){var n=t.classList.contains("selected")||t.hasAttribute("selected"),i=e.classList.contains("selected")||e.hasAttribute("selected");return n&&!i?-1:!n&&i?1:0})),n.forEach((function(e){return t.appendChild(e)}))},e.prototype.remoteSearch=function(t){return s(this,void 0,void 0,(function(){var e,n,i,o,r=this;return l(this,(function(s){switch(s.label){case 0:return[4,this.apiRequest(t)];case 1:return e=s.sent(),this.remoteOptions=e,n=e.map((function(t){return"".concat(t.id)})),null,o=this.dropdown.querySelectorAll("[data-value]"),this.el.querySelectorAll("[data-hs-select-option]").forEach((function(t){var e,i=t.getAttribute("data-id");n.includes(i)||(null===(e=r.value)||void 0===e?void 0:e.includes(t.value))||r.destroyOriginalOption(t.value)})),o.forEach((function(t){var e,i=t.getAttribute("data-id");n.includes(i)||(null===(e=r.value)||void 0===e?void 0:e.includes(t.getAttribute("data-value")))?n=n.filter((function(t){return t!==i})):r.destroyOption(t.getAttribute("data-value"))})),(i=e.filter((function(t){return n.includes("".concat(t.id))}))).length?this.buildOptionsFromRemoteData(i):console.log("There is no data were responded!"),[2]}}))}))},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,i,o,r){var s=(0,u.htmlToElement)("");s.setAttribute("value",e),i&&s.setAttribute("disabled","disabled"),o&&s.setAttribute("selected","selected"),n&&s.setAttribute("data-id",n),s.setAttribute("data-hs-select-option",JSON.stringify(r)),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,i=this.wrapper.offsetWidth-(parseInt(window.getComputedStyle(this.wrapper).paddingLeft)+parseInt(window.getComputedStyle(this.wrapper).paddingRight));this.tagsInput.style.width="".concat(Math.min(n,i)+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})):a(a([],Array.from(this.value),!0),[t],!1),this.selectMultipleItems(),this.setNewValue()):(this.value=t,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),(0,u.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(),this.triggerChangeEventForNativeSelect()},e.prototype.triggerChangeEventForNativeSelect=function(){var t=new Event("change",{bubbles:!0});this.el.dispatchEvent(t)},e.prototype.addSelectOption=function(t,e,n,i,o){this.selectOptions=a(a([],this.selectOptions,!0),[{title:t,val:e,disabled:n,selected:i,options:o}],!1)},e.prototype.removeSelectOption=function(t,e){if(void 0===e&&(e=!1),!!!this.selectOptions.some((function(e){return e.val===t})))return!1;this.selectOptions=this.selectOptions.filter((function(e){return e.val!==t})),this.value=e?this.value.filter((function(e){return e!==t})):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(){var t;"tags"===this.mode?this.setTagsItems():(null===(t=this.value)||void 0===t?void 0:t.length)?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder},e.prototype.stringFromValueBasic=function(t){var e=this,n=[],i="";if(t.forEach((function(t){e.isMultiple?e.value.includes(t.val)&&n.push(t.title):e.value===t.val&&n.push(t.title)})),this.toggleCountText&&""!==this.toggleCountText&&n.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){var o=n.slice(0,this.toggleCountTextMinItems-1);i="".concat(o.join(this.toggleSeparators.items)," ").concat(this.toggleSeparators.betweenItemsAndCounter," ").concat(n.length-o.length," ").concat(this.toggleCountText)}else i="".concat(n.length," ").concat(this.toggleCountText);else i=n.join(this.toggleSeparators.items);return i},e.prototype.stringFromValueRemoteData=function(){var t=this,e=this.dropdown.querySelectorAll("[data-title-value]"),n=[],i="";if(e.forEach((function(e){var i=e.getAttribute("data-value");t.isMultiple?t.value.includes(i)&&n.push(i):t.value===i&&n.push(i)})),this.toggleCountText&&""!==this.toggleCountText&&n.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){var o=n.slice(0,this.toggleCountTextMinItems-1);i="".concat(o.join(this.toggleSeparators.items)," ").concat(this.toggleSeparators.betweenItemsAndCounter," ").concat(n.length-o.length," ").concat(this.toggleCountText)}else i="".concat(n.length," ").concat(this.toggleCountText);else i=n.join(this.toggleSeparators.items);return i},e.prototype.stringFromValue=function(){return this.apiUrl?this.stringFromValueRemoteData():this.stringFromValueBasic(this.selectOptions)},e.prototype.selectSingleItem=function(){var t=this;Array.from(this.el.children).find((function(e){return t.value===e.value})).selected=!0;var e=Array.from(this.dropdown.children).find((function(e){return t.value===e.getAttribute("data-value")}));e&&e.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){var e=this;this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,u.htmlToElement)(this.searchNoResultTemplate),this.searchNoResult.innerText=this.searchNoResultText,(0,u.classToClassList)(this.searchNoResultClasses,this.searchNoResult);var n,i=this.dropdown.querySelectorAll("[data-value]"),o=!1;this.searchLimit&&(n=0),i.forEach((function(i){var r=i.getAttribute("data-title-value").toLocaleLowerCase(),s=t?t.split("").map((function(t){return t.match(/\w/)?"".concat(t,"[\\W_]*"):"\\W*"})).join(""):"",l=new RegExp(s,"i"),a=e.isSearchDirectMatch,c=r.trim();(t?a?!c.toLowerCase().includes(t.toLowerCase())||n>=e.searchLimit:!l.test(c)||n>=e.searchLimit:!l.test(c))?i.classList.add("hidden"):(i.classList.remove("hidden"),o=!0,e.searchLimit&&n++)})),o||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.toggleFn=function(){this.isOpened?this.close():this.open()},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,e=this,n=(null===(t=null===window||void 0===window?void 0:window.$hsSelectCollection)||void 0===t?void 0:t.find((function(t){return t.element.isOpened})))||null;if(n&&n.element.close(),this.animationInProcess)return!1;this.animationInProcess=!0,"window"===this.dropdownScope&&this.dropdown.classList.add("invisible"),this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout((function(){var t;(null===(t=null==e?void 0:e.toggle)||void 0===t?void 0:t.ariaExpanded)&&(e.toggle.ariaExpanded="true"),e.wrapper.classList.add("active"),e.dropdown.classList.add("opened"),e.dropdown.classList.contains("w-full")&&"window"===e.dropdownScope&&e.updateDropdownWidth(),e.popperInstance&&"window"===e.dropdownScope&&(e.popperInstance.update(),e.dropdown.classList.remove("invisible")),e.hasSearch&&!e.preventSearchFocus&&e.search.focus(),e.animationInProcess=!1})),this.isOpened=!0},e.prototype.close=function(){var t,e,n,i,o=this;if(this.animationInProcess)return!1;this.animationInProcess=!0,(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,u.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===(i=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===i||i.classList.remove("hs-select-option-highlighted"),this.isOpened=!1},e.prototype.addOption=function(t){var e=this,n="".concat(this.selectOptions.length),i=function(t){var i=t.title,o=t.val,r=t.disabled,s=t.selected,l=t.options;!!e.selectOptions.some((function(t){return t.val===o}))||(e.addSelectOption(i,o,r,s,l),e.buildOption(i,o,r,s,l,n),e.buildOriginalOption(i,o,null,r,s,l),s&&!e.isMultiple&&e.onSelectOption(o))};Array.isArray(t)?t.forEach((function(t){i(t)})):i(t)},e.prototype.removeOption=function(t){var e=this,n=function(t,n){void 0===n&&(n=!1),!!e.selectOptions.some((function(e){return e.val===t}))&&(e.removeSelectOption(t,n),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,e.isMultiple)})):n(t,this.isMultiple),this.setNewValue()},e.prototype.recalculateDirection=function(){var t,e,n,i;(0,u.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===(i=this.dropdownDirectionClasses)||void 0===i?void 0:i.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"),i=n?JSON.parse(n):{};new e(t,i)}})),window.$hsSelectCollection&&(window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)})))},e.open=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.open()},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")&&!t.closest("[data-hs-select-dropdown].opened")){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}))&&p.SELECT_ACCESSIBILITY_KEY_SET.includes(t.code)&&!t.metaKey)switch(t.code){case"Escape":t.preventDefault(),this.onEscape();break;case"ArrowUp":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":t.preventDefault(),t.stopImmediatePropagation(),this.onArrow(!1);break;case"Tab":t.preventDefault(),t.stopImmediatePropagation(),this.onTab(t.shiftKey);break;case"Home":t.preventDefault(),t.stopImmediatePropagation(),this.onStartEnd();break;case"End":t.preventDefault(),t.stopImmediatePropagation(),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 i=(t?Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),o=n.querySelector(".hs-select-option-highlighted")||n.querySelector(".selected");o||i[0].classList.add("hs-select-option-highlighted");var r=i.findIndex((function(t){return t===o}));r+1 *:not(.hidden)")).reverse():Array.from(n.querySelectorAll(":scope > *:not(.hidden)"))).filter((function(t){return!t.classList.contains("disabled")})),o=n.querySelector(".hs-select-option-highlighted")||n.querySelector(".selected");o||i[0].classList.add("hs-select-option-highlighted");var r=i.findIndex((function(t){return t===o}));if(!(r+1 *:not(.hidden)")):Array.from(n.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((function(t){return!t.classList.contains("disabled")})),o=n.querySelector(".hs-select-option-highlighted");i.length&&(i[0].focus(),o&&o.classList.remove("hs-select-option-highlighted"),i[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})),i=window.$hsSelectCollection.find((function(t){return t.element.el===e}));n.element.close(),i.element.open()}else{(i=window.$hsSelectCollection.find((function(t){return t.element.isOpened})))&&i.element.onSelectOption(t.target.dataset.value||"")}},e}(d.default);window.addEventListener("load",(function(){h.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=h),e.default=h},887:function(t,e,n){ /* * HSStepper - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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,l.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,l.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,l.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,l.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,l.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,l.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,l.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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=a),e.default=a},97:function(t,e,n){ +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;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,o=t.el;n===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||i)&&o.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,o=void 0!==i&&i,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:o,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,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,l.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,o=void 0!==i&&i,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:o,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,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,l.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,l.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,l.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,l.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,l.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 o=this.navItems.find((function(e){return e.index===t.currentIndex}));(o?o.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,l.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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=a),e.default=a},97:function(t,e,n){ /* * HSStrongPassword - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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,l.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,l.dispatch)("change.hs.strongPassword",this.el,o)},e.prototype.hideStrips=function(t){Array.from(this.el.children).forEach((function(e,n){n?@[\\\\\\]^_`{|}~",i.target&&i.init(),i}return o(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,l.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,i=e.getAttribute("data-hs-strong-password-hints-rule-text");(null===(n=t.checksExclude)||void 0===n?void 0:n.includes(i))&&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,"]"))},i=0;return this.availableChecks.includes("lowercase")&&t.match(n.lowercase)&&(i+=1,e.add("lowercase")),this.availableChecks.includes("uppercase")&&t.match(n.uppercase)&&(i+=1,e.add("uppercase")),this.availableChecks.includes("numbers")&&t.match(n.numbers)&&(i+=1,e.add("numbers")),this.availableChecks.includes("special-characters")&&t.match(n["special-characters"])&&(i+=1,e.add("special-characters")),this.availableChecks.includes("min-length")&&t.length>=this.minLength&&(i+=1,e.add("min-length")),t.length||(i=0),i===this.availableChecks.length?this.el.classList.add("accepted"):this.el.classList.remove("accepted"),this.strength=i,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]"),i=t.querySelector("[data-uncheck]");e?(t.classList.add("active"),n.classList.remove("hidden"),i.classList.add("hidden")):(t.classList.remove("active"),n.classList.add("hidden"),i.classList.remove("hidden"))},e.prototype.setStrength=function(t){var e=this.checkStrength(t),n=e.strength,i={strength:n,rules:e.rules};this.hideStrips(n),this.fireEvent("change",i),(0,l.dispatch)("change.hs.strongPassword",this.el,i)},e.prototype.hideStrips=function(t){Array.from(this.el.children).forEach((function(e,n){nt)},e.prototype.isParentHidden=function(){return this.el.closest(".hs-collapse")||this.el.closest(".hs-overlay")},e.prototype.parentType=function(){return this.el.closest(".hs-collapse")?"collapse":!!this.el.closest(".hs-overlay")&&"overlay"},e.prototype.callbackAccordingToType=function(){var t=this;if("collapse"===this.parentType()){var e=this.el.closest(".hs-collapse").id;window.HSCollapse.getInstance('[data-hs-collapse="#'.concat(e,'"]'),!0).element.on("beforeOpen",(function(){if(!t.el)return!1;t.textareaSetHeight(3)}))}else{if("overlay"!==this.parentType())return!1;window.HSOverlay.getInstance(this.el.closest(".hs-overlay"),!0).element.on("open",(function(){if(!t.el)return!1;t.textareaSetHeight(3)}))}},e.getInstance=function(t,e){var n=window.$hsTextareaAutoHeightCollection.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.$hsTextareaAutoHeightCollection||(window.$hsTextareaAutoHeightCollection=[]),document.querySelectorAll("[data-hs-textarea-auto-height]:not(.--prevent-on-load-init)").forEach((function(t){if(!window.$hsTextareaAutoHeightCollection.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-textarea-auto-height"),i=n?JSON.parse(n):{};new e(t,i)}}))},e}(s(n(961)).default);window.addEventListener("load",(function(){l.autoInit()})),"undefined"!=typeof window&&(window.HSTextareaAutoHeight=l),e.default=l},502:function(t,e,n){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;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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=a),e.default=a},969:function(t,e,n){ +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;n1&&!!i.el.closest("[data-hs-toggle-password-group]"),i.target&&i.init(),i}return o(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,l.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}(s(n(961)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=a),e.default=a},969:function(t,e,n){ /* * HSTooltip - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -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{ +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&&a{ /* * HSStaticMethods - * @version: 2.4.1 + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ +Object.defineProperty(e,"__esModule",{value:!0});var i=n(292),o=n(255),r={getClassProperty:i.getClassProperty,afterTransition:i.afterTransition,autoInit:function(t){void 0===t&&(t="all"),"all"===t?o.COLLECTIONS.forEach((function(t){var e=t.fn;null==e||e.autoInit()})):o.COLLECTIONS.forEach((function(e){var n=e.key,i=e.fn;t.includes(n)&&(null==i||i.autoInit())}))},cleanCollection:function(t){void 0===t&&(t="all"),"all"===t?o.COLLECTIONS.forEach((function(t){var e=t.collection;window[e]instanceof Array&&(window[e]=[])})):o.COLLECTIONS.forEach((function(e){var n=e.key,i=e.collection;t.includes(n)&&window[i]instanceof Array&&(window[i]=[])}))}};"undefined"!=typeof window&&(window.HSStaticMethods=r),e.default=r},292:function(t,e){ +/* + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -Object.defineProperty(e,"__esModule",{value:!0});var o=n(292),i=n(255),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())}))},cleanCollection:function(t){void 0===t&&(t="all"),"all"===t?i.COLLECTIONS.forEach((function(t){var e=t.collection;window[e]instanceof Array&&(window[e]=[])})):i.COLLECTIONS.forEach((function(e){var n=e.key,o=e.collection;t.includes(n)&&window[o]instanceof Array&&(window[o]=[])}))}};"undefined"!=typeof window&&(window.HSStaticMethods=r),e.default=r},292: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.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=o(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var o=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=o;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 i=function(t){return!!t&&("none"===window.getComputedStyle(t).display||i(t.parentElement))};e.isParentOrElementHidden=i;e.debounce=function(t,e){var o;return void 0===e&&(e=200),function(){for(var i=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),t.split(n).forEach((function(t){return"add"===o?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.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}return 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})},n(158)})())); \ No newline at end of file +var n=this;Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isDirectChild=e.isFormElement=e.isParentOrElementHidden=e.isEnoughSpace=e.isIpadOS=e.isIOS=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0,e.getHighestZIndex=function(t){var e=Number.NEGATIVE_INFINITY;return t.forEach((function(t){var n=i(t);"auto"!==n&&(n=parseInt(n,10))>e&&(e=n)})),e};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};var i=function(t){return window.getComputedStyle(t).getPropertyValue("z-index")};e.getZIndex=i;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.isDirectChild=function(t,e){for(var n=t.children,i=0;i=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 i;return void 0===e&&(e=200),function(){for(var o=[],r=0;r0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=function(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=function(t,e,n,i){void 0===n&&(n=" "),void 0===i&&(i="add"),t.split(n).forEach((function(t){return"add"===i?e.classList.add(t):e.classList.remove(t)}))};e.menuSearchHistory={historyIndex:-1,addHistory:function(t){this.historyIndex=t},existsInHistory:function(t){return t>this.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},e={};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}return n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},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})},n(158)})())); \ No newline at end of file diff --git a/src/constants.ts b/src/constants.ts index 721a503..15e835b 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -60,6 +60,7 @@ export const COMBO_BOX_ACCESSIBILITY_KEY_SET = [ ]; export const BREAKPOINTS: any = { + xs: 0, sm: 640, md: 768, lg: 1024, diff --git a/src/helpers/apexcharts/index.ts b/src/helpers/apexcharts/index.ts new file mode 100644 index 0000000..d5b5afa --- /dev/null +++ b/src/helpers/apexcharts/index.ts @@ -0,0 +1,307 @@ +/* + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ + +import { + IBuildTooltipHelperOptions, + IChartProps, + IChartPropsSeries, + IChartDonutProps, +} from './interfaces'; +import { EventWithProps } from '../types'; + +function buildTooltip(props: IChartProps, options: IBuildTooltipHelperOptions) { + const { + title, + mode, + valuePrefix = '$', + isValueDivided = true, + valuePostfix = '', + hasTextLabel = false, + invertGroup = false, + labelDivider = '', + wrapperClasses = 'ms-0.5 mb-2 bg-white border border-gray-200 text-gray-800 rounded-lg shadow-md dark:bg-neutral-800 dark:border-neutral-700', + wrapperExtClasses = '', + seriesClasses = 'text-[12px]', + seriesExtClasses = '', + titleClasses = 'font-semibold !text-sm !bg-white !border-gray-200 text-gray-800 rounded-t-lg dark:!bg-neutral-800 dark:!border-neutral-700 dark:text-neutral-200', + titleExtClasses = '', + markerClasses = '!w-2.5 !h-2.5 !me-1.5', + markerExtClasses = '!rounded-sm', + valueClasses = '!font-medium text-gray-500 !ms-auto dark:text-neutral-400', + valueExtClasses = '', + labelClasses = 'text-gray-500 dark:text-neutral-400', + labelExtClasses = '', + } = options; + const { dataPointIndex } = props; + const { colors } = props.ctx.opts; + const series = props.ctx.opts.series as IChartPropsSeries[]; + let seriesGroups = ''; + + series.forEach((single, i) => { + const val = + props.series[i][dataPointIndex] || + (typeof series[i].data[dataPointIndex] !== 'object' + ? series[i].data[dataPointIndex] + : props.series[i][dataPointIndex]); + const label = series[i].name; + const groupData = invertGroup + ? { + left: `${hasTextLabel ? label : ''}${labelDivider}`, + right: `${valuePrefix}${val >= 1000 && isValueDivided ? `${val / 1000}k` : val}${valuePostfix}`, + } + : { + left: `${valuePrefix}${val >= 1000 && isValueDivided ? `${val / 1000}k` : val}${valuePostfix}`, + right: `${hasTextLabel ? label : ''}${labelDivider}`, + }; + const labelMarkup = `${groupData.left}`; + + seriesGroups += `
+ + +
+
+ ${groupData.right} +
+
+
+ ${labelMarkup} +
`; + }); + + return `
+
${title}
+ ${seriesGroups} +
`; +} + +function buildTooltipCompareTwo( + props: IChartProps, + options: IBuildTooltipHelperOptions, +) { + const { dataPointIndex } = props; + const { categories } = props.ctx.opts.xaxis; + const { colors } = props.ctx.opts; + const series = props.ctx.opts.series as IChartPropsSeries[]; + + const { + title, + mode, + valuePrefix = '$', + isValueDivided = true, + valuePostfix = '', + hasCategory = true, + hasTextLabel = false, + labelDivider = '', + wrapperClasses = 'ms-0.5 mb-2 bg-white border border-gray-200 text-gray-800 rounded-lg shadow-md dark:bg-neutral-800 dark:border-neutral-700', + wrapperExtClasses = '', + seriesClasses = '!justify-between w-full text-[12px]', + seriesExtClasses = '', + titleClasses = 'flex justify-between font-semibold !text-sm !bg-white !border-gray-200 text-gray-800 rounded-t-lg dark:!bg-neutral-800 dark:!border-neutral-700 dark:text-neutral-200', + titleExtClasses = '', + markerClasses = '!w-2.5 !h-2.5 !me-1.5', + markerExtClasses = '!rounded-sm', + valueClasses = '!font-medium text-gray-500 !ms-auto dark:text-neutral-400', + valueExtClasses = '', + labelClasses = 'text-gray-500 dark:text-neutral-400 ms-2', + labelExtClasses = '', + } = options; + + let seriesGroups = ''; + const s0 = series[0].data[dataPointIndex]; + const s1 = series[1].data[dataPointIndex]; + const category = categories[dataPointIndex].split(' '); + const newCategory = hasCategory + ? `${category[0]}${category[1] ? ' ' : ''}${category[1] ? category[1].slice(0, 3) : ''}` + : ''; + const isGrowing = s0 > s1; + const isDifferenceIsNull = s0 / s1 === 1; + const difference = isDifferenceIsNull ? 0 : (s0 / s1) * 100; + const icon = isGrowing + ? `` + : ``; + + series.forEach((_, i) => { + const val = + props.series[i][dataPointIndex] || + (typeof series[i].data[dataPointIndex] !== 'object' + ? series[i].data[dataPointIndex] + : props.series[i][dataPointIndex]); + const label = series[i].name; + const altValue = series[i].altValue || null; + const labelMarkup = `${newCategory} ${label || ''}`; + const valueMarkup = + altValue || + `${valuePrefix}${val >= 1000 && isValueDivided ? `${val / 1000}k` : val}${valuePostfix}${labelDivider}`; + + seriesGroups += `
+ + +
+
+ ${valueMarkup} +
+
+
+ ${hasTextLabel ? labelMarkup : ''} +
`; + }); + + return `
+
+ ${title} + + ${!isDifferenceIsNull ? icon : ''} + + ${difference.toFixed(1)}% + + +
+ ${seriesGroups} +
`; +} + +function buildTooltipCompareTwoAlt( + props: IChartProps, + options: IBuildTooltipHelperOptions, +) { + const { dataPointIndex } = props; + const { categories } = props.ctx.opts.xaxis; + const { colors } = props.ctx.opts; + const series = props.ctx.opts.series as IChartPropsSeries[]; + + const { + title, + mode, + valuePrefix = '$', + isValueDivided = true, + valuePostfix = '', + hasCategory = true, + hasTextLabel = false, + labelDivider = '', + wrapperClasses = 'ms-0.5 mb-2 bg-white border border-gray-200 text-gray-800 rounded-lg shadow-md dark:bg-neutral-800 dark:border-neutral-700', + wrapperExtClasses = '', + seriesClasses = '!justify-between w-full text-[12px]', + seriesExtClasses = '', + titleClasses = 'flex justify-between font-semibold !text-sm !bg-white !border-gray-200 text-gray-800 rounded-t-lg dark:!bg-neutral-800 dark:!border-neutral-700 dark:text-neutral-200', + titleExtClasses = '', + markerClasses = '!w-2.5 !h-2.5 !me-1.5', + markerExtClasses = '!rounded-sm', + valueClasses = '!font-medium text-gray-500 !ms-auto dark:text-neutral-400', + valueExtClasses = '', + labelClasses = 'text-gray-500 dark:text-neutral-400 ms-2', + labelExtClasses = '', + } = options; + + let seriesGroups = ''; + const s0 = series[0].data[dataPointIndex]; + const s1 = series[1].data[dataPointIndex]; + const category = categories[dataPointIndex].split(' '); + const newCategory = hasCategory + ? `${category[0]}${category[1] ? ' ' : ''}${category[1] ? category[1].slice(0, 3) : ''}` + : ''; + const isGrowing = s0 > s1; + const isDifferenceIsNull = s0 / s1 === 1; + const difference = isDifferenceIsNull ? 0 : (s0 / s1) * 100; + const icon = isGrowing + ? `` + : ``; + + series.forEach((single, i) => { + const val = + props.series[i][dataPointIndex] || + (typeof series[i].data[dataPointIndex] !== 'object' + ? series[i].data[dataPointIndex] + : props.series[i][dataPointIndex]); + const label = series[i].name; + const labelMarkup = `${valuePrefix}${val >= 1000 && isValueDivided ? `${val / 1000}k` : val}${valuePostfix}`; + + seriesGroups += `
+ + +
+
+ ${newCategory} ${label || ''}${labelDivider} +
+
+
+ ${hasTextLabel ? labelMarkup : ''} +
`; + }); + + return `
+
+ ${title} + + ${!isDifferenceIsNull ? icon : ''} + + ${difference.toFixed(1)}% + + +
+ ${seriesGroups} +
`; +} + +function buildTooltipForDonut( + { series, seriesIndex, w }: IChartDonutProps, + textColor: string[], +) { + const { globals } = w; + const { colors } = globals; + + return `
+
+
+ ${globals.labels[seriesIndex]}: + ${series[seriesIndex]} +
+
+
`; +} + +function buildChart(id: string, shared: Function, light: string, dark: string) { + const $chart = document.querySelector(id); + let chart: any = null; + + if (!$chart) return false; + + const tabpanel = $chart.closest('[role="tabpanel"]'); + let modeFromBodyClass: string | null = null; + + Array.from(document.querySelector('html').classList).forEach((cl) => { + if (['dark', 'light', 'default'].includes(cl)) modeFromBodyClass = cl; + }); + + const optionsFn = ( + mode = modeFromBodyClass || localStorage.getItem('hs_theme'), + ) => window._.merge(shared(mode), mode === 'dark' ? dark : light); + + if ($chart) { + chart = new ApexCharts($chart, optionsFn()); + chart.render(); + + window.addEventListener('on-hs-appearance-change', (evt: EventWithProps) => + chart.updateOptions(optionsFn(evt.detail)), + ); + + if (tabpanel) + tabpanel.addEventListener( + 'on-hs-appearance-change', + (evt: EventWithProps) => chart.updateOptions(optionsFn(evt.detail)), + ); + } + + return chart; +} + +export { + buildTooltip, + buildTooltipCompareTwo, + buildTooltipCompareTwoAlt, + buildTooltipForDonut, + buildChart, +}; diff --git a/src/helpers/apexcharts/interfaces.ts b/src/helpers/apexcharts/interfaces.ts new file mode 100644 index 0000000..74d10e3 --- /dev/null +++ b/src/helpers/apexcharts/interfaces.ts @@ -0,0 +1,47 @@ +import { ApexOptions } from 'apexcharts'; + +export interface IBuildTooltipHelperOptions { + title: string; + mode: string; + valuePrefix: string; + isValueDivided: boolean; + valuePostfix: string; + hasTextLabel: boolean; + invertGroup: boolean; + labelDivider: string; + wrapperClasses: string; + wrapperExtClasses: string; + seriesClasses: string; + seriesExtClasses: string; + titleClasses: string; + titleExtClasses: string; + markerClasses: string; + markerExtClasses: string; + valueClasses: string; + valueExtClasses: string; + labelClasses: string; + labelExtClasses: string; + hasCategory?: boolean; +} + +export interface IChartProps { + dataPointIndex: number; + ctx: { + opts: ApexOptions; + }; + series: [][]; +} + +export interface IChartPropsSeries { + name: string; + altValue?: string; + data: number[]; +} + +export interface IChartDonutProps { + series: IChartPropsSeries[]; + seriesIndex: number; + w: { + globals: ApexOptions; + }; +} diff --git a/src/helpers/clipboard/index.ts b/src/helpers/clipboard/index.ts new file mode 100644 index 0000000..37a2c2b --- /dev/null +++ b/src/helpers/clipboard/index.ts @@ -0,0 +1,70 @@ +/* + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ + +declare var ClipboardJS: any; + +const clipboardSelector = window?.HS_CLIPBOARD_SELECTOR ?? '.js-clipboard'; + +window.addEventListener('load', () => { + const $clipboards = document.querySelectorAll(clipboardSelector); + + $clipboards.forEach((el: HTMLElement) => { + const clipboard = new ClipboardJS(el, { + text: ( + trigger: HTMLSelectElement | HTMLInputElement | HTMLTextAreaElement, + ) => { + const clipboardText = trigger.dataset.clipboardText; + + if (clipboardText) return clipboardText; + + const clipboardTarget = trigger.dataset.clipboardTarget; + const $element: + | HTMLSelectElement + | HTMLInputElement + | HTMLTextAreaElement = document.querySelector(clipboardTarget); + + if ( + $element.tagName === 'SELECT' || + $element.tagName === 'INPUT' || + $element.tagName === 'TEXTAREA' + ) + return $element.value; + else return $element.textContent; + }, + }); + clipboard.on('success', () => { + const $default: HTMLElement = el.querySelector('.js-clipboard-default'); + const $success: HTMLElement = el.querySelector('.js-clipboard-success'); + const $successText = el.querySelector('.js-clipboard-success-text'); + const successText = el.dataset.clipboardSuccessText || ''; + const tooltip = el.closest('.hs-tooltip'); + let oldSuccessText: string; + + if ($successText) { + oldSuccessText = $successText.textContent; + $successText.textContent = successText; + } + if ($default && $success) { + $default.style.display = 'none'; + $success.style.display = 'block'; + } + if (tooltip) (window.HSTooltip as any).show(tooltip); + + setTimeout(function () { + if ($successText && oldSuccessText) + $successText.textContent = oldSuccessText; + if (tooltip) (window.HSTooltip as any).hide(tooltip); + if ($default && $success) { + $success.style.display = ''; + $default.style.display = ''; + } + }, 800); + }); + }); +}); + +export {}; diff --git a/src/helpers/types.ts b/src/helpers/types.ts new file mode 100644 index 0000000..55682d0 --- /dev/null +++ b/src/helpers/types.ts @@ -0,0 +1,12 @@ +export type EventProps = { + detail: string; +}; + +export type OptionProps = { + options: { + toggleLight: string; + isDark: boolean; + }; +}; + +export type EventWithProps = Event & EventProps; diff --git a/src/index.ts b/src/index.ts index 1fa00f8..2c3b270 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,18 @@ +/* + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ + declare var _: any; declare var DataTable: any; declare var Dropzone: any; +declare var noUiSlider: any; let HSDataTableModule; let HSFileUploadModule; +let HSRangeSliderModule; export { default as HSCopyMarkup } from './plugins/copy-markup'; export { default as HSAccordion } from './plugins/accordion'; @@ -20,10 +29,12 @@ export { default as HSSelect } from './plugins/select'; export { default as HSStepper } from './plugins/stepper'; export { default as HSStrongPassword } from './plugins/strong-password'; export { default as HSTabs } from './plugins/tabs'; +export { default as HSTextareaAutoHeight } from './plugins/textarea-auto-height'; export { default as HSThemeSwitch } from './plugins/theme-switch'; export { default as HSToggleCount } from './plugins/toggle-count'; export { default as HSTogglePassword } from './plugins/toggle-password'; export { default as HSTooltip } from './plugins/tooltip'; +export { default as HSTreeView } from './plugins/tree-view'; export { default as HSStaticMethods } from './static'; if (typeof DataTable !== 'undefined' && typeof jQuery !== 'undefined') @@ -34,4 +45,9 @@ export { HSDataTableModule as HSDataTable }; if (typeof _ !== 'undefined' && typeof Dropzone !== 'undefined') HSFileUploadModule = require('./plugins/file-upload').default; else HSFileUploadModule = null; -export { HSFileUploadModule as HSFileUpload }; \ No newline at end of file +export { HSFileUploadModule as HSFileUpload }; + +if (typeof typeof noUiSlider !== 'undefined') + HSRangeSliderModule = require('./plugins/range-slider').default; +else HSRangeSliderModule = null; +export { HSRangeSliderModule as HSRangeSlider }; diff --git a/src/plugins/accordion/index.ts b/src/plugins/accordion/index.ts index a2eb6fe..2b3b365 100644 --- a/src/plugins/accordion/index.ts +++ b/src/plugins/accordion/index.ts @@ -1,6 +1,6 @@ /* * HSAccordion - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -13,7 +13,7 @@ import { IAccordion, IAccordionTreeView, IAccordionTreeViewStaticOptions, -} from './interfaces'; +} from '../accordion/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; @@ -24,8 +24,8 @@ class HSAccordion { private readonly toggle: HTMLElement | null; public content: HTMLElement | null; - private readonly group: HTMLElement | null; - private readonly isAlwaysOpened: boolean; + private group: HTMLElement | null; + private isAlwaysOpened: boolean; static selectable: IAccordionTreeView[]; @@ -34,9 +34,7 @@ class HSAccordion this.toggle = this.el.querySelector('.hs-accordion-toggle') || null; this.content = this.el.querySelector('.hs-accordion-content') || null; - this.group = this.el.closest('.hs-accordion-group') || null; - this.isAlwaysOpened = - this.group.hasAttribute('data-hs-accordion-always-open') || false; + this.update(); if (this.toggle && this.content) this.init(); } @@ -112,6 +110,24 @@ class HSAccordion }); } + public update() { + this.group = this.el.closest('.hs-accordion-group') || null; + + if (!this.group) return false; + + this.isAlwaysOpened = + this.group.hasAttribute('data-hs-accordion-always-open') || false; + + window.$hsAccordionCollection.map((el) => { + if (el.id === this.el.id) { + el.element.group = this.group; + el.element.isAlwaysOpened = this.isAlwaysOpened; + } + + return el; + }); + } + // Static methods static getInstance(target: HTMLElement | string, isInstance?: boolean) { const elInCollection = window.$hsAccordionCollection.find( diff --git a/src/plugins/base-plugin/index.ts b/src/plugins/base-plugin/index.ts index 394948c..d06f97b 100644 --- a/src/plugins/base-plugin/index.ts +++ b/src/plugins/base-plugin/index.ts @@ -1,12 +1,14 @@ +/// + /* * HSBasePlugin - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -import { IBasePlugin } from './interfaces'; +import { IBasePlugin } from '../base-plugin/interfaces'; export default class HSBasePlugin implements IBasePlugin diff --git a/src/plugins/carousel/index.ts b/src/plugins/carousel/index.ts index e94f44a..4680b8f 100644 --- a/src/plugins/carousel/index.ts +++ b/src/plugins/carousel/index.ts @@ -1,40 +1,70 @@ /* * HSCarousel - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ +import { classToClassList, debounce, htmlToElement } from '../../utils'; + import { ICarousel, ICarouselOptions } from './interfaces'; +import { TCarouselOptionsSlidesQty } from './types'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; +import { BREAKPOINTS } from '../../constants'; class HSCarousel extends HSBasePlugin implements ICarousel { - private readonly inner: HTMLElement | null; - private readonly slides: NodeListOf | undefined[]; - private readonly prev: HTMLElement | null; - private readonly next: HTMLElement | null; - private readonly dots: NodeListOf | null; - private sliderWidth: number; private currentIndex: number; private readonly loadingClasses: string | string[]; - private readonly loadingClassesRemove: string | string[]; - private readonly loadingClassesAdd: string | string[]; - private readonly afterLoadingClassesAdd: string | string[]; + private readonly dotsItemClasses: string; + private readonly isAutoHeight: boolean; private readonly isAutoPlay: boolean; + private readonly isCentered: boolean; + private readonly isDraggable: boolean; + private readonly isInfiniteLoop: boolean; private readonly isRTL: boolean; + private readonly isSnap: boolean; + private readonly hasSnapSpacers: boolean; + private readonly slidesQty: TCarouselOptionsSlidesQty | number; private readonly speed: number; - private readonly isInfiniteLoop: boolean; + private readonly updateDelay: number; + + private readonly loadingClassesRemove: string | string[]; + private readonly loadingClassesAdd: string | string[]; + private readonly afterLoadingClassesAdd: string | string[]; + + private readonly container: HTMLElement | null; + private readonly inner: HTMLElement | null; + private readonly slides: NodeListOf | undefined[]; + private readonly prev: HTMLElement | null; + private readonly next: HTMLElement | null; + private readonly dots: HTMLElement | null; + private dotsItems: NodeListOf | undefined[] | null; + private readonly info: HTMLElement | null; + private readonly infoTotal: HTMLElement | null; + private readonly infoCurrent: HTMLElement | null; + + private sliderWidth: number; private timer: any; + // Drag events' help variables + private isScrolling: ReturnType; + private isDragging: boolean; + private dragStartX: number | null; + private initialTranslateX: number | null; + // Touch events' help variables private readonly touchX: { start: number; end: number; }; + // Resize events' help variables + private resizeContainer: HTMLElement; + public resizeContainerWidth: number; + constructor(el: HTMLElement, options?: ICarouselOptions) { super(el, options); @@ -49,32 +79,71 @@ class HSCarousel extends HSBasePlugin implements ICarousel { this.loadingClasses = concatOptions.loadingClasses ? `${concatOptions.loadingClasses}`.split(',') : null; - this.loadingClassesRemove = this.loadingClasses?.[0] - ? this.loadingClasses[0].split(' ') - : 'opacity-0'; - this.loadingClassesAdd = this.loadingClasses?.[1] - ? this.loadingClasses[1].split(' ') - : ''; - this.afterLoadingClassesAdd = this.loadingClasses?.[2] - ? this.loadingClasses[2].split(' ') - : ''; + this.dotsItemClasses = concatOptions.dotsItemClasses + ? concatOptions.dotsItemClasses + : null; + this.isAutoHeight = + typeof concatOptions.isAutoHeight !== 'undefined' + ? concatOptions.isAutoHeight + : false; this.isAutoPlay = typeof concatOptions.isAutoPlay !== 'undefined' ? concatOptions.isAutoPlay : false; - this.speed = concatOptions.speed || 4000; + this.isCentered = + typeof concatOptions.isCentered !== 'undefined' + ? concatOptions.isCentered + : false; + this.isDraggable = + typeof concatOptions.isDraggable !== 'undefined' + ? concatOptions.isDraggable + : false; this.isInfiniteLoop = typeof concatOptions.isInfiniteLoop !== 'undefined' ? concatOptions.isInfiniteLoop - : true; + : false; this.isRTL = typeof concatOptions.isRTL !== 'undefined' ? concatOptions.isRTL : false; + this.isSnap = + typeof concatOptions.isSnap !== 'undefined' + ? concatOptions.isSnap + : false; + this.hasSnapSpacers = + typeof concatOptions.hasSnapSpacers !== 'undefined' + ? concatOptions.hasSnapSpacers + : true; + this.speed = concatOptions.speed || 4000; + this.updateDelay = concatOptions.updateDelay || 0; + this.slidesQty = concatOptions.slidesQty || 1; + + this.loadingClassesRemove = this.loadingClasses?.[0] + ? this.loadingClasses[0].split(' ') + : 'opacity-0'; + this.loadingClassesAdd = this.loadingClasses?.[1] + ? this.loadingClasses[1].split(' ') + : ''; + this.afterLoadingClassesAdd = this.loadingClasses?.[2] + ? this.loadingClasses[2].split(' ') + : ''; + + this.container = this.el.querySelector('.hs-carousel') || null; this.inner = this.el.querySelector('.hs-carousel-body') || null; this.slides = this.el.querySelectorAll('.hs-carousel-slide') || []; this.prev = this.el.querySelector('.hs-carousel-prev') || null; this.next = this.el.querySelector('.hs-carousel-next') || null; - this.dots = this.el.querySelectorAll('.hs-carousel-pagination > *') || null; - this.sliderWidth = this.inner.parentElement.clientWidth; + this.dots = this.el.querySelector('.hs-carousel-pagination') || null; + this.info = this.el.querySelector('.hs-carousel-info') || null; + this.infoTotal = + this?.info?.querySelector('.hs-carousel-info-total') || null; + this.infoCurrent = + this?.info?.querySelector('.hs-carousel-info-current') || null; + + this.sliderWidth = this.el.getBoundingClientRect().width; + + // Drag events' help variables + this.isDragging = false; + this.dragStartX = null; + this.initialTranslateX = null; // Touch events' help variables this.touchX = { @@ -82,24 +151,54 @@ class HSCarousel extends HSBasePlugin implements ICarousel { end: 0, }; + // Resize events' help variables + this.resizeContainer = document.querySelector('body'); + this.resizeContainerWidth = 0; + this.init(); } + private setIsSnap() { + const containerRect = this.container.getBoundingClientRect(); + const containerCenter = containerRect.left + containerRect.width / 2; + + let closestElement: HTMLElement | null = null; + let closestElementIndex: number | null = null; + let closestDistance = Infinity; + + Array.from(this.inner.children).forEach((child: HTMLElement) => { + const childRect = child.getBoundingClientRect(); + const innerContainerRect = this.inner.getBoundingClientRect(); + const childCenter = + childRect.left + childRect.width / 2 - innerContainerRect.left; + const distance = Math.abs( + containerCenter - (innerContainerRect.left + childCenter), + ); + + if (distance < closestDistance) { + closestDistance = distance; + closestElement = child; + } + }); + + if (closestElement) { + closestElementIndex = Array.from(this.slides).findIndex( + (el) => el === closestElement, + ); + } + + this.setIndex(closestElementIndex); + + if (this.dots) this.setCurrentDot(); + } + private init() { this.createCollection(window.$hsCarouselCollection, this); if (this.inner) { this.calculateWidth(); - if (this.loadingClassesRemove) { - if (typeof this.loadingClassesRemove === 'string') - this.inner.classList.remove(this.loadingClassesRemove); - else this.inner.classList.remove(...this.loadingClassesRemove); - } - if (this.loadingClassesAdd) { - if (typeof this.loadingClassesAdd === 'string') - this.inner.classList.add(this.loadingClassesAdd); - else this.inner.classList.add(...this.loadingClassesAdd); - } + + if (this.isDraggable && !this.isSnap) this.initDragHandling(); } if (this.prev) this.prev.addEventListener('click', () => { @@ -117,74 +216,396 @@ class HSCarousel extends HSBasePlugin implements ICarousel { this.setTimer(); } }); - if (this.dots) { - this.dots.forEach((el, i) => - el.addEventListener('click', () => { - this.goTo(i); - if (this.isAutoPlay) { - this.resetTimer(); - this.setTimer(); - } - }), - ); - } + if (this.dots) this.initDots(); + if (this.info) this.buildInfo(); if (this.slides.length) { this.addCurrentClass(); if (!this.isInfiniteLoop) this.addDisabledClass(); if (this.isAutoPlay) this.autoPlay(); } - if (this.inner && this.afterLoadingClassesAdd) { - setTimeout(() => { - if (typeof this.afterLoadingClassesAdd === 'string') - this.inner.classList.add(this.afterLoadingClassesAdd); - else this.inner.classList.add(...this.afterLoadingClassesAdd); + + setTimeout(() => { + if (this.isSnap) this.setIsSnap(); + + if (this.loadingClassesRemove) { + if (typeof this.loadingClassesRemove === 'string') + this.inner.classList.remove(this.loadingClassesRemove); + else this.inner.classList.remove(...this.loadingClassesRemove); + } + if (this.loadingClassesAdd) { + if (typeof this.loadingClassesAdd === 'string') + this.inner.classList.add(this.loadingClassesAdd); + else this.inner.classList.add(...this.loadingClassesAdd); + } + + if (this.inner && this.afterLoadingClassesAdd) { + setTimeout(() => { + if (typeof this.afterLoadingClassesAdd === 'string') + this.inner.classList.add(this.afterLoadingClassesAdd); + else this.inner.classList.add(...this.afterLoadingClassesAdd); + }); + } + }, 400); + + if (this.isSnap) { + this.container.addEventListener('scroll', () => { + clearTimeout(this.isScrolling); + + this.isScrolling = setTimeout(() => { + this.setIsSnap(); + }, 100); }); } this.el.classList.add('init'); - this.el.addEventListener('touchstart', (evt) => { - this.touchX.start = evt.changedTouches[0].screenX; + if (!this.isSnap) { + this.el.addEventListener('touchstart', (evt) => { + this.touchX.start = evt.changedTouches[0].screenX; + }); + + this.el.addEventListener('touchend', (evt) => { + this.touchX.end = evt.changedTouches[0].screenX; + + this.detectDirection(); + }); + } + + this.observeResize(); + } + + private initDragHandling(): void { + const scrollableElement = this.inner; + + if (scrollableElement) { + scrollableElement.addEventListener( + 'mousedown', + this.handleDragStart.bind(this), + ); + scrollableElement.addEventListener( + 'touchstart', + this.handleDragStart.bind(this), + { passive: true }, + ); + + document.addEventListener('mousemove', this.handleDragMove.bind(this)); + document.addEventListener('touchmove', this.handleDragMove.bind(this), { + passive: false, + }); + + document.addEventListener('mouseup', this.handleDragEnd.bind(this)); + document.addEventListener('touchend', this.handleDragEnd.bind(this)); + } + } + + private getTranslateXValue(): number { + const transformMatrix = window.getComputedStyle(this.inner).transform; + + if (transformMatrix !== 'none') { + const matrixValues = transformMatrix + .match(/matrix.*\((.+)\)/)?.[1] + .split(', '); + + if (matrixValues) { + let translateX = parseFloat( + matrixValues.length === 6 ? matrixValues[4] : matrixValues[12], + ); + if (this.isRTL) translateX = -translateX; + + return isNaN(translateX) || translateX === 0 ? 0 : -translateX; + } + } + return 0; + } + + private removeClickEventWhileDragging(evt: MouseEvent) { + evt.preventDefault(); + } + + private handleDragStart(evt: MouseEvent | TouchEvent): void { + evt.preventDefault(); + + this.isDragging = true; + this.dragStartX = this.getEventX(evt); + this.initialTranslateX = this.isRTL + ? this.getTranslateXValue() + : -this.getTranslateXValue(); + + this.inner.classList.add('dragging'); + } + + private handleDragMove(evt: MouseEvent | TouchEvent): void { + if (!this.isDragging) return; + + this.inner.querySelectorAll('a:not(.prevented-click)').forEach((el) => { + el.classList.add('prevented-click'); + el.addEventListener('click', this.removeClickEventWhileDragging); }); - this.el.addEventListener('touchend', (evt) => { - this.touchX.end = evt.changedTouches[0].screenX; + const currentX = this.getEventX(evt); + let deltaX = currentX - this.dragStartX; + if (this.isRTL) deltaX = -deltaX; + const newTranslateX = this.initialTranslateX + deltaX; + const newTranslateXFunc = () => { + let calcWidth = + (this.sliderWidth * this.slides.length) / this.getCurrentSlidesQty() - + this.sliderWidth; + const containerWidth = this.sliderWidth; + const itemWidth = containerWidth / this.getCurrentSlidesQty(); + const centeredOffset = (containerWidth - itemWidth) / 2; + const limitStart = this.isCentered ? centeredOffset : 0; + if (this.isCentered) calcWidth = calcWidth + centeredOffset; + const limitEnd = -calcWidth; + + if (this.isRTL) { + if (newTranslateX < limitStart) return limitStart; + if (newTranslateX > calcWidth) return limitEnd; + else return -newTranslateX; + } else { + if (newTranslateX > limitStart) return limitStart; + else if (newTranslateX < -calcWidth) return limitEnd; + else return newTranslateX; + } + }; + + this.setTranslate(newTranslateXFunc()); + } + + private handleDragEnd(): void { + if (!this.isDragging) return; + this.isDragging = false; + + const containerWidth = this.sliderWidth; + const itemWidth = containerWidth / this.getCurrentSlidesQty(); + const currentTranslateX = this.getTranslateXValue(); + let closestIndex = Math.round(currentTranslateX / itemWidth); + if (this.isRTL) closestIndex = Math.round(currentTranslateX / itemWidth); - this.detectDirection(); + this.inner.classList.remove('dragging'); + + setTimeout(() => { + this.calculateTransform(closestIndex); + if (this.dots) this.setCurrentDot(); + + this.dragStartX = null; + this.initialTranslateX = null; + + this.inner.querySelectorAll('a.prevented-click').forEach((el) => { + el.classList.remove('prevented-click'); + el.removeEventListener('click', this.removeClickEventWhileDragging); + }); }); + } - this.observeResize(); + private getEventX(event: MouseEvent | TouchEvent): number { + return event instanceof MouseEvent + ? event.clientX + : event.touches[0].clientX; + } + + private getCurrentSlidesQty(): number { + if (typeof this.slidesQty === 'object') { + const windowWidth = document.body.clientWidth; + let currentRes = 0; + + Object.keys(this.slidesQty).forEach((key: string) => { + if ( + windowWidth >= + (typeof key + 1 === 'number' + ? (this.slidesQty as TCarouselOptionsSlidesQty)[key] + : BREAKPOINTS[key]) + ) + currentRes = (this.slidesQty as TCarouselOptionsSlidesQty)[key]; + }); + + return currentRes; + } else { + return this.slidesQty as number; + } + } + + private buildSnapSpacers() { + const existingBefore = this.inner.querySelector('.hs-snap-before'); + const existingAfter = this.inner.querySelector('.hs-snap-after'); + if (existingBefore) existingBefore.remove(); + if (existingAfter) existingAfter.remove(); + + const containerWidth = this.sliderWidth; + const itemWidth = containerWidth / this.getCurrentSlidesQty(); + const spacerWidth = containerWidth / 2 - itemWidth / 2; + + const before = htmlToElement( + `
`, + ); + const after = htmlToElement( + `
`, + ); + + this.inner.prepend(before); + this.inner.appendChild(after); + } + + private initDots() { + if (this.el.querySelectorAll('.hs-carousel-pagination-item').length) + this.setDots(); + else this.buildDots(); + + if (this.dots) this.setCurrentDot(); + } + + private buildDots() { + this.dots.innerHTML = ''; + + const slidesQty = + !this.isCentered && this.slidesQty + ? this.slides.length - (this.getCurrentSlidesQty() - 1) + : this.slides.length; + + for (let i = 0; i < slidesQty; i++) { + const singleDot = this.buildSingleDot(i); + + this.dots.append(singleDot); + } + } + + private setDots() { + this.dotsItems = this.dots.querySelectorAll('.hs-carousel-pagination-item'); + + this.dotsItems.forEach((dot, ind) => { + const targetIndex = dot.getAttribute( + 'data-carousel-pagination-item-target', + ); + + this.singleDotEvents(dot, targetIndex ? +targetIndex : ind); + }); + } + + private goToCurrentDot() { + const container = this.dots; + const containerRect = container.getBoundingClientRect(); + const containerScrollLeft = container.scrollLeft; + const containerScrollTop = container.scrollTop; + const containerWidth = container.clientWidth; + const containerHeight = container.clientHeight; + + const item = this.dotsItems[this.currentIndex]; + const itemRect = item.getBoundingClientRect(); + const itemLeft = itemRect.left - containerRect.left + containerScrollLeft; + const itemRight = itemLeft + item.clientWidth; + const itemTop = itemRect.top - containerRect.top + containerScrollTop; + const itemBottom = itemTop + item.clientHeight; + + let scrollLeft = containerScrollLeft; + let scrollTop = containerScrollTop; + + if ( + itemLeft < containerScrollLeft || + itemRight > containerScrollLeft + containerWidth + ) { + scrollLeft = itemRight - containerWidth; + } + + if ( + itemTop < containerScrollTop || + itemBottom > containerScrollTop + containerHeight + ) { + scrollTop = itemBottom - containerHeight; + } + + container.scrollTo({ + left: scrollLeft, + top: scrollTop, + behavior: 'smooth', + }); + } + + private buildInfo() { + if (this.infoTotal) this.setInfoTotal(); + if (this.infoCurrent) this.setInfoCurrent(); + } + + private setInfoTotal() { + this.infoTotal.innerText = `${this.slides.length}`; + } + + private setInfoCurrent() { + this.infoCurrent.innerText = `${this.currentIndex + 1}`; + } + + private buildSingleDot(ind: number) { + const singleDot = htmlToElement(''); + if (this.dotsItemClasses) classToClassList(this.dotsItemClasses, singleDot); + + this.singleDotEvents(singleDot, ind); + + return singleDot; + } + + private singleDotEvents(dot: HTMLElement, ind: number) { + dot.addEventListener('click', () => { + this.goTo(ind); + + if (this.isAutoPlay) { + this.resetTimer(); + this.setTimer(); + } + }); } private observeResize() { - const resizeObserver = new ResizeObserver(() => this.recalculateWidth()); + const resizeObserver = new ResizeObserver( + debounce((entries: ResizeObserverEntry[]) => { + for (let entry of entries) { + const newWidth = entry.contentRect.width; - resizeObserver.observe(document.querySelector('body')); + if (newWidth !== this.resizeContainerWidth) { + this.recalculateWidth(); + if (this.dots) this.initDots(); + this.addCurrentClass(); + + this.resizeContainerWidth = newWidth; + } + } + }, this.updateDelay), + ); + + resizeObserver.observe(this.resizeContainer); } private calculateWidth() { - // Set slider width - this.inner.style.width = `${this.sliderWidth * this.slides.length}px`; - this.inner.style.transform = this.calculateTransform(); + if (!this.isSnap) + this.inner.style.width = `${(this.sliderWidth * this.slides.length) / this.getCurrentSlidesQty()}px`; - // Set width to each slide this.slides.forEach((el) => { - el.style.width = `${this.sliderWidth}px`; + el.style.width = `${this.sliderWidth / this.getCurrentSlidesQty()}px`; }); + + this.calculateTransform(); } private addCurrentClass() { - this.slides.forEach((el, i) => { - if (i === this.currentIndex) { - el.classList.add('active'); - } else { - el.classList.remove('active'); - } - }); + if (this.isSnap) { + const itemsQty = Math.floor(this.getCurrentSlidesQty() / 2); - if (this.dots) { - this.dots.forEach((el, i) => { - if (i === this.currentIndex) { + for (let i = 0; i < this.slides.length; i++) { + const slide = this.slides[i]; + + if ( + i <= this.currentIndex + itemsQty && + i >= this.currentIndex - itemsQty + ) + slide.classList.add('active'); + else slide.classList.remove('active'); + } + } else { + const maxIndex = this.isCentered + ? this.currentIndex + + this.getCurrentSlidesQty() + + (this.getCurrentSlidesQty() - 1) + : this.currentIndex + this.getCurrentSlidesQty(); + + this.slides.forEach((el, i) => { + if (i >= this.currentIndex && i < maxIndex) { el.classList.add('active'); } else { el.classList.remove('active'); @@ -193,18 +614,89 @@ class HSCarousel extends HSBasePlugin implements ICarousel { } } + private setCurrentDot() { + const toggleDotActive = (el: HTMLElement | Element, i: number) => { + let statement = false; + const itemsQty = Math.floor(this.getCurrentSlidesQty() / 2); + + if (this.isSnap && !this.hasSnapSpacers) { + statement = + i === + (this.getCurrentSlidesQty() % 2 === 0 + ? this.currentIndex - itemsQty + 1 + : this.currentIndex - itemsQty); + } else statement = i === this.currentIndex; + + if (statement) el.classList.add('active'); + else el.classList.remove('active'); + }; + + if (this.dotsItems) + this.dotsItems.forEach((el, i) => toggleDotActive(el, i)); + else + this.dots + .querySelectorAll(':scope > *') + .forEach((el, i) => toggleDotActive(el, i)); + } + + private setElementToDisabled(el: HTMLElement) { + el.classList.add('disabled'); + if (el.tagName === 'BUTTON' || el.tagName === 'INPUT') + el.setAttribute('disabled', 'disabled'); + } + + private unsetElementToDisabled(el: HTMLElement) { + el.classList.remove('disabled'); + if (el.tagName === 'BUTTON' || el.tagName === 'INPUT') + el.removeAttribute('disabled'); + } + private addDisabledClass() { if (!this.prev || !this.next) return false; - if (this.currentIndex === 0) { - this.next.classList.remove('disabled'); - this.prev.classList.add('disabled'); - } else if (this.currentIndex === this.slides.length - 1) { - this.prev.classList.remove('disabled'); - this.next.classList.add('disabled'); + const gapValue = getComputedStyle(this.inner).getPropertyValue('gap'); + const itemsQty = Math.floor(this.getCurrentSlidesQty() / 2); + let currentIndex = 0; + let maxIndex = 0; + let statementPrev = false; + let statementNext = false; + + if (this.isSnap) { + currentIndex = this.currentIndex; + maxIndex = this.hasSnapSpacers + ? this.slides.length - 1 + : this.slides.length - itemsQty - 1; + statementPrev = this.hasSnapSpacers + ? currentIndex === 0 + : this.getCurrentSlidesQty() % 2 === 0 + ? currentIndex - itemsQty < 0 + : currentIndex - itemsQty === 0; + statementNext = + currentIndex >= maxIndex && + this.container.scrollLeft + + this.container.clientWidth + + (parseFloat(gapValue) || 0) >= + this.container.scrollWidth; + } else { + currentIndex = this.currentIndex; + maxIndex = this.isCentered + ? this.slides.length - + this.getCurrentSlidesQty() + + (this.getCurrentSlidesQty() - 1) + : this.slides.length - this.getCurrentSlidesQty(); + statementPrev = currentIndex === 0; + statementNext = currentIndex >= maxIndex; + } + + if (statementPrev) { + this.unsetElementToDisabled(this.next); + this.setElementToDisabled(this.prev); + } else if (statementNext) { + this.unsetElementToDisabled(this.prev); + this.setElementToDisabled(this.next); } else { - this.prev.classList.remove('disabled'); - this.next.classList.remove('disabled'); + this.unsetElementToDisabled(this.prev); + this.unsetElementToDisabled(this.next); } } @@ -232,51 +724,157 @@ class HSCarousel extends HSBasePlugin implements ICarousel { // Public methods public recalculateWidth() { - this.sliderWidth = this.inner.parentElement.clientWidth; + this.sliderWidth = this.inner.parentElement.getBoundingClientRect().width; this.calculateWidth(); + + if ( + this.sliderWidth !== + this.inner.parentElement.getBoundingClientRect().width + ) + this.recalculateWidth(); } - private calculateTransform(): string { - let value = this.currentIndex * this.sliderWidth; - return this.isRTL - ? `translate(${value}px, 0px)` - : `translate(-${value}px, 0px)`; + private calculateTransform(currentIdx?: number | undefined): void { + if (currentIdx !== undefined) this.currentIndex = currentIdx; + if ( + this.currentIndex > this.slides.length - this.getCurrentSlidesQty() && + !this.isCentered + ) + this.currentIndex = this.slides.length - this.getCurrentSlidesQty(); + + const containerWidth = this.sliderWidth; + const itemWidth = containerWidth / this.getCurrentSlidesQty(); + let translateX = this.currentIndex * itemWidth; + + // TODO:: need to test auto scrolling to the end if last on resize + if (this.isSnap && !this.isCentered) { + if ( + this.container.scrollLeft < containerWidth && + this.container.scrollLeft + itemWidth / 2 > containerWidth + ) + this.container.scrollLeft = this.container.scrollWidth; + } + + if (this.isCentered && !this.isSnap) { + const centeredOffset = (containerWidth - itemWidth) / 2; + + if (this.currentIndex === 0) translateX = -centeredOffset; + else if ( + this.currentIndex >= + this.slides.length - + this.getCurrentSlidesQty() + + (this.getCurrentSlidesQty() - 1) + ) { + const totalSlideWidth = this.slides.length * itemWidth; + + translateX = totalSlideWidth - containerWidth + centeredOffset; + } else translateX = this.currentIndex * itemWidth - centeredOffset; + } + + if (!this.isSnap) + this.inner.style.transform = this.isRTL + ? `translate(${translateX}px, 0px)` + : `translate(${-translateX}px, 0px)`; + + if (this.isAutoHeight) + this.inner.style.height = `${this.slides[this.currentIndex].clientHeight}px`; + + if (this.dotsItems) this.goToCurrentDot(); + + this.addCurrentClass(); + if (!this.isInfiniteLoop) this.addDisabledClass(); + if (this.isSnap && this.hasSnapSpacers) this.buildSnapSpacers(); + if (this.infoCurrent) this.setInfoCurrent(); + } + + private setTranslate(val: number) { + this.inner.style.transform = this.isRTL + ? `translate(${-val}px, 0px)` + : `translate(${val}px, 0px)`; } public goToPrev() { - if (this.currentIndex === 0 && this.isInfiniteLoop) { - this.currentIndex = this.slides.length - 1; - this.inner.style.transform = this.calculateTransform(); + if (this.currentIndex > 0) { + this.currentIndex--; + } else { + this.currentIndex = this.slides.length - this.getCurrentSlidesQty(); + } - this.addCurrentClass(); - } else if (this.currentIndex !== 0) { - this.currentIndex -= 1; - this.inner.style.transform = this.calculateTransform(); + if (this.isSnap) { + const itemWidth = this.sliderWidth / this.getCurrentSlidesQty(); + + this.container.scrollBy({ + left: Math.max(-this.container.scrollLeft, -itemWidth), + behavior: 'smooth', + }); this.addCurrentClass(); - this.addDisabledClass(); - } + if (!this.isInfiniteLoop) this.addDisabledClass(); + } else this.calculateTransform(); + + if (this.dots) this.setCurrentDot(); } public goToNext() { - if (this.currentIndex === this.slides.length - 1 && this.isInfiniteLoop) { + const statement = this.isCentered + ? this.slides.length - + this.getCurrentSlidesQty() + + (this.getCurrentSlidesQty() - 1) + : this.slides.length - this.getCurrentSlidesQty(); + + if (this.currentIndex < statement) { + this.currentIndex++; + } else { this.currentIndex = 0; - this.inner.style.transform = this.calculateTransform(); + } - this.addCurrentClass(); - } else if (this.currentIndex < this.slides.length - 1) { - this.currentIndex += 1; - this.inner.style.transform = this.calculateTransform(); + if (this.isSnap) { + const itemWidth = this.sliderWidth / this.getCurrentSlidesQty(); + const maxScrollLeft = + this.container.scrollWidth - this.container.clientWidth; + + this.container.scrollBy({ + left: Math.min(itemWidth, maxScrollLeft - this.container.scrollLeft), + behavior: 'smooth', + }); this.addCurrentClass(); - this.addDisabledClass(); - } + if (!this.isInfiniteLoop) this.addDisabledClass(); + } else this.calculateTransform(); + + if (this.dots) this.setCurrentDot(); } public goTo(i: number) { + const currentIndex = this.currentIndex; + this.currentIndex = i; + + if (this.isSnap) { + const itemWidth = this.sliderWidth / this.getCurrentSlidesQty(); + const index = + currentIndex > this.currentIndex + ? currentIndex - this.currentIndex + : this.currentIndex - currentIndex; + const width = + currentIndex > this.currentIndex + ? -(itemWidth * index) + : itemWidth * index; + + this.container.scrollBy({ + left: width, + behavior: 'smooth', + }); + + this.addCurrentClass(); + if (!this.isInfiniteLoop) this.addDisabledClass(); + } else this.calculateTransform(); + + if (this.dots) this.setCurrentDot(); + } + + private setIndex(i: number) { this.currentIndex = i; - this.inner.style.transform = this.calculateTransform(); this.addCurrentClass(); if (!this.isInfiniteLoop) this.addDisabledClass(); @@ -327,14 +925,6 @@ window.addEventListener('load', () => { // console.log('Carousel collection:', window.$hsCarouselCollection); }); -window.addEventListener('resize', () => { - if (!window.$hsCarouselCollection) return false; - - window.$hsCarouselCollection.forEach((el) => { - el.element.recalculateWidth(); - }); -}); - if (typeof window !== 'undefined') { window.HSCarousel = HSCarousel; } diff --git a/src/plugins/carousel/interfaces.ts b/src/plugins/carousel/interfaces.ts index 3c0719e..534ecff 100644 --- a/src/plugins/carousel/interfaces.ts +++ b/src/plugins/carousel/interfaces.ts @@ -1,20 +1,30 @@ +import { TCarouselOptionsSlidesQty } from './types'; + export interface ICarouselOptions { currentIndex: number; loadingClasses?: string | string[]; + dotsItemClasses?: string; + isAutoHeight?: boolean; isAutoPlay?: boolean; - speed?: number; + isCentered?: boolean; + isDraggable?: boolean; isInfiniteLoop?: boolean; isRTL?: boolean; + isSnap?: boolean; + hasSnapSpacers?: boolean; + slidesQty?: TCarouselOptionsSlidesQty | number; + speed?: number; + updateDelay?: number; } export interface ICarousel { options?: ICarouselOptions; - + recalculateWidth(): void; - + goToPrev(): void; - + goToNext(): void; - + goTo(i: number): void; } diff --git a/src/plugins/carousel/types.ts b/src/plugins/carousel/types.ts index 37ba73a..707324f 100644 --- a/src/plugins/carousel/types.ts +++ b/src/plugins/carousel/types.ts @@ -1 +1,3 @@ -// no types +export type TCarouselOptionsSlidesQty = { + [key: string]: number; +}; diff --git a/src/plugins/collapse/index.ts b/src/plugins/collapse/index.ts index 9304438..1eadb3c 100644 --- a/src/plugins/collapse/index.ts +++ b/src/plugins/collapse/index.ts @@ -1,6 +1,6 @@ /* * HSCollapse - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -8,7 +8,7 @@ import { dispatch, afterTransition } from '../../utils'; -import { ICollapse } from './interfaces'; +import { ICollapse } from '../collapse/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; diff --git a/src/plugins/combobox/index.ts b/src/plugins/combobox/index.ts index 137a983..d44ea07 100644 --- a/src/plugins/combobox/index.ts +++ b/src/plugins/combobox/index.ts @@ -1,6 +1,6 @@ /* * HSComboBox - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -15,7 +15,11 @@ import { isParentOrElementHidden, } from '../../utils'; -import { IComboBox, IComboBoxOptions, IComboBoxItemAttr } from './interfaces'; +import { + IComboBox, + IComboBoxOptions, + IComboBoxItemAttr, +} from '../combobox/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; diff --git a/src/plugins/copy-markup/index.ts b/src/plugins/copy-markup/index.ts index c13a1b0..5aaefd3 100644 --- a/src/plugins/copy-markup/index.ts +++ b/src/plugins/copy-markup/index.ts @@ -1,6 +1,6 @@ /* * HSCopyMarkup - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -8,7 +8,10 @@ import { dispatch } from '../../utils'; -import { ICopyMarkupOptions, ICopyMarkup } from './interfaces'; +import { + ICopyMarkupOptions, + ICopyMarkup, +} from '../copy-markup/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; diff --git a/src/plugins/datatable/index.ts b/src/plugins/datatable/index.ts index 3c4eca5..6e4366a 100644 --- a/src/plugins/datatable/index.ts +++ b/src/plugins/datatable/index.ts @@ -1,6 +1,6 @@ /* * HSDataTable - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -10,7 +10,7 @@ import { Api } from 'datatables.net'; import { debounce, htmlToElement, classToClassList } from '../../utils'; -import { IDataTableOptions, IDataTable } from './interfaces'; +import { IDataTableOptions, IDataTable } from '../datatable/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; diff --git a/src/plugins/dropdown/index.ts b/src/plugins/dropdown/index.ts index e901ad3..1b53cf8 100644 --- a/src/plugins/dropdown/index.ts +++ b/src/plugins/dropdown/index.ts @@ -1,6 +1,6 @@ /* * HSDropdown - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -19,7 +19,7 @@ import { IMenuSearchHistory } from '../../utils/interfaces'; import { createPopper, PositioningStrategy } from '@popperjs/core'; -import { IDropdown, IHTMLElementPopper } from './interfaces'; +import { IDropdown, IHTMLElementPopper } from '../dropdown/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; diff --git a/src/plugins/file-upload/index.ts b/src/plugins/file-upload/index.ts index 0bad2a3..60c7a12 100644 --- a/src/plugins/file-upload/index.ts +++ b/src/plugins/file-upload/index.ts @@ -1,6 +1,6 @@ /* * HSFileUpload - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -10,7 +10,7 @@ import { DropzoneFile } from 'dropzone'; import { htmlToElement, classToClassList } from '../../utils'; -import { IFileUploadOptions, IFileUpload } from './interfaces'; +import { IFileUploadOptions, IFileUpload } from '../file-upload/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; @@ -29,7 +29,7 @@ class HSFileUpload private extensions: any = {}; private singleton: boolean; - private dropzone: Dropzone | null; + public dropzone: Dropzone | null; constructor(el: HTMLElement, options?: IFileUploadOptions, events?: {}) { super(el, options, events); diff --git a/src/plugins/input-number/index.ts b/src/plugins/input-number/index.ts index c98fa32..ad6905d 100644 --- a/src/plugins/input-number/index.ts +++ b/src/plugins/input-number/index.ts @@ -1,6 +1,6 @@ /* * HSInputNumber - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -8,7 +8,10 @@ import { dispatch } from '../../utils'; -import { IInputNumberOptions, IInputNumber } from './interfaces'; +import { + IInputNumberOptions, + IInputNumber, +} from '../input-number/interfaces'; import HSBasePlugin from '../base-plugin'; diff --git a/src/plugins/overlay/index.ts b/src/plugins/overlay/index.ts index 36f7739..21573ef 100644 --- a/src/plugins/overlay/index.ts +++ b/src/plugins/overlay/index.ts @@ -1,6 +1,6 @@ /* * HSOverlay - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -10,11 +10,12 @@ import { stringToBoolean, getClassProperty, isParentOrElementHidden, + isDirectChild, dispatch, afterTransition, } from '../../utils'; -import { IOverlayOptions, IOverlay } from './interfaces'; +import { IOverlayOptions, IOverlay } from '../overlay/interfaces'; import { ICollectionItem } from '../../interfaces'; import { BREAKPOINTS } from '../../constants'; @@ -33,6 +34,7 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private readonly overlayId: string | null; public overlay: HTMLElement | null; + public initContainer: HTMLElement | null; public isCloseWhenClickInside: boolean; public isTabAccessibilityLimited: boolean; public isLayoutAffect: boolean; @@ -40,6 +42,7 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { public hasAbilityToCloseOnBackdropClick: boolean; public openedBreakpoint: number | null; public autoClose: number | null; + public moveOverlayToBody: number | null; constructor(el: HTMLElement, options?: IOverlayOptions, events?: {}) { super(el, options, events); @@ -58,11 +61,13 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { concatOptions?.backdropClasses ?? 'hs-overlay-backdrop transition duration fixed inset-0 bg-gray-900 bg-opacity-50 dark:bg-opacity-80 dark:bg-neutral-900'; this.backdropExtraClasses = concatOptions?.backdropExtraClasses ?? ''; + this.moveOverlayToBody = concatOptions?.moveOverlayToBody || null; this.openNextOverlay = false; this.autoHide = null; this.overlayId = this.el.getAttribute('data-hs-overlay'); this.overlay = document.querySelector(this.overlayId); + this.initContainer = this.overlay?.parentElement || null; if (this.overlay) { this.isCloseWhenClickInside = stringToBoolean( getClassProperty(this.overlay, '--close-when-click-inside', 'false') || @@ -549,6 +554,38 @@ const autoCloseResizeFn = () => { }); }; +const moveOverlayToBodyResizeFn = () => { + if ( + !window.$hsOverlayCollection.length || + !window.$hsOverlayCollection.find((el) => el.element.moveOverlayToBody) + ) + return false; + + const overlays = window.$hsOverlayCollection.filter( + (el) => el.element.moveOverlayToBody, + ); + + overlays.forEach((overlay) => { + const resolution = overlay.element.moveOverlayToBody; + const initPlace = overlay.element.initContainer; + const newPlace = document.querySelector('body'); + const target = overlay.element.overlay; + + if (!initPlace && target) return false; + + if ( + document.body.clientWidth <= resolution && + !isDirectChild(newPlace, target) + ) + newPlace.appendChild(target); + else if ( + document.body.clientWidth > resolution && + !initPlace.contains(target) + ) + initPlace.appendChild(target); + }); +}; + const setOpenedResizeFn = () => { if ( !window.$hsOverlayCollection.length || @@ -601,12 +638,14 @@ const setBackdropZIndexResizeFn = () => { window.addEventListener('load', () => { HSOverlay.autoInit(); + moveOverlayToBodyResizeFn(); // Uncomment for debug // console.log('Overlay collection:', window.$hsOverlayCollection); }); window.addEventListener('resize', () => { autoCloseResizeFn(); + moveOverlayToBodyResizeFn(); setOpenedResizeFn(); setBackdropZIndexResizeFn(); }); diff --git a/src/plugins/overlay/interfaces.ts b/src/plugins/overlay/interfaces.ts index d9c58a8..bd8e6d8 100644 --- a/src/plugins/overlay/interfaces.ts +++ b/src/plugins/overlay/interfaces.ts @@ -4,6 +4,7 @@ export interface IOverlayOptions { isClosePrev?: boolean; backdropClasses?: string | null; backdropExtraClasses?: string | null; + moveOverlayToBody?: number | null; } export interface IOverlay { diff --git a/src/plugins/pin-input/index.ts b/src/plugins/pin-input/index.ts index ff7fcdc..4fd998c 100644 --- a/src/plugins/pin-input/index.ts +++ b/src/plugins/pin-input/index.ts @@ -1,6 +1,6 @@ /* * HSPinInput - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -8,7 +8,7 @@ import { dispatch } from '../../utils'; -import { IPinInputOptions, IPinInput } from './interfaces'; +import { IPinInputOptions, IPinInput } from '../pin-input/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; diff --git a/src/plugins/range-slider/index.ts b/src/plugins/range-slider/index.ts new file mode 100644 index 0000000..d4cc6fe --- /dev/null +++ b/src/plugins/range-slider/index.ts @@ -0,0 +1,215 @@ +/* + * HSRangeSlider + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ + +import type { cssClasses, target } from 'nouislider'; + +import { + IRangeSliderCssClassesObject, + IRangeSlider, + IRangeSliderOptions, +} from './interfaces'; + +import HSBasePlugin from '../base-plugin'; +import { ICollectionItem } from '../../interfaces'; + +class HSRangeSlider + extends HSBasePlugin + implements IRangeSlider +{ + private readonly concatOptions: IRangeSliderOptions; + private format: any | null; + + constructor(el: HTMLElement, options?: IRangeSliderOptions, events?: {}) { + super(el, options, events); + + const data = el.getAttribute('data-hs-range-slider'); + const dataOptions: IRangeSliderOptions = data ? JSON.parse(data) : {}; + + this.concatOptions = { + ...dataOptions, + ...options, + cssClasses: { + ...noUiSlider.cssClasses, + ...this.processClasses(dataOptions.cssClasses), + }, + }; + + this.init(); + } + + get formattedValue() { + const values: number | string | (string | number)[] = ( + this.el as target + ).noUiSlider.get(); + + if (Array.isArray(values) && this.format) { + const updateValues: (string | number)[] = []; + + values.forEach((val) => { + updateValues.push(this.format.to(val)); + }); + + return updateValues; + } else if (this.format) { + return this.format.to(values); + } else { + return values; + } + } + + private processClasses(cl: typeof cssClasses) { + const mergedClasses: IRangeSliderCssClassesObject = {}; + + Object.keys(cl).forEach((key: keyof typeof noUiSlider.cssClasses) => { + if (key) mergedClasses[key] = `${noUiSlider.cssClasses[key]} ${cl[key]}`; + }); + + return mergedClasses as typeof cssClasses; + } + + private init() { + this.createCollection(window.$hsRangeSliderCollection, this); + + if ( + typeof this.concatOptions?.formatter === 'object' + ? this.concatOptions?.formatter?.type === + 'thousandsSeparatorAndDecimalPoints' + : this.concatOptions?.formatter === 'thousandsSeparatorAndDecimalPoints' + ) + this.thousandsSeparatorAndDecimalPointsFormatter(); + else if ( + typeof this.concatOptions?.formatter === 'object' + ? this.concatOptions?.formatter?.type === 'integer' + : this.concatOptions?.formatter === 'integer' + ) + this.integerFormatter(); + else if ( + typeof this.concatOptions?.formatter === 'object' && + (this.concatOptions?.formatter?.prefix || + this.concatOptions?.formatter?.postfix) + ) + this.prefixOrPostfixFormatter(); + + noUiSlider.create(this.el, this.concatOptions); + + if (this.concatOptions.disabled) this.setDisabled(); + } + + private formatValue(val: number | string) { + let result = ''; + + if (typeof this.concatOptions?.formatter === 'object') { + if (this.concatOptions?.formatter?.prefix) + result += this.concatOptions?.formatter?.prefix; + result += val; + if (this.concatOptions?.formatter?.postfix) + result += this.concatOptions?.formatter?.postfix; + } else result += val; + + return result; + } + + private integerFormatter() { + this.format = { + to: (val: number) => this.formatValue(Math.round(val)), + from: (val: string) => Math.round(+val), + }; + + if (this.concatOptions?.tooltips) this.concatOptions.tooltips = this.format; + } + + private prefixOrPostfixFormatter() { + this.format = { + to: (val: number) => this.formatValue(val), + from: (val: string) => +val, + }; + + if (this.concatOptions?.tooltips) this.concatOptions.tooltips = this.format; + } + + private thousandsSeparatorAndDecimalPointsFormatter() { + this.format = { + to: (val: number) => + this.formatValue( + new Intl.NumberFormat('en-US', { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + }).format(val), + ), + from: (val: string) => parseFloat(val.replace(/,/g, '')), + }; + + if (this.concatOptions?.tooltips) this.concatOptions.tooltips = this.format; + } + + private setDisabled() { + this.el.setAttribute('disabled', 'disabled'); + this.el.classList.add('disabled'); + } + + // Static methods + static getInstance(target: HTMLElement | string, isInstance = false) { + const elInCollection = window.$hsRangeSliderCollection.find( + (el) => + el.element.el === + (typeof target === 'string' ? document.querySelector(target) : target), + ); + + return elInCollection + ? isInstance + ? elInCollection + : elInCollection.element.el + : null; + } + + static autoInit() { + if (!window.$hsRangeSliderCollection) window.$hsRangeSliderCollection = []; + + document + .querySelectorAll('[data-hs-range-slider]:not(.--prevent-on-load-init)') + .forEach((el: HTMLElement) => { + if ( + !window.$hsRangeSliderCollection.find( + (elC) => (elC?.element?.el as HTMLElement) === el, + ) + ) + new HSRangeSlider(el); + }); + } + + // Backward compatibility + static on(evt: string, target: HTMLElement, cb: Function) { + const elInCollection = window.$hsRangeSliderCollection.find( + (el) => + el.element.el === + (typeof target === 'string' ? document.querySelector(target) : target), + ); + + if (elInCollection) elInCollection.element.events[evt] = cb; + } +} + +declare global { + interface Window { + HSRangeSlider: Function; + $hsRangeSliderCollection: ICollectionItem[]; + } +} + +window.addEventListener('load', () => { + HSRangeSlider.autoInit(); + + // Uncomment for debug + // console.log('Range slider collection:', window.$hsRangeSliderCollection); +}); + +if (typeof window !== 'undefined') { + window.HSRangeSlider = HSRangeSlider; +} + +export default HSRangeSlider; diff --git a/src/plugins/range-slider/interfaces.ts b/src/plugins/range-slider/interfaces.ts new file mode 100644 index 0000000..171e780 --- /dev/null +++ b/src/plugins/range-slider/interfaces.ts @@ -0,0 +1,24 @@ +import type { Options } from 'nouislider'; + +import { TRangeSliderOptionsFormatterType } from './types'; + +export interface IRangeSliderCssClassesObject { + [key: string]: any; +} + +export interface IRangeSliderOptionsFormatterOptions { + type?: TRangeSliderOptionsFormatterType; + prefix?: string; + postfix?: string; +} + +export interface IRangeSliderOptions extends Options { + disabled?: boolean; + formatter?: + | IRangeSliderOptionsFormatterOptions + | TRangeSliderOptionsFormatterType; +} + +export interface IRangeSlider { + options?: IRangeSliderOptions; +} diff --git a/src/plugins/range-slider/types.ts b/src/plugins/range-slider/types.ts new file mode 100644 index 0000000..59c3d42 --- /dev/null +++ b/src/plugins/range-slider/types.ts @@ -0,0 +1,4 @@ +export type TRangeSliderOptionsFormatterType = + | 'integer' + | 'thousandsSeparatorAndDecimalPoints' + | null; diff --git a/src/plugins/remove-element/index.ts b/src/plugins/remove-element/index.ts index 2bb73c1..ca90108 100644 --- a/src/plugins/remove-element/index.ts +++ b/src/plugins/remove-element/index.ts @@ -1,6 +1,6 @@ /* * HSRemoveElement - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -8,7 +8,10 @@ import { afterTransition } from '../../utils'; -import { IRemoveElementOptions, IRemoveElement } from './interfaces'; +import { + IRemoveElementOptions, + IRemoveElement, +} from '../remove-element/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; @@ -50,9 +53,9 @@ class HSRemoveElement this.removeTarget.classList.add(this.removeTargetAnimationClass); - afterTransition(this.removeTarget, () => { - this.removeTarget.remove(); - }); + afterTransition(this.removeTarget, () => + setTimeout(() => this.removeTarget.remove()), + ); } // Static method diff --git a/src/plugins/scrollspy/index.ts b/src/plugins/scrollspy/index.ts index 3acd100..bfcb9f3 100644 --- a/src/plugins/scrollspy/index.ts +++ b/src/plugins/scrollspy/index.ts @@ -1,6 +1,6 @@ /* * HSScrollspy - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -8,7 +8,7 @@ import { getClassProperty, dispatch } from '../../utils'; -import { IScrollspy } from './interfaces'; +import { IScrollspy } from '../scrollspy/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; diff --git a/src/plugins/search-by-json/index.ts b/src/plugins/search-by-json/index.ts deleted file mode 100644 index 3d62de1..0000000 --- a/src/plugins/search-by-json/index.ts +++ /dev/null @@ -1,217 +0,0 @@ -/* - * HSTogglePassword - * @version: 2.4.1 - * @author: Preline Labs Ltd. - * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) - * Copyright 2024 Preline Labs Ltd. - */ - -import { debounce, htmlToElement, classToClassList } from '../../utils'; - -import { - ISearchByJsonOptions, - ISearchItem, - ISearchByJson, - ISearchItemTemplate, -} from './interfaces'; - -import HSBasePlugin from '../base-plugin'; -import { ICollectionItem } from '../../interfaces'; - -class HSSearchByJson - extends HSBasePlugin - implements ISearchByJson -{ - private readonly jsonUrl: string; - private readonly minChars: number; - - private json: ISearchItem[]; - private result: ISearchItem[]; - private val: string; - - private readonly dropdownTemplate: string; - private readonly dropdownClasses: string; - private readonly dropdownItemTemplate: string; - private readonly dropdownItemTemplatesByType: ISearchItemTemplate[]; - private readonly dropdownItemClasses: string; - private readonly highlightedTextTagName: string; - private readonly highlightedTextClasses: string; - - private dropdown: HTMLElement | null; - - constructor(el: HTMLInputElement, options?: ISearchByJsonOptions) { - super(el, options); - - const data = el.getAttribute('data-hs-search-by-json'); - const dataOptions: ISearchByJsonOptions = data ? JSON.parse(data) : {}; - const concatOptions = { - ...dataOptions, - ...options, - }; - - this.jsonUrl = concatOptions.jsonUrl; - this.minChars = concatOptions.minChars || 3; - this.dropdownTemplate = concatOptions.dropdownTemplate || '
'; - this.dropdownClasses = - concatOptions.dropdownClasses || - 'absolute top-full z-[1] w-full bg-white border border-gray-200 rounded-md hidden mt-2'; - this.dropdownItemTemplate = - concatOptions.dropdownItemTemplate || '
'; - this.dropdownItemTemplatesByType = - concatOptions.dropdownItemTemplatesByType || null; - this.dropdownItemClasses = - concatOptions.dropdownItemClasses || - 'py-2 px-4 w-full cursor-pointer text-sm hover:bg-gray-300 hover:text-black'; - this.highlightedTextTagName = concatOptions.highlightedTextTagName || 'u'; - this.highlightedTextClasses = - concatOptions.highlightedTextClasses || 'bg-green-200'; - - if (this.jsonUrl) this.fetchData().then(() => this.init()); - } - - private init() { - this.createCollection(window.$hsSearchByJsonCollection, this); - - this.buildDropdown(); - - this.el.addEventListener( - 'input', - debounce((evt: InputEvent) => { - this.val = (evt.target as HTMLInputElement).value; - - if (this.val.length > this.minChars) { - this.searchData(this.val); - } else { - this.result = []; - } - - if (this.result.length) { - this.dropdown.classList.remove('hidden'); - } else { - this.dropdown.classList.add('hidden'); - } - - this.buildItems(); - }), - ); - } - - private async fetchData() { - await fetch(this.jsonUrl) - .then((data) => data.json()) - .then((data) => (this.json = data)); - } - - private searchData(val: string) { - this.result = this.json.filter((el) => { - const value = val.toLowerCase(); - const title = el.title.toLowerCase(); - const description = el.description.toLowerCase(); - - return title.includes(value) || description.includes(value); - }); - } - - private buildDropdown() { - this.dropdown = htmlToElement(this.dropdownTemplate); - if (this.dropdownClasses) - classToClassList(this.dropdownClasses, this.dropdown); - - this.el.after(this.dropdown); - } - - private buildItems() { - this.dropdown.innerHTML = ''; - - this.result.forEach((el) => { - const link = htmlToElement( - ``, - ); - link.append(this.itemTemplate(el)); - this.dropdown.append(link); - }); - } - - private itemTemplate(el: ISearchItem) { - const re = new RegExp(this.val, 'gi'); - const newTitle = el.title.replace( - re, - `<${this.highlightedTextTagName} class="inline-block ${this.highlightedTextClasses}">${this.val}`, - ); - const newDescription = el.description.replace( - re, - `<${this.highlightedTextTagName} class="inline-block ${this.highlightedTextClasses}">${this.val}`, - ); - const templateByType = this.dropdownItemTemplatesByType - ? this.dropdownItemTemplatesByType.find( - (template) => template.type === el.type, - ) - : null; - const template = templateByType - ? htmlToElement(templateByType.markup) - : htmlToElement(this.dropdownItemTemplate); - if (this.dropdownItemClasses) - classToClassList(this.dropdownItemClasses, template); - const title: HTMLElement = template.querySelector('[data-title]'); - if (title) title.append(htmlToElement(`${newTitle}`)); - else template.append(htmlToElement(`${newTitle}`)); - const description: HTMLElement = - template.querySelector('[data-description]'); - if (description) - description.append(htmlToElement(`${newDescription}`)); - else if (!templateByType) { - const br = htmlToElement('
'); - template.append(br); - template.append(htmlToElement(`${newDescription}`)); - } - - return template; - } - - // Static method - static getInstance(target: HTMLElement | string) { - const elInCollection = window.$hsSearchByJsonCollection.find( - (el) => - el.element.el === - (typeof target === 'string' ? document.querySelector(target) : target), - ); - - return elInCollection ? elInCollection.element : null; - } - - static autoInit() { - if (!window.$hsSearchByJsonCollection) - window.$hsSearchByJsonCollection = []; - - document - .querySelectorAll('[data-hs-search-by-json]:not(.--prevent-on-load-init)') - .forEach((el: HTMLInputElement) => { - if ( - !window.$hsSearchByJsonCollection.find( - (elC) => (elC?.element?.el as HTMLElement) === el, - ) - ) - new HSSearchByJson(el); - }); - } -} - -declare global { - interface Window { - HSSearchByJson: Function; - $hsSearchByJsonCollection: ICollectionItem[]; - } -} - -window.addEventListener('load', () => { - HSSearchByJson.autoInit(); - - // Uncomment for debug - // console.log('Search by JSON collection:', window.$hsSearchByJsonCollection); -}); - -if (typeof window !== 'undefined') { - window.HSSearchByJson = HSSearchByJson; -} - -export default HSSearchByJson; diff --git a/src/plugins/search-by-json/interfaces.ts b/src/plugins/search-by-json/interfaces.ts deleted file mode 100644 index 91922e6..0000000 --- a/src/plugins/search-by-json/interfaces.ts +++ /dev/null @@ -1,28 +0,0 @@ -export interface ISearchItemTemplate { - type: string; - markup: string; -} - -export interface ISearchItem { - title: string; - url: string; - description: string; - categories?: string; - type?: string; -} - -export interface ISearchByJsonOptions { - jsonUrl: string; - minChars?: number; - dropdownTemplate?: string; - dropdownClasses?: string; - dropdownItemTemplate?: string; - dropdownItemTemplatesByType?: ISearchItemTemplate[]; - dropdownItemClasses?: string; - highlightedTextTagName?: string; - highlightedTextClasses?: string; -} - -export interface ISearchByJson { - options?: ISearchByJsonOptions; -} diff --git a/src/plugins/select/index.ts b/src/plugins/select/index.ts index 51b6a21..2a3d330 100644 --- a/src/plugins/select/index.ts +++ b/src/plugins/select/index.ts @@ -1,6 +1,6 @@ /* * HSSelect - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -20,12 +20,13 @@ import { ISelectOptions, ISingleOption, ISingleOptionOptions, -} from './interfaces'; + IApiFieldMap, +} from '../select/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; -import { SELECT_ACCESSIBILITY_KEY_SET } from '../../constants'; +import { SELECT_ACCESSIBILITY_KEY_SET, POSITIONS } from '../../constants'; class HSSelect extends HSBasePlugin implements ISelect { value: string | string[] | null; @@ -40,6 +41,14 @@ class HSSelect extends HSBasePlugin implements ISelect { isDisabled: boolean | null; selectedItems: string[]; + private readonly apiUrl: string | null; + private readonly apiQuery: string | null; + private readonly apiOptions: RequestInit | null; + private readonly apiDataPart: string | null; + private readonly apiSearchQueryKey: string | null; + private readonly apiFieldsMap: IApiFieldMap | null; + private readonly apiIconTag: string | null; + private readonly toggleTag: string | null; private readonly toggleClasses: string | null; private readonly toggleSeparators: { @@ -52,6 +61,7 @@ class HSSelect extends HSBasePlugin implements ISelect { private readonly wrapperClasses: string | null; private readonly tagsItemTemplate: string | null; private readonly tagsItemClasses: string | null; + private readonly tagsInputId: string | null; private readonly tagsInputClasses: string | null; private readonly dropdownTag: string | null; private readonly dropdownClasses: string | null; @@ -60,10 +70,17 @@ class HSSelect extends HSBasePlugin implements ISelect { bottom?: string; } | null; public dropdownSpace: number | null; + public readonly dropdownPlacement: string | null; + public readonly dropdownScope: 'window' | 'parent'; + private readonly searchTemplate: string | null; private readonly searchWrapperTemplate: string | null; private readonly searchPlaceholder: string | null; + private readonly searchId: string | null; + private readonly searchLimit: number | typeof Infinity; + private readonly isSearchDirectMatch: boolean; private readonly searchClasses: string | null; private readonly searchWrapperClasses: string | null; + private readonly searchNoResultTemplate: string | null; private readonly searchNoResultText: string | null; private readonly searchNoResultClasses: string | null; private readonly optionTag: string | null; @@ -79,16 +96,21 @@ class HSSelect extends HSBasePlugin implements ISelect { private toggleTextWrapper: HTMLElement | null; private tagsInput: HTMLElement | null; private dropdown: HTMLElement | null; + private popperInstance: any; private searchWrapper: HTMLElement | null; private search: HTMLInputElement | null; private searchNoResult: HTMLElement | null; private selectOptions: ISingleOption[] | []; - private extraMarkup: string | string[] | null; + private extraMarkup: string | string[] | Element | null; private readonly isAddTagOnEnter: boolean; private tagsInputHelper: HTMLElement | null; + private remoteOptions: unknown[]; + + private optionId = 0; + constructor(el: HTMLElement, options?: ISelectOptions) { super(el, options); @@ -117,6 +139,15 @@ class HSSelect extends HSBasePlugin implements ISelect { this.isMultiple = this.el.hasAttribute('multiple') || false; this.isDisabled = this.el.hasAttribute('disabled') || false; this.selectedItems = []; + + this.apiUrl = concatOptions?.apiUrl || null; + this.apiQuery = concatOptions?.apiQuery || null; + this.apiOptions = concatOptions?.apiOptions || null; + this.apiSearchQueryKey = concatOptions?.apiSearchQueryKey || null; + this.apiDataPart = concatOptions?.apiDataPart || null; + this.apiFieldsMap = concatOptions?.apiFieldsMap || null; + this.apiIconTag = concatOptions?.apiIconTag || null; + this.wrapperClasses = concatOptions?.wrapperClasses || null; this.toggleTag = concatOptions?.toggleTag || null; this.toggleClasses = concatOptions?.toggleClasses || null; @@ -131,19 +162,31 @@ class HSSelect extends HSBasePlugin implements ISelect { concatOptions?.toggleCountTextMode || 'countAfterLimit'; this.tagsItemTemplate = concatOptions?.tagsItemTemplate || null; this.tagsItemClasses = concatOptions?.tagsItemClasses || null; + this.tagsInputId = concatOptions?.tagsInputId || null; this.tagsInputClasses = concatOptions?.tagsInputClasses || null; this.dropdownTag = concatOptions?.dropdownTag || null; this.dropdownClasses = concatOptions?.dropdownClasses || null; this.dropdownDirectionClasses = concatOptions?.dropdownDirectionClasses || null; this.dropdownSpace = concatOptions?.dropdownSpace || 10; + this.dropdownPlacement = concatOptions?.dropdownPlacement || null; + this.dropdownScope = concatOptions?.dropdownScope || 'parent'; + this.searchTemplate = concatOptions?.searchTemplate || null; this.searchWrapperTemplate = concatOptions?.searchWrapperTemplate || null; this.searchWrapperClasses = concatOptions?.searchWrapperClasses || 'bg-white p-2 sticky top-0'; + this.searchId = concatOptions?.searchId || null; + this.searchLimit = concatOptions?.searchLimit || Infinity; + this.isSearchDirectMatch = + typeof concatOptions?.isSearchDirectMatch !== 'undefined' + ? concatOptions?.isSearchDirectMatch + : true; this.searchClasses = concatOptions?.searchClasses || 'block w-[calc(100%-2rem)] text-sm border-gray-200 rounded-md focus:border-blue-500 focus:ring-blue-500 dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 py-2 px-3 my-2 mx-4'; this.searchPlaceholder = concatOptions?.searchPlaceholder || 'Search...'; + this.searchNoResultTemplate = + concatOptions?.searchNoResultTemplate || ''; this.searchNoResultText = concatOptions?.searchNoResultText || 'No results found'; this.searchNoResultClasses = @@ -159,6 +202,7 @@ class HSSelect extends HSBasePlugin implements ISelect { this.animationInProcess = false; this.selectOptions = []; + this.remoteOptions = []; this.tagsInputHelper = null; @@ -260,13 +304,32 @@ class HSSelect extends HSBasePlugin implements ISelect { } private buildExtraMarkup() { - const appendMarkup = (markup: string) => { - this.wrapper.append(htmlToElement(markup)); + const appendMarkup = (markup: string): HTMLElement => { + const el = htmlToElement(markup); + + this.wrapper.append(el); + + return el; + }; + const clickHandle = (el: HTMLElement) => { + if (!el.classList.contains('--prevent-click')) + el.addEventListener('click', (evt: Event) => { + evt.stopPropagation(); + this.toggleFn(); + }); }; - if (Array.isArray(this.extraMarkup)) - this.extraMarkup.forEach((el) => appendMarkup(el)); - else appendMarkup(this.extraMarkup); + if (Array.isArray(this.extraMarkup)) { + this.extraMarkup.forEach((el) => { + const newEl = appendMarkup(el); + + clickHandle(newEl); + }); + } else { + const newEl = appendMarkup(this.extraMarkup as string); + + clickHandle(newEl); + } } private buildToggle() { @@ -300,22 +363,28 @@ class HSSelect extends HSBasePlugin implements ISelect { this.toggle.addEventListener('click', () => { if (this.isDisabled) return false; - if (this.isOpened) this.close(); - else this.open(); + this.toggleFn(); }); } private setToggleIcon() { + const item = this.getItemByValue(this.value as string) as ISingleOption & + IApiFieldMap; const icon = this.toggle.querySelector('[data-icon]'); icon.innerHTML = ''; if (icon) { const img = htmlToElement( - this.getItemByValue(this.value as string)?.options?.icon || '', - ); + this.apiUrl && this.apiIconTag + ? this.apiIconTag || '' + : item?.options?.icon || '', + ) as HTMLImageElement; + if (this.value && this.apiUrl && this.apiIconTag && item[this.apiFieldsMap.icon]) + img.src = (item[this.apiFieldsMap.icon] as string) || ''; + icon.append(img); - if (!img) icon.classList.add('hidden'); + if (!img || !img?.src) icon.classList.add('hidden'); else icon.classList.remove('hidden'); } } @@ -347,7 +416,7 @@ class HSSelect extends HSBasePlugin implements ISelect { } private buildTagsItem(val: string) { - const item = this.getItemByValue(val); + const item = this.getItemByValue(val) as ISingleOption & IApiFieldMap; let template, title, remove, icon: null | HTMLElement; @@ -362,8 +431,16 @@ class HSSelect extends HSBasePlugin implements ISelect { } // Icon - if (item?.options?.icon) { - const img = htmlToElement(item?.options?.icon); + if (item?.options?.icon || this.apiIconTag) { + const img = htmlToElement( + this.apiUrl && this.apiIconTag + ? this.apiIconTag + : item?.options?.icon, + ) as HTMLImageElement; + + if (this.apiUrl && this.apiIconTag && item[this.apiFieldsMap.icon]) + img.src = (item[this.apiFieldsMap.icon] as string) || ''; + icon = template ? template.querySelector('[data-icon]') : document.createElement('span'); @@ -372,10 +449,14 @@ class HSSelect extends HSBasePlugin implements ISelect { if (!template) newItem.append(icon); } + if ( template && template.querySelector('[data-icon]') && - !item?.options?.icon + !item?.options?.icon && + !this.apiUrl && + !this.apiIconTag && + !item[this.apiFieldsMap?.icon] ) { template.querySelector('[data-icon]').classList.add('hidden'); } @@ -415,7 +496,13 @@ class HSSelect extends HSBasePlugin implements ISelect { } private getItemByValue(val: string) { - return this.selectOptions.find((el: ISingleOption) => el.val === val); + const value = this.apiUrl + ? (this.remoteOptions as (ISingleOption & IApiFieldMap)[]).find( + (el) => el[this.apiFieldsMap.title] === val, + ) + : this.selectOptions.find((el: ISingleOption) => el.val === val); + + return value; } private setTagsItems() { @@ -433,10 +520,13 @@ class HSSelect extends HSBasePlugin implements ISelect { private buildTagsInput() { this.tagsInput = document.createElement('input'); + if (this.tagsInputId) this.tagsInput.id = this.tagsInputId; if (this.tagsInputClasses) classToClassList(this.tagsInputClasses, this.tagsInput); - this.tagsInput.addEventListener('focus', () => this.open()); + this.tagsInput.addEventListener('focus', () => { + if (!this.isOpened) this.open(); + }); this.tagsInput.addEventListener('input', () => this.calculateInputWidth()); this.tagsInput.addEventListener( 'input', @@ -476,7 +566,8 @@ class HSSelect extends HSBasePlugin implements ISelect { this.dropdown = htmlToElement(this.dropdownTag || '
'); this.dropdown.setAttribute('data-hs-select-dropdown', ''); - this.dropdown.classList.add('absolute', 'top-full'); + if (this.dropdownScope === 'parent') + this.dropdown.classList.add('absolute', 'top-full'); this.dropdown.role = 'listbox'; this.dropdown.tabIndex = -1; this.dropdown.ariaOrientation = 'vertical'; @@ -498,6 +589,39 @@ class HSSelect extends HSBasePlugin implements ISelect { `${i}`, ), ); + + if (this.apiUrl) this.optionsFromRemoteData(); + + if (this.dropdownScope === 'window') this.buildPopper(); + } + + private buildPopper() { + if (typeof Popper !== 'undefined' && Popper.createPopper) { + document.body.appendChild(this.dropdown); + + this.popperInstance = Popper.createPopper( + this.mode === 'tags' ? this.wrapper : this.toggle, + this.dropdown, + { + placement: POSITIONS[this.dropdownPlacement] || 'bottom', + strategy: 'fixed', + modifiers: [ + { + name: 'offset', + options: { + offset: [0, 5], + }, + }, + ], + }, + ); + } + } + + private updateDropdownWidth() { + const toggle = this.mode === 'tags' ? this.wrapper : this.toggle; + + this.dropdown.style.width = `${toggle.clientWidth}px`; } private buildSearch() { @@ -509,19 +633,28 @@ class HSSelect extends HSBasePlugin implements ISelect { classToClassList(this.searchWrapperClasses, this.searchWrapper); input = this.searchWrapper.querySelector('[data-input]'); - this.search = htmlToElement('') as HTMLInputElement; + const search = htmlToElement( + this.searchTemplate || '', + ); + this.search = ( + search.tagName === 'INPUT' ? search : search.querySelector(':scope input') + ) as HTMLInputElement; + this.search.placeholder = this.searchPlaceholder; if (this.searchClasses) classToClassList(this.searchClasses, this.search); + if (this.searchId) this.search.id = this.searchId; this.search.addEventListener( 'input', - debounce((evt: InputEvent) => - this.searchOptions((evt.target as HTMLInputElement).value), - ), + debounce((evt: InputEvent) => { + if (this.apiUrl) + this.remoteSearch((evt.target as HTMLInputElement).value); + else this.searchOptions((evt.target as HTMLInputElement).value); + }), ); - if (input) input.append(this.search); - else this.searchWrapper.append(this.search); + if (input) input.append(search); + else this.searchWrapper.append(search); this.dropdown.append(this.searchWrapper); } @@ -533,6 +666,7 @@ class HSSelect extends HSBasePlugin implements ISelect { selected: boolean = false, options?: ISingleOptionOptions, index: string = '1', + id?: string, ) { let template: HTMLElement | null = null; let titleWrapper: HTMLElement | null = null; @@ -544,10 +678,11 @@ class HSSelect extends HSBasePlugin implements ISelect { option.setAttribute('data-title-value', title); option.setAttribute('tabIndex', index); option.classList.add('cursor-pointer'); + option.setAttribute('data-id', id || `${this.optionId}`); + if (!id) this.optionId++; if (disabled) option.classList.add('disabled'); if (selected) { - // @ts-ignore - if (this.isMultiple) this.value = [...this.value, val]; + if (this.isMultiple) this.value = [...(this.value as []), val]; else this.value = val; } if (this.optionTemplate) { @@ -563,9 +698,14 @@ class HSSelect extends HSBasePlugin implements ISelect { } if (options) { if (options.icon) { - const img = htmlToElement(options.icon); + const img = htmlToElement(this.apiIconTag ?? options.icon); img.classList.add('max-w-full'); + if (this.apiUrl) { + img.setAttribute('alt', title); + img.setAttribute('src', options.icon); + } + if (template) { iconWrapper = template.querySelector('[data-icon]'); iconWrapper.append(img); @@ -580,7 +720,8 @@ class HSSelect extends HSBasePlugin implements ISelect { if (options.description) { if (template) { descriptionWrapper = template.querySelector('[data-description]'); - descriptionWrapper.append(options.description); + if (descriptionWrapper) + descriptionWrapper.append(options.description); } else { const description = htmlToElement('
'); description.textContent = options.description; @@ -614,6 +755,152 @@ class HSSelect extends HSBasePlugin implements ISelect { if (selected) this.setNewValue(); } + private buildOptionFromRemoteData( + title: string, + val: string, + disabled: boolean = false, + selected: boolean = false, + index: string = '1', + id: string | null, + options?: ISingleOptionOptions, + ) { + if (index) { + this.buildOption(title, val, disabled, selected, options, index, id); + } else { + alert( + 'ID parameter is required for generating remote options! Please check your API endpoint have it.', + ); + } + } + + private buildOptionsFromRemoteData(data: []) { + data.forEach((el: IApiFieldMap, i) => { + let id = null; + let title = ''; + const options: IApiFieldMap & { rest: { [key: string]: unknown } } = { + id: '', + title: '', + icon: null, + description: null, + rest: {}, + }; + + Object.keys(el).forEach((key: string) => { + if (el[this.apiFieldsMap.id]) id = el[this.apiFieldsMap.id]; + if (el[this.apiFieldsMap.title]) + title = el[this.apiFieldsMap.title] as string; + if (el[this.apiFieldsMap.icon]) + options.icon = el[this.apiFieldsMap.icon] as string; + if (el[this.apiFieldsMap?.description]) + options.description = el[this.apiFieldsMap.description] as string; + options.rest[key] = el[key]; + }); + + this.buildOriginalOption( + title, + title, + id, + false, + false, + options as ISingleOptionOptions & IApiFieldMap, + ); + + this.buildOptionFromRemoteData( + title, + title, + false, + false, + `${i}`, + id, + options as ISingleOptionOptions & IApiFieldMap, + ); + }); + + this.sortElements(this.el, 'option'); + this.sortElements(this.dropdown, '[data-value]'); + } + + private async optionsFromRemoteData(val = '') { + const res = await this.apiRequest(val); + this.remoteOptions = res; + + if (res.length) this.buildOptionsFromRemoteData(this.remoteOptions as []); + else console.log('There is no data were responded!'); + } + + private async apiRequest(val = '') { + try { + let url = this.apiUrl; + const search = this.apiSearchQueryKey + ? `${this.apiSearchQueryKey}=${val.toLowerCase()}` + : null; + const query = `${this.apiQuery}`; + const options = this.apiOptions || {}; + + if (search) url += `?${search}`; + if (this.apiQuery) url += `${search ? '&' : '?'}${query}`; + + const req = await fetch(url, options); + const res = await req.json(); + + return this.apiDataPart ? res[this.apiDataPart] : res; + } catch (err) { + console.error(err); + } + } + + private sortElements(container: HTMLElement, selector: string): void { + const items = Array.from(container.querySelectorAll(selector)); + + items.sort((a, b) => { + const isASelected = + a.classList.contains('selected') || a.hasAttribute('selected'); + const isBSelected = + b.classList.contains('selected') || b.hasAttribute('selected'); + + if (isASelected && !isBSelected) return -1; + if (!isASelected && isBSelected) return 1; + + return 0; + }); + + items.forEach((item) => container.appendChild(item)); + } + + private async remoteSearch(val: string) { + const res = await this.apiRequest(val); + this.remoteOptions = res; + let newIds = res.map((item: { id: string }) => `${item.id}`); + let restOptions = null; + const pseudoOptions = this.dropdown.querySelectorAll('[data-value]'); + const options = this.el.querySelectorAll('[data-hs-select-option]'); + + options.forEach((el: HTMLOptionElement) => { + const dataId = el.getAttribute('data-id'); + + if (!newIds.includes(dataId) && !this.value?.includes(el.value)) + this.destroyOriginalOption(el.value); + }); + + pseudoOptions.forEach((el: HTMLElement) => { + const dataId = el.getAttribute('data-id'); + + if ( + !newIds.includes(dataId) && + !this.value?.includes(el.getAttribute('data-value')) + ) + this.destroyOption(el.getAttribute('data-value')); + else newIds = newIds.filter((item: string) => item !== dataId); + }); + + restOptions = res.filter((item: { id: string }) => + newIds.includes(`${item.id}`), + ); + + if (restOptions.length) this.buildOptionsFromRemoteData(restOptions as []); + else console.log('There is no data were responded!'); + } + private destroyOption(val: string) { const option = this.dropdown.querySelector(`[data-value="${val}"]`); @@ -625,6 +912,7 @@ class HSSelect extends HSBasePlugin implements ISelect { private buildOriginalOption( title: string, val: string, + id?: string | null, disabled?: boolean, selected?: boolean, options?: ISingleOptionOptions, @@ -633,6 +921,7 @@ class HSSelect extends HSBasePlugin implements ISelect { option.setAttribute('value', val); if (disabled) option.setAttribute('disabled', 'disabled'); if (selected) option.setAttribute('selected', 'selected'); + if (id) option.setAttribute('data-id', id); option.setAttribute('data-hs-select-option', JSON.stringify(options)); option.innerText = title; @@ -782,13 +1071,9 @@ class HSSelect extends HSBasePlugin implements ISelect { (el: ISingleOption) => el.val !== val, ); - console.log(isArray); - this.value = isArray ? (this.value as string[]).filter((item: string) => item !== val) : val; - - console.log(this.value); } private resetTagsInputField() { @@ -812,19 +1097,17 @@ class HSSelect extends HSBasePlugin implements ISelect { if (this.mode === 'tags') { this.setTagsItems(); } else { - console.log(); - - if (this.value.length) + if (this.value?.length) { this.toggleTextWrapper.innerHTML = this.stringFromValue(); - else this.toggleTextWrapper.innerHTML = this.placeholder; + } else this.toggleTextWrapper.innerHTML = this.placeholder; } } - private stringFromValue() { + private stringFromValueBasic(options: ISingleOption[]) { const value: string[] = []; let title = ''; - this.selectOptions.forEach((el: ISingleOption) => { + options.forEach((el: ISingleOption) => { if (this.isMultiple) { if (this.value.includes(el.val)) value.push(el.title); } else { @@ -851,6 +1134,48 @@ class HSSelect extends HSBasePlugin implements ISelect { return title; } + private stringFromValueRemoteData() { + const options = this.dropdown.querySelectorAll('[data-title-value]'); + const value: string[] = []; + let title = ''; + + options.forEach((el: HTMLElement) => { + const dataValue = el.getAttribute('data-value'); + + if (this.isMultiple) { + if (this.value.includes(dataValue)) value.push(dataValue); + } else { + if (this.value === dataValue) value.push(dataValue); + } + }); + + if ( + this.toggleCountText && + this.toggleCountText !== '' && + value.length >= this.toggleCountTextMinItems + ) { + if (this.toggleCountTextMode === 'nItemsAndCount') { + const nItems = value.slice(0, this.toggleCountTextMinItems - 1); + + title = `${nItems.join(this.toggleSeparators.items)} ${this.toggleSeparators.betweenItemsAndCounter} ${value.length - nItems.length} ${this.toggleCountText}`; + } else { + title = `${value.length} ${this.toggleCountText}`; + } + } else { + title = value.join(this.toggleSeparators.items); + } + + return title; + } + + private stringFromValue() { + const result = this.apiUrl + ? this.stringFromValueRemoteData() + : this.stringFromValueBasic(this.selectOptions); + + return result; + } + private selectSingleItem() { const selectedOption = Array.from(this.el.children).find( (el) => this.value === (el as HTMLOptionElement).value, @@ -889,21 +1214,42 @@ class HSSelect extends HSBasePlugin implements ISelect { this.searchNoResult.remove(); this.searchNoResult = null; } - this.searchNoResult = htmlToElement(''); + this.searchNoResult = htmlToElement(this.searchNoResultTemplate); this.searchNoResult.innerText = this.searchNoResultText; classToClassList(this.searchNoResultClasses, this.searchNoResult); const options = this.dropdown.querySelectorAll('[data-value]'); let hasItems = false; + let countLimit: number; + if (this.searchLimit) countLimit = 0; options.forEach((el) => { const optionVal = el.getAttribute('data-title-value').toLocaleLowerCase(); - - if (!optionVal.includes(val.toLocaleLowerCase())) + const regexSafeVal = val + ? val + .split('') + .map((char) => { + return char.match(/\w/) ? `${char}[\\W_]*` : '\\W*'; + }) + .join('') + : ''; + const regex = new RegExp(regexSafeVal, 'i'); + const directMatch = this.isSearchDirectMatch; + const cleanedOptionVal = optionVal.trim(); + const condition = val + ? directMatch + ? !cleanedOptionVal.toLowerCase().includes(val.toLowerCase()) || + countLimit >= this.searchLimit + : !regex.test(cleanedOptionVal) || countLimit >= this.searchLimit + : !regex.test(cleanedOptionVal); + + if (condition) { el.classList.add('hidden'); - else { + } else { el.classList.remove('hidden'); hasItems = true; + + if (this.searchLimit) countLimit++; } }); @@ -929,6 +1275,11 @@ class HSSelect extends HSBasePlugin implements ISelect { } } + private toggleFn() { + if (this.isOpened) this.close(); + else this.open(); + } + // Public methods public destroy() { const parent = this.el.parentElement.parentElement; @@ -949,6 +1300,8 @@ class HSSelect extends HSBasePlugin implements ISelect { this.animationInProcess = true; + if (this.dropdownScope === 'window') + this.dropdown.classList.add('invisible'); this.dropdown.classList.remove('hidden'); this.recalculateDirection(); @@ -957,6 +1310,15 @@ class HSSelect extends HSBasePlugin implements ISelect { if (this?.toggle?.ariaExpanded) this.toggle.ariaExpanded = 'true'; this.wrapper.classList.add('active'); this.dropdown.classList.add('opened'); + if ( + this.dropdown.classList.contains('w-full') && + this.dropdownScope === 'window' + ) + this.updateDropdownWidth(); + if (this.popperInstance && this.dropdownScope === 'window') { + this.popperInstance.update(); + this.dropdown.classList.remove('invisible'); + } if (this.hasSearch && !this.preventSearchFocus) this.search.focus(); this.animationInProcess = false; @@ -1008,7 +1370,7 @@ class HSSelect extends HSBasePlugin implements ISelect { if (!hasOption) { this.addSelectOption(title, val, disabled, selected, options); this.buildOption(title, val, disabled, selected, options, i); - this.buildOriginalOption(title, val, disabled, selected, options); + this.buildOriginalOption(title, val, null, disabled, selected, options); if (selected && !this.isMultiple) this.onSelectOption(val); } @@ -1154,7 +1516,10 @@ class HSSelect extends HSBasePlugin implements ISelect { } static closeCurrentlyOpened(evtTarget: HTMLElement | null = null) { - if (!evtTarget.closest('.hs-select.active')) { + if ( + !evtTarget.closest('.hs-select.active') && + !evtTarget.closest('[data-hs-select-dropdown].opened') + ) { const currentlyOpened = window.$hsSelectCollection.filter((el) => el.element.isOpened) || null; diff --git a/src/plugins/select/interfaces.ts b/src/plugins/select/interfaces.ts index 9aebc9f..9e1db16 100644 --- a/src/plugins/select/interfaces.ts +++ b/src/plugins/select/interfaces.ts @@ -11,6 +11,14 @@ export interface ISingleOption { options?: ISingleOptionOptions | null; } +export interface IApiFieldMap { + id: string; + title: string; + icon?: string | null; + description?: string | null; + [key: string]: unknown; +} + export interface ISelectOptions { value?: string | string[]; isOpened?: boolean; @@ -23,6 +31,14 @@ export interface ISelectOptions { wrapperClasses?: string; + apiUrl?: string | null; + apiQuery?: string | null; + apiOptions?: RequestInit | null; + apiDataPart?: string | null; + apiSearchQueryKey?: string | null; + apiFieldsMap?: IApiFieldMap | null; + apiIconTag?: string | null; + toggleTag?: string; toggleClasses?: string; toggleSeparators?: { @@ -35,6 +51,7 @@ export interface ISelectOptions { tagsItemTemplate?: string; tagsItemClasses?: string; + tagsInputId?: string; tagsInputClasses?: string; dropdownTag?: string; @@ -44,13 +61,20 @@ export interface ISelectOptions { bottom?: string; }; dropdownSpace: number; + dropdownPlacement: string | null; + dropdownScope: 'window' | 'parent'; extraMarkup?: string | string[] | null; + searchTemplate?: string; searchWrapperTemplate?: string; + searchId?: string; + searchLimit?: number | typeof Infinity; + isSearchDirectMatch?: boolean; searchClasses?: string; searchWrapperClasses?: string; searchPlaceholder?: string; + searchNoResultTemplate?: string | null; searchNoResultText?: string | null; searchNoResultClasses?: string | null; diff --git a/src/plugins/stepper/index.ts b/src/plugins/stepper/index.ts index fe94a8c..c060575 100644 --- a/src/plugins/stepper/index.ts +++ b/src/plugins/stepper/index.ts @@ -1,6 +1,6 @@ /* * HSStepper - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -8,7 +8,11 @@ import { dispatch } from '../../utils'; -import { IStepperOptions, IStepper, IStepperItem } from './interfaces'; +import { + IStepperOptions, + IStepper, + IStepperItem, +} from '../stepper/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; diff --git a/src/plugins/strong-password/index.ts b/src/plugins/strong-password/index.ts index 3e74136..d262447 100644 --- a/src/plugins/strong-password/index.ts +++ b/src/plugins/strong-password/index.ts @@ -1,6 +1,6 @@ /* * HSStrongPassword - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -13,7 +13,10 @@ import { classToClassList, } from '../../utils'; -import { IStrongPasswordOptions, IStrongPassword } from './interfaces'; +import { + IStrongPasswordOptions, + IStrongPassword, +} from '../strong-password/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; diff --git a/src/plugins/tabs/index.ts b/src/plugins/tabs/index.ts index 9efea02..67af2b0 100644 --- a/src/plugins/tabs/index.ts +++ b/src/plugins/tabs/index.ts @@ -1,6 +1,6 @@ /* * HSTabs - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -8,7 +8,7 @@ import { dispatch } from '../../utils'; -import { ITabs } from './interfaces'; +import { ITabs } from '../tabs/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; diff --git a/src/plugins/tabs/interfaces.ts b/src/plugins/tabs/interfaces.ts index 3c6f8f5..619ba96 100644 --- a/src/plugins/tabs/interfaces.ts +++ b/src/plugins/tabs/interfaces.ts @@ -1,3 +1,3 @@ export interface ITabs { options?: {}; -} +} \ No newline at end of file diff --git a/src/plugins/textarea-auto-height/index.ts b/src/plugins/textarea-auto-height/index.ts new file mode 100644 index 0000000..c0ab91b --- /dev/null +++ b/src/plugins/textarea-auto-height/index.ts @@ -0,0 +1,167 @@ +/* + * HSTextareaAutoHeight + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ + +import { + ITextareaAutoHeightOptions, + ITextareaAutoHeight, +} from '../textarea-auto-height/interfaces'; + +import HSBasePlugin from '../base-plugin'; +import { ICollectionItem } from '../../interfaces'; + +class HSTextareaAutoHeight + extends HSBasePlugin + implements ITextareaAutoHeight +{ + private readonly defaultHeight: number; + + constructor(el: HTMLTextAreaElement, options?: ITextareaAutoHeightOptions) { + super(el, options); + + const data = el.getAttribute('data-hs-copy-markup'); + const dataOptions: ITextareaAutoHeightOptions = data + ? JSON.parse(data) + : {}; + const concatOptions = { + ...dataOptions, + ...options, + }; + + this.defaultHeight = concatOptions?.defaultHeight || 0; + + this.init(); + } + + private init() { + this.createCollection(window.$hsTextareaAutoHeightCollection, this); + + this.setAutoHeight(); + } + + private setAutoHeight() { + if (this.isParentHidden()) this.callbackAccordingToType(); + else this.textareaSetHeight(3); + + this.el.addEventListener('input', () => this.textareaSetHeight(3)); + } + + private textareaSetHeight(offsetTop = 0) { + this.el.style.height = 'auto'; + this.el.style.height = + this.checkIfOneLine() && this.defaultHeight + ? `${this.defaultHeight}px` + : `${this.el.scrollHeight + offsetTop}px`; + } + + private checkIfOneLine(): boolean { + const clientHeight = this.el.clientHeight; + const scrollHeight = this.el.scrollHeight; + + if (scrollHeight > clientHeight) return false; + else return true; + } + + private isParentHidden() { + return this.el.closest('.hs-collapse') || this.el.closest('.hs-overlay'); + } + + private parentType(): string | boolean { + if (this.el.closest('.hs-collapse')) return 'collapse'; + else if (this.el.closest('.hs-overlay')) return 'overlay'; + else return false; + } + + private callbackAccordingToType() { + if (this.parentType() === 'collapse') { + const collapseId = this.el.closest('.hs-collapse').id; + const { element } = (window.HSCollapse as any).getInstance( + `[data-hs-collapse="#${collapseId}"]`, + true, + ); + + element.on('beforeOpen', () => { + if (!this.el) return false; + + this.textareaSetHeight(3); + }); + } else if (this.parentType() === 'overlay') { + const { element } = (window.HSOverlay as any).getInstance( + this.el.closest('.hs-overlay'), + true, + ); + + element.on('open', () => { + if (!this.el) return false; + + this.textareaSetHeight(3); + }); + } else return false; + } + + // Static method + static getInstance( + target: HTMLTextAreaElement | string, + isInstance?: boolean, + ) { + const elInCollection = window.$hsTextareaAutoHeightCollection.find( + (el) => + el.element.el === + (typeof target === 'string' ? document.querySelector(target) : target), + ); + + return elInCollection + ? isInstance + ? elInCollection + : elInCollection.element + : null; + } + + static autoInit() { + if (!window.$hsTextareaAutoHeightCollection) + window.$hsTextareaAutoHeightCollection = []; + + document + .querySelectorAll( + '[data-hs-textarea-auto-height]:not(.--prevent-on-load-init)', + ) + .forEach((el: HTMLTextAreaElement) => { + if ( + !window.$hsTextareaAutoHeightCollection.find( + (elC) => (elC?.element?.el as HTMLTextAreaElement) === el, + ) + ) { + const data = el.getAttribute('data-hs-textarea-auto-height'); + const options: ITextareaAutoHeightOptions = data + ? JSON.parse(data) + : {}; + + new HSTextareaAutoHeight(el, options); + } + }); + } +} + +declare global { + interface Window { + HSTextareaAutoHeight: Function; + $hsTextareaAutoHeightCollection: ICollectionItem[]; + } +} + +window.addEventListener('load', () => { + HSTextareaAutoHeight.autoInit(); + + // Uncomment for debug + // console.log('Textarea Autoheight collection:', window.$hsTextareaAutoHeightCollection); +}); + +if (typeof window !== 'undefined') { + window.HSTextareaAutoHeight = HSTextareaAutoHeight; +} + +export default HSTextareaAutoHeight; diff --git a/src/plugins/textarea-auto-height/interfaces.ts b/src/plugins/textarea-auto-height/interfaces.ts new file mode 100644 index 0000000..e122bb5 --- /dev/null +++ b/src/plugins/textarea-auto-height/interfaces.ts @@ -0,0 +1,7 @@ +export interface ITextareaAutoHeightOptions { + defaultHeight: number; +} + +export interface ITextareaAutoHeight { + options?: ITextareaAutoHeightOptions; +} diff --git a/src/plugins/search-by-json/types.ts b/src/plugins/textarea-auto-height/types.ts similarity index 100% rename from src/plugins/search-by-json/types.ts rename to src/plugins/textarea-auto-height/types.ts diff --git a/src/plugins/theme-switch/index.ts b/src/plugins/theme-switch/index.ts index ba79da5..7016b2b 100644 --- a/src/plugins/theme-switch/index.ts +++ b/src/plugins/theme-switch/index.ts @@ -1,11 +1,14 @@ /* * HSThemeSwitch - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -import { IThemeSwitchOptions, IThemeSwitch } from './interfaces'; +import { + IThemeSwitchOptions, + IThemeSwitch, +} from '../theme-switch/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; diff --git a/src/plugins/toggle-count/index.ts b/src/plugins/toggle-count/index.ts index 4304967..b126a9d 100644 --- a/src/plugins/toggle-count/index.ts +++ b/src/plugins/toggle-count/index.ts @@ -1,12 +1,15 @@ /* * HSToggleCount - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ -import { IToggleCountOptions, IToggleCount } from './interfaces'; +import { + IToggleCountOptions, + IToggleCount, +} from '../toggle-count/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; diff --git a/src/plugins/toggle-password/index.ts b/src/plugins/toggle-password/index.ts index 9ec2913..3b48c7f 100644 --- a/src/plugins/toggle-password/index.ts +++ b/src/plugins/toggle-password/index.ts @@ -1,6 +1,6 @@ /* * HSTogglePassword - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -8,7 +8,10 @@ import { isFormElement, dispatch } from '../../utils'; -import { ITogglePasswordOptions, ITogglePassword } from './interfaces'; +import { + ITogglePasswordOptions, + ITogglePassword, +} from '../toggle-password/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; diff --git a/src/plugins/tooltip/index.ts b/src/plugins/tooltip/index.ts index 5297b9f..9eb822f 100644 --- a/src/plugins/tooltip/index.ts +++ b/src/plugins/tooltip/index.ts @@ -1,6 +1,6 @@ /* * HSTooltip - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. @@ -9,7 +9,7 @@ import { createPopper, PositioningStrategy, Instance } from '@popperjs/core'; import { getClassProperty, dispatch, afterTransition } from '../../utils'; -import { ITooltip } from './interfaces'; +import { ITooltip } from '../tooltip/interfaces'; import HSBasePlugin from '../base-plugin'; import { ICollectionItem } from '../../interfaces'; diff --git a/src/plugins/tree-view/index.ts b/src/plugins/tree-view/index.ts new file mode 100644 index 0000000..123156c --- /dev/null +++ b/src/plugins/tree-view/index.ts @@ -0,0 +1,303 @@ +/* + * HSTreeView + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ + +import { dispatch } from '../../utils'; + +import { + ITreeViewOptions, + ITreeView, + ITreeViewItem, + ITreeViewOptionsControlBy, +} from './interfaces'; + +import HSBasePlugin from '../base-plugin'; +import { ICollectionItem } from '../../interfaces'; + +class HSTreeView extends HSBasePlugin implements ITreeView { + private items: ITreeViewItem[] = []; + private readonly controlBy: ITreeViewOptionsControlBy; + private readonly autoSelectChildren: boolean; + private readonly isIndeterminate: boolean; + static group: number = 0; + + constructor(el: HTMLElement, options?: ITreeViewOptions, events?: {}) { + super(el, options, events); + + const data = el.getAttribute('data-hs-tree-view'); + const dataOptions: ITreeView = data ? JSON.parse(data) : {}; + const concatOptions = { + ...dataOptions, + ...options, + }; + + this.controlBy = concatOptions?.controlBy || 'button'; + this.autoSelectChildren = concatOptions?.autoSelectChildren || false; + this.isIndeterminate = concatOptions?.isIndeterminate || true; + + this.init(); + } + + private init() { + this.createCollection(window.$hsTreeViewCollection, this); + + HSTreeView.group += 1; + + this.initItems(); + } + + private initItems() { + this.el.querySelectorAll('[data-hs-tree-view-item]').forEach((el, ind) => { + const data = JSON.parse(el.getAttribute('data-hs-tree-view-item')); + if (!el.id) el.id = `tree-view-item-${HSTreeView.group}-${ind}`; + const concatData = { + ...data, + id: data.id ?? el.id, + path: this.getPath(el), + isSelected: data.isSelected ?? false, + }; + + this.items.push(concatData); + + if (this.controlBy === 'checkbox') this.controlByCheckbox(el, concatData); + else this.controlByButton(el, concatData); + }); + } + + private controlByButton(el: Element, data: ITreeViewItem) { + el.addEventListener('click', (evt: PointerEvent) => { + evt.stopPropagation(); + + if (el.classList.contains('disabled')) return false; + + if (!evt.metaKey && !evt.shiftKey) this.unselectItem(data); + this.selectItem(el, data); + + this.fireEvent('click', { + el, + data: data, + }); + dispatch('click.hs.treeView', this.el, { + el, + data: data, + }); + }); + } + + private controlByCheckbox(el: Element, data: ITreeViewItem) { + const control = el.querySelector(`input[value="${data.value}"]`); + + if (!!control) + control.addEventListener('change', () => { + if (this.autoSelectChildren) { + this.selectItem(el, data); + if (data.isDir) this.selectChildren(el, data); + this.toggleParent(el); + } else this.selectItem(el, data); + }); + } + + private getItem(id: string) { + return this.items.find((el) => el.id === id); + } + + private getPath(el: Element) { + const path: any = []; + let parent = el.closest('[data-hs-tree-view-item]'); + + while (!!parent) { + const data = JSON.parse(parent.getAttribute('data-hs-tree-view-item')); + + path.push(data.value); + + parent = parent.parentElement?.closest('[data-hs-tree-view-item]'); + } + + return path.reverse().join('/'); + } + + private unselectItem(exception: ITreeViewItem | null = null) { + let selectedItems = this.getSelectedItems(); + if (exception) + selectedItems = selectedItems.filter((el) => el.id !== exception.id); + + if (selectedItems.length) { + selectedItems.forEach((el) => { + const selectedElement = document.querySelector(`#${el.id}`); + + selectedElement.classList.remove('selected'); + this.changeItemProp(el.id, 'isSelected', false); + }); + } + } + + private selectItem(el: Element, data: ITreeViewItem) { + if (data.isSelected) { + el.classList.remove('selected'); + this.changeItemProp(data.id, 'isSelected', false); + } else { + el.classList.add('selected'); + this.changeItemProp(data.id, 'isSelected', true); + } + } + + private selectChildren(el: Element, data: ITreeViewItem) { + const items = el.querySelectorAll('[data-hs-tree-view-item]'); + + Array.from(items) + .filter((elI) => !elI.classList.contains('disabled')) + .forEach((elI) => { + const initialItemData = elI.id ? this.getItem(elI.id) : null; + + if (!initialItemData) return false; + + if (data.isSelected) { + elI.classList.add('selected'); + this.changeItemProp(initialItemData.id, 'isSelected', true); + } else { + elI.classList.remove('selected'); + this.changeItemProp(initialItemData.id, 'isSelected', false); + } + + const currentItemData = this.getItem(elI.id); + const control: HTMLFormElement = elI.querySelector( + `input[value="${currentItemData.value}"]`, + ); + + if (this.isIndeterminate) control.indeterminate = false; + + if (currentItemData.isSelected) control.checked = true; + else control.checked = false; + }); + } + + private toggleParent(el: Element) { + let parent = el.parentElement?.closest('[data-hs-tree-view-item]'); + + while (!!parent) { + const items = parent.querySelectorAll( + '[data-hs-tree-view-item]:not(.disabled)', + ); + const data = JSON.parse(parent.getAttribute('data-hs-tree-view-item')); + const control: HTMLFormElement = parent.querySelector( + `input[value="${data.value}"]`, + ); + let hasUnchecked = false; + let checkedItems = 0; + + items.forEach((elI) => { + const dataI = this.getItem(elI.id); + + if (dataI.isSelected) checkedItems += 1; + if (!dataI.isSelected) hasUnchecked = true; + }); + + if (hasUnchecked) { + parent.classList.remove('selected'); + this.changeItemProp(parent.id, 'isSelected', false); + control.checked = false; + } else { + parent.classList.add('selected'); + this.changeItemProp(parent.id, 'isSelected', true); + control.checked = true; + } + + if (this.isIndeterminate) { + if (checkedItems > 0 && checkedItems < items.length) + control.indeterminate = true; + else control.indeterminate = false; + } + + parent = parent.parentElement?.closest('[data-hs-tree-view-item]'); + } + } + + // Public methods + public update() { + this.items.map((el: ITreeViewItem) => { + const selector = document.querySelector(`#${el.id}`); + + if (el.path !== this.getPath(selector)) el.path = this.getPath(selector); + + return el; + }); + } + + public getSelectedItems() { + return this.items.filter((el) => el.isSelected); + } + + public changeItemProp(id: string, prop: string, val: any) { + this.items.map((el) => { + // @ts-ignore + if (el.id === id) el[prop] = val; + + return el; + }); + } + + // Static methods + static getInstance(target: HTMLElement | string, isInstance?: boolean) { + const elInCollection = window.$hsTreeViewCollection.find( + (el) => + el.element.el === + (typeof target === 'string' ? document.querySelector(target) : target), + ); + + return elInCollection + ? isInstance + ? elInCollection + : elInCollection.element.el + : null; + } + + static autoInit() { + if (!window.$hsTreeViewCollection) window.$hsTreeViewCollection = []; + + document + .querySelectorAll('[data-hs-tree-view]:not(.--prevent-on-load-init)') + .forEach((el: HTMLElement) => { + if ( + !window.$hsTreeViewCollection.find( + (elC) => (elC?.element?.el as HTMLElement) === el, + ) + ) + new HSTreeView(el); + }); + } + + // Backward compatibility + static on(evt: string, target: HTMLElement, cb: Function) { + const elInCollection = window.$hsTreeViewCollection.find( + (el) => + el.element.el === + (typeof target === 'string' ? document.querySelector(target) : target), + ); + + if (elInCollection) elInCollection.element.events[evt] = cb; + } +} + +declare global { + interface Window { + HSTreeView: Function; + $hsTreeViewCollection: ICollectionItem[]; + } +} + +window.addEventListener('load', () => { + HSTreeView.autoInit(); + + // Uncomment for debug + // console.log('Tree view collection:', window.$hsTreeViewCollection); +}); + +if (typeof window !== 'undefined') { + window.HSTreeView = HSTreeView; +} + +export default HSTreeView; diff --git a/src/plugins/tree-view/interfaces.ts b/src/plugins/tree-view/interfaces.ts new file mode 100644 index 0000000..4363903 --- /dev/null +++ b/src/plugins/tree-view/interfaces.ts @@ -0,0 +1,20 @@ +export type ITreeViewOptionsControlBy = 'checkbox' | 'button'; + +export interface ITreeViewItem { + id: string; + value: string; + isDir: boolean; + path: string; + isSelected?: boolean; +} + +export interface ITreeViewOptions { + items: ITreeViewItem[] | null; + controlBy?: ITreeViewOptionsControlBy; + autoSelectChildren?: boolean; + isIndeterminate?: boolean; +} + +export interface ITreeView { + options?: ITreeViewOptions; +} diff --git a/src/plugins/tree-view/types.ts b/src/plugins/tree-view/types.ts new file mode 100644 index 0000000..37ba73a --- /dev/null +++ b/src/plugins/tree-view/types.ts @@ -0,0 +1 @@ +// no types diff --git a/src/spa/index.ts b/src/spa/index.ts index 8d0fd54..637a550 100644 --- a/src/spa/index.ts +++ b/src/spa/index.ts @@ -1,4 +1,11 @@ -import { ISpaCollectionItem } from './interfaces'; +/* + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ + +import { ISpaCollectionItem } from '../spa/interfaces'; import HSCopyMarkup from '../plugins/copy-markup'; import HSAccordion from '../plugins/accordion'; @@ -11,16 +18,19 @@ import HSFileUpload from '../plugins/file-upload'; import HSInputNumber from '../plugins/input-number'; import HSOverlay from '../plugins/overlay'; import HSPinInput from '../plugins/pin-input'; +import HSRangeSlider from '../plugins/range-slider'; import HSRemoveElement from '../plugins/remove-element'; import HSScrollspy from '../plugins/scrollspy'; import HSSelect from '../plugins/select'; import HSStepper from '../plugins/stepper'; import HSStrongPassword from '../plugins/strong-password'; import HSTabs from '../plugins/tabs'; +import HSTextareaAutoHeight from '../plugins/textarea-auto-height'; import HSThemeSwitch from '../plugins/theme-switch'; import HSToggleCount from '../plugins/toggle-count'; import HSTogglePassword from '../plugins/toggle-password'; import HSTooltip from '../plugins/tooltip'; +import HSTreeView from '../plugins/tree-view'; export const COLLECTIONS: ISpaCollectionItem[] = [ { @@ -46,6 +56,11 @@ export const COLLECTIONS: ISpaCollectionItem[] = [ }, { key: 'overlay', fn: HSOverlay, collection: '$hsOverlayCollection' }, { key: 'pin-input', fn: HSPinInput, collection: '$hsPinInputCollection' }, + { + key: 'range-slider', + fn: HSRangeSlider, + collection: '$hsRangeSliderCollection', + }, { key: 'remove-element', fn: HSRemoveElement, @@ -60,6 +75,11 @@ export const COLLECTIONS: ISpaCollectionItem[] = [ collection: '$hsStrongPasswordCollection', }, { key: 'tabs', fn: HSTabs, collection: '$hsTabsCollection' }, + { + key: 'textarea-auto-height', + fn: HSTextareaAutoHeight, + collection: '$hsTextareaAutoHeightCollection', + }, { key: 'theme-switch', fn: HSThemeSwitch, @@ -76,4 +96,5 @@ export const COLLECTIONS: ISpaCollectionItem[] = [ collection: '$hsTogglePasswordCollection', }, { key: 'tooltip', fn: HSTooltip, collection: '$hsTooltipCollection' }, + { key: 'tree-view', fn: HSTreeView, collection: '$hsTreeViewCollection' }, ]; diff --git a/src/static/index.ts b/src/static/index.ts index 2eba119..556cea3 100644 --- a/src/static/index.ts +++ b/src/static/index.ts @@ -1,14 +1,14 @@ /* * HSStaticMethods - * @version: 2.4.1 + * @version: 2.5.0 * @author: Preline Labs Ltd. * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) * Copyright 2024 Preline Labs Ltd. */ import { getClassProperty, afterTransition } from '../utils'; -import { COLLECTIONS } from '../spa'; -import { IStaticMethods } from './interfaces'; +import { COLLECTIONS } from '../spa/index'; +import { IStaticMethods } from '../static/interfaces'; import { ICollectionItem } from '../interfaces'; import type HSCopyMarkup from '../plugins/copy-markup'; import type HSAccordion from '../plugins/accordion'; @@ -21,16 +21,19 @@ import type HSFileUpload from '../plugins/file-upload'; import type HSInputNumber from '../plugins/input-number'; import type HSOverlay from '../plugins/overlay'; import type HSPinInput from '../plugins/pin-input'; +import type HSRangeSlider from '../plugins/range-slider'; import type HSRemoveElement from '../plugins/remove-element'; import type HSScrollspy from '../plugins/scrollspy'; import type HSSelect from '../plugins/select'; import type HSStepper from '../plugins/stepper'; import type HSStrongPassword from '../plugins/strong-password'; import type HSTabs from '../plugins/tabs'; +import type HSTextareaAutoHeight from '../plugins/textarea-auto-height'; import type HSThemeSwitch from '../plugins/theme-switch'; import type HSToggleCount from '../plugins/toggle-count'; import type HSTogglePassword from '../plugins/toggle-password'; import type HSTooltip from '../plugins/tooltip'; +import type HSTreeView from '../plugins/tree-view'; declare global { interface Window { @@ -46,16 +49,19 @@ declare global { $hsInputNumberCollection: { id: number; element: HSInputNumber }[]; $hsOverlayCollection: ICollectionItem[]; $hsPinInputCollection: ICollectionItem[]; + $hsRangeSliderCollection: ICollectionItem[]; $hsRemoveElementCollection: ICollectionItem[]; $hsScrollspyCollection: ICollectionItem[]; $hsSelectCollection: ICollectionItem[]; $hsStepperCollection: ICollectionItem[]; $hsStrongPasswordCollection: ICollectionItem[]; $hsTabsCollection: ICollectionItem[]; + $hsTextareaAutoHeightCollection: ICollectionItem[]; $hsThemeSwitchCollection: ICollectionItem[]; $hsToggleCountCollection: ICollectionItem[]; $hsTogglePasswordCollection: ICollectionItem[]; $hsTooltipCollection: ICollectionItem[]; + $hsTreeViewCollection: ICollectionItem[]; } } diff --git a/src/utils/index.ts b/src/utils/index.ts index 23ee6e7..b5b8f06 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,3 +1,10 @@ +/* + * @version: 2.5.0 + * @author: Preline Labs Ltd. + * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html) + * Copyright 2024 Preline Labs Ltd. + */ + const stringToBoolean = (string: string): boolean => { return string === 'true' ? true : false; }; @@ -68,6 +75,16 @@ const isIpadOS = () => { ); }; +const isDirectChild = (parent: Element, child: HTMLElement) => { + const children = parent.children; + + for (let i = 0; i < children.length; i++) { + if (children[i] === child) return true; + } + + return false; +}; + const isEnoughSpace = ( el: HTMLElement, toggle: HTMLElement, @@ -205,6 +222,7 @@ export { isEnoughSpace, isParentOrElementHidden, isFormElement, + isDirectChild, debounce, dispatch, afterTransition, diff --git a/tsconfig.json b/tsconfig.json index b652aa3..24a3df7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "baseUrl": "./", "outDir": "./dist/", "sourceMap": true, "noImplicitAny": true, @@ -8,5 +9,13 @@ "allowJs": true, "moduleResolution": "node", "esModuleInterop": true - } + }, + "include": [ + "src/**/*", + "global.d.ts" + ], + "exclude": [ + "node_modules", + "**/*.spec.ts" + ] } \ No newline at end of file diff --git a/tsconfig.mjs.json b/tsconfig.mjs.json new file mode 100644 index 0000000..9a5aa89 --- /dev/null +++ b/tsconfig.mjs.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "ESNext", + "target": "ES6", + "moduleResolution": "node", + "esModuleInterop": true, + "sourceMap": true, + "noImplicitAny": true, + "allowJs": true, + "baseUrl": ".", + "outDir": "./dist", + "allowSyntheticDefaultImports": true + }, + "include": [ + "src/**/*", + "./global.d.ts" + ], + "exclude": [ + "node_modules", + "**/*.spec.ts" + ] +} \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index 708fe43..12b1df0 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,7 +3,6 @@ const TerserPlugin = require('terser-webpack-plugin'); module.exports = { mode: 'production', - watch: true, stats: 'minimal', entry: { index: './src/index.ts', @@ -18,16 +17,23 @@ module.exports = { 'input-number': './src/plugins/input-number/index.ts', overlay: './src/plugins/overlay/index.ts', 'pin-input': './src/plugins/pin-input/index.ts', + 'range-slider': './src/plugins/range-slider/index.ts', 'remove-element': './src/plugins/remove-element/index.ts', scrollspy: './src/plugins/scrollspy/index.ts', select: './src/plugins/select/index.ts', stepper: './src/plugins/stepper/index.ts', 'strong-password': './src/plugins/strong-password/index.ts', tabs: './src/plugins/tabs/index.ts', + 'textarea-auto-height': './src/plugins/textarea-auto-height/index.ts', 'theme-switch': './src/plugins/theme-switch/index.ts', 'toggle-count': './src/plugins/toggle-count/index.ts', 'toggle-password': './src/plugins/toggle-password/index.ts', tooltip: './src/plugins/tooltip/index.ts', + 'tree-view': './src/plugins/tree-view/index.ts', + + // Helpers + 'helper-apexcharts': './src/helpers/apexcharts/index.ts', + 'helper-clipboard': './src/helpers/clipboard/index.ts', }, module: { rules: [ @@ -35,7 +41,9 @@ module.exports = { { test: /\.ts?$/, use: 'ts-loader', exclude: /node_modules/ }, ], }, - resolve: { extensions: ['.ts', '.js'] }, + resolve: { + extensions: ['.ts', '.js'], + }, output: { path: path.resolve(__dirname, 'dist'), filename: '[name].js', @@ -46,6 +54,8 @@ module.exports = { lodash: '_', 'datatable.net-dt': 'DataTable', dropzone: 'Dropzone', + clipboard: 'ClipboardJS', + noUiSlider: 'noUiSlider', }, optimization: { minimize: true, diff --git a/webpack.config.mjs.js b/webpack.config.mjs.js new file mode 100644 index 0000000..33fd618 --- /dev/null +++ b/webpack.config.mjs.js @@ -0,0 +1,82 @@ +const path = require('path'); +const TerserPlugin = require('terser-webpack-plugin'); + +module.exports = { + mode: 'production', + 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', + datatable: './src/plugins/datatable/index.ts', + dropdown: './src/plugins/dropdown/index.ts', + 'file-upload': './src/plugins/file-upload/index.ts', + 'input-number': './src/plugins/input-number/index.ts', + overlay: './src/plugins/overlay/index.ts', + 'pin-input': './src/plugins/pin-input/index.ts', + 'range-slider': './src/plugins/range-slider/index.ts', + 'remove-element': './src/plugins/remove-element/index.ts', + scrollspy: './src/plugins/scrollspy/index.ts', + select: './src/plugins/select/index.ts', + stepper: './src/plugins/stepper/index.ts', + 'strong-password': './src/plugins/strong-password/index.ts', + tabs: './src/plugins/tabs/index.ts', + 'textarea-auto-height': './src/plugins/textarea-auto-height/index.ts', + 'theme-switch': './src/plugins/theme-switch/index.ts', + 'toggle-count': './src/plugins/toggle-count/index.ts', + 'toggle-password': './src/plugins/toggle-password/index.ts', + tooltip: './src/plugins/tooltip/index.ts', + 'tree-view': './src/plugins/tree-view/index.ts', + + // Helpers + 'helper-apexcharts': './src/helpers/apexcharts/index.ts', + 'helper-clipboard': './src/helpers/clipboard/index.ts', + }, + module: { + rules: [ + { test: /\.ts?$/, enforce: 'pre', use: ['source-map-loader'] }, + { + test: /\.ts?$/, + use: [ + { + loader: 'ts-loader', + options: { + configFile: 'tsconfig.mjs.json', + }, + }, + ], + exclude: /node_modules/, + }, + ], + }, + experiments: { + outputModule: true, + }, + resolve: { + extensions: ['.ts', '.js'], + }, + output: { + path: path.resolve(__dirname, 'dist'), + filename: '[name].mjs', + libraryTarget: 'module', + }, + externals: { + jquery: 'jQuery', + lodash: '_', + 'datatable.net-dt': 'DataTable', + dropzone: 'Dropzone', + clipboard: 'ClipboardJS', + noUiSlider: 'noUiSlider', + }, + optimization: { + minimize: true, + minimizer: [ + new TerserPlugin({ + extractComments: false, + }), + ], + }, +};