From 9301c7266358ce175c5303a55b278c9629ca6f29 Mon Sep 17 00:00:00 2001 From: yagnikvamja Date: Fri, 3 Jan 2025 19:45:00 +0530 Subject: [PATCH] v1.3.0 --- CHANGELOG.md | 26 +++ flyonui.d.ts | 54 +++-- flyonui.js | 72 +++--- flyonui.mjs | 173 -------------- global.d.ts | 2 +- package.json | 3 +- plugin.js | 2 +- plugin.ts | 50 ++++- src/components/styled/accordion.css | 2 +- src/components/styled/advance-select.css | 6 +- src/components/styled/card.css | 17 +- src/components/styled/chat.css | 2 +- src/components/styled/divider.css | 2 +- src/components/styled/drawer.css | 2 +- src/components/styled/dropdown.css | 4 +- src/components/styled/footer.css | 2 +- src/components/styled/form.css | 4 +- src/components/styled/input.css | 6 +- src/components/styled/menu.css | 6 +- src/components/styled/modal.css | 14 +- src/components/styled/radio.css | 2 +- src/components/styled/stat.css | 2 +- src/components/styled/tab.css | 2 +- src/components/styled/table.css | 4 +- src/components/styled/textarea.css | 2 +- src/components/unstyled/breadcrumbs.css | 2 +- src/components/unstyled/card.css | 2 +- src/components/unstyled/form.css | 4 +- src/components/unstyled/modal.css | 12 +- src/js/helpers/apexcharts/index.ts | 19 +- src/js/helpers/clipboard/index.ts | 2 +- src/js/index.ts | 2 +- src/js/plugins/accordion/index.ts | 69 +++--- src/js/plugins/base-plugin/index.ts | 2 +- src/js/plugins/carousel/index.ts | 6 +- src/js/plugins/collapse/index.ts | 44 ++-- src/js/plugins/combobox/index.ts | 25 ++- src/js/plugins/combobox/interfaces.ts | 1 + src/js/plugins/copy-markup/index.ts | 2 +- src/js/plugins/datatable/index.ts | 275 ++++++++++++++--------- src/js/plugins/dropdown/index.ts | 79 ++++--- src/js/plugins/file-upload/index.ts | 12 +- src/js/plugins/input-number/index.ts | 2 +- src/js/plugins/overlay/index.ts | 270 ++++++++++++---------- src/js/plugins/pin-input/index.ts | 2 +- src/js/plugins/range-slider/index.ts | 6 +- src/js/plugins/remove-element/index.ts | 12 +- src/js/plugins/scrollspy/index.ts | 2 +- src/js/plugins/select/index.ts | 42 +++- src/js/plugins/select/interfaces.ts | 1 + src/js/plugins/stepper/index.ts | 4 +- src/js/plugins/strong-password/index.ts | 2 +- src/js/plugins/tabs/index.ts | 12 +- src/js/plugins/tabs/interfaces.ts | 6 + src/js/plugins/toggle-count/index.ts | 2 +- src/js/plugins/toggle-password/index.ts | 2 +- src/js/plugins/tooltip/index.ts | 46 ++-- src/js/plugins/tree-view/index.ts | 26 ++- src/js/spa/index.ts | 2 +- src/js/static/index.ts | 10 +- src/js/utils/index.ts | 2 +- src/utilities/styled/card.css | 37 +-- src/vendors/styled/apexcharts.css | 2 +- src/vendors/styled/editor.css | 8 +- src/vendors/styled/flatpickr.css | 18 +- src/vendors/styled/fullcalendar.css | 2 +- 66 files changed, 810 insertions(+), 727 deletions(-) delete mode 100644 flyonui.mjs diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e32875..59318b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,29 @@ +## [1.3.0] - [2025-01-03] + +## Added + +**Combo Box** : [Minimum search Length](https://flyonui.com/docs/advanced-forms/combo-box/#minimum-search-length) + +**Datatables** : [Multiple Controls](https://flyonui.com/docs/third-party-plugins/datatables/#multiple-controls) + +## Updated + +- Preline v2.7.0 +- Updated divider component border-color from `base-content/10` to `base-content/20` +- Updated heading color from `text-base-content/90` to `text-base-content` +- You can now invoke overlay methods directly on the overlay itself without linking it to any button. The previous functionality is retained for backward compatibility. + +## Fixes and Improvements + +- Added: A new parameter `optionAllowEmptyOption` has been added for Advanced Select +- Added: A new parameter `minSearchLength` has been added for Combo Box +- Added: Enhanced support for multiple `prev` and `next` elements, each with its own event listeners, ensuring proper initialization and cleanup in the destroy method. Improved event listener management for `search` and `pagination` controls to prevent memory leaks and support dynamic elements. +- Fixed: Removed `flyonui.mjs` as it was creating issues while using `import` +- Fixed: Improve card style specificity +- Fixed: Typo in select and textarea. [[PR #30]](https://github.com/themeselection/flyonui/pull/30) +- Fixed: Improved label styles for better usability in form elements. +- Fixed: `setValue` method functionality with tags in Advanced Select. + ## [1.2.0] - [2024-12-11] ## Added diff --git a/flyonui.d.ts b/flyonui.d.ts index 48c6656..b78d576 100644 --- a/flyonui.d.ts +++ b/flyonui.d.ts @@ -87,14 +87,15 @@ export declare class HSAccordion extends HSBasePlugin impleme hide(): boolean; update(): boolean; destroy(): void; - static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem; - static show(target: HTMLElement): void; - static hide(target: HTMLElement): void; + private static findInCollection; static autoInit(): void; + static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem; + static show(target: HSAccordion | HTMLElement | string): void; + static hide(target: HSAccordion | HTMLElement | string): void; static onSelectableClick: (evt: Event, item: IAccordionTreeView, el: HTMLElement) => void; static treeView(): boolean; static toggleSelected(root: IAccordionTreeView, item: HTMLElement): void; - static on(evt: string, target: HTMLElement, cb: Function): void; + static on(evt: string, target: HSAccordion | HTMLElement | string, cb: Function): void; } export type TCarouselOptionsSlidesQty = { [key: string]: number; @@ -246,16 +247,18 @@ export declare class HSCollapse extends HSBasePlugin<{}> implements ICollapse { show(): boolean; hide(): boolean; destroy(): void; + private static findInCollection; static getInstance(target: HTMLElement, isInstance?: boolean): HTMLElement | ICollectionItem; static autoInit(): void; - static show(target: HTMLElement): void; - static hide(target: HTMLElement): void; - static on(evt: string, target: HTMLElement, cb: Function): void; + static show(target: HSCollapse | HTMLElement | string): void; + static hide(target: HSCollapse | HTMLElement | string): void; + static on(evt: string, target: HSCollapse | HTMLElement | string, cb: Function): void; } export interface IComboBoxOptions { gap?: number; viewport?: string | HTMLElement | null; preventVisibility?: boolean; + minSearchLength?: number; apiUrl?: string | null; apiDataPart?: string | null; apiQuery?: string | null; @@ -286,6 +289,7 @@ export declare class HSComboBox extends HSBasePlugin implement gap: number; viewport: string | HTMLElement | null; preventVisibility: boolean; + minSearchLength: number; apiUrl: string | null; apiDataPart: string | null; apiQuery: string | null; @@ -321,6 +325,7 @@ export declare class HSComboBox extends HSBasePlugin implement isOpened: boolean; isCurrent: boolean; private animationInProcess; + private isSearchLengthExceeded; private onInputFocusListener; private onInputInputListener; private onToggleClickListener; @@ -436,10 +441,11 @@ export declare class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> imp close(isAnimated?: boolean): boolean; forceClearState(): void; destroy(): void; + private static findInCollection; static getInstance(target: HTMLElement | string, isInstance?: boolean): ICollectionItem | IHTMLElementPopper; static autoInit(): void; - static open(target: HTMLElement): void; - static close(target: HTMLElement): void; + static open(target: HSDropdown | HTMLElement | string): void; + static close(target: HSDropdown | HTMLElement | string): void; static accessibility(evt: KeyboardEvent): void; static onEscape(evt: KeyboardEvent): void; static onEnter(evt: KeyboardEvent): boolean; @@ -448,7 +454,7 @@ export declare class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> imp static onStartEnd(isStart?: boolean): boolean; static onFirstLetter(code: string): boolean; static closeCurrentlyOpened(evtTarget?: HTMLElement | null, isAnimated?: boolean): void; - static on(evt: string, target: HTMLElement, cb: Function): void; + static on(evt: string, target: HSDropdown | HTMLElement | string, cb: Function): void; } export interface IInputNumberOptions { min?: number; @@ -517,8 +523,7 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private readonly animationTarget; private openNextOverlay; private autoHide; - private readonly overlayId; - overlay: HTMLElement | null; + private toggleButtons; initContainer: HTMLElement | null; isCloseWhenClickInside: boolean; isTabAccessibilityLimited: boolean; @@ -538,24 +543,27 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private overlayClick; private backdropClick; private init; + private buildToggleButtons; private hideAuto; private checkTimer; private buildBackdrop; private destroyBackdrop; private focusElement; private getScrollbarSize; - open(): false | Promise; + private collectToggleParameters; + open(): Promise; close(forceClose?: boolean): Promise; destroy(): void; - static getInstance(target: HTMLElement, isInstance?: boolean): HTMLElement | ICollectionItem; + private static findInCollection; + static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem; static autoInit(): void; - static open(target: HTMLElement): void; - static close(target: HTMLElement): void; + static open(target: HSOverlay | HTMLElement | string): void; + static close(target: HSOverlay | HTMLElement | string): void; static setOpened(breakpoint: number, el: ICollectionItem): void; static accessibility(evt: KeyboardEvent): boolean; static onEscape(target: ICollectionItem): void; static onTab(target: ICollectionItem): boolean; - static on(evt: string, target: HTMLElement, cb: Function): void; + static on(evt: string, target: HSOverlay | HTMLElement | string, cb: Function): void; } export interface IPinInputOptions { availableCharsRE?: RegExp; @@ -712,6 +720,7 @@ export interface ISelectOptions { searchNoResultTemplate?: string | null; searchNoResultText?: string | null; searchNoResultClasses?: string | null; + optionAllowEmptyOption?: boolean; optionTemplate?: string; optionTag?: string; optionClasses?: string; @@ -777,6 +786,7 @@ export declare class HSSelect extends HSBasePlugin implements IS private readonly searchNoResultTemplate; private readonly searchNoResultText; private readonly searchNoResultClasses; + private readonly optionAllowEmptyOption; private readonly optionTag; private readonly optionTemplate; private readonly optionClasses; @@ -1167,11 +1177,12 @@ export declare class HSTooltip extends HSBasePlugin<{}> implements ITooltip { show(): void; hide(): void; destroy(): void; + private static findInCollection; static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem; static autoInit(): void; - static show(target: HTMLElement): void; - static hide(target: HTMLElement): void; - static on(evt: string, target: HTMLElement, cb: Function): void; + static show(target: HSTooltip | HTMLElement | string): void; + static hide(target: HSTooltip | HTMLElement | string): void; + static on(evt: string, target: HSTooltip | HTMLElement | string, cb: Function): void; } export type ITreeViewOptionsControlBy = "checkbox" | "button"; export interface ITreeViewItem { @@ -1219,9 +1230,10 @@ export declare class HSTreeView extends HSBasePlugin implement getSelectedItems(): ITreeViewItem[]; changeItemProp(id: string, prop: string, val: any): void; destroy(): void; + private static findInCollection; static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem; static autoInit(): void; - static on(evt: string, target: HTMLElement, cb: Function): void; + static on(evt: string, target: HSTreeView | HTMLElement | string, cb: Function): void; } export interface IStaticMethods { getClassProperty(el: HTMLElement, prop?: string, val?: string): string; diff --git a/flyonui.js b/flyonui.js index 1694210..f749d6e 100644 --- a/flyonui.js +++ b/flyonui.js @@ -1,6 +1,6 @@ !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]}}(globalThis,(()=>(()=>{"use strict";var t={170:(t,e,n)=>{n.r(e),n.d(e,{afterMain:()=>S,afterRead:()=>w,afterWrite:()=>E,applyStyles:()=>_,arrow:()=>Z,auto:()=>l,basePlacements:()=>a,beforeMain:()=>b,beforeRead:()=>g,beforeWrite:()=>L,bottom:()=>o,clippingParents:()=>d,computeStyles:()=>nt,createPopper:()=>_t,createPopperBase:()=>Pt,createPopperLite:()=>Bt,detectOverflow:()=>yt,end:()=>u,eventListeners:()=>ot,flip:()=>wt,hide:()=>St,left:()=>s,main:()=>C,modifierPhases:()=>T,offset:()=>Lt,placements:()=>m,popper:()=>h,popperGenerator:()=>At,popperOffsets:()=>It,preventOverflow:()=>Et,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",C="main",S="afterMain",L="beforeWrite",I="write",E="afterWrite",T=[g,y,w,b,C,S,L,I,E];function x(t){return t?(t.nodeName||"").toLowerCase():null}function k(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function O(t){return t instanceof k(t).Element||t instanceof Element}function A(t){return t instanceof k(t).HTMLElement||t instanceof HTMLElement}function P(t){return"undefined"!=typeof ShadowRoot&&(t instanceof k(t).ShadowRoot||t instanceof ShadowRoot)}const _={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];A(o)&&x(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}),{});A(i)&&x(i)&&(Object.assign(i.style,r),Object.keys(o).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]};function B(t){return t.split("-")[0]}var D=Math.max,M=Math.min,q=Math.round;function $(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function N(){return!/^((?!chrome|android).)*safari/i.test($())}function H(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var i=t.getBoundingClientRect(),o=1,r=1;e&&A(t)&&(o=t.offsetWidth>0&&q(i.width)/t.offsetWidth||1,r=t.offsetHeight>0&&q(i.height)/t.offsetHeight||1);var s=(O(t)?k(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 j(t){var e=H(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 F(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&P(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function V(t){return k(t).getComputedStyle(t)}function R(t){return["table","td","th"].indexOf(x(t))>=0}function W(t){return((O(t)?t.ownerDocument:t.document)||window.document).documentElement}function U(t){return"html"===x(t)?t:t.assignedSlot||t.parentNode||(P(t)?t.host:null)||W(t)}function z(t){return A(t)&&"fixed"!==V(t).position?t.offsetParent:null}function Q(t){for(var e=k(t),n=z(t);n&&R(n)&&"static"===V(n).position;)n=z(n);return n&&("html"===x(n)||"body"===x(n)&&"static"===V(n).position)?e:n||function(t){var e=/firefox/i.test($());if(/Trident/i.test($())&&A(t)&&"fixed"===V(t).position)return null;var n=U(t);for(P(n)&&(n=n.host);A(n)&&["html","body"].indexOf(x(n))<0;){var i=V(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 D(t,M(e,n))}function X(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Y(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=B(n.placement),h=J(p),f=[s,r].indexOf(p)>=0?"height":"width";if(u&&d){var v=function(t,e){return X("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Y(t,a))}(c.padding,n),m=j(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],C=Q(u),S=C?"y"===h?C.clientHeight||0:C.clientWidth||0:0,L=w/2-b/2,I=v[g],E=S-m[f]-v[y],T=S/2-m[f]/2+L,x=K(I,T,E),k=h;n.modifiersData[l]=((e={})[k]=x,e.centerOffset=x-T,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)))&&F(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,C="function"==typeof v?v({x:y,y:b}):{x:y,y:b};y=C.x,b=C.y;var S=d.hasOwnProperty("x"),L=d.hasOwnProperty("y"),I=s,E=i,T=window;if(f){var x=Q(n),O="clientHeight",A="clientWidth";if(x===k(n)&&"static"!==V(x=W(n)).position&&"absolute"===p&&(O="scrollHeight",A="scrollWidth"),a===i||(a===s||a===r)&&c===u)E=o,b-=(m&&x===T&&T.visualViewport?T.visualViewport.height:x[O])-l.height,b*=h?1:-1;if(a===s||(a===i||a===o)&&c===u)I=r,y-=(m&&x===T&&T.visualViewport?T.visualViewport.width:x[A])-l.width,y*=h?1:-1}var P,_=Object.assign({position:p},f&&tt),B=!0===v?function(t,e){var n=t.x,i=t.y,o=e.devicePixelRatio||1;return{x:q(n*o)/o||0,y:q(i*o)/o||0}}({x:y,y:b},k(n)):{x:y,y:b};return y=B.x,b=B.y,h?Object.assign({},_,((P={})[E]=L?"0":"",P[I]=S?"0":"",P.transform=(T.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",P)):Object.assign({},_,((e={})[E]=L?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,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:B(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=k(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=k(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ut(t){return H(W(t)).left+ct(t).scrollLeft}function dt(t){var e=V(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(x(t))>=0?t.ownerDocument.body:A(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=k(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=k(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)):O(e)?function(t,e){var n=H(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(e,n):ft(function(t){var e,n=W(t),i=ct(t),o=null==(e=t.ownerDocument)?void 0:e.body,r=D(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=D(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-i.scrollLeft+ut(t),a=-i.scrollTop;return"rtl"===V(o||n).direction&&(l+=D(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(V(t).position)>=0&&A(t)?Q(t):t;return O(n)?e.filter((function(t){return O(t)&&F(t,n)&&"body"!==x(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=D(o.top,e.top),e.right=M(o.right,e.right),e.bottom=M(o.bottom,e.bottom),e.left=D(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?B(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,C=n.altBoundary,S=void 0!==C&&C,L=n.padding,I=void 0===L?0:L,E=X("number"!=typeof I?I:Y(I,a)),T=b===h?f:h,x=t.rects.popper,k=t.elements[S?T:b],A=mt(O(k)?k:k.contextElement||W(t.elements.popper),m,y,u),P=H(t.elements.reference),_=gt({reference:P,element:x,strategy:"absolute",placement:l}),B=ft(Object.assign({},x,_)),D=b===h?B:P,M={top:A.top-D.top+E.top,bottom:D.bottom-A.bottom+E.bottom,left:A.left-D.left+E.left,right:D.right-A.right+E.right},q=t.modifiersData.offset;if(b===h&&q){var $=q[l];Object.keys(M).forEach((function(t){var e=[r,o].indexOf(t)>=0?1:-1,n=[i,o].indexOf(t)>=0?"y":"x";M[t]+=$[n]*e}))}return M}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,L=void 0===S||S,I=n.allowedAutoPlacements,E=e.options.placement,T=B(E),x=g||(T===E||!L?[st(E)]:function(t){if(B(t)===l)return[];var e=st(t);return[at(t),e,at(e)]}(E)),k=[E].concat(x).reduce((function(t,n){return t.concat(B(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})[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:L,allowedAutoPlacements:I}):n)}),[]),O=e.rects.reference,A=e.rects.popper,P=new Map,_=!0,D=k[0],M=0;M=0,j=H?"width":"height",F=yt(e,{placement:q,boundary:w,rootBoundary:b,altBoundary:C,padding:y}),V=H?N?r:s:N?o:i;O[j]>A[j]&&(V=st(V));var R=st(V),W=[];if(p&&W.push(F[$]<=0),f&&W.push(F[V]<=0,F[R]<=0),W.every((function(t){return t}))){D=q,_=!1;break}P.set(q,W)}if(_)for(var U=function(t){var e=k.find((function(e){var n=P.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return D=e,"break"},z=L?3:1;z>0;z--){if("break"===U(z))break}e.placement!==D&&(e.modifiersData[u]._skip=!0,e.placement=D,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[i,r,o,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,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=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 Lt={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=B(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 Et={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),L=G(e.placement),I=!L,E=J(S),T="x"===E?"y":"x",x=e.modifiersData.popperOffsets,k=e.rects.reference,O=e.rects.popper,A="function"==typeof b?b(Object.assign({},e.rects,{placement:e.placement})):b,P="number"==typeof A?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),_=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,q={x:0,y:0};if(x){if(u){var $,N="y"===E?i:s,H="y"===E?o:r,F="y"===E?"height":"width",V=x[E],R=V+C[N],W=V-C[H],U=y?-O[F]/2:0,z=L===c?k[F]:O[F],X=L===c?-O[F]:-k[F],Y=e.elements.arrow,Z=y&&Y?j(Y):{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[H],it=K(0,k[F],Z[F]),ot=I?k[F]/2-U-it-et-P.mainAxis:z-it-et-P.mainAxis,rt=I?-k[F]/2+U+it+nt+P.mainAxis:X+it+nt+P.mainAxis,st=e.elements.arrow&&Q(e.elements.arrow),lt=st?"y"===E?st.clientTop||0:st.clientLeft||0:0,at=null!=($=null==_?void 0:_[E])?$:0,ct=V+rt-at,ut=K(y?M(R,V+ot-at-lt):R,V,y?D(W,ct):W);x[E]=ut,q[E]=ut-V}if(p){var dt,pt="x"===E?i:s,ht="x"===E?o:r,ft=x[T],vt="y"===T?"height":"width",mt=ft+C[pt],gt=ft-C[ht],wt=-1!==[i,s].indexOf(S),bt=null!=(dt=null==_?void 0:_[T])?dt:0,Ct=wt?mt:ft-k[vt]-O[vt]-bt+P.altAxis,St=wt?ft+k[vt]+O[vt]-bt-P.altAxis:gt,Lt=y&&wt?function(t,e,n){var i=K(t,e,n);return i>n?n:i}(Ct,ft,St):K(y?Ct:mt,ft,y?St:gt);x[T]=Lt,q[T]=Lt-ft}e.modifiersData[l]=q}},requiresIfExists:["offset"]};function Tt(t,e,n){void 0===n&&(n=!1);var i,o,r=A(e),s=A(e)&&function(t){var e=t.getBoundingClientRect(),n=q(e.width)/t.offsetWidth||1,i=q(e.height)/t.offsetHeight||1;return 1!==n||1!==i}(e),l=W(e),a=H(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==x(e)||dt(l))&&(c=(i=e)!==k(i)&&A(i)?{scrollLeft:(o=i).scrollLeft,scrollTop:o.scrollTop}:ct(i)),A(e)?((u=H(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):l&&(u.x=ut(l))),{x:a.left+c.scrollLeft-u.x,y:a.top+c.scrollTop-u.y,width:a.width,height:a.height}}function xt(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 kt={placement:"bottom",modifiers:[],strategy:"absolute"};function Ot(){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-start":"top-start","top-end":"top-end",bottom:"bottom","bottom-start":"bottom-start","bottom-end":"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","ArrowRight","ArrowLeft","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","Space","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}},800:function(t,e,n){ /* - * @version: 2.6.0 + * @version: 2.7.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,39 +8,39 @@ 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.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(12);Object.defineProperty(e,"HSCopyMarkup",{enumerable:!0,get:function(){return i(o).default}});var r=n(306);Object.defineProperty(e,"HSAccordion",{enumerable:!0,get:function(){return i(r).default}});var s=n(302);Object.defineProperty(e,"HSCarousel",{enumerable:!0,get:function(){return i(s).default}});var l=n(763);Object.defineProperty(e,"HSCollapse",{enumerable:!0,get:function(){return i(l).default}});var a=n(75);Object.defineProperty(e,"HSComboBox",{enumerable:!0,get:function(){return i(a).default}});var c=n(753);Object.defineProperty(e,"HSDropdown",{enumerable:!0,get:function(){return i(c).default}});var u=n(86);Object.defineProperty(e,"HSInputNumber",{enumerable:!0,get:function(){return i(u).default}});var d=n(164);Object.defineProperty(e,"HSOverlay",{enumerable:!0,get:function(){return i(d).default}});var p=n(594);Object.defineProperty(e,"HSPinInput",{enumerable:!0,get:function(){return i(p).default}});var h=n(113);Object.defineProperty(e,"HSRemoveElement",{enumerable:!0,get:function(){return i(h).default}});var f=n(881);Object.defineProperty(e,"HSScrollspy",{enumerable:!0,get:function(){return i(f).default}});var v=n(956);Object.defineProperty(e,"HSSelect",{enumerable:!0,get:function(){return i(v).default}});var m=n(213);Object.defineProperty(e,"HSStepper",{enumerable:!0,get:function(){return i(m).default}});var g=n(207);Object.defineProperty(e,"HSStrongPassword",{enumerable:!0,get:function(){return i(g).default}});var y=n(944);Object.defineProperty(e,"HSTabs",{enumerable:!0,get:function(){return i(y).default}});var w=n(126);Object.defineProperty(e,"HSToggleCount",{enumerable:!0,get:function(){return i(w).default}});var b=n(234);Object.defineProperty(e,"HSTogglePassword",{enumerable:!0,get:function(){return i(b).default}});var C=n(487);Object.defineProperty(e,"HSTooltip",{enumerable:!0,get:function(){return i(C).default}});var S=n(782);Object.defineProperty(e,"HSTreeView",{enumerable:!0,get:function(){return i(S).default}});var L=n(319);Object.defineProperty(e,"HSStaticMethods",{enumerable:!0,get:function(){return i(L).default}}),"undefined"!=typeof DataTable&&"undefined"!=typeof jQuery?e.HSDataTable=n(792).default:e.HSDataTable=null,"undefined"!=typeof _&&"undefined"!=typeof Dropzone?e.HSFileUpload=n(192).default:e.HSFileUpload=null,"undefined"!=typeof noUiSlider?e.HSRangeSlider=n(977).default:e.HSRangeSlider=null},306:function(t,e,n){ /* * HSAccordion - * @version: 2.6.0 + * @version: 2.7.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;n .accordion-item.active")&&this.group.querySelector(":scope > .accordion-item.active")!==this.el&&window.$hsAccordionCollection.find((function(t){return t.element.el===e.group.querySelector(":scope > .accordion-item.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.accordion.item",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.accordion.item",e.el,e.el)}))},e.prototype.update=function(){var t=this;if(this.group=this.el.closest(".accordion")||null,!this.group)return!1;this.isAlwaysOpened=this.group.hasAttribute("data-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.prototype.destroy=function(){var t,n=this;(null===(t=null==e?void 0:e.selectable)||void 0===t?void 0:t.length)&&e.selectable.forEach((function(t){t.listeners.forEach((function(t){var e=t.el,n=t.listener;e.removeEventListener("click",n)}))})),this.onToggleClickListener&&this.toggle.removeEventListener("click",this.onToggleClickListener),this.toggle=null,this.content=null,this.group=null,this.onToggleClickListener=null,window.$hsAccordionCollection=window.$hsAccordionCollection.filter((function(t){return t.element.el!==n.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=[]),window.$hsAccordionCollection&&(window.$hsAccordionCollection=window.$hsAccordionCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll(".accordion-item: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(".accordion-treeview-root").length)return!1;this.selectable=[],document.querySelectorAll(".accordion-treeview-root").forEach((function(e){var n=null==e?void 0:e.getAttribute("data-accordion-options"),i=n?JSON.parse(n):{};t.selectable.push({el:e,options:r({},i),listeners:[]})})),this.selectable.length&&this.selectable.forEach((function(e){e.el.querySelectorAll(".accordion-selectable").forEach((function(n){var i=function(i){return t.onSelectableClick(i,e,n)};n.addEventListener("click",i),e.listeners.push({el:n,listener:i})}))}))},e.toggleSelected=function(t,e){e.classList.contains("selected")?e.classList.remove("selected"):(t.el.querySelectorAll(".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.onSelectableClick=function(t,n,i){t.stopPropagation(),e.toggleSelected(n,i)},e}(s(n(287)).default);window.addEventListener("load",(function(){a.autoInit(),document.querySelectorAll(".accordion-treeview-root").length&&a.treeView()})),"undefined"!=typeof window&&(window.HSAccordion=a),e.default=a},287:(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},302: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 .accordion-item.active")&&this.group.querySelector(":scope > .accordion-item.active")!==this.el&&window.$hsAccordionCollection.find((function(t){return t.element.el===e.group.querySelector(":scope > .accordion-item.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.accordion.item",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="none",e.content.style.height="",e.fireEvent("close",e.el),(0,l.dispatch)("close.accordion.item",e.el,e.el)}))},e.prototype.update=function(){var t=this;if(this.group=this.el.closest(".accordion")||null,!this.group)return!1;this.isAlwaysOpened=this.group.hasAttribute("data-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.prototype.destroy=function(){var t,n=this;(null===(t=null==e?void 0:e.selectable)||void 0===t?void 0:t.length)&&e.selectable.forEach((function(t){t.listeners.forEach((function(t){var e=t.el,n=t.listener;e.removeEventListener("click",n)}))})),this.onToggleClickListener&&this.toggle.removeEventListener("click",this.onToggleClickListener),this.toggle=null,this.content=null,this.group=null,this.onToggleClickListener=null,window.$hsAccordionCollection=window.$hsAccordionCollection.filter((function(t){return t.element.el!==n.el}))},e.findInCollection=function(t){return window.$hsAccordionCollection.find((function(n){return t instanceof e?n.element.el===t.el:"string"==typeof t?n.element.el===document.querySelector(t):n.element.el===t}))||null},e.autoInit=function(){window.$hsAccordionCollection||(window.$hsAccordionCollection=[]),window.$hsAccordionCollection&&(window.$hsAccordionCollection=window.$hsAccordionCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll(".accordion-item: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.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 n=e.findInCollection(t);n&&"block"!==n.element.content.style.display&&n.element.show()},e.hide=function(t){var n=e.findInCollection(t),i=n?window.getComputedStyle(n.element.content):null;n&&"none"!==i.display&&n.element.hide()},e.treeView=function(){var t=this;if(!document.querySelectorAll(".accordion-treeview-root").length)return!1;this.selectable=[],document.querySelectorAll(".accordion-treeview-root").forEach((function(e){var n=null==e?void 0:e.getAttribute("data-accordion-options"),i=n?JSON.parse(n):{};t.selectable.push({el:e,options:r({},i),listeners:[]})})),this.selectable.length&&this.selectable.forEach((function(e){e.el.querySelectorAll(".accordion-selectable").forEach((function(n){var i=function(i){return t.onSelectableClick(i,e,n)};n.addEventListener("click",i),e.listeners.push({el:n,listener:i})}))}))},e.toggleSelected=function(t,e){e.classList.contains("selected")?e.classList.remove("selected"):(t.el.querySelectorAll(".accordion-selectable").forEach((function(t){return t.classList.remove("selected")})),e.classList.add("selected"))},e.on=function(t,n,i){var o=e.findInCollection(n);o&&(o.element.events[t]=i)},e.onSelectableClick=function(t,n,i){t.stopPropagation(),e.toggleSelected(n,i)},e}(s(n(287)).default);window.addEventListener("load",(function(){a.autoInit(),document.querySelectorAll(".accordion-treeview-root").length&&a.treeView()})),"undefined"!=typeof window&&(window.HSAccordion=a),e.default=a},287:(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},302:function(t,e,n){ /* * HSCarousel - * @version: 2.6.0 + * @version: 2.7.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;nt?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(".snap-before"),e=this.inner.querySelector(".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(".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;this.onDotClickListener=function(){return n.dotClick(e)},t.addEventListener("click",this.onDotClickListener)},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.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.setIndex=function(t){this.currentIndex=t,this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()},e.prototype.recalculateWidth=function(){this.sliderWidth=this.inner.parentElement.getBoundingClientRect().width,this.calculateWidth(),this.sliderWidth!==this.inner.parentElement.getBoundingClientRect().width&&this.recalculateWidth()},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.destroy=function(){var t,e,n,i=this;(this.loadingClassesAdd&&("string"==typeof this.loadingClassesAdd?this.inner.classList.remove(this.loadingClassesAdd):(t=this.inner.classList).remove.apply(t,this.loadingClassesAdd)),this.inner&&this.afterLoadingClassesAdd&&setTimeout((function(){var t;"string"==typeof i.afterLoadingClassesAdd?i.inner.classList.remove(i.afterLoadingClassesAdd):(t=i.inner.classList).remove.apply(t,i.afterLoadingClassesAdd)})),this.el.classList.remove("init"),this.inner.classList.remove("dragging"),this.slides.forEach((function(t){return t.classList.remove("active")})),(null===(e=null==this?void 0:this.dotsItems)||void 0===e?void 0:e.length)&&this.dotsItems.forEach((function(t){return t.classList.remove("active")})),this.prev.classList.remove("disabled"),this.next.classList.remove("disabled"),this.inner.style.width="",this.slides.forEach((function(t){return t.style.width=""})),this.isSnap||(this.inner.style.transform=""),this.isAutoHeight&&(this.inner.style.height=""),this.prev.removeEventListener("click",this.onPrevClickListener),this.next.removeEventListener("click",this.onNextClickListener),this.container.removeEventListener("scroll",this.onContainerScrollListener),this.el.removeEventListener("touchstart",this.onElementTouchStartListener),this.el.removeEventListener("touchend",this.onElementTouchEndListener),this.inner.removeEventListener("mousedown",this.onInnerMouseDownListener),this.inner.removeEventListener("touchstart",this.onInnerTouchStartListener),document.removeEventListener("mousemove",this.onDocumentMouseMoveListener),document.removeEventListener("touchmove",this.onDocumentTouchMoveListener),document.removeEventListener("mouseup",this.onDocumentMouseUpListener),document.removeEventListener("touchend",this.onDocumentTouchEndListener),this.inner.querySelectorAll("a:not(.prevented-click)").forEach((function(t){t.classList.remove("prevented-click"),t.removeEventListener("click",i.removeClickEventWhileDragging)})),(null===(n=null==this?void 0:this.dotsItems)||void 0===n?void 0:n.length)||this.dots.querySelectorAll(":scope > *").length)&&(((null==this?void 0:this.dotsItems)||this.dots.querySelectorAll(":scope > *")).forEach((function(t){return t.removeEventListener("click",i.onDotClickListener)})),this.dots.innerHTML=null);this.inner.querySelector(".snap-before").remove(),this.inner.querySelector(".snap-after").remove(),this.dotsItems=null,this.isDragging=!1,this.dragStartX=null,this.initialTranslateX=null,window.$hsCarouselCollection=window.$hsCarouselCollection.filter((function(t){return t.element.el!==i.el}))},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=[]),window.$hsCarouselCollection&&(window.$hsCarouselCollection=window.$hsCarouselCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll("[data-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},763: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?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]:a.BREAKPOINTS[i])&&(n=t.slidesQty[i])})),n}return this.slidesQty},e.prototype.buildSnapSpacers=function(){var t=this.inner.querySelector(".snap-before"),e=this.inner.querySelector(".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(".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;this.onDotClickListener=function(){return n.dotClick(e)},t.addEventListener("click",this.onDotClickListener)},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.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.setIndex=function(t){this.currentIndex=t,this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()},e.prototype.recalculateWidth=function(){this.sliderWidth=this.inner.parentElement.getBoundingClientRect().width,this.calculateWidth(),this.sliderWidth!==this.inner.parentElement.getBoundingClientRect().width&&this.recalculateWidth()},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.destroy=function(){var t,e,n,i=this;(this.loadingClassesAdd&&("string"==typeof this.loadingClassesAdd?this.inner.classList.remove(this.loadingClassesAdd):(t=this.inner.classList).remove.apply(t,this.loadingClassesAdd)),this.inner&&this.afterLoadingClassesAdd&&setTimeout((function(){var t;"string"==typeof i.afterLoadingClassesAdd?i.inner.classList.remove(i.afterLoadingClassesAdd):(t=i.inner.classList).remove.apply(t,i.afterLoadingClassesAdd)})),this.el.classList.remove("init"),this.inner.classList.remove("dragging"),this.slides.forEach((function(t){return t.classList.remove("active")})),(null===(e=null==this?void 0:this.dotsItems)||void 0===e?void 0:e.length)&&this.dotsItems.forEach((function(t){return t.classList.remove("active")})),this.prev.classList.remove("disabled"),this.next.classList.remove("disabled"),this.inner.style.width="",this.slides.forEach((function(t){return t.style.width=""})),this.isSnap||(this.inner.style.transform=""),this.isAutoHeight&&(this.inner.style.height=""),this.prev.removeEventListener("click",this.onPrevClickListener),this.next.removeEventListener("click",this.onNextClickListener),this.container.removeEventListener("scroll",this.onContainerScrollListener),this.el.removeEventListener("touchstart",this.onElementTouchStartListener),this.el.removeEventListener("touchend",this.onElementTouchEndListener),this.inner.removeEventListener("mousedown",this.onInnerMouseDownListener),this.inner.removeEventListener("touchstart",this.onInnerTouchStartListener),document.removeEventListener("mousemove",this.onDocumentMouseMoveListener),document.removeEventListener("touchmove",this.onDocumentTouchMoveListener),document.removeEventListener("mouseup",this.onDocumentMouseUpListener),document.removeEventListener("touchend",this.onDocumentTouchEndListener),this.inner.querySelectorAll("a:not(.prevented-click)").forEach((function(t){t.classList.remove("prevented-click"),t.removeEventListener("click",i.removeClickEventWhileDragging)})),(null===(n=null==this?void 0:this.dotsItems)||void 0===n?void 0:n.length)||this.dots.querySelectorAll(":scope > *").length)&&(((null==this?void 0:this.dotsItems)||this.dots.querySelectorAll(":scope > *")).forEach((function(t){return t.removeEventListener("click",i.onDotClickListener)})),this.dots.innerHTML=null);this.inner.querySelector(".snap-before").remove(),this.inner.querySelector(".snap-after").remove(),this.dotsItems=null,this.isDragging=!1,this.dragStartX=null,this.initialTranslateX=null,window.$hsCarouselCollection=window.$hsCarouselCollection.filter((function(t){return t.element.el!==i.el}))},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=[]),window.$hsCarouselCollection&&(window.$hsCarouselCollection=window.$hsCarouselCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll("[data-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}(s(n(287)).default);window.addEventListener("load",(function(){c.autoInit()})),"undefined"!=typeof window&&(window.HSCarousel=c),e.default=c},763:function(t,e,n){ /* * HSCollapse - * @version: 2.6.0 + * @version: 2.7.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.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(806),l=r(n(287)),a=r(n(753)),c=function(t){function e(e,n,i){var o=t.call(this,e,n,i)||this;return o.contentId=o.el.dataset.collapse,o.content=document.querySelector(o.contentId),o.animationInProcess=!1,o.content&&o.init(),o}return o(e,t),e.prototype.elementClick=function(){this.content.classList.contains("open")?this.hide():this.show()},e.prototype.init=function(){var t,e=this;this.createCollection(window.$hsCollapseCollection,this),this.onElementClickListener=function(){return e.elementClick()},(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.onElementClickListener)},e.prototype.hideAllMegaMenuItems=function(){this.content.querySelectorAll("mega-menu-content.block").forEach((function(t){t.classList.remove("block"),t.classList.add("hidden")}))},e.prototype.closeDropdowns=function(){this.content&&this.content.querySelectorAll(".dropdown").forEach((function(t){try{var e=a.default.getInstance(t,!0);if(!(null==e?void 0:e.element))return;t instanceof HTMLElement&&t.classList.contains("open")&&e.element.close(!1)}catch(t){console.warn("Error closing dropdown:",t)}}))},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.collapse",e.el,e.el)})),(0,s.afterTransition)(this.content,(function(){e.content.style.height="",e.fireEvent("open",e.el),(0,s.dispatch)("open.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.collapse",e.el,e.el),e.animationInProcess=!1})),this.content.querySelectorAll(".mega-menu-content.block").length&&this.hideAllMegaMenuItems(),this.closeDropdowns()},e.prototype.destroy=function(){var t=this;this.el.removeEventListener("click",this.onElementClickListener),this.content=null,this.animationInProcess=!1,window.$hsCollapseCollection=window.$hsCollapseCollection.filter((function(e){return e.element.el!==t.el}))},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=[]),window.$hsCollapseCollection&&(window.$hsCollapseCollection=window.$hsCollapseCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll(".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}(l.default);window.addEventListener("load",(function(){c.autoInit()})),"undefined"!=typeof window&&(window.HSCollapse=c),e.default=c},75: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(806),l=r(n(287)),a=r(n(753)),c=function(t){function e(e,n,i){var o=t.call(this,e,n,i)||this;return o.contentId=o.el.dataset.collapse,o.content=document.querySelector(o.contentId),o.animationInProcess=!1,o.content&&o.init(),o}return o(e,t),e.prototype.elementClick=function(){this.content.classList.contains("open")?this.hide():this.show()},e.prototype.init=function(){var t,e=this;this.createCollection(window.$hsCollapseCollection,this),this.onElementClickListener=function(){return e.elementClick()},(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.onElementClickListener)},e.prototype.hideAllMegaMenuItems=function(){this.content.querySelectorAll(".mega-menu-content.block").forEach((function(t){t.classList.remove("block"),t.classList.add("hidden")}))},e.prototype.closeDropdowns=function(){this.content&&this.content.querySelectorAll(".dropdown").forEach((function(t){try{var e=a.default.getInstance(t,!0);if(!(null==e?void 0:e.element))return;t instanceof HTMLElement&&t.classList.contains("open")&&e.element.close(!1)}catch(t){console.warn("Error closing dropdown:",t)}}))},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.collapse",e.el,e.el)})),(0,s.afterTransition)(this.content,(function(){e.content.style.height="",e.fireEvent("open",e.el),(0,s.dispatch)("open.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.collapse",e.el,e.el),e.animationInProcess=!1})),this.content.querySelectorAll(".mega-menu-content.block").length&&this.hideAllMegaMenuItems(),this.closeDropdowns()},e.prototype.destroy=function(){var t=this;this.el.removeEventListener("click",this.onElementClickListener),this.content=null,this.animationInProcess=!1,window.$hsCollapseCollection=window.$hsCollapseCollection.filter((function(e){return e.element.el!==t.el}))},e.findInCollection=function(t){return window.$hsCollapseCollection.find((function(n){return t instanceof e?n.element.el===t.el:"string"==typeof t?n.element.el===document.querySelector(t):n.element.el===t}))||null},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=[]),window.$hsCollapseCollection&&(window.$hsCollapseCollection=window.$hsCollapseCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll(".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 n=e.findInCollection(t);n&&n.element.content.classList.contains("hidden")&&n.element.show()},e.hide=function(t){var n=e.findInCollection(t);n&&!n.element.content.classList.contains("hidden")&&n.element.hide()},e.on=function(t,n,i){var o=e.findInCollection(n);o&&(o.element.events[t]=i)},e}(l.default);window.addEventListener("load",(function(){c.autoInit()})),"undefined"!=typeof window&&(window.HSCollapse=c),e.default=c},75:function(t,e,n){ /* * HSComboBox - * @version: 2.6.0 + * @version: 2.7.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&&o[o.length-1])||6!==l[0]&&2!==l[0])){r=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]\n
\n \n \n
\n ',_.outputEmptyTemplate=null!==(m=null==M?void 0:M.outputEmptyTemplate)&&void 0!==m?m:'',_.outputLoaderTemplate=null!==(g=null==M?void 0:M.outputLoaderTemplate)&&void 0!==g?g:'',_.groupingType=null!==(y=null==M?void 0:M.groupingType)&&void 0!==y?y:null,_.groupingTitleTemplate=null!==(w=null==M?void 0:M.groupingTitleTemplate)&&void 0!==w?w:"default"===_.groupingType?'
':'',_.tabsWrapperTemplate=null!==(b=null==M?void 0:M.tabsWrapperTemplate)&&void 0!==b?b:'
',_.preventSelection=null!==(C=null==M?void 0:M.preventSelection)&&void 0!==C&&C,_.preventAutoPosition=null!==(S=null==M?void 0:M.preventAutoPosition)&&void 0!==S&&S,_.isOpenOnFocus=null!==(L=null==M?void 0:M.isOpenOnFocus)&&void 0!==L&&L,_.input=null!==(I=_.el.querySelector("[data-combo-box-input]"))&&void 0!==I?I:null,_.output=null!==(E=_.el.querySelector("[data-combo-box-output]"))&&void 0!==E?E:null,_.itemsWrapper=null!==(T=_.el.querySelector("[data-combo-box-output-items-wrapper]"))&&void 0!==T?T:null,_.items=null!==(x=Array.from(_.el.querySelectorAll("[data-combo-box-output-item]")))&&void 0!==x?x:[],_.tabs=[],_.toggle=null!==(k=_.el.querySelector("[data-combo-box-toggle]"))&&void 0!==k?k:null,_.toggleClose=null!==(O=_.el.querySelector("[data-combo-box-close]"))&&void 0!==O?O:null,_.toggleOpen=null!==(A=_.el.querySelector("[data-combo-box-open]"))&&void 0!==A?A:null,_.outputPlaceholder=null,_.selected=_.value=null!==(P=_.el.querySelector("[data-combo-box-input]").value)&&void 0!==P?P:"",_.currentData=null,_.isOpened=!1,_.isCurrent=!1,_.animationInProcess=!1,_.selectedGroup="all",_.init(),_}return o(e,t),e.prototype.inputFocus=function(){this.isOpened||(this.setResultAndRender(),this.open())},e.prototype.inputInput=function(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()},e.prototype.toggleClick=function(){this.isOpened?this.close():this.open(this.toggle.getAttribute("data-combo-box-toggle"))},e.prototype.toggleCloseClick=function(){this.close()},e.prototype.toggleOpenClick=function(){this.open()},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.getNestedProperty=function(t,e){return e.split(".").reduce((function(t,e){return t&&t[e]}),t)},e.prototype.setValue=function(t,e){void 0===e&&(e=null),this.selected=t,this.value=t,this.input.value=t,e&&(this.currentData=e),this.fireEvent("select",this.currentData),(0,u.dispatch)("select.combobox",this.el,this.currentData)},e.prototype.setValueAndOpen=function(t){this.value=t,this.items.length&&this.setItemsVisibility()},e.prototype.setValueAndClear=function(t,e){void 0===e&&(e=null),t?this.setValue(t,e):this.setValue(this.selected,e),this.outputPlaceholder&&this.destroyOutputPlaceholder()},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.setResultAndRender=function(t){void 0===t&&(t="");var e=this.preventVisibility?this.input.value:t;this.setResults(e),(this.apiSearchQuery||this.apiSearchPath||this.apiSearchDefaultPath)&&this.itemsFromJson()},e.prototype.setResults=function(t){this.value=t,this.resultItems(),this.hasVisibleItems()?this.destroyOutputPlaceholder():this.buildOutputPlaceholder()},e.prototype.setGroups=function(){var t=[];this.items.forEach((function(e){var n=JSON.parse(e.getAttribute("data-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.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.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-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-combo-box-group-title]").forEach((function(e){var n=e.getAttribute("data-combo-box-group-title");t.items.filter((function(t){return JSON.parse(t.getAttribute("data-combo-box-output-item")).group.name===n&&"block"===t.style.display})).length?e.style.display="block":e.style.display="none"}))},e.prototype.isTextExists=function(t,e){var n=e.map((function(t){return t.toLowerCase()}));return Array.from(t.querySelectorAll("[data-combo-box-search-text]")).some((function(t){return n.includes(t.getAttribute("data-combo-box-search-text").toLowerCase())}))},e.prototype.isTextExistsAny=function(t,e){return Array.from(t.querySelectorAll("[data-combo-box-search-text]")).some((function(t){return t.getAttribute("data-combo-box-search-text").toLowerCase().includes(e.toLowerCase())}))},e.prototype.hasVisibleItems=function(){return!!this.items.length&&this.items.some((function(t){return"block"===t.style.display}))},e.prototype.valuesBySelector=function(t){return Array.from(t.querySelectorAll("[data-combo-box-search-text]")).reduce((function(t,e){return a(a([],t,!0),[e.getAttribute("data-combo-box-search-text")],!1)}),[])},e.prototype.sortItems=function(){return this.items.sort((function(t,e){var n=t.querySelector("[data-combo-box-value]").getAttribute("data-combo-box-search-text"),i=e.querySelector("[data-combo-box-value]").getAttribute("data-combo-box-search-text");return ni?1:0}))},e.prototype.buildInput=function(){var t=this;this.isOpenOnFocus&&(this.onInputFocusListener=function(){return t.inputFocus()},this.input.addEventListener("focus",this.onInputFocusListener)),this.onInputInputListener=(0,u.debounce)((function(e){return t.inputInput(e)})),this.input.addEventListener("input",this.onInputInputListener)},e.prototype.buildItems=function(){return s(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return this.output.role="listbox",this.output.tabIndex=-1,this.output.ariaOrientation="vertical",this.apiUrl?[4,this.itemsFromJson()]:[3,2];case 1:return t.sent(),[3,3];case 2:this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="",this.itemsFromHtml(),t.label=3;case 3:return this.items[0].classList.contains("selected")&&(this.currentData=JSON.parse(this.items[0].getAttribute("data-combo-box-item-stored-data"))),[2]}}))}))},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.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.onToggleClickListener=function(){return o.toggleClick()},this.toggle.addEventListener("click",this.onToggleClickListener)},e.prototype.buildToggleClose=function(){var t=this;this.onToggleCloseClickListener=function(){return t.toggleCloseClick()},this.toggleClose.addEventListener("click",this.onToggleCloseClickListener)},e.prototype.buildToggleOpen=function(){var t=this;this.onToggleOpenClickListener=function(){return t.toggleOpenClick()},this.toggleOpen.addEventListener("click",this.onToggleOpenClickListener)},e.prototype.buildOutputPlaceholder=function(){this.outputPlaceholder||(this.outputPlaceholder=(0,u.htmlToElement)(this.outputEmptyTemplate)),this.appendItemsToWrapper(this.outputPlaceholder)},e.prototype.destroyOutputLoader=function(){this.outputLoader&&this.outputLoader.remove(),this.outputLoader=null},e.prototype.itemRender=function(t){var e,n=this,i=t.querySelector("[data-combo-box-value]").getAttribute("data-combo-box-search-text"),o=null!==(e=JSON.parse(t.getAttribute("data-combo-box-item-stored-data")))&&void 0!==e?e:null;this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t),this.preventSelection||t.addEventListener("click",(function(){n.close(i,o),n.setSelectedByValue(n.valuesBySelector(t))}))},e.prototype.plainRender=function(t){var e=this;t.forEach((function(t){e.itemRender(t)}))},e.prototype.jsonItemsRender=function(t){var e=this;t.forEach((function(t,n){var i=(0,u.htmlToElement)(e.outputItemTemplate);i.setAttribute("data-combo-box-item-stored-data",JSON.stringify(t)),i.querySelectorAll("[data-combo-box-output-item-field]").forEach((function(n){var i=e.getNestedProperty(t,n.getAttribute("data-combo-box-output-item-field")),o=n.hasAttribute("data-combo-box-output-item-hide-if-empty");n.textContent=null!=i?i:"",!i&&o&&(n.style.display="none")})),i.querySelectorAll("[data-combo-box-search-text]").forEach((function(n){var i=e.getNestedProperty(t,n.getAttribute("data-combo-box-output-item-field"));n.setAttribute("data-combo-box-search-text",null!=i?i:"")})),i.querySelectorAll("[data-combo-box-output-item-attr]").forEach((function(e){JSON.parse(e.getAttribute("data-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-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-combo-box-value]").getAttribute("data-combo-box-search-text"),JSON.parse(i.getAttribute("data-combo-box-item-stored-data"))),e.setSelectedByValue(e.valuesBySelector(i))})),e.appendItemsToWrapper(i)}))},e.prototype.groupDefaultRender=function(){var t=this;this.groups.forEach((function(e){var n=(0,u.htmlToElement)(t.groupingTitleTemplate);n.setAttribute("data-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-combo-box-output-item")).group.name===e.name}));t.plainRender(i)}))},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-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-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-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-combo-box-group-title")===t.selectedGroup}));t.tabs.forEach((function(t){return t.classList.remove("active")})),n.classList.add("active"),t.setItemsVisibility()}))}))},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.itemsFromJson=function(){return s(this,void 0,void 0,(function(){var t,e,n,i,o,r,s=this;return l(this,(function(l){switch(l.label){case 0:this.buildOutputLoader(),l.label=1;case 1:return l.trys.push([1,4,,5]),t="".concat(this.apiQuery),e=void 0,n=void 0,i=this.apiUrl,!this.apiSearchQuery&&this.apiSearchPath?(n=this.apiSearchDefaultPath&&""===this.value?"/".concat(this.apiSearchDefaultPath):"/".concat(this.apiSearchPath,"/").concat(this.value.toLowerCase()),(this.apiSearchPath||this.apiSearchDefaultPath)&&(i+=n)):(e="".concat(this.apiSearchQuery,"=").concat(this.value.toLowerCase()),this.apiQuery&&this.apiSearchQuery?i+="?".concat(e,"&").concat(t):this.apiQuery?i+="?".concat(t):this.apiSearchQuery&&(i+="?".concat(e))),[4,fetch(i,this.apiHeaders)];case 2:return[4,l.sent().json()];case 3:return o=l.sent(),this.apiDataPart&&(o=o[this.apiDataPart]),(this.apiSearchQuery||this.apiSearchPath)&&(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)(s.groupingTitleTemplate);e.setAttribute("data-combo-box-group-title",t.name),e.classList.add("--exclude-accessibility"),e.innerText=t.title;var n=o.filter((function(e){return e[s.apiGroupField]===t.name}));s.itemsWrapper?s.itemsWrapper.append(e):s.output.append(e),s.jsonItemsRender(n)}))):this.jsonItemsRender(o),this.setResults(this.input.value),[3,5];case 4:return r=l.sent(),console.error(r),this.buildOutputPlaceholder(),[3,5];case 5:return this.destroyOutputLoader(),[2]}}))}))},e.prototype.appendItemsToWrapper=function(t){this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t)},e.prototype.resultItems=function(){if(!this.items.length)return!1;this.setItemsVisibility(),this.setSelectedByValue([this.selected])},e.prototype.destroyOutputPlaceholder=function(){this.outputPlaceholder&&this.outputPlaceholder.remove(),this.outputPlaceholder=null},e.prototype.getCurrentData=function(){return this.currentData},e.prototype.setCurrent=function(){window.$hsComboBoxCollection.length&&(window.$hsComboBoxCollection.map((function(t){return t.element.isCurrent=!1})),this.isCurrent=!0)},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.close=function(t,e){var n,i,o=this;return void 0===e&&(e=null),!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t,e),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),!1):(this.animationInProcess=!0,(null===(n=null==this?void 0:this.input)||void 0===n?void 0:n.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,u.afterTransition)(this.output,(function(){o.output.style.display="none",o.setValueAndClear(t,e||null),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.prototype.destroy=function(){var t=this;this.input.removeEventListener("focus",this.onInputFocusListener),this.input.removeEventListener("input",this.onInputInputListener),this.toggle.removeEventListener("click",this.onToggleClickListener),this.toggleClose&&this.toggleClose.removeEventListener("click",this.onToggleCloseClickListener),this.toggleOpen&&this.toggleOpen.removeEventListener("click",this.onToggleOpenClickListener),this.el.classList.remove("has-value","active"),this.items.length&&this.items.forEach((function(t){t.classList.remove("selected"),t.style.display=""})),this.output.removeAttribute("role"),this.output.removeAttribute("tabindex"),this.output.removeAttribute("aria-orientation"),this.outputLoader&&(this.outputLoader.remove(),this.outputLoader=null),this.outputPlaceholder&&(this.outputPlaceholder.remove(),this.outputPlaceholder=null),this.apiUrl&&(this.output.innerHTML=""),this.items=[],window.$hsComboBoxCollection=window.$hsComboBoxCollection.filter((function(e){return e.element.el!==t.el}))},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=[],window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)}))),window.$hsComboBoxCollection&&(window.$hsComboBoxCollection=window.$hsComboBoxCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll("[data-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-combo-box"),i=n?JSON.parse(n):{};new e(t,i)}}))},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-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-combo-box-value]").getAttribute("data-combo-box-search-text"),t&&t.classList.remove("combo-box-output-item-highlighted"),e.classList.add("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(".combo-box-output-item-highlighted");l||s[0].classList.add("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])){r=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]\n
\n \n \n
\n ',B.outputEmptyTemplate=null!==(g=null==q?void 0:q.outputEmptyTemplate)&&void 0!==g?g:'',B.outputLoaderTemplate=null!==(y=null==q?void 0:q.outputLoaderTemplate)&&void 0!==y?y:'',B.groupingType=null!==(w=null==q?void 0:q.groupingType)&&void 0!==w?w:null,B.groupingTitleTemplate=null!==(b=null==q?void 0:q.groupingTitleTemplate)&&void 0!==b?b:"default"===B.groupingType?'
':'',B.tabsWrapperTemplate=null!==(C=null==q?void 0:q.tabsWrapperTemplate)&&void 0!==C?C:'
',B.preventSelection=null!==(S=null==q?void 0:q.preventSelection)&&void 0!==S&&S,B.preventAutoPosition=null!==(L=null==q?void 0:q.preventAutoPosition)&&void 0!==L&&L,B.isOpenOnFocus=null!==(I=null==q?void 0:q.isOpenOnFocus)&&void 0!==I&&I,B.input=null!==(E=B.el.querySelector("[data-combo-box-input]"))&&void 0!==E?E:null,B.output=null!==(T=B.el.querySelector("[data-combo-box-output]"))&&void 0!==T?T:null,B.itemsWrapper=null!==(x=B.el.querySelector("[data-combo-box-output-items-wrapper]"))&&void 0!==x?x:null,B.items=null!==(k=Array.from(B.el.querySelectorAll("[data-combo-box-output-item]")))&&void 0!==k?k:[],B.tabs=[],B.toggle=null!==(O=B.el.querySelector("[data-combo-box-toggle]"))&&void 0!==O?O:null,B.toggleClose=null!==(A=B.el.querySelector("[data-combo-box-close]"))&&void 0!==A?A:null,B.toggleOpen=null!==(P=B.el.querySelector("[data-combo-box-open]"))&&void 0!==P?P:null,B.outputPlaceholder=null,B.selected=B.value=null!==(_=B.el.querySelector("[data-combo-box-input]").value)&&void 0!==_?_:"",B.currentData=null,B.isOpened=!1,B.isCurrent=!1,B.animationInProcess=!1,B.selectedGroup="all",B.init(),B}return o(e,t),e.prototype.inputFocus=function(){this.isOpened||(this.setResultAndRender(),this.open())},e.prototype.inputInput=function(t){var e=t.target.value.trim();e.length<=this.minSearchLength?this.setResultAndRender(""):this.setResultAndRender(e),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),this.isOpened||this.open()},e.prototype.toggleClick=function(){this.isOpened?this.close():this.open(this.toggle.getAttribute("data-combo-box-toggle"))},e.prototype.toggleCloseClick=function(){this.close()},e.prototype.toggleOpenClick=function(){this.open()},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.getNestedProperty=function(t,e){return e.split(".").reduce((function(t,e){return t&&t[e]}),t)},e.prototype.setValue=function(t,e){void 0===e&&(e=null),this.selected=t,this.value=t,this.input.value=t,e&&(this.currentData=e),this.fireEvent("select",this.currentData),(0,u.dispatch)("select.combobox",this.el,this.currentData)},e.prototype.setValueAndOpen=function(t){this.value=t,this.items.length&&this.setItemsVisibility()},e.prototype.setValueAndClear=function(t,e){void 0===e&&(e=null),t?this.setValue(t,e):this.setValue(this.selected,e),this.outputPlaceholder&&this.destroyOutputPlaceholder()},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.setResultAndRender=function(t){void 0===t&&(t="");var e=this.preventVisibility?this.input.value:t;this.setResults(e),(this.apiSearchQuery||this.apiSearchPath||this.apiSearchDefaultPath)&&this.itemsFromJson(),this.isSearchLengthExceeded=""===e},e.prototype.setResults=function(t){this.value=t,this.resultItems(),this.hasVisibleItems()?this.destroyOutputPlaceholder():this.buildOutputPlaceholder()},e.prototype.setGroups=function(){var t=[];this.items.forEach((function(e){var n=JSON.parse(e.getAttribute("data-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.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.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-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-combo-box-group-title]").forEach((function(e){var n=e.getAttribute("data-combo-box-group-title");t.items.filter((function(t){return JSON.parse(t.getAttribute("data-combo-box-output-item")).group.name===n&&"block"===t.style.display})).length?e.style.display="block":e.style.display="none"}))},e.prototype.isTextExists=function(t,e){var n=e.map((function(t){return t.toLowerCase()}));return Array.from(t.querySelectorAll("[data-combo-box-search-text]")).some((function(t){return n.includes(t.getAttribute("data-combo-box-search-text").toLowerCase())}))},e.prototype.isTextExistsAny=function(t,e){return Array.from(t.querySelectorAll("[data-combo-box-search-text]")).some((function(t){return t.getAttribute("data-combo-box-search-text").toLowerCase().includes(e.toLowerCase())}))},e.prototype.hasVisibleItems=function(){return!!this.items.length&&this.items.some((function(t){return"block"===t.style.display}))},e.prototype.valuesBySelector=function(t){return Array.from(t.querySelectorAll("[data-combo-box-search-text]")).reduce((function(t,e){return a(a([],t,!0),[e.getAttribute("data-combo-box-search-text")],!1)}),[])},e.prototype.sortItems=function(){return this.items.sort((function(t,e){var n=t.querySelector("[data-combo-box-value]").getAttribute("data-combo-box-search-text"),i=e.querySelector("[data-combo-box-value]").getAttribute("data-combo-box-search-text");return ni?1:0}))},e.prototype.buildInput=function(){var t=this;this.isOpenOnFocus&&(this.onInputFocusListener=function(){return t.inputFocus()},this.input.addEventListener("focus",this.onInputFocusListener)),this.onInputInputListener=(0,u.debounce)((function(e){return t.inputInput(e)})),this.input.addEventListener("input",this.onInputInputListener)},e.prototype.buildItems=function(){return s(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return this.output.role="listbox",this.output.tabIndex=-1,this.output.ariaOrientation="vertical",this.apiUrl?[4,this.itemsFromJson()]:[3,2];case 1:return t.sent(),[3,3];case 2:this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="",this.itemsFromHtml(),t.label=3;case 3:return this.items[0].classList.contains("selected")&&(this.currentData=JSON.parse(this.items[0].getAttribute("data-combo-box-item-stored-data"))),[2]}}))}))},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.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.onToggleClickListener=function(){return o.toggleClick()},this.toggle.addEventListener("click",this.onToggleClickListener)},e.prototype.buildToggleClose=function(){var t=this;this.onToggleCloseClickListener=function(){return t.toggleCloseClick()},this.toggleClose.addEventListener("click",this.onToggleCloseClickListener)},e.prototype.buildToggleOpen=function(){var t=this;this.onToggleOpenClickListener=function(){return t.toggleOpenClick()},this.toggleOpen.addEventListener("click",this.onToggleOpenClickListener)},e.prototype.buildOutputPlaceholder=function(){this.outputPlaceholder||(this.outputPlaceholder=(0,u.htmlToElement)(this.outputEmptyTemplate)),this.appendItemsToWrapper(this.outputPlaceholder)},e.prototype.destroyOutputLoader=function(){this.outputLoader&&this.outputLoader.remove(),this.outputLoader=null},e.prototype.itemRender=function(t){var e,n=this,i=t.querySelector("[data-combo-box-value]").getAttribute("data-combo-box-search-text"),o=null!==(e=JSON.parse(t.getAttribute("data-combo-box-item-stored-data")))&&void 0!==e?e:null;this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t),this.preventSelection||t.addEventListener("click",(function(){n.close(i,o),n.setSelectedByValue(n.valuesBySelector(t))}))},e.prototype.plainRender=function(t){var e=this;t.forEach((function(t){e.itemRender(t)}))},e.prototype.jsonItemsRender=function(t){var e=this;t.forEach((function(t,n){var i=(0,u.htmlToElement)(e.outputItemTemplate);i.setAttribute("data-combo-box-item-stored-data",JSON.stringify(t)),i.querySelectorAll("[data-combo-box-output-item-field]").forEach((function(n){var i=e.getNestedProperty(t,n.getAttribute("data-combo-box-output-item-field")),o=n.hasAttribute("data-combo-box-output-item-hide-if-empty");n.textContent=null!=i?i:"",!i&&o&&(n.style.display="none")})),i.querySelectorAll("[data-combo-box-search-text]").forEach((function(n){var i=e.getNestedProperty(t,n.getAttribute("data-combo-box-output-item-field"));n.setAttribute("data-combo-box-search-text",null!=i?i:"")})),i.querySelectorAll("[data-combo-box-output-item-attr]").forEach((function(e){JSON.parse(e.getAttribute("data-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-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-combo-box-value]").getAttribute("data-combo-box-search-text"),JSON.parse(i.getAttribute("data-combo-box-item-stored-data"))),e.setSelectedByValue(e.valuesBySelector(i))})),e.appendItemsToWrapper(i)}))},e.prototype.groupDefaultRender=function(){var t=this;this.groups.forEach((function(e){var n=(0,u.htmlToElement)(t.groupingTitleTemplate);n.setAttribute("data-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-combo-box-output-item")).group.name===e.name}));t.plainRender(i)}))},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-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-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-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-combo-box-group-title")===t.selectedGroup}));t.tabs.forEach((function(t){return t.classList.remove("active")})),n.classList.add("active"),t.setItemsVisibility()}))}))},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.itemsFromJson=function(){return s(this,void 0,void 0,(function(){var t,e,n,i,o,r,s=this;return l(this,(function(l){switch(l.label){case 0:if(this.isSearchLengthExceeded)return[2,!1];this.buildOutputLoader(),l.label=1;case 1:return l.trys.push([1,4,,5]),t="".concat(this.apiQuery),e=void 0,n=void 0,i=this.apiUrl,!this.apiSearchQuery&&this.apiSearchPath?(n=this.apiSearchDefaultPath&&""===this.value?"/".concat(this.apiSearchDefaultPath):"/".concat(this.apiSearchPath,"/").concat(this.value.toLowerCase()),(this.apiSearchPath||this.apiSearchDefaultPath)&&(i+=n)):(e="".concat(this.apiSearchQuery,"=").concat(this.value.toLowerCase()),this.apiQuery&&this.apiSearchQuery?i+="?".concat(e,"&").concat(t):this.apiQuery?i+="?".concat(t):this.apiSearchQuery&&(i+="?".concat(e))),[4,fetch(i,this.apiHeaders)];case 2:return[4,l.sent().json()];case 3:return o=l.sent(),this.apiDataPart&&(o=o[this.apiDataPart]),(this.apiSearchQuery||this.apiSearchPath)&&(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)(s.groupingTitleTemplate);e.setAttribute("data-combo-box-group-title",t.name),e.classList.add("--exclude-accessibility"),e.innerText=t.title;var n=o.filter((function(e){return e[s.apiGroupField]===t.name}));s.itemsWrapper?s.itemsWrapper.append(e):s.output.append(e),s.jsonItemsRender(n)}))):this.jsonItemsRender(o),this.setResults(this.input.value.length<=this.minSearchLength?"":this.input.value),[3,5];case 4:return r=l.sent(),console.error(r),this.buildOutputPlaceholder(),[3,5];case 5:return this.destroyOutputLoader(),[2]}}))}))},e.prototype.appendItemsToWrapper=function(t){this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t)},e.prototype.resultItems=function(){if(!this.items.length)return!1;this.setItemsVisibility(),this.setSelectedByValue([this.selected])},e.prototype.destroyOutputPlaceholder=function(){this.outputPlaceholder&&this.outputPlaceholder.remove(),this.outputPlaceholder=null},e.prototype.getCurrentData=function(){return this.currentData},e.prototype.setCurrent=function(){window.$hsComboBoxCollection.length&&(window.$hsComboBoxCollection.map((function(t){return t.element.isCurrent=!1})),this.isCurrent=!0)},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.close=function(t,e){var n,i,o=this;return void 0===e&&(e=null),!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(t,e),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),!1):(this.animationInProcess=!0,(null===(n=null==this?void 0:this.input)||void 0===n?void 0:n.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,u.afterTransition)(this.output,(function(){o.output.style.display="none",o.setValueAndClear(t,e||null),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.prototype.destroy=function(){var t=this;this.input.removeEventListener("focus",this.onInputFocusListener),this.input.removeEventListener("input",this.onInputInputListener),this.toggle.removeEventListener("click",this.onToggleClickListener),this.toggleClose&&this.toggleClose.removeEventListener("click",this.onToggleCloseClickListener),this.toggleOpen&&this.toggleOpen.removeEventListener("click",this.onToggleOpenClickListener),this.el.classList.remove("has-value","active"),this.items.length&&this.items.forEach((function(t){t.classList.remove("selected"),t.style.display=""})),this.output.removeAttribute("role"),this.output.removeAttribute("tabindex"),this.output.removeAttribute("aria-orientation"),this.outputLoader&&(this.outputLoader.remove(),this.outputLoader=null),this.outputPlaceholder&&(this.outputPlaceholder.remove(),this.outputPlaceholder=null),this.apiUrl&&(this.output.innerHTML=""),this.items=[],window.$hsComboBoxCollection=window.$hsComboBoxCollection.filter((function(e){return e.element.el!==t.el}))},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=[],window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)}))),window.$hsComboBoxCollection&&(window.$hsComboBoxCollection=window.$hsComboBoxCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll("[data-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-combo-box"),i=n?JSON.parse(n):{};new e(t,i)}}))},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-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-combo-box-value]").getAttribute("data-combo-box-search-text"),t&&t.classList.remove("combo-box-output-item-highlighted"),e.classList.add("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(".combo-box-output-item-highlighted");l||s[0].classList.add("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),e="".concat(this.target.id,"-").concat(this.count++);t.setAttribute("id",e),this.addToItems(t),this.limit&&this.items.length>=this.limit&&this.el.setAttribute("disabled","disabled"),this.fireEvent("copy",t),(0,l.dispatch)("copy.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)})),this.limit&&this.items.length>=this.limit&&this.el.setAttribute("disabled","disabled")},e.prototype.setTarget=function(){var t="string"==typeof this.targetSelector?document.querySelector(this.targetSelector).cloneNode(!0):this.targetSelector.cloneNode(!0);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-copy-markup-delete-item]");this.wrapper?this.wrapper.append(t):this.el.before(t),n&&(this.onDeleteItemButtonClickListener=function(){return e.deleteItemButtonClick(t)},n.addEventListener("click",this.onDeleteItemButtonClickListener)),this.items.push(t)},e.prototype.delete=function(t){if(t){var e=this.items.indexOf(t);-1!==e&&this.items.splice(e,1),t.remove(),this.fireEvent("delete",t),(0,l.dispatch)("delete.copyMarkup",t,t),this.limit&&this.items.length1&&(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"),this.onSinglePagingClickListener.push({id:t,fn:function(){return e.singlePagingClick(t)}}),i.addEventListener("click",this.onSinglePagingClickListener.find((function(e){return e.id===t})).fn),this.pagingPages.append(i)},e.prototype.onPageClick=function(t){this.dataTable.page(t-1).draw("page")},e.prototype.initRowSelecting=function(){var t=this;this.onRowSelectingAllChangeListener=function(){return t.rowSelectingAllChange()},this.rowSelectingAll.addEventListener("change",this.onRowSelectingAllChangeListener)},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=[]),window.$hsDataTableCollection&&(window.$hsDataTableCollection=window.$hsDataTableCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll("[data-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(287)).default);window.addEventListener("load",(function(){document.querySelectorAll("[data-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},753: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,t),u>2&&t.appendChild((0,a.htmlToElement)('...')));for(var p=u;p<=d;p++)this.buildPagingPage(p,t);d...')),this.buildPagingPage(l,t)),this.pagingPrevList.forEach((function(t){return e.disablePagingArrow(t,0===i)})),this.pagingNextList.forEach((function(t){return e.disablePagingArrow(t,i===o-1)})),this.pagingList.forEach((function(t){return e.hidePagingIfSinglePage(t)}))},e.prototype.buildPagingPage=function(t,e){var n=this,i=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),i===t-1&&o.classList.add("active"),this.onSinglePagingClickListener.push({el:o,fn:function(){return n.singlePagingClick(t)}}),o.addEventListener("click",this.onSinglePagingClickListener.find((function(t){return t.el===o})).fn),e.append(o)},e.prototype.onPageClick=function(t){this.dataTable.page(t-1).draw("page")},e.prototype.initRowSelecting=function(){var t=this;this.onRowSelectingAllChangeListener=function(){return t.rowSelectingAllChange()},this.rowSelectingAll.addEventListener("change",this.onRowSelectingAllChangeListener)},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.prototype.destroy=function(){var t=this;this.searches&&this.onSearchInputListener.forEach((function(t){var e=t.el,n=t.fn;return e.removeEventListener("click",n)})),this.pageEntitiesList&&this.onPageEntitiesChangeListener.forEach((function(t){var e=t.el,n=t.fn;return e.removeEventListener("change",n)})),this.pagingPagesList.length&&(this.onSinglePagingClickListener.forEach((function(t){var e=t.el,n=t.fn;return e.removeEventListener("click",n)})),this.pagingPagesList.forEach((function(t){return t.innerHTML=""}))),this.pagingPrevList.length&&this.onPagingPrevClickListener.forEach((function(t){var e=t.el,n=t.fn;return e.removeEventListener("click",n)})),this.pagingNextList.length&&this.onPagingNextClickListener.forEach((function(t){var e=t.el,n=t.fn;return e.removeEventListener("click",n)})),this.rowSelectingAll&&this.rowSelectingAll.removeEventListener("change",this.onRowSelectingAllChangeListener),this.dataTable.destroy(),this.rowSelectingAll=null,this.rowSelectingIndividual=null,window.$hsDataTableCollection=window.$hsDataTableCollection.filter((function(e){return e.element.el!==t.el}))},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=[]),window.$hsDataTableCollection&&(window.$hsDataTableCollection=window.$hsDataTableCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll("[data-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(287)).default);window.addEventListener("load",(function(){document.querySelectorAll("[data-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},753:function(t,e,n){ /* * HSDropdown - * @version: 2.6.0 + * @version: 2.7.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.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,o=0,r=e.length;o .dropdown-toggle")||o.el.querySelector(":scope > .dropdown-toggle-wrapper > .dropdown-toggle")||o.el.children[0],o.closers=Array.from(o.el.querySelectorAll(":scope .dropdown-close"))||null,o.menu=o.el.querySelector(":scope > .dropdown-menu"),o.eventMode=(0,l.getClassProperty)(o.el,"--trigger","click"),o.closeMode=(0,l.getClassProperty)(o.el,"--auto-close","true"),o.hasAutofocus=(0,l.stringToBoolean)((0,l.getClassProperty)(o.el,"--has-autofocus","true")||"true"),o.animationInProcess=!1,o.onCloserClickListener=[],o.toggle&&o.menu&&o.init(),o}return o(e,t),e.prototype.elementMouseEnter=function(){this.onMouseEnterHandler()},e.prototype.elementMouseLeave=function(){this.onMouseLeaveHandler()},e.prototype.toggleClick=function(t){this.onClickHandler(t)},e.prototype.toggleContextMenu=function(t){t.preventDefault(),this.onContextMenuHandler(t)},e.prototype.closerClick=function(){this.close()},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.onElementMouseEnterListener=function(){return t.elementMouseEnter()},this.onElementMouseLeaveListener=function(){return t.elementMouseLeave()},this.el.addEventListener("mouseenter",this.onElementMouseEnterListener),this.el.addEventListener("mouseleave",this.onElementMouseLeaveListener))},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"),"contextmenu"===this.eventMode?(this.onToggleContextMenuListener=function(t){return e.toggleContextMenu(t)},this.toggle.addEventListener("contextmenu",this.onToggleContextMenuListener)):(this.onToggleClickListener=function(t){return e.toggleClick(t)},this.toggle.addEventListener("click",this.onToggleClickListener))},e.prototype.buildMenu=function(){var t=this;this.menu.role=this.menu.getAttribute("role")||"menu";var e=this.menu.querySelectorAll('[role="menuitemcheckbox"]'),n=this.menu.querySelectorAll('[role="menuitemradio"]');e.forEach((function(e){return e.addEventListener("click",(function(){return t.selectCheckbox(e)}))})),n.forEach((function(e){return e.addEventListener("click",(function(){return t.selectRadio(e)}))}))},e.prototype.buildClosers=function(){var t=this;this.closers.forEach((function(e){t.onCloserClickListener.push({el:e,fn:function(){return t.closerClick()}}),e.addEventListener("click",t.onCloserClickListener.find((function(t){return t.el===e})).fn)}))},e.prototype.getScrollbarSize=function(){var t=document.createElement("div");t.style.overflow="scroll",t.style.width="100px",t.style.height="100px",document.body.appendChild(t);var e=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),e},e.prototype.onContextMenuHandler=function(t){var n={getBoundingClientRect:(function(){return new DOMRect},function(){return new DOMRect(t.clientX,t.clientY,0,0)})};e.closeCurrentlyOpened(),this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?(this.close(),document.body.style.overflow="",document.body.style.paddingRight=""):(document.body.style.overflow="hidden",document.body.style.paddingRight="".concat(this.getScrollbarSize(),"px"),this.open(n))},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(){var t=(window.getComputedStyle(this.el).getPropertyValue("--scope")||"").replace(" ","");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(),"window"===t&&this.el.appendChild(this.menu),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.focusElement=function(){var t=this.menu.querySelector("[autofocus]");if(!t)return!1;t.focus()},e.prototype.setupPopper=function(t){var e=t||this.el,n=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),i=(window.getComputedStyle(this.el).getPropertyValue("--flip")||"true").replace(" ",""),o=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),s=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ","")),l=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ",""),c=parseInt((window.getComputedStyle(this.el).getPropertyValue("--skidding")||"0").replace(" ",""));return(0,a.createPopper)(e,this.menu,{placement:u.POSITIONS[n]||"bottom-start",strategy:o,modifiers:r(r([],"fixed"!==o?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===i},{name:"offset",options:{offset:[c,s]}},{name:"computeStyles",options:{adaptive:"fixed"===o,gpuAcceleration:"true"===l}}],!1)})},e.prototype.selectCheckbox=function(t){t.ariaChecked="true"===t.ariaChecked?"false":"true"},e.prototype.selectRadio=function(t){if("true"===t.ariaChecked)return!1;var e=t.closest(".group").querySelectorAll('[role="menuitemradio"]');Array.from(e).filter((function(e){return e!==t})).forEach((function(t){t.ariaChecked="false"})),t.ariaChecked="true"},e.prototype.calculatePopperPosition=function(t){var e=this.setupPopper(t);e.forceUpdate();var n=e.state.placement;return e.destroy(),n},e.prototype.open=function(t){var e=this;if(this.el.classList.contains("open")||this.animationInProcess)return!1;var n=t||this.el;this.animationInProcess=!0;var i=(window.getComputedStyle(this.el).getPropertyValue("--scope")||"").replace(" ",""),o=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),s=(window.getComputedStyle(this.el).getPropertyValue("--flip")||"true").replace(" ",""),c=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),d=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"5").replace(" ","")),p=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ",""),h=parseInt((window.getComputedStyle(this.el).getPropertyValue("--skidding")||"0").replace(" ",""));"window"===i&&document.body.appendChild(this.menu),"static"!==c&&(this.el._popper=(0,a.createPopper)(n,this.menu,{placement:u.POSITIONS[o]||"bottom-start",strategy:c,modifiers:r(r([],"fixed"!==c?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===s},{name:"offset",options:{offset:[h,d]}},{name:"computeStyles",options:{adaptive:"fixed"===c,gpuAcceleration:"true"===p}}],!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"),"window"===i&&e.menu.classList.add("open"),e.animationInProcess=!1,e.hasAutofocus&&e.focusElement()})),this.fireEvent("open",this.el),(0,l.dispatch)("open.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,i=(window.getComputedStyle(this.el).getPropertyValue("--scope")||"").replace(" ","");if(this.animationInProcess=!0,"window"===i&&this.menu.classList.remove("open"),t){var o=this.el.querySelector("[data-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.dropdown",e.el,e.el)},e.prototype.forceClearState=function(){this.destroyPopper(),this.menu.style.margin=null,this.el.classList.remove("open")},e.prototype.destroy=function(){var t=this;(0,l.isIOS)()||(0,l.isIpadOS)()||(this.el.removeEventListener("mouseenter",this.onElementMouseEnterListener),this.el.removeEventListener("mouseleave",(function(){return t.onElementMouseLeaveListener})),this.onElementMouseEnterListener=null,this.onElementMouseLeaveListener=null),this.toggle.removeEventListener("click",this.onToggleClickListener),this.onToggleClickListener=null,this.closers.length&&(this.closers.forEach((function(e){e.removeEventListener("click",t.onCloserClickListener.find((function(t){return t.el===e})).fn)})),this.onCloserClickListener=null),this.el.classList.remove("open"),this.destroyPopper(),window.$hsDropdownCollection=window.$hsDropdownCollection.filter((function(e){return e.element.el!==t.el}))},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.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))}))}window.$hsDropdownCollection&&(window.$hsDropdownCollection=window.$hsDropdownCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll(".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)}))},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(".select.active")||(t.preventDefault(),this.onEscape(t));break;case"Enter":e.element.menu.querySelector(".select button:focus")||e.element.menu.querySelector(".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"ArrowRight":t.preventDefault(),t.stopImmediatePropagation(),this.onArrowX(t,"right");break;case"ArrowLeft":t.preventDefault(),t.stopImmediatePropagation(),this.onArrowX(t,"left");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(".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,n=t.target,i=(null!==(e=window.$hsDropdownCollection.find((function(t){return t.element.el===n.closest(".dropdown")})))&&void 0!==e?e:null).element;if(i&&n.classList.contains("dropdown-toggle"))t.preventDefault(),i.open();else if(i&&"menuitemcheckbox"===n.getAttribute("role"))i.selectCheckbox(n),i.close();else{if(!i||"menuitemradio"!==n.getAttribute("role"))return!1;i.selectRadio(n),i.close()}},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]), .dropdown > button:not([hidden]), [role="button"]:not([hidden]), [role^="menuitem"]:not([hidden], .dropdown-item, form)')).reverse():Array.from(n.querySelectorAll('a:not([hidden]), .dropdown > button:not([hidden]), [role="button"]:not([hidden]), [role^="menuitem"]:not([hidden], .dropdown-item, form)')),o=Array.from(i).filter((function(t){var e=t;return null===e.closest("[hidden]")&&null!==e.offsetParent})).filter((function(t){return!t.classList.contains("disabled")})),r=n.querySelector('a:focus, button:focus, [role="button"]:focus, [role^="menuitem"]:focus, .dropdown-item:focus, button:focus'),s=o.findIndex((function(t){return t===r}));s+1 .dropdown-toggle")||o.el.querySelector(":scope > .dropdown-toggle-wrapper > .dropdown-toggle")||o.el.children[0],o.closers=Array.from(o.el.querySelectorAll(":scope .dropdown-close"))||null,o.menu=o.el.querySelector(":scope > .dropdown-menu"),o.eventMode=(0,l.getClassProperty)(o.el,"--trigger","click"),o.closeMode=(0,l.getClassProperty)(o.el,"--auto-close","true"),o.hasAutofocus=(0,l.stringToBoolean)((0,l.getClassProperty)(o.el,"--has-autofocus","true")||"true"),o.animationInProcess=!1,o.onCloserClickListener=[],o.toggle&&o.menu&&o.init(),o}return o(e,t),e.prototype.elementMouseEnter=function(){this.onMouseEnterHandler()},e.prototype.elementMouseLeave=function(){this.onMouseLeaveHandler()},e.prototype.toggleClick=function(t){this.onClickHandler(t)},e.prototype.toggleContextMenu=function(t){t.preventDefault(),this.onContextMenuHandler(t)},e.prototype.closerClick=function(){this.close()},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.onElementMouseEnterListener=function(){return t.elementMouseEnter()},this.onElementMouseLeaveListener=function(){return t.elementMouseLeave()},this.el.addEventListener("mouseenter",this.onElementMouseEnterListener),this.el.addEventListener("mouseleave",this.onElementMouseLeaveListener))},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"),"contextmenu"===this.eventMode?(this.onToggleContextMenuListener=function(t){return e.toggleContextMenu(t)},this.toggle.addEventListener("contextmenu",this.onToggleContextMenuListener)):(this.onToggleClickListener=function(t){return e.toggleClick(t)},this.toggle.addEventListener("click",this.onToggleClickListener))},e.prototype.buildMenu=function(){var t=this;this.menu.role=this.menu.getAttribute("role")||"menu";var e=this.menu.querySelectorAll('[role="menuitemcheckbox"]'),n=this.menu.querySelectorAll('[role="menuitemradio"]');e.forEach((function(e){return e.addEventListener("click",(function(){return t.selectCheckbox(e)}))})),n.forEach((function(e){return e.addEventListener("click",(function(){return t.selectRadio(e)}))}))},e.prototype.buildClosers=function(){var t=this;this.closers.forEach((function(e){t.onCloserClickListener.push({el:e,fn:function(){return t.closerClick()}}),e.addEventListener("click",t.onCloserClickListener.find((function(t){return t.el===e})).fn)}))},e.prototype.getScrollbarSize=function(){var t=document.createElement("div");t.style.overflow="scroll",t.style.width="100px",t.style.height="100px",document.body.appendChild(t);var e=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),e},e.prototype.onContextMenuHandler=function(t){var n={getBoundingClientRect:(function(){return new DOMRect},function(){return new DOMRect(t.clientX,t.clientY,0,0)})};e.closeCurrentlyOpened(),this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?(this.close(),document.body.style.overflow="",document.body.style.paddingRight=""):(document.body.style.overflow="hidden",document.body.style.paddingRight="".concat(this.getScrollbarSize(),"px"),this.open(n))},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(){var t=(window.getComputedStyle(this.el).getPropertyValue("--scope")||"").replace(" ","");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(),"window"===t&&this.el.appendChild(this.menu),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.focusElement=function(){var t=this.menu.querySelector("[autofocus]");if(!t)return!1;t.focus()},e.prototype.setupPopper=function(t){var e=t||this.el,n=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),i=(window.getComputedStyle(this.el).getPropertyValue("--flip")||"true").replace(" ",""),o=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),s=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"10").replace(" ","")),l=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ",""),c=parseInt((window.getComputedStyle(this.el).getPropertyValue("--skidding")||"0").replace(" ",""));return(0,a.createPopper)(e,this.menu,{placement:u.POSITIONS[n]||"bottom-start",strategy:o,modifiers:r(r([],"fixed"!==o?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===i},{name:"offset",options:{offset:[c,s]}},{name:"computeStyles",options:{adaptive:"fixed"===o,gpuAcceleration:"true"===l}}],!1)})},e.prototype.selectCheckbox=function(t){t.ariaChecked="true"===t.ariaChecked?"false":"true"},e.prototype.selectRadio=function(t){if("true"===t.ariaChecked)return!1;var e=t.closest(".group").querySelectorAll('[role="menuitemradio"]');Array.from(e).filter((function(e){return e!==t})).forEach((function(t){t.ariaChecked="false"})),t.ariaChecked="true"},e.prototype.calculatePopperPosition=function(t){var e=this.setupPopper(t);e.forceUpdate();var n=e.state.placement;return e.destroy(),n},e.prototype.open=function(t){var e=this;if(this.el.classList.contains("open")||this.animationInProcess)return!1;var n=t||this.el;this.animationInProcess=!0;var i=(window.getComputedStyle(this.el).getPropertyValue("--scope")||"").replace(" ",""),o=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),s=(window.getComputedStyle(this.el).getPropertyValue("--flip")||"true").replace(" ",""),c=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),d=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"5").replace(" ","")),p=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ",""),h=parseInt((window.getComputedStyle(this.el).getPropertyValue("--skidding")||"0").replace(" ",""));"window"===i&&document.body.appendChild(this.menu),"static"!==c&&(this.el._popper=(0,a.createPopper)(n,this.menu,{placement:u.POSITIONS[o]||"bottom-start",strategy:c,modifiers:r(r([],"fixed"!==c?this.absoluteStrategyModifiers():[],!0),[{name:"flip",enabled:"true"===s},{name:"offset",options:{offset:[h,d]}},{name:"computeStyles",options:{adaptive:"fixed"===c,gpuAcceleration:"true"===p}}],!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"),"window"===i&&e.menu.classList.add("open"),e.animationInProcess=!1,e.hasAutofocus&&e.focusElement(),e.fireEvent("open",e.el),(0,l.dispatch)("open.dropdown",e.el,e.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,i=(window.getComputedStyle(this.el).getPropertyValue("--scope")||"").replace(" ","");if(this.animationInProcess=!0,"window"===i&&this.menu.classList.remove("open"),t){var o=this.el.querySelector("[data-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.dropdown",e.el,e.el)},e.prototype.forceClearState=function(){this.destroyPopper(),this.menu.style.margin=null,this.el.classList.remove("open")},e.prototype.destroy=function(){var t=this;(0,l.isIOS)()||(0,l.isIpadOS)()||(this.el.removeEventListener("mouseenter",this.onElementMouseEnterListener),this.el.removeEventListener("mouseleave",(function(){return t.onElementMouseLeaveListener})),this.onElementMouseEnterListener=null,this.onElementMouseLeaveListener=null),this.toggle.removeEventListener("click",this.onToggleClickListener),this.onToggleClickListener=null,this.closers.length&&(this.closers.forEach((function(e){e.removeEventListener("click",t.onCloserClickListener.find((function(t){return t.el===e})).fn)})),this.onCloserClickListener=null),this.el.classList.remove("open"),this.destroyPopper(),window.$hsDropdownCollection=window.$hsDropdownCollection.filter((function(e){return e.element.el!==t.el}))},e.findInCollection=function(t){return window.$hsDropdownCollection.find((function(n){return t instanceof e?n.element.el===t.el:"string"==typeof t?n.element.el===document.querySelector(t):n.element.el===t}))||null},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.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))}))}window.$hsDropdownCollection&&(window.$hsDropdownCollection=window.$hsDropdownCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll(".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)}))},e.open=function(t){var n=e.findInCollection(t);n&&n.element.menu.classList.contains("hidden")&&n.element.open()},e.close=function(t){var n=e.findInCollection(t);n&&!n.element.menu.classList.contains("hidden")&&n.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(".select.active")||(t.preventDefault(),this.onEscape(t));break;case"Enter":e.element.menu.querySelector(".select button:focus")||e.element.menu.querySelector(".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"ArrowRight":t.preventDefault(),t.stopImmediatePropagation(),this.onArrowX(t,"right");break;case"ArrowLeft":t.preventDefault(),t.stopImmediatePropagation(),this.onArrowX(t,"left");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(".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,n=t.target,i=(null!==(e=window.$hsDropdownCollection.find((function(t){return t.element.el===n.closest(".dropdown")})))&&void 0!==e?e:null).element;if(i&&n.classList.contains("dropdown-toggle"))t.preventDefault(),i.open();else if(i&&"menuitemcheckbox"===n.getAttribute("role"))i.selectCheckbox(n),i.close();else{if(!i||"menuitemradio"!==n.getAttribute("role"))return!1;i.selectRadio(n),i.close()}},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]), .dropdown > button:not([hidden]), [role="button"]:not([hidden]), [role^="menuitem"]:not([hidden], .dropdown-item, form)')).reverse():Array.from(n.querySelectorAll('a:not([hidden]), .dropdown > button:not([hidden]), [role="button"]:not([hidden]), [role^="menuitem"]:not([hidden], .dropdown-item, form)')),o=Array.from(i).filter((function(t){var e=t;return null===e.closest("[hidden]")&&null!==e.offsetParent})).filter((function(t){return!t.classList.contains("disabled")})),r=n.querySelector('a:focus, button:focus, [role="button"]:focus, [role^="menuitem"]:focus, .dropdown-item:focus, button:focus'),s=o.findIndex((function(t){return t===r}));s+1\n
\n
\n \n \n \n
\n

\n .\n

\n

\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n \n 0%\n \n
\n ',s.extensions=_.merge({default:{icon:'',class:"shrink-0 size-5"},xls:{icon:'',class:"shrink-0 size-5"},doc:{icon:'',class:"shrink-0 size-5"},zip:{icon:'',class:"shrink-0 size-5"}},a.extensions),s.singleton=a.singleton,s.concatOptions=r(r({clickable:s.el.querySelector("[data-file-upload-trigger]"),previewsContainer:s.el.querySelector("[data-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:s.previewTemplate,autoHideTrigger:!1},a),n),s.onReloadButtonClickListener=[],s.onTempFileInputChangeListener=[],s.init(),s}return o(e,t),e.prototype.tempFileInputChange=function(t,e){var n,i=null===(n=t.target.files)||void 0===n?void 0:n[0];if(i){var o=i;o.status=Dropzone.ADDED,o.accepted=!0,o.previewElement=e.previewElement,o.previewTemplate=e.previewTemplate,o.previewsContainer=e.previewsContainer,this.dropzone.removeFile(e),this.dropzone.addFile(o)}},e.prototype.reloadButtonClick=function(t,e){var n=this;t.preventDefault(),t.stopPropagation();var i=document.createElement("input");i.type="file",this.onTempFileInputChangeListener.push({el:i,fn:function(t){return n.tempFileInputChange(t,e)}}),i.click(),i.addEventListener("change",this.onTempFileInputChangeListener.find((function(t){return t.el===i})).fn)},e.prototype.init=function(){this.createCollection(window.$hsFileUploadCollection,this),this.initDropzone()},e.prototype.initDropzone=function(){var t=this,e=this.el.querySelector("[data-file-upload-clear]"),n=Array.from(this.el.querySelectorAll("[data-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.destroy=function(){var t=this;this.onTempFileInputChangeListener.forEach((function(t){t.el.removeEventListener("change",t.fn)})),this.onTempFileInputChangeListener=null,this.onReloadButtonClickListener.forEach((function(t){t.el.removeEventListener("click",t.fn)})),this.onReloadButtonClickListener=null,this.dropzone.destroy(),window.$hsFileUploadCollection=window.$hsFileUploadCollection.filter((function(e){return e.element.el!==t.el}))},e.prototype.onAddFile=function(t){var e=this,n=t.previewElement,i=t.previewElement.querySelector("[data-file-upload-reload]");if(!n)return!1;this.singleton&&this.dropzone.files.length>1&&this.dropzone.removeFile(this.dropzone.files[0]),i&&(this.onReloadButtonClickListener.push({el:i,fn:function(n){return e.reloadButtonClick(n,t)}}),i.addEventListener("click",this.onReloadButtonClickListener.find((function(t){return t.el===i})).fn)),this.previewAccepted(t)},e.prototype.previewAccepted=function(t){var e=this,n=t.previewElement,i=this.splitFileName(t.name),o=n.querySelector("[data-file-upload-file-name]"),r=n.querySelector("[data-file-upload-file-ext]"),s=n.querySelector("[data-file-upload-file-size]"),l=n.querySelector("[data-file-upload-file-icon]"),a=this.el.querySelector("[data-file-upload-trigger]"),c=n.querySelector("[data-dz-thumbnail]"),u=n.querySelector("[data-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-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-file-upload-progress-bar]"),o=n.querySelector("[data-file-upload-progress-bar-pane]"),r=n.querySelector("[data-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=[]),window.$hsFileUploadCollection&&(window.$hsFileUploadCollection=window.$hsFileUploadCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll("[data-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-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},86: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
\n
\n \n \n \n
\n

\n .\n

\n

\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n \n 0%\n \n
\n ',s.extensions=_.merge({default:{icon:'',class:"shrink-0 size-5"},xls:{icon:'',class:"shrink-0 size-5"},doc:{icon:'',class:"shrink-0 size-5"},zip:{icon:'',class:"shrink-0 size-5"}},a.extensions),s.singleton=a.singleton,s.concatOptions=r(r({clickable:s.el.querySelector("[data-file-upload-trigger]"),previewsContainer:s.el.querySelector("[data-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:s.previewTemplate,autoHideTrigger:!1},a),n),s.onReloadButtonClickListener=[],s.onTempFileInputChangeListener=[],s.init(),s}return o(e,t),e.prototype.tempFileInputChange=function(t,e){var n,i=null===(n=t.target.files)||void 0===n?void 0:n[0];if(i){var o=i;o.status=Dropzone.ADDED,o.accepted=!0,o.previewElement=e.previewElement,o.previewTemplate=e.previewTemplate,o.previewsContainer=e.previewsContainer,this.dropzone.removeFile(e),this.dropzone.addFile(o)}},e.prototype.reloadButtonClick=function(t,e){var n=this;t.preventDefault(),t.stopPropagation();var i=document.createElement("input");i.type="file",this.onTempFileInputChangeListener.push({el:i,fn:function(t){return n.tempFileInputChange(t,e)}}),i.click(),i.addEventListener("change",this.onTempFileInputChangeListener.find((function(t){return t.el===i})).fn)},e.prototype.init=function(){this.createCollection(window.$hsFileUploadCollection,this),this.initDropzone()},e.prototype.initDropzone=function(){var t=this,e=this.el.querySelector("[data-file-upload-clear]"),n=Array.from(this.el.querySelectorAll("[data-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.destroy=function(){var t=this;this.onTempFileInputChangeListener.forEach((function(t){t.el.removeEventListener("change",t.fn)})),this.onTempFileInputChangeListener=null,this.onReloadButtonClickListener.forEach((function(t){t.el.removeEventListener("click",t.fn)})),this.onReloadButtonClickListener=null,this.dropzone.destroy(),window.$hsFileUploadCollection=window.$hsFileUploadCollection.filter((function(e){return e.element.el!==t.el}))},e.prototype.onAddFile=function(t){var e=this,n=t.previewElement,i=t.previewElement.querySelector("[data-file-upload-reload]");if(!n)return!1;this.singleton&&this.dropzone.files.length>1&&this.dropzone.removeFile(this.dropzone.files[0]),i&&(this.onReloadButtonClickListener.push({el:i,fn:function(n){return e.reloadButtonClick(n,t)}}),i.addEventListener("click",this.onReloadButtonClickListener.find((function(t){return t.el===i})).fn)),this.previewAccepted(t)},e.prototype.previewAccepted=function(t){var e=this,n=t.previewElement,i=this.splitFileName(t.name),o=n.querySelector("[data-file-upload-file-name]"),r=n.querySelector("[data-file-upload-file-ext]"),s=n.querySelector("[data-file-upload-file-size]"),l=n.querySelector("[data-file-upload-file-icon]"),a=this.el.querySelector("[data-file-upload-trigger]"),c=n.querySelector("[data-dz-thumbnail]"),u=n.querySelector("[data-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-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-file-upload-progress-bar]"),o=n.querySelector("[data-file-upload-progress-bar-pane]"),r=n.querySelector("[data-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=[]),window.$hsFileUploadCollection&&(window.$hsFileUploadCollection=window.$hsFileUploadCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll("[data-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-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},86:function(t,e,n){ /* * HSInputNumber - * @version: 2.6.0 + * @version: 2.7.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. @@ -80,15 +80,15 @@ var i,o=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{ 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.inputInput=function(){this.changeValue()},e.prototype.incrementClick=function(){this.changeValue("increment")},e.prototype.decrementClick=function(){this.changeValue("decrement")},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<=this.minInputValue&&(this.inputValue=this.minInputValue,this.input.value="".concat(this.minInputValue)),this.inputValue<=this.minInputValue&&this.changeValue(),this.input.hasAttribute("disabled")&&this.disableButtons()},e.prototype.buildInput=function(){var t=this;this.onInputInputListener=function(){return t.inputInput()},this.input.addEventListener("input",this.onInputInputListener)},e.prototype.buildIncrement=function(){var t=this;this.onIncrementClickListener=function(){return t.incrementClick()},this.increment.addEventListener("click",this.onIncrementClickListener)},e.prototype.buildDecrement=function(){var t=this;this.onDecrementClickListener=function(){return t.decrementClick()},this.decrement.addEventListener("click",this.onDecrementClickListener)},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.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.prototype.destroy=function(){var t=this;this.el.classList.remove("disabled"),this.increment.removeAttribute("disabled"),this.decrement.removeAttribute("disabled"),this.input.removeEventListener("input",this.onInputInputListener),this.increment.removeEventListener("click",this.onIncrementClickListener),this.decrement.removeEventListener("click",this.onDecrementClickListener),window.$hsInputNumberCollection=window.$hsInputNumberCollection.filter((function(e){return e.element.el!==t.el}))},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=[]),window.$hsInputNumberCollection&&(window.$hsInputNumberCollection=window.$hsInputNumberCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll("[data-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(287)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=a),e.default=a},164:function(t,e,n){ /* * HSOverlay - * @version: 2.6.0 + * @version: 2.7.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;n=t?(document.body.classList.add("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)),a&&"Escape"===t.code&&(t.preventDefault(),this.onEscape(o))},e.onEscape=function(t){t&&t.element.hasAbilityToCloseOnBackdropClick&&t.element.close()},e.onTab=function(t){var e=t.element.overlay,n=Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(0===n.length)return!1;var i=e.querySelector(":focus");if(i){for(var o=!1,r=0,s=n;re&&!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){var e=t.element,n=e.autoCloseEqualityType,i=e.autoClose;("less-than"===n?document.body.clientWidth<=i:document.body.clientWidth>=i)&&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){var e=t.element,n=e.autoCloseEqualityType,i=e.autoClose;("less-than"===n?document.body.clientWidth<=i:document.body.clientWidth>=i)&&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("overlay-body-open")}))}()})),"undefined"!=typeof window&&(window.HSOverlay=c),e.default=c},594: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("overlay-body-open"),e.element.open()):e.element.close(!0)},e.accessibility=function(t){var e,n,i=window.$hsOverlayCollection.filter((function(t){return t.element.el.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.el)||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)),a&&"Escape"===t.code&&(t.preventDefault(),this.onEscape(o))},e.onEscape=function(t){t&&t.element.hasAbilityToCloseOnBackdropClick&&t.element.close()},e.onTab=function(t){var e=t.element.el,n=Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(0===n.length)return!1;var i=e.querySelector(":focus");if(i){for(var o=!1,r=0,s=n;re&&!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){var e=t.element,n=e.autoCloseEqualityType,i=e.autoClose;("less-than"===n?document.body.clientWidth<=i:document.body.clientWidth>=i)&&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){var e=t.element,n=e.autoCloseEqualityType,i=e.autoClose;("less-than"===n?document.body.clientWidth<=i:document.body.clientWidth>=i)&&t.element.close(!0)}))}(),function(){if(!window.$hsOverlayCollection.length||!window.$hsOverlayCollection.find((function(t){return t.element.el.classList.contains("opened")})))return!1;window.$hsOverlayCollection.filter((function(t){return t.element.el.classList.contains("opened")})).forEach((function(t){var e=parseInt(window.getComputedStyle(t.element.el).getPropertyValue("z-index")),n=document.querySelector("#".concat(t.element.el.id,"-backdrop"));return!!n&&e!==parseInt(window.getComputedStyle(n).getPropertyValue("z-index"))+1&&("style"in n&&(n.style.zIndex="".concat(e-1)),void document.body.classList.add("overlay-body-open"))}))}()})),"undefined"!=typeof window&&(window.HSOverlay=c),e.default=c},594:function(t,e,n){ /* * HSPinInput - * @version: 2.6.0 + * @version: 2.7.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. @@ -96,7 +96,7 @@ var i,o=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{ 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.prototype.destroy=function(){var t=this;this.el.classList.remove("active"),this.items.length&&this.items.forEach((function(e){e.removeEventListener("input",t.onElementInputListener.find((function(t){return t.el===e})).fn),e.removeEventListener("paste",t.onElementPasteListener.find((function(t){return t.el===e})).fn),e.removeEventListener("keydown",t.onElementKeydownListener.find((function(t){return t.el===e})).fn),e.removeEventListener("focusin",t.onElementFocusinListener.find((function(t){return t.el===e})).fn),e.removeEventListener("focusout",t.onElementFocusoutListener.find((function(t){return t.el===e})).fn)})),this.items=null,this.currentItem=null,this.currentValue=null,window.$hsPinInputCollection=window.$hsPinInputCollection.filter((function(e){return e.element.el!==t.el}))},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=[]),window.$hsPinInputCollection&&(window.$hsPinInputCollection=window.$hsPinInputCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll("[data-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(287)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=a),e.default=a},977:function(t,e,n){ /* * HSRangeSlider - * @version: 2.6.0 + * @version: 2.7.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. @@ -104,15 +104,15 @@ var i,o=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{ 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])){r=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]",l.searchNoResultText=(null==u?void 0:u.searchNoResultText)||"No results found",l.searchNoResultClasses=(null==u?void 0:u.searchNoResultClasses)||"block advance-select-option",l.optionTemplate=(null==u?void 0:u.optionTemplate)||null,l.optionTag=(null==u?void 0:u.optionTag)||null,l.optionClasses=(null==u?void 0:u.optionClasses)||null,l.extraMarkup=(null==u?void 0:u.extraMarkup)||null,l.descriptionClasses=(null==u?void 0:u.descriptionClasses)||null,l.iconClasses=(null==u?void 0:u.iconClasses)||null,l.isAddTagOnEnter=null===(s=null==u?void 0:u.isAddTagOnEnter)||void 0===s||s,l.animationInProcess=!1,l.selectOptions=[],l.remoteOptions=[],l.tagsInputHelper=null,l.init(),l}return o(e,t),e.prototype.wrapperClick=function(t){t.target.closest("[data-select-dropdown]")||t.target.closest("[data-tag-value]")||this.tagsInput.focus()},e.prototype.toggleClick=function(){if(this.isDisabled)return!1;this.toggleFn()},e.prototype.tagsInputFocus=function(){this.isOpened||this.open()},e.prototype.tagsInputInput=function(){this.calculateInputWidth()},e.prototype.tagsInputInputSecond=function(t){this.searchOptions(t.target.value)},e.prototype.tagsInputKeydown=function(t){if("Enter"===t.key&&this.isAddTagOnEnter){var e=t.target.value;if(this.selectOptions.find((function(t){return t.val===e})))return!1;this.addSelectOption(e,e),this.buildOption(e,e),this.dropdown.querySelector('[data-value="'.concat(e,'"]')).click(),this.resetTagsInputField()}},e.prototype.searchInput=function(t){this.apiUrl?this.remoteSearch(t.target.value):this.searchOptions(t.target.value)},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-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("advance-select","relative"),"tags"===this.mode&&(this.onWrapperClickListener=function(e){return t.wrapperClick(e)},this.wrapper.addEventListener("click",this.onWrapperClickListener)),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.onToggleClickListener=function(){return o.toggleClick()},this.toggle.addEventListener("click",this.onToggleClickListener)},e.prototype.setToggleIcon=function(){var t,e=this.getItemByValue(this.value),n=this.toggle.querySelector("[data-icon]");if(n){n.innerHTML="";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?n.classList.remove("hidden"):n.classList.add("hidden")}},e.prototype.setToggleTitle=function(){var t,e=this.toggle.querySelector("[data-title]");e&&(e.innerHTML=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder,e.classList.add("truncate"),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(),c.triggerChangeEventForNativeSelect()})),this.wrapper.append(p)},e.prototype.getItemByValue=function(t){var e=this;return this.apiUrl?this.remoteOptions.find((function(n){return"".concat(n[e.apiFieldsMap.val])===t||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.onTagsInputFocusListener=function(){return t.tagsInputFocus()},this.onTagsInputInputListener=function(){return t.tagsInputInput()},this.onTagsInputInputSecondListener=(0,u.debounce)((function(e){return t.tagsInputInputSecond(e)})),this.onTagsInputKeydownListener=function(e){return t.tagsInputKeydown(e)},this.tagsInput.addEventListener("focus",this.onTagsInputFocusListener),this.tagsInput.addEventListener("input",this.onTagsInputInputListener),this.tagsInput.addEventListener("input",this.onTagsInputInputSecondListener),this.tagsInput.addEventListener("keydown",this.onTagsInputKeydownListener),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-select-dropdown",""),"parent"===this.dropdownScope&&(this.dropdown.classList.add("absolute"),this.dropdownVerticalFixedPlacement||this.dropdown.classList.add("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(){if(void 0!==d.createPopper){document.body.appendChild(this.dropdown);var t="tags"===this.mode?this.wrapper:this.toggle;this.popperInstance=(0,d.createPopper)(t,this.dropdown,{placement:h.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.onSearchInputListener=(0,u.debounce)((function(t){return e.searchInput(t)})),this.search.addEventListener("input",this.onSearchInputListener),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="",s={id:"",val:"",title:"",icon:null,description:null,rest:{}};Object.keys(t).forEach((function(n){var l;t[e.apiFieldsMap.id]&&(i=t[e.apiFieldsMap.id]),(t[e.apiFieldsMap.val]||t[e.apiFieldsMap.title])&&(r=t[e.apiFieldsMap.val]||t[e.apiFieldsMap.title]),t[e.apiFieldsMap.title]&&(o=t[e.apiFieldsMap.title]),t[e.apiFieldsMap.icon]&&(s.icon=t[e.apiFieldsMap.icon]),t[null===(l=e.apiFieldsMap)||void 0===l?void 0:l.description]&&(s.description=t[e.apiFieldsMap.description]),s.rest[n]=t[n]})),e.buildOriginalOption(o,"".concat(r),i,!1,!1,s),e.buildOptionFromRemoteData(o,"".concat(r),!1,!1,"".concat(n),i,s)})),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-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-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),"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(!0)),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),(0,u.dispatch)("change.advance.select",this.el,this.value)},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,n=this,i=[],o="";if(t.forEach((function(t){n.isMultiple?n.value.includes(t.val)&&i.push(t.title):n.value===t.val&&i.push(t.title)})),void 0!==this.toggleCountText&&null!==this.toggleCountText&&i.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){var r=i.slice(0,this.toggleCountTextMinItems-1),s=[r.join(this.toggleSeparators.items)],l="".concat(i.length-r.length);if((null===(e=null==this?void 0:this.toggleSeparators)||void 0===e?void 0:e.betweenItemsAndCounter)&&s.push(this.toggleSeparators.betweenItemsAndCounter),this.toggleCountText)switch(this.toggleCountTextPlacement){case"postfix-no-space":s.push("".concat(l).concat(this.toggleCountText));break;case"prefix-no-space":s.push("".concat(this.toggleCountText).concat(l));break;case"prefix":s.push("".concat(this.toggleCountText," ").concat(l));break;default:s.push("".concat(l," ").concat(this.toggleCountText))}o=s.join(" ")}else o="".concat(i.length," ").concat(this.toggleCountText);else o=i.join(this.toggleSeparators.items);return o},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"),o=e.getAttribute("data-title-value");t.isMultiple?t.value.includes(i)&&n.push(o):t.value===i&&n.push(o)})),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(){this.wrapper&&this.wrapper.removeEventListener("click",this.onWrapperClickListener),this.toggle&&this.toggle.removeEventListener("click",this.onToggleClickListener),this.tagsInput&&(this.tagsInput.removeEventListener("focus",this.onTagsInputFocusListener),this.tagsInput.removeEventListener("input",this.onTagsInputInputListener),this.tagsInput.removeEventListener("input",this.onTagsInputInputSecondListener),this.tagsInput.removeEventListener("keydown",this.onTagsInputKeydownListener)),this.search&&this.search.removeEventListener("input",this.onSearchInputListener);var t=this.el.parentElement.parentElement;this.el.classList.remove("hidden"),this.el.style.display="",t.prepend(this.el),t.querySelector(".advance-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(t){var e,n,i,o,r=this;if(void 0===t&&(t=!1),this.animationInProcess)return!1;this.animationInProcess=!0,(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.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,u.afterTransition)(this.dropdown,(function(){r.dropdown.classList.add("hidden"),r.hasSearch&&(r.search.value="",r.search.dispatchEvent(new Event("input",{bubbles:!0})),r.search.blur()),t&&r.toggle.focus(),r.animationInProcess=!1})),null===(o=this.dropdown.querySelector(".select-option-highlighted"))||void 0===o||o.classList.remove("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;if((null==this?void 0:this.dropdownVerticalFixedPlacement)&&(this.dropdown.classList.contains("bottom-full")||this.dropdown.classList.contains("top-full")))return!1;"top"===(null==this?void 0:this.dropdownVerticalFixedPlacement)?(this.dropdown.classList.add("bottom-full"),this.dropdown.style.marginBottom="".concat(this.dropdownSpace,"px")):"bottom"===(null==this?void 0:this.dropdownVerticalFixedPlacement)?(this.dropdown.classList.add("top-full"),this.dropdown.style.marginTop="".concat(this.dropdownSpace,"px")):(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=[],window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)}))),window.$hsSelectCollection&&(window.$hsSelectCollection=window.$hsSelectCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll("[data-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-select"),i=n?JSON.parse(n):{};new e(t,i)}}))},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(".advance-select.active")&&!t.closest("[data-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}))&&h.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":case"Space":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(".select-option-highlighted")||n.querySelector(".selected");o||i[0].classList.add("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(".select-option-highlighted")||n.querySelector(".selected");o||i[0].classList.add("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(".select-option-highlighted");i.length&&(i[0].focus(),o&&o.classList.remove("select-option-highlighted"),i[0].classList.add("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}(p.default);window.addEventListener("load",(function(){f.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=f),e.default=f},213: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])){r=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]",l.searchNoResultText=(null==u?void 0:u.searchNoResultText)||"No results found",l.searchNoResultClasses=(null==u?void 0:u.searchNoResultClasses)||"block advance-select-option",l.optionAllowEmptyOption=void 0!==(null==u?void 0:u.optionAllowEmptyOption)&&(null==u?void 0:u.optionAllowEmptyOption),l.optionTemplate=(null==u?void 0:u.optionTemplate)||null,l.optionTag=(null==u?void 0:u.optionTag)||null,l.optionClasses=(null==u?void 0:u.optionClasses)||null,l.extraMarkup=(null==u?void 0:u.extraMarkup)||null,l.descriptionClasses=(null==u?void 0:u.descriptionClasses)||null,l.iconClasses=(null==u?void 0:u.iconClasses)||null,l.isAddTagOnEnter=null===(s=null==u?void 0:u.isAddTagOnEnter)||void 0===s||s,l.animationInProcess=!1,l.selectOptions=[],l.remoteOptions=[],l.tagsInputHelper=null,l.init(),l}return o(e,t),e.prototype.wrapperClick=function(t){t.target.closest("[data-select-dropdown]")||t.target.closest("[data-tag-value]")||this.tagsInput.focus()},e.prototype.toggleClick=function(){if(this.isDisabled)return!1;this.toggleFn()},e.prototype.tagsInputFocus=function(){this.isOpened||this.open()},e.prototype.tagsInputInput=function(){this.calculateInputWidth()},e.prototype.tagsInputInputSecond=function(t){this.searchOptions(t.target.value)},e.prototype.tagsInputKeydown=function(t){if("Enter"===t.key&&this.isAddTagOnEnter){var e=t.target.value;if(this.selectOptions.find((function(t){return t.val===e})))return!1;this.addSelectOption(e,e),this.buildOption(e,e),this.dropdown.querySelector('[data-value="'.concat(e,'"]')).click(),this.resetTagsInputField()}},e.prototype.searchInput=function(t){this.apiUrl?this.remoteSearch(t.target.value):this.searchOptions(t.target.value)},e.prototype.setValue=function(t){(this.value=t,this.clearSelections(),Array.isArray(t))?"tags"===this.mode?(this.unselectMultipleItems(),this.selectMultipleItems(),this.selectedItems=[],this.wrapper.querySelectorAll("[data-tag-value]").forEach((function(t){return t.remove()})),this.setTagsItems(),this.reassignTagsInputPlaceholder(this.value.length?"":this.placeholder)):(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());this.triggerChangeEventForNativeSelect()},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(e){return t.optionAllowEmptyOption||!t.optionAllowEmptyOption&&e.value&&""!==e.value})).forEach((function(e){var n=e.getAttribute("data-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("advance-select","relative"),"tags"===this.mode&&(this.onWrapperClickListener=function(e){return t.wrapperClick(e)},this.wrapper.addEventListener("click",this.onWrapperClickListener)),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.onToggleClickListener=function(){return o.toggleClick()},this.toggle.addEventListener("click",this.onToggleClickListener)},e.prototype.setToggleIcon=function(){var t,e=this.getItemByValue(this.value),n=this.toggle.querySelector("[data-icon]");if(n){n.innerHTML="";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?n.classList.remove("hidden"):n.classList.add("hidden")}},e.prototype.setToggleTitle=function(){var t,e=this.toggle.querySelector("[data-title]");e&&(e.innerHTML=(null===(t=this.getItemByValue(this.value))||void 0===t?void 0:t.title)||this.placeholder,e.classList.add("truncate"),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(),c.triggerChangeEventForNativeSelect()})),this.wrapper.append(p)},e.prototype.getItemByValue=function(t){var e=this;return this.apiUrl?this.remoteOptions.find((function(n){return"".concat(n[e.apiFieldsMap.val])===t||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.onTagsInputFocusListener=function(){return t.tagsInputFocus()},this.onTagsInputInputListener=function(){return t.tagsInputInput()},this.onTagsInputInputSecondListener=(0,u.debounce)((function(e){return t.tagsInputInputSecond(e)})),this.onTagsInputKeydownListener=function(e){return t.tagsInputKeydown(e)},this.tagsInput.addEventListener("focus",this.onTagsInputFocusListener),this.tagsInput.addEventListener("input",this.onTagsInputInputListener),this.tagsInput.addEventListener("input",this.onTagsInputInputSecondListener),this.tagsInput.addEventListener("keydown",this.onTagsInputKeydownListener),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-select-dropdown",""),"parent"===this.dropdownScope&&(this.dropdown.classList.add("absolute"),this.dropdownVerticalFixedPlacement||this.dropdown.classList.add("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(){if(void 0!==d.createPopper){document.body.appendChild(this.dropdown);var t="tags"===this.mode?this.wrapper:this.toggle;this.popperInstance=(0,d.createPopper)(t,this.dropdown,{placement:h.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.onSearchInputListener=(0,u.debounce)((function(t){return e.searchInput(t)})),this.search.addEventListener("input",this.onSearchInputListener),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="",s={id:"",val:"",title:"",icon:null,description:null,rest:{}};Object.keys(t).forEach((function(n){var l;t[e.apiFieldsMap.id]&&(i=t[e.apiFieldsMap.id]),(t[e.apiFieldsMap.val]||t[e.apiFieldsMap.title])&&(r=t[e.apiFieldsMap.val]||t[e.apiFieldsMap.title]),t[e.apiFieldsMap.title]&&(o=t[e.apiFieldsMap.title]),t[e.apiFieldsMap.icon]&&(s.icon=t[e.apiFieldsMap.icon]),t[null===(l=e.apiFieldsMap)||void 0===l?void 0:l.description]&&(s.description=t[e.apiFieldsMap.description]),s.rest[n]=t[n]})),e.buildOriginalOption(o,"".concat(r),i,!1,!1,s),e.buildOptionFromRemoteData(o,"".concat(r),!1,!1,"".concat(n),i,s)})),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-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-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),"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(!0)),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),(0,u.dispatch)("change.advance.select",this.el,this.value)},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,n=this,i=[],o="";if(t.forEach((function(t){n.isMultiple?n.value.includes(t.val)&&i.push(t.title):n.value===t.val&&i.push(t.title)})),void 0!==this.toggleCountText&&null!==this.toggleCountText&&i.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){var r=i.slice(0,this.toggleCountTextMinItems-1),s=[r.join(this.toggleSeparators.items)],l="".concat(i.length-r.length);if((null===(e=null==this?void 0:this.toggleSeparators)||void 0===e?void 0:e.betweenItemsAndCounter)&&s.push(this.toggleSeparators.betweenItemsAndCounter),this.toggleCountText)switch(this.toggleCountTextPlacement){case"postfix-no-space":s.push("".concat(l).concat(this.toggleCountText));break;case"prefix-no-space":s.push("".concat(this.toggleCountText).concat(l));break;case"prefix":s.push("".concat(this.toggleCountText," ").concat(l));break;default:s.push("".concat(l," ").concat(this.toggleCountText))}o=s.join(" ")}else o="".concat(i.length," ").concat(this.toggleCountText);else o=i.join(this.toggleSeparators.items);return o},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"),o=e.getAttribute("data-title-value");t.isMultiple?t.value.includes(i)&&n.push(o):t.value===i&&n.push(o)})),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(){this.wrapper&&this.wrapper.removeEventListener("click",this.onWrapperClickListener),this.toggle&&this.toggle.removeEventListener("click",this.onToggleClickListener),this.tagsInput&&(this.tagsInput.removeEventListener("focus",this.onTagsInputFocusListener),this.tagsInput.removeEventListener("input",this.onTagsInputInputListener),this.tagsInput.removeEventListener("input",this.onTagsInputInputSecondListener),this.tagsInput.removeEventListener("keydown",this.onTagsInputKeydownListener)),this.search&&this.search.removeEventListener("input",this.onSearchInputListener);var t=this.el.parentElement.parentElement;this.el.classList.remove("hidden"),this.el.style.display="",t.prepend(this.el),t.querySelector(".advance-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(t){var e,n,i,o,r=this;if(void 0===t&&(t=!1),this.animationInProcess)return!1;this.animationInProcess=!0,(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(n=this.dropdownDirectionClasses)||void 0===n?void 0:n.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,u.afterTransition)(this.dropdown,(function(){r.dropdown.classList.add("hidden"),r.hasSearch&&(r.search.value="",r.search.dispatchEvent(new Event("input",{bubbles:!0})),r.search.blur()),t&&r.toggle.focus(),r.animationInProcess=!1})),null===(o=this.dropdown.querySelector(".select-option-highlighted"))||void 0===o||o.classList.remove("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;if((null==this?void 0:this.dropdownVerticalFixedPlacement)&&(this.dropdown.classList.contains("bottom-full")||this.dropdown.classList.contains("top-full")))return!1;"top"===(null==this?void 0:this.dropdownVerticalFixedPlacement)?(this.dropdown.classList.add("bottom-full"),this.dropdown.style.marginBottom="".concat(this.dropdownSpace,"px")):"bottom"===(null==this?void 0:this.dropdownVerticalFixedPlacement)?(this.dropdown.classList.add("top-full"),this.dropdown.style.marginTop="".concat(this.dropdownSpace,"px")):(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=[],window.addEventListener("click",(function(t){var n=t.target;e.closeCurrentlyOpened(n)})),document.addEventListener("keydown",(function(t){return e.accessibility(t)}))),window.$hsSelectCollection&&(window.$hsSelectCollection=window.$hsSelectCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll("[data-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-select"),i=n?JSON.parse(n):{};new e(t,i)}}))},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(".advance-select.active")&&!t.closest("[data-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}))&&h.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":case"Space":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(".select-option-highlighted")||n.querySelector(".selected");o||i[0].classList.add("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(".select-option-highlighted")||n.querySelector(".selected");o||i[0].classList.add("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(".select-option-highlighted");i.length&&(i[0].focus(),o&&o.classList.remove("select-option-highlighted"),i[0].classList.add("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}(p.default);window.addEventListener("load",(function(){f.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=f),e.default=f},213:function(t,e,n){ /* * HSStepper * @version: 2.6.0 @@ -136,7 +136,7 @@ var i,o=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{ 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-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)&&(this.onNavItemClickListener.push({el:o,fn:function(){return e.navItemClick(t)}}),o.addEventListener("click",this.onNavItemClickListener.find((function(t){return t.el===o})).fn))},e.prototype.addNavItem=function(t){var e=JSON.parse(t.getAttribute("data-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.isInvalid,m=void 0!==v&&v;s&&t.classList.add("is-valid"),a&&t.classList.add("skipped"),p&&("BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.setAttribute("disabled","disabled"),t.classList.add("disabled")),m&&t.classList.add("is-invalid"),this.navItems.push({index:n,isFinal:o,isCompleted:s,isSkip:a,isOptional:u,isDisabled:p,isProcessed:f,isInvalid: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.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.isInvalid=!0,t.el.classList.add("is-invalid")},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-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-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("is-valid"),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.isInvalid=!1,t.isCompleted=!1,t.isDisabled=!1,t.el.classList.remove("is-invalid","is-valid"),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-stepper-back-btn]"),this.nextBtn=this.el.querySelector("[data-stepper-next-btn]"),this.skipBtn=this.el.querySelector("[data-stepper-skip-btn]"),this.completeStepBtn=this.el.querySelector("[data-stepper-complete-step-btn]"),this.finishBtn=this.el.querySelector("[data-stepper-finish-btn]"),this.resetBtn=this.el.querySelector("[data-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.onBackClickListener=function(){return t.backClick()},this.backBtn.addEventListener("click",this.onBackClickListener))},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.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.onNextClickListener=function(){return t.nextClick()},this.nextBtn.addEventListener("click",this.onNextClickListener))},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.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.isInvalid=!1,e.isDisabled=!1,n.isSkip=!1,e.el.classList.remove("skipped","is-valid","is-invalid"),n.el.classList.remove("skipped","is-valid","is-invalid")},e.prototype.buildSkipButton=function(){var t=this;this.skipBtn&&(this.showSkipButton(),this.onSkipClickListener=function(){return t.skipClick()},this.skipBtn.addEventListener("click",this.onSkipClickListener))},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.stepper",this.el,this.currentIndex)},e.prototype.buildCompleteStepButton=function(){var t=this;this.completeStepBtn&&(this.completeStepBtnDefaultText=this.completeStepBtn.innerText,this.onCompleteStepBtnClickListener=function(){return t.completeStepBtnClick()},this.completeStepBtn.addEventListener("click",this.onCompleteStepBtnClickListener))},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-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("is-valid")},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.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.onFinishBtnClickListener=function(){return t.finishBtnClick()},this.finishBtn.addEventListener("click",this.onFinishBtnClickListener))},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.stepper",this.el,this.currentIndex)},e.prototype.buildResetButton=function(){var t=this;this.resetBtn&&(this.onResetBtnClickListener=function(){return t.resetBtnClick()},this.resetBtn.addEventListener("click",this.onResetBtnClickListener))},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("is-valid","skipped")})),this.contentItems.forEach((function(e){var n=e.el;e.isSkip=!1,e.isCompleted=!1,t.unsetCurrentContentItemActions(n),n.classList.remove("is-valid","skipped")})),this.currentIndex=1,this.unsetCompleted(),this.isCompleted=!1,this.showSkipButton(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.fireEvent("reset",this.currentIndex),(0,l.dispatch)("reset.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.prototype.destroy=function(){var t=this;this.el.classList.remove("completed"),this.el.querySelectorAll("[data-stepper-nav-item]").forEach((function(t){t.classList.remove("active","is-valid","skipped","disabled","is-invalid"),"BUTTON"!==t.tagName&&"INPUT"!==t.tagName||t.removeAttribute("disabled")})),this.el.querySelectorAll("[data-stepper-content-item]").forEach((function(t){t.classList.remove("is-valid","skipped")})),this.backBtn&&this.backBtn.classList.remove("disabled"),this.nextBtn&&this.nextBtn.classList.remove("disabled"),this.completeStepBtn&&this.completeStepBtn.classList.remove("disabled"),this.backBtn&&(this.backBtn.style.display=""),this.nextBtn&&(this.nextBtn.style.display=""),this.skipBtn&&(this.skipBtn.style.display=""),this.finishBtn&&(this.finishBtn.style.display="none"),this.resetBtn&&(this.resetBtn.style.display="none"),this.onNavItemClickListener.length&&this.onNavItemClickListener.forEach((function(t){var e=t.el,n=t.fn;e.removeEventListener("click",n)})),this.backBtn&&this.backBtn.removeEventListener("click",this.onBackClickListener),this.nextBtn&&this.nextBtn.removeEventListener("click",this.onNextClickListener),this.skipBtn&&this.skipBtn.removeEventListener("click",this.onSkipClickListener),this.completeStepBtn&&this.completeStepBtn.removeEventListener("click",this.onCompleteStepBtnClickListener),this.finishBtn&&this.finishBtn.removeEventListener("click",this.onFinishBtnClickListener),this.resetBtn&&this.resetBtn.removeEventListener("click",this.onResetBtnClickListener),window.$hsStepperCollection=window.$hsStepperCollection.filter((function(e){return e.element.el!==t.el}))},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=[]),window.$hsStepperCollection&&(window.$hsStepperCollection=window.$hsStepperCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll("[data-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(287)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=a),e.default=a},207:function(t,e,n){ /* * HSStrongPassword - * @version: 2.6.0 + * @version: 2.7.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. @@ -144,7 +144,7 @@ var i,o=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{ 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?@[\\\\\\]^_`{|}~",i.target&&i.init(),i}return o(e,t),e.prototype.targetInput=function(t){this.setStrength(t.target.value)},e.prototype.targetFocus=function(){this.isOpened=!0,this.hints.classList.remove("hidden"),this.hints.classList.add("block"),this.recalculateDirection()},e.prototype.targetBlur=function(){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=""},e.prototype.targetInputSecond=function(){this.setWeaknessText()},e.prototype.targetInputThird=function(){this.setRulesText()},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.onTargetInputListener=function(e){return t.targetInput(e)},this.target.addEventListener("input",this.onTargetInputListener)},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-pw-strength-hint]")||null,this.rules=Array.from(this.hints.querySelectorAll("[data-pw-strength-rule]"))||null,this.rules.forEach((function(e){var n,i=e.getAttribute("data-pw-strength-rule");(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.onTargetFocusListener=function(){return t.targetFocus()},this.onTargetBlurListener=function(){return t.targetBlur()},this.target.addEventListener("focus",this.onTargetFocusListener),this.target.addEventListener("blur",this.onTargetBlurListener))},e.prototype.buildWeakness=function(){var t=this;this.checkStrength(this.target.value),this.setWeaknessText(),this.onTargetInputSecondListener=function(){return setTimeout((function(){return t.targetInputSecond()}))},this.target.addEventListener("input",this.onTargetInputSecondListener)},e.prototype.buildRules=function(){var t=this;this.setRulesText(),this.onTargetInputThirdListener=function(){return setTimeout((function(){return t.targetInputThird()}))},this.target.addEventListener("input",this.onTargetInputThirdListener)},e.prototype.setWeaknessText=function(){var t=this.weakness.getAttribute("data-pw-strength-hint"),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-pw-strength-rule");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.strongPassword",this.el,i)},e.prototype.hideStrips=function(t){Array.from(this.el.children).forEach((function(e,n){n1&&!!i.el.closest("[data-toggle-password-group]"),i.target&&i.init(),i}return o(e,t),e.prototype.elementAction=function(){this.isShown?this.hide():this.show(),this.fireEvent("toggle",this.target),(0,l.dispatch)("toggle.toggle-select",this.el,this.target)},e.prototype.init=function(){var t=this;this.createCollection(window.$hsTogglePasswordCollection,this),this.isShown?this.show():this.hide(),this.onElementActionListener=function(){return t.elementAction()},this.el.addEventListener(this.eventType,this.onElementActionListener)},e.prototype.getMultipleToggles=function(){var t=this.el.closest("[data-toggle-password-group]").querySelectorAll("[data-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-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-toggle-password-group]").classList.remove("active")):(this.isShown=!1,this.el.classList.remove("active"));this.target.forEach((function(t){t.type="password"}))},e.prototype.destroy=function(){var t=this;this.isMultiple?this.el.closest("[data-toggle-password-group]").classList.remove("active"):this.el.classList.remove("active"),this.target.forEach((function(t){t.type="password"})),this.el.removeEventListener(this.eventType,this.onElementActionListener),this.isShown=!1,window.$hsTogglePasswordCollection=window.$hsTogglePasswordCollection.filter((function(e){return e.element.el!==t.el}))},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=[]),window.$hsTogglePasswordCollection&&(window.$hsTogglePasswordCollection=window.$hsTogglePasswordCollection.filter((function(t){var e=t.element;return document.contains(e.el)}))),document.querySelectorAll("[data-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(287)).default);window.addEventListener("load",(function(){a.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=a),e.default=a},487:function(t,e,n){ /* * HSTooltip - * @version: 2.6.0 + * @version: 2.7.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&&a{ +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.6.0 + * @version: 2.7.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(806),o=n(393),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},806:function(t,e){ +Object.defineProperty(e,"__esModule",{value:!0});var i=n(393),o=n(806),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,i=e.fn;t.includes(n)&&(null==i||i.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,i=e.collection;t.includes(n)&&window[i]instanceof Array&&(window[i]=[])}))}};"undefined"!=typeof window&&(window.HSStaticMethods=r),e.default=r},806:function(t,e){ /* - * @version: 2.6.0 + * @version: 2.7.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/flyonui.mjs b/flyonui.mjs deleted file mode 100644 index 8971319..0000000 --- a/flyonui.mjs +++ /dev/null @@ -1,173 +0,0 @@ -var e={316:(e,t,i)=>{function s(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){return e instanceof s(e).Element||e instanceof Element}function o(e){return e instanceof s(e).HTMLElement||e instanceof HTMLElement}function l(e){return"undefined"!=typeof ShadowRoot&&(e instanceof s(e).ShadowRoot||e instanceof ShadowRoot)}i.d(t,{n4:()=>me});var r=Math.max,a=Math.min,d=Math.round;function c(){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 h(){return!/^((?!chrome|android).)*safari/i.test(c())}function u(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var l=e.getBoundingClientRect(),r=1,a=1;t&&o(e)&&(r=e.offsetWidth>0&&d(l.width)/e.offsetWidth||1,a=e.offsetHeight>0&&d(l.height)/e.offsetHeight||1);var c=(n(e)?s(e):window).visualViewport,u=!h()&&i,p=(l.left+(u&&c?c.offsetLeft:0))/r,m=(l.top+(u&&c?c.offsetTop:0))/a,g=l.width/r,v=l.height/a;return{width:g,height:v,top:m,right:p+g,bottom:m+v,left:p,x:p,y:m}}function p(e){var t=s(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function m(e){return e?(e.nodeName||"").toLowerCase():null}function g(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function v(e){return u(g(e)).left+p(e).scrollLeft}function f(e){return s(e).getComputedStyle(e)}function w(e){var t=f(e),i=t.overflow,s=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+n+s)}function y(e,t,i){void 0===i&&(i=!1);var n,l,r=o(t),a=o(t)&&function(e){var t=e.getBoundingClientRect(),i=d(t.width)/e.offsetWidth||1,s=d(t.height)/e.offsetHeight||1;return 1!==i||1!==s}(t),c=g(t),h=u(e,a,i),f={scrollLeft:0,scrollTop:0},y={x:0,y:0};return(r||!r&&!i)&&(("body"!==m(t)||w(c))&&(f=(n=t)!==s(n)&&o(n)?{scrollLeft:(l=n).scrollLeft,scrollTop:l.scrollTop}:p(n)),o(t)?((y=u(t,!0)).x+=t.clientLeft,y.y+=t.clientTop):c&&(y.x=v(c))),{x:h.left+f.scrollLeft-y.x,y:h.top+f.scrollTop-y.y,width:h.width,height:h.height}}function b(e){var t=u(e),i=e.offsetWidth,s=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:s}}function C(e){return"html"===m(e)?e:e.assignedSlot||e.parentNode||(l(e)?e.host:null)||g(e)}function S(e){return["html","body","#document"].indexOf(m(e))>=0?e.ownerDocument.body:o(e)&&w(e)?e:S(C(e))}function L(e,t){var i;void 0===t&&(t=[]);var n=S(e),o=n===(null==(i=e.ownerDocument)?void 0:i.body),l=s(n),r=o?[l].concat(l.visualViewport||[],w(n)?n:[]):n,a=t.concat(r);return o?a:a.concat(L(C(r)))}function I(e){return["table","td","th"].indexOf(m(e))>=0}function x(e){return o(e)&&"fixed"!==f(e).position?e.offsetParent:null}function E(e){for(var t=s(e),i=x(e);i&&I(i)&&"static"===f(i).position;)i=x(i);return i&&("html"===m(i)||"body"===m(i)&&"static"===f(i).position)?t:i||function(e){var t=/firefox/i.test(c());if(/Trident/i.test(c())&&o(e)&&"fixed"===f(e).position)return null;var i=C(e);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)||t&&"filter"===s.willChange||t&&s.filter&&"none"!==s.filter)return i;i=i.parentNode}return null}(e)||t}var k="top",T="bottom",A="right",O="left",$="auto",P=[k,T,A,O],D="start",B="end",q="viewport",M="popper",N=P.reduce((function(e,t){return e.concat([t+"-"+D,t+"-"+B])}),[]),H=[].concat(P,[$]).reduce((function(e,t){return e.concat([t,t+"-"+D,t+"-"+B])}),[]),F=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function V(e){var t=new Map,i=new Set,s=[];function n(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!i.has(e)){var s=t.get(e);s&&n(s)}})),s.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){i.has(e.name)||n(e)})),s}var R={placement:"bottom",modifiers:[],strategy:"absolute"};function j(){for(var e=arguments.length,t=new Array(e),i=0;i=0?"x":"y"}function K(e){var t,i=e.reference,s=e.element,n=e.placement,o=n?z(n):null,l=n?J(n):null,r=i.x+i.width/2-s.width/2,a=i.y+i.height/2-s.height/2;switch(o){case k:t={x:r,y:i.y-s.height};break;case T:t={x:r,y:i.y+i.height};break;case A:t={x:i.x+i.width,y:a};break;case O:t={x:i.x-s.width,y:a};break;default:t={x:i.x,y:i.y}}var d=o?Q(o):null;if(null!=d){var c="y"===d?"height":"width";switch(l){case D:t[d]=t[d]-(i[c]/2-s[c]/2);break;case B:t[d]=t[d]+(i[c]/2-s[c]/2)}}return t}var X={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Z(e){var t,i=e.popper,n=e.popperRect,o=e.placement,l=e.variation,r=e.offsets,a=e.position,c=e.gpuAcceleration,h=e.adaptive,u=e.roundOffsets,p=e.isFixed,m=r.x,v=void 0===m?0:m,w=r.y,y=void 0===w?0:w,b="function"==typeof u?u({x:v,y}):{x:v,y};v=b.x,y=b.y;var C=r.hasOwnProperty("x"),S=r.hasOwnProperty("y"),L=O,I=k,x=window;if(h){var $=E(i),P="clientHeight",D="clientWidth";if($===s(i)&&"static"!==f($=g(i)).position&&"absolute"===a&&(P="scrollHeight",D="scrollWidth"),o===k||(o===O||o===A)&&l===B)I=T,y-=(p&&$===x&&x.visualViewport?x.visualViewport.height:$[P])-n.height,y*=c?1:-1;if(o===O||(o===k||o===T)&&l===B)L=A,v-=(p&&$===x&&x.visualViewport?x.visualViewport.width:$[D])-n.width,v*=c?1:-1}var q,M=Object.assign({position:a},h&&X),N=!0===u?function(e,t){var i=e.x,s=e.y,n=t.devicePixelRatio||1;return{x:d(i*n)/n||0,y:d(s*n)/n||0}}({x:v,y},s(i)):{x:v,y};return v=N.x,y=N.y,c?Object.assign({},M,((q={})[I]=S?"0":"",q[L]=C?"0":"",q.transform=(x.devicePixelRatio||1)<=1?"translate("+v+"px, "+y+"px)":"translate3d("+v+"px, "+y+"px, 0)",q)):Object.assign({},M,((t={})[I]=S?y+"px":"",t[L]=C?v+"px":"",t.transform="",t))}const G={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,s=e.name,n=i.offset,o=void 0===n?[0,0]:n,l=H.reduce((function(e,i){return e[i]=function(e,t,i){var s=z(e),n=[O,k].indexOf(s)>=0?-1:1,o="function"==typeof i?i(Object.assign({},t,{placement:e})):i,l=o[0],r=o[1];return l=l||0,r=(r||0)*n,[O,A].indexOf(s)>=0?{x:r,y:l}:{x:l,y:r}}(i,t.rects,o),e}),{}),r=l[t.placement],a=r.x,d=r.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=a,t.modifiersData.popperOffsets.y+=d),t.modifiersData[s]=l}};var _={left:"right",right:"left",bottom:"top",top:"bottom"};function Y(e){return e.replace(/left|right|bottom|top/g,(function(e){return _[e]}))}var ee={start:"end",end:"start"};function te(e){return e.replace(/start|end/g,(function(e){return ee[e]}))}function ie(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&l(i)){var s=t;do{if(s&&e.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function se(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ne(e,t,i){return t===q?se(function(e,t){var i=s(e),n=g(e),o=i.visualViewport,l=n.clientWidth,r=n.clientHeight,a=0,d=0;if(o){l=o.width,r=o.height;var c=h();(c||!c&&"fixed"===t)&&(a=o.offsetLeft,d=o.offsetTop)}return{width:l,height:r,x:a+v(e),y:d}}(e,i)):n(t)?function(e,t){var i=u(e,!1,"fixed"===t);return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}(t,i):se(function(e){var t,i=g(e),s=p(e),n=null==(t=e.ownerDocument)?void 0:t.body,o=r(i.scrollWidth,i.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),l=r(i.scrollHeight,i.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-s.scrollLeft+v(e),d=-s.scrollTop;return"rtl"===f(n||i).direction&&(a+=r(i.clientWidth,n?n.clientWidth:0)-o),{width:o,height:l,x:a,y:d}}(g(e)))}function oe(e,t,i,s){var l="clippingParents"===t?function(e){var t=L(C(e)),i=["absolute","fixed"].indexOf(f(e).position)>=0&&o(e)?E(e):e;return n(i)?t.filter((function(e){return n(e)&&ie(e,i)&&"body"!==m(e)})):[]}(e):[].concat(t),d=[].concat(l,[i]),c=d[0],h=d.reduce((function(t,i){var n=ne(e,i,s);return t.top=r(n.top,t.top),t.right=a(n.right,t.right),t.bottom=a(n.bottom,t.bottom),t.left=r(n.left,t.left),t}),ne(e,c,s));return h.width=h.right-h.left,h.height=h.bottom-h.top,h.x=h.left,h.y=h.top,h}function le(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function re(e,t){return t.reduce((function(t,i){return t[i]=e,t}),{})}function ae(e,t){void 0===t&&(t={});var i=t,s=i.placement,o=void 0===s?e.placement:s,l=i.strategy,r=void 0===l?e.strategy:l,a=i.boundary,d=void 0===a?"clippingParents":a,c=i.rootBoundary,h=void 0===c?q:c,p=i.elementContext,m=void 0===p?M:p,v=i.altBoundary,f=void 0!==v&&v,w=i.padding,y=void 0===w?0:w,b=le("number"!=typeof y?y:re(y,P)),C=m===M?"reference":M,S=e.rects.popper,L=e.elements[f?C:m],I=oe(n(L)?L:L.contextElement||g(e.elements.popper),d,h,r),x=u(e.elements.reference),E=K({reference:x,element:S,strategy:"absolute",placement:o}),O=se(Object.assign({},S,E)),$=m===M?O:x,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},B=e.modifiersData.offset;if(m===M&&B){var N=B[o];Object.keys(D).forEach((function(e){var t=[A,T].indexOf(e)>=0?1:-1,i=[k,T].indexOf(e)>=0?"y":"x";D[e]+=N[i]*t}))}return D}function de(e,t,i){return r(e,a(t,i))}const ce={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,s=e.name,n=i.mainAxis,o=void 0===n||n,l=i.altAxis,d=void 0!==l&&l,c=i.boundary,h=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,w=ae(t,{boundary:c,rootBoundary:h,padding:p,altBoundary:u}),y=z(t.placement),C=J(t.placement),S=!C,L=Q(y),I="x"===L?"y":"x",x=t.modifiersData.popperOffsets,$=t.rects.reference,P=t.rects.popper,B="function"==typeof f?f(Object.assign({},t.rects,{placement:t.placement})):f,q="number"==typeof B?{mainAxis:B,altAxis:B}:Object.assign({mainAxis:0,altAxis:0},B),M=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,N={x:0,y:0};if(x){if(o){var H,F="y"===L?k:O,V="y"===L?T:A,R="y"===L?"height":"width",j=x[L],W=j+w[F],U=j-w[V],K=g?-P[R]/2:0,X=C===D?$[R]:P[R],Z=C===D?-P[R]:-$[R],G=t.elements.arrow,_=g&&G?b(G):{width:0,height:0},Y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},ee=Y[F],te=Y[V],ie=de(0,$[R],_[R]),se=S?$[R]/2-K-ie-ee-q.mainAxis:X-ie-ee-q.mainAxis,ne=S?-$[R]/2+K+ie+te+q.mainAxis:Z+ie+te+q.mainAxis,oe=t.elements.arrow&&E(t.elements.arrow),le=oe?"y"===L?oe.clientTop||0:oe.clientLeft||0:0,re=null!=(H=null==M?void 0:M[L])?H:0,ce=j+ne-re,he=de(g?a(W,j+se-re-le):W,j,g?r(U,ce):U);x[L]=he,N[L]=he-j}if(d){var ue,pe="x"===L?k:O,me="x"===L?T:A,ge=x[I],ve="y"===I?"height":"width",fe=ge+w[pe],we=ge-w[me],ye=-1!==[k,O].indexOf(y),be=null!=(ue=null==M?void 0:M[I])?ue:0,Ce=ye?fe:ge-$[ve]-P[ve]-be+q.altAxis,Se=ye?ge+$[ve]+P[ve]-be-q.altAxis:we,Le=g&&ye?function(e,t,i){var s=de(e,t,i);return s>i?i:s}(Ce,ge,Se):de(g?Ce:fe,ge,g?Se:we);x[I]=Le,N[I]=Le-ge}t.modifiersData[s]=N}},requiresIfExists:["offset"]};const he={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,s=e.name,n=e.options,o=i.elements.arrow,l=i.modifiersData.popperOffsets,r=z(i.placement),a=Q(r),d=[O,A].indexOf(r)>=0?"height":"width";if(o&&l){var c=function(e,t){return le("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:re(e,P))}(n.padding,i),h=b(o),u="y"===a?k:O,p="y"===a?T:A,m=i.rects.reference[d]+i.rects.reference[a]-l[a]-i.rects.popper[d],g=l[a]-i.rects.reference[a],v=E(o),f=v?"y"===a?v.clientHeight||0:v.clientWidth||0:0,w=m/2-g/2,y=c[u],C=f-h[d]-c[p],S=f/2-h[d]/2+w,L=de(y,S,C),I=a;i.modifiersData[s]=((t={})[I]=L,t.centerOffset=L-S,t)}},effect:function(e){var t=e.state,i=e.options.element,s=void 0===i?"[data-popper-arrow]":i;null!=s&&("string"!=typeof s||(s=t.elements.popper.querySelector(s)))&&ie(t.elements.popper,s)&&(t.elements.arrow=s)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ue(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function pe(e){return[k,A,T,O].some((function(t){return e[t]>=0}))}var me=W({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,n=e.options,o=n.scroll,l=void 0===o||o,r=n.resize,a=void 0===r||r,d=s(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return l&&c.forEach((function(e){e.addEventListener("scroll",i.update,U)})),a&&d.addEventListener("resize",i.update,U),function(){l&&c.forEach((function(e){e.removeEventListener("scroll",i.update,U)})),a&&d.removeEventListener("resize",i.update,U)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=K({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,i=e.options,s=i.gpuAcceleration,n=void 0===s||s,o=i.adaptive,l=void 0===o||o,r=i.roundOffsets,a=void 0===r||r,d={placement:z(t.placement),variation:J(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:n,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Z(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:a})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Z(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),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 i=t.styles[e]||{},s=t.attributes[e]||{},n=t.elements[e];o(n)&&m(n)&&(Object.assign(n.style,i),Object.keys(s).forEach((function(e){var t=s[e];!1===t?n.removeAttribute(e):n.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach((function(e){var s=t.elements[e],n=t.attributes[e]||{},l=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce((function(e,t){return e[t]="",e}),{});o(s)&&m(s)&&(Object.assign(s.style,l),Object.keys(n).forEach((function(e){s.removeAttribute(e)})))}))}},requires:["computeStyles"]},G,{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,s=e.name;if(!t.modifiersData[s]._skip){for(var n=i.mainAxis,o=void 0===n||n,l=i.altAxis,r=void 0===l||l,a=i.fallbackPlacements,d=i.padding,c=i.boundary,h=i.rootBoundary,u=i.altBoundary,p=i.flipVariations,m=void 0===p||p,g=i.allowedAutoPlacements,v=t.options.placement,f=z(v),w=a||(f===v||!m?[Y(v)]:function(e){if(z(e)===$)return[];var t=Y(e);return[te(e),t,te(t)]}(v)),y=[v].concat(w).reduce((function(e,i){return e.concat(z(i)===$?function(e,t){void 0===t&&(t={});var i=t,s=i.placement,n=i.boundary,o=i.rootBoundary,l=i.padding,r=i.flipVariations,a=i.allowedAutoPlacements,d=void 0===a?H:a,c=J(s),h=c?r?N:N.filter((function(e){return J(e)===c})):P,u=h.filter((function(e){return d.indexOf(e)>=0}));0===u.length&&(u=h);var p=u.reduce((function(t,i){return t[i]=ae(e,{placement:i,boundary:n,rootBoundary:o,padding:l})[z(i)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:i,boundary:c,rootBoundary:h,padding:d,flipVariations:m,allowedAutoPlacements:g}):i)}),[]),b=t.rects.reference,C=t.rects.popper,S=new Map,L=!0,I=y[0],x=0;x=0,F=M?"width":"height",V=ae(t,{placement:E,boundary:c,rootBoundary:h,altBoundary:u,padding:d}),R=M?q?A:O:q?T:k;b[F]>C[F]&&(R=Y(R));var j=Y(R),W=[];if(o&&W.push(V[B]<=0),r&&W.push(V[R]<=0,V[j]<=0),W.every((function(e){return e}))){I=E,L=!1;break}S.set(E,W)}if(L)for(var U=function(e){var t=y.find((function(t){var i=S.get(t);if(i)return i.slice(0,e).every((function(e){return e}))}));if(t)return I=t,"break"},Q=m?3:1;Q>0;Q--){if("break"===U(Q))break}t.placement!==I&&(t.modifiersData[s]._skip=!0,t.placement=I,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},ce,he,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,s=t.rects.reference,n=t.rects.popper,o=t.modifiersData.preventOverflow,l=ae(t,{elementContext:"reference"}),r=ae(t,{altBoundary:!0}),a=ue(l,s),d=ue(r,n,o),c=pe(a),h=pe(d);t.modifiersData[i]={referenceClippingOffsets:a,popperEscapeOffsets:d,isReferenceHidden:c,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}}]})},179:(e,t,i)=>{i.d(t,{Fy:()=>o,In:()=>n,LO:()=>a,fp:()=>l,jU:()=>r,lP:()=>s});const s={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-start":"top-start","top-end":"top-end",bottom:"bottom","bottom-start":"bottom-start","bottom-end":"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","ArrowRight","ArrowLeft","Home","End","Enter"],o=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],l=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Space","Tab"],r=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],a={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},696:(e,t,i)=>{i.d(t,{A:()=>l});var s=i(392),n=i(709); -/* - * HSAccordion - * @version: 2.6.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(e,t,i){super(e,t,i),this.toggle=this.el.querySelector(".accordion-toggle")||null,this.content=this.el.querySelector(".accordion-content")||null,this.update(),this.toggle&&(this.isToggleStopPropagated=(0,s.PK)((0,s.gj)(this.toggle,"--stop-propagation","false")||"false")),this.toggle&&this.content&&this.init()}init(){this.createCollection(window.$hsAccordionCollection,this),this.onToggleClickListener=e=>this.toggleClick(e),this.toggle.addEventListener("click",this.onToggleClickListener)}toggleClick(e){this.isToggleStopPropagated&&e.stopPropagation(),this.el.classList.contains("active")?this.hide():this.show()}show(){var e;if(this.group&&!this.isAlwaysOpened&&this.group.querySelector(":scope > .accordion-item.active")&&this.group.querySelector(":scope > .accordion-item.active")!==this.el){window.$hsAccordionCollection.find((e=>e.element.el===this.group.querySelector(":scope > .accordion-item.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.accordion.item",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.accordion.item",this.el,this.el)}))}update(){if(this.group=this.el.closest(".accordion")||null,!this.group)return!1;this.isAlwaysOpened=this.group.hasAttribute("data-accordion-always-open")||!1,window.$hsAccordionCollection.map((e=>(e.id===this.el.id&&(e.element.group=this.group,e.element.isAlwaysOpened=this.isAlwaysOpened),e)))}destroy(){var e;(null===(e=null==o?void 0:o.selectable)||void 0===e?void 0:e.length)&&o.selectable.forEach((e=>{e.listeners.forEach((({el:e,listener:t})=>{e.removeEventListener("click",t)}))})),this.onToggleClickListener&&this.toggle.removeEventListener("click",this.onToggleClickListener),this.toggle=null,this.content=null,this.group=null,this.onToggleClickListener=null,window.$hsAccordionCollection=window.$hsAccordionCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t){const i=window.$hsAccordionCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.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=[]),window.$hsAccordionCollection&&(window.$hsAccordionCollection=window.$hsAccordionCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll(".accordion-item:not(.--prevent-on-load-init)").forEach((e=>{window.$hsAccordionCollection.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 treeView(){if(!document.querySelectorAll(".accordion-treeview-root").length)return!1;this.selectable=[],document.querySelectorAll(".accordion-treeview-root").forEach((e=>{const t=null==e?void 0:e.getAttribute("data-accordion-options"),i=t?JSON.parse(t):{};this.selectable.push({el:e,options:Object.assign({},i),listeners:[]})})),this.selectable.length&&this.selectable.forEach((e=>{const{el:t}=e;t.querySelectorAll(".accordion-selectable").forEach((t=>{const i=i=>this.onSelectableClick(i,e,t);t.addEventListener("click",i),e.listeners.push({el:t,listener:i})}))}))}static toggleSelected(e,t){t.classList.contains("selected")?t.classList.remove("selected"):(e.el.querySelectorAll(".accordion-selectable").forEach((e=>e.classList.remove("selected"))),t.classList.add("selected"))}static on(e,t,i){const s=window.$hsAccordionCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));s&&(s.element.events[e]=i)}}o.onSelectableClick=(e,t,i)=>{e.stopPropagation(),o.toggleSelected(t,i)},window.addEventListener("load",(()=>{o.autoInit(),document.querySelectorAll(".accordion-treeview-root").length&&o.treeView()})),"undefined"!=typeof window&&(window.HSAccordion=o);const l=o},709:(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}}},376:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(392),n=i(709),o=i(179); -/* - * HSCarousel - * @version: 2.6.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){var i,s,n,o,l;super(e,t);const r=e.getAttribute("data-carousel"),a=r?JSON.parse(r):{},d=Object.assign(Object.assign({},a),t);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(".carousel")||null,this.inner=this.el.querySelector(".carousel-body")||null,this.slides=this.el.querySelectorAll(".carousel-slide")||[],this.prev=this.el.querySelector(".carousel-prev")||null,this.next=this.el.querySelector(".carousel-next")||null,this.dots=this.el.querySelector(".carousel-pagination")||null,this.info=this.el.querySelector(".carousel-info")||null,this.infoTotal=(null===(o=null==this?void 0:this.info)||void 0===o?void 0:o.querySelector(".carousel-info-total"))||null,this.infoCurrent=(null===(l=null==this?void 0:this.info)||void 0===l?void 0:l.querySelector(".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 e=this.container.getBoundingClientRect(),t=e.left+e.width/2;let i=null,s=null,n=1/0;Array.from(this.inner.children).forEach((e=>{const s=e.getBoundingClientRect(),o=this.inner.getBoundingClientRect(),l=s.left+s.width/2-o.left,r=Math.abs(t-(o.left+l));re===i))),this.setIndex(s),this.dots&&this.setCurrentDot()}prevClick(){this.goToPrev(),this.isAutoPlay&&(this.resetTimer(),this.setTimer())}nextClick(){this.goToNext(),this.isAutoPlay&&(this.resetTimer(),this.setTimer())}containerScroll(){clearTimeout(this.isScrolling),this.isScrolling=setTimeout((()=>{this.setIsSnap()}),100)}elementTouchStart(e){this.touchX.start=e.changedTouches[0].screenX}elementTouchEnd(e){this.touchX.end=e.changedTouches[0].screenX,this.detectDirection()}innerMouseDown(e){this.handleDragStart(e)}innerTouchStart(e){this.handleDragStart(e)}documentMouseMove(e){this.handleDragMove(e)}documentTouchMove(e){this.handleDragMove(e)}documentMouseUp(){this.handleDragEnd()}documentTouchEnd(){this.handleDragEnd()}dotClick(e){this.goTo(e),this.isAutoPlay&&(this.resetTimer(),this.setTimer())}init(){this.createCollection(window.$hsCarouselCollection,this),this.inner&&(this.calculateWidth(),this.isDraggable&&!this.isSnap&&this.initDragHandling()),this.prev&&(this.onPrevClickListener=()=>this.prevClick(),this.prev.addEventListener("click",this.onPrevClickListener)),this.next&&(this.onNextClickListener=()=>this.nextClick(),this.next.addEventListener("click",this.onNextClickListener)),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.onContainerScrollListener=()=>this.containerScroll(),this.container.addEventListener("scroll",this.onContainerScrollListener)),this.el.classList.add("init"),this.isSnap||(this.onElementTouchStartListener=e=>this.elementTouchStart(e),this.onElementTouchEndListener=e=>this.elementTouchEnd(e),this.el.addEventListener("touchstart",this.onElementTouchStartListener),this.el.addEventListener("touchend",this.onElementTouchEndListener)),this.observeResize()}initDragHandling(){const e=this.inner;this.onInnerMouseDownListener=e=>this.innerMouseDown(e),this.onInnerTouchStartListener=e=>this.innerTouchStart(e),this.onDocumentMouseMoveListener=e=>this.documentMouseMove(e),this.onDocumentTouchMoveListener=e=>this.documentTouchMove(e),this.onDocumentMouseUpListener=()=>this.documentMouseUp(),this.onDocumentTouchEndListener=()=>this.documentTouchEnd(),e&&(e.addEventListener("mousedown",this.onInnerMouseDownListener),e.addEventListener("touchstart",this.onInnerTouchStartListener,{passive:!0}),document.addEventListener("mousemove",this.onDocumentMouseMoveListener),document.addEventListener("touchmove",this.onDocumentTouchMoveListener,{passive:!1}),document.addEventListener("mouseup",this.onDocumentMouseUpListener),document.addEventListener("touchend",this.onDocumentTouchEndListener))}getTranslateXValue(){var e;const t=window.getComputedStyle(this.inner).transform;if("none"!==t){const i=null===(e=t.match(/matrix.*\((.+)\)/))||void 0===e?void 0:e[1].split(", ");if(i){let e=parseFloat(6===i.length?i[4]:i[12]);return this.isRTL&&(e=-e),isNaN(e)||0===e?0:-e}}return 0}removeClickEventWhileDragging(e){e.preventDefault()}handleDragStart(e){e.preventDefault(),this.isDragging=!0,this.dragStartX=this.getEventX(e),this.initialTranslateX=this.isRTL?this.getTranslateXValue():-this.getTranslateXValue(),this.inner.classList.add("dragging")}handleDragMove(e){if(!this.isDragging)return;this.inner.querySelectorAll("a:not(.prevented-click)").forEach((e=>{e.classList.add("prevented-click"),e.addEventListener("click",this.removeClickEventWhileDragging)}));let t=this.getEventX(e)-this.dragStartX;this.isRTL&&(t=-t);const i=this.initialTranslateX+t;this.setTranslate((()=>{let e=this.sliderWidth*this.slides.length/this.getCurrentSlidesQty()-this.sliderWidth;const t=this.sliderWidth,s=(t-t/this.getCurrentSlidesQty())/2,n=this.isCentered?s:0;this.isCentered&&(e+=s);const o=-e;return this.isRTL?ie?o:-i:i>n?n:i<-e?o:i})())}handleDragEnd(){if(!this.isDragging)return;this.isDragging=!1;const e=this.sliderWidth/this.getCurrentSlidesQty(),t=this.getTranslateXValue();let i=Math.round(t/e);this.isRTL&&(i=Math.round(t/e)),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((e=>{e.classList.remove("prevented-click"),e.removeEventListener("click",this.removeClickEventWhileDragging)}))}))}getEventX(e){return e instanceof MouseEvent?e.clientX:e.touches[0].clientX}getCurrentSlidesQty(){if("object"==typeof this.slidesQty){const e=document.body.clientWidth;let t=0;return Object.keys(this.slidesQty).forEach((i=>{e>=(typeof i+1=="number"?this.slidesQty[i]:o.LO[i])&&(t=this.slidesQty[i])})),t}return this.slidesQty}buildSnapSpacers(){const e=this.inner.querySelector(".snap-before"),t=this.inner.querySelector(".snap-after");e&&e.remove(),t&&t.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(".carousel-pagination-item").length?this.setDots():this.buildDots(),this.dots&&this.setCurrentDot()}buildDots(){this.dots.innerHTML="";const e=!this.isCentered&&this.slidesQty?this.slides.length-(this.getCurrentSlidesQty()-1):this.slides.length;for(let t=0;t{const i=e.getAttribute("data-carousel-pagination-item-target");this.singleDotEvents(e,i?+i:t)}))}goToCurrentDot(){const e=this.dots,t=e.getBoundingClientRect(),i=e.scrollLeft,s=e.scrollTop,n=e.clientWidth,o=e.clientHeight,l=this.dotsItems[this.currentIndex],r=l.getBoundingClientRect(),a=r.left-t.left+i,d=a+l.clientWidth,c=r.top-t.top+s,h=c+l.clientHeight;let u=i,p=s;(ai+n)&&(u=d-n),(cs+o)&&(p=h-o),e.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(e){const t=(0,s.fc)("");return this.dotsItemClasses&&(0,s.en)(this.dotsItemClasses,t),this.singleDotEvents(t,e),t}singleDotEvents(e,t){this.onDotClickListener=()=>this.dotClick(t),e.addEventListener("click",this.onDotClickListener)}observeResize(){new ResizeObserver((0,s.sg)((e=>{for(let t of e){const e=t.contentRect.width;e!==this.resizeContainerWidth&&(this.recalculateWidth(),this.dots&&this.initDots(),this.addCurrentClass(),this.resizeContainerWidth=e)}}),this.updateDelay)).observe(this.resizeContainer)}calculateWidth(){this.isSnap||(this.inner.style.width=this.sliderWidth*this.slides.length/this.getCurrentSlidesQty()+"px"),this.slides.forEach((e=>{e.style.width=this.sliderWidth/this.getCurrentSlidesQty()+"px"})),this.calculateTransform()}addCurrentClass(){if(this.isSnap){const e=Math.floor(this.getCurrentSlidesQty()/2);for(let t=0;t=this.currentIndex-e?i.classList.add("active"):i.classList.remove("active")}}else{const e=this.isCentered?this.currentIndex+this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.currentIndex+this.getCurrentSlidesQty();this.slides.forEach(((t,i)=>{i>=this.currentIndex&&i{let i=!1;const s=Math.floor(this.getCurrentSlidesQty()/2);i=this.isSnap&&!this.hasSnapSpacers?t===(this.getCurrentSlidesQty()%2==0?this.currentIndex-s+1:this.currentIndex-s):t===this.currentIndex,i?e.classList.add("active"):e.classList.remove("active")};this.dotsItems?this.dotsItems.forEach(((t,i)=>e(t,i))):this.dots.querySelectorAll(":scope > *").forEach(((t,i)=>e(t,i)))}setElementToDisabled(e){e.classList.add("disabled"),"BUTTON"!==e.tagName&&"INPUT"!==e.tagName||e.setAttribute("disabled","disabled")}unsetElementToDisabled(e){e.classList.remove("disabled"),"BUTTON"!==e.tagName&&"INPUT"!==e.tagName||e.removeAttribute("disabled")}addDisabledClass(){if(!this.prev||!this.next)return!1;const e=getComputedStyle(this.inner).getPropertyValue("gap"),t=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-t-1,n=this.hasSnapSpacers?0===i:this.getCurrentSlidesQty()%2==0?i-t<0:i-t==0,o=i>=s&&this.container.scrollLeft+this.container.clientWidth+(parseFloat(e)||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:e,end:t}=this.touchX;te&&this.goToPrev()}calculateTransform(e){void 0!==e&&(this.currentIndex=e),this.currentIndex>this.slides.length-this.getCurrentSlidesQty()&&!this.isCentered&&(this.currentIndex=this.slides.length-this.getCurrentSlidesQty());const t=this.sliderWidth,i=t/this.getCurrentSlidesQty();let s=this.currentIndex*i;if(this.isSnap&&!this.isCentered&&this.container.scrollLeftt&&(this.container.scrollLeft=this.container.scrollWidth),this.isCentered&&!this.isSnap){const e=(t-i)/2;if(0===this.currentIndex)s=-e;else if(this.currentIndex>=this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1)){s=this.slides.length*i-t+e}else s=this.currentIndex*i-e}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(e){this.inner.style.transform=this.isRTL?`translate(${-e}px, 0px)`:`translate(${e}px, 0px)`}setIndex(e){this.currentIndex=e,this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}recalculateWidth(){this.sliderWidth=this.inner.parentElement.getBoundingClientRect().width,this.calculateWidth(),this.sliderWidth!==this.inner.parentElement.getBoundingClientRect().width&&this.recalculateWidth()}goToPrev(){if(this.currentIndex>0?this.currentIndex--:this.currentIndex=this.slides.length-this.getCurrentSlidesQty(),this.isSnap){const e=this.sliderWidth/this.getCurrentSlidesQty();this.container.scrollBy({left:Math.max(-this.container.scrollLeft,-e),behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()}goToNext(){const e=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty();if(this.currentIndexthis.currentIndex?t-this.currentIndex:this.currentIndex-t,s=t>this.currentIndex?-e*i:e*i;this.container.scrollBy({left:s,behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()}destroy(){var e,t;if(this.loadingClassesAdd&&("string"==typeof this.loadingClassesAdd?this.inner.classList.remove(this.loadingClassesAdd):this.inner.classList.remove(...this.loadingClassesAdd)),this.inner&&this.afterLoadingClassesAdd&&setTimeout((()=>{"string"==typeof this.afterLoadingClassesAdd?this.inner.classList.remove(this.afterLoadingClassesAdd):this.inner.classList.remove(...this.afterLoadingClassesAdd)})),this.el.classList.remove("init"),this.inner.classList.remove("dragging"),this.slides.forEach((e=>e.classList.remove("active"))),(null===(e=null==this?void 0:this.dotsItems)||void 0===e?void 0:e.length)&&this.dotsItems.forEach((e=>e.classList.remove("active"))),this.prev.classList.remove("disabled"),this.next.classList.remove("disabled"),this.inner.style.width="",this.slides.forEach((e=>e.style.width="")),this.isSnap||(this.inner.style.transform=""),this.isAutoHeight&&(this.inner.style.height=""),this.prev.removeEventListener("click",this.onPrevClickListener),this.next.removeEventListener("click",this.onNextClickListener),this.container.removeEventListener("scroll",this.onContainerScrollListener),this.el.removeEventListener("touchstart",this.onElementTouchStartListener),this.el.removeEventListener("touchend",this.onElementTouchEndListener),this.inner.removeEventListener("mousedown",this.onInnerMouseDownListener),this.inner.removeEventListener("touchstart",this.onInnerTouchStartListener),document.removeEventListener("mousemove",this.onDocumentMouseMoveListener),document.removeEventListener("touchmove",this.onDocumentTouchMoveListener),document.removeEventListener("mouseup",this.onDocumentMouseUpListener),document.removeEventListener("touchend",this.onDocumentTouchEndListener),this.inner.querySelectorAll("a:not(.prevented-click)").forEach((e=>{e.classList.remove("prevented-click"),e.removeEventListener("click",this.removeClickEventWhileDragging)})),(null===(t=null==this?void 0:this.dotsItems)||void 0===t?void 0:t.length)||this.dots.querySelectorAll(":scope > *").length){((null==this?void 0:this.dotsItems)||this.dots.querySelectorAll(":scope > *")).forEach((e=>e.removeEventListener("click",this.onDotClickListener))),this.dots.innerHTML=null}this.inner.querySelector(".snap-before").remove(),this.inner.querySelector(".snap-after").remove(),this.dotsItems=null,this.isDragging=!1,this.dragStartX=null,this.initialTranslateX=null,window.$hsCarouselCollection=window.$hsCarouselCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t){const i=window.$hsCarouselCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element:null}static autoInit(){window.$hsCarouselCollection||(window.$hsCarouselCollection=[]),window.$hsCarouselCollection&&(window.$hsCarouselCollection=window.$hsCarouselCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-carousel]:not(.--prevent-on-load-init)").forEach((e=>{window.$hsCarouselCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))||new l(e)}))}}window.addEventListener("load",(()=>{l.autoInit()})),"undefined"!=typeof window&&(window.HSCarousel=l);const r=l},729:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(392),n=i(709),o=i(479); -/* - * HSCollapse - * @version: 2.6.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,i){super(e,t,i),this.contentId=this.el.dataset.collapse,this.content=document.querySelector(this.contentId),this.animationInProcess=!1,this.content&&this.init()}elementClick(){this.content.classList.contains("open")?this.hide():this.show()}init(){var e;this.createCollection(window.$hsCollapseCollection,this),this.onElementClickListener=()=>this.elementClick(),(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.onElementClickListener)}hideAllMegaMenuItems(){this.content.querySelectorAll("mega-menu-content.block").forEach((e=>{e.classList.remove("block"),e.classList.add("hidden")}))}closeDropdowns(){if(!this.content)return;this.content.querySelectorAll(".dropdown").forEach((e=>{try{const t=o.A.getInstance(e,!0);if(!(null==t?void 0:t.element))return;e instanceof HTMLElement&&e.classList.contains("open")&&t.element.close(!1)}catch(e){console.warn("Error closing dropdown:",e)}}))}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,s.JD)("beforeOpen.collapse",this.el,this.el)})),(0,s.yd)(this.content,(()=>{this.content.style.height="",this.fireEvent("open",this.el),(0,s.JD)("open.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,s.yd)(this.content,(()=>{this.content.classList.add("hidden"),this.content.style.height="",this.fireEvent("hide",this.el),(0,s.JD)("hide.collapse",this.el,this.el),this.animationInProcess=!1})),this.content.querySelectorAll(".mega-menu-content.block").length&&this.hideAllMegaMenuItems(),this.closeDropdowns()}destroy(){this.el.removeEventListener("click",this.onElementClickListener),this.content=null,this.animationInProcess=!1,window.$hsCollapseCollection=window.$hsCollapseCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t=!1){const i=window.$hsCollapseCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element.el:null}static autoInit(){window.$hsCollapseCollection||(window.$hsCollapseCollection=[]),window.$hsCollapseCollection&&(window.$hsCollapseCollection=window.$hsCollapseCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll(".collapse-toggle:not(.--prevent-on-load-init)").forEach((e=>{window.$hsCollapseCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.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,i){const s=window.$hsCollapseCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));s&&(s.element.events[e]=i)}}window.addEventListener("load",(()=>{l.autoInit()})),"undefined"!=typeof window&&(window.HSCollapse=l);const r=l},421:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(392),n=i(709),o=i(179),l=function(e,t,i,s){return new(i||(i=Promise))((function(n,o){function l(e){try{a(s.next(e))}catch(e){o(e)}}function r(e){try{a(s.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(l,r)}a((s=s.apply(e,t||[])).next())}))};class r extends n.A{constructor(e,t,i){var s,n,o,l,r,a,d,c,h,u,p,m,g,v,f,w,y,b,C,S,L,I,x,E,k,T,A;super(e,t,i);const O=e.getAttribute("data-combo-box"),$=O?JSON.parse(O):{},P=Object.assign(Object.assign({},$),t);this.gap=6,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!==(n=null==P?void 0:P.preventVisibility)&&void 0!==n&&n,this.apiUrl=null!==(o=null==P?void 0:P.apiUrl)&&void 0!==o?o:null,this.apiDataPart=null!==(l=null==P?void 0:P.apiDataPart)&&void 0!==l?l:null,this.apiQuery=null!==(r=null==P?void 0:P.apiQuery)&&void 0!==r?r:null,this.apiSearchQuery=null!==(a=null==P?void 0:P.apiSearchQuery)&&void 0!==a?a:null,this.apiSearchPath=null!==(d=null==P?void 0:P.apiSearchPath)&&void 0!==d?d:null,this.apiSearchDefaultPath=null!==(c=null==P?void 0:P.apiSearchDefaultPath)&&void 0!==c?c:null,this.apiHeaders=null!==(h=null==P?void 0:P.apiHeaders)&&void 0!==h?h:{},this.apiGroupField=null!==(u=null==P?void 0:P.apiGroupField)&&void 0!==u?u:null,this.outputItemTemplate=null!==(p=null==P?void 0:P.outputItemTemplate)&&void 0!==p?p:'',this.outputEmptyTemplate=null!==(m=null==P?void 0:P.outputEmptyTemplate)&&void 0!==m?m:'',this.outputLoaderTemplate=null!==(g=null==P?void 0:P.outputLoaderTemplate)&&void 0!==g?g:'',this.groupingType=null!==(v=null==P?void 0:P.groupingType)&&void 0!==v?v:null,this.groupingTitleTemplate=null!==(f=null==P?void 0:P.groupingTitleTemplate)&&void 0!==f?f:"default"===this.groupingType?'
':'',this.tabsWrapperTemplate=null!==(w=null==P?void 0:P.tabsWrapperTemplate)&&void 0!==w?w:'
',this.preventSelection=null!==(y=null==P?void 0:P.preventSelection)&&void 0!==y&&y,this.preventAutoPosition=null!==(b=null==P?void 0:P.preventAutoPosition)&&void 0!==b&&b,this.isOpenOnFocus=null!==(C=null==P?void 0:P.isOpenOnFocus)&&void 0!==C&&C,this.input=null!==(S=this.el.querySelector("[data-combo-box-input]"))&&void 0!==S?S:null,this.output=null!==(L=this.el.querySelector("[data-combo-box-output]"))&&void 0!==L?L:null,this.itemsWrapper=null!==(I=this.el.querySelector("[data-combo-box-output-items-wrapper]"))&&void 0!==I?I:null,this.items=null!==(x=Array.from(this.el.querySelectorAll("[data-combo-box-output-item]")))&&void 0!==x?x:[],this.tabs=[],this.toggle=null!==(E=this.el.querySelector("[data-combo-box-toggle]"))&&void 0!==E?E:null,this.toggleClose=null!==(k=this.el.querySelector("[data-combo-box-close]"))&&void 0!==k?k:null,this.toggleOpen=null!==(T=this.el.querySelector("[data-combo-box-open]"))&&void 0!==T?T:null,this.outputPlaceholder=null,this.selected=this.value=null!==(A=this.el.querySelector("[data-combo-box-input]").value)&&void 0!==A?A:"",this.currentData=null,this.isOpened=!1,this.isCurrent=!1,this.animationInProcess=!1,this.selectedGroup="all",this.init()}inputFocus(){this.isOpened||(this.setResultAndRender(),this.open())}inputInput(e){this.setResultAndRender(e.target.value),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),this.isOpened||this.open()}toggleClick(){this.isOpened?this.close():this.open(this.toggle.getAttribute("data-combo-box-toggle"))}toggleCloseClick(){this.close()}toggleOpenClick(){this.open()}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()}getNestedProperty(e,t){return t.split(".").reduce(((e,t)=>e&&e[t]),e)}setValue(e,t=null){this.selected=e,this.value=e,this.input.value=e,t&&(this.currentData=t),this.fireEvent("select",this.currentData),(0,s.JD)("select.combobox",this.el,this.currentData)}setValueAndOpen(e){this.value=e,this.items.length&&this.setItemsVisibility()}setValueAndClear(e,t=null){e?this.setValue(e,t):this.setValue(this.selected,t),this.outputPlaceholder&&this.destroyOutputPlaceholder()}setSelectedByValue(e){this.items.forEach((t=>{this.isTextExists(t,e)?t.classList.add("selected"):t.classList.remove("selected")}))}setResultAndRender(e=""){let t=this.preventVisibility?this.input.value:e;this.setResults(t),(this.apiSearchQuery||this.apiSearchPath||this.apiSearchDefaultPath)&&this.itemsFromJson()}setResults(e){this.value=e,this.resultItems(),this.hasVisibleItems()?this.destroyOutputPlaceholder():this.buildOutputPlaceholder()}setGroups(){const e=[];this.items.forEach((t=>{const{group:i}=JSON.parse(t.getAttribute("data-combo-box-output-item"));e.some((e=>(null==e?void 0:e.name)===i.name))||e.push(i)})),this.groups=e}setApiGroups(e){const t=[];e.forEach((e=>{const i=e[this.apiGroupField];t.some((e=>e.name===i))||t.push({name:i,title:i})})),this.groups=t}setItemsVisibility(){"tabs"===this.groupingType&&"all"!==this.selectedGroup&&this.items.forEach((e=>{e.style.display="none"}));const e="tabs"===this.groupingType?"all"===this.selectedGroup?this.items:this.items.filter((e=>{const{group:t}=JSON.parse(e.getAttribute("data-combo-box-output-item"));return t.name===this.selectedGroup})):this.items;"tabs"===this.groupingType&&"all"!==this.selectedGroup&&e.forEach((e=>{e.style.display="block"})),e.forEach((e=>{this.isTextExistsAny(e,this.value)?e.style.display="block":e.style.display="none"})),"default"===this.groupingType&&this.output.querySelectorAll("[data-combo-box-group-title]").forEach((e=>{const t=e.getAttribute("data-combo-box-group-title");this.items.filter((e=>{const{group:i}=JSON.parse(e.getAttribute("data-combo-box-output-item"));return i.name===t&&"block"===e.style.display})).length?e.style.display="block":e.style.display="none"}))}isTextExists(e,t){const i=t.map((e=>e.toLowerCase()));return Array.from(e.querySelectorAll("[data-combo-box-search-text]")).some((e=>i.includes(e.getAttribute("data-combo-box-search-text").toLowerCase())))}isTextExistsAny(e,t){return Array.from(e.querySelectorAll("[data-combo-box-search-text]")).some((e=>e.getAttribute("data-combo-box-search-text").toLowerCase().includes(t.toLowerCase())))}hasVisibleItems(){return!!this.items.length&&this.items.some((e=>"block"===e.style.display))}valuesBySelector(e){return Array.from(e.querySelectorAll("[data-combo-box-search-text]")).reduce(((e,t)=>[...e,t.getAttribute("data-combo-box-search-text")]),[])}sortItems(){return this.items.sort(((e,t)=>{const i=e.querySelector("[data-combo-box-value]").getAttribute("data-combo-box-search-text"),s=t.querySelector("[data-combo-box-value]").getAttribute("data-combo-box-search-text");return is?1:0}))}buildInput(){this.isOpenOnFocus&&(this.onInputFocusListener=()=>this.inputFocus(),this.input.addEventListener("focus",this.onInputFocusListener)),this.onInputInputListener=(0,s.sg)((e=>this.inputInput(e))),this.input.addEventListener("input",this.onInputInputListener)}buildItems(){return l(this,void 0,void 0,(function*(){this.output.role="listbox",this.output.tabIndex=-1,this.output.ariaOrientation="vertical",this.apiUrl?yield this.itemsFromJson():(this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="",this.itemsFromHtml()),this.items[0].classList.contains("selected")&&(this.currentData=JSON.parse(this.items[0].getAttribute("data-combo-box-item-stored-data")))}))}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)}buildToggle(){var e,t,i,s;this.isOpened?((null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.toggle.ariaExpanded="true"),(null===(t=null==this?void 0:this.input)||void 0===t?void 0:t.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.onToggleClickListener=()=>this.toggleClick(),this.toggle.addEventListener("click",this.onToggleClickListener)}buildToggleClose(){this.onToggleCloseClickListener=()=>this.toggleCloseClick(),this.toggleClose.addEventListener("click",this.onToggleCloseClickListener)}buildToggleOpen(){this.onToggleOpenClickListener=()=>this.toggleOpenClick(),this.toggleOpen.addEventListener("click",this.onToggleOpenClickListener)}buildOutputPlaceholder(){this.outputPlaceholder||(this.outputPlaceholder=(0,s.fc)(this.outputEmptyTemplate)),this.appendItemsToWrapper(this.outputPlaceholder)}destroyOutputLoader(){this.outputLoader&&this.outputLoader.remove(),this.outputLoader=null}itemRender(e){var t;const i=e.querySelector("[data-combo-box-value]").getAttribute("data-combo-box-search-text"),s=null!==(t=JSON.parse(e.getAttribute("data-combo-box-item-stored-data")))&&void 0!==t?t:null;this.itemsWrapper?this.itemsWrapper.append(e):this.output.append(e),this.preventSelection||e.addEventListener("click",(()=>{this.close(i,s),this.setSelectedByValue(this.valuesBySelector(e))}))}plainRender(e){e.forEach((e=>{this.itemRender(e)}))}jsonItemsRender(e){e.forEach(((e,t)=>{const i=(0,s.fc)(this.outputItemTemplate);i.setAttribute("data-combo-box-item-stored-data",JSON.stringify(e)),i.querySelectorAll("[data-combo-box-output-item-field]").forEach((t=>{const i=this.getNestedProperty(e,t.getAttribute("data-combo-box-output-item-field")),s=t.hasAttribute("data-combo-box-output-item-hide-if-empty");t.textContent=null!=i?i:"",!i&&s&&(t.style.display="none")})),i.querySelectorAll("[data-combo-box-search-text]").forEach((t=>{const i=this.getNestedProperty(e,t.getAttribute("data-combo-box-output-item-field"));t.setAttribute("data-combo-box-search-text",null!=i?i:"")})),i.querySelectorAll("[data-combo-box-output-item-attr]").forEach((t=>{JSON.parse(t.getAttribute("data-combo-box-output-item-attr")).forEach((i=>{t.setAttribute(i.attr,e[i.valueFrom])}))})),i.setAttribute("tabIndex",`${t}`),"tabs"!==this.groupingType&&"default"!==this.groupingType||i.setAttribute("data-combo-box-output-item",`{"group": {"name": "${e[this.apiGroupField]}", "title": "${e[this.apiGroupField]}"}}`),this.items=[...this.items,i],this.preventSelection||i.addEventListener("click",(()=>{this.close(i.querySelector("[data-combo-box-value]").getAttribute("data-combo-box-search-text"),JSON.parse(i.getAttribute("data-combo-box-item-stored-data"))),this.setSelectedByValue(this.valuesBySelector(i))})),this.appendItemsToWrapper(i)}))}groupDefaultRender(){this.groups.forEach((e=>{const t=(0,s.fc)(this.groupingTitleTemplate);t.setAttribute("data-combo-box-group-title",e.name),t.classList.add("--exclude-accessibility"),t.innerText=e.title,this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t);const i=this.sortItems().filter((t=>{const{group:i}=JSON.parse(t.getAttribute("data-combo-box-output-item"));return i.name===e.name}));this.plainRender(i)}))}groupTabsRender(){const e=(0,s.fc)(this.tabsWrapperTemplate),t=(0,s.fc)('
');e.append(t),this.output.insertBefore(e,this.output.firstChild);const i=(0,s.fc)(this.groupingTitleTemplate);i.setAttribute("data-combo-box-group-title","all"),i.classList.add("--exclude-accessibility","active"),i.innerText="All",this.tabs=[...this.tabs,i],t.append(i),i.addEventListener("click",(()=>{this.selectedGroup="all";const e=this.tabs.find((e=>e.getAttribute("data-combo-box-group-title")===this.selectedGroup));this.tabs.forEach((e=>e.classList.remove("active"))),e.classList.add("active"),this.setItemsVisibility()})),this.groups.forEach((e=>{const i=(0,s.fc)(this.groupingTitleTemplate);i.setAttribute("data-combo-box-group-title",e.name),i.classList.add("--exclude-accessibility"),i.innerText=e.title,this.tabs=[...this.tabs,i],t.append(i),i.addEventListener("click",(()=>{this.selectedGroup=e.name;const t=this.tabs.find((e=>e.getAttribute("data-combo-box-group-title")===this.selectedGroup));this.tabs.forEach((e=>e.classList.remove("active"))),t.classList.add("active"),this.setItemsVisibility()}))}))}itemsFromHtml(){if("default"===this.groupingType)this.groupDefaultRender();else if("tabs"===this.groupingType){const e=this.sortItems();this.groupTabsRender(),this.plainRender(e)}else{const e=this.sortItems();this.plainRender(e)}this.setResults(this.input.value)}itemsFromJson(){return l(this,void 0,void 0,(function*(){this.buildOutputLoader();try{const e=`${this.apiQuery}`;let t,i,n=this.apiUrl;!this.apiSearchQuery&&this.apiSearchPath?(i=this.apiSearchDefaultPath&&""===this.value?`/${this.apiSearchDefaultPath}`:`/${this.apiSearchPath}/${this.value.toLowerCase()}`,(this.apiSearchPath||this.apiSearchDefaultPath)&&(n+=i)):(t=`${this.apiSearchQuery}=${this.value.toLowerCase()}`,this.apiQuery&&this.apiSearchQuery?n+=`?${t}&${e}`:this.apiQuery?n+=`?${e}`:this.apiSearchQuery&&(n+=`?${t}`));const o=yield fetch(n,this.apiHeaders);let l=yield o.json();this.apiDataPart&&(l=l[this.apiDataPart]),(this.apiSearchQuery||this.apiSearchPath)&&(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((e=>{const t=(0,s.fc)(this.groupingTitleTemplate);t.setAttribute("data-combo-box-group-title",e.name),t.classList.add("--exclude-accessibility"),t.innerText=e.title;const i=l.filter((t=>t[this.apiGroupField]===e.name));this.itemsWrapper?this.itemsWrapper.append(t):this.output.append(t),this.jsonItemsRender(i)}))):this.jsonItemsRender(l),this.setResults(this.input.value)}catch(e){console.error(e),this.buildOutputPlaceholder()}this.destroyOutputLoader()}))}appendItemsToWrapper(e){this.itemsWrapper?this.itemsWrapper.append(e):this.output.append(e)}resultItems(){if(!this.items.length)return!1;this.setItemsVisibility(),this.setSelectedByValue([this.selected])}destroyOutputPlaceholder(){this.outputPlaceholder&&this.outputPlaceholder.remove(),this.outputPlaceholder=null}getCurrentData(){return this.currentData}setCurrent(){window.$hsComboBoxCollection.length&&(window.$hsComboBoxCollection.map((e=>e.element.isCurrent=!1)),this.isCurrent=!0)}open(e){return!this.animationInProcess&&(void 0!==e&&this.setValueAndOpen(e),!this.preventVisibility&&(this.animationInProcess=!0,this.output.style.display="block",this.preventAutoPosition||this.recalculateDirection(),setTimeout((()=>{var e,t;(null===(e=null==this?void 0:this.input)||void 0===e?void 0:e.ariaExpanded)&&(this.input.ariaExpanded="true"),(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.el.classList.add("active"),this.animationInProcess=!1})),void(this.isOpened=!0)))}close(e,t=null){var i,n;return!this.animationInProcess&&(this.preventVisibility?(this.setValueAndClear(e,t),""!==this.input.value?this.el.classList.add("has-value"):this.el.classList.remove("has-value"),!1):(this.animationInProcess=!0,(null===(i=null==this?void 0:this.input)||void 0===i?void 0:i.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,s.yd)(this.output,(()=>{this.output.style.display="none",this.setValueAndClear(e,t||null),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`)}destroy(){this.input.removeEventListener("focus",this.onInputFocusListener),this.input.removeEventListener("input",this.onInputInputListener),this.toggle.removeEventListener("click",this.onToggleClickListener),this.toggleClose&&this.toggleClose.removeEventListener("click",this.onToggleCloseClickListener),this.toggleOpen&&this.toggleOpen.removeEventListener("click",this.onToggleOpenClickListener),this.el.classList.remove("has-value","active"),this.items.length&&this.items.forEach((e=>{e.classList.remove("selected"),e.style.display=""})),this.output.removeAttribute("role"),this.output.removeAttribute("tabindex"),this.output.removeAttribute("aria-orientation"),this.outputLoader&&(this.outputLoader.remove(),this.outputLoader=null),this.outputPlaceholder&&(this.outputPlaceholder.remove(),this.outputPlaceholder=null),this.apiUrl&&(this.output.innerHTML=""),this.items=[],window.$hsComboBoxCollection=window.$hsComboBoxCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t){const i=window.$hsComboBoxCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element:null}static autoInit(){window.$hsComboBoxCollection||(window.$hsComboBoxCollection=[],window.addEventListener("click",(e=>{const t=e.target;r.closeCurrentlyOpened(t)})),document.addEventListener("keydown",(e=>r.accessibility(e)))),window.$hsComboBoxCollection&&(window.$hsComboBoxCollection=window.$hsComboBoxCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-combo-box]:not(.--prevent-on-load-init)").forEach((e=>{if(!window.$hsComboBoxCollection.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-combo-box"),i=t?JSON.parse(t):{};new r(e,i)}}))}static close(e){const t=window.$hsComboBoxCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));t&&t.element.isOpened&&t.element.close()}static closeCurrentlyOpened(e=null){if(!e.closest("[data-combo-box].active")){const e=window.$hsComboBoxCollection.filter((e=>e.element.isOpened))||null;e&&e.forEach((e=>{e.element.close()}))}}static getPreparedItems(e=!1,t){if(!t)return null;return(e?Array.from(t.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter((e=>"none"!==e.style.display)).reverse():Array.from(t.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter((e=>"none"!==e.style.display))).filter((e=>!e.classList.contains("disabled")))}static setHighlighted(e,t,i){t.focus(),i.value=t.querySelector("[data-combo-box-value]").getAttribute("data-combo-box-search-text"),e&&e.classList.remove("combo-box-output-item-highlighted"),t.classList.add("combo-box-output-item-highlighted")}static accessibility(e){if(window.$hsComboBoxCollection.find((e=>e.element.preventVisibility?e.element.isCurrent:e.element.isOpened))&&o.jU.includes(e.code)&&!e.metaKey)switch(e.code){case"Escape":e.preventDefault(),this.onEscape();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;case"Enter":e.preventDefault(),this.onEnter(e)}}static onEscape(){const e=window.$hsComboBoxCollection.find((e=>!e.element.preventVisibility&&e.element.isOpened));e&&(e.element.close(),e.element.input.blur())}static onArrow(e=!0){var t;const i=window.$hsComboBoxCollection.find((e=>e.element.preventVisibility?e.element.isCurrent:e.element.isOpened));if(i){const s=null!==(t=i.element.itemsWrapper)&&void 0!==t?t:i.element.output;if(!s)return!1;const n=r.getPreparedItems(e,s),o=s.querySelector(".combo-box-output-item-highlighted");let l=null;o||n[0].classList.add("combo-box-output-item-highlighted");let a=n.findIndex((e=>e===o));a+1e.element.preventVisibility?e.element.isCurrent:e.element.isOpened));if(i){const s=null!==(t=i.element.itemsWrapper)&&void 0!==t?t:i.element.output;if(!s)return!1;const n=r.getPreparedItems(e,s),o=s.querySelector(".combo-box-output-item-highlighted");n.length&&r.setHighlighted(o,n[0],i.element.input)}}static onEnter(e){var t;const i=e.target,n=window.$hsComboBoxCollection.find((t=>!(0,s.sH)(t.element.el)&&e.target.closest("[data-combo-box]")===t.element.el)),o=n.element.el.querySelector(".combo-box-output-item-highlighted a");i.hasAttribute("data-combo-box-input")?(n.element.close(),i.blur()):(n.element.preventSelection||n.element.setSelectedByValue(n.element.valuesBySelector(e.target)),n.element.preventSelection&&o&&window.location.assign(o.getAttribute("href")),n.element.close(n.element.preventSelection?null:e.target.querySelector("[data-combo-box-value]").getAttribute("data-combo-box-search-text"),null!==(t=JSON.parse(e.target.getAttribute("data-combo-box-item-stored-data")))&&void 0!==t?t:null))}}window.addEventListener("load",(()=>{r.autoInit()})),document.addEventListener("scroll",(()=>{if(!window.$hsComboBoxCollection)return!1;const e=window.$hsComboBoxCollection.find((e=>e.element.isOpened));e&&!e.element.preventAutoPosition&&e.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSComboBox=r);const a=r},306:(e,t,i)=>{i.d(t,{A:()=>l});var s=i(392),n=i(709); -/* - * HSCopyMarkup - * @version: 2.6.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(e,t){super(e,t),this.count=0;const i=e.getAttribute("data-copy-markup"),s=i?JSON.parse(i):{},n=Object.assign(Object.assign({},s),t);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()}elementClick(){this.copy()}deleteItemButtonClick(e){this.delete(e)}init(){this.createCollection(window.$hsCopyMarkupCollection,this),this.onElementClickListener=()=>this.elementClick(),this.setTarget(),this.setWrapper(),this.addPredefinedItems(),this.el.addEventListener("click",this.onElementClickListener)}copy(){if(this.limit&&this.items.length>=this.limit)return!1;this.el.hasAttribute("disabled")&&this.el.setAttribute("disabled","");const e=this.target.cloneNode(!0),t=`${this.target.id}-${this.count++}`;e.setAttribute("id",t),this.addToItems(e),this.limit&&this.items.length>=this.limit&&this.el.setAttribute("disabled","disabled"),this.fireEvent("copy",e),(0,s.JD)("copy.copyMarkup",e,e)}addPredefinedItems(){Array.from(this.wrapper.children).filter((e=>!e.classList.contains("[--ignore-for-count]"))).forEach((e=>{this.addToItems(e)})),this.limit&&this.items.length>=this.limit&&this.el.setAttribute("disabled","disabled")}setTarget(){const e="string"==typeof this.targetSelector?document.querySelector(this.targetSelector).cloneNode(!0):this.targetSelector.cloneNode(!0);this.target=e}setWrapper(){this.wrapper="string"==typeof this.wrapperSelector?document.querySelector(this.wrapperSelector):this.wrapperSelector}addToItems(e){const t=e.querySelector("[data-copy-markup-delete-item]");this.wrapper?this.wrapper.append(e):this.el.before(e),t&&(this.onDeleteItemButtonClickListener=()=>this.deleteItemButtonClick(e),t.addEventListener("click",this.onDeleteItemButtonClickListener)),this.items.push(e)}delete(e){if(e){const t=this.items.indexOf(e);-1!==t&&this.items.splice(t,1),e.remove(),this.fireEvent("delete",e),(0,s.JD)("delete.copyMarkup",e,e),this.limit&&this.items.lengthe.removeEventListener("click",this.onDeleteItemButtonClickListener))),this.el.removeAttribute("disabled"),this.target=null,this.wrapper=null,this.items=null,window.$hsCopyMarkupCollection=window.$hsCopyMarkupCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t){const i=window.$hsCopyMarkupCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element:null}static autoInit(){window.$hsCopyMarkupCollection||(window.$hsCopyMarkupCollection=[]),window.$hsCopyMarkupCollection&&(window.$hsCopyMarkupCollection=window.$hsCopyMarkupCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-copy-markup]:not(.--prevent-on-load-init)").forEach((e=>{if(!window.$hsCopyMarkupCollection.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-copy-markup"),i=t?JSON.parse(t):{};new o(e,i)}}))}}window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSCopyMarkup=o);const l=o},66:(e,t,i)=>{i.d(t,{A:()=>l});var s=i(392),n=i(709); -/* - * HSDataTable - * @version: 2.6.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(e,t,i){var s,n,o,l,r,a,d,c,h,u,p,m,g,v,f,w,y,b,C,S,L,I,x,E,k;super(e,t,i),this.el="string"==typeof e?document.querySelector(e):e;const T=[];Array.from(this.el.querySelectorAll("thead th, thead td")).forEach(((e,t)=>{e.classList.contains("--exclude-from-ordering")&&T.push({targets:t,orderable:!1})}));const A=this.el.getAttribute("data-datatable"),O=A?JSON.parse(A):{};this.concatOptions=Object.assign(Object.assign({searching:!0,lengthChange:!1,order:[],columnDefs:[...T]},O),t),this.table=this.el.querySelector("table"),this.search=null!==(s=this.el.querySelector("[data-datatable-search]"))&&void 0!==s?s:null,this.pageEntities=null!==(n=this.el.querySelector("[data-datatable-page-entities]"))&&void 0!==n?n:null,this.paging=null!==(o=this.el.querySelector("[data-datatable-paging]"))&&void 0!==o?o:null,this.pagingPrev=null!==(l=this.el.querySelector("[data-datatable-paging-prev]"))&&void 0!==l?l:null,this.pagingNext=null!==(r=this.el.querySelector("[data-datatable-paging-next]"))&&void 0!==r?r:null,this.pagingPages=null!==(a=this.el.querySelector("[data-datatable-paging-pages]"))&&void 0!==a?a:null,this.info=null!==(d=this.el.querySelector("[data-datatable-info]"))&&void 0!==d?d:null,this.infoFrom=null!==(c=this.el.querySelector("[data-datatable-info-from]"))&&void 0!==c?c:null,this.infoTo=null!==(h=this.el.querySelector("[data-datatable-info-to]"))&&void 0!==h?h:null,this.infoLength=null!==(u=this.el.querySelector("[data-datatable-info-length]"))&&void 0!==u?u:null,(null===(p=this.concatOptions)||void 0===p?void 0:p.rowSelectingOptions)&&(this.rowSelectingAll=null!==(w=(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-datatable-row-selecting-all]"))&&void 0!==w?w:null),(null===(y=this.concatOptions)||void 0===y?void 0:y.rowSelectingOptions)&&(this.rowSelectingIndividual=null!==(L=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-datatable-row-selecting-individual]")&&void 0!==L?L: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!==(k=null===(E=null===(x=this.concatOptions)||void 0===x?void 0:x.pagingOptions)||void 0===E?void 0:E.pageBtnClasses)&&void 0!==k?k:null,this.onSinglePagingClickListener=[],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()}))}searchInput(e){this.onSearchInput(e.target.value)}pageEntitiesChange(e){this.onEntitiesChange(parseInt(e.target.value))}pagingPrevClick(){this.onPrevClick()}pagingNextClick(){this.onNextClick()}rowSelectingAllChange(){this.onSelectAllChange()}singlePagingClick(e){this.onPageClick(e)}destroy(){const e=this.el.querySelectorAll("[data-page]");this.search&&this.search.removeEventListener("input",this.onSearchInputListener),this.pageEntities&&this.pageEntities.removeEventListener("change",this.onPageEntitiesChangeListener),this.pagingPrev&&this.pagingPrev.removeEventListener("click",this.onPagingPrevClickListener),this.pagingNext&&this.pagingNext.removeEventListener("click",this.onPagingNextClickListener),this.rowSelectingAll&&this.rowSelectingAll.removeEventListener("change",this.onRowSelectingAllChangeListener),e.length&&(e.forEach((e=>{const t=+e.getAttribute("data-page");e.removeEventListener("click",this.onSinglePagingClickListener.find((e=>e.id===t)).fn)})),this.pagingPages.innerHTML=""),this.dataTable.destroy(),this.rowSelectingAll=null,this.rowSelectingIndividual=null,window.$hsDataTableCollection=window.$hsDataTableCollection.filter((({element:e})=>e.el!==this.el))}initSearch(){this.onSearchInputListener=(0,s.sg)((e=>this.searchInput(e))),this.search.addEventListener("input",this.onSearchInputListener)}onSearchInput(e){this.dataTable.search(e).draw()}initPageEntities(){this.onPageEntitiesChangeListener=e=>this.pageEntitiesChange(e),this.pageEntities.addEventListener("change",this.onPageEntitiesChangeListener)}onEntitiesChange(e){this.dataTable.page.len(e).draw()}initInfo(){this.infoFrom&&this.initInfoFrom(),this.infoTo&&this.initInfoTo(),this.infoLength&&this.initInfoLength()}initInfoFrom(){const{start:e}=this.dataTable.page.info();this.infoFrom.innerText=`${e+1}`}initInfoTo(){const{end:e}=this.dataTable.page.info();this.infoTo.innerText=`${e}`}initInfoLength(){const{recordsTotal:e}=this.dataTable.page.info();this.infoLength.innerText=`${e}`}updateInfo(){this.initInfo()}initPaging(){this.hidePagingIfSinglePage()}hidePagingIfSinglePage(){const{pages:e}=this.dataTable.page.info();e<2?(this.paging.classList.add("hidden"),this.paging.style.display="none"):(this.paging.classList.remove("hidden"),this.paging.style.display="")}initPagingPrev(){this.onPagingPrevClickListener=()=>this.pagingPrevClick(),this.pagingPrev.addEventListener("click",this.onPagingPrevClickListener)}onPrevClick(){this.dataTable.page("previous").draw("page")}disablePagingArrow(e,t){t?(e.classList.add("disabled"),e.setAttribute("disabled","disabled")):(e.classList.remove("disabled"),e.removeAttribute("disabled"))}initPagingNext(){this.onPagingNextClickListener=()=>this.pagingNextClick(),this.pagingNext.addEventListener("click",this.onPagingNextClickListener)}onNextClick(){this.dataTable.page("next").draw("page")}buildPagingPages(){this.updatePaging()}updatePaging(){const{page:e,pages:t,length:i}=this.dataTable.page.info(),n=this.dataTable.rows({search:"applied"}).count(),o=Math.ceil(n/i),l=e+1;let r=Math.max(1,l-Math.floor(this.maxPagesToShow/2)),a=Math.min(o,r+(this.maxPagesToShow-1));a-r+11&&(this.buildPagingPage(1),r>2&&this.pagingPages.appendChild((0,s.fc)('...')));for(let e=r;e<=a;e++)this.buildPagingPage(e);a...')),this.buildPagingPage(o)),this.disablePagingArrow(this.pagingPrev,0===e),this.disablePagingArrow(this.pagingNext,e===t-1),this.hidePagingIfSinglePage()}buildPagingPage(e){const{page:t}=this.dataTable.page.info(),i=(0,s.fc)('');i.innerText=`${e}`,i.setAttribute("data-page",`${e}`),this.pageBtnClasses&&(0,s.en)(this.pageBtnClasses,i),t===e-1&&i.classList.add("active"),this.onSinglePagingClickListener.push({id:e,fn:()=>this.singlePagingClick(e)}),i.addEventListener("click",this.onSinglePagingClickListener.find((t=>t.id===e)).fn),this.pagingPages.append(i)}onPageClick(e){this.dataTable.page(e-1).draw("page")}initRowSelecting(){this.onRowSelectingAllChangeListener=()=>this.rowSelectingAllChange(),this.rowSelectingAll.addEventListener("change",this.onRowSelectingAllChangeListener)}triggerChangeEventToRow(){this.table.querySelectorAll(`tbody ${this.rowSelectingIndividual}`).forEach((e=>{e.addEventListener("change",(()=>{this.updateSelectAllCheckbox()}))}))}onSelectAllChange(){let e=this.rowSelectingAll.checked;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((t=>{const i=t.querySelector(this.rowSelectingIndividual);i&&(i.checked=e)})),this.updateSelectAllCheckbox()}updateSelectAllCheckbox(){if(!this.dataTable.rows({search:"applied"}).count())return this.rowSelectingAll.checked=!1,!1;let e=!0;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach((t=>{const i=t.querySelector(this.rowSelectingIndividual);if(i&&!i.checked)return e=!1,!1})),this.rowSelectingAll.checked=e}static getInstance(e,t){const i=window.$hsDataTableCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element.el:null}static autoInit(){window.$hsDataTableCollection||(window.$hsDataTableCollection=[]),window.$hsDataTableCollection&&(window.$hsDataTableCollection=window.$hsDataTableCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-datatable]:not(.--prevent-on-load-init)").forEach((e=>{window.$hsDataTableCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))||new o(e)}))}}window.addEventListener("load",(()=>{document.querySelectorAll("[data-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},479:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(392),n=i(316),o=i(709),l=i(179); -/* - * HSDropdown - * @version: 2.6.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 o.A{constructor(e,t,i){super(e,t,i),this.toggle=this.el.querySelector(":scope > .dropdown-toggle")||this.el.querySelector(":scope > .dropdown-toggle-wrapper > .dropdown-toggle")||this.el.children[0],this.closers=Array.from(this.el.querySelectorAll(":scope .dropdown-close"))||null,this.menu=this.el.querySelector(":scope > .dropdown-menu"),this.eventMode=(0,s.gj)(this.el,"--trigger","click"),this.closeMode=(0,s.gj)(this.el,"--auto-close","true"),this.hasAutofocus=(0,s.PK)((0,s.gj)(this.el,"--has-autofocus","true")||"true"),this.animationInProcess=!1,this.onCloserClickListener=[],this.toggle&&this.menu&&this.init()}elementMouseEnter(){this.onMouseEnterHandler()}elementMouseLeave(){this.onMouseLeaveHandler()}toggleClick(e){this.onClickHandler(e)}toggleContextMenu(e){e.preventDefault(),this.onContextMenuHandler(e)}closerClick(){this.close()}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.onElementMouseEnterListener=()=>this.elementMouseEnter(),this.onElementMouseLeaveListener=()=>this.elementMouseLeave(),this.el.addEventListener("mouseenter",this.onElementMouseEnterListener),this.el.addEventListener("mouseleave",this.onElementMouseLeaveListener))}resizeHandler(){this.eventMode=(0,s.gj)(this.el,"--trigger","click"),this.closeMode=(0,s.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"),"contextmenu"===this.eventMode?(this.onToggleContextMenuListener=e=>this.toggleContextMenu(e),this.toggle.addEventListener("contextmenu",this.onToggleContextMenuListener)):(this.onToggleClickListener=e=>this.toggleClick(e),this.toggle.addEventListener("click",this.onToggleClickListener))}buildMenu(){this.menu.role=this.menu.getAttribute("role")||"menu";const e=this.menu.querySelectorAll('[role="menuitemcheckbox"]'),t=this.menu.querySelectorAll('[role="menuitemradio"]');e.forEach((e=>e.addEventListener("click",(()=>this.selectCheckbox(e))))),t.forEach((e=>e.addEventListener("click",(()=>this.selectRadio(e)))))}buildClosers(){this.closers.forEach((e=>{this.onCloserClickListener.push({el:e,fn:()=>this.closerClick()}),e.addEventListener("click",this.onCloserClickListener.find((t=>t.el===e)).fn)}))}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}onContextMenuHandler(e){const t={getBoundingClientRect:(()=>new DOMRect,()=>new DOMRect(e.clientX,e.clientY,0,0))};r.closeCurrentlyOpened(),this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?(this.close(),document.body.style.overflow="",document.body.style.paddingRight=""):(document.body.style.overflow="hidden",document.body.style.paddingRight=`${this.getScrollbarSize()}px`,this.open(t))}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(){const e=(window.getComputedStyle(this.el).getPropertyValue("--scope")||"").replace(" ","");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(),"window"===e&&this.el.appendChild(this.menu),this.animationInProcess=!1}absoluteStrategyModifiers(){return[{name:"applyStyles",fn:e=>{const t=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"absolute").replace(" ",""),i=(window.getComputedStyle(this.el).getPropertyValue("--adaptive")||"adaptive").replace(" ","");e.state.elements.popper.style.position=t,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}}]}focusElement(){const e=this.menu.querySelector("[autofocus]");if(!e)return!1;e.focus()}setupPopper(e){const t=e||this.el,i=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),s=(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(" ","")),a=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ",""),d=parseInt((window.getComputedStyle(this.el).getPropertyValue("--skidding")||"0").replace(" ",""));return(0,n.n4)(t,this.menu,{placement:l.lP[i]||"bottom-start",strategy:o,modifiers:[..."fixed"!==o?this.absoluteStrategyModifiers():[],{name:"flip",enabled:"true"===s},{name:"offset",options:{offset:[d,r]}},{name:"computeStyles",options:{adaptive:"fixed"===o,gpuAcceleration:"true"===a}}]})}selectCheckbox(e){e.ariaChecked="true"===e.ariaChecked?"false":"true"}selectRadio(e){if("true"===e.ariaChecked)return!1;const t=e.closest(".group").querySelectorAll('[role="menuitemradio"]');Array.from(t).filter((t=>t!==e)).forEach((e=>{e.ariaChecked="false"})),e.ariaChecked="true"}calculatePopperPosition(e){const t=this.setupPopper(e);t.forceUpdate();const i=t.state.placement;return t.destroy(),i}open(e){if(this.el.classList.contains("open")||this.animationInProcess)return!1;const t=e||this.el;this.animationInProcess=!0;const i=(window.getComputedStyle(this.el).getPropertyValue("--scope")||"").replace(" ",""),o=(window.getComputedStyle(this.el).getPropertyValue("--placement")||"").replace(" ",""),r=(window.getComputedStyle(this.el).getPropertyValue("--flip")||"true").replace(" ",""),a=(window.getComputedStyle(this.el).getPropertyValue("--strategy")||"fixed").replace(" ",""),d=parseInt((window.getComputedStyle(this.el).getPropertyValue("--offset")||"5").replace(" ","")),c=(window.getComputedStyle(this.el).getPropertyValue("--gpu-acceleration")||"true").replace(" ",""),h=parseInt((window.getComputedStyle(this.el).getPropertyValue("--skidding")||"0").replace(" ",""));"window"===i&&document.body.appendChild(this.menu),"static"!==a&&(this.el._popper=(0,n.n4)(t,this.menu,{placement:l.lP[o]||"bottom-start",strategy:a,modifiers:[..."fixed"!==a?this.absoluteStrategyModifiers():[],{name:"flip",enabled:"true"===r},{name:"offset",options:{offset:[h,d]}},{name:"computeStyles",options:{adaptive:"fixed"===a,gpuAcceleration:"true"===c}}]})),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"),"window"===i&&this.menu.classList.add("open"),this.animationInProcess=!1,this.hasAutofocus&&this.focusElement()})),this.fireEvent("open",this.el),(0,s.JD)("open.dropdown",this.el,this.el)}close(e=!0){if(this.animationInProcess||!this.el.classList.contains("open"))return!1;const t=(window.getComputedStyle(this.el).getPropertyValue("--scope")||"").replace(" ","");if(this.animationInProcess=!0,"window"===t&&this.menu.classList.remove("open"),e){const e=this.el.querySelector("[data-dropdown-transition]")||this.menu;(0,s.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,s.JD)("close.dropdown",this.el,this.el)})()}forceClearState(){this.destroyPopper(),this.menu.style.margin=null,this.el.classList.remove("open")}destroy(){(0,s.un)()||(0,s.zG)()||(this.el.removeEventListener("mouseenter",this.onElementMouseEnterListener),this.el.removeEventListener("mouseleave",(()=>this.onElementMouseLeaveListener)),this.onElementMouseEnterListener=null,this.onElementMouseLeaveListener=null),this.toggle.removeEventListener("click",this.onToggleClickListener),this.onToggleClickListener=null,this.closers.length&&(this.closers.forEach((e=>{e.removeEventListener("click",this.onCloserClickListener.find((t=>t.el===e)).fn)})),this.onCloserClickListener=null),this.el.classList.remove("open"),this.destroyPopper(),window.$hsDropdownCollection=window.$hsDropdownCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t){const i=window.$hsDropdownCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element.el:null}static autoInit(){if(!window.$hsDropdownCollection){window.$hsDropdownCollection=[],document.addEventListener("keydown",(e=>r.accessibility(e))),window.addEventListener("click",(e=>{const t=e.target;r.closeCurrentlyOpened(t)}));let e=window.innerWidth;window.addEventListener("resize",(()=>{window.innerWidth!==e&&(e=innerWidth,r.closeCurrentlyOpened(null,!1))}))}window.$hsDropdownCollection&&(window.$hsDropdownCollection=window.$hsDropdownCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll(".dropdown:not(.--prevent-on-load-init)").forEach((e=>{window.$hsDropdownCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))||new r(e)}))}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=s.IM;const t=window.$hsDropdownCollection.find((e=>e.element.el.classList.contains("open")));if(t&&(l.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(".select.active")||(e.preventDefault(),this.onEscape(e));break;case"Enter":t.element.menu.querySelector(".select button:focus")||t.element.menu.querySelector(".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"ArrowRight":e.preventDefault(),e.stopImmediatePropagation(),this.onArrowX(e,"right");break;case"ArrowLeft":e.preventDefault(),e.stopImmediatePropagation(),this.onArrowX(e,"left");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(".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){var t;const i=e.target,{element:s}=null!==(t=window.$hsDropdownCollection.find((e=>e.element.el===i.closest(".dropdown"))))&&void 0!==t?t:null;if(s&&i.classList.contains("dropdown-toggle"))e.preventDefault(),s.open();else if(s&&"menuitemcheckbox"===i.getAttribute("role"))s.selectCheckbox(i),s.close();else{if(!s||"menuitemradio"!==i.getAttribute("role"))return!1;s.selectRadio(i),s.close()}}static onArrow(e=!0){const t=window.$hsDropdownCollection.find((e=>e.element.el.classList.contains("open")));if(t){const i=t.element.menu;if(!i)return!1;const s=e?Array.from(i.querySelectorAll('a:not([hidden]), .dropdown > button:not([hidden]), [role="button"]:not([hidden]), [role^="menuitem"]:not([hidden], .dropdown-item, form)')).reverse():Array.from(i.querySelectorAll('a:not([hidden]), .dropdown > button:not([hidden]), [role="button"]:not([hidden]), [role^="menuitem"]:not([hidden], .dropdown-item, form)')),n=Array.from(s).filter((e=>{const t=e;return null===t.closest("[hidden]")&&null!==t.offsetParent})).filter((e=>!e.classList.contains("disabled"))),o=i.querySelector('a:focus, button:focus, [role="button"]:focus, [role^="menuitem"]:focus, .dropdown-item:focus, button:focus');let l=n.findIndex((e=>e===o));l+1e.element.el.classList.contains("open")));if(t){const i=t.element.menu;if(!i)return!1;const s=(e?Array.from(i.querySelectorAll('a, button, [role="button"], [role^="menuitem"]')):Array.from(i.querySelectorAll('a, button, [role="button"], [role^="menuitem"]')).reverse()).filter((e=>!e.classList.contains("disabled")));s.length&&s[0].focus()}}static onFirstLetter(e){const t=window.$hsDropdownCollection.find((e=>e.element.el.classList.contains("open")));if(t){const i=t.element.menu;if(!i)return!1;const s=Array.from(i.querySelectorAll('a, [role="button"], [role^="menuitem"]')),n=()=>s.findIndex(((t,i)=>t.innerText.toLowerCase().charAt(0)===e.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(e=null,t=!0){const i=e&&e.closest(".dropdown")&&e.closest(".dropdown").parentElement.closest(".dropdown")?e.closest(".dropdown").parentElement.closest(".dropdown"):null;let n=i?window.$hsDropdownCollection.filter((e=>e.element.el.classList.contains("open")&&e.element.menu.closest(".dropdown").parentElement.closest(".dropdown")===i)):window.$hsDropdownCollection.filter((e=>e.element.el.classList.contains("open")));e&&e.closest(".dropdown")&&"inside"===(0,s.BF)(e.closest(".dropdown"),"--auto-close")&&(n=n.filter((t=>t.element.el!==e.closest(".dropdown")))),e&&e.closest(".dropdown")&&"outside"===(0,s.BF)(e.closest(".dropdown"),"--auto-close")&&(n=n.filter((t=>t.element.el==e.closest(".dropdown"))),n.forEach((e=>e.element.close(t)))),n&&n.forEach((e=>{if("false"===e.element.closeMode||"outside"===e.element.closeMode)return!1;e.element.close(t)})),n&&n.forEach((e=>{if("contextmenu"!==(0,s.BF)(e.element.el,"--trigger"))return!1;document.body.style.overflow="",document.body.style.paddingRight=""}))}static on(e,t,i){const s=window.$hsDropdownCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));s&&(s.element.events[e]=i)}}window.addEventListener("load",(()=>{r.autoInit()})),window.addEventListener("resize",(()=>{window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),window.$hsDropdownCollection.forEach((e=>e.element.resizeHandler()))})),"undefined"!=typeof window&&(window.HSDropdown=r);const a=r},230:(e,t,i)=>{i.d(t,{A:()=>l});var s=i(392),n=i(709); -/* - * HSFileUpload - * @version: 2.6.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(e,t,i){var s;super(e,t,i),this.extensions={},this.el="string"==typeof e?document.querySelector(e):e;const n=this.el.getAttribute("data-file-upload"),o=n?JSON.parse(n):{};this.previewTemplate=(null===(s=this.el.querySelector("[data-file-upload-preview]"))||void 0===s?void 0:s.innerHTML)||'
\n
\n
\n \n \n \n
\n

\n .\n

\n

\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n \n 0%\n \n
\n
',this.extensions=_.merge({default:{icon:'',class:"shrink-0 size-5"},xls:{icon:'',class:"shrink-0 size-5"},doc:{icon:'',class:"shrink-0 size-5"},zip:{icon:'',class:"shrink-0 size-5"}},o.extensions),this.singleton=o.singleton,this.concatOptions=Object.assign(Object.assign({clickable:this.el.querySelector("[data-file-upload-trigger]"),previewsContainer:this.el.querySelector("[data-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:this.previewTemplate,autoHideTrigger:!1},o),t),this.onReloadButtonClickListener=[],this.onTempFileInputChangeListener=[],this.init()}tempFileInputChange(e,t){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)}}reloadButtonClick(e,t){e.preventDefault(),e.stopPropagation();const i=document.createElement("input");i.type="file",this.onTempFileInputChangeListener.push({el:i,fn:e=>this.tempFileInputChange(e,t)}),i.click(),i.addEventListener("change",this.onTempFileInputChangeListener.find((e=>e.el===i)).fn)}init(){this.createCollection(window.$hsFileUploadCollection,this),this.initDropzone()}initDropzone(){const e=this.el.querySelector("[data-file-upload-clear]"),t=Array.from(this.el.querySelectorAll("[data-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()}}))}destroy(){this.onTempFileInputChangeListener.forEach((e=>{e.el.removeEventListener("change",e.fn)})),this.onTempFileInputChangeListener=null,this.onReloadButtonClickListener.forEach((e=>{e.el.removeEventListener("click",e.fn)})),this.onReloadButtonClickListener=null,this.dropzone.destroy(),window.$hsFileUploadCollection=window.$hsFileUploadCollection.filter((({element:e})=>e.el!==this.el))}onAddFile(e){const{previewElement:t}=e,i=e.previewElement.querySelector("[data-file-upload-reload]");if(!t)return!1;this.singleton&&this.dropzone.files.length>1&&this.dropzone.removeFile(this.dropzone.files[0]),i&&(this.onReloadButtonClickListener.push({el:i,fn:t=>this.reloadButtonClick(t,e)}),i.addEventListener("click",this.onReloadButtonClickListener.find((e=>e.el===i)).fn)),this.previewAccepted(e)}previewAccepted(e){const{previewElement:t}=e,i=this.splitFileName(e.name),s=t.querySelector("[data-file-upload-file-name]"),n=t.querySelector("[data-file-upload-file-ext]"),o=t.querySelector("[data-file-upload-file-size]"),l=t.querySelector("[data-file-upload-file-icon]"),r=this.el.querySelector("[data-file-upload-trigger]"),a=t.querySelector("[data-dz-thumbnail]"),d=t.querySelector("[data-file-upload-remove]");s&&(s.textContent=i.name),n&&(n.textContent=i.extension),o&&(o.textContent=this.formatFileSize(e.size)),a&&(e.type.includes("image/")?a.classList.remove("hidden"):this.setIcon(i.extension,l)),this.dropzone.files.length>0&&this.concatOptions.autoHideTrigger&&(r.style.display="none"),d&&(d.onclick=()=>this.dropzone.removeFile(e))}onRemoveFile(){const e=this.el.querySelector("[data-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 s=i.querySelector("[data-file-upload-progress-bar]"),n=i.querySelector("[data-file-upload-progress-bar-pane]"),o=i.querySelector("[data-file-upload-progress-bar-value]"),l=Math.floor(t);s&&s.setAttribute("aria-valuenow",`${l}`),n&&(n.style.width=`${l}%`),o&&(o.innerText=`${l}`)}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 n=(null===(t=this.extensions[e])||void 0===t?void 0:t.icon)?(0,s.fc)(this.extensions[e].icon):(0,s.fc)(this.extensions.default.icon);return(0,s.en)((null===(i=this.extensions[e])||void 0===i?void 0:i.class)?this.extensions[e].class:this.extensions.default.class,n),n}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=[]),window.$hsFileUploadCollection&&(window.$hsFileUploadCollection=window.$hsFileUploadCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-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 o(e)}))}}window.addEventListener("load",(()=>{document.querySelectorAll("[data-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},856:(e,t,i)=>{i.d(t,{A:()=>l});var s=i(392),n=i(709); -/* - * HSInputNumber - * @version: 2.6.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(e,t){super(e,t),this.input=this.el.querySelector("[data-input-number-input]")||null,this.increment=this.el.querySelector("[data-input-number-increment]")||null,this.decrement=this.el.querySelector("[data-input-number-decrement]")||null,this.input&&this.checkIsNumberAndConvert();const i=this.el.dataset.inputNumber,s=i?JSON.parse(i):{step:1},n=Object.assign(Object.assign({},s),t);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()}inputInput(){this.changeValue()}incrementClick(){this.changeValue("increment")}decrementClick(){this.changeValue("decrement")}init(){this.createCollection(window.$hsInputNumberCollection,this),this.input&&this.increment&&this.build()}checkIsNumberAndConvert(){const e=this.input.value.trim(),t=this.cleanAndExtractNumber(e);null!==t?(this.inputValue=t,this.input.value=t.toString()):(this.inputValue=0,this.input.value="0")}cleanAndExtractNumber(e){const t=[];let i=!1;e.split("").forEach((e=>{e>="0"&&e<="9"?t.push(e):"."!==e||i||(t.push(e),i=!0)}));const s=t.join(""),n=parseFloat(s);return isNaN(n)?null:n}build(){this.input&&this.buildInput(),this.increment&&this.buildIncrement(),this.decrement&&this.buildDecrement(),this.inputValue<=this.minInputValue&&(this.inputValue=this.minInputValue,this.input.value=`${this.minInputValue}`),this.inputValue<=this.minInputValue&&this.changeValue(),this.input.hasAttribute("disabled")&&this.disableButtons()}buildInput(){this.onInputInputListener=()=>this.inputInput(),this.input.addEventListener("input",this.onInputInputListener)}buildIncrement(){this.onIncrementClickListener=()=>this.incrementClick(),this.increment.addEventListener("click",this.onIncrementClickListener)}buildDecrement(){this.onDecrementClickListener=()=>this.decrementClick(),this.decrement.addEventListener("click",this.onDecrementClickListener)}changeValue(e="none"){var t,i;const n={inputValue:this.inputValue},o=null!==(t=this.minInputValue)&&void 0!==t?t: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,e){case"increment":const e=this.inputValue+this.step;this.inputValue=e>=o&&e<=l?e:l,this.input.value=this.inputValue.toString();break;case"decrement":const t=this.inputValue-this.step;this.inputValue=t>=o&&t<=l?t: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.inputNumber",this.el,n)}disableButtons(e="all"){"all"===e?("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"===e?"BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.setAttribute("disabled","disabled"):"decrement"===e&&("BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.setAttribute("disabled","disabled"))}enableButtons(e="all"){"all"===e?("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"===e?"BUTTON"!==this.increment.tagName&&"INPUT"!==this.increment.tagName||this.increment.removeAttribute("disabled"):"decrement"===e&&("BUTTON"!==this.decrement.tagName&&"INPUT"!==this.decrement.tagName||this.decrement.removeAttribute("disabled"))}destroy(){this.el.classList.remove("disabled"),this.increment.removeAttribute("disabled"),this.decrement.removeAttribute("disabled"),this.input.removeEventListener("input",this.onInputInputListener),this.increment.removeEventListener("click",this.onIncrementClickListener),this.decrement.removeEventListener("click",this.onDecrementClickListener),window.$hsInputNumberCollection=window.$hsInputNumberCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t){const i=window.$hsInputNumberCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element:null}static autoInit(){window.$hsInputNumberCollection||(window.$hsInputNumberCollection=[]),window.$hsInputNumberCollection&&(window.$hsInputNumberCollection=window.$hsInputNumberCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-input-number]:not(.--prevent-on-load-init)").forEach((e=>{window.$hsInputNumberCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))||new o(e)}))}}window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSInputNumber=o);const l=o},734:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(392),n=i(179),o=i(709); -/* - * HSOverlay - * @version: 2.6.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,i){var o,l,r,a,d,c;super(e,t,i);const h=e.getAttribute("data-overlay-options"),u=h?JSON.parse(h):{},p=Object.assign(Object.assign({},u),t);if(this.hiddenClass=(null==p?void 0:p.hiddenClass)||"hidden",this.emulateScrollbarSpace=(null==p?void 0:p.emulateScrollbarSpace)||!1,this.isClosePrev=null===(o=null==p?void 0:p.isClosePrev)||void 0===o||o,this.backdropClasses=null!==(l=null==p?void 0:p.backdropClasses)&&void 0!==l?l:"overlay-backdrop transition duration fixed inset-0 bg-base-shadow/70 overflow-y-auto",this.backdropParent="string"==typeof p.backdropParent?document.querySelector(p.backdropParent):document.body,this.backdropExtraClasses=null!==(r=null==p?void 0:p.backdropExtraClasses)&&void 0!==r?r:"",this.moveOverlayToBody=(null==p?void 0:p.moveOverlayToBody)||null,this.openNextOverlay=!1,this.autoHide=null,this.overlayId=this.el.getAttribute("data-overlay"),this.overlay=document.querySelector(this.overlayId),this.initContainer=(null===(a=this.overlay)||void 0===a?void 0:a.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-overlay-keyboard")||"true");const e=(0,s.gj)(this.overlay,"--auto-close"),t=(0,s.gj)(this.overlay,"--auto-close-equality-type");this.autoClose=!isNaN(+e)&&isFinite(+e)?+e:n.LO[e]||null,this.autoCloseEqualityType=null!==(d=t)&&void 0!==d?d:null;const i=(0,s.gj)(this.overlay,"--opened");this.openedBreakpoint=(!isNaN(+i)&&isFinite(+i)?+i:n.LO[i])||null}this.animationTarget=(null===(c=null==this?void 0:this.overlay)||void 0===c?void 0:c.querySelector(".overlay-animation-target"))||this.overlay,this.overlay&&this.init()}elementClick(){this.overlay.classList.contains("opened")?this.close():this.open()}overlayClick(e){e.target.id&&`#${e.target.id}`===this.overlayId&&this.isCloseWhenClickInside&&this.hasAbilityToCloseOnBackdropClick&&this.close()}backdropClick(){this.close()}init(){var e;if(this.createCollection(window.$hsOverlayCollection,this),this.isLayoutAffect&&this.openedBreakpoint){const e=l.getInstance(this.el,!0);l.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.onElementClickListener=()=>this.elementClick(),this.onOverlayClickListener=e=>this.overlayClick(e),this.el.addEventListener("click",this.onElementClickListener),this.overlay.addEventListener("click",this.onOverlayClickListener)}hideAuto(){const e=parseInt((0,s.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")),i=this.overlay.getAttribute("data-overlay-backdrop-container")||!1;this.backdrop=document.createElement("div");let n=`${this.backdropClasses} ${this.backdropExtraClasses}`;const o="static"!==(0,s.gj)(this.overlay,"--overlay-backdrop","true"),l="false"===(0,s.gj)(this.overlay,"--overlay-backdrop","true");this.backdrop.id=`${this.overlay.id}-backdrop`,"style"in this.backdrop&&(this.backdrop.style.zIndex=""+(t-1));for(const t of e)(t.startsWith("overlay-backdrop-open:")||t.includes(":overlay-backdrop-open:"))&&(n+=` ${t}`);l||(i&&(this.backdrop=document.querySelector(i).cloneNode(!0),this.backdrop.classList.remove("hidden"),n=`${this.backdrop.classList.toString()}`,this.backdrop.classList.value=""),o&&(this.onBackdropClickListener=()=>this.backdropClick(),this.backdrop.addEventListener("click",this.onBackdropClickListener,!0)),this.backdrop.setAttribute("data-overlay-backdrop-template",""),this.backdropParent.appendChild(this.backdrop),setTimeout((()=>{this.backdrop.classList.value=n})))}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,s.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(".overlay.open"),t=window.$hsOverlayCollection.find((t=>Array.from(e).includes(t.element.overlay)&&!t.element.isLayoutAffect)),i=document.querySelectorAll(`[data-overlay="#${this.overlay.id}"]`),n="true"!==(0,s.gj)(this.overlay,"--body-scroll","false");if(this.isClosePrev&&t)return this.openNextOverlay=!0,t.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((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("overlay-body-open"),this.fireEvent("open",this.el),(0,s.JD)("open.overlay",this.el,this.el),this.hasAutofocus&&this.focusElement()}),50)}close(e=!1){this.isLayoutAffect&&document.body.classList.remove("overlay-body-open");const t=e=>{if(this.overlay.classList.contains("open"))return!1;document.querySelectorAll(`[data-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,s.JD)("close.overlay",this.el,this.el),document.querySelector(".overlay.opened")||(document.body.style.overflow="",this.emulateScrollbarSpace&&(document.body.style.paddingRight="")),e(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"),e?t(i):(0,s.yd)(this.animationTarget,(()=>t(i)))}))}destroy(){this.overlay.classList.remove("open","opened",this.hiddenClass),this.isLayoutAffect&&document.body.classList.remove("overlay-body-open"),this.el.removeEventListener("click",this.onElementClickListener),this.overlay.removeEventListener("click",this.onOverlayClickListener),this.backdrop&&this.backdrop.removeEventListener("click",this.onBackdropClickListener),this.backdrop&&(this.backdrop.remove(),this.backdrop=null),window.$hsOverlayCollection=window.$hsOverlayCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t){const i=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 i?t?i:i.element.el:null}static autoInit(){window.$hsOverlayCollection||(window.$hsOverlayCollection=[],document.addEventListener("keydown",(e=>l.accessibility(e)))),window.$hsOverlayCollection&&(window.$hsOverlayCollection=window.$hsOverlayCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-overlay]:not(.--prevent-on-load-init)").forEach((e=>{window.$hsOverlayCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))||new l(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("overlay-body-open"),t.element.overlay.classList.add("opened")):t.element.close(!0)}static accessibility(e){var t,i;const n=window.$hsOverlayCollection.filter((e=>e.element.overlay.classList.contains("open"))),o=n[n.length-1],l=null===(i=null===(t=null==o?void 0:o.element)||void 0===t?void 0:t.overlay)||void 0===i?void 0:i.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),r=[];(null==l?void 0:l.length)&&l.forEach((e=>{(0,s.sH)(e)||r.push(e)}));const a=o&&!e.metaKey;if(a&&!o.element.isTabAccessibilityLimited&&"Tab"===e.code)return!1;a&&r.length&&"Tab"===e.code&&(e.preventDefault(),this.onTab(o)),a&&"Escape"===e.code&&(e.preventDefault(),this.onEscape(o))}static onEscape(e){e&&e.element.hasAbilityToCloseOnBackdropClick&&e.element.close()}static onTab(e){const t=e.element.overlay,i=Array.from(t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(0===i.length)return!1;const s=t.querySelector(":focus");if(s){let e=!1;for(const t of i){if(e)return void t.focus();t===s&&(e=!0)}i[0].focus()}else i[0].focus()}static on(e,t,i){const s=window.$hsOverlayCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)||e.element.overlay===("string"==typeof t?document.querySelector(t):t)));s&&(s.element.events[e]=i)}}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,i=e.element.initContainer,n=document.querySelector("body"),o=e.element.overlay;if(!i&&o)return!1;document.body.clientWidth<=t&&!(0,s.wC)(n,o)?n.appendChild(o):document.body.clientWidth>t&&!i.contains(o)&&i.appendChild(o)}))};window.addEventListener("load",(()=>{l.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=>{const{autoCloseEqualityType:t,autoClose:i}=e.element;("less-than"===t?document.body.clientWidth<=i:document.body.clientWidth>=i)&&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=>{const{autoCloseEqualityType:t,autoClose:i}=e.element;("less-than"===t?document.body.clientWidth<=i:document.body.clientWidth>=i)&&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")),i=document.querySelector(`#${e.element.overlay.id}-backdrop`);if(t===parseInt(window.getComputedStyle(i).getPropertyValue("z-index"))+1)return!1;"style"in i&&(i.style.zIndex=""+(t-1)),document.body.classList.add("overlay-body-open")}))})()})),"undefined"!=typeof window&&(window.HSOverlay=l);const a=l},656:(e,t,i)=>{i.d(t,{A:()=>l});var s=i(392),n=i(709); -/* - * HSPinInput - * @version: 2.6.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{elementInput(e,t){this.onInput(e,t)}elementPaste(e){this.onPaste(e)}elementKeydown(e,t){this.onKeydown(e,t)}elementFocusin(e){this.onFocusIn(e)}elementFocusout(e){this.onFocusOut(e)}constructor(e,t){super(e,t);const i=e.getAttribute("data-pin-input"),s=i?JSON.parse(i):{},n=Object.assign(Object.assign({},s),t);this.items=this.el.querySelectorAll("[data-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.onElementInputListener=[],this.onElementPasteListener=[],this.onElementKeydownListener=[],this.onElementFocusinListener=[],this.onElementFocusoutListener=[],this.init()}init(){this.createCollection(window.$hsPinInputCollection,this),this.items.length&&this.build()}build(){this.buildInputItems()}buildInputItems(){this.items.forEach(((e,t)=>{this.placeholders.push(e.getAttribute("placeholder")||""),e.hasAttribute("autofocus")&&this.onFocusIn(t),this.onElementInputListener.push({el:e,fn:e=>this.elementInput(e,t)}),this.onElementPasteListener.push({el:e,fn:e=>this.elementPaste(e)}),this.onElementKeydownListener.push({el:e,fn:e=>this.elementKeydown(e,t)}),this.onElementFocusinListener.push({el:e,fn:()=>this.elementFocusin(t)}),this.onElementFocusoutListener.push({el:e,fn:()=>this.elementFocusout(t)}),e.addEventListener("input",this.onElementInputListener.find((t=>t.el===e)).fn),e.addEventListener("paste",this.onElementPasteListener.find((t=>t.el===e)).fn),e.addEventListener("keydown",this.onElementKeydownListener.find((t=>t.el===e)).fn),e.addEventListener("focusin",this.onElementFocusinListener.find((t=>t.el===e)).fn),e.addEventListener("focusout",this.onElementFocusoutListener.find((t=>t.el===e)).fn)}))}checkIfNumber(e){return e.match(this.availableCharsRE)}autoFillAll(e){Array.from(e).forEach(((e,t)=>{if(!(null==this?void 0:this.items[t]))return!1;this.items[t].value=e,this.items[t].dispatchEvent(new Event("input",{bubbles:!0}))}))}setCurrentValue(){this.currentValue=Array.from(this.items).map((e=>e.value))}toggleCompleted(){this.currentValue.includes("")?this.el.classList.remove("active"):this.el.classList.add("active")}onInput(e,t){const i=e.target.value;if(this.currentItem=e.target,this.currentItem.value="",this.currentItem.value=i[i.length-1],!this.checkIfNumber(this.currentItem.value))return this.currentItem.value=this.currentValue[t]||"",!1;if(this.setCurrentValue(),this.currentItem.value){if(t0&&this.items[t-1].focus()}onKeydown(e,t){"Backspace"===e.key&&t>0&&(""===this.items[t].value?(this.items[t-1].value="",this.items[t-1].focus()):this.items[t].value=""),this.setCurrentValue(),this.toggleCompleted()}onFocusIn(e){this.items[e].setAttribute("placeholder","")}onFocusOut(e){this.items[e].setAttribute("placeholder",this.placeholders[e])}onPaste(e){e.preventDefault(),this.items.forEach((t=>{document.activeElement===t&&this.autoFillAll(e.clipboardData.getData("text"))}))}destroy(){this.el.classList.remove("active"),this.items.length&&this.items.forEach((e=>{e.removeEventListener("input",this.onElementInputListener.find((t=>t.el===e)).fn),e.removeEventListener("paste",this.onElementPasteListener.find((t=>t.el===e)).fn),e.removeEventListener("keydown",this.onElementKeydownListener.find((t=>t.el===e)).fn),e.removeEventListener("focusin",this.onElementFocusinListener.find((t=>t.el===e)).fn),e.removeEventListener("focusout",this.onElementFocusoutListener.find((t=>t.el===e)).fn)})),this.items=null,this.currentItem=null,this.currentValue=null,window.$hsPinInputCollection=window.$hsPinInputCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t){const i=window.$hsPinInputCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element:null}static autoInit(){window.$hsPinInputCollection||(window.$hsPinInputCollection=[]),window.$hsPinInputCollection&&(window.$hsPinInputCollection=window.$hsPinInputCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-pin-input]:not(.--prevent-on-load-init)").forEach((e=>{window.$hsPinInputCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))||new o(e)}))}}window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSPinInput=o);const l=o},991:(e,t,i)=>{i.d(t,{A:()=>o});var s=i(709); -/* - * HSRangeSlider - * @version: 2.6.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(e,t,i){super(e,t,i);const s=e.getAttribute("data-range-slider"),n=s?JSON.parse(s):{};this.concatOptions=Object.assign(Object.assign(Object.assign({},n),t),{cssClasses:Object.assign(Object.assign({},noUiSlider.cssClasses),this.processClasses(n.cssClasses))}),this.init()}get formattedValue(){const e=this.el.noUiSlider.get();if(Array.isArray(e)&&this.format){const t=[];return e.forEach((e=>{t.push(this.format.to(e))})),t}return this.format?this.format.to(e):e}processClasses(e){const t={};return Object.keys(e).forEach((i=>{i&&(t[i]=`${noUiSlider.cssClasses[i]} ${e[i]}`)})),t}init(){var e,t,i,s,n,o,l,r,a,d,c,h,u;this.createCollection(window.$hsRangeSliderCollection,this),("object"==typeof(null===(e=this.concatOptions)||void 0===e?void 0:e.formatter)?"thousandsSeparatorAndDecimalPoints"===(null===(i=null===(t=this.concatOptions)||void 0===t?void 0:t.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===(r=this.concatOptions)||void 0===r?void 0:r.formatter))?this.integerFormatter():"object"==typeof(null===(a=this.concatOptions)||void 0===a?void 0:a.formatter)&&((null===(c=null===(d=this.concatOptions)||void 0===d?void 0:d.formatter)||void 0===c?void 0:c.prefix)||(null===(u=null===(h=this.concatOptions)||void 0===h?void 0:h.formatter)||void 0===u?void 0:u.postfix))&&this.prefixOrPostfixFormatter(),noUiSlider.create(this.el,this.concatOptions),this.concatOptions.disabled&&this.setDisabled()}formatValue(e){var t,i,s,n,o,l,r,a,d;let c="";return"object"==typeof(null===(t=this.concatOptions)||void 0===t?void 0:t.formatter)?((null===(s=null===(i=this.concatOptions)||void 0===i?void 0:i.formatter)||void 0===s?void 0:s.prefix)&&(c+=null===(o=null===(n=this.concatOptions)||void 0===n?void 0:n.formatter)||void 0===o?void 0:o.prefix),c+=e,(null===(r=null===(l=this.concatOptions)||void 0===l?void 0:l.formatter)||void 0===r?void 0:r.postfix)&&(c+=null===(d=null===(a=this.concatOptions)||void 0===a?void 0:a.formatter)||void 0===d?void 0:d.postfix)):c+=e,c}integerFormatter(){var e;this.format={to:e=>this.formatValue(Math.round(e)),from:e=>Math.round(+e)},(null===(e=this.concatOptions)||void 0===e?void 0:e.tooltips)&&(this.concatOptions.tooltips=this.format)}prefixOrPostfixFormatter(){var e;this.format={to:e=>this.formatValue(e),from:e=>+e},(null===(e=this.concatOptions)||void 0===e?void 0:e.tooltips)&&(this.concatOptions.tooltips=this.format)}thousandsSeparatorAndDecimalPointsFormatter(){var e;this.format={to:e=>this.formatValue(new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}).format(e)),from:e=>parseFloat(e.replace(/,/g,""))},(null===(e=this.concatOptions)||void 0===e?void 0:e.tooltips)&&(this.concatOptions.tooltips=this.format)}setDisabled(){this.el.setAttribute("disabled","disabled"),this.el.classList.add("disabled")}destroy(){this.el.noUiSlider.destroy(),this.format=null,window.$hsRangeSliderCollection=window.$hsRangeSliderCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t=!1){const i=window.$hsRangeSliderCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element.el:null}static autoInit(){window.$hsRangeSliderCollection||(window.$hsRangeSliderCollection=[]),window.$hsRangeSliderCollection&&(window.$hsRangeSliderCollection=window.$hsRangeSliderCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-range-slider]:not(.--prevent-on-load-init)").forEach((e=>{window.$hsRangeSliderCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))||new n(e)}))}static on(e,t,i){const s=window.$hsRangeSliderCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));s&&(s.element.events[e]=i)}}window.addEventListener("load",(()=>{n.autoInit()})),"undefined"!=typeof window&&(window.HSRangeSlider=n);const o=n},259:(e,t,i)=>{i.d(t,{A:()=>l});var s=i(392),n=i(709); -/* - * HSRemoveElement - * @version: 2.6.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(e,t){super(e,t);const i=e.getAttribute("data-remove-element-options"),s=i?JSON.parse(i):{},n=Object.assign(Object.assign({},s),t);this.removeTargetId=this.el.getAttribute("data-remove-element"),this.removeTarget=document.querySelector(this.removeTargetId),this.removeTargetAnimationClass=(null==n?void 0:n.removeTargetAnimationClass)||"removing",this.removeTarget&&this.init()}elementClick(){this.remove()}init(){this.createCollection(window.$hsRemoveElementCollection,this),this.onElementClickListener=()=>this.elementClick(),this.el.addEventListener("click",this.onElementClickListener)}remove(){if(!this.removeTarget)return!1;this.removeTarget.classList.add(this.removeTargetAnimationClass),(0,s.yd)(this.removeTarget,(()=>setTimeout((()=>this.removeTarget.remove()))))}destroy(){this.removeTarget.classList.remove(this.removeTargetAnimationClass),this.el.removeEventListener("click",this.onElementClickListener),window.$hsRemoveElementCollection=window.$hsRemoveElementCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t=!1){const i=window.$hsRemoveElementCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element.el:null}static autoInit(){window.$hsRemoveElementCollection||(window.$hsRemoveElementCollection=[]),window.$hsRemoveElementCollection&&(window.$hsRemoveElementCollection=window.$hsRemoveElementCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-remove-element]:not(.--prevent-on-load-init)").forEach((e=>{window.$hsRemoveElementCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))||new o(e)}))}}window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSRemoveElement=o);const l=o},163:(e,t,i)=>{i.d(t,{A:()=>l});var s=i(392),n=i(709); -/* - * HSScrollspy - * @version: 2.6.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(e,t={}){super(e,t),this.activeSection=null,this.contentId=this.el.getAttribute("data-scrollspy"),this.content=document.querySelector(this.contentId),this.links=this.el.querySelectorAll("[href]"),this.sections=[],this.scrollableId=this.el.getAttribute("data-scrollspy-scrollable-parent"),this.scrollable=this.scrollableId?document.querySelector(this.scrollableId):document,this.onLinkClickListener=[],this.init()}scrollableScroll(e){Array.from(this.sections).forEach((t=>{if(!t.getAttribute("id"))return!1;this.update(e,t)}))}linkClick(e,t){if(e.preventDefault(),"javascript:;"===t.getAttribute("href"))return!1;this.scrollTo(t)}init(){this.createCollection(window.$hsScrollspyCollection,this),this.links.forEach((e=>{this.sections.push(this.scrollable.querySelector(e.getAttribute("href")))})),this.onScrollableScrollListener=e=>this.scrollableScroll(e),this.scrollable.addEventListener("scroll",this.onScrollableScrollListener),this.links.forEach((e=>{this.onLinkClickListener.push({el:e,fn:t=>this.linkClick(t,e)}),e.addEventListener("click",this.onLinkClickListener.find((t=>t.el===e)).fn)}))}update(e,t){const i=parseInt((0,s.gj)(this.el,"--scrollspy-offset","0")),n=parseInt((0,s.gj)(t,"--scrollspy-offset"))||i,o=e.target===document?0:parseInt(String(e.target.getBoundingClientRect().top)),l=parseInt(String(t.getBoundingClientRect().top))-n-o,r=t.offsetHeight;if(l<=0&&l+r>0){if(this.activeSection===t)return!1;this.links.forEach((e=>{e.classList.remove("active")}));const e=this.el.querySelector(`[href="#${t.getAttribute("id")}"]`);if(e){e.classList.add("active");const t=e.closest("[data-scrollspy-group]");if(t){const e=t.querySelector("[href]");e&&e.classList.add("active")}}this.activeSection=t}}scrollTo(e){const t=e.getAttribute("href"),i=document.querySelector(t),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,r=i.offsetTop-o-l,a=this.scrollable===document?window:this.scrollable,d=()=>{window.history.replaceState(null,null,e.getAttribute("href")),"scrollTo"in a&&a.scrollTo({top:r,left:0,behavior:"smooth"})},c=this.fireEvent("beforeScroll",this.el);(0,s.JD)("beforeScroll.scrollspy",this.el,this.el),c instanceof Promise?c.then((()=>d())):d()}destroy(){this.el.querySelector("[href].active").classList.remove("active"),this.scrollable.removeEventListener("scroll",this.onScrollableScrollListener),this.onLinkClickListener.length&&this.onLinkClickListener.forEach((({el:e,fn:t})=>{e.removeEventListener("click",t)})),window.$hsScrollspyCollection=window.$hsScrollspyCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t=!1){const i=window.$hsScrollspyCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element.el:null}static autoInit(){window.$hsScrollspyCollection||(window.$hsScrollspyCollection=[]),window.$hsScrollspyCollection&&(window.$hsScrollspyCollection=window.$hsScrollspyCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-scrollspy]:not(.--prevent-on-load-init)").forEach((e=>{window.$hsScrollspyCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))||new o(e)}))}}window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSScrollspy=o);const l=o},838:(e,t,i)=>{i.d(t,{A:()=>d});var s=i(392),n=i(316),o=i(709),l=i(179),r=function(e,t,i,s){return new(i||(i=Promise))((function(n,o){function l(e){try{a(s.next(e))}catch(e){o(e)}}function r(e){try{a(s.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(l,r)}a((s=s.apply(e,t||[])).next())}))};class a extends o.A{constructor(e,t){var i,s,n;super(e,t),this.optionId=0;const o=e.getAttribute("data-select"),l=o?JSON.parse(o):{},r=Object.assign(Object.assign({},l),t);this.value=(null==r?void 0:r.value)||this.el.value||null,this.placeholder=(null==r?void 0:r.placeholder)||"Select...",this.hasSearch=(null==r?void 0:r.hasSearch)||!1,this.preventSearchFocus=(null==r?void 0:r.preventSearchFocus)||!1,this.mode=(null==r?void 0:r.mode)||"default",this.viewport=void 0!==(null==r?void 0:r.viewport)?document.querySelector(null==r?void 0:r.viewport):null,this.isOpened=Boolean(null==r?void 0:r.isOpened)||!1,this.isMultiple=this.el.hasAttribute("multiple")||!1,this.isDisabled=this.el.hasAttribute("disabled")||!1,this.selectedItems=[],this.apiUrl=(null==r?void 0:r.apiUrl)||null,this.apiQuery=(null==r?void 0:r.apiQuery)||null,this.apiOptions=(null==r?void 0:r.apiOptions)||null,this.apiSearchQueryKey=(null==r?void 0:r.apiSearchQueryKey)||null,this.apiDataPart=(null==r?void 0:r.apiDataPart)||null,this.apiFieldsMap=(null==r?void 0:r.apiFieldsMap)||null,this.apiIconTag=(null==r?void 0:r.apiIconTag)||null,this.wrapperClasses=(null==r?void 0:r.wrapperClasses)||null,this.toggleTag=(null==r?void 0:r.toggleTag)||null,this.toggleClasses=(null==r?void 0:r.toggleClasses)||null,this.toggleCountText=void 0===typeof(null==r?void 0:r.toggleCountText)?null:r.toggleCountText,this.toggleCountTextPlacement=(null==r?void 0:r.toggleCountTextPlacement)||"postfix",this.toggleCountTextMinItems=(null==r?void 0:r.toggleCountTextMinItems)||1,this.toggleCountTextMode=(null==r?void 0:r.toggleCountTextMode)||"countAfterLimit",this.toggleSeparators={items:(null===(i=null==r?void 0:r.toggleSeparators)||void 0===i?void 0:i.items)||", ",betweenItemsAndCounter:(null===(s=null==r?void 0:r.toggleSeparators)||void 0===s?void 0:s.betweenItemsAndCounter)||"and"},this.tagsItemTemplate=(null==r?void 0:r.tagsItemTemplate)||null,this.tagsItemClasses=(null==r?void 0:r.tagsItemClasses)||null,this.tagsInputId=(null==r?void 0:r.tagsInputId)||null,this.tagsInputClasses=(null==r?void 0:r.tagsInputClasses)||null,this.dropdownTag=(null==r?void 0:r.dropdownTag)||null,this.dropdownClasses=(null==r?void 0:r.dropdownClasses)||null,this.dropdownDirectionClasses=(null==r?void 0:r.dropdownDirectionClasses)||null,this.dropdownSpace=(null==r?void 0:r.dropdownSpace)||10,this.dropdownPlacement=(null==r?void 0:r.dropdownPlacement)||null,this.dropdownVerticalFixedPlacement=(null==r?void 0:r.dropdownVerticalFixedPlacement)||null,this.dropdownScope=(null==r?void 0:r.dropdownScope)||"parent",this.searchTemplate=(null==r?void 0:r.searchTemplate)||null,this.searchWrapperTemplate=(null==r?void 0:r.searchWrapperTemplate)||null,this.searchWrapperClasses=(null==r?void 0:r.searchWrapperClasses)||"bg-white p-2 sticky top-0",this.searchId=(null==r?void 0:r.searchId)||null,this.searchLimit=(null==r?void 0:r.searchLimit)||1/0,this.isSearchDirectMatch=void 0===(null==r?void 0:r.isSearchDirectMatch)||(null==r?void 0:r.isSearchDirectMatch),this.searchClasses=(null==r?void 0:r.searchClasses)||"border-base-content/40 focus:border-primary focus:ring-primary bg-base-100 block w-full rounded-btn border px-3 py-2 text-base focus:ring-1",this.searchPlaceholder=(null==r?void 0:r.searchPlaceholder)||"Search...",this.searchNoResultTemplate=(null==r?void 0:r.searchNoResultTemplate)||"",this.searchNoResultText=(null==r?void 0:r.searchNoResultText)||"No results found",this.searchNoResultClasses=(null==r?void 0:r.searchNoResultClasses)||"block advance-select-option",this.optionTemplate=(null==r?void 0:r.optionTemplate)||null,this.optionTag=(null==r?void 0:r.optionTag)||null,this.optionClasses=(null==r?void 0:r.optionClasses)||null,this.extraMarkup=(null==r?void 0:r.extraMarkup)||null,this.descriptionClasses=(null==r?void 0:r.descriptionClasses)||null,this.iconClasses=(null==r?void 0:r.iconClasses)||null,this.isAddTagOnEnter=null===(n=null==r?void 0:r.isAddTagOnEnter)||void 0===n||n,this.animationInProcess=!1,this.selectOptions=[],this.remoteOptions=[],this.tagsInputHelper=null,this.init()}wrapperClick(e){e.target.closest("[data-select-dropdown]")||e.target.closest("[data-tag-value]")||this.tagsInput.focus()}toggleClick(){if(this.isDisabled)return!1;this.toggleFn()}tagsInputFocus(){this.isOpened||this.open()}tagsInputInput(){this.calculateInputWidth()}tagsInputInputSecond(e){this.searchOptions(e.target.value)}tagsInputKeydown(e){if("Enter"===e.key&&this.isAddTagOnEnter){const t=e.target.value;if(this.selectOptions.find((e=>e.val===t)))return!1;this.addSelectOption(t,t),this.buildOption(t,t),this.dropdown.querySelector(`[data-value="${t}"]`).click(),this.resetTagsInputField()}}searchInput(e){this.apiUrl?this.remoteSearch(e.target.value):this.searchOptions(e.target.value)}setValue(e){this.value=e,this.clearSelections(),Array.isArray(e)?(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((e=>e.value&&""!==e.value)).forEach((e=>{const t=e.getAttribute("data-select-option");this.selectOptions=[...this.selectOptions,{title:e.textContent,val:e.value,disabled:e.disabled,options:"undefined"!==t?JSON.parse(t):null}]})),this.isMultiple){const e=Array.from(this.el.children).filter((e=>e.selected));if(e){const t=[];e.forEach((e=>{t.push(e.value)})),this.value=t}}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("advance-select","relative"),"tags"===this.mode&&(this.onWrapperClickListener=e=>this.wrapperClick(e),this.wrapper.addEventListener("click",this.onWrapperClickListener)),this.wrapperClasses&&(0,s.en)(this.wrapperClasses,this.wrapper),this.el.before(this.wrapper),this.wrapper.append(this.el)}buildExtraMarkup(){const e=e=>{const t=(0,s.fc)(e);return this.wrapper.append(t),t},t=e=>{e.classList.contains("--prevent-click")||e.addEventListener("click",(e=>{e.stopPropagation(),this.toggleFn()}))};if(Array.isArray(this.extraMarkup))this.extraMarkup.forEach((i=>{const s=e(i);t(s)}));else{const i=e(this.extraMarkup);t(i)}}buildToggle(){var e,t;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===(e=this.getItemByValue(this.value))||void 0===e?void 0:e.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===(t=this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.isOpened?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.onToggleClickListener=()=>this.toggleClick(),this.toggle.addEventListener("click",this.onToggleClickListener)}setToggleIcon(){var e;const t=this.getItemByValue(this.value),i=this.toggle.querySelector("[data-icon]");if(i){i.innerHTML="";const n=(0,s.fc)(this.apiUrl&&this.apiIconTag?this.apiIconTag||"":(null===(e=null==t?void 0:t.options)||void 0===e?void 0:e.icon)||"");this.value&&this.apiUrl&&this.apiIconTag&&t[this.apiFieldsMap.icon]&&(n.src=t[this.apiFieldsMap.icon]||""),i.append(n),n?i.classList.remove("hidden"):i.classList.add("hidden")}}setToggleTitle(){var e;const t=this.toggle.querySelector("[data-title]");t&&(t.innerHTML=(null===(e=this.getItemByValue(this.value))||void 0===e?void 0:e.title)||this.placeholder,t.classList.add("truncate"),this.toggle.append(t))}buildTags(){this.isDisabled&&this.wrapper.classList.add("disabled"),this.buildTagsInput(),this.setTagsItems()}reassignTagsInputPlaceholder(e){this.tagsInput.placeholder=e,this.tagsInputHelper.innerHTML=e,this.calculateInputWidth()}buildTagsItem(e){var t,i,n,o;const l=this.getItemByValue(e);let r,a,d,c;const h=document.createElement("div");if(h.setAttribute("data-tag-value",e),this.tagsItemClasses&&(0,s.en)(this.tagsItemClasses,h),this.tagsItemTemplate&&(r=(0,s.fc)(this.tagsItemTemplate),h.append(r)),(null===(t=null==l?void 0:l.options)||void 0===t?void 0:t.icon)||this.apiIconTag){const e=(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]&&(e.src=l[this.apiFieldsMap.icon]||""),c=r?r.querySelector("[data-icon]"):document.createElement("span"),c.append(e),r||h.append(c)}!r||!r.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]||r.querySelector("[data-icon]").classList.add("hidden"),a=r?r.querySelector("[data-title]"):document.createElement("span"),a.textContent=l.title||"",r||h.append(a),r?d=r.querySelector("[data-remove]"):(d=document.createElement("span"),d.textContent="X",h.append(d)),d.addEventListener("click",(()=>{this.value=this.value.filter((t=>t!==e)),this.selectedItems=this.selectedItems.filter((t=>t!==e)),this.value.length||this.reassignTagsInputPlaceholder(this.placeholder),this.unselectMultipleItems(),this.selectMultipleItems(),h.remove(),this.triggerChangeEventForNativeSelect()})),this.wrapper.append(h)}getItemByValue(e){return this.apiUrl?this.remoteOptions.find((t=>`${t[this.apiFieldsMap.val]}`===e||t[this.apiFieldsMap.title]===e)):this.selectOptions.find((t=>t.val===e))}setTagsItems(){this.value&&this.value.forEach((e=>{this.selectedItems.includes(e)||this.buildTagsItem(e),this.selectedItems=this.selectedItems.includes(e)?this.selectedItems:[...this.selectedItems,e]}))}buildTagsInput(){this.tagsInput=document.createElement("input"),this.tagsInputId&&(this.tagsInput.id=this.tagsInputId),this.tagsInputClasses&&(0,s.en)(this.tagsInputClasses,this.tagsInput),this.onTagsInputFocusListener=()=>this.tagsInputFocus(),this.onTagsInputInputListener=()=>this.tagsInputInput(),this.onTagsInputInputSecondListener=(0,s.sg)((e=>this.tagsInputInputSecond(e))),this.onTagsInputKeydownListener=e=>this.tagsInputKeydown(e),this.tagsInput.addEventListener("focus",this.onTagsInputFocusListener),this.tagsInput.addEventListener("input",this.onTagsInputInputListener),this.tagsInput.addEventListener("input",this.onTagsInputInputSecondListener),this.tagsInput.addEventListener("keydown",this.onTagsInputKeydownListener),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-select-dropdown",""),"parent"===this.dropdownScope&&(this.dropdown.classList.add("absolute"),this.dropdownVerticalFixedPlacement||this.dropdown.classList.add("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(((e,t)=>this.buildOption(e.title,e.val,e.disabled,e.selected,e.options,`${t}`))),this.apiUrl&&this.optionsFromRemoteData(),"window"===this.dropdownScope&&this.buildPopper()}buildPopper(){if(void 0!==n.n4){document.body.appendChild(this.dropdown);const e="tags"===this.mode?this.wrapper:this.toggle;this.popperInstance=(0,n.n4)(e,this.dropdown,{placement:l.lP[this.dropdownPlacement]||"bottom",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,5]}}]})}}updateDropdownWidth(){const e="tags"===this.mode?this.wrapper:this.toggle;this.dropdown.style.width=`${e.clientWidth}px`}buildSearch(){let e;this.searchWrapper=(0,s.fc)(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&(0,s.en)(this.searchWrapperClasses,this.searchWrapper),e=this.searchWrapper.querySelector("[data-input]");const t=(0,s.fc)(this.searchTemplate||'');this.search="INPUT"===t.tagName?t:t.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.onSearchInputListener=(0,s.sg)((e=>this.searchInput(e))),this.search.addEventListener("input",this.onSearchInputListener),e?e.append(t):this.searchWrapper.append(t),this.dropdown.append(this.searchWrapper)}buildOption(e,t,i=!1,n=!1,o,l="1",r){var a;let d=null,c=null,h=null,u=null;const p=(0,s.fc)(this.optionTag||"
");if(p.setAttribute("data-value",t),p.setAttribute("data-title-value",e),p.setAttribute("tabIndex",l),p.classList.add("cursor-pointer"),p.setAttribute("data-id",r||`${this.optionId}`),r||this.optionId++,i&&p.classList.add("disabled"),n&&(this.isMultiple?this.value=[...this.value,t]:this.value=t),this.optionTemplate&&(d=(0,s.fc)(this.optionTemplate),p.append(d)),d?(c=d.querySelector("[data-title]"),c.textContent=e||""):p.textContent=e||"",o){if(o.icon){const t=(0,s.fc)(null!==(a=this.apiIconTag)&&void 0!==a?a:o.icon);if(t.classList.add("max-w-full"),this.apiUrl&&(t.setAttribute("alt",e),t.setAttribute("src",o.icon)),d)h=d.querySelector("[data-icon]"),h.append(t);else{const e=(0,s.fc)("
");this.iconClasses&&(0,s.en)(this.iconClasses,e),e.append(t),p.append(e)}}if(o.description)if(d)u=d.querySelector("[data-description]"),u&&u.append(o.description);else{const e=(0,s.fc)("
");e.textContent=o.description,this.descriptionClasses&&(0,s.en)(this.descriptionClasses,e),p.append(e)}}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(t):this.value===t)&&p.classList.add("selected"),i||p.addEventListener("click",(()=>this.onSelectOption(t))),this.optionClasses&&(0,s.en)(this.optionClasses,p),this.dropdown&&this.dropdown.append(p),n&&this.setNewValue()}buildOptionFromRemoteData(e,t,i=!1,s=!1,n="1",o,l){n?this.buildOption(e,t,i,s,l,n,o):alert("ID parameter is required for generating remote options! Please check your API endpoint have it.")}buildOptionsFromRemoteData(e){e.forEach(((e,t)=>{let i=null,s="",n="";const o={id:"",val:"",title:"",icon:null,description:null,rest:{}};Object.keys(e).forEach((t=>{var l;e[this.apiFieldsMap.id]&&(i=e[this.apiFieldsMap.id]),(e[this.apiFieldsMap.val]||e[this.apiFieldsMap.title])&&(n=e[this.apiFieldsMap.val]||e[this.apiFieldsMap.title]),e[this.apiFieldsMap.title]&&(s=e[this.apiFieldsMap.title]),e[this.apiFieldsMap.icon]&&(o.icon=e[this.apiFieldsMap.icon]),e[null===(l=this.apiFieldsMap)||void 0===l?void 0:l.description]&&(o.description=e[this.apiFieldsMap.description]),o.rest[t]=e[t]})),this.buildOriginalOption(s,`${n}`,i,!1,!1,o),this.buildOptionFromRemoteData(s,`${n}`,!1,!1,`${t}`,i,o)})),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")}optionsFromRemoteData(){return r(this,arguments,void 0,(function*(e=""){const t=yield this.apiRequest(e);this.remoteOptions=t,t.length?this.buildOptionsFromRemoteData(this.remoteOptions):console.log("There is no data were responded!")}))}apiRequest(){return r(this,arguments,void 0,(function*(e=""){try{let t=this.apiUrl;const i=this.apiSearchQueryKey?`${this.apiSearchQueryKey}=${e.toLowerCase()}`:null,s=`${this.apiQuery}`,n=this.apiOptions||{};i&&(t+=`?${i}`),this.apiQuery&&(t+=`${i?"&":"?"}${s}`);const o=yield fetch(t,n),l=yield o.json();return this.apiDataPart?l[this.apiDataPart]:l}catch(e){console.error(e)}}))}sortElements(e,t){const i=Array.from(e.querySelectorAll(t));i.sort(((e,t)=>{const i=e.classList.contains("selected")||e.hasAttribute("selected"),s=t.classList.contains("selected")||t.hasAttribute("selected");return i&&!s?-1:!i&&s?1:0})),i.forEach((t=>e.appendChild(t)))}remoteSearch(e){return r(this,void 0,void 0,(function*(){const t=yield this.apiRequest(e);this.remoteOptions=t;let i=t.map((e=>`${e.id}`)),s=null;const n=this.dropdown.querySelectorAll("[data-value]");this.el.querySelectorAll("[data-select-option]").forEach((e=>{var t;const s=e.getAttribute("data-id");i.includes(s)||(null===(t=this.value)||void 0===t?void 0:t.includes(e.value))||this.destroyOriginalOption(e.value)})),n.forEach((e=>{var t;const s=e.getAttribute("data-id");i.includes(s)||(null===(t=this.value)||void 0===t?void 0:t.includes(e.getAttribute("data-value")))?i=i.filter((e=>e!==s)):this.destroyOption(e.getAttribute("data-value"))})),s=t.filter((e=>i.includes(`${e.id}`))),s.length?this.buildOptionsFromRemoteData(s):console.log("There is no data were responded!")}))}destroyOption(e){const t=this.dropdown.querySelector(`[data-value="${e}"]`);if(!t)return!1;t.remove()}buildOriginalOption(e,t,i,n,o,l){const r=(0,s.fc)("");r.setAttribute("value",t),n&&r.setAttribute("disabled","disabled"),o&&r.setAttribute("selected","selected"),i&&r.setAttribute("data-id",i),r.setAttribute("data-select-option",JSON.stringify(l)),r.innerText=e,this.el.append(r)}destroyOriginalOption(e){const t=this.el.querySelector(`[value="${e}"]`);if(!t)return!1;t.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 e=parseInt(window.getComputedStyle(this.tagsInput).paddingLeft)+parseInt(window.getComputedStyle(this.tagsInput).paddingRight),t=parseInt(window.getComputedStyle(this.tagsInput).borderLeftWidth)+parseInt(window.getComputedStyle(this.tagsInput).borderRightWidth),i=this.tagsInputHelper.offsetWidth+e+t,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(e){if(this.clearSelections(),this.isMultiple?(this.value=this.value.includes(e)?Array.from(this.value).filter((t=>t!==e)):[...Array.from(this.value),e],this.selectMultipleItems(),this.setNewValue()):(this.value=e,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),"tags"===this.mode){const e=this.selectedItems.filter((e=>!this.value.includes(e)));e.length&&e.forEach((e=>{this.selectedItems=this.selectedItems.filter((t=>t!==e)),this.wrapper.querySelector(`[data-tag-value="${e}"]`).remove()})),this.resetTagsInputField()}this.isMultiple||(this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.close(!0)),this.value.length||"tags"!==this.mode||this.reassignTagsInputPlaceholder(this.placeholder),this.isOpened&&"tags"===this.mode&&this.tagsInput&&this.tagsInput.focus(),this.triggerChangeEventForNativeSelect()}triggerChangeEventForNativeSelect(){const e=new Event("change",{bubbles:!0});this.el.dispatchEvent(e),(0,s.JD)("change.advance.select",this.el,this.value)}addSelectOption(e,t,i,s,n){this.selectOptions=[...this.selectOptions,{title:e,val:t,disabled:i,selected:s,options:n}]}removeSelectOption(e,t=!1){if(!!!this.selectOptions.some((t=>t.val===e)))return!1;this.selectOptions=this.selectOptions.filter((t=>t.val!==e)),this.value=t?this.value.filter((t=>t!==e)):e}resetTagsInputField(){this.tagsInput.value="",this.reassignTagsInputPlaceholder(""),this.searchOptions("")}clearSelections(){Array.from(this.dropdown.children).forEach((e=>{e.classList.contains("selected")&&e.classList.remove("selected")})),Array.from(this.el.children).forEach((e=>{e.selected&&(e.selected=!1)}))}setNewValue(){var e;"tags"===this.mode?this.setTagsItems():(null===(e=this.value)||void 0===e?void 0:e.length)?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder}stringFromValueBasic(e){var t;const i=[];let s="";if(e.forEach((e=>{this.isMultiple?this.value.includes(e.val)&&i.push(e.title):this.value===e.val&&i.push(e.title)})),void 0!==this.toggleCountText&&null!==this.toggleCountText&&i.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){const e=i.slice(0,this.toggleCountTextMinItems-1),n=[e.join(this.toggleSeparators.items)],o=""+(i.length-e.length);if((null===(t=null==this?void 0:this.toggleSeparators)||void 0===t?void 0:t.betweenItemsAndCounter)&&n.push(this.toggleSeparators.betweenItemsAndCounter),this.toggleCountText)switch(this.toggleCountTextPlacement){case"postfix-no-space":n.push(`${o}${this.toggleCountText}`);break;case"prefix-no-space":n.push(`${this.toggleCountText}${o}`);break;case"prefix":n.push(`${this.toggleCountText} ${o}`);break;default:n.push(`${o} ${this.toggleCountText}`)}s=n.join(" ")}else s=`${i.length} ${this.toggleCountText}`;else s=i.join(this.toggleSeparators.items);return s}stringFromValueRemoteData(){const e=this.dropdown.querySelectorAll("[data-title-value]"),t=[];let i="";if(e.forEach((e=>{const i=e.getAttribute("data-value"),s=e.getAttribute("data-title-value");this.isMultiple?this.value.includes(i)&&t.push(s):this.value===i&&t.push(s)})),this.toggleCountText&&""!==this.toggleCountText&&t.length>=this.toggleCountTextMinItems)if("nItemsAndCount"===this.toggleCountTextMode){const e=t.slice(0,this.toggleCountTextMinItems-1);i=`${e.join(this.toggleSeparators.items)} ${this.toggleSeparators.betweenItemsAndCounter} ${t.length-e.length} ${this.toggleCountText}`}else i=`${t.length} ${this.toggleCountText}`;else i=t.join(this.toggleSeparators.items);return i}stringFromValue(){return this.apiUrl?this.stringFromValueRemoteData():this.stringFromValueBasic(this.selectOptions)}selectSingleItem(){Array.from(this.el.children).find((e=>this.value===e.value)).selected=!0;const e=Array.from(this.dropdown.children).find((e=>this.value===e.getAttribute("data-value")));e&&e.classList.add("selected")}selectMultipleItems(){Array.from(this.dropdown.children).filter((e=>this.value.includes(e.getAttribute("data-value")))).forEach((e=>e.classList.add("selected"))),Array.from(this.el.children).filter((e=>this.value.includes(e.value))).forEach((e=>e.selected=!0))}unselectMultipleItems(){Array.from(this.dropdown.children).forEach((e=>e.classList.remove("selected"))),Array.from(this.el.children).forEach((e=>e.selected=!1))}searchOptions(e){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 t=this.dropdown.querySelectorAll("[data-value]");let i,n=!1;this.searchLimit&&(i=0),t.forEach((t=>{const s=t.getAttribute("data-title-value").toLocaleLowerCase(),o=e?e.split("").map((e=>e.match(/\w/)?`${e}[\\W_]*`:"\\W*")).join(""):"",l=new RegExp(o,"i"),r=this.isSearchDirectMatch,a=s.trim();(e?r?!a.toLowerCase().includes(e.toLowerCase())||i>=this.searchLimit:!l.test(a)||i>=this.searchLimit:!l.test(a))?t.classList.add("hidden"):(t.classList.remove("hidden"),n=!0,this.searchLimit&&i++)})),n||this.dropdown.append(this.searchNoResult)}eraseToggleIcon(){const e=this.toggle.querySelector("[data-icon]");e&&(e.innerHTML=null,e.classList.add("hidden"))}eraseToggleTitle(){const e=this.toggle.querySelector("[data-title]");e?e.innerHTML=this.placeholder:this.toggleTextWrapper.innerHTML=this.placeholder}toggleFn(){this.isOpened?this.close():this.open()}destroy(){this.wrapper&&this.wrapper.removeEventListener("click",this.onWrapperClickListener),this.toggle&&this.toggle.removeEventListener("click",this.onToggleClickListener),this.tagsInput&&(this.tagsInput.removeEventListener("focus",this.onTagsInputFocusListener),this.tagsInput.removeEventListener("input",this.onTagsInputInputListener),this.tagsInput.removeEventListener("input",this.onTagsInputInputSecondListener),this.tagsInput.removeEventListener("keydown",this.onTagsInputKeydownListener)),this.search&&this.search.removeEventListener("input",this.onSearchInputListener);const e=this.el.parentElement.parentElement;this.el.classList.remove("hidden"),this.el.style.display="",e.prepend(this.el),e.querySelector(".advance-select").remove(),this.wrapper=null}open(){var e;const t=(null===(e=null===window||void 0===window?void 0:window.$hsSelectCollection)||void 0===e?void 0:e.find((e=>e.element.isOpened)))||null;if(t&&t.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 e;(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.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(e=!1){var t,i,n,o;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===(i=this.dropdownDirectionClasses)||void 0===i?void 0:i.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,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()),e&&this.toggle.focus(),this.animationInProcess=!1})),null===(o=this.dropdown.querySelector(".select-option-highlighted"))||void 0===o||o.classList.remove("select-option-highlighted"),this.isOpened=!1}addOption(e){let t=`${this.selectOptions.length}`;const i=e=>{const{title:i,val:s,disabled:n,selected:o,options:l}=e;!!this.selectOptions.some((e=>e.val===s))||(this.addSelectOption(i,s,n,o,l),this.buildOption(i,s,n,o,l,t),this.buildOriginalOption(i,s,null,n,o,l),o&&!this.isMultiple&&this.onSelectOption(s))};Array.isArray(e)?e.forEach((e=>{i(e)})):i(e)}removeOption(e){const t=(e,t=!1)=>{!!this.selectOptions.some((t=>t.val===e))&&(this.removeSelectOption(e,t),this.destroyOption(e),this.destroyOriginalOption(e),this.value===e&&(this.value=null,this.eraseToggleTitle(),this.eraseToggleIcon()))};Array.isArray(e)?e.forEach((e=>{t(e,this.isMultiple)})):t(e,this.isMultiple),this.setNewValue()}recalculateDirection(){var e,t,i,n;if((null==this?void 0:this.dropdownVerticalFixedPlacement)&&(this.dropdown.classList.contains("bottom-full")||this.dropdown.classList.contains("top-full")))return!1;"top"===(null==this?void 0:this.dropdownVerticalFixedPlacement)?(this.dropdown.classList.add("bottom-full"),this.dropdown.style.marginBottom=`${this.dropdownSpace}px`):"bottom"===(null==this?void 0:this.dropdownVerticalFixedPlacement)?(this.dropdown.classList.add("top-full"),this.dropdown.style.marginTop=`${this.dropdownSpace}px`):(0,s.PR)(this.dropdown,this.toggle||this.tagsInput,"bottom",this.dropdownSpace,this.viewport)?(this.dropdown.classList.remove("bottom-full"),(null===(e=this.dropdownDirectionClasses)||void 0===e?void 0:e.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="",this.dropdown.classList.add("top-full"),(null===(t=this.dropdownDirectionClasses)||void 0===t?void 0:t.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(e,t){const i=window.$hsSelectCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element:null}static autoInit(){window.$hsSelectCollection||(window.$hsSelectCollection=[],window.addEventListener("click",(e=>{const t=e.target;a.closeCurrentlyOpened(t)})),document.addEventListener("keydown",(e=>a.accessibility(e)))),window.$hsSelectCollection&&(window.$hsSelectCollection=window.$hsSelectCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-select]:not(.--prevent-on-load-init)").forEach((e=>{if(!window.$hsSelectCollection.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-select"),i=t?JSON.parse(t):{};new a(e,i)}}))}static open(e){const t=window.$hsSelectCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));t&&!t.element.isOpened&&t.element.open()}static close(e){const t=window.$hsSelectCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));t&&t.element.isOpened&&t.element.close()}static closeCurrentlyOpened(e=null){if(!e.closest(".advance-select.active")&&!e.closest("[data-select-dropdown].opened")){const e=window.$hsSelectCollection.filter((e=>e.element.isOpened))||null;e&&e.forEach((e=>{e.element.close()}))}}static accessibility(e){if(window.$hsSelectCollection.find((e=>e.element.isOpened))&&l.fp.includes(e.code)&&!e.metaKey)switch(e.code){case"Escape":e.preventDefault(),this.onEscape();break;case"ArrowUp":e.preventDefault(),e.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":e.preventDefault(),e.stopImmediatePropagation(),this.onArrow(!1);break;case"Tab":e.preventDefault(),e.stopImmediatePropagation(),this.onTab(e.shiftKey);break;case"Home":e.preventDefault(),e.stopImmediatePropagation(),this.onStartEnd();break;case"End":e.preventDefault(),e.stopImmediatePropagation(),this.onStartEnd(!1);break;case"Enter":case"Space":e.preventDefault(),this.onEnter(e)}}static onEscape(){const e=window.$hsSelectCollection.find((e=>e.element.isOpened));e&&e.element.close()}static onArrow(e=!0){const t=window.$hsSelectCollection.find((e=>e.element.isOpened));if(t){const i=t.element.dropdown;if(!i)return!1;const s=(e?Array.from(i.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(i.querySelectorAll(":scope > *:not(.hidden)"))).filter((e=>!e.classList.contains("disabled"))),n=i.querySelector(".select-option-highlighted")||i.querySelector(".selected");n||s[0].classList.add("select-option-highlighted");let o=s.findIndex((e=>e===n));o+1e.element.isOpened));if(t){const i=t.element.dropdown;if(!i)return!1;const s=(e?Array.from(i.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(i.querySelectorAll(":scope > *:not(.hidden)"))).filter((e=>!e.classList.contains("disabled"))),n=i.querySelector(".select-option-highlighted")||i.querySelector(".selected");n||s[0].classList.add("select-option-highlighted");let o=s.findIndex((e=>e===n));if(!(o+1e.element.isOpened));if(t){const i=t.element.dropdown;if(!i)return!1;const s=(e?Array.from(i.querySelectorAll(":scope > *:not(.hidden)")):Array.from(i.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter((e=>!e.classList.contains("disabled"))),n=i.querySelector(".select-option-highlighted");s.length&&(s[0].focus(),n&&n.classList.remove("select-option-highlighted"),s[0].classList.add("select-option-highlighted"))}}static onEnter(e){const t=e.target.previousSibling;if(window.$hsSelectCollection.find((e=>e.element.el===t))){const e=window.$hsSelectCollection.find((e=>e.element.isOpened)),i=window.$hsSelectCollection.find((e=>e.element.el===t));e.element.close(),i.element.open()}else{const t=window.$hsSelectCollection.find((e=>e.element.isOpened));t&&t.element.onSelectOption(e.target.dataset.value||"")}}}window.addEventListener("load",(()=>{a.autoInit()})),document.addEventListener("scroll",(()=>{if(!window.$hsSelectCollection)return!1;const e=window.$hsSelectCollection.find((e=>e.element.isOpened));e&&e.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSSelect=a);const d=a},467:(e,t,i)=>{i.d(t,{A:()=>l});var s=i(392),n=i(709); -/* - * HSStepper - * @version: 2.6.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(e,t){super(e,t);const i=e.getAttribute("data-stepper"),s=i?JSON.parse(i):{},n=Object.assign(Object.assign({},s),t);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.onNavItemClickListener=[],this.init()}navItemClick(e){this.handleNavItemClick(e)}backClick(){if(this.handleBackButtonClick(),"linear"===this.mode){const e=this.navItems.find((({index:e})=>e===this.currentIndex)),t=this.contentItems.find((({index:e})=>e===this.currentIndex));if(!e||!t)return;e.isCompleted&&(e.isCompleted=!1,e.isSkip=!1,e.el.classList.remove("is-valid","skipped")),t.isCompleted&&(t.isCompleted=!1,t.isSkip=!1,t.el.classList.remove("is-valid","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()}}nextClick(){var e;if(this.fireEvent("beforeNext",this.currentIndex),(0,s.JD)("beforeNext.stepper",this.el,this.currentIndex),null===(e=this.getNavItem(this.currentIndex))||void 0===e?void 0:e.isProcessed)return this.disableAll(),!1;this.goToNext()}skipClick(){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=""))}completeStepBtnClick(){this.handleCompleteStepButtonClick()}finishBtnClick(){var e;if(this.fireEvent("beforeFinish",this.currentIndex),(0,s.JD)("beforeFinish.stepper",this.el,this.currentIndex),null===(e=this.getNavItem(this.currentIndex))||void 0===e?void 0:e.isProcessed)return this.disableAll(),!1;this.handleFinishButtonClick()}resetBtnClick(){this.handleResetButtonClick()}init(){this.createCollection(window.$hsStepperCollection,this),this.buildNav(),this.buildContent(),this.buildButtons(),this.setTotalSteps()}getUncompletedSteps(e=!1){return this.navItems.filter((({isCompleted:t,isSkip:i})=>e?!t||i:!t&&!i))}setTotalSteps(){this.navItems.forEach((e=>{const{index:t}=e;t>this.totalSteps&&(this.totalSteps=t)}))}buildNav(){this.el.querySelectorAll("[data-stepper-nav-item]").forEach((e=>this.addNavItem(e))),this.navItems.forEach((e=>this.buildNavItem(e)))}buildNavItem(e){const{index:t,isDisabled:i,el:s}=e;t===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||i)&&(this.onNavItemClickListener.push({el:s,fn:()=>this.navItemClick(e)}),s.addEventListener("click",this.onNavItemClickListener.find((e=>e.el===s)).fn))}addNavItem(e){const{index:t,isFinal:i=!1,isCompleted:s=!1,isSkip:n=!1,isOptional:o=!1,isDisabled:l=!1,isProcessed:r=!1,isInvalid:a=!1}=JSON.parse(e.getAttribute("data-stepper-nav-item"));s&&e.classList.add("is-valid"),n&&e.classList.add("skipped"),l&&("BUTTON"!==e.tagName&&"INPUT"!==e.tagName||e.setAttribute("disabled","disabled"),e.classList.add("disabled")),a&&e.classList.add("is-invalid"),this.navItems.push({index:t,isFinal:i,isCompleted:s,isSkip:n,isOptional:o,isDisabled:l,isProcessed:r,isInvalid:a,el:e})}setCurrentNavItem(){this.navItems.forEach((e=>{const{index:t,el:i}=e;t===this.currentIndex?this.setCurrentNavItemActions(i):this.unsetCurrentNavItemActions(i)}))}setCurrentNavItemActions(e){e.classList.add("active"),this.fireEvent("active",this.currentIndex),(0,s.JD)("active.stepper",this.el,this.currentIndex)}getNavItem(e=this.currentIndex){return this.navItems.find((({index:t})=>t===e))}setProcessedNavItemActions(e){e.isProcessed=!0,e.el.classList.add("processed")}setErrorNavItemActions(e){e.isInvalid=!0,e.el.classList.add("is-invalid")}unsetCurrentNavItemActions(e){e.classList.remove("active")}handleNavItemClick(e){const{index:t}=e;this.currentIndex=t,this.setCurrentNavItem(),this.setCurrentContentItem(),this.checkForTheFirstStep()}buildContent(){this.el.querySelectorAll("[data-stepper-content-item]").forEach((e=>this.addContentItem(e))),this.navItems.forEach((e=>this.buildContentItem(e)))}buildContentItem(e){const{index:t}=e;t===this.currentIndex&&this.setCurrentContentItem()}addContentItem(e){const{index:t,isFinal:i=!1,isCompleted:s=!1,isSkip:n=!1}=JSON.parse(e.getAttribute("data-stepper-content-item"));s&&e.classList.add("is-valid"),n&&e.classList.add("skipped"),this.contentItems.push({index:t,isFinal:i,isCompleted:s,isSkip:n,el:e})}setCurrentContentItem(){if(this.isCompleted){const e=this.contentItems.find((({isFinal:e})=>e)),t=this.contentItems.filter((({isFinal:e})=>!e));return e.el.style.display="",t.forEach((({el:e})=>e.style.display="none")),!1}this.contentItems.forEach((e=>{const{index:t,el:i}=e;t===this.currentIndex?this.setCurrentContentItemActions(i):this.unsetCurrentContentItemActions(i)}))}hideAllContentItems(){this.contentItems.forEach((({el:e})=>e.style.display="none"))}setCurrentContentItemActions(e){e.style.display=""}unsetCurrentContentItemActions(e){e.style.display="none"}disableAll(){const e=this.getNavItem(this.currentIndex);e.isInvalid=!1,e.isCompleted=!1,e.isDisabled=!1,e.el.classList.remove("is-invalid","is-valid"),this.disableButtons()}disableNavItemActions(e){e.isDisabled=!0,e.el.classList.add("disabled")}enableNavItemActions(e){e.isDisabled=!1,e.el.classList.remove("disabled")}buildButtons(){this.backBtn=this.el.querySelector("[data-stepper-back-btn]"),this.nextBtn=this.el.querySelector("[data-stepper-next-btn]"),this.skipBtn=this.el.querySelector("[data-stepper-skip-btn]"),this.completeStepBtn=this.el.querySelector("[data-stepper-complete-step-btn]"),this.finishBtn=this.el.querySelector("[data-stepper-finish-btn]"),this.resetBtn=this.el.querySelector("[data-stepper-reset-btn]"),this.buildBackButton(),this.buildNextButton(),this.buildSkipButton(),this.buildCompleteStepButton(),this.buildFinishButton(),this.buildResetButton()}buildBackButton(){this.backBtn&&(this.checkForTheFirstStep(),this.onBackClickListener=()=>this.backClick(),this.backBtn.addEventListener("click",this.onBackClickListener))}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.stepper",this.el,this.currentIndex))}checkForTheFirstStep(){1===this.currentIndex?this.setToDisabled(this.backBtn):this.setToNonDisabled(this.backBtn)}setToDisabled(e){"BUTTON"!==e.tagName&&"INPUT"!==e.tagName||e.setAttribute("disabled","disabled"),e.classList.add("disabled")}setToNonDisabled(e){"BUTTON"!==e.tagName&&"INPUT"!==e.tagName||e.removeAttribute("disabled"),e.classList.remove("disabled")}buildNextButton(){this.nextBtn&&(this.onNextClickListener=()=>this.nextClick(),this.nextBtn.addEventListener("click",this.onNextClickListener))}unsetProcessedNavItemActions(e){e.isProcessed=!1,e.el.classList.remove("processed")}handleNextButtonClick(e=!0){if(e)this.currentIndex===this.totalSteps?this.currentIndex=1:this.currentIndex++;else{const e=this.getUncompletedSteps();if(1===e.length){const{index:t}=e[0];this.currentIndex=t}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.stepper",this.el,this.currentIndex)}removeOptionalClasses(){const e=this.navItems.find((({index:e})=>e===this.currentIndex)),t=this.contentItems.find((({index:e})=>e===this.currentIndex));e.isSkip=!1,e.isInvalid=!1,e.isDisabled=!1,t.isSkip=!1,e.el.classList.remove("skipped","is-valid","is-invalid"),t.el.classList.remove("skipped","is-valid","is-invalid")}buildSkipButton(){this.skipBtn&&(this.showSkipButton(),this.onSkipClickListener=()=>this.skipClick(),this.skipBtn.addEventListener("click",this.onSkipClickListener))}setSkipItem(e){const t=this.navItems.find((({index:t})=>t===(e||this.currentIndex))),i=this.contentItems.find((({index:t})=>t===(e||this.currentIndex)));t&&i&&(this.setSkipItemActions(t),this.setSkipItemActions(i))}setSkipItemActions(e){e.isSkip=!0,e.el.classList.add("skipped")}showSkipButton(){if(!this.skipBtn)return;const{isOptional:e}=this.navItems.find((({index:e})=>e===this.currentIndex));this.skipBtn.style.display=e?"":"none"}handleSkipButtonClick(){this.setSkipItem(),this.handleNextButtonClick(),this.fireEvent("skip",this.currentIndex),(0,s.JD)("skip.stepper",this.el,this.currentIndex)}buildCompleteStepButton(){this.completeStepBtn&&(this.completeStepBtnDefaultText=this.completeStepBtn.innerText,this.onCompleteStepBtnClickListener=()=>this.completeStepBtnClick(),this.completeStepBtn.addEventListener("click",this.onCompleteStepBtnClickListener))}changeTextAndDisableCompleteButtonIfStepCompleted(){const e=this.navItems.find((({index:e})=>e===this.currentIndex)),{completedText:t}=JSON.parse(this.completeStepBtn.getAttribute("data-stepper-complete-step-btn"));e&&(e.isCompleted?(this.completeStepBtn.innerText=t||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(e){const t=this.navItems.find((({index:t})=>t===(e||this.currentIndex))),i=this.contentItems.find((({index:t})=>t===(e||this.currentIndex)));t&&i&&(this.setCompleteItemActions(t),this.setCompleteItemActions(i))}setCompleteItemActions(e){e.isCompleted=!0,e.el.classList.add("is-valid")}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.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.onFinishBtnClickListener=()=>this.finishBtnClick(),this.finishBtn.addEventListener("click",this.onFinishBtnClickListener))}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 e=this.getUncompletedSteps(),t=this.getUncompletedSteps(!0),{el:i}=this.contentItems.find((({isFinal:e})=>e));e.length&&e.forEach((({index:e})=>this.setCompleteItem(e))),this.currentIndex=this.totalSteps,this.setCurrentNavItem(),this.hideAllContentItems();const n=this.navItems.find((({index:e})=>e===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=""),t.length<=1&&(this.isCompleted=!0,this.setCompleted()),this.fireEvent("finish",this.currentIndex),(0,s.JD)("finish.stepper",this.el,this.currentIndex)}buildResetButton(){this.resetBtn&&(this.onResetBtnClickListener=()=>this.resetBtnClick(),this.resetBtn.addEventListener("click",this.onResetBtnClickListener))}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((e=>{const{el:t}=e;e.isSkip=!1,e.isCompleted=!1,this.unsetCurrentNavItemActions(t),t.classList.remove("is-valid","skipped")})),this.contentItems.forEach((e=>{const{el:t}=e;e.isSkip=!1,e.isCompleted=!1,this.unsetCurrentContentItemActions(t),t.classList.remove("is-valid","skipped")})),this.currentIndex=1,this.unsetCompleted(),this.isCompleted=!1,this.showSkipButton(),this.setCurrentNavItem(),this.setCurrentContentItem(),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.fireEvent("reset",this.currentIndex),(0,s.JD)("reset.stepper",this.el,this.currentIndex)}setProcessedNavItem(e){const t=this.getNavItem(e);t&&this.setProcessedNavItemActions(t)}unsetProcessedNavItem(e){const t=this.getNavItem(e);t&&this.unsetProcessedNavItemActions(t)}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(e){const t=this.getNavItem(e);t&&this.setErrorNavItemActions(t)}destroy(){this.el.classList.remove("completed"),this.el.querySelectorAll("[data-stepper-nav-item]").forEach((e=>{e.classList.remove("active","is-valid","skipped","disabled","is-invalid"),"BUTTON"!==e.tagName&&"INPUT"!==e.tagName||e.removeAttribute("disabled")})),this.el.querySelectorAll("[data-stepper-content-item]").forEach((e=>{e.classList.remove("is-valid","skipped")})),this.backBtn&&this.backBtn.classList.remove("disabled"),this.nextBtn&&this.nextBtn.classList.remove("disabled"),this.completeStepBtn&&this.completeStepBtn.classList.remove("disabled"),this.backBtn&&(this.backBtn.style.display=""),this.nextBtn&&(this.nextBtn.style.display=""),this.skipBtn&&(this.skipBtn.style.display=""),this.finishBtn&&(this.finishBtn.style.display="none"),this.resetBtn&&(this.resetBtn.style.display="none"),this.onNavItemClickListener.length&&this.onNavItemClickListener.forEach((({el:e,fn:t})=>{e.removeEventListener("click",t)})),this.backBtn&&this.backBtn.removeEventListener("click",this.onBackClickListener),this.nextBtn&&this.nextBtn.removeEventListener("click",this.onNextClickListener),this.skipBtn&&this.skipBtn.removeEventListener("click",this.onSkipClickListener),this.completeStepBtn&&this.completeStepBtn.removeEventListener("click",this.onCompleteStepBtnClickListener),this.finishBtn&&this.finishBtn.removeEventListener("click",this.onFinishBtnClickListener),this.resetBtn&&this.resetBtn.removeEventListener("click",this.onResetBtnClickListener),window.$hsStepperCollection=window.$hsStepperCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t){const i=window.$hsStepperCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element:null}static autoInit(){window.$hsStepperCollection||(window.$hsStepperCollection=[]),window.$hsStepperCollection&&(window.$hsStepperCollection=window.$hsStepperCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-stepper]:not(.--prevent-on-load-init)").forEach((e=>{window.$hsStepperCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))||new o(e)}))}}window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSStepper=o);const l=o},789:(e,t,i)=>{i.d(t,{A:()=>l});var s=i(392),n=i(709); -/* - * HSStrongPassword - * @version: 2.6.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(e,t){super(e,t),this.isOpened=!1,this.strength=0,this.passedRules=new Set;const i=e.getAttribute("data-strong-password"),s=i?JSON.parse(i):{},n=Object.assign(Object.assign({},s),t);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((e=>!this.checksExclude.includes(e))),this.specialCharactersSet=(null==n?void 0:n.specialCharactersSet)||"!\"#$%&'()*+,-./:;<=>?@[\\\\\\]^_`{|}~",this.target&&this.init()}targetInput(e){this.setStrength(e.target.value)}targetFocus(){this.isOpened=!0,this.hints.classList.remove("hidden"),this.hints.classList.add("block"),this.recalculateDirection()}targetBlur(){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=""}targetInputSecond(){this.setWeaknessText()}targetInputThird(){this.setRulesText()}init(){this.createCollection(window.$hsStrongPasswordCollection,this),this.availableChecks.length&&this.build()}build(){this.buildStrips(),this.hints&&this.buildHints(),this.setStrength(this.target.value),this.onTargetInputListener=e=>this.targetInput(e),this.target.addEventListener("input",this.onTargetInputListener)}buildStrips(){if(this.el.innerHTML="",this.stripClasses)for(let e=0;e");(0,s.en)(this.stripClasses,e),this.el.append(e)}}buildHints(){this.weakness=this.hints.querySelector("[data-pw-strength-hint]")||null,this.rules=Array.from(this.hints.querySelectorAll("[data-pw-strength-rule]"))||null,this.rules.forEach((e=>{var t;const i=e.getAttribute("data-pw-strength-rule");(null===(t=this.checksExclude)||void 0===t?void 0:t.includes(i))&&e.remove()})),this.weakness&&this.buildWeakness(),this.rules&&this.buildRules(),"popover"===this.mode&&(this.onTargetFocusListener=()=>this.targetFocus(),this.onTargetBlurListener=()=>this.targetBlur(),this.target.addEventListener("focus",this.onTargetFocusListener),this.target.addEventListener("blur",this.onTargetBlurListener))}buildWeakness(){this.checkStrength(this.target.value),this.setWeaknessText(),this.onTargetInputSecondListener=()=>setTimeout((()=>this.targetInputSecond())),this.target.addEventListener("input",this.onTargetInputSecondListener)}buildRules(){this.setRulesText(),this.onTargetInputThirdListener=()=>setTimeout((()=>this.targetInputThird())),this.target.addEventListener("input",this.onTargetInputThirdListener)}setWeaknessText(){const e=this.weakness.getAttribute("data-pw-strength-hint"),t=JSON.parse(e);this.weakness.textContent=t[this.strength]}setRulesText(){this.rules.forEach((e=>{const t=e.getAttribute("data-pw-strength-rule");this.checkIfPassed(e,this.passedRules.has(t))}))}togglePopover(){const e=this.el.querySelector(".popover");e&&e.classList.toggle("show")}checkStrength(e){const t=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")&&e.match(i.lowercase)&&(s+=1,t.add("lowercase")),this.availableChecks.includes("uppercase")&&e.match(i.uppercase)&&(s+=1,t.add("uppercase")),this.availableChecks.includes("numbers")&&e.match(i.numbers)&&(s+=1,t.add("numbers")),this.availableChecks.includes("special-characters")&&e.match(i["special-characters"])&&(s+=1,t.add("special-characters")),this.availableChecks.includes("min-length")&&e.length>=this.minLength&&(s+=1,t.add("min-length")),e.length||(s=0),s===this.availableChecks.length?this.el.classList.add("accepted"):this.el.classList.remove("accepted"),this.strength=s,this.passedRules=t,{strength:this.strength,rules:this.passedRules}}checkIfPassed(e,t=!1){const i=e.querySelector("[data-check]"),s=e.querySelector("[data-uncheck]");t?(e.classList.add("active"),i.classList.remove("hidden"),s.classList.add("hidden")):(e.classList.remove("active"),i.classList.add("hidden"),s.classList.remove("hidden"))}setStrength(e){const{strength:t,rules:i}=this.checkStrength(e),n={strength:t,rules:i};this.hideStrips(t),this.fireEvent("change",n),(0,s.JD)("change.strongPassword",this.el,n)}hideStrips(e){Array.from(this.el.children).forEach(((t,i)=>{ie.el!==this.el))}static getInstance(e,t){const i=window.$hsStrongPasswordCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element.el:null}static autoInit(){window.$hsStrongPasswordCollection||(window.$hsStrongPasswordCollection=[]),window.$hsStrongPasswordCollection&&(window.$hsStrongPasswordCollection=window.$hsStrongPasswordCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-strong-password]:not(.--prevent-on-load-init)").forEach((e=>{if(!window.$hsStrongPasswordCollection.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-strong-password"),i=t?JSON.parse(t):{};new o(e,i)}}))}}window.addEventListener("load",(()=>{o.autoInit()})),document.addEventListener("scroll",(()=>{if(!window.$hsStrongPasswordCollection)return!1;const e=window.$hsStrongPasswordCollection.find((e=>e.element.isOpened));e&&e.element.recalculateDirection()})),"undefined"!=typeof window&&(window.HSStrongPassword=o);const l=o},330:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(392),n=i(709),o=i(179); -/* - * HSTabs - * @version: 2.6.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,i){super(e,t,i),this.toggles=this.el.querySelectorAll("[data-tab]"),this.extraToggleId=this.el.getAttribute("data-tab-select"),this.extraToggle=document.querySelector(this.extraToggleId),this.current=Array.from(this.toggles).find((e=>e.classList.contains("active"))),this.currentContentId=this.current.getAttribute("data-tab"),this.currentContent=document.querySelector(this.currentContentId),this.prev=null,this.prevContentId=null,this.prevContent=null,this.eventType="click",this.onToggleClickListener=[],this.init()}toggleClick(e){this.open(e)}extraToggleChange(e){this.change(e)}init(){this.createCollection(window.$hsTabsCollection,this),this.toggles.forEach((e=>{this.onToggleClickListener.push({el:e,fn:()=>this.toggleClick(e)}),e.addEventListener(this.eventType,this.onToggleClickListener.find((t=>t.el===e)).fn)})),this.extraToggle&&(this.onExtraToggleChangeListener=e=>this.extraToggleChange(e),this.extraToggle.addEventListener("change",this.onExtraToggleChangeListener))}open(e){var t,i;this.prev=this.current,this.prevContentId=this.currentContentId,this.prevContent=this.currentContent,this.current=e,this.currentContentId=this.current.getAttribute("data-tab"),this.currentContent=document.querySelector(this.currentContentId),(null===(t=null==this?void 0:this.prev)||void 0===t?void 0:t.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:e,prev:this.prevContentId,current:this.currentContentId}),(0,s.JD)("change.tab",e,{el:e,prev:this.prevContentId,current:this.currentContentId})}change(e){const t=document.querySelector(`[data-tab="${e.target.value}"]`);t&&t.click()}destroy(){this.toggles.forEach((e=>{e.removeEventListener(this.eventType,this.onToggleClickListener.find((t=>t.el===e)).fn)})),this.onToggleClickListener=[],this.extraToggle&&this.extraToggle.removeEventListener("change",this.onExtraToggleChangeListener),window.$hsTabsCollection=window.$hsTabsCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t){const i=window.$hsTabsCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element:null}static autoInit(){window.$hsTabsCollection||(window.$hsTabsCollection=[],document.addEventListener("keydown",(e=>l.accessibility(e)))),window.$hsTabsCollection&&(window.$hsTabsCollection=window.$hsTabsCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll('[role="tablist"]:not(select):not(.--prevent-on-load-init)').forEach((e=>{window.$hsTabsCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))||new l(e)}))}static open(e){const t=window.$hsTabsCollection.find((t=>Array.from(t.element.toggles).includes("string"==typeof e?document.querySelector(e):e))),i=Array.from(t.element.toggles).find((t=>t===("string"==typeof e?document.querySelector(e):e)));i&&!i.classList.contains("active")&&t.element.open(i)}static accessibility(e){const t=document.querySelector("[data-tab]:focus");if(t&&o.Fy.includes(e.code)&&!e.metaKey){const i=t.closest('[role="tablist"]').getAttribute("data-tabs-vertical");switch(e.preventDefault(),e.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(e=!0){const t=document.querySelector("[data-tab]:focus").closest('[role="tablist"]'),i=window.$hsTabsCollection.find((e=>e.element.el===t));if(i){const t=e?Array.from(i.element.toggles).reverse():Array.from(i.element.toggles),s=t.find((e=>document.activeElement===e));let n=t.findIndex((e=>e===s));n=n+1e.element.el===t));if(i){const t=e?Array.from(i.element.toggles):Array.from(i.element.toggles).reverse();t.length&&(t[0].focus(),t[0].click())}}static on(e,t,i){const s=window.$hsTabsCollection.find((e=>Array.from(e.element.toggles).includes("string"==typeof t?document.querySelector(t):t)));s&&(s.element.events[e]=i)}}window.addEventListener("load",(()=>{l.autoInit()})),"undefined"!=typeof window&&(window.HSTabs=l);const r=l},680:(e,t,i)=>{i.d(t,{A:()=>o});var s=i(709); -/* - * HSToggleCount - * @version: 2.6.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(e,t){super(e,t);const i=e.getAttribute("data-toggle-count"),s=i?JSON.parse(i):{},n=Object.assign(Object.assign({},s),t);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()}toggleChange(){this.isChecked=!this.isChecked,this.toggle()}init(){this.createCollection(window.$hsToggleCountCollection,this),this.isChecked&&(this.el.innerText=String(this.max)),this.onToggleChangeListener=()=>this.toggleChange(),this.target.addEventListener("change",this.onToggleChangeListener)}toggle(){this.isChecked?this.countUp():this.countDown()}animate(e,t){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*(t-e)+e)),o<1&&window.requestAnimationFrame(s)};window.requestAnimationFrame(s)}countUp(){this.animate(this.min,this.max)}countDown(){this.animate(this.max,this.min)}destroy(){this.target.removeEventListener("change",this.onToggleChangeListener),window.$hsToggleCountCollection=window.$hsToggleCountCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t){const i=window.$hsToggleCountCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element:null}static autoInit(){window.$hsToggleCountCollection||(window.$hsToggleCountCollection=[]),window.$hsToggleCountCollection&&(window.$hsToggleCountCollection=window.$hsToggleCountCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-toggle-count]:not(.--prevent-on-load-init)").forEach((e=>{window.$hsToggleCountCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))||new n(e)}))}}window.addEventListener("load",(()=>{n.autoInit()})),"undefined"!=typeof window&&(window.HSToggleCount=n);const o=n},224:(e,t,i)=>{i.d(t,{A:()=>l});var s=i(392),n=i(709); -/* - * HSTogglePassword - * @version: 2.6.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(e,t){super(e,t);const i=e.getAttribute("data-toggle-password"),n=i?JSON.parse(i):{},o=Object.assign(Object.assign({},n),t),l=[];if((null==o?void 0:o.target)&&"string"==typeof(null==o?void 0:o.target)){(null==o?void 0:o.target.split(",")).forEach((e=>{l.push(document.querySelector(e))}))}else(null==o?void 0:o.target)&&"object"==typeof(null==o?void 0:o.target)?o.target.forEach((e=>l.push(document.querySelector(e)))):o.target.forEach((e=>l.push(e)));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-toggle-password-group]"),this.target&&this.init()}elementAction(){this.isShown?this.hide():this.show(),this.fireEvent("toggle",this.target),(0,s.JD)("toggle.toggle-select",this.el,this.target)}init(){this.createCollection(window.$hsTogglePasswordCollection,this),this.isShown?this.show():this.hide(),this.onElementActionListener=()=>this.elementAction(),this.el.addEventListener(this.eventType,this.onElementActionListener)}getMultipleToggles(){const e=this.el.closest("[data-toggle-password-group]").querySelectorAll("[data-toggle-password]"),t=[];return e.forEach((e=>{t.push(o.getInstance(e))})),t}show(){if(this.isMultiple){this.getMultipleToggles().forEach((e=>!!e&&(e.isShown=!0))),this.el.closest("[data-toggle-password-group]").classList.add("active")}else this.isShown=!0,this.el.classList.add("active");this.target.forEach((e=>{e.type="text"}))}hide(){if(this.isMultiple){this.getMultipleToggles().forEach((e=>!!e&&(e.isShown=!1))),this.el.closest("[data-toggle-password-group]").classList.remove("active")}else this.isShown=!1,this.el.classList.remove("active");this.target.forEach((e=>{e.type="password"}))}destroy(){this.isMultiple?this.el.closest("[data-toggle-password-group]").classList.remove("active"):this.el.classList.remove("active"),this.target.forEach((e=>{e.type="password"})),this.el.removeEventListener(this.eventType,this.onElementActionListener),this.isShown=!1,window.$hsTogglePasswordCollection=window.$hsTogglePasswordCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t){const i=window.$hsTogglePasswordCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element:null}static autoInit(){window.$hsTogglePasswordCollection||(window.$hsTogglePasswordCollection=[]),window.$hsTogglePasswordCollection&&(window.$hsTogglePasswordCollection=window.$hsTogglePasswordCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-toggle-password]:not(.--prevent-on-load-init)").forEach((e=>{window.$hsTogglePasswordCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))||new o(e)}))}}window.addEventListener("load",(()=>{o.autoInit()})),"undefined"!=typeof window&&(window.HSTogglePassword=o);const l=o},949:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(316),n=i(392),o=i(709),l=i(179); -/* - * HSTooltip - * @version: 2.6.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 o.A{constructor(e,t,i){super(e,t,i),this.el&&(this.toggle=this.el.querySelector(".tooltip-toggle")||this.el,this.content=this.el.querySelector(".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.interaction=(0,n.gj)(this.el,"--interaction","true"),this.strategy=(0,n.gj)(this.el,"--strategy"),this.scope=(0,n.gj)(this.el,"--scope")||"parent"),this.el&&this.toggle&&this.content&&this.init()}toggleClick(){this.click()}toggleFocus(){this.focus()}toggleMouseEnter(){this.enter()}toggleMouseLeave(){this.leave()}toggleHandle(){this.hide(),this.toggle.removeEventListener("click",this.onToggleHandleListener,!0),this.toggle.removeEventListener("blur",this.onToggleHandleListener,!0)}init(){this.createCollection(window.$hsTooltipCollection,this),"click"===this.eventMode?(this.onToggleClickListener=()=>this.toggleClick(),this.toggle.addEventListener("click",this.onToggleClickListener)):"focus"===this.eventMode?(this.onToggleFocusListener=()=>this.toggleFocus(),this.toggle.addEventListener("click",this.onToggleFocusListener)):"hover"===this.eventMode&&(this.onToggleMouseEnterListener=()=>this.toggleMouseEnter(),this.onToggleMouseLeaveListener=()=>this.toggleMouseLeave(),this.toggle.addEventListener("mouseenter",this.onToggleMouseEnterListener),this.toggle.addEventListener("mouseleave",this.onToggleMouseLeaveListener)),"false"===this.preventPopper&&this.buildPopper()}enter(){this._show()}leave(){this.hide()}click(){this.el.classList.contains("show")?this.hide():(this._show(),this.onToggleHandleListener=()=>{setTimeout((()=>this.toggleHandle()))},this.toggle.addEventListener("click",this.onToggleHandleListener,!0),this.toggle.addEventListener("blur",this.onToggleHandleListener,!0))}focus(){var e;if(this._show(),"true"===this.interaction){const t=e=>{this.content&&this.content.contains(e.target)&&e.stopPropagation()};null===(e=this.content)||void 0===e||e.addEventListener("click",t);const i=e=>{var t;(null===(t=this.content)||void 0===t?void 0:t.contains(e.target))||this.el.contains(e.target)||this.hide()};document.body.addEventListener("click",i)}else{const e=()=>{this.hide(),this.toggle.removeEventListener("blur",e,!0)};this.toggle.addEventListener("blur",e,!0)}}buildPopper(){"window"===this.scope&&document.body.appendChild(this.content),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,0]}}]})}_show(){this.content.classList.remove("hidden"),"window"===this.scope&&this.content.classList.add("show"),"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,n.JD)("show.tooltip",this.el,this.el)}))}show(){switch(this.eventMode){case"click":this.click();break;case"focus":this.focus();break;default:this.enter()}this.toggle.focus(),this.toggle.style.outline="none"}hide(){this.el.classList.remove("show"),"window"===this.scope&&this.content.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,n.JD)("hide.tooltip",this.el,this.el),(0,n.yd)(this.content,(()=>{if(this.el.classList.contains("show"))return!1;this.content.classList.add("hidden"),this.toggle.style.outline=""}))}destroy(){this.el.classList.remove("show"),this.content.classList.add("hidden"),"click"===this.eventMode?this.toggle.removeEventListener("click",this.onToggleClickListener):"focus"===this.eventMode?this.toggle.removeEventListener("click",this.onToggleFocusListener):"hover"===this.eventMode&&(this.toggle.removeEventListener("mouseenter",this.onToggleMouseEnterListener),this.toggle.removeEventListener("mouseleave",this.onToggleMouseLeaveListener)),this.toggle.removeEventListener("click",this.onToggleHandleListener,!0),this.toggle.removeEventListener("blur",this.onToggleHandleListener,!0),this.popperInstance.destroy(),this.popperInstance=null,window.$hsTooltipCollection=window.$hsTooltipCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t=!1){const i=window.$hsTooltipCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element.el:null}static autoInit(){window.$hsTooltipCollection||(window.$hsTooltipCollection=[]),window.$hsTooltipCollection&&(window.$hsTooltipCollection=window.$hsTooltipCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll(".tooltip").forEach((e=>{window.$hsTooltipCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))||new r(e)}))}static show(e){const t=window.$hsTooltipCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));t&&t.element.show()}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,i){const s=window.$hsTooltipCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));s&&(s.element.events[e]=i)}}window.addEventListener("load",(()=>{r.autoInit()})),"undefined"!=typeof window&&(window.HSTooltip=r);const a=r},504:(e,t,i)=>{i.d(t,{A:()=>l});var s=i(392),n=i(709); -/* - * HSTreeView - * @version: 2.6.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(e,t,i){super(e,t,i),this.items=[];const s=e.getAttribute("data-tree-view"),n=s?JSON.parse(s):{},o=Object.assign(Object.assign({},n),t);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.onElementClickListener=[],this.onControlChangeListener=[],this.init()}elementClick(e,t,i){if(e.stopPropagation(),t.classList.contains("disabled"))return!1;e.metaKey||e.shiftKey||this.unselectItem(i),this.selectItem(t,i),this.fireEvent("click",{el:t,data:i}),(0,s.JD)("click.treeView",this.el,{el:t,data:i})}controlChange(e,t){this.autoSelectChildren?(this.selectItem(e,t),t.isDir&&this.selectChildren(e,t),this.toggleParent(e)):this.selectItem(e,t)}init(){this.createCollection(window.$hsTreeViewCollection,this),o.group+=1,this.initItems()}initItems(){this.el.querySelectorAll("[data-tree-view-item]").forEach(((e,t)=>{var i,s;const n=JSON.parse(e.getAttribute("data-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){this.onElementClickListener.push({el:e,fn:i=>this.elementClick(i,e,t)}),e.addEventListener("click",this.onElementClickListener.find((t=>t.el===e)).fn)}controlByCheckbox(e,t){const i=e.querySelector(`input[value="${t.value}"]`);i&&(this.onControlChangeListener.push({el:i,fn:()=>this.controlChange(e,t)}),i.addEventListener("change",this.onControlChangeListener.find((e=>e.el===i)).fn))}getItem(e){return this.items.find((t=>t.id===e))}getPath(e){var t;const i=[];let s=e.closest("[data-tree-view-item]");for(;s;){const e=JSON.parse(s.getAttribute("data-tree-view-item"));i.push(e.value),s=null===(t=s.parentElement)||void 0===t?void 0:t.closest("[data-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-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-tree-view-item]");for(;s;){const e=s.querySelectorAll("[data-tree-view-item]:not(.disabled)"),t=JSON.parse(s.getAttribute("data-tree-view-item")),n=s.querySelector(`input[value="${t.value}"]`);let o=!1,l=0;e.forEach((e=>{const t=this.getItem(e.id);t.isSelected&&(l+=1),t.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 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)))}destroy(){this.onElementClickListener.forEach((({el:e,fn:t})=>{e.removeEventListener("click",t)})),this.onControlChangeListener.length&&this.onElementClickListener.forEach((({el:e,fn:t})=>{e.removeEventListener("change",t)})),this.unselectItem(),this.items=[],window.$hsTreeViewCollection=window.$hsTreeViewCollection.filter((({element:e})=>e.el!==this.el)),o.group-=1}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=[]),window.$hsTreeViewCollection&&(window.$hsTreeViewCollection=window.$hsTreeViewCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-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 l=o},392:(e,t,i)=>{i.d(t,{BF:()=>o,IM:()=>f,JD:()=>p,PK:()=>s,PR:()=>d,V6:()=>c,en:()=>v,fc:()=>g,gj:()=>n,sH:()=>h,sg:()=>u,un:()=>l,wC:()=>a,yd:()=>m,zG:()=>r}); -/* - * @version: 2.6.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=e=>"true"===e,n=(e,t,i="")=>(window.getComputedStyle(e).getPropertyValue(t)||i).replace(" ",""),o=(e,t,i="")=>{let s="";return e.classList.forEach((e=>{e.includes(t)&&(s=e)})),s.match(/:(.*)]/)?s.match(/:(.*)]/)[1]:i};const l=()=>!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),r=()=>navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),a=(e,t)=>{const i=e.children;for(let e=0;e{const o=t.getBoundingClientRect(),l=n?n.getBoundingClientRect():null,r=window.innerHeight,a=l?o.top-l.top:o.top,d=(n?l.bottom:r)-o.bottom,c=e.clientHeight+s;return"bottom"===i?d>=c:"top"===i?a>=c:a>=c||d>=c},c=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,h=e=>{if(!e)return!1;return"none"===window.getComputedStyle(e).display||h(e.parentElement)},u=(e,t=200)=>{let i;return(...s)=>{clearTimeout(i),i=setTimeout((()=>{e.apply(void 0,s)}),t)}},p=(e,t,i=null)=>{const s=new CustomEvent(e,{detail:{payload:i},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(s)},m=(e,t)=>{const i=()=>{t(),e.removeEventListener("transitionend",i,!0)},s=window.getComputedStyle(e),n=s.getPropertyValue("transition-duration");"none"!==s.getPropertyValue("transition-property")&&parseFloat(n)>0?e.addEventListener("transitionend",i,!0):t()},g=e=>{const t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild},v=(e,t,i=" ",s="add")=>{e.split(i).forEach((e=>"add"===s?t.classList.add(e):t.classList.remove(e)))},f={historyIndex:-1,addHistory(e){this.historyIndex=e},existsInHistory(e){return e>this.historyIndex},clearHistory(){this.historyIndex=-1}}}},t={};function i(s){var n=t[s];if(void 0!==n)return n.exports;var o=t[s]={exports:{}};return e[s](o,o.exports,i),o.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,{ax:()=>o.A,Wl:()=>l.A,Zr:()=>r.A,HA:()=>a.A,r$:()=>n.A,Af:()=>O,ZK:()=>d.A,jM:()=>$,DH:()=>c.A,wX:()=>h.A,Pd:()=>u.A,cf:()=>P,Sy:()=>p.A,hO:()=>m.A,g5:()=>g.A,KC:()=>A,jv:()=>v.A,cU:()=>f.A,S6:()=>w.A,Lq:()=>y.A,zx:()=>b.A,pX:()=>C.A,$h:()=>S.A});var n=i(306),o=i(696),l=i(376),r=i(729),a=i(421),d=i(479),c=i(856),h=i(734),u=i(656),p=i(259),m=i(163),g=i(838),v=i(467),f=i(789),w=i(330),y=i(680),b=i(224),C=i(949),S=i(504),L=i(392),I=i(66),x=i(230),E=i(991);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:r.A,collection:"$hsCollapseCollection"},{key:"combobox",fn:a.A,collection:"$hsComboBoxCollection"},{key:"datatable",fn:I.A,collection:"$hsDataTableCollection"},{key:"dropdown",fn:d.A,collection:"$hsDropdownCollection"},{key:"file-upload",fn:x.A,collection:"$hsFileUploadCollection"},{key:"input-number",fn:c.A,collection:"$hsInputNumberCollection"},{key:"overlay",fn:h.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:w.A,collection:"$hsTabsCollection"},{key:"toggle-count",fn:y.A,collection:"$hsToggleCountCollection"},{key:"toggle-password",fn:b.A,collection:"$hsTogglePasswordCollection"},{key:"tooltip",fn:C.A,collection:"$hsTooltipCollection"},{key:"tree-view",fn:S.A,collection:"$hsTreeViewCollection"}],T={getClassProperty:L.gj,afterTransition:L.yd,autoInit(e="all"){"all"===e?k.forEach((({fn:e})=>{null==e||e.autoInit()})):k.forEach((({key:t,fn:i})=>{e.includes(t)&&(null==i||i.autoInit())}))},cleanCollection(e="all"){"all"===e?k.forEach((({collection:e})=>{window[e]instanceof Array&&(window[e]=[])})):k.forEach((({key:t,collection:i})=>{e.includes(t)&&window[i]instanceof Array&&(window[i]=[])}))}};"undefined"!=typeof window&&(window.HSStaticMethods=T);const A=T; -/* - * @version: 2.6.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 O,$,P;O="undefined"!=typeof DataTable&&"undefined"!=typeof jQuery?i(66).A:null,$="undefined"!=typeof _&&"undefined"!=typeof Dropzone?i(230).A:null,P="undefined"!=typeof noUiSlider?i(991).A:null;var D=s.ax,B=s.Wl,q=s.Zr,M=s.HA,N=s.r$,H=s.Af,F=s.ZK,V=s.jM,R=s.DH,j=s.wX,W=s.Pd,U=s.cf,z=s.Sy,J=s.hO,Q=s.g5,K=s.KC,X=s.jv,Z=s.cU,G=s.S6,Y=s.Lq,ee=s.zx,te=s.pX,ie=s.$h;export{D as HSAccordion,B as HSCarousel,q as HSCollapse,M as HSComboBox,N as HSCopyMarkup,H as HSDataTable,F as HSDropdown,V as HSFileUpload,R as HSInputNumber,j as HSOverlay,W as HSPinInput,U as HSRangeSlider,z as HSRemoveElement,J as HSScrollspy,Q as HSSelect,K as HSStaticMethods,X as HSStepper,Z as HSStrongPassword,G as HSTabs,Y as HSToggleCount,ee as HSTogglePassword,te as HSTooltip,ie as HSTreeView}; \ No newline at end of file diff --git a/global.d.ts b/global.d.ts index d9a97b4..54e6e5e 100644 --- a/global.d.ts +++ b/global.d.ts @@ -4,11 +4,11 @@ import { ICollectionItem } from './src/js/interfaces' import { IStaticMethods } from './src/js/static/interfaces' -import type HSCopyMarkup from './src/js/plugins/copy-markup' import type HSAccordion from './src/js/plugins/accordion' import type HSCarousel from './src/js/plugins/carousel' import type HSCollapse from './src/js/plugins/collapse' import type HSComboBox from './src/js/plugins/combobox' +import type HSCopyMarkup from './src/js/plugins/copy-markup' import type HSDataTable from './src/js/plugins/datatable' import type HSDropdown from './src/js/plugins/dropdown' import type HSFileUpload from './src/js/plugins/file-upload' diff --git a/package.json b/package.json index 3fa852a..1234311 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flyonui", - "version": "1.2.0", + "version": "1.3.0", "description": "The easiest, free and open-source Tailwind CSS component library with semantic classes.", "author": "ThemeSelection", "license": "MIT", @@ -62,7 +62,6 @@ "./global.d.ts", "./flyonui.d.ts", "./flyonui.js", - "./flyonui.mjs", "./LICENSE", "./THIRD_PARTY_LICENSES", "./README.md" diff --git a/plugin.js b/plugin.js index adac926..cfcc8aa 100644 --- a/plugin.js +++ b/plugin.js @@ -1,6 +1,6 @@ /* * Plugin - * @version: 2.6.0 + * @version: 2.7.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) diff --git a/plugin.ts b/plugin.ts index 4c7872a..86a7454 100644 --- a/plugin.ts +++ b/plugin.ts @@ -1,6 +1,6 @@ /* * Plugin - * @version: 2.5.1 + * @version: 2.7.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) @@ -37,21 +37,56 @@ export default plugin(function ({ addVariant, e }: PluginAPI) { modifySelectors(({ className }) => { return `.dropdown.open > .dropdown-menu > .${e(`dropdown-open${separator}${className}`)}` }) + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.dropdown-menu.open.${e(`dropdown-open${separator}${className}`)}` + }) } ] as TStringFunc[]) - addVariant('removing', (({ modifySelectors, separator }: IAddVariantOptions) => { + addVariant('dropdown-item-disabled', (({ modifySelectors, separator }: IAddVariantOptions) => { modifySelectors(({ className }) => { - return `.removing.${e(`removing${separator}${className}`)}` + return `.dropdown.open > .dropdown-menu .disabled.${e(`dropdown-item-disabled${separator}${className}`)}` }) }) as TStringFunc) - addVariant('tooltip-shown', (({ modifySelectors, separator }: IAddVariantOptions) => { + addVariant('dropdown-item-checked', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.dropdown.open > .dropdown-menu [aria-checked="true"].${e( + `dropdown-item-checked${separator}${className}` + )}` + }) + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.dropdown.open > .dropdown-menu [aria-checked="true"] .${e( + `dropdown-item-checked${separator}${className}` + )}` + }) + } + ] as TStringFunc[]) + + addVariant('removing', (({ modifySelectors, separator }: IAddVariantOptions) => { modifySelectors(({ className }) => { - return `.tooltip.show .${e(`tooltip-shown${separator}${className}`)}` + return `.removing.${e(`removing${separator}${className}`)}` }) }) as TStringFunc) + addVariant('tooltip-shown', [ + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.tooltip.show .${e(`tooltip-shown${separator}${className}`)}` + }) + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.tooltip-content.show.${e(`tooltip-shown${separator}${className}`)}` + }) + } + ] as TStringFunc[]) + addVariant('accordion-item-active', [ ({ modifySelectors, separator }: IAddVariantOptions) => { modifySelectors(({ className }) => { @@ -86,6 +121,11 @@ export default plugin(function ({ addVariant, e }: PluginAPI) { `accordion-item-active${separator}${className}` )}` }) + }, + ({ modifySelectors, separator }: IAddVariantOptions) => { + modifySelectors(({ className }) => { + return `.accordion-item.active .accordion-force-active.${e(`accordion-item-active${separator}${className}`)}` + }) } ] as TStringFunc[]) diff --git a/src/components/styled/accordion.css b/src/components/styled/accordion.css index 29f341a..3e1d928 100644 --- a/src/components/styled/accordion.css +++ b/src/components/styled/accordion.css @@ -1,5 +1,5 @@ .accordion-toggle { - @apply text-base-content/90 w-full cursor-pointer px-5 py-4 text-lg font-medium disabled:pointer-events-none disabled:opacity-50; + @apply text-base-content w-full cursor-pointer px-5 py-4 text-lg font-medium disabled:pointer-events-none disabled:opacity-50; } .accordion-shadow :where(.accordion-item) { diff --git a/src/components/styled/advance-select.css b/src/components/styled/advance-select.css index 1844996..ab4108e 100644 --- a/src/components/styled/advance-select.css +++ b/src/components/styled/advance-select.css @@ -1,5 +1,5 @@ .advance-select-toggle { - @apply border-base-content/40 bg-base-100 text-base-content/90 rounded-btn hover:border-base-content/60 border text-base font-normal; + @apply border-base-content/40 bg-base-100 text-base-content rounded-btn hover:border-base-content/60 border text-base font-normal; @apply select-disabled:pointer-events-none select-disabled:border-0 select-disabled:bg-neutral/10 select-disabled:text-neutral/50 select-disabled:py-2; &:focus, @@ -16,7 +16,7 @@ } .advance-select-option { - @apply hover:bg-neutral/10 focus:bg-neutral/10 text-base-content/90 rounded-btn text-base font-normal focus:outline-none; + @apply hover:bg-neutral/10 focus:bg-neutral/10 text-base-content rounded-btn text-base font-normal focus:outline-none; &.active, &:active { @apply bg-primary/10 text-primary; @@ -24,7 +24,7 @@ } .advance-select-tag { - @apply border-base-content/25 bg-base-100 text-base-content/90 rounded-box hover:border-base-content/60 border text-base font-normal; + @apply border-base-content/25 bg-base-100 text-base-content rounded-box hover:border-base-content/60 border text-base font-normal; &:focus, &:focus-within { @apply ring-primary shadow-primary/22 border-primary shadow-sm ring-1; diff --git a/src/components/styled/card.css b/src/components/styled/card.css index d420e21..f4d0b14 100644 --- a/src/components/styled/card.css +++ b/src/components/styled/card.css @@ -7,21 +7,14 @@ &-header { @apply rounded-t-box; padding: var(--padding-card, 1.5rem); - - & + .card-body { - padding-top: 0; - } } &-body { padding: var(--padding-card, 1.5rem); - & + .card-footer { - padding-top: 0; - } } &-footer { - @apply rounded-b-box pt-0; + @apply rounded-b-box; padding: var(--padding-card, 1.5rem); } @@ -68,6 +61,14 @@ } } +:where(.card-header) + .card-body { + padding-top: 0; +} + +:where(.card-body) + .card-footer { + padding-top: 0; +} + .card-group { @apply rounded-box border-base-content/40; --cd-shadow: theme(colors.base-shadow/0.26); diff --git a/src/components/styled/chat.css b/src/components/styled/chat.css index 04554c9..98e7ced 100644 --- a/src/components/styled/chat.css +++ b/src/components/styled/chat.css @@ -6,7 +6,7 @@ } &-receiver .chat-bubble { - @apply bg-base-100 text-base-content/90 rounded-es-none; + @apply bg-base-100 text-base-content rounded-es-none; &:before { inset-inline-start: -0.749rem; } diff --git a/src/components/styled/divider.css b/src/components/styled/divider.css index fd46475..13264f9 100644 --- a/src/components/styled/divider.css +++ b/src/components/styled/divider.css @@ -1,5 +1,5 @@ .divider { - @apply after:border-base-content/10 before:border-base-content/10 my-4 h-4 whitespace-nowrap; + @apply after:border-base-content/20 before:border-base-content/20 my-4 h-4 whitespace-nowrap; &:not(:empty) { @apply gap-4; diff --git a/src/components/styled/drawer.css b/src/components/styled/drawer.css index 71f0f55..a42922d 100644 --- a/src/components/styled/drawer.css +++ b/src/components/styled/drawer.css @@ -5,7 +5,7 @@ @apply flex items-center justify-between p-6; } &-title { - @apply text-base-content/90 font-medium; + @apply text-base-content font-medium; } &-body { @apply [&::-webkit-scrollbar-track]:bg-base-200 [&::-webkit-scrollbar-thumb]:bg-secondary/50 hover:[&::-webkit-scrollbar-thumb]:bg-secondary/80 overflow-y-auto overflow-x-hidden [&::-webkit-scrollbar]:w-2; diff --git a/src/components/styled/dropdown.css b/src/components/styled/dropdown.css index 484d8ac..e7413a1 100644 --- a/src/components/styled/dropdown.css +++ b/src/components/styled/dropdown.css @@ -3,7 +3,7 @@ } .dropdown-item { - @apply text-base-content/90 rounded-btn bg-transparent no-underline decoration-0; + @apply text-base-content rounded-btn bg-transparent no-underline decoration-0; &:hover, &:focus, @@ -25,7 +25,7 @@ & > .label { @apply text-base-content/80 py-1 text-base; &-text { - @apply text-base-content/90; + @apply text-base-content; } } } diff --git a/src/components/styled/footer.css b/src/components/styled/footer.css index 70e6754..6267713 100644 --- a/src/components/styled/footer.css +++ b/src/components/styled/footer.css @@ -4,6 +4,6 @@ @apply gap-3; } &-title { - @apply text-base-content/90 mb-1 text-base font-medium; + @apply text-base-content mb-1 text-base font-medium; } } diff --git a/src/components/styled/form.css b/src/components/styled/form.css index e43695a..1ac0d46 100644 --- a/src/components/styled/form.css +++ b/src/components/styled/form.css @@ -1,5 +1,5 @@ .label { - @apply text-base-content/80 p-1; + @apply text-base-content/80 select-none p-1; &-text-alt { @apply text-xs; @@ -10,5 +10,5 @@ } .label-text { - @apply text-base-content/90 cursor-pointer text-sm; + @apply text-base-content block cursor-pointer text-sm; } diff --git a/src/components/styled/input.css b/src/components/styled/input.css index 01a059d..f3e2a76 100644 --- a/src/components/styled/input.css +++ b/src/components/styled/input.css @@ -15,7 +15,7 @@ input { border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; &::file-selector-button { - @apply bg-base-content/20 text-base-content/90 rounded-s-btn border-0 font-semibold uppercase no-underline; + @apply bg-base-content/20 text-base-content rounded-s-btn border-0 font-semibold uppercase no-underline; } &[type="file"]:disabled { @apply bg-neutral/10; @@ -27,7 +27,7 @@ input { &:-webkit-autofill, &:-webkit-autofill:focus { - @apply bg-base-100 text-base-content/90; + @apply bg-base-100 text-base-content; } &-floating { @@ -184,7 +184,7 @@ input { /* input group text */ .input-group-text { - @apply text-base-content/90 flex items-center px-3 font-normal; + @apply text-base-content flex items-center px-3 font-normal; transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; diff --git a/src/components/styled/menu.css b/src/components/styled/menu.css index 43f7d19..bc6d24f 100644 --- a/src/components/styled/menu.css +++ b/src/components/styled/menu.css @@ -25,14 +25,14 @@ } :where(.menu li:not(.menu-title, .disabled, [disabled], :disabled)) { - @apply text-base-content/90; + @apply text-base-content; } :where(.menu li:not(.menu-title, .disabled, [disabled], :disabled) > *:not(ul, .collapse, .menu-title)) { &:not(.active, .btn).focus, &:not(.active, .btn):focus, &:not(.active, .btn):focus-visible { - @apply bg-base-content/10 text-base-content/90 cursor-pointer outline-none; + @apply bg-base-content/10 text-base-content cursor-pointer outline-none; } @media (hover: hover) { &:not(.active, .btn, .disabled, :disabled, [disabled]):hover { @@ -56,5 +56,5 @@ } .menu-title { - @apply text-base-content/90 px-4 py-2 text-sm font-medium; + @apply text-base-content px-4 py-2 text-sm font-medium; } diff --git a/src/components/styled/modal.css b/src/components/styled/modal.css index ccac878..36505e0 100755 --- a/src/components/styled/modal.css +++ b/src/components/styled/modal.css @@ -11,5 +11,17 @@ } .modal-body { - @apply [&::-webkit-scrollbar-track]:bg-base-200 [&::-webkit-scrollbar-thumb]:bg-secondary/50 hover:[&::-webkit-scrollbar-thumb]:bg-secondary/80 overflow-y-auto overflow-x-hidden [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:rounded-full [&::-webkit-scrollbar]:w-2; + @apply [&::-webkit-scrollbar-track]:bg-base-200 [&::-webkit-scrollbar-thumb]:bg-secondary/50 hover:[&::-webkit-scrollbar-thumb]:bg-secondary/80 overflow-y-auto overflow-x-hidden p-6 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:rounded-full [&::-webkit-scrollbar]:w-2; +} + +.modal-footer { + @apply p-6; +} + +:where(.modal-header) + .modal-body { + padding-top: 0; +} + +:where(.modal-body) + .modal-footer { + padding-top: 0; } diff --git a/src/components/styled/radio.css b/src/components/styled/radio.css index 04bffd4..3c8a1ce 100644 --- a/src/components/styled/radio.css +++ b/src/components/styled/radio.css @@ -263,7 +263,7 @@ @apply pb-1; } .label-text { - @apply text-base-content/90 font-medium; + @apply text-base-content font-medium; } } diff --git a/src/components/styled/stat.css b/src/components/styled/stat.css index ede51fc..1b1faf8 100644 --- a/src/components/styled/stat.css +++ b/src/components/styled/stat.css @@ -15,7 +15,7 @@ @apply text-base-content/80; } &-value { - @apply text-base-content/90 text-3xl font-semibold; + @apply text-base-content text-3xl font-semibold; } &-desc { @apply text-base-content/50 text-xs; diff --git a/src/components/styled/tab.css b/src/components/styled/tab.css index 7da4e3b..a3058aa 100644 --- a/src/components/styled/tab.css +++ b/src/components/styled/tab.css @@ -3,7 +3,7 @@ border-end-start-radius: 0; } .tab { - @apply text-base-content/90; + @apply text-base-content; --tab-bg: theme(colors.base-100); --tab-border-color: theme(colors.base-content/0.1); padding-inline-start: var(--tab-padding, 1rem); diff --git a/src/components/styled/table.css b/src/components/styled/table.css index 06dd72e..da9e8c4 100644 --- a/src/components/styled/table.css +++ b/src/components/styled/table.css @@ -5,7 +5,7 @@ @apply text-nowrap px-5 py-[0.55rem] align-middle text-base; } :where(th) { - @apply text-base-content/90 text-nowrap text-sm font-medium uppercase; + @apply text-base-content text-nowrap text-sm font-medium uppercase; letter-spacing: 1px; } &-xs :where(th, td) { @@ -50,7 +50,7 @@ } :where(thead, tfoot, th) { - @apply text-base-content/90 whitespace-nowrap; + @apply text-base-content whitespace-nowrap; } &-borderless { diff --git a/src/components/styled/textarea.css b/src/components/styled/textarea.css index d2ee1bf..df46135 100644 --- a/src/components/styled/textarea.css +++ b/src/components/styled/textarea.css @@ -71,7 +71,7 @@ textarea { /* label styles */ .textarea-floating-label, .textarea-filled-label { - @apply text-base-content/90 peer-focus:placeholder:text-base-content/50 peer-focus:text-primary pointer-events-none absolute start-0 top-2 w-full overflow-hidden text-ellipsis bg-transparent px-4 text-base transition-all ease-in; + @apply text-base-content peer-focus:placeholder:text-base-content/50 peer-focus:text-primary pointer-events-none absolute start-0 top-2 w-full overflow-hidden text-ellipsis bg-transparent px-4 text-base transition-all ease-in; } .textarea-floating-label { diff --git a/src/components/unstyled/breadcrumbs.css b/src/components/unstyled/breadcrumbs.css index 18f04b0..12f2e6f 100644 --- a/src/components/unstyled/breadcrumbs.css +++ b/src/components/unstyled/breadcrumbs.css @@ -15,7 +15,7 @@ } &:last-child { - @apply text-base-content/90 cursor-text font-medium; + @apply text-base-content cursor-text font-medium; } } } diff --git a/src/components/unstyled/card.css b/src/components/unstyled/card.css index 02e6449..c4b3db4 100644 --- a/src/components/unstyled/card.css +++ b/src/components/unstyled/card.css @@ -12,7 +12,7 @@ } &-title { - @apply text-base-content/90 text-2xl font-semibold; + @apply text-base-content text-2xl font-semibold; } & figure { diff --git a/src/components/unstyled/form.css b/src/components/unstyled/form.css index 0cdc3b4..b311a38 100644 --- a/src/components/unstyled/form.css +++ b/src/components/unstyled/form.css @@ -1,3 +1,3 @@ -.label { - @apply flex select-none items-center justify-between; +.label:where(:not(.label-text)) { + @apply flex items-center justify-between; } diff --git a/src/components/unstyled/modal.css b/src/components/unstyled/modal.css index 0a8fe2b..f707fff 100755 --- a/src/components/unstyled/modal.css +++ b/src/components/unstyled/modal.css @@ -13,22 +13,16 @@ .modal-header { @apply relative flex items-center justify-between p-6; - & + .modal-body { - padding-top: 0; - } } .modal-title { - @apply text-base-content/90 text-2xl font-semibold; + @apply text-base-content text-2xl font-semibold; } .modal-body { - @apply overflow-y-auto p-6 text-base font-normal [&::-webkit-scrollbar]:w-2; - & + .modal-footer { - padding-top: 0; - } + @apply overflow-y-auto text-base font-normal [&::-webkit-scrollbar]:w-2; } .modal-footer { - @apply flex items-center justify-end gap-3 p-6; + @apply flex items-center justify-end gap-3; } diff --git a/src/js/helpers/apexcharts/index.ts b/src/js/helpers/apexcharts/index.ts index d3cedfc..f40498b 100644 --- a/src/js/helpers/apexcharts/index.ts +++ b/src/js/helpers/apexcharts/index.ts @@ -1,11 +1,11 @@ /* - * @version: 2.6.0 + * @version: 2.7.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 { IBuildTooltipHelperOptions, IChartDonutProps, IChartProps, IChartPropsSeries } from './interfaces' function buildTooltip(props: IChartProps, options: IBuildTooltipHelperOptions) { const { @@ -20,13 +20,13 @@ function buildTooltip(props: IChartProps, options: IBuildTooltipHelperOptions) { wrapperExtClasses = '', seriesClasses = 'text-xs items-center', seriesExtClasses = '', - titleClasses = '!text-sm !font-semibold !bg-base-100 !border-base-content/40 text-base-content/90 rounded-t-lg !px-2.5', + titleClasses = '!text-sm !font-semibold !bg-base-100 !border-base-content/40 text-base-content rounded-t-lg !px-2.5', titleExtClasses = '', markerClasses = '!w-2.5 !h-2.5 !me-1.5 rtl:!mr-0', markerExtClasses = '', valueClasses = '!font-medium text-base-content/80 !ms-auto', valueExtClasses = '', - labelClasses = 'text-base-content/90', + labelClasses = 'text-base-content', labelExtClasses = '' } = options const { dataPointIndex } = props @@ -90,13 +90,13 @@ function buildTooltipCompareTwo(props: IChartProps, options: IBuildTooltipHelper wrapperExtClasses = '', seriesClasses = 'text-xs items-center !justify-between', seriesExtClasses = '', - titleClasses = '!text-sm !font-semibold !bg-base-100 !border-base-content/40 text-base-content/90 rounded-t-lg !px-2.5', + titleClasses = '!text-sm !font-semibold !bg-base-100 !border-base-content/40 text-base-content rounded-t-lg !px-2.5', titleExtClasses = 'flex justify-between', markerClasses = '!w-2.5 !h-2.5 !me-1.5', markerExtClasses = '', valueClasses = '!font-medium text-base-content/80 !ms-auto', valueExtClasses = '', - labelClasses = 'text-base-content/90 !fw-medium', + labelClasses = 'text-base-content !fw-medium', labelExtClasses = '' } = options @@ -170,13 +170,13 @@ function buildTooltipCompareTwoAlt(props: IChartProps, options: IBuildTooltipHel wrapperExtClasses = '', seriesClasses = 'text-xs items-center !justify-between', seriesExtClasses = '', - titleClasses = '!text-sm !font-semibold !bg-base-100 !border-base-content/40 text-base-content/90 rounded-t-lg flex !justify-between !px-2.5', + titleClasses = '!text-sm !font-semibold !bg-base-100 !border-base-content/40 text-base-content rounded-t-lg flex !justify-between !px-2.5', titleExtClasses = '', markerClasses = '!w-2.5 !h-2.5 !me-1.5', markerExtClasses = '', valueClasses = '!font-medium text-base-content/80 !ms-auto', valueExtClasses = '', - labelClasses = 'text-base-content/90 !fw-medium', + labelClasses = 'text-base-content !fw-medium', labelExtClasses = '' } = options @@ -259,4 +259,5 @@ function buildChart(id: string, shared: Function) { return chart } -export { buildTooltip, buildTooltipCompareTwo, buildTooltipCompareTwoAlt, buildTooltipForDonut, buildChart } +export { buildChart, buildTooltip, buildTooltipCompareTwo, buildTooltipCompareTwoAlt, buildTooltipForDonut } + diff --git a/src/js/helpers/clipboard/index.ts b/src/js/helpers/clipboard/index.ts index 205677f..24760fb 100644 --- a/src/js/helpers/clipboard/index.ts +++ b/src/js/helpers/clipboard/index.ts @@ -1,5 +1,5 @@ /* - * @version: 2.6.0 + * @version: 2.7.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/src/js/index.ts b/src/js/index.ts index 795670f..f49ab70 100644 --- a/src/js/index.ts +++ b/src/js/index.ts @@ -1,5 +1,5 @@ /* - * @version: 2.6.0 + * @version: 2.7.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/src/js/plugins/accordion/index.ts b/src/js/plugins/accordion/index.ts index a41c4b4..7e79206 100644 --- a/src/js/plugins/accordion/index.ts +++ b/src/js/plugins/accordion/index.ts @@ -1,17 +1,17 @@ /* * HSAccordion - * @version: 2.6.0 + * @version: 2.7.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, stringToBoolean, dispatch, afterTransition } from '../../utils' +import { afterTransition, dispatch, getClassProperty, stringToBoolean } from '../../utils' -import { IAccordionOptions, IAccordion, IAccordionTreeView, IAccordionTreeViewStaticOptions } from './interfaces' +import { IAccordion, IAccordionOptions, IAccordionTreeView, IAccordionTreeViewStaticOptions } from './interfaces' -import HSBasePlugin from '../base-plugin' import { ICollectionItem } from '../../interfaces' +import HSBasePlugin from '../base-plugin' class HSAccordion extends HSBasePlugin implements IAccordion { private toggle: HTMLElement | null @@ -106,8 +106,8 @@ class HSAccordion extends HSBasePlugin implements IAccordion }) afterTransition(this.content, () => { - this.content.style.display = '' - this.content.style.height = '0' + this.content.style.display = 'none' + this.content.style.height = '' this.fireEvent('close', this.el) dispatch('close.accordion.item', this.el, this.el) @@ -154,28 +154,14 @@ class HSAccordion extends HSBasePlugin implements IAccordion } // Static methods - static getInstance(target: HTMLElement | string, isInstance?: boolean) { - const elInCollection = window.$hsAccordionCollection.find( - el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) - ) - - return elInCollection ? (isInstance ? elInCollection : elInCollection.element.el) : null - } - - static show(target: HTMLElement) { - const elInCollection = window.$hsAccordionCollection.find( - el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) - ) - - if (elInCollection && elInCollection.element.content.style.display !== 'block') elInCollection.element.show() - } - - static hide(target: HTMLElement) { - const elInCollection = window.$hsAccordionCollection.find( - el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) + private static findInCollection(target: HSAccordion | HTMLElement | string): ICollectionItem | null { + return ( + window.$hsAccordionCollection.find(el => { + if (target instanceof HSAccordion) return el.element.el === target.el + else if (typeof target === 'string') return el.element.el === document.querySelector(target) + else return el.element.el === target + }) || null ) - - if (elInCollection && elInCollection.element.content.style.display === 'block') elInCollection.element.hide() } static autoInit() { @@ -192,6 +178,27 @@ class HSAccordion extends HSBasePlugin implements IAccordion }) } + static getInstance(target: HTMLElement | string, isInstance?: boolean) { + const elInCollection = window.$hsAccordionCollection.find( + el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) + ) + + return elInCollection ? (isInstance ? elInCollection : elInCollection.element.el) : null + } + + static show(target: HSAccordion | HTMLElement | string) { + const instance = HSAccordion.findInCollection(target) + + if (instance && instance.element.content.style.display !== 'block') instance.element.show() + } + + static hide(target: HSAccordion | HTMLElement | string) { + const instance = HSAccordion.findInCollection(target) + const style = instance ? window.getComputedStyle(instance.element.content) : null + + if (instance && style.display !== 'none') instance.element.hide() + } + static onSelectableClick = (evt: Event, item: IAccordionTreeView, el: HTMLElement) => { evt.stopPropagation() @@ -237,12 +244,10 @@ class HSAccordion extends HSBasePlugin implements IAccordion } // Backward compatibility - static on(evt: string, target: HTMLElement, cb: Function) { - const elInCollection = window.$hsAccordionCollection.find( - el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) - ) + static on(evt: string, target: HSAccordion | HTMLElement | string, cb: Function) { + const instance = HSAccordion.findInCollection(target) - if (elInCollection) elInCollection.element.events[evt] = cb + if (instance) instance.element.events[evt] = cb } } diff --git a/src/js/plugins/base-plugin/index.ts b/src/js/plugins/base-plugin/index.ts index d1cdce3..f512678 100644 --- a/src/js/plugins/base-plugin/index.ts +++ b/src/js/plugins/base-plugin/index.ts @@ -2,7 +2,7 @@ /* * HSBasePlugin - * @version: 2.6.0 + * @version: 2.7.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/src/js/plugins/carousel/index.ts b/src/js/plugins/carousel/index.ts index 9bdbe82..c6c5550 100644 --- a/src/js/plugins/carousel/index.ts +++ b/src/js/plugins/carousel/index.ts @@ -1,6 +1,6 @@ /* * HSCarousel - * @version: 2.6.0 + * @version: 2.7.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. @@ -11,9 +11,9 @@ 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' +import { ICollectionItem } from '../../interfaces' +import HSBasePlugin from '../base-plugin' class HSCarousel extends HSBasePlugin implements ICarousel { private currentIndex: number diff --git a/src/js/plugins/collapse/index.ts b/src/js/plugins/collapse/index.ts index a5afe28..8feac5c 100644 --- a/src/js/plugins/collapse/index.ts +++ b/src/js/plugins/collapse/index.ts @@ -1,18 +1,18 @@ /* * HSCollapse - * @version: 2.6.0 + * @version: 2.7.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, afterTransition } from '../../utils' +import { afterTransition, dispatch } from '../../utils' import { ICollapse } from './interfaces' +import { ICollectionItem } from '../../interfaces' import HSBasePlugin from '../base-plugin' import HSDropdown from '../dropdown' -import { ICollectionItem } from '../../interfaces' class HSCollapse extends HSBasePlugin<{}> implements ICollapse { private readonly contentId: string | null @@ -53,12 +53,12 @@ class HSCollapse extends HSBasePlugin<{}> implements ICollapse { } private hideAllMegaMenuItems() { - this.content.querySelectorAll('mega-menu-content.block').forEach(el => { + this.content.querySelectorAll('.mega-menu-content.block').forEach(el => { el.classList.remove('block') el.classList.add('hidden') }) } - + // This function is added to close all dropdowns when the collapse is closed private closeDropdowns(): void { if (!this.content) return @@ -149,6 +149,16 @@ class HSCollapse extends HSBasePlugin<{}> implements ICollapse { } // Static methods + private static findInCollection(target: HSCollapse | HTMLElement | string): ICollectionItem | null { + return ( + window.$hsCollapseCollection.find(el => { + if (target instanceof HSCollapse) return el.element.el === target.el + else if (typeof target === 'string') return el.element.el === document.querySelector(target) + else return el.element.el === target + }) || null + ) + } + static getInstance(target: HTMLElement, isInstance = false) { const elInCollection = window.$hsCollapseCollection.find( el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) @@ -168,29 +178,23 @@ class HSCollapse extends HSBasePlugin<{}> implements ICollapse { }) } - static show(target: HTMLElement) { - const elInCollection = window.$hsCollapseCollection.find( - el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) - ) + static show(target: HSCollapse | HTMLElement | string) { + const instance = HSCollapse.findInCollection(target) - if (elInCollection && elInCollection.element.content.classList.contains('hidden')) elInCollection.element.show() + if (instance && instance.element.content.classList.contains('hidden')) instance.element.show() } - static hide(target: HTMLElement) { - const elInCollection = window.$hsCollapseCollection.find( - el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) - ) + static hide(target: HSCollapse | HTMLElement | string) { + const instance = HSCollapse.findInCollection(target) - if (elInCollection && !elInCollection.element.content.classList.contains('hidden')) elInCollection.element.hide() + if (instance && !instance.element.content.classList.contains('hidden')) instance.element.hide() } // Backward compatibility - static on(evt: string, target: HTMLElement, cb: Function) { - const elInCollection = window.$hsCollapseCollection.find( - el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) - ) + static on(evt: string, target: HSCollapse | HTMLElement | string, cb: Function) { + const instance = HSCollapse.findInCollection(target) - if (elInCollection) elInCollection.element.events[evt] = cb + if (instance) instance.element.events[evt] = cb } } diff --git a/src/js/plugins/combobox/index.ts b/src/js/plugins/combobox/index.ts index bcf91c2..f99468b 100644 --- a/src/js/plugins/combobox/index.ts +++ b/src/js/plugins/combobox/index.ts @@ -1,17 +1,17 @@ /* * HSComboBox - * @version: 2.6.0 + * @version: 2.7.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 { isEnoughSpace, debounce, dispatch, afterTransition, htmlToElement, isParentOrElementHidden } from '../../utils' +import { afterTransition, debounce, dispatch, htmlToElement, isEnoughSpace, isParentOrElementHidden } from '../../utils' -import { IComboBox, IComboBoxOptions, IComboBoxItemAttr } from './interfaces' +import { IComboBox, IComboBoxItemAttr, IComboBoxOptions } from './interfaces' -import HSBasePlugin from '../base-plugin' import { ICollectionItem } from '../../interfaces' +import HSBasePlugin from '../base-plugin' import { COMBO_BOX_ACCESSIBILITY_KEY_SET } from '../../constants' @@ -19,6 +19,7 @@ class HSComboBox extends HSBasePlugin implements IComboBox { gap: number viewport: string | HTMLElement | null preventVisibility: boolean + minSearchLength: number apiUrl: string | null apiDataPart: string | null apiQuery: string | null @@ -57,6 +58,7 @@ class HSComboBox extends HSBasePlugin implements IComboBox { isOpened: boolean isCurrent: boolean private animationInProcess: boolean + private isSearchLengthExceeded = false private onInputFocusListener: () => void private onInputInputListener: (evt: InputEvent) => void @@ -81,6 +83,7 @@ class HSComboBox extends HSBasePlugin implements IComboBox { ? (document.querySelector(concatOptions?.viewport) as HTMLElement) : concatOptions?.viewport) ?? null this.preventVisibility = concatOptions?.preventVisibility ?? false + this.minSearchLength = concatOptions?.minSearchLength ?? 0 this.apiUrl = concatOptions?.apiUrl ?? null this.apiDataPart = concatOptions?.apiDataPart ?? null this.apiQuery = concatOptions?.apiQuery ?? null @@ -140,9 +143,14 @@ class HSComboBox extends HSBasePlugin implements IComboBox { } private inputInput(evt: InputEvent) { - this.setResultAndRender((evt.target as HTMLInputElement).value) + const val = (evt.target as HTMLInputElement).value.trim() + + if (val.length <= this.minSearchLength) this.setResultAndRender('') + else this.setResultAndRender(val) + if (this.input.value !== '') this.el.classList.add('has-value') else this.el.classList.remove('has-value') + if (!this.isOpened) this.open() } @@ -224,6 +232,9 @@ class HSComboBox extends HSBasePlugin implements IComboBox { this.setResults(_value) if (this.apiSearchQuery || this.apiSearchPath || this.apiSearchDefaultPath) this.itemsFromJson() + + if (_value === '') this.isSearchLengthExceeded = true + else this.isSearchLengthExceeded = false } private setResults(val: string) { @@ -594,6 +605,8 @@ class HSComboBox extends HSBasePlugin implements IComboBox { } private async itemsFromJson() { + if (this.isSearchLengthExceeded) return false + this.buildOutputLoader() try { @@ -662,7 +675,7 @@ class HSComboBox extends HSBasePlugin implements IComboBox { this.jsonItemsRender(items) } - this.setResults(this.input.value) + this.setResults(this.input.value.length <= this.minSearchLength ? '' : this.input.value) } catch (err) { console.error(err) diff --git a/src/js/plugins/combobox/interfaces.ts b/src/js/plugins/combobox/interfaces.ts index 2e19a6c..b683304 100644 --- a/src/js/plugins/combobox/interfaces.ts +++ b/src/js/plugins/combobox/interfaces.ts @@ -2,6 +2,7 @@ export interface IComboBoxOptions { gap?: number viewport?: string | HTMLElement | null preventVisibility?: boolean + minSearchLength?: number apiUrl?: string | null apiDataPart?: string | null apiQuery?: string | null diff --git a/src/js/plugins/copy-markup/index.ts b/src/js/plugins/copy-markup/index.ts index 71ddc04..17223f2 100644 --- a/src/js/plugins/copy-markup/index.ts +++ b/src/js/plugins/copy-markup/index.ts @@ -1,6 +1,6 @@ /* * HSCopyMarkup - * @version: 2.6.0 + * @version: 2.7.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/src/js/plugins/datatable/index.ts b/src/js/plugins/datatable/index.ts index f2da9e5..6666e6d 100644 --- a/src/js/plugins/datatable/index.ts +++ b/src/js/plugins/datatable/index.ts @@ -1,6 +1,6 @@ /* * HSDataTable - * @version: 2.6.0 + * @version: 2.7.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,12 +8,12 @@ import { Api } from 'datatables.net' -import { debounce, htmlToElement, classToClassList } from '../../utils' +import { classToClassList, debounce, htmlToElement } from '../../utils' -import { IDataTableOptions, IDataTable } from './interfaces' +import { IDataTable, IDataTableOptions } from './interfaces' -import HSBasePlugin from '../base-plugin' import { ICollectionItem } from '../../interfaces' +import HSBasePlugin from '../base-plugin' declare var DataTable: any @@ -29,19 +29,17 @@ class HSDataTable extends HSBasePlugin implements IDataTable private readonly table: HTMLTableElement - private readonly search: HTMLElement | null + private searches: HTMLElement[] | null + + private pageEntitiesList: (HTMLSelectElement | HTMLInputElement)[] | null - private readonly pageEntities: HTMLSelectElement | HTMLInputElement | null + private pagingList: HTMLElement[] | null + private pagingPagesList: HTMLElement[] | null - private readonly paging: HTMLElement | null - private readonly pagingPrev: HTMLElement | null - private readonly pagingNext: HTMLElement | null - private readonly pagingPages: HTMLElement | null + private pagingPrevList: HTMLElement[] | null + private pagingNextList: HTMLElement[] | null - private readonly info: HTMLElement | null - private readonly infoFrom: HTMLElement | null - private readonly infoTo: HTMLElement | null - private readonly infoLength: HTMLElement | null + private readonly infoList: HTMLElement[] | null private rowSelectingAll: HTMLElement | null private rowSelectingIndividual: string | null @@ -50,17 +48,37 @@ class HSDataTable extends HSBasePlugin implements IDataTable private isRowSelecting: boolean private readonly pageBtnClasses: string | null - private onSearchInputListener: (evt: InputEvent) => void - private onPageEntitiesChangeListener: (evt: Event) => void - private onPagingPrevClickListener: () => void - private onPagingNextClickListener: () => void - private onRowSelectingAllChangeListener: () => void + private onSearchInputListener: + | { + el: Element + fn: (evt: InputEvent) => void + }[] + | null + private onPageEntitiesChangeListener: + | { + el: Element + fn: (evt: InputEvent) => void + }[] + | null private onSinglePagingClickListener: | { - id: number + el: Element + fn: () => void + }[] + | null + private onPagingPrevClickListener: + | { + el: Element + fn: () => void + }[] + | null + private onPagingNextClickListener: + | { + el: Element fn: () => void }[] | null + private onRowSelectingAllChangeListener: () => void constructor(el: HTMLElement, options?: IDataTableOptions, events?: {}) { super(el, options, events) @@ -91,19 +109,16 @@ class HSDataTable extends HSBasePlugin implements IDataTable this.table = this.el.querySelector('table') - this.search = this.el.querySelector('[data-datatable-search]') ?? null + this.searches = Array.from(this.el.querySelectorAll('[data-datatable-search]')) ?? null - this.pageEntities = this.el.querySelector('[data-datatable-page-entities]') ?? null + this.pageEntitiesList = Array.from(this.el.querySelectorAll('[data-datatable-page-entities]')) ?? null - this.paging = this.el.querySelector('[data-datatable-paging]') ?? null - this.pagingPrev = this.el.querySelector('[data-datatable-paging-prev]') ?? null - this.pagingNext = this.el.querySelector('[data-datatable-paging-next]') ?? null - this.pagingPages = this.el.querySelector('[data-datatable-paging-pages]') ?? null + this.pagingList = Array.from(this.el.querySelectorAll('[data-datatable-paging]')) ?? null + this.pagingPagesList = Array.from(this.el.querySelectorAll('[data-datatable-paging-pages]')) ?? null + this.pagingPrevList = Array.from(this.el.querySelectorAll('[data-datatable-paging-prev]')) ?? null + this.pagingNextList = Array.from(this.el.querySelectorAll('[data-datatable-paging-next]')) ?? null - this.info = this.el.querySelector('[data-datatable-info]') ?? null - this.infoFrom = this.el.querySelector('[data-datatable-info-from]') ?? null - this.infoTo = this.el.querySelector('[data-datatable-info-to]') ?? null - this.infoLength = this.el.querySelector('[data-datatable-info-length]') ?? null + this.infoList = Array.from(this.el.querySelectorAll('[data-datatable-info]')) ?? null if (this.concatOptions?.rowSelectingOptions) this.rowSelectingAll = @@ -116,13 +131,17 @@ class HSDataTable extends HSBasePlugin implements IDataTable '[data-datatable-row-selecting-individual]' ?? null - if (this.pageEntities) this.concatOptions.pageLength = parseInt(this.pageEntities.value) + if (this.pageEntitiesList.length) this.concatOptions.pageLength = parseInt(this.pageEntitiesList[0].value) this.maxPagesToShow = 3 this.isRowSelecting = !!this.concatOptions?.rowSelectingOptions this.pageBtnClasses = this.concatOptions?.pagingOptions?.pageBtnClasses ?? null + this.onSearchInputListener = [] + this.onPageEntitiesChangeListener = [] this.onSinglePagingClickListener = [] + this.onPagingPrevClickListener = [] + this.onPagingNextClickListener = [] this.init() } @@ -132,16 +151,16 @@ class HSDataTable extends HSBasePlugin implements IDataTable this.initTable() - if (this.search) this.initSearch() + if (this.searches.length) this.initSearch() - if (this.pageEntities) this.initPageEntities() + if (this.pageEntitiesList.length) this.initPageEntities() - if (this.paging) this.initPaging() - if (this.pagingPrev) this.initPagingPrev() - if (this.pagingNext) this.initPagingNext() - if (this.pagingPages) this.buildPagingPages() + if (this.pagingList.length) this.initPaging() + if (this.pagingPagesList.length) this.buildPagingPages() + if (this.pagingPrevList.length) this.initPagingPrev() + if (this.pagingNextList.length) this.initPagingNext() - if (this.info) this.initInfo() + if (this.infoList.length) this.initInfo() if (this.isRowSelecting) this.initRowSelecting() } @@ -155,7 +174,7 @@ class HSDataTable extends HSBasePlugin implements IDataTable if (this.isRowSelecting) this.updateSelectAllCheckbox() if (this.isRowSelecting) this.triggerChangeEventToRow() this.updateInfo() - this.updatePaging() + this.pagingPagesList.forEach(el => this.updatePaging(el)) }) } @@ -164,7 +183,7 @@ class HSDataTable extends HSBasePlugin implements IDataTable } private pageEntitiesChange(evt: Event) { - this.onEntitiesChange(parseInt((evt.target as HTMLSelectElement).value)) + this.onEntitiesChange(parseInt((evt.target as HTMLSelectElement).value), evt.target as HTMLSelectElement) } private pagingPrevClick() { @@ -183,37 +202,16 @@ class HSDataTable extends HSBasePlugin implements IDataTable this.onPageClick(count) } - // Public methods - public destroy() { - const pagingItems = this.el.querySelectorAll('[data-page]') - if (this.search) this.search.removeEventListener('input', this.onSearchInputListener) - if (this.pageEntities) this.pageEntities.removeEventListener('change', this.onPageEntitiesChangeListener) - if (this.pagingPrev) this.pagingPrev.removeEventListener('click', this.onPagingPrevClickListener) - if (this.pagingNext) this.pagingNext.removeEventListener('click', this.onPagingNextClickListener) - if (this.rowSelectingAll) this.rowSelectingAll.removeEventListener('change', this.onRowSelectingAllChangeListener) - if (pagingItems.length) { - pagingItems.forEach(el => { - const counter = +el.getAttribute('data-page') - - el.removeEventListener('click', this.onSinglePagingClickListener.find(el => el.id === counter).fn) - }) - - this.pagingPages.innerHTML = '' - } - - this.dataTable.destroy() - - this.rowSelectingAll = null - this.rowSelectingIndividual = null - - window.$hsDataTableCollection = window.$hsDataTableCollection.filter(({ element }) => element.el !== this.el) - } - // Search private initSearch() { - this.onSearchInputListener = debounce((evt: InputEvent) => this.searchInput(evt)) + this.searches.forEach(el => { + this.onSearchInputListener.push({ + el, + fn: debounce((evt: InputEvent) => this.searchInput(evt)) + }) - this.search.addEventListener('input', this.onSearchInputListener) + el.addEventListener('input', this.onSearchInputListener.find(search => search.el === el).fn) + }) } private onSearchInput(val: string) { @@ -222,38 +220,59 @@ class HSDataTable extends HSBasePlugin implements IDataTable // Page entities private initPageEntities() { - this.onPageEntitiesChangeListener = evt => this.pageEntitiesChange(evt) + this.pageEntitiesList.forEach(el => { + this.onPageEntitiesChangeListener.push({ + el, + fn: evt => this.pageEntitiesChange(evt) + }) - this.pageEntities.addEventListener('change', this.onPageEntitiesChangeListener) + el.addEventListener('change', this.onPageEntitiesChangeListener.find(pageEntity => pageEntity.el === el).fn) + }) } - private onEntitiesChange(entities: number) { + private onEntitiesChange(entities: number, target: HTMLSelectElement) { + const otherEntities = this.pageEntitiesList.filter(el => el !== target) + + if (otherEntities.length) + otherEntities.forEach(el => { + if (window.HSSelect) { + // @ts-ignore + const hsSelectInstance = window.HSSelect.getInstance(el, true) + if (hsSelectInstance) hsSelectInstance.element.setValue(`${entities}`) + } else el.value = `${entities}` + }) + this.dataTable.page.len(entities).draw() } // Info private initInfo() { - if (this.infoFrom) this.initInfoFrom() - if (this.infoTo) this.initInfoTo() - if (this.infoLength) this.initInfoLength() + this.infoList.forEach(el => { + this.initInfoFrom(el) + this.initInfoTo(el) + this.initInfoLength(el) + }) } - private initInfoFrom() { + private initInfoFrom(el: HTMLElement) { + const infoFrom = (el.querySelector('[data-datatable-info-from]') as HTMLElement) ?? null const { start } = this.dataTable.page.info() - this.infoFrom.innerText = `${start + 1}` + if (infoFrom) infoFrom.innerText = `${start + 1}` } - private initInfoTo() { + private initInfoTo(el: HTMLElement) { + const infoTo = (el.querySelector('[data-datatable-info-to]') as HTMLElement) ?? null const { end } = this.dataTable.page.info() - this.infoTo.innerText = `${end}` + if (infoTo) infoTo.innerText = `${end}` } - private initInfoLength() { + private initInfoLength(el: HTMLElement) { + const infoLength = (el.querySelector('[data-datatable-info-length]') as HTMLElement) ?? null const { recordsTotal } = this.dataTable.page.info() - this.infoLength.innerText = `${recordsTotal}` + if (infoLength) infoLength.innerText = `${recordsTotal}` } private updateInfo() { @@ -262,25 +281,30 @@ class HSDataTable extends HSBasePlugin implements IDataTable // Paging private initPaging() { - this.hidePagingIfSinglePage() + this.pagingList.forEach(el => this.hidePagingIfSinglePage(el)) } - private hidePagingIfSinglePage() { + private hidePagingIfSinglePage(el: HTMLElement) { const { pages } = this.dataTable.page.info() if (pages < 2) { - this.paging.classList.add('hidden') - this.paging.style.display = 'none' + el.classList.add('hidden') + el.style.display = 'none' } else { - this.paging.classList.remove('hidden') - this.paging.style.display = '' + el.classList.remove('hidden') + el.style.display = '' } } private initPagingPrev() { - this.onPagingPrevClickListener = () => this.pagingPrevClick() + this.pagingPrevList.forEach(el => { + this.onPagingPrevClickListener.push({ + el, + fn: () => this.pagingPrevClick() + }) - this.pagingPrev.addEventListener('click', this.onPagingPrevClickListener) + el.addEventListener('click', this.onPagingPrevClickListener.find(pagingPrev => pagingPrev.el === el).fn) + }) } private onPrevClick() { @@ -298,9 +322,14 @@ class HSDataTable extends HSBasePlugin implements IDataTable } private initPagingNext() { - this.onPagingNextClickListener = () => this.pagingNextClick() + this.pagingNextList.forEach(el => { + this.onPagingNextClickListener.push({ + el, + fn: () => this.pagingNextClick() + }) - this.pagingNext.addEventListener('click', this.onPagingNextClickListener) + el.addEventListener('click', this.onPagingNextClickListener.find(pagingNext => pagingNext.el === el).fn) + }) } private onNextClick() { @@ -308,10 +337,10 @@ class HSDataTable extends HSBasePlugin implements IDataTable } private buildPagingPages() { - this.updatePaging() + this.pagingPagesList.forEach(el => this.updatePaging(el)) } - private updatePaging() { + private updatePaging(pagingPages: HTMLElement) { const { page, pages, length } = this.dataTable.page.info() const totalRecords = this.dataTable.rows({ search: 'applied' }).count() const totalPages = Math.ceil(totalRecords / length) @@ -324,34 +353,31 @@ class HSDataTable extends HSBasePlugin implements IDataTable startPage = Math.max(1, endPage - this.maxPagesToShow + 1) } - this.pagingPages.innerHTML = '' + pagingPages.innerHTML = '' if (startPage > 1) { - this.buildPagingPage(1) + this.buildPagingPage(1, pagingPages) - if (startPage > 2) { - this.pagingPages.appendChild(htmlToElement(`...`)) - } + if (startPage > 2) pagingPages.appendChild(htmlToElement(`...`)) } for (let i = startPage; i <= endPage; i++) { - this.buildPagingPage(i) + this.buildPagingPage(i, pagingPages) } if (endPage < totalPages) { - if (endPage < totalPages - 1) { - this.pagingPages.appendChild(htmlToElement(`...`)) - } + if (endPage < totalPages - 1) pagingPages.appendChild(htmlToElement(`...`)) - this.buildPagingPage(totalPages) + this.buildPagingPage(totalPages, pagingPages) } - this.disablePagingArrow(this.pagingPrev, page === 0) - this.disablePagingArrow(this.pagingNext, page === pages - 1) - this.hidePagingIfSinglePage() + this.pagingPrevList.forEach(el => this.disablePagingArrow(el, page === 0)) + this.pagingNextList.forEach(el => this.disablePagingArrow(el, page === pages - 1)) + + this.pagingList.forEach(el => this.hidePagingIfSinglePage(el)) } - private buildPagingPage(counter: number) { + private buildPagingPage(counter: number, target: HTMLElement) { const { page } = this.dataTable.page.info() const pageEl = htmlToElement(``) pageEl.innerText = `${counter}` @@ -360,13 +386,16 @@ class HSDataTable extends HSBasePlugin implements IDataTable if (page === counter - 1) pageEl.classList.add('active') this.onSinglePagingClickListener.push({ - id: counter, + el: pageEl, fn: () => this.singlePagingClick(counter) }) - pageEl.addEventListener('click', this.onSinglePagingClickListener.find(el => el.id === counter).fn) + pageEl.addEventListener( + 'click', + this.onSinglePagingClickListener.find(singlePaging => singlePaging.el === pageEl).fn + ) - this.pagingPages.append(pageEl) + target.append(pageEl) } private onPageClick(counter: number) { @@ -432,6 +461,34 @@ class HSDataTable extends HSBasePlugin implements IDataTable ;(this.rowSelectingAll as HTMLInputElement).checked = isChecked } + // Public methods + public destroy() { + if (this.searches) { + this.onSearchInputListener.forEach(({ el, fn }) => el.removeEventListener('click', fn)) + + // this.searches = null; + } + if (this.pageEntitiesList) + this.onPageEntitiesChangeListener.forEach(({ el, fn }) => el.removeEventListener('change', fn)) + if (this.pagingPagesList.length) { + this.onSinglePagingClickListener.forEach(({ el, fn }) => el.removeEventListener('click', fn)) + + this.pagingPagesList.forEach(el => (el.innerHTML = '')) + } + if (this.pagingPrevList.length) + this.onPagingPrevClickListener.forEach(({ el, fn }) => el.removeEventListener('click', fn)) + if (this.pagingNextList.length) + this.onPagingNextClickListener.forEach(({ el, fn }) => el.removeEventListener('click', fn)) + if (this.rowSelectingAll) this.rowSelectingAll.removeEventListener('change', this.onRowSelectingAllChangeListener) + + this.dataTable.destroy() + + this.rowSelectingAll = null + this.rowSelectingIndividual = null + + window.$hsDataTableCollection = window.$hsDataTableCollection.filter(({ element }) => element.el !== this.el) + } + // Static methods static getInstance(target: HTMLElement | string, isInstance?: boolean) { const elInCollection = window.$hsDataTableCollection.find( diff --git a/src/js/plugins/dropdown/index.ts b/src/js/plugins/dropdown/index.ts index d4574e1..a8a1250 100644 --- a/src/js/plugins/dropdown/index.ts +++ b/src/js/plugins/dropdown/index.ts @@ -1,30 +1,30 @@ /* * HSDropdown - * @version: 2.6.0 + * @version: 2.7.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 { - stringToBoolean, + afterTransition, + dispatch, getClassProperty, getClassPropertyAlt, isIOS, isIpadOS, - dispatch, - afterTransition, - menuSearchHistory + menuSearchHistory, + stringToBoolean } from '../../utils' import { IMenuSearchHistory } from '../../utils/interfaces' import { createPopper, PositioningStrategy, VirtualElement } from '@popperjs/core' -import { IDropdown, IHTMLElementPopper } from './interfaces' -import HSBasePlugin from '../base-plugin' import { ICollectionItem } from '../../interfaces' +import HSBasePlugin from '../base-plugin' +import { IDropdown, IHTMLElementPopper } from '../dropdown/interfaces' -import { POSITIONS, DROPDOWN_ACCESSIBILITY_KEY_SET } from '../../constants' +import { DROPDOWN_ACCESSIBILITY_KEY_SET, POSITIONS } from '../../constants' class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> implements IDropdown { private static history: IMenuSearchHistory @@ -273,6 +273,7 @@ class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> implements IDropdo ' ', '' ) + // This is added in FlyonUI const skidding = parseInt((window.getComputedStyle(this.el).getPropertyValue('--skidding') || '0').replace(' ', '')) const popperInstance = createPopper(_target, this.menu, { placement: POSITIONS[placement] || 'bottom-start', @@ -347,6 +348,7 @@ class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> implements IDropdo ' ', '' ) + // This is added in FlyonUI const skidding = parseInt((window.getComputedStyle(this.el).getPropertyValue('--skidding') || '0').replace(' ', '')) if (scope === 'window') document.body.appendChild(this.menu) @@ -392,10 +394,13 @@ class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> implements IDropdo this.animationInProcess = false if (this.hasAutofocus) this.focusElement() + + this.fireEvent('open', this.el) + dispatch('open.dropdown', this.el, this.el) }) - this.fireEvent('open', this.el) - dispatch('open.dropdown', this.el, this.el) + // this.fireEvent('open', this.el); + // dispatch('open.dropdown', this.el, this.el); } public close(isAnimated = true) { @@ -460,6 +465,16 @@ class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> implements IDropdo } // Static methods + private static findInCollection(target: HSDropdown | HTMLElement | string): ICollectionItem | null { + return ( + window.$hsDropdownCollection.find(el => { + if (target instanceof HSDropdown) return el.element.el === target.el + else if (typeof target === 'string') return el.element.el === document.querySelector(target) + else return el.element.el === target + }) || null + ) + } + static getInstance(target: HTMLElement | string, isInstance?: boolean) { const elInCollection = window.$hsDropdownCollection.find( el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) @@ -497,22 +512,16 @@ class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> implements IDropdo }) } - static open(target: HTMLElement) { - const elInCollection = window.$hsDropdownCollection.find( - el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) - ) + static open(target: HSDropdown | HTMLElement | string) { + const instance = HSDropdown.findInCollection(target) - if (elInCollection && elInCollection.element.menu.classList.contains('hidden')) elInCollection.element.open() + if (instance && instance.element.menu.classList.contains('hidden')) instance.element.open() } - static close(target: HTMLElement) { - const elInCollection = window.$hsDropdownCollection.find( - el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) - ) + static close(target: HSDropdown | HTMLElement | string) { + const instance = HSDropdown.findInCollection(target) - if (elInCollection && !elInCollection.element.menu.classList.contains('hidden')) { - elInCollection.element.close() - } + if (instance && !instance.element.menu.classList.contains('hidden')) instance.element.close() } // Accessibility methods @@ -601,7 +610,8 @@ class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> implements IDropdo static onEnter(evt: KeyboardEvent) { const target = evt.target as HTMLElement - const { element } = window.$hsDropdownCollection.find(el => el.element.el === target.closest('.dropdown')) ?? null + const { element } = + window.$hsDropdownCollection.find(el => el.element.el === target.closest('.dropdown')) ?? null if (element && target.classList.contains('dropdown-toggle')) { evt.preventDefault() @@ -660,7 +670,8 @@ class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> implements IDropdo const closestDropdown = toggle.closest('.dropdown.open') const isRootDropdown = !!closestDropdown && !closestDropdown?.parentElement.closest('.dropdown') const menuToOpen = - (HSDropdown.getInstance(toggle.closest('.dropdown') as HTMLElement, true) as ICollectionItem) ?? null + (HSDropdown.getInstance(toggle.closest('.dropdown') as HTMLElement, true) as ICollectionItem) ?? + null const firstLink = menuToOpen.element.menu.querySelector( 'a, button, [role="button"], [role^="menuitem"]' ) as HTMLButtonElement @@ -668,8 +679,10 @@ class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> implements IDropdo if (isRootDropdown && !toggle.classList.contains('dropdown-toggle')) return false const menuToClose = - (HSDropdown.getInstance(toggle.closest('.dropdown.open') as HTMLElement, true) as ICollectionItem) ?? - null + (HSDropdown.getInstance( + toggle.closest('.dropdown.open') as HTMLElement, + true + ) as ICollectionItem) ?? null if ( menuToOpen.element.el.classList.contains('open') && @@ -745,7 +758,9 @@ class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> implements IDropdo static closeCurrentlyOpened(evtTarget: HTMLElement | null = null, isAnimated = true) { const parent = - evtTarget && evtTarget.closest('.dropdown') && evtTarget.closest('.dropdown').parentElement.closest('.dropdown') + evtTarget && + evtTarget.closest('.dropdown') && + evtTarget.closest('.dropdown').parentElement.closest('.dropdown') ? evtTarget.closest('.dropdown').parentElement.closest('.dropdown') : null let currentlyOpened = parent @@ -763,7 +778,7 @@ class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> implements IDropdo ) { currentlyOpened = currentlyOpened.filter(el => el.element.el !== evtTarget.closest('.dropdown')) } - + // This is added in FlyonUI if ( evtTarget && evtTarget.closest('.dropdown') && @@ -794,12 +809,10 @@ class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> implements IDropdo } // Backward compatibility - static on(evt: string, target: HTMLElement, cb: Function) { - const elInCollection = window.$hsDropdownCollection.find( - el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) - ) + static on(evt: string, target: HSDropdown | HTMLElement | string, cb: Function) { + const instance = HSDropdown.findInCollection(target) - if (elInCollection) elInCollection.element.events[evt] = cb + if (instance) instance.element.events[evt] = cb } } diff --git a/src/js/plugins/file-upload/index.ts b/src/js/plugins/file-upload/index.ts index 858b93b..4614cb5 100644 --- a/src/js/plugins/file-upload/index.ts +++ b/src/js/plugins/file-upload/index.ts @@ -1,6 +1,6 @@ /* * HSFileUpload - * @version: 2.6.0 + * @version: 2.7.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,12 +8,12 @@ import { DropzoneFile } from 'dropzone' -import { htmlToElement, classToClassList } from '../../utils' +import { classToClassList, htmlToElement } from '../../utils' -import { IFileUploadOptions, IFileUpload } from './interfaces' +import { IFileUpload, IFileUploadOptions } from './interfaces' -import HSBasePlugin from '../base-plugin' import { ICollectionItem } from '../../interfaces' +import HSBasePlugin from '../base-plugin' declare var _: any declare var Dropzone: any @@ -58,7 +58,7 @@ class HSFileUpload extends HSBasePlugin implements IFileUplo
-

+

.

@@ -74,7 +74,7 @@ class HSFileUpload extends HSBasePlugin implements IFileUplo
- + 0%
diff --git a/src/js/plugins/input-number/index.ts b/src/js/plugins/input-number/index.ts index 1acd6d1..41523de 100644 --- a/src/js/plugins/input-number/index.ts +++ b/src/js/plugins/input-number/index.ts @@ -1,6 +1,6 @@ /* * HSInputNumber - * @version: 2.6.0 + * @version: 2.7.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/src/js/plugins/overlay/index.ts b/src/js/plugins/overlay/index.ts index e1cf56f..2604e43 100644 --- a/src/js/plugins/overlay/index.ts +++ b/src/js/plugins/overlay/index.ts @@ -1,24 +1,24 @@ /* * HSOverlay - * @version: 2.6.0 + * @version: 2.7.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 { - stringToBoolean, + afterTransition, + dispatch, getClassProperty, - isParentOrElementHidden, isDirectChild, - dispatch, - afterTransition + isParentOrElementHidden, + stringToBoolean } from '../../utils' -import { IOverlayOptions, IOverlay } from './interfaces' -import { TOverlayOptionsAutoCloseEqualityType } from './types' -import { ICollectionItem } from '../../interfaces' import { BREAKPOINTS } from '../../constants' +import { ICollectionItem } from '../../interfaces' +import { IOverlay, IOverlayOptions } from './interfaces' +import { TOverlayOptionsAutoCloseEqualityType } from './types' import HSBasePlugin from '../base-plugin' @@ -33,9 +33,8 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private openNextOverlay: boolean private autoHide: ReturnType | null - private readonly overlayId: string | null + private toggleButtons: HTMLElement[] - public overlay: HTMLElement | null public initContainer: HTMLElement | null public isCloseWhenClickInside: boolean public isTabAccessibilityLimited: boolean @@ -49,17 +48,27 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { private backdrop: HTMLElement | null - private onElementClickListener: () => void + private onElementClickListener: + | { + el: HTMLElement + fn: () => void + }[] + | null private onOverlayClickListener: (evt: Event) => void private onBackdropClickListener: () => void constructor(el: HTMLElement, options?: IOverlayOptions, events?: {}) { super(el, options, events) + // Collect all data options from toggles + this.toggleButtons = Array.from(document.querySelectorAll(`[data-overlay="#${this.el.id}"]`)) + const toggleDataOptions = this.collectToggleParameters(this.toggleButtons) + const data = el.getAttribute('data-overlay-options') const dataOptions: IOverlayOptions = data ? JSON.parse(data) : {} const concatOptions = { ...dataOptions, + ...toggleDataOptions, ...options } @@ -78,51 +87,46 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { this.openNextOverlay = false this.autoHide = null - this.overlayId = this.el.getAttribute('data-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') || 'false' - ) - this.isTabAccessibilityLimited = stringToBoolean( - getClassProperty(this.overlay, '--tab-accessibility-limited', 'true') || 'true' - ) - this.isLayoutAffect = stringToBoolean(getClassProperty(this.overlay, '--is-layout-affect', 'false') || 'false') - this.hasAutofocus = stringToBoolean(getClassProperty(this.overlay, '--has-autofocus', 'true') || 'true') - this.hasAbilityToCloseOnBackdropClick = stringToBoolean( - this.overlay.getAttribute('data-overlay-keyboard') || 'true' - ) + this.initContainer = this.el?.parentElement || null + this.isCloseWhenClickInside = stringToBoolean( + getClassProperty(this.el, '--close-when-click-inside', 'false') || 'false' + ) + this.isTabAccessibilityLimited = stringToBoolean( + getClassProperty(this.el, '--tab-accessibility-limited', 'true') || 'true' + ) + this.isLayoutAffect = stringToBoolean(getClassProperty(this.el, '--is-layout-affect', 'false') || 'false') + this.hasAutofocus = stringToBoolean(getClassProperty(this.el, '--has-autofocus', 'true') || 'true') + this.hasAbilityToCloseOnBackdropClick = stringToBoolean(this.el.getAttribute('data-overlay-keyboard') || 'true') - const autoCloseBreakpoint = getClassProperty(this.overlay, '--auto-close') - const autoCloseEqualityType = getClassProperty(this.overlay, '--auto-close-equality-type') - this.autoClose = - !isNaN(+autoCloseBreakpoint) && isFinite(+autoCloseBreakpoint) - ? +autoCloseBreakpoint - : BREAKPOINTS[autoCloseBreakpoint] || null - this.autoCloseEqualityType = (autoCloseEqualityType as TOverlayOptionsAutoCloseEqualityType) ?? null - - const openedBreakpoint = getClassProperty(this.overlay, '--opened') - this.openedBreakpoint = - (!isNaN(+openedBreakpoint) && isFinite(+openedBreakpoint) - ? +openedBreakpoint - : BREAKPOINTS[openedBreakpoint]) || null - } + const autoCloseBreakpoint = getClassProperty(this.el, '--auto-close') + const autoCloseEqualityType = getClassProperty(this.el, '--auto-close-equality-type') + const openedBreakpoint = getClassProperty(this.el, '--opened') + + this.autoClose = + !isNaN(+autoCloseBreakpoint) && isFinite(+autoCloseBreakpoint) + ? +autoCloseBreakpoint + : BREAKPOINTS[autoCloseBreakpoint] || null + this.autoCloseEqualityType = (autoCloseEqualityType as TOverlayOptionsAutoCloseEqualityType) ?? null + this.openedBreakpoint = + (!isNaN(+openedBreakpoint) && isFinite(+openedBreakpoint) ? +openedBreakpoint : BREAKPOINTS[openedBreakpoint]) || + null + + this.animationTarget = this?.el?.querySelector('.overlay-animation-target') || this.el - this.animationTarget = this?.overlay?.querySelector('.overlay-animation-target') || this.overlay + this.onElementClickListener = [] - if (this.overlay) this.init() + this.init() } private elementClick() { - if (this.overlay.classList.contains('opened')) this.close() + if (this.el.classList.contains('opened')) this.close() else this.open() } private overlayClick(evt: Event) { if ( (evt.target as HTMLElement).id && - `#${(evt.target as HTMLElement).id}` === this.overlayId && + `#${(evt.target as HTMLElement).id}` === this.el.id && this.isCloseWhenClickInside && this.hasAbilityToCloseOnBackdropClick ) { @@ -143,20 +147,29 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { HSOverlay.setOpened(this.openedBreakpoint, instance as ICollectionItem) } - if (this?.el?.ariaExpanded) { - if (this.overlay.classList.contains('opened')) this.el.ariaExpanded = 'true' - else this.el.ariaExpanded = 'false' - } - - this.onElementClickListener = () => this.elementClick() this.onOverlayClickListener = evt => this.overlayClick(evt) - this.el.addEventListener('click', this.onElementClickListener) - this.overlay.addEventListener('click', this.onOverlayClickListener) + this.el.addEventListener('click', this.onOverlayClickListener) + + if (this.toggleButtons.length) this.buildToggleButtons() + } + + private buildToggleButtons() { + this.toggleButtons.forEach(el => { + if (this.el.classList.contains('opened')) el.ariaExpanded = 'true' + else el.ariaExpanded = 'false' + + this.onElementClickListener.push({ + el, + fn: () => this.elementClick() + }) + + el.addEventListener('click', this.onElementClickListener.find(toggleButton => toggleButton.el === el).fn) + }) } private hideAuto() { - const time = parseInt(getClassProperty(this.overlay, '--auto-hide', '0')) + const time = parseInt(getClassProperty(this.el, '--auto-hide', '0')) if (time) { this.autoHide = setTimeout(() => { @@ -174,15 +187,15 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { } private buildBackdrop() { - const overlayClasses = this.overlay.classList.value.split(' ') - const overlayZIndex = parseInt(window.getComputedStyle(this.overlay).getPropertyValue('z-index')) - const backdropId = this.overlay.getAttribute('data-overlay-backdrop-container') || false + const overlayClasses = this.el.classList.value.split(' ') + const overlayZIndex = parseInt(window.getComputedStyle(this.el).getPropertyValue('z-index')) + const backdropId = this.el.getAttribute('data-overlay-backdrop-container') || false this.backdrop = document.createElement('div') let backdropClasses = `${this.backdropClasses} ${this.backdropExtraClasses}` - const closeOnBackdrop = getClassProperty(this.overlay, '--overlay-backdrop', 'true') !== 'static' - const disableBackdrop = getClassProperty(this.overlay, '--overlay-backdrop', 'true') === 'false' + const closeOnBackdrop = getClassProperty(this.el, '--overlay-backdrop', 'true') !== 'static' + const disableBackdrop = getClassProperty(this.el, '--overlay-backdrop', 'true') === 'false' - this.backdrop.id = `${this.overlay.id}-backdrop` + this.backdrop.id = `${this.el.id}-backdrop` if ('style' in this.backdrop) this.backdrop.style.zIndex = `${overlayZIndex - 1}` for (const value of overlayClasses) { @@ -216,7 +229,7 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { } private destroyBackdrop() { - const backdrop: HTMLElement = document.querySelector(`#${this.overlay.id}-backdrop`) + const backdrop: HTMLElement = document.querySelector(`#${this.el.id}-backdrop`) if (!backdrop) return @@ -234,7 +247,7 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { } private focusElement() { - const input: HTMLInputElement = this.overlay.querySelector('[autofocus]') + const input: HTMLInputElement = this.el.querySelector('[autofocus]') if (!input) return false else input.focus() @@ -254,16 +267,29 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { return scrollbarSize } + private collectToggleParameters(buttons: HTMLElement[]) { + let toggleData = {} + + buttons.forEach(el => { + const data = el.getAttribute('data-overlay-options') + const dataOptions: IOverlayOptions = data ? JSON.parse(data) : {} + toggleData = { + ...toggleData, + ...dataOptions + } + }) + + return toggleData + } + // Public methods public open() { - if (!this.overlay) return false - const openedOverlays = document.querySelectorAll('.overlay.open') const currentlyOpened = window.$hsOverlayCollection.find( - el => Array.from(openedOverlays).includes(el.element.overlay) && !el.element.isLayoutAffect + el => Array.from(openedOverlays).includes(el.element.el) && !el.element.isLayoutAffect ) - const toggles = document.querySelectorAll(`[data-overlay="#${this.overlay.id}"]`) - const disabledScroll = getClassProperty(this.overlay, '--body-scroll', 'false') !== 'true' + const toggles = document.querySelectorAll(`[data-overlay="#${this.el.id}"]`) + const disabledScroll = getClassProperty(this.el, '--body-scroll', 'false') !== 'true' if (this.isClosePrev && currentlyOpened) { this.openNextOverlay = true @@ -287,14 +313,14 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { toggles.forEach(toggle => { if (toggle.ariaExpanded) toggle.ariaExpanded = 'true' }) - this.overlay.classList.remove(this.hiddenClass) - this.overlay.setAttribute('aria-overlay', 'true') - this.overlay.setAttribute('tabindex', '-1') + this.el.classList.remove(this.hiddenClass) + this.el.setAttribute('aria-overlay', 'true') + this.el.setAttribute('tabindex', '-1') setTimeout(() => { - if (this.overlay.classList.contains('opened')) return false + if (this.el.classList.contains('opened')) return false - this.overlay.classList.add('open', 'opened') + this.el.classList.add('open', 'opened') if (this.isLayoutAffect) document.body.classList.add('overlay-body-open') this.fireEvent('open', this.el) @@ -308,13 +334,13 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { if (this.isLayoutAffect) document.body.classList.remove('overlay-body-open') const closeFn = (cb: Function) => { - if (this.overlay.classList.contains('open')) return false - const toggles = document.querySelectorAll(`[data-overlay="#${this.overlay.id}"]`) + if (this.el.classList.contains('open')) return false + const toggles = document.querySelectorAll(`[data-overlay="#${this.el.id}"]`) toggles.forEach(toggle => { if (toggle.ariaExpanded) toggle.ariaExpanded = 'false' }) - this.overlay.classList.add(this.hiddenClass) + this.el.classList.add(this.hiddenClass) this.destroyBackdrop() @@ -326,15 +352,13 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { if (this.emulateScrollbarSpace) document.body.style.paddingRight = '' } - cb(this.overlay) + cb(this.el) } return new Promise(resolve => { - if (!this.overlay) return false - - this.overlay.classList.remove('open', 'opened') - this.overlay.removeAttribute('aria-overlay') - this.overlay.removeAttribute('tabindex') + this.el.classList.remove('open', 'opened') + this.el.removeAttribute('aria-overlay') + this.el.removeAttribute('tabindex') if (forceClose) closeFn(resolve) else afterTransition(this.animationTarget, () => closeFn(resolve)) @@ -343,12 +367,17 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { public destroy() { // Remove classes - this.overlay.classList.remove('open', 'opened', this.hiddenClass) + this.el.classList.remove('open', 'opened', this.hiddenClass) if (this.isLayoutAffect) document.body.classList.remove('overlay-body-open') // Remove listeners - this.el.removeEventListener('click', this.onElementClickListener) - this.overlay.removeEventListener('click', this.onOverlayClickListener) + this.el.removeEventListener('click', this.onOverlayClickListener) + if (this.onElementClickListener.length) { + this.onElementClickListener.forEach(({ el, fn }) => { + el.removeEventListener('click', fn) + }) + this.onElementClickListener = null + } if (this.backdrop) this.backdrop.removeEventListener('click', this.onBackdropClickListener) if (this.backdrop) { @@ -360,11 +389,25 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { } // Static methods - static getInstance(target: HTMLElement, isInstance?: boolean) { + private static findInCollection(target: HSOverlay | HTMLElement | string): ICollectionItem | null { + return ( + window.$hsOverlayCollection.find(el => { + if (target instanceof HSOverlay) return el.element.el === target.el + else if (typeof target === 'string') return el.element.el === document.querySelector(target) + else return el.element.el === target + }) || null + ) + } + + static getInstance(target: HTMLElement | string, isInstance?: boolean) { + // Backward compatibility + const _temp = typeof target === 'string' ? document.querySelector(target) : target + const _target = _temp?.getAttribute('data-overlay') ? _temp.getAttribute('data-overlay') : target + const elInCollection = window.$hsOverlayCollection.find( el => - el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) || - el.element.overlay === (typeof target === 'string' ? document.querySelector(target) : target) + el.element.el === (typeof _target === 'string' ? document.querySelector(_target) : _target) || + el.element.el === (typeof _target === 'string' ? document.querySelector(_target) : _target) ) return elInCollection ? (isInstance ? elInCollection : elInCollection.element.el) : null @@ -380,45 +423,35 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { if (window.$hsOverlayCollection) window.$hsOverlayCollection = window.$hsOverlayCollection.filter(({ element }) => document.contains(element.el)) - document.querySelectorAll('[data-overlay]:not(.--prevent-on-load-init)').forEach((el: HTMLElement) => { + document.querySelectorAll('.overlay:not(.--prevent-on-load-init)').forEach((el: HTMLElement) => { if (!window.$hsOverlayCollection.find(elC => (elC?.element?.el as HTMLElement) === el)) new HSOverlay(el) }) } - static open(target: HTMLElement) { - const elInCollection = window.$hsOverlayCollection.find( - el => - el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) || - el.element.overlay === (typeof target === 'string' ? document.querySelector(target) : target) - ) + static open(target: HSOverlay | HTMLElement | string) { + const instance = HSOverlay.findInCollection(target) - if (elInCollection && elInCollection.element.overlay.classList.contains(elInCollection.element.hiddenClass)) - elInCollection.element.open() + if (instance && instance.element.el.classList.contains(instance.element.hiddenClass)) instance.element.open() } - static close(target: HTMLElement) { - const elInCollection = window.$hsOverlayCollection.find( - el => - el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) || - el.element.overlay === (typeof target === 'string' ? document.querySelector(target) : target) - ) + static close(target: HSOverlay | HTMLElement | string) { + const instance = HSOverlay.findInCollection(target) - if (elInCollection && !elInCollection.element.overlay.classList.contains(elInCollection.element.hiddenClass)) - elInCollection.element.close() + if (instance && !instance.element.el.classList.contains(instance.element.hiddenClass)) instance.element.close() } static setOpened(breakpoint: number, el: ICollectionItem) { if (document.body.clientWidth >= breakpoint) { document.body.classList.add('overlay-body-open') - el.element.overlay.classList.add('opened') + el.element.open() } else el.element.close(true) } // Accessibility methods static accessibility(evt: KeyboardEvent) { - const targets = window.$hsOverlayCollection.filter(el => el.element.overlay.classList.contains('open')) + const targets = window.$hsOverlayCollection.filter(el => el.element.el.classList.contains('open')) const target = targets[targets.length - 1] - const focusableElements = target?.element?.overlay?.querySelectorAll( + const focusableElements = target?.element?.el?.querySelectorAll( 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])' ) const notHiddenFocusableElements: HTMLElement[] = [] @@ -445,7 +478,7 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { } static onTab(target: ICollectionItem) { - const overlayElement = target.element.overlay + const overlayElement = target.element.el const focusableElements = Array.from( overlayElement.querySelectorAll( 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])' @@ -478,14 +511,10 @@ class HSOverlay extends HSBasePlugin<{}> implements IOverlay { } // Backward compatibility - static on(evt: string, target: HTMLElement, cb: Function) { - const elInCollection = window.$hsOverlayCollection.find( - el => - el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) || - el.element.overlay === (typeof target === 'string' ? document.querySelector(target) : target) - ) + static on(evt: string, target: HSOverlay | HTMLElement | string, cb: Function) { + const instance = HSOverlay.findInCollection(target) - if (elInCollection) elInCollection.element.events[evt] = cb + if (instance) instance.element.events[evt] = cb } } @@ -524,7 +553,7 @@ const moveOverlayToBodyResizeFn = () => { const resolution = overlay.element.moveOverlayToBody const initPlace = overlay.element.initContainer const newPlace = document.querySelector('body') - const target = overlay.element.overlay + const target = overlay.element.el if (!initPlace && target) return false @@ -554,19 +583,22 @@ const setOpenedResizeFn = () => { const setBackdropZIndexResizeFn = () => { if ( !window.$hsOverlayCollection.length || - !window.$hsOverlayCollection.find(el => el.element.overlay.classList.contains('opened')) + !window.$hsOverlayCollection.find(el => el.element.el.classList.contains('opened')) ) return false - const overlays = window.$hsOverlayCollection.filter(el => el.element.overlay.classList.contains('opened')) + const overlays = window.$hsOverlayCollection.filter(el => el.element.el.classList.contains('opened')) overlays.forEach(overlay => { - const overlayZIndex = parseInt(window.getComputedStyle(overlay.element.overlay).getPropertyValue('z-index')) - const backdrop: HTMLElement = document.querySelector(`#${overlay.element.overlay.id}-backdrop`) + const overlayZIndex = parseInt(window.getComputedStyle(overlay.element.el).getPropertyValue('z-index')) + const backdrop: HTMLElement = document.querySelector(`#${overlay.element.el.id}-backdrop`) + if (!backdrop) return false + const backdropZIndex = parseInt(window.getComputedStyle(backdrop).getPropertyValue('z-index')) if (overlayZIndex === backdropZIndex + 1) return false if ('style' in backdrop) backdrop.style.zIndex = `${overlayZIndex - 1}` + document.body.classList.add('overlay-body-open') }) } diff --git a/src/js/plugins/pin-input/index.ts b/src/js/plugins/pin-input/index.ts index 2604ddf..c092853 100644 --- a/src/js/plugins/pin-input/index.ts +++ b/src/js/plugins/pin-input/index.ts @@ -1,6 +1,6 @@ /* * HSPinInput - * @version: 2.6.0 + * @version: 2.7.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/src/js/plugins/range-slider/index.ts b/src/js/plugins/range-slider/index.ts index 1a77d0f..bfe0a91 100644 --- a/src/js/plugins/range-slider/index.ts +++ b/src/js/plugins/range-slider/index.ts @@ -1,6 +1,6 @@ /* * HSRangeSlider - * @version: 2.6.0 + * @version: 2.7.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,10 +8,10 @@ import type { cssClasses, target } from 'nouislider' -import { IRangeSliderCssClassesObject, IRangeSlider, IRangeSliderOptions } from './interfaces' +import { IRangeSlider, IRangeSliderCssClassesObject, IRangeSliderOptions } from './interfaces' -import HSBasePlugin from '../base-plugin' import { ICollectionItem } from '../../interfaces' +import HSBasePlugin from '../base-plugin' class HSRangeSlider extends HSBasePlugin implements IRangeSlider { private readonly concatOptions: IRangeSliderOptions diff --git a/src/js/plugins/remove-element/index.ts b/src/js/plugins/remove-element/index.ts index bb4b996..ed402c3 100644 --- a/src/js/plugins/remove-element/index.ts +++ b/src/js/plugins/remove-element/index.ts @@ -1,6 +1,6 @@ /* * HSRemoveElement - * @version: 2.6.0 + * @version: 2.7.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,10 +8,10 @@ import { afterTransition } from '../../utils' -import { IRemoveElementOptions, IRemoveElement } from './interfaces' +import { IRemoveElement, IRemoveElementOptions } from '../remove-element/interfaces' -import HSBasePlugin from '../base-plugin' import { ICollectionItem } from '../../interfaces' +import HSBasePlugin from '../base-plugin' class HSRemoveElement extends HSBasePlugin implements IRemoveElement { private readonly removeTargetId: string | null @@ -71,9 +71,11 @@ class HSRemoveElement extends HSBasePlugin implements IRe } // Static method - static getInstance(target: HTMLElement, isInstance = false) { + static getInstance(target: HTMLElement, isInstance?: boolean) { const elInCollection = window.$hsRemoveElementCollection.find( - el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) + el => + el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) || + el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) ) return elInCollection ? (isInstance ? elInCollection : elInCollection.element.el) : null diff --git a/src/js/plugins/scrollspy/index.ts b/src/js/plugins/scrollspy/index.ts index e63bef0..acc4eef 100644 --- a/src/js/plugins/scrollspy/index.ts +++ b/src/js/plugins/scrollspy/index.ts @@ -1,6 +1,6 @@ /* * HSScrollspy - * @version: 2.6.0 + * @version: 2.7.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/src/js/plugins/select/index.ts b/src/js/plugins/select/index.ts index eec469e..1fd1511 100644 --- a/src/js/plugins/select/index.ts +++ b/src/js/plugins/select/index.ts @@ -6,16 +6,15 @@ * Copyright 2024 Preline Labs Ltd. */ -import { isEnoughSpace, debounce, dispatch, afterTransition, htmlToElement, classToClassList } from '../../utils' +import { afterTransition, classToClassList, debounce, dispatch, htmlToElement, isEnoughSpace } from '../../utils' -import { ISelect, ISelectOptions, ISingleOption, ISingleOptionOptions, IApiFieldMap } from './interfaces' +import { IApiFieldMap, ISelect, ISelectOptions, ISingleOption, ISingleOptionOptions } from './interfaces' import { createPopper } from '@popperjs/core' - -import HSBasePlugin from '../base-plugin' import { ICollectionItem } from '../../interfaces' +import HSBasePlugin from '../base-plugin' -import { SELECT_ACCESSIBILITY_KEY_SET, POSITIONS } from '../../constants' +import { POSITIONS, SELECT_ACCESSIBILITY_KEY_SET } from '../../constants' class HSSelect extends HSBasePlugin implements ISelect { value: string | string[] | null @@ -74,6 +73,7 @@ class HSSelect extends HSBasePlugin implements ISelect { private readonly searchNoResultTemplate: string | null private readonly searchNoResultText: string | null private readonly searchNoResultClasses: string | null + private readonly optionAllowEmptyOption: boolean private readonly optionTag: string | null private readonly optionTemplate: string | null private readonly optionClasses: string | null @@ -176,6 +176,8 @@ class HSSelect extends HSBasePlugin implements ISelect { this.searchNoResultTemplate = concatOptions?.searchNoResultTemplate || '' this.searchNoResultText = concatOptions?.searchNoResultText || 'No results found' this.searchNoResultClasses = concatOptions?.searchNoResultClasses || 'block advance-select-option' + this.optionAllowEmptyOption = + typeof concatOptions?.optionAllowEmptyOption !== 'undefined' ? concatOptions?.optionAllowEmptyOption : false this.optionTemplate = concatOptions?.optionTemplate || null this.optionTag = concatOptions?.optionTag || null this.optionClasses = concatOptions?.optionClasses || null @@ -242,21 +244,33 @@ class HSSelect extends HSBasePlugin implements ISelect { public setValue(val: string | string[]) { this.value = val - this.clearSelections() if (Array.isArray(val)) { - this.toggleTextWrapper.innerHTML = this.value.length ? this.stringFromValue() : this.placeholder - this.unselectMultipleItems() - this.selectMultipleItems() + if (this.mode === 'tags') { + this.unselectMultipleItems() + this.selectMultipleItems() + + this.selectedItems = [] + + const existingTags = this.wrapper.querySelectorAll('[data-tag-value]') + existingTags.forEach(tag => tag.remove()) + + this.setTagsItems() + this.reassignTagsInputPlaceholder(this.value.length ? '' : this.placeholder) + } else { + this.toggleTextWrapper.innerHTML = this.value.length ? this.stringFromValue() : this.placeholder + this.unselectMultipleItems() + this.selectMultipleItems() + } } else { this.setToggleTitle() - if (this.toggle.querySelector('[data-icon]')) this.setToggleIcon() if (this.toggle.querySelector('[data-title]')) this.setToggleTitle() - this.selectSingleItem() } + + this.triggerChangeEventForNativeSelect() } private init() { @@ -270,7 +284,10 @@ class HSSelect extends HSBasePlugin implements ISelect { if (this.el.children) { Array.from(this.el.children) - .filter((el: HTMLOptionElement) => el.value && el.value !== '') + .filter( + (el: HTMLOptionElement) => + this.optionAllowEmptyOption || (!this.optionAllowEmptyOption && el.value && el.value !== '') + ) .forEach((el: HTMLOptionElement) => { const data = el.getAttribute('data-select-option') @@ -572,6 +589,7 @@ class HSSelect extends HSBasePlugin implements ISelect { if (this.dropdownScope === 'window') this.buildPopper() } + // This function has been updated. private buildPopper() { if (typeof createPopper !== 'undefined') { document.body.appendChild(this.dropdown) diff --git a/src/js/plugins/select/interfaces.ts b/src/js/plugins/select/interfaces.ts index 4b7cc55..8a287c4 100644 --- a/src/js/plugins/select/interfaces.ts +++ b/src/js/plugins/select/interfaces.ts @@ -81,6 +81,7 @@ export interface ISelectOptions { searchNoResultText?: string | null searchNoResultClasses?: string | null + optionAllowEmptyOption?: boolean optionTemplate?: string optionTag?: string optionClasses?: string diff --git a/src/js/plugins/stepper/index.ts b/src/js/plugins/stepper/index.ts index c69055d..d58fbff 100644 --- a/src/js/plugins/stepper/index.ts +++ b/src/js/plugins/stepper/index.ts @@ -8,10 +8,10 @@ import { dispatch } from '../../utils' -import { IStepperOptions, IStepper, IStepperItem } from './interfaces' +import { IStepper, IStepperItem, IStepperOptions } from './interfaces' -import HSBasePlugin from '../base-plugin' import { ICollectionItem } from '../../interfaces' +import HSBasePlugin from '../base-plugin' class HSStepper extends HSBasePlugin<{}> implements IStepper { private currentIndex: number | null diff --git a/src/js/plugins/strong-password/index.ts b/src/js/plugins/strong-password/index.ts index 8015a7f..abe7a29 100644 --- a/src/js/plugins/strong-password/index.ts +++ b/src/js/plugins/strong-password/index.ts @@ -1,6 +1,6 @@ /* * HSStrongPassword - * @version: 2.6.0 + * @version: 2.7.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/src/js/plugins/tabs/index.ts b/src/js/plugins/tabs/index.ts index 6b1e4af..c24b7ac 100644 --- a/src/js/plugins/tabs/index.ts +++ b/src/js/plugins/tabs/index.ts @@ -1,17 +1,17 @@ /* * HSTabs - * @version: 2.6.0 + * @version: 2.7.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, isIOS, isIpadOS } from '../../utils' +import { dispatch } from '../../utils' -import { ITabs } from './interfaces' +import { ITabs, ITabsOnChangePayload } from './interfaces' -import HSBasePlugin from '../base-plugin' import { ICollectionItem } from '../../interfaces' +import HSBasePlugin from '../base-plugin' import { TABS_ACCESSIBILITY_KEY_SET } from '../../constants' @@ -104,12 +104,12 @@ class HSTabs extends HSBasePlugin<{}> implements ITabs { el, prev: this.prevContentId, current: this.currentContentId - }) + } as ITabsOnChangePayload) dispatch('change.tab', el, { el, prev: this.prevContentId, current: this.currentContentId - }) + } as ITabsOnChangePayload) } private change(evt: Event) { diff --git a/src/js/plugins/tabs/interfaces.ts b/src/js/plugins/tabs/interfaces.ts index b0a7901..0d4d12f 100644 --- a/src/js/plugins/tabs/interfaces.ts +++ b/src/js/plugins/tabs/interfaces.ts @@ -1,3 +1,9 @@ +export interface ITabsOnChangePayload { + el: HTMLElement + prev: string + current: string +} + export interface ITabs { options?: {} diff --git a/src/js/plugins/toggle-count/index.ts b/src/js/plugins/toggle-count/index.ts index f9730c1..445b112 100644 --- a/src/js/plugins/toggle-count/index.ts +++ b/src/js/plugins/toggle-count/index.ts @@ -1,6 +1,6 @@ /* * HSToggleCount - * @version: 2.6.0 + * @version: 2.7.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/src/js/plugins/toggle-password/index.ts b/src/js/plugins/toggle-password/index.ts index d3e155f..6941b60 100644 --- a/src/js/plugins/toggle-password/index.ts +++ b/src/js/plugins/toggle-password/index.ts @@ -1,6 +1,6 @@ /* * HSTogglePassword - * @version: 2.6.0 + * @version: 2.7.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/src/js/plugins/tooltip/index.ts b/src/js/plugins/tooltip/index.ts index bf38b13..5ce5b4b 100644 --- a/src/js/plugins/tooltip/index.ts +++ b/src/js/plugins/tooltip/index.ts @@ -1,19 +1,19 @@ /* * HSTooltip - * @version: 2.6.0 + * @version: 2.7.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 { createPopper, PositioningStrategy, Instance } from '@popperjs/core' -import { getClassProperty, dispatch, afterTransition } from '../../utils' +import { createPopper, Instance, PositioningStrategy } from '@popperjs/core' +import { afterTransition, dispatch, getClassProperty } from '../../utils' import { ITooltip } from './interfaces' import { TTooltipOptionsScope } from './types' -import HSBasePlugin from '../base-plugin' import { ICollectionItem } from '../../interfaces' +import HSBasePlugin from '../base-plugin' import { POSITIONS } from '../../constants' @@ -103,7 +103,7 @@ class HSTooltip extends HSBasePlugin<{}> implements ITooltip { private leave() { this.hide() } - // This function is updated it closes tooltip if open to the tooltip + // This function is updated. private click() { if (this.el.classList.contains('show')) { this.hide() @@ -260,6 +260,16 @@ class HSTooltip extends HSBasePlugin<{}> implements ITooltip { } // Static methods + private static findInCollection(target: HSTooltip | HTMLElement | string): ICollectionItem | null { + return ( + window.$hsTooltipCollection.find(el => { + if (target instanceof HSTooltip) return el.element.el === target.el + else if (typeof target === 'string') return el.element.el === document.querySelector(target) + else return el.element.el === target + }) || null + ) + } + static getInstance(target: HTMLElement | string, isInstance = false) { const elInCollection = window.$hsTooltipCollection.find( el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) @@ -274,34 +284,28 @@ class HSTooltip extends HSBasePlugin<{}> implements ITooltip { if (window.$hsTooltipCollection) window.$hsTooltipCollection = window.$hsTooltipCollection.filter(({ element }) => document.contains(element.el)) - document.querySelectorAll('.tooltip').forEach((el: HTMLElement) => { + document.querySelectorAll('.tooltip:not(.--prevent-on-load-init)').forEach((el: HTMLElement) => { if (!window.$hsTooltipCollection.find(elC => (elC?.element?.el as HTMLElement) === el)) new HSTooltip(el) }) } - static show(target: HTMLElement) { - const elInCollection = window.$hsTooltipCollection.find( - el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) - ) + static show(target: HSTooltip | HTMLElement | string) { + const instance = HSTooltip.findInCollection(target) - if (elInCollection) elInCollection.element.show() + if (instance) instance.element.show() } - static hide(target: HTMLElement) { - const elInCollection = window.$hsTooltipCollection.find( - el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) - ) + static hide(target: HSTooltip | HTMLElement | string) { + const instance = HSTooltip.findInCollection(target) - if (elInCollection) elInCollection.element.hide() + if (instance) instance.element.hide() } // Backward compatibility - static on(evt: string, target: HTMLElement, cb: Function) { - const elInCollection = window.$hsTooltipCollection.find( - el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) - ) + static on(evt: string, target: HSTooltip | HTMLElement | string, cb: Function) { + const instance = HSTooltip.findInCollection(target) - if (elInCollection) elInCollection.element.events[evt] = cb + if (instance) instance.element.events[evt] = cb } } diff --git a/src/js/plugins/tree-view/index.ts b/src/js/plugins/tree-view/index.ts index 928cb0a..3ef3dbe 100644 --- a/src/js/plugins/tree-view/index.ts +++ b/src/js/plugins/tree-view/index.ts @@ -1,6 +1,6 @@ /* * HSTreeView - * @version: 2.6.0 + * @version: 2.7.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,10 +8,10 @@ import { dispatch } from '../../utils' -import { ITreeViewOptions, ITreeView, ITreeViewItem, ITreeViewOptionsControlBy } from './interfaces' +import { ITreeView, ITreeViewItem, ITreeViewOptions, ITreeViewOptionsControlBy } from './interfaces' -import HSBasePlugin from '../base-plugin' import { ICollectionItem } from '../../interfaces' +import HSBasePlugin from '../base-plugin' class HSTreeView extends HSBasePlugin implements ITreeView { private items: ITreeViewItem[] = [] @@ -278,6 +278,16 @@ class HSTreeView extends HSBasePlugin implements ITreeView { } // Static methods + private static findInCollection(target: HSTreeView | HTMLElement | string): ICollectionItem | null { + return ( + window.$hsTreeViewCollection.find(el => { + if (target instanceof HSTreeView) return el.element.el === target.el + else if (typeof target === 'string') return el.element.el === document.querySelector(target) + else return el.element.el === target + }) || null + ) + } + static getInstance(target: HTMLElement | string, isInstance?: boolean) { const elInCollection = window.$hsTreeViewCollection.find( el => el.element.el === (typeof target === 'string' ? document.querySelector(target) : target) @@ -298,12 +308,12 @@ class HSTreeView extends HSBasePlugin implements ITreeView { } // 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) - ) + static on(evt: string, target: HSTreeView | HTMLElement | string, cb: Function) { + const instance = HSTreeView.findInCollection(target) + + console.log(1) - if (elInCollection) elInCollection.element.events[evt] = cb + if (instance) instance.element.events[evt] = cb } } diff --git a/src/js/spa/index.ts b/src/js/spa/index.ts index 171170c..e329fb5 100644 --- a/src/js/spa/index.ts +++ b/src/js/spa/index.ts @@ -1,5 +1,5 @@ /* - * @version: 2.6.0 + * @version: 2.7.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/src/js/static/index.ts b/src/js/static/index.ts index d1cd7b4..c2bbb5c 100644 --- a/src/js/static/index.ts +++ b/src/js/static/index.ts @@ -1,20 +1,17 @@ /* * HSStaticMethods - * @version: 2.6.0 + * @version: 2.7.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/index' -import { IStaticMethods } from '../static/interfaces' import { ICollectionItem } from '../interfaces' -import type HSCopyMarkup from '../plugins/copy-markup' import type HSAccordion from '../plugins/accordion' import type HSCarousel from '../plugins/carousel' import type HSCollapse from '../plugins/collapse' import type HSComboBox from '../plugins/combobox' +import type HSCopyMarkup from '../plugins/copy-markup' import type HSDataTable from '../plugins/datatable' import type HSDropdown from '../plugins/dropdown' import type HSFileUpload from '../plugins/file-upload' @@ -32,6 +29,9 @@ 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' +import { COLLECTIONS } from '../spa/index' +import { IStaticMethods } from '../static/interfaces' +import { afterTransition, getClassProperty } from '../utils' declare global { interface Window { diff --git a/src/js/utils/index.ts b/src/js/utils/index.ts index 86091d7..6a50d2e 100644 --- a/src/js/utils/index.ts +++ b/src/js/utils/index.ts @@ -1,5 +1,5 @@ /* - * @version: 2.6.0 + * @version: 2.7.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/src/utilities/styled/card.css b/src/utilities/styled/card.css index 9838ad5..288348d 100644 --- a/src/utilities/styled/card.css +++ b/src/utilities/styled/card.css @@ -1,17 +1,22 @@ -.card-compact { - .card-header { - @apply p-4; - & + .card-body { - padding-top: 0; - } - } - .card-footer { - @apply p-4 pt-0; - } - .card-body { - @apply p-4; - } - .card-title { - @apply mb-1; - } + +:where(.card-compact ) .card-header { + @apply p-4; +} +:where(.card-compact ) .card-footer { + @apply p-4; +} +:where(.card-compact ) .card-body { + @apply p-4; +} +:where(.card-compact ) .card-title { + @apply mb-1; +} + + +:where(.card-compact:has(>.card-header)) > .card-body { +@apply pt-0; +} + +:where(.card-compact:has(>.card-body)) > .card-footer { +@apply pt-0; } diff --git a/src/vendors/styled/apexcharts.css b/src/vendors/styled/apexcharts.css index 112c788..a56af79 100644 --- a/src/vendors/styled/apexcharts.css +++ b/src/vendors/styled/apexcharts.css @@ -16,5 +16,5 @@ } .apexcharts-tooltip-title { - @apply !bg-base-100 !border-base-content/40 text-base-content/90 rounded-t-lg !px-2.5 !text-sm !font-semibold; + @apply !bg-base-100 !border-base-content/40 text-base-content rounded-t-lg !px-2.5 !text-sm !font-semibold; } diff --git a/src/vendors/styled/editor.css b/src/vendors/styled/editor.css index c3c7163..838a98f 100644 --- a/src/vendors/styled/editor.css +++ b/src/vendors/styled/editor.css @@ -18,7 +18,7 @@ /* Search field styling */ .cdx-search-field { - @apply rounded-box bg-base-200/40 text-base-content/90 border-base-content/20; + @apply rounded-box bg-base-200/40 text-base-content border-base-content/20; } /* Popover and conversion tool item styling */ @@ -26,7 +26,7 @@ .ce-conversion-tool, .tc-toolbox__toggler, .tc-toolbox__toggler:hover { - @apply !text-base-content/90; + @apply !text-base-content; } /* Secondary title and label styling */ @@ -56,7 +56,7 @@ /* Conversion toolbar label styling */ .ce-conversion-toolbar__label { - @apply text-base-content/90 font-medium; + @apply text-base-content font-medium; } /* Inline toolbar dropdown styling */ @@ -132,7 +132,7 @@ .tc-add-column, .tc-add-row { - @apply !text-base-content/90; + @apply !text-base-content; } .tc-cell, diff --git a/src/vendors/styled/flatpickr.css b/src/vendors/styled/flatpickr.css index 645fab2..45169f3 100644 --- a/src/vendors/styled/flatpickr.css +++ b/src/vendors/styled/flatpickr.css @@ -15,7 +15,7 @@ /* Calendar header */ .flatpickr-current-month { - @apply text-base-content/90 absolute start-4 flex w-auto items-center justify-center gap-1 pt-0 text-base font-medium rtl:end-4 rtl:start-auto; + @apply text-base-content absolute start-4 flex w-auto items-center justify-center gap-1 pt-0 text-base font-medium rtl:end-4 rtl:start-auto; .flatpickr-monthDropdown-months, input.cur-year { @@ -58,9 +58,9 @@ } .flatpickr-prev-month, .flatpickr-next-month { - @apply bg-neutral/10 hover:fill-base-content/90 text-base-content/90 absolute top-4 flex size-7 items-center justify-center rounded-full p-0 no-underline rtl:rotate-180; + @apply bg-neutral/10 hover:fill-base-content/90 text-base-content absolute top-4 flex size-7 items-center justify-center rounded-full p-0 no-underline rtl:rotate-180; svg { - @apply fill-base-content/90 text-base-content/90 size-3 align-middle; + @apply fill-base-content/90 text-base-content size-3 align-middle; } } .flatpickr-prev-month:hover svg, @@ -95,7 +95,7 @@ span.flatpickr-weekday, .flatpickr-weekwrapper .flatpickr-weekday { - @apply text-base-content/90 m-0 block cursor-default text-center text-sm font-medium; + @apply text-base-content m-0 block cursor-default text-center text-sm font-medium; } /* Dates */ @@ -113,7 +113,7 @@ span.flatpickr-weekday, } .flatpickr-day { - @apply text-base-content/90 size-9.5 max-w-9.5 relative m-0 flex cursor-pointer items-center justify-center text-center text-base; + @apply text-base-content size-9.5 max-w-9.5 relative m-0 flex cursor-pointer items-center justify-center text-center text-base; &.today:not(.selected) { @apply bg-primary/20 text-primary border-transparent; @@ -225,7 +225,7 @@ span.flatpickr-weekday, .flatpickr-weekwrapper { & span.flatpickr-day, & span.flatpickr-day:hover { - @apply text-base-content/90 size-9.5 max-w-9.5 m-0 flex cursor-pointer items-center justify-center text-center text-base [&:not(:last-child)]:mb-0.5; + @apply text-base-content size-9.5 max-w-9.5 m-0 flex cursor-pointer items-center justify-center text-center text-base [&:not(:last-child)]:mb-0.5; } & .flatpickr-weeks { @@ -279,13 +279,13 @@ span.flatpickr-weekday, } .flatpickr-time input.flatpickr-hour { - @apply rounded-btn border-base-content/10 text-base-content/90 h-auto border border-solid text-base font-normal leading-[inherit]; + @apply rounded-btn border-base-content/10 text-base-content h-auto border border-solid text-base font-normal leading-[inherit]; } .flatpickr-time input.flatpickr-minute { - @apply rounded-btn border-base-content/10 text-base-content/90 h-auto border border-solid text-base leading-[inherit]; + @apply rounded-btn border-base-content/10 text-base-content h-auto border border-solid text-base leading-[inherit]; } .flatpickr-time .flatpickr-am-pm { - @apply rounded-btn border-base-content/10 text-base-content/90 flex items-center justify-center border text-base leading-[inherit]; + @apply rounded-btn border-base-content/10 text-base-content flex items-center justify-center border text-base leading-[inherit]; } .numInputWrapper:hover, diff --git a/src/vendors/styled/fullcalendar.css b/src/vendors/styled/fullcalendar.css index 7ecdeba..2dce495 100644 --- a/src/vendors/styled/fullcalendar.css +++ b/src/vendors/styled/fullcalendar.css @@ -64,7 +64,7 @@ .fc-toolbar .fc-prev-button, .fc-toolbar .fc-next-button { - @apply !text-base-content/80 hover:!text-base-content/90 bg-transparent px-2 py-0 hover:bg-transparent; + @apply !text-base-content/80 hover:!text-base-content bg-transparent px-2 py-0 hover:bg-transparent; .fc-icon { @apply -mt-0.5 hover:scale-110;