@preline/non-auto 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +9 -0
- package/index.js +65 -63
- package/index.mjs +55 -55
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,212 +1,214 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i=t();for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(self,()=>(()=>{var e={949(e,t,i){"use strict";i.r(t),i.d(t,{arrow:()=>Me,autoPlacement:()=>Le,autoUpdate:()=>Se,computePosition:()=>Pe,detectOverflow:()=>xe,flip:()=>ke,getOverflowAncestors:()=>ne,hide:()=>Ae,inline:()=>Oe,limitShift:()=>De,offset:()=>Te,platform:()=>we,shift:()=>Ee,size:()=>Ie});const s=["top","right","bottom","left"],n=["start","end"],o=s.reduce((e,t)=>e.concat(t,t+"-"+n[0],t+"-"+n[1]),[]),l=Math.min,r=Math.max,a=Math.round,c=Math.floor,d=e=>({x:e,y:e}),h={left:"right",right:"left",bottom:"top",top:"bottom"};function u(e,t,i){return r(e,l(t,i))}function p(e,t){return"function"==typeof e?e(t):e}function m(e){return e.split("-")[0]}function g(e){return e.split("-")[1]}function v(e){return"x"===e?"y":"x"}function f(e){return"y"===e?"height":"width"}function y(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function b(e){return v(y(e))}function w(e,t,i){void 0===i&&(i=!1);const s=g(e),n=b(e),o=f(n);let l="x"===n?s===(i?"end":"start")?"right":"left":"start"===s?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=k(l)),[l,k(l)]}function C(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const S=["left","right"],x=["right","left"],T=["top","bottom"],L=["bottom","top"];function E(e,t,i,s){const n=g(e);let o=function(e,t,i){switch(e){case"top":case"bottom":return i?t?x:S:t?S:x;case"left":case"right":return t?T:L;default:return[]}}(m(e),"start"===i,s);return n&&(o=o.map(e=>e+"-"+n),t&&(o=o.concat(o.map(C)))),o}function k(e){const t=m(e);return h[t]+e.slice(t.length)}function I(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function A(e){const{x:t,y:i,width:s,height:n}=e;return{width:s,height:n,top:i,left:t,right:t+s,bottom:i+n,x:t,y:i}}function M(e,t,i){let{reference:s,floating:n}=e;const o=y(t),l=b(t),r=f(l),a=m(t),c="y"===o,d=s.x+s.width/2-n.width/2,h=s.y+s.height/2-n.height/2,u=s[r]/2-n[r]/2;let p;switch(a){case"top":p={x:d,y:s.y-n.height};break;case"bottom":p={x:d,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:h};break;case"left":p={x:s.x-n.width,y:h};break;default:p={x:s.x,y:s.y}}switch(g(t)){case"start":p[l]-=u*(i&&c?-1:1);break;case"end":p[l]+=u*(i&&c?-1:1)}return p}async function O(e,t){var i;void 0===t&&(t={});const{x:s,y:n,platform:o,rects:l,elements:r,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:u=!1,padding:m=0}=p(t,e),g=I(m),v=r[u?"floating"===h?"reference":"floating":h],f=A(await o.getClippingRect({element:null==(i=await(null==o.isElement?void 0:o.isElement(v)))||i?v:v.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(r.floating)),boundary:c,rootBoundary:d,strategy:a})),y="floating"===h?{x:s,y:n,width:l.floating.width,height:l.floating.height}:l.reference,b=await(null==o.getOffsetParent?void 0:o.getOffsetParent(r.floating)),w=await(null==o.isElement?void 0:o.isElement(b))&&await(null==o.getScale?void 0:o.getScale(b))||{x:1,y:1},C=A(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:r,rect:y,offsetParent:b,strategy:a}):y);return{top:(f.top-C.top+g.top)/w.y,bottom:(C.bottom-f.bottom+g.bottom)/w.y,left:(f.left-C.left+g.left)/w.x,right:(C.right-f.right+g.right)/w.x}}function D(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function P(e){return s.some(t=>e[t]>=0)}function $(e){const t=l(...e.map(e=>e.left)),i=l(...e.map(e=>e.top));return{x:t,y:i,width:r(...e.map(e=>e.right))-t,height:r(...e.map(e=>e.bottom))-i}}const N=new Set(["left","top"]);function H(){return"undefined"!=typeof window}function B(e){return _(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function F(e){var t;return null==(t=(_(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function _(e){return!!H()&&(e instanceof Node||e instanceof q(e).Node)}function R(e){return!!H()&&(e instanceof Element||e instanceof q(e).Element)}function V(e){return!!H()&&(e instanceof HTMLElement||e instanceof q(e).HTMLElement)}function j(e){return!(!H()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof q(e).ShadowRoot)}function z(e){const{overflow:t,overflowX:i,overflowY:s,display:n}=ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+i)&&"inline"!==n&&"contents"!==n}function W(e){return/^(table|td|th)$/.test(B(e))}function U(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const Y=/transform|translate|scale|rotate|perspective|filter/,K=/paint|layout|strict|content/,Q=e=>!!e&&"none"!==e;let J;function Z(e){const t=R(e)?ee(e):e;return Q(t.transform)||Q(t.translate)||Q(t.scale)||Q(t.rotate)||Q(t.perspective)||!G()&&(Q(t.backdropFilter)||Q(t.filter))||Y.test(t.willChange||"")||K.test(t.contain||"")}function G(){return null==J&&(J="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),J}function X(e){return/^(html|body|#document)$/.test(B(e))}function ee(e){return q(e).getComputedStyle(e)}function te(e){return R(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ie(e){if("html"===B(e))return e;const t=e.assignedSlot||e.parentNode||j(e)&&e.host||F(e);return j(t)?t.host:t}function se(e){const t=ie(e);return X(t)?e.ownerDocument?e.ownerDocument.body:e.body:V(t)&&z(t)?t:se(t)}function ne(e,t,i){var s;void 0===t&&(t=[]),void 0===i&&(i=!0);const n=se(e),o=n===(null==(s=e.ownerDocument)?void 0:s.body),l=q(n);if(o){const e=oe(l);return t.concat(l,l.visualViewport||[],z(n)?n:[],e&&i?ne(e):[])}return t.concat(n,ne(n,[],i))}function oe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function le(e){const t=ee(e);let i=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const n=V(e),o=n?e.offsetWidth:i,l=n?e.offsetHeight:s,r=a(i)!==o||a(s)!==l;return r&&(i=o,s=l),{width:i,height:s,$:r}}function re(e){return R(e)?e:e.contextElement}function ae(e){const t=re(e);if(!V(t))return d(1);const i=t.getBoundingClientRect(),{width:s,height:n,$:o}=le(t);let l=(o?a(i.width):i.width)/s,r=(o?a(i.height):i.height)/n;return l&&Number.isFinite(l)||(l=1),r&&Number.isFinite(r)||(r=1),{x:l,y:r}}const ce=d(0);function de(e){const t=q(e);return G()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ce}function he(e,t,i,s){void 0===t&&(t=!1),void 0===i&&(i=!1);const n=e.getBoundingClientRect(),o=re(e);let l=d(1);t&&(s?R(s)&&(l=ae(s)):l=ae(e));const r=function(e,t,i){return void 0===t&&(t=!1),!(!i||t&&i!==q(e))&&t}(o,i,s)?de(o):d(0);let a=(n.left+r.x)/l.x,c=(n.top+r.y)/l.y,h=n.width/l.x,u=n.height/l.y;if(o){const e=q(o),t=s&&R(s)?q(s):s;let i=e,n=oe(i);for(;n&&s&&t!==i;){const e=ae(n),t=n.getBoundingClientRect(),s=ee(n),o=t.left+(n.clientLeft+parseFloat(s.paddingLeft))*e.x,l=t.top+(n.clientTop+parseFloat(s.paddingTop))*e.y;a*=e.x,c*=e.y,h*=e.x,u*=e.y,a+=o,c+=l,i=q(n),n=oe(i)}}return A({width:h,height:u,x:a,y:c})}function ue(e,t){const i=te(e).scrollLeft;return t?t.left+i:he(F(e)).left+i}function pe(e,t){const i=e.getBoundingClientRect();return{x:i.left+t.scrollLeft-ue(e,i),y:i.top+t.scrollTop}}function me(e,t,i){let s;if("viewport"===t)s=function(e,t){const i=q(e),s=F(e),n=i.visualViewport;let o=s.clientWidth,l=s.clientHeight,r=0,a=0;if(n){o=n.width,l=n.height;const e=G();(!e||e&&"fixed"===t)&&(r=n.offsetLeft,a=n.offsetTop)}const c=ue(s);if(c<=0){const e=s.ownerDocument,t=e.body,i=getComputedStyle(t),n="CSS1Compat"===e.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,l=Math.abs(s.clientWidth-t.clientWidth-n);l<=25&&(o-=l)}else c<=25&&(o+=c);return{width:o,height:l,x:r,y:a}}(e,i);else if("document"===t)s=function(e){const t=F(e),i=te(e),s=e.ownerDocument.body,n=r(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),o=r(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let l=-i.scrollLeft+ue(e);const a=-i.scrollTop;return"rtl"===ee(s).direction&&(l+=r(t.clientWidth,s.clientWidth)-n),{width:n,height:o,x:l,y:a}}(F(e));else if(R(t))s=function(e,t){const i=he(e,!0,"fixed"===t),s=i.top+e.clientTop,n=i.left+e.clientLeft,o=V(e)?ae(e):d(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:n*o.x,y:s*o.y}}(t,i);else{const i=de(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return A(s)}function ge(e,t){const i=ie(e);return!(i===t||!R(i)||X(i))&&("fixed"===ee(i).position||ge(i,t))}function ve(e,t,i){const s=V(t),n=F(t),o="fixed"===i,l=he(e,!0,o,t);let r={scrollLeft:0,scrollTop:0};const a=d(0);function c(){a.x=ue(n)}if(s||!s&&!o)if(("body"!==B(t)||z(n))&&(r=te(t)),s){const e=he(t,!0,o,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else n&&c();o&&!s&&n&&c();const h=!n||s||o?d(0):pe(n,r);return{x:l.left+r.scrollLeft-a.x-h.x,y:l.top+r.scrollTop-a.y-h.y,width:l.width,height:l.height}}function fe(e){return"static"===ee(e).position}function ye(e,t){if(!V(e)||"fixed"===ee(e).position)return null;if(t)return t(e);let i=e.offsetParent;return F(e)===i&&(i=i.ownerDocument.body),i}function be(e,t){const i=q(e);if(U(e))return i;if(!V(e)){let t=ie(e);for(;t&&!X(t);){if(R(t)&&!fe(t))return t;t=ie(t)}return i}let s=ye(e,t);for(;s&&W(s)&&fe(s);)s=ye(s,t);return s&&X(s)&&fe(s)&&!Z(s)?i:s||function(e){let t=ie(e);for(;V(t)&&!X(t);){if(Z(t))return t;if(U(t))return null;t=ie(t)}return null}(e)||i}const we={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:i,offsetParent:s,strategy:n}=e;const o="fixed"===n,l=F(s),r=!!t&&U(t.floating);if(s===l||r&&o)return i;let a={scrollLeft:0,scrollTop:0},c=d(1);const h=d(0),u=V(s);if((u||!u&&!o)&&(("body"!==B(s)||z(l))&&(a=te(s)),u)){const e=he(s);c=ae(s),h.x=e.x+s.clientLeft,h.y=e.y+s.clientTop}const p=!l||u||o?d(0):pe(l,a);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-a.scrollLeft*c.x+h.x+p.x,y:i.y*c.y-a.scrollTop*c.y+h.y+p.y}},getDocumentElement:F,getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:s,strategy:n}=e;const o=[..."clippingAncestors"===i?U(t)?[]:function(e,t){const i=t.get(e);if(i)return i;let s=ne(e,[],!1).filter(e=>R(e)&&"body"!==B(e)),n=null;const o="fixed"===ee(e).position;let l=o?ie(e):e;for(;R(l)&&!X(l);){const t=ee(l),i=Z(l);i||"fixed"!==t.position||(n=null),(o?!i&&!n:!i&&"static"===t.position&&n&&("absolute"===n.position||"fixed"===n.position)||z(l)&&!i&&ge(e,l))?s=s.filter(e=>e!==l):n=t,l=ie(l)}return t.set(e,s),s}(t,this._c):[].concat(i),s],a=me(t,o[0],n);let c=a.top,d=a.right,h=a.bottom,u=a.left;for(let e=1;e<o.length;e++){const i=me(t,o[e],n);c=r(i.top,c),d=l(i.right,d),h=l(i.bottom,h),u=r(i.left,u)}return{width:d-u,height:h-c,x:u,y:c}},getOffsetParent:be,getElementRects:async function(e){const t=this.getOffsetParent||be,i=this.getDimensions,s=await i(e.floating);return{reference:ve(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:i}=le(e);return{width:t,height:i}},getScale:ae,isElement:R,isRTL:function(e){return"rtl"===ee(e).direction}};function Ce(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Se(e,t,i,s){void 0===s&&(s={});const{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:d="function"==typeof IntersectionObserver,animationFrame:h=!1}=s,u=re(e),p=n||o?[...u?ne(u):[],...t?ne(t):[]]:[];p.forEach(e=>{n&&e.addEventListener("scroll",i,{passive:!0}),o&&e.addEventListener("resize",i)});const m=u&&d?function(e,t){let i,s=null;const n=F(e);function o(){var e;clearTimeout(i),null==(e=s)||e.disconnect(),s=null}return function a(d,h){void 0===d&&(d=!1),void 0===h&&(h=1),o();const u=e.getBoundingClientRect(),{left:p,top:m,width:g,height:v}=u;if(d||t(),!g||!v)return;const f={rootMargin:-c(m)+"px "+-c(n.clientWidth-(p+g))+"px "+-c(n.clientHeight-(m+v))+"px "+-c(p)+"px",threshold:r(0,l(1,h))||1};let y=!0;function b(t){const s=t[0].intersectionRatio;if(s!==h){if(!y)return a();s?a(!1,s):i=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==s||Ce(u,e.getBoundingClientRect())||a(),y=!1}try{s=new IntersectionObserver(b,{...f,root:n.ownerDocument})}catch(e){s=new IntersectionObserver(b,f)}s.observe(e)}(!0),o}(u,i):null;let g,v=-1,f=null;a&&(f=new ResizeObserver(e=>{let[s]=e;s&&s.target===u&&f&&t&&(f.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),i()}),u&&!h&&f.observe(u),t&&f.observe(t));let y=h?he(e):null;return h&&function t(){const s=he(e);y&&!Ce(y,s)&&i();y=s,g=requestAnimationFrame(t)}(),i(),()=>{var e;p.forEach(e=>{n&&e.removeEventListener("scroll",i),o&&e.removeEventListener("resize",i)}),null==m||m(),null==(e=f)||e.disconnect(),f=null,h&&cancelAnimationFrame(g)}}const xe=O,Te=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var i,s;const{x:n,y:o,placement:l,middlewareData:r}=t,a=await async function(e,t){const{placement:i,platform:s,elements:n}=e,o=await(null==s.isRTL?void 0:s.isRTL(n.floating)),l=m(i),r=g(i),a="y"===y(i),c=N.has(l)?-1:1,d=o&&a?-1:1,h=p(t,e);let{mainAxis:u,crossAxis:v,alignmentAxis:f}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return r&&"number"==typeof f&&(v="end"===r?-1*f:f),a?{x:v*d,y:u*c}:{x:u*c,y:v*d}}(t,e);return l===(null==(i=r.offset)?void 0:i.placement)&&null!=(s=r.arrow)&&s.alignmentOffset?{}:{x:n+a.x,y:o+a.y,data:{...a,placement:l}}}}},Le=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var i,s,n;const{rects:l,middlewareData:r,placement:a,platform:c,elements:d}=t,{crossAxis:h=!1,alignment:u,allowedPlacements:v=o,autoAlignment:f=!0,...y}=p(e,t),b=void 0!==u||v===o?function(e,t,i){return(e?[...i.filter(t=>g(t)===e),...i.filter(t=>g(t)!==e)]:i.filter(e=>m(e)===e)).filter(i=>!e||g(i)===e||!!t&&C(i)!==i)}(u||null,f,v):v,S=await c.detectOverflow(t,y),x=(null==(i=r.autoPlacement)?void 0:i.index)||0,T=b[x];if(null==T)return{};const L=w(T,l,await(null==c.isRTL?void 0:c.isRTL(d.floating)));if(a!==T)return{reset:{placement:b[0]}};const E=[S[m(T)],S[L[0]],S[L[1]]],k=[...(null==(s=r.autoPlacement)?void 0:s.overflows)||[],{placement:T,overflows:E}],I=b[x+1];if(I)return{data:{index:x+1,overflows:k},reset:{placement:I}};const A=k.map(e=>{const t=g(e.placement);return[e.placement,t&&h?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),M=(null==(n=A.filter(e=>e[2].slice(0,g(e[0])?2:3).every(e=>e<=0))[0])?void 0:n[0])||A[0][0];return M!==a?{data:{index:x+1,overflows:k},reset:{placement:M}}:{}}}},Ee=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:s,placement:n,platform:o}=t,{mainAxis:l=!0,crossAxis:r=!1,limiter:a={fn:e=>{let{x:t,y:i}=e;return{x:t,y:i}}},...c}=p(e,t),d={x:i,y:s},h=await o.detectOverflow(t,c),g=y(m(n)),f=v(g);let b=d[f],w=d[g];if(l){const e="y"===f?"bottom":"right";b=u(b+h["y"===f?"top":"left"],b,b-h[e])}if(r){const e="y"===g?"bottom":"right";w=u(w+h["y"===g?"top":"left"],w,w-h[e])}const C=a.fn({...t,[f]:b,[g]:w});return{...C,data:{x:C.x-i,y:C.y-s,enabled:{[f]:l,[g]:r}}}}}},ke=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var i,s;const{placement:n,middlewareData:o,rects:l,initialPlacement:r,platform:a,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:f=!0,...b}=p(e,t);if(null!=(i=o.arrow)&&i.alignmentOffset)return{};const S=m(n),x=y(r),T=m(r)===r,L=await(null==a.isRTL?void 0:a.isRTL(c.floating)),I=u||(T||!f?[k(r)]:function(e){const t=k(e);return[C(e),t,C(t)]}(r)),A="none"!==v;!u&&A&&I.push(...E(r,f,v,L));const M=[r,...I],O=await a.detectOverflow(t,b),D=[];let P=(null==(s=o.flip)?void 0:s.overflows)||[];if(d&&D.push(O[S]),h){const e=w(n,l,L);D.push(O[e[0]],O[e[1]])}if(P=[...P,{placement:n,overflows:D}],!D.every(e=>e<=0)){var $,N;const e=((null==($=o.flip)?void 0:$.index)||0)+1,t=M[e];if(t){if(!("alignment"===h&&x!==y(t))||P.every(e=>y(e.placement)!==x||e.overflows[0]>0))return{data:{index:e,overflows:P},reset:{placement:t}}}let i=null==(N=P.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:N.placement;if(!i)switch(g){case"bestFit":{var H;const e=null==(H=P.filter(e=>{if(A){const t=y(e.placement);return t===x||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:H[0];e&&(i=e);break}case"initialPlacement":i=r}if(n!==i)return{reset:{placement:i}}}return{}}}},Ie=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var i,s;const{placement:n,rects:o,platform:a,elements:c}=t,{apply:d=()=>{},...h}=p(e,t),u=await a.detectOverflow(t,h),v=m(n),f=g(n),b="y"===y(n),{width:w,height:C}=o.floating;let S,x;"top"===v||"bottom"===v?(S=v,x=f===(await(null==a.isRTL?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(x=v,S="end"===f?"top":"bottom");const T=C-u.top-u.bottom,L=w-u.left-u.right,E=l(C-u[S],T),k=l(w-u[x],L),I=!t.middlewareData.shift;let A=E,M=k;if(null!=(i=t.middlewareData.shift)&&i.enabled.x&&(M=L),null!=(s=t.middlewareData.shift)&&s.enabled.y&&(A=T),I&&!f){const e=r(u.left,0),t=r(u.right,0),i=r(u.top,0),s=r(u.bottom,0);b?M=w-2*(0!==e||0!==t?e+t:r(u.left,u.right)):A=C-2*(0!==i||0!==s?i+s:r(u.top,u.bottom))}await d({...t,availableWidth:M,availableHeight:A});const O=await a.getDimensions(c.floating);return w!==O.width||C!==O.height?{reset:{rects:!0}}:{}}}},Ae=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:i,platform:s}=t,{strategy:n="referenceHidden",...o}=p(e,t);switch(n){case"referenceHidden":{const e=D(await s.detectOverflow(t,{...o,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:P(e)}}}case"escaped":{const e=D(await s.detectOverflow(t,{...o,altBoundary:!0}),i.floating);return{data:{escapedOffsets:e,escaped:P(e)}}}default:return{}}}}},Me=e=>({name:"arrow",options:e,async fn(t){const{x:i,y:s,placement:n,rects:o,platform:r,elements:a,middlewareData:c}=t,{element:d,padding:h=0}=p(e,t)||{};if(null==d)return{};const m=I(h),v={x:i,y:s},y=b(n),w=f(y),C=await r.getDimensions(d),S="y"===y,x=S?"top":"left",T=S?"bottom":"right",L=S?"clientHeight":"clientWidth",E=o.reference[w]+o.reference[y]-v[y]-o.floating[w],k=v[y]-o.reference[y],A=await(null==r.getOffsetParent?void 0:r.getOffsetParent(d));let M=A?A[L]:0;M&&await(null==r.isElement?void 0:r.isElement(A))||(M=a.floating[L]||o.floating[w]);const O=E/2-k/2,D=M/2-C[w]/2-1,P=l(m[x],D),$=l(m[T],D),N=P,H=M-C[w]-$,B=M/2-C[w]/2+O,q=u(N,B,H),F=!c.arrow&&null!=g(n)&&B!==q&&o.reference[w]/2-(B<N?P:$)-C[w]/2<0,_=F?B<N?B-N:B-H:0;return{[y]:v[y]+_,data:{[y]:q,centerOffset:B-q-_,...F&&{alignmentOffset:_}},reset:F}}}),Oe=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:i,elements:s,rects:n,platform:o,strategy:a}=t,{padding:c=2,x:d,y:h}=p(e,t),u=Array.from(await(null==o.getClientRects?void 0:o.getClientRects(s.reference))||[]),g=function(e){const t=e.slice().sort((e,t)=>e.y-t.y),i=[];let s=null;for(let e=0;e<t.length;e++){const n=t[e];!s||n.y-s.y>s.height/2?i.push([n]):i[i.length-1].push(n),s=n}return i.map(e=>A($(e)))}(u),v=A($(u)),f=I(c);const b=await o.getElementRects({reference:{getBoundingClientRect:function(){if(2===g.length&&g[0].left>g[1].right&&null!=d&&null!=h)return g.find(e=>d>e.left-f.left&&d<e.right+f.right&&h>e.top-f.top&&h<e.bottom+f.bottom)||v;if(g.length>=2){if("y"===y(i)){const e=g[0],t=g[g.length-1],s="top"===m(i),n=e.top,o=t.bottom,l=s?e.left:t.left,r=s?e.right:t.right;return{top:n,bottom:o,left:l,right:r,width:r-l,height:o-n,x:l,y:n}}const e="left"===m(i),t=r(...g.map(e=>e.right)),s=l(...g.map(e=>e.left)),n=g.filter(i=>e?i.left===s:i.right===t),o=n[0].top,a=n[n.length-1].bottom;return{top:o,bottom:a,left:s,right:t,width:t-s,height:a-o,x:s,y:o}}return v}},floating:s.floating,strategy:a});return n.reference.x!==b.reference.x||n.reference.y!==b.reference.y||n.reference.width!==b.reference.width||n.reference.height!==b.reference.height?{reset:{rects:b}}:{}}}},De=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:i,y:s,placement:n,rects:o,middlewareData:l}=t,{offset:r=0,mainAxis:a=!0,crossAxis:c=!0}=p(e,t),d={x:i,y:s},h=y(n),u=v(h);let g=d[u],f=d[h];const b=p(r,t),w="number"==typeof b?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(a){const e="y"===u?"height":"width",t=o.reference[u]-o.floating[e]+w.mainAxis,i=o.reference[u]+o.reference[e]-w.mainAxis;g<t?g=t:g>i&&(g=i)}if(c){var C,S;const e="y"===u?"width":"height",t=N.has(m(n)),i=o.reference[h]-o.floating[e]+(t&&(null==(C=l.offset)?void 0:C[h])||0)+(t?0:w.crossAxis),s=o.reference[h]+o.reference[e]+(t?0:(null==(S=l.offset)?void 0:S[h])||0)-(t?w.crossAxis:0);f<i?f=i:f>s&&(f=s)}return{[u]:g,[h]:f}}}},Pe=(e,t,i)=>{const s=new Map,n={platform:we,...i},o={...n.platform,_c:s};return(async(e,t,i)=>{const{placement:s="bottom",strategy:n="absolute",middleware:o=[],platform:l}=i,r=l.detectOverflow?l:{...l,detectOverflow:O},a=await(null==l.isRTL?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:h}=M(c,s,a),u=s,p=0;const m={};for(let i=0;i<o.length;i++){const g=o[i];if(!g)continue;const{name:v,fn:f}=g,{x:y,y:b,data:w,reset:C}=await f({x:d,y:h,initialPlacement:s,placement:u,strategy:n,middlewareData:m,rects:c,platform:r,elements:{reference:e,floating:t}});d=null!=y?y:d,h=null!=b?b:h,m[v]={...m[v],...w},C&&p<50&&(p++,"object"==typeof C&&(C.placement&&(u=C.placement),C.rects&&(c=!0===C.rects?await l.getElementRects({reference:e,floating:t,strategy:n}):C.rects),({x:d,y:h}=M(c,u,a))),i=-1)}return{x:d,y:h,placement:u,strategy:n,middlewareData:m}})(e,t,{...n,platform:o})}},9119(e,t,i){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HSStaticMethods=t.COLLECTIONS=void 0;const n=i(292),o=s(i(8171)),l=s(i(6621)),r=s(i(4701)),a=s(i(2470)),c=s(i(7298)),d=s(i(3747)),h=s(i(1553)),u=s(i(9608)),p=s(i(9247)),m=s(i(989)),g=s(i(69)),v=s(i(4343)),f=s(i(4061)),y=s(i(4808)),b=s(i(1148)),w=s(i(5308)),C=s(i(9948)),S=s(i(591)),x=s(i(8572)),T=s(i(8962)),L=s(i(5803)),E=s(i(6473)),k=s(i(9419)),I=s(i(1717)),A=s(i(8549)),M=s(i(4986)),O=s(i(4957)),D=()=>globalThis;t.COLLECTIONS=[{key:"copy-markup",fn:o.default,collection:"$hsCopyMarkupCollection"},{key:"accordion",fn:l.default,collection:"$hsAccordionCollection"},{key:"carousel",fn:r.default,collection:"$hsCarouselCollection"},{key:"collapse",fn:a.default,collection:"$hsCollapseCollection"},{key:"combobox",fn:c.default,collection:"$hsComboBoxCollection"},{key:"datatable",fn:(()=>{const e=D();return void 0!==e.DataTable&&void 0!==e.jQuery})()?d.default:null,collection:"$hsDataTableCollection"},{key:"datepicker",fn:void 0!==D().VanillaCalendarPro?h.default:null,collection:"$hsDatepickerCollection"},{key:"dropdown",fn:u.default,collection:"$hsDropdownCollection"},{key:"file-upload",fn:(()=>{const e=D();return void 0!==e._&&void 0!==e.Dropzone})()?p.default:null,collection:"$hsFileUploadCollection"},{key:"input-number",fn:m.default,collection:"$hsInputNumberCollection"},{key:"layout-splitter",fn:g.default,collection:"$hsLayoutSplitterCollection"},{key:"overlay",fn:v.default,collection:"$hsOverlayCollection"},{key:"pin-input",fn:f.default,collection:"$hsPinInputCollection"},{key:"range-slider",fn:void 0!==D().noUiSlider?y.default:null,collection:"$hsRangeSliderCollection"},{key:"remove-element",fn:b.default,collection:"$hsRemoveElementCollection"},{key:"scroll-nav",fn:w.default,collection:"$hsScrollNavCollection"},{key:"scrollspy",fn:C.default,collection:"$hsScrollspyCollection"},{key:"select",fn:S.default,collection:"$hsSelectCollection"},{key:"stepper",fn:x.default,collection:"$hsStepperCollection"},{key:"strong-password",fn:T.default,collection:"$hsStrongPasswordCollection"},{key:"tabs",fn:L.default,collection:"$hsTabsCollection"},{key:"textarea-auto-height",fn:E.default,collection:"$hsTextareaAutoHeightCollection"},{key:"theme-switch",fn:k.default,collection:"$hsThemeSwitchCollection"},{key:"toggle-count",fn:I.default,collection:"$hsToggleCountCollection"},{key:"toggle-password",fn:A.default,collection:"$hsTogglePasswordCollection"},{key:"tooltip",fn:M.default,collection:"$hsTooltipCollection"},{key:"tree-view",fn:O.default,collection:"$hsTreeViewCollection"}],t.HSStaticMethods={getClassProperty:n.getClassProperty,afterTransition:n.afterTransition,autoInit(e="all"){if("all"===e)return void t.COLLECTIONS.forEach(({fn:e})=>{var t;null===(t=null==e?void 0:e.autoInit)||void 0===t||t.call(e)});const i=Array.isArray(e)?e:[e];t.COLLECTIONS.forEach(({key:e,fn:t})=>{var s;i.includes(e)&&(null===(s=null==t?void 0:t.autoInit)||void 0===s||s.call(t))})},cleanCollection(e="all"){if("undefined"==typeof window)return;if("all"===e)return void t.COLLECTIONS.forEach(({collection:e})=>{window[e]instanceof Array&&(window[e]=[])});const i=Array.isArray(e)?e:[e];t.COLLECTIONS.forEach(({key:e,collection:t})=>{i.includes(e)&&window[t]instanceof Array&&(window[t]=[])})}},t.default=t.HSStaticMethods},8223(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BREAKPOINTS=t.COMBO_BOX_ACCESSIBILITY_KEY_SET=t.SELECT_ACCESSIBILITY_KEY_SET=t.TABS_ACCESSIBILITY_KEY_SET=t.OVERLAY_ACCESSIBILITY_KEY_SET=t.DROPDOWN_ACCESSIBILITY_KEY_SET=t.POSITIONS=void 0,t.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},t.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","ArrowRight","ArrowLeft","Home","End","Enter"],t.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],t.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],t.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Space","Tab"],t.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],t.BREAKPOINTS={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},3158(e,t,i){"use strict";
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i=t();for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}(self,()=>(()=>{var e={949(e,t,i){"use strict";i.r(t),i.d(t,{arrow:()=>Me,autoPlacement:()=>ke,autoUpdate:()=>xe,computePosition:()=>Pe,detectOverflow:()=>Se,flip:()=>Le,getOverflowAncestors:()=>se,hide:()=>Ae,inline:()=>Oe,limitShift:()=>De,offset:()=>Te,platform:()=>we,shift:()=>Ee,size:()=>Ie});const n=["top","right","bottom","left"],s=["start","end"],o=n.reduce((e,t)=>e.concat(t,t+"-"+s[0],t+"-"+s[1]),[]),l=Math.min,r=Math.max,a=Math.round,d=Math.floor,c=e=>({x:e,y:e}),h={left:"right",right:"left",bottom:"top",top:"bottom"};function u(e,t,i){return r(e,l(t,i))}function p(e,t){return"function"==typeof e?e(t):e}function m(e){return e.split("-")[0]}function g(e){return e.split("-")[1]}function v(e){return"x"===e?"y":"x"}function f(e){return"y"===e?"height":"width"}function y(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function b(e){return v(y(e))}function w(e,t,i){void 0===i&&(i=!1);const n=g(e),s=b(e),o=f(s);let l="x"===s?n===(i?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=L(l)),[l,L(l)]}function C(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const x=["left","right"],S=["right","left"],T=["top","bottom"],k=["bottom","top"];function E(e,t,i,n){const s=g(e);let o=function(e,t,i){switch(e){case"top":case"bottom":return i?t?S:x:t?x:S;case"left":case"right":return t?T:k;default:return[]}}(m(e),"start"===i,n);return s&&(o=o.map(e=>e+"-"+s),t&&(o=o.concat(o.map(C)))),o}function L(e){const t=m(e);return h[t]+e.slice(t.length)}function I(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function A(e){const{x:t,y:i,width:n,height:s}=e;return{width:n,height:s,top:i,left:t,right:t+n,bottom:i+s,x:t,y:i}}function M(e,t,i){let{reference:n,floating:s}=e;const o=y(t),l=b(t),r=f(l),a=m(t),d="y"===o,c=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2,u=n[r]/2-s[r]/2;let p;switch(a){case"top":p={x:c,y:n.y-s.height};break;case"bottom":p={x:c,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:h};break;case"left":p={x:n.x-s.width,y:h};break;default:p={x:n.x,y:n.y}}switch(g(t)){case"start":p[l]-=u*(i&&d?-1:1);break;case"end":p[l]+=u*(i&&d?-1:1)}return p}async function O(e,t){var i;void 0===t&&(t={});const{x:n,y:s,platform:o,rects:l,elements:r,strategy:a}=e,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:h="floating",altBoundary:u=!1,padding:m=0}=p(t,e),g=I(m),v=r[u?"floating"===h?"reference":"floating":h],f=A(await o.getClippingRect({element:null==(i=await(null==o.isElement?void 0:o.isElement(v)))||i?v:v.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(r.floating)),boundary:d,rootBoundary:c,strategy:a})),y="floating"===h?{x:n,y:s,width:l.floating.width,height:l.floating.height}:l.reference,b=await(null==o.getOffsetParent?void 0:o.getOffsetParent(r.floating)),w=await(null==o.isElement?void 0:o.isElement(b))&&await(null==o.getScale?void 0:o.getScale(b))||{x:1,y:1},C=A(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:r,rect:y,offsetParent:b,strategy:a}):y);return{top:(f.top-C.top+g.top)/w.y,bottom:(C.bottom-f.bottom+g.bottom)/w.y,left:(f.left-C.left+g.left)/w.x,right:(C.right-f.right+g.right)/w.x}}function D(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function P(e){return n.some(t=>e[t]>=0)}function $(e){const t=l(...e.map(e=>e.left)),i=l(...e.map(e=>e.top));return{x:t,y:i,width:r(...e.map(e=>e.right))-t,height:r(...e.map(e=>e.bottom))-i}}const N=new Set(["left","top"]);function H(){return"undefined"!=typeof window}function B(e){return _(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function F(e){var t;return null==(t=(_(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function _(e){return!!H()&&(e instanceof Node||e instanceof q(e).Node)}function R(e){return!!H()&&(e instanceof Element||e instanceof q(e).Element)}function j(e){return!!H()&&(e instanceof HTMLElement||e instanceof q(e).HTMLElement)}function V(e){return!(!H()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof q(e).ShadowRoot)}function z(e){const{overflow:t,overflowX:i,overflowY:n,display:s}=ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&"inline"!==s&&"contents"!==s}function W(e){return/^(table|td|th)$/.test(B(e))}function Y(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const U=/transform|translate|scale|rotate|perspective|filter/,K=/paint|layout|strict|content/,Q=e=>!!e&&"none"!==e;let J;function G(e){const t=R(e)?ee(e):e;return Q(t.transform)||Q(t.translate)||Q(t.scale)||Q(t.rotate)||Q(t.perspective)||!Z()&&(Q(t.backdropFilter)||Q(t.filter))||U.test(t.willChange||"")||K.test(t.contain||"")}function Z(){return null==J&&(J="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),J}function X(e){return/^(html|body|#document)$/.test(B(e))}function ee(e){return q(e).getComputedStyle(e)}function te(e){return R(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ie(e){if("html"===B(e))return e;const t=e.assignedSlot||e.parentNode||V(e)&&e.host||F(e);return V(t)?t.host:t}function ne(e){const t=ie(e);return X(t)?e.ownerDocument?e.ownerDocument.body:e.body:j(t)&&z(t)?t:ne(t)}function se(e,t,i){var n;void 0===t&&(t=[]),void 0===i&&(i=!0);const s=ne(e),o=s===(null==(n=e.ownerDocument)?void 0:n.body),l=q(s);if(o){const e=oe(l);return t.concat(l,l.visualViewport||[],z(s)?s:[],e&&i?se(e):[])}return t.concat(s,se(s,[],i))}function oe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function le(e){const t=ee(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=j(e),o=s?e.offsetWidth:i,l=s?e.offsetHeight:n,r=a(i)!==o||a(n)!==l;return r&&(i=o,n=l),{width:i,height:n,$:r}}function re(e){return R(e)?e:e.contextElement}function ae(e){const t=re(e);if(!j(t))return c(1);const i=t.getBoundingClientRect(),{width:n,height:s,$:o}=le(t);let l=(o?a(i.width):i.width)/n,r=(o?a(i.height):i.height)/s;return l&&Number.isFinite(l)||(l=1),r&&Number.isFinite(r)||(r=1),{x:l,y:r}}const de=c(0);function ce(e){const t=q(e);return Z()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:de}function he(e,t,i,n){void 0===t&&(t=!1),void 0===i&&(i=!1);const s=e.getBoundingClientRect(),o=re(e);let l=c(1);t&&(n?R(n)&&(l=ae(n)):l=ae(e));const r=function(e,t,i){return void 0===t&&(t=!1),!(!i||t&&i!==q(e))&&t}(o,i,n)?ce(o):c(0);let a=(s.left+r.x)/l.x,d=(s.top+r.y)/l.y,h=s.width/l.x,u=s.height/l.y;if(o){const e=q(o),t=n&&R(n)?q(n):n;let i=e,s=oe(i);for(;s&&n&&t!==i;){const e=ae(s),t=s.getBoundingClientRect(),n=ee(s),o=t.left+(s.clientLeft+parseFloat(n.paddingLeft))*e.x,l=t.top+(s.clientTop+parseFloat(n.paddingTop))*e.y;a*=e.x,d*=e.y,h*=e.x,u*=e.y,a+=o,d+=l,i=q(s),s=oe(i)}}return A({width:h,height:u,x:a,y:d})}function ue(e,t){const i=te(e).scrollLeft;return t?t.left+i:he(F(e)).left+i}function pe(e,t){const i=e.getBoundingClientRect();return{x:i.left+t.scrollLeft-ue(e,i),y:i.top+t.scrollTop}}function me(e,t,i){let n;if("viewport"===t)n=function(e,t){const i=q(e),n=F(e),s=i.visualViewport;let o=n.clientWidth,l=n.clientHeight,r=0,a=0;if(s){o=s.width,l=s.height;const e=Z();(!e||e&&"fixed"===t)&&(r=s.offsetLeft,a=s.offsetTop)}const d=ue(n);if(d<=0){const e=n.ownerDocument,t=e.body,i=getComputedStyle(t),s="CSS1Compat"===e.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,l=Math.abs(n.clientWidth-t.clientWidth-s);l<=25&&(o-=l)}else d<=25&&(o+=d);return{width:o,height:l,x:r,y:a}}(e,i);else if("document"===t)n=function(e){const t=F(e),i=te(e),n=e.ownerDocument.body,s=r(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=r(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let l=-i.scrollLeft+ue(e);const a=-i.scrollTop;return"rtl"===ee(n).direction&&(l+=r(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:l,y:a}}(F(e));else if(R(t))n=function(e,t){const i=he(e,!0,"fixed"===t),n=i.top+e.clientTop,s=i.left+e.clientLeft,o=j(e)?ae(e):c(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:s*o.x,y:n*o.y}}(t,i);else{const i=ce(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return A(n)}function ge(e,t){const i=ie(e);return!(i===t||!R(i)||X(i))&&("fixed"===ee(i).position||ge(i,t))}function ve(e,t,i){const n=j(t),s=F(t),o="fixed"===i,l=he(e,!0,o,t);let r={scrollLeft:0,scrollTop:0};const a=c(0);function d(){a.x=ue(s)}if(n||!n&&!o)if(("body"!==B(t)||z(s))&&(r=te(t)),n){const e=he(t,!0,o,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else s&&d();o&&!n&&s&&d();const h=!s||n||o?c(0):pe(s,r);return{x:l.left+r.scrollLeft-a.x-h.x,y:l.top+r.scrollTop-a.y-h.y,width:l.width,height:l.height}}function fe(e){return"static"===ee(e).position}function ye(e,t){if(!j(e)||"fixed"===ee(e).position)return null;if(t)return t(e);let i=e.offsetParent;return F(e)===i&&(i=i.ownerDocument.body),i}function be(e,t){const i=q(e);if(Y(e))return i;if(!j(e)){let t=ie(e);for(;t&&!X(t);){if(R(t)&&!fe(t))return t;t=ie(t)}return i}let n=ye(e,t);for(;n&&W(n)&&fe(n);)n=ye(n,t);return n&&X(n)&&fe(n)&&!G(n)?i:n||function(e){let t=ie(e);for(;j(t)&&!X(t);){if(G(t))return t;if(Y(t))return null;t=ie(t)}return null}(e)||i}const we={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:i,offsetParent:n,strategy:s}=e;const o="fixed"===s,l=F(n),r=!!t&&Y(t.floating);if(n===l||r&&o)return i;let a={scrollLeft:0,scrollTop:0},d=c(1);const h=c(0),u=j(n);if((u||!u&&!o)&&(("body"!==B(n)||z(l))&&(a=te(n)),u)){const e=he(n);d=ae(n),h.x=e.x+n.clientLeft,h.y=e.y+n.clientTop}const p=!l||u||o?c(0):pe(l,a);return{width:i.width*d.x,height:i.height*d.y,x:i.x*d.x-a.scrollLeft*d.x+h.x+p.x,y:i.y*d.y-a.scrollTop*d.y+h.y+p.y}},getDocumentElement:F,getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:n,strategy:s}=e;const o=[..."clippingAncestors"===i?Y(t)?[]:function(e,t){const i=t.get(e);if(i)return i;let n=se(e,[],!1).filter(e=>R(e)&&"body"!==B(e)),s=null;const o="fixed"===ee(e).position;let l=o?ie(e):e;for(;R(l)&&!X(l);){const t=ee(l),i=G(l);i||"fixed"!==t.position||(s=null),(o?!i&&!s:!i&&"static"===t.position&&s&&("absolute"===s.position||"fixed"===s.position)||z(l)&&!i&&ge(e,l))?n=n.filter(e=>e!==l):s=t,l=ie(l)}return t.set(e,n),n}(t,this._c):[].concat(i),n],a=me(t,o[0],s);let d=a.top,c=a.right,h=a.bottom,u=a.left;for(let e=1;e<o.length;e++){const i=me(t,o[e],s);d=r(i.top,d),c=l(i.right,c),h=l(i.bottom,h),u=r(i.left,u)}return{width:c-u,height:h-d,x:u,y:d}},getOffsetParent:be,getElementRects:async function(e){const t=this.getOffsetParent||be,i=this.getDimensions,n=await i(e.floating);return{reference:ve(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:i}=le(e);return{width:t,height:i}},getScale:ae,isElement:R,isRTL:function(e){return"rtl"===ee(e).direction}};function Ce(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xe(e,t,i,n){void 0===n&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:h=!1}=n,u=re(e),p=s||o?[...u?se(u):[],...t?se(t):[]]:[];p.forEach(e=>{s&&e.addEventListener("scroll",i,{passive:!0}),o&&e.addEventListener("resize",i)});const m=u&&c?function(e,t){let i,n=null;const s=F(e);function o(){var e;clearTimeout(i),null==(e=n)||e.disconnect(),n=null}return function a(c,h){void 0===c&&(c=!1),void 0===h&&(h=1),o();const u=e.getBoundingClientRect(),{left:p,top:m,width:g,height:v}=u;if(c||t(),!g||!v)return;const f={rootMargin:-d(m)+"px "+-d(s.clientWidth-(p+g))+"px "+-d(s.clientHeight-(m+v))+"px "+-d(p)+"px",threshold:r(0,l(1,h))||1};let y=!0;function b(t){const n=t[0].intersectionRatio;if(n!==h){if(!y)return a();n?a(!1,n):i=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==n||Ce(u,e.getBoundingClientRect())||a(),y=!1}try{n=new IntersectionObserver(b,{...f,root:s.ownerDocument})}catch(e){n=new IntersectionObserver(b,f)}n.observe(e)}(!0),o}(u,i):null;let g,v=-1,f=null;a&&(f=new ResizeObserver(e=>{let[n]=e;n&&n.target===u&&f&&t&&(f.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),i()}),u&&!h&&f.observe(u),t&&f.observe(t));let y=h?he(e):null;return h&&function t(){const n=he(e);y&&!Ce(y,n)&&i();y=n,g=requestAnimationFrame(t)}(),i(),()=>{var e;p.forEach(e=>{s&&e.removeEventListener("scroll",i),o&&e.removeEventListener("resize",i)}),null==m||m(),null==(e=f)||e.disconnect(),f=null,h&&cancelAnimationFrame(g)}}const Se=O,Te=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var i,n;const{x:s,y:o,placement:l,middlewareData:r}=t,a=await async function(e,t){const{placement:i,platform:n,elements:s}=e,o=await(null==n.isRTL?void 0:n.isRTL(s.floating)),l=m(i),r=g(i),a="y"===y(i),d=N.has(l)?-1:1,c=o&&a?-1:1,h=p(t,e);let{mainAxis:u,crossAxis:v,alignmentAxis:f}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return r&&"number"==typeof f&&(v="end"===r?-1*f:f),a?{x:v*c,y:u*d}:{x:u*d,y:v*c}}(t,e);return l===(null==(i=r.offset)?void 0:i.placement)&&null!=(n=r.arrow)&&n.alignmentOffset?{}:{x:s+a.x,y:o+a.y,data:{...a,placement:l}}}}},ke=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var i,n,s;const{rects:l,middlewareData:r,placement:a,platform:d,elements:c}=t,{crossAxis:h=!1,alignment:u,allowedPlacements:v=o,autoAlignment:f=!0,...y}=p(e,t),b=void 0!==u||v===o?function(e,t,i){return(e?[...i.filter(t=>g(t)===e),...i.filter(t=>g(t)!==e)]:i.filter(e=>m(e)===e)).filter(i=>!e||g(i)===e||!!t&&C(i)!==i)}(u||null,f,v):v,x=await d.detectOverflow(t,y),S=(null==(i=r.autoPlacement)?void 0:i.index)||0,T=b[S];if(null==T)return{};const k=w(T,l,await(null==d.isRTL?void 0:d.isRTL(c.floating)));if(a!==T)return{reset:{placement:b[0]}};const E=[x[m(T)],x[k[0]],x[k[1]]],L=[...(null==(n=r.autoPlacement)?void 0:n.overflows)||[],{placement:T,overflows:E}],I=b[S+1];if(I)return{data:{index:S+1,overflows:L},reset:{placement:I}};const A=L.map(e=>{const t=g(e.placement);return[e.placement,t&&h?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),M=(null==(s=A.filter(e=>e[2].slice(0,g(e[0])?2:3).every(e=>e<=0))[0])?void 0:s[0])||A[0][0];return M!==a?{data:{index:S+1,overflows:L},reset:{placement:M}}:{}}}},Ee=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:s,platform:o}=t,{mainAxis:l=!0,crossAxis:r=!1,limiter:a={fn:e=>{let{x:t,y:i}=e;return{x:t,y:i}}},...d}=p(e,t),c={x:i,y:n},h=await o.detectOverflow(t,d),g=y(m(s)),f=v(g);let b=c[f],w=c[g];if(l){const e="y"===f?"bottom":"right";b=u(b+h["y"===f?"top":"left"],b,b-h[e])}if(r){const e="y"===g?"bottom":"right";w=u(w+h["y"===g?"top":"left"],w,w-h[e])}const C=a.fn({...t,[f]:b,[g]:w});return{...C,data:{x:C.x-i,y:C.y-n,enabled:{[f]:l,[g]:r}}}}}},Le=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var i,n;const{placement:s,middlewareData:o,rects:l,initialPlacement:r,platform:a,elements:d}=t,{mainAxis:c=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:f=!0,...b}=p(e,t);if(null!=(i=o.arrow)&&i.alignmentOffset)return{};const x=m(s),S=y(r),T=m(r)===r,k=await(null==a.isRTL?void 0:a.isRTL(d.floating)),I=u||(T||!f?[L(r)]:function(e){const t=L(e);return[C(e),t,C(t)]}(r)),A="none"!==v;!u&&A&&I.push(...E(r,f,v,k));const M=[r,...I],O=await a.detectOverflow(t,b),D=[];let P=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&D.push(O[x]),h){const e=w(s,l,k);D.push(O[e[0]],O[e[1]])}if(P=[...P,{placement:s,overflows:D}],!D.every(e=>e<=0)){var $,N;const e=((null==($=o.flip)?void 0:$.index)||0)+1,t=M[e];if(t){if(!("alignment"===h&&S!==y(t))||P.every(e=>y(e.placement)!==S||e.overflows[0]>0))return{data:{index:e,overflows:P},reset:{placement:t}}}let i=null==(N=P.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:N.placement;if(!i)switch(g){case"bestFit":{var H;const e=null==(H=P.filter(e=>{if(A){const t=y(e.placement);return t===S||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:H[0];e&&(i=e);break}case"initialPlacement":i=r}if(s!==i)return{reset:{placement:i}}}return{}}}},Ie=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var i,n;const{placement:s,rects:o,platform:a,elements:d}=t,{apply:c=()=>{},...h}=p(e,t),u=await a.detectOverflow(t,h),v=m(s),f=g(s),b="y"===y(s),{width:w,height:C}=o.floating;let x,S;"top"===v||"bottom"===v?(x=v,S=f===(await(null==a.isRTL?void 0:a.isRTL(d.floating))?"start":"end")?"left":"right"):(S=v,x="end"===f?"top":"bottom");const T=C-u.top-u.bottom,k=w-u.left-u.right,E=l(C-u[x],T),L=l(w-u[S],k),I=!t.middlewareData.shift;let A=E,M=L;if(null!=(i=t.middlewareData.shift)&&i.enabled.x&&(M=k),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(A=T),I&&!f){const e=r(u.left,0),t=r(u.right,0),i=r(u.top,0),n=r(u.bottom,0);b?M=w-2*(0!==e||0!==t?e+t:r(u.left,u.right)):A=C-2*(0!==i||0!==n?i+n:r(u.top,u.bottom))}await c({...t,availableWidth:M,availableHeight:A});const O=await a.getDimensions(d.floating);return w!==O.width||C!==O.height?{reset:{rects:!0}}:{}}}},Ae=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:i,platform:n}=t,{strategy:s="referenceHidden",...o}=p(e,t);switch(s){case"referenceHidden":{const e=D(await n.detectOverflow(t,{...o,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:P(e)}}}case"escaped":{const e=D(await n.detectOverflow(t,{...o,altBoundary:!0}),i.floating);return{data:{escapedOffsets:e,escaped:P(e)}}}default:return{}}}}},Me=e=>({name:"arrow",options:e,async fn(t){const{x:i,y:n,placement:s,rects:o,platform:r,elements:a,middlewareData:d}=t,{element:c,padding:h=0}=p(e,t)||{};if(null==c)return{};const m=I(h),v={x:i,y:n},y=b(s),w=f(y),C=await r.getDimensions(c),x="y"===y,S=x?"top":"left",T=x?"bottom":"right",k=x?"clientHeight":"clientWidth",E=o.reference[w]+o.reference[y]-v[y]-o.floating[w],L=v[y]-o.reference[y],A=await(null==r.getOffsetParent?void 0:r.getOffsetParent(c));let M=A?A[k]:0;M&&await(null==r.isElement?void 0:r.isElement(A))||(M=a.floating[k]||o.floating[w]);const O=E/2-L/2,D=M/2-C[w]/2-1,P=l(m[S],D),$=l(m[T],D),N=P,H=M-C[w]-$,B=M/2-C[w]/2+O,q=u(N,B,H),F=!d.arrow&&null!=g(s)&&B!==q&&o.reference[w]/2-(B<N?P:$)-C[w]/2<0,_=F?B<N?B-N:B-H:0;return{[y]:v[y]+_,data:{[y]:q,centerOffset:B-q-_,...F&&{alignmentOffset:_}},reset:F}}}),Oe=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:i,elements:n,rects:s,platform:o,strategy:a}=t,{padding:d=2,x:c,y:h}=p(e,t),u=Array.from(await(null==o.getClientRects?void 0:o.getClientRects(n.reference))||[]),g=function(e){const t=e.slice().sort((e,t)=>e.y-t.y),i=[];let n=null;for(let e=0;e<t.length;e++){const s=t[e];!n||s.y-n.y>n.height/2?i.push([s]):i[i.length-1].push(s),n=s}return i.map(e=>A($(e)))}(u),v=A($(u)),f=I(d);const b=await o.getElementRects({reference:{getBoundingClientRect:function(){if(2===g.length&&g[0].left>g[1].right&&null!=c&&null!=h)return g.find(e=>c>e.left-f.left&&c<e.right+f.right&&h>e.top-f.top&&h<e.bottom+f.bottom)||v;if(g.length>=2){if("y"===y(i)){const e=g[0],t=g[g.length-1],n="top"===m(i),s=e.top,o=t.bottom,l=n?e.left:t.left,r=n?e.right:t.right;return{top:s,bottom:o,left:l,right:r,width:r-l,height:o-s,x:l,y:s}}const e="left"===m(i),t=r(...g.map(e=>e.right)),n=l(...g.map(e=>e.left)),s=g.filter(i=>e?i.left===n:i.right===t),o=s[0].top,a=s[s.length-1].bottom;return{top:o,bottom:a,left:n,right:t,width:t-n,height:a-o,x:n,y:o}}return v}},floating:n.floating,strategy:a});return s.reference.x!==b.reference.x||s.reference.y!==b.reference.y||s.reference.width!==b.reference.width||s.reference.height!==b.reference.height?{reset:{rects:b}}:{}}}},De=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:i,y:n,placement:s,rects:o,middlewareData:l}=t,{offset:r=0,mainAxis:a=!0,crossAxis:d=!0}=p(e,t),c={x:i,y:n},h=y(s),u=v(h);let g=c[u],f=c[h];const b=p(r,t),w="number"==typeof b?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(a){const e="y"===u?"height":"width",t=o.reference[u]-o.floating[e]+w.mainAxis,i=o.reference[u]+o.reference[e]-w.mainAxis;g<t?g=t:g>i&&(g=i)}if(d){var C,x;const e="y"===u?"width":"height",t=N.has(m(s)),i=o.reference[h]-o.floating[e]+(t&&(null==(C=l.offset)?void 0:C[h])||0)+(t?0:w.crossAxis),n=o.reference[h]+o.reference[e]+(t?0:(null==(x=l.offset)?void 0:x[h])||0)-(t?w.crossAxis:0);f<i?f=i:f>n&&(f=n)}return{[u]:g,[h]:f}}}},Pe=(e,t,i)=>{const n=new Map,s={platform:we,...i},o={...s.platform,_c:n};return(async(e,t,i)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:l}=i,r=l.detectOverflow?l:{...l,detectOverflow:O},a=await(null==l.isRTL?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:c,y:h}=M(d,n,a),u=n,p=0;const m={};for(let i=0;i<o.length;i++){const g=o[i];if(!g)continue;const{name:v,fn:f}=g,{x:y,y:b,data:w,reset:C}=await f({x:c,y:h,initialPlacement:n,placement:u,strategy:s,middlewareData:m,rects:d,platform:r,elements:{reference:e,floating:t}});c=null!=y?y:c,h=null!=b?b:h,m[v]={...m[v],...w},C&&p<50&&(p++,"object"==typeof C&&(C.placement&&(u=C.placement),C.rects&&(d=!0===C.rects?await l.getElementRects({reference:e,floating:t,strategy:s}):C.rects),({x:c,y:h}=M(d,u,a))),i=-1)}return{x:c,y:h,placement:u,strategy:s,middlewareData:m}})(e,t,{...s,platform:o})}},9119(e,t,i){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HSStaticMethods=t.COLLECTIONS=void 0;const s=i(292),o=n(i(8171)),l=n(i(6621)),r=n(i(4701)),a=n(i(2470)),d=n(i(7298)),c=n(i(3747)),h=n(i(1553)),u=n(i(9608)),p=n(i(9247)),m=n(i(989)),g=n(i(69)),v=n(i(4343)),f=n(i(4061)),y=n(i(4808)),b=n(i(1148)),w=n(i(5308)),C=n(i(9948)),x=n(i(591)),S=n(i(8572)),T=n(i(8962)),k=n(i(5803)),E=n(i(6473)),L=n(i(9419)),I=n(i(1717)),A=n(i(8549)),M=n(i(4986)),O=n(i(4957)),D=()=>globalThis;t.COLLECTIONS=[{key:"copy-markup",fn:o.default,collection:"$hsCopyMarkupCollection"},{key:"accordion",fn:l.default,collection:"$hsAccordionCollection"},{key:"carousel",fn:r.default,collection:"$hsCarouselCollection"},{key:"collapse",fn:a.default,collection:"$hsCollapseCollection"},{key:"combobox",fn:d.default,collection:"$hsComboBoxCollection"},{key:"datatable",fn:(()=>{const e=D();return void 0!==e.DataTable&&void 0!==e.jQuery})()?c.default:null,collection:"$hsDataTableCollection"},{key:"datepicker",fn:void 0!==D().VanillaCalendarPro?h.default:null,collection:"$hsDatepickerCollection"},{key:"dropdown",fn:u.default,collection:"$hsDropdownCollection"},{key:"file-upload",fn:(()=>{const e=D();return void 0!==e._&&void 0!==e.Dropzone})()?p.default:null,collection:"$hsFileUploadCollection"},{key:"input-number",fn:m.default,collection:"$hsInputNumberCollection"},{key:"layout-splitter",fn:g.default,collection:"$hsLayoutSplitterCollection"},{key:"overlay",fn:v.default,collection:"$hsOverlayCollection"},{key:"pin-input",fn:f.default,collection:"$hsPinInputCollection"},{key:"range-slider",fn:void 0!==D().noUiSlider?y.default:null,collection:"$hsRangeSliderCollection"},{key:"remove-element",fn:b.default,collection:"$hsRemoveElementCollection"},{key:"scroll-nav",fn:w.default,collection:"$hsScrollNavCollection"},{key:"scrollspy",fn:C.default,collection:"$hsScrollspyCollection"},{key:"select",fn:x.default,collection:"$hsSelectCollection"},{key:"stepper",fn:S.default,collection:"$hsStepperCollection"},{key:"strong-password",fn:T.default,collection:"$hsStrongPasswordCollection"},{key:"tabs",fn:k.default,collection:"$hsTabsCollection"},{key:"textarea-auto-height",fn:E.default,collection:"$hsTextareaAutoHeightCollection"},{key:"theme-switch",fn:L.default,collection:"$hsThemeSwitchCollection"},{key:"toggle-count",fn:I.default,collection:"$hsToggleCountCollection"},{key:"toggle-password",fn:A.default,collection:"$hsTogglePasswordCollection"},{key:"tooltip",fn:M.default,collection:"$hsTooltipCollection"},{key:"tree-view",fn:O.default,collection:"$hsTreeViewCollection"}],t.HSStaticMethods={getClassProperty:s.getClassProperty,afterTransition:s.afterTransition,autoInit(e="all"){if("all"===e)return void t.COLLECTIONS.forEach(({fn:e})=>{var t;null===(t=null==e?void 0:e.autoInit)||void 0===t||t.call(e)});const i=Array.isArray(e)?e:[e];t.COLLECTIONS.forEach(({key:e,fn:t})=>{var n;i.includes(e)&&(null===(n=null==t?void 0:t.autoInit)||void 0===n||n.call(t))})},cleanCollection(e="all"){if("undefined"==typeof window)return;if("all"===e)return void t.COLLECTIONS.forEach(({collection:e})=>{window[e]instanceof Array&&(window[e]=[])});const i=Array.isArray(e)?e:[e];t.COLLECTIONS.forEach(({key:e,collection:t})=>{i.includes(e)&&window[t]instanceof Array&&(window[t]=[])})}},t.default=t.HSStaticMethods},8223(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BREAKPOINTS=t.COMBO_BOX_ACCESSIBILITY_KEY_SET=t.SELECT_ACCESSIBILITY_KEY_SET=t.TABS_ACCESSIBILITY_KEY_SET=t.OVERLAY_ACCESSIBILITY_KEY_SET=t.DROPDOWN_ACCESSIBILITY_KEY_SET=t.POSITIONS=void 0,t.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},t.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","ArrowRight","ArrowLeft","Home","End","Enter"],t.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],t.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],t.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Space","Tab"],t.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],t.BREAKPOINTS={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},3158(e,t,i){"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* @version: 5.
|
|
3
|
+
* @version: 5.1.0
|
|
4
4
|
* @author: Preline Labs Ltd.
|
|
5
5
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
6
6
|
* Copyright 2024 Preline Labs Ltd.
|
|
7
|
-
*/var
|
|
7
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.COLLECTIONS=t.HSStaticMethods=t.HSTreeView=t.HSTooltip=t.HSTogglePassword=t.HSToggleCount=t.HSThemeSwitch=t.HSTextareaAutoHeight=t.HSTabs=t.HSStrongPassword=t.HSStepper=t.HSSelect=t.HSScrollspy=t.HSScrollNav=t.HSRemoveElement=t.HSRangeSlider=t.HSPinInput=t.HSOverlay=t.HSLayoutSplitter=t.HSInputNumber=t.HSFileUpload=t.HSDropdown=t.HSDatepicker=t.HSDataTable=t.HSComboBox=t.HSCollapse=t.HSCarousel=t.HSAccordion=t.HSCopyMarkup=void 0;var s=i(8171);Object.defineProperty(t,"HSCopyMarkup",{enumerable:!0,get:function(){return n(s).default}});var o=i(6621);Object.defineProperty(t,"HSAccordion",{enumerable:!0,get:function(){return n(o).default}});var l=i(4701);Object.defineProperty(t,"HSCarousel",{enumerable:!0,get:function(){return n(l).default}});var r=i(2470);Object.defineProperty(t,"HSCollapse",{enumerable:!0,get:function(){return n(r).default}});var a=i(7298);Object.defineProperty(t,"HSComboBox",{enumerable:!0,get:function(){return n(a).default}});var d=i(3747);Object.defineProperty(t,"HSDataTable",{enumerable:!0,get:function(){return n(d).default}});var c=i(1553);Object.defineProperty(t,"HSDatepicker",{enumerable:!0,get:function(){return n(c).default}});var h=i(9608);Object.defineProperty(t,"HSDropdown",{enumerable:!0,get:function(){return n(h).default}});var u=i(9247);Object.defineProperty(t,"HSFileUpload",{enumerable:!0,get:function(){return n(u).default}});var p=i(989);Object.defineProperty(t,"HSInputNumber",{enumerable:!0,get:function(){return n(p).default}});var m=i(69);Object.defineProperty(t,"HSLayoutSplitter",{enumerable:!0,get:function(){return n(m).default}});var g=i(4343);Object.defineProperty(t,"HSOverlay",{enumerable:!0,get:function(){return n(g).default}});var v=i(4061);Object.defineProperty(t,"HSPinInput",{enumerable:!0,get:function(){return n(v).default}});var f=i(4808);Object.defineProperty(t,"HSRangeSlider",{enumerable:!0,get:function(){return n(f).default}});var y=i(1148);Object.defineProperty(t,"HSRemoveElement",{enumerable:!0,get:function(){return n(y).default}});var b=i(5308);Object.defineProperty(t,"HSScrollNav",{enumerable:!0,get:function(){return n(b).default}});var w=i(9948);Object.defineProperty(t,"HSScrollspy",{enumerable:!0,get:function(){return n(w).default}});var C=i(591);Object.defineProperty(t,"HSSelect",{enumerable:!0,get:function(){return n(C).default}});var x=i(8572);Object.defineProperty(t,"HSStepper",{enumerable:!0,get:function(){return n(x).default}});var S=i(8962);Object.defineProperty(t,"HSStrongPassword",{enumerable:!0,get:function(){return n(S).default}});var T=i(5803);Object.defineProperty(t,"HSTabs",{enumerable:!0,get:function(){return n(T).default}});var k=i(6473);Object.defineProperty(t,"HSTextareaAutoHeight",{enumerable:!0,get:function(){return n(k).default}});var E=i(9419);Object.defineProperty(t,"HSThemeSwitch",{enumerable:!0,get:function(){return n(E).default}});var L=i(1717);Object.defineProperty(t,"HSToggleCount",{enumerable:!0,get:function(){return n(L).default}});var I=i(8549);Object.defineProperty(t,"HSTogglePassword",{enumerable:!0,get:function(){return n(I).default}});var A=i(4986);Object.defineProperty(t,"HSTooltip",{enumerable:!0,get:function(){return n(A).default}});var M=i(4957);Object.defineProperty(t,"HSTreeView",{enumerable:!0,get:function(){return n(M).default}});var O=i(9119);Object.defineProperty(t,"HSStaticMethods",{enumerable:!0,get:function(){return n(O).default}}),Object.defineProperty(t,"COLLECTIONS",{enumerable:!0,get:function(){return O.COLLECTIONS}})},248(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(292);t.default=class{constructor(){this.components=[],this.currentlyOpenedComponents=[],this.activeComponent=null,this.allowedKeybindings=new Set(["Escape","Enter"," ","Space","ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Tab","Home","End"]),this.initGlobalListeners()}initGlobalListeners(){document.addEventListener("keydown",e=>this.handleGlobalKeydown(e)),document.addEventListener("focusin",e=>this.handleGlobalFocusin(e))}isAllowedKeybinding(e){return!!this.allowedKeybindings.has(e.key)||!(1!==e.key.length||!/^[a-zA-Z]$/.test(e.key)||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)}getActiveComponent(e){if(!e)return null;const t=this.components.filter(t=>t.wrapper.contains(e)||t.context&&t.context.contains(e));if(0===t.length)return null;if(1===t.length)return t[0];let i=null,n=Number.MAX_SAFE_INTEGER;for(const s of t){let t=0,o=e;for(;o&&o!==s.wrapper&&o!==s.context;)t++,o=o.parentElement;t<n&&(n=t,i=s)}return i}getActiveComponentForKey(e,t){if(!e)return null;const i=this.components.filter(t=>t.wrapper.contains(e)||t.context&&t.context.contains(e));if(0===i.length)return null;const n=i.filter(e=>{const i=e.handlers;switch(t){case"Escape":return!!i.onEsc;case"Enter":return!!i.onEnter;case" ":case"Space":return!!i.onSpace;case"ArrowDown":case"ArrowUp":case"ArrowLeft":case"ArrowRight":return!!i.onArrow;case"Tab":return!!i.onTab||!!i.onShiftTab;case"Home":return!!i.onHome;case"End":return!!i.onEnd;default:return!!i.onFirstLetter}});if(0===n.length)return this.getActiveComponent(e);if(1===n.length)return n[0];let s=null,o=Number.MAX_SAFE_INTEGER;for(const t of n){let i=0,n=e;for(;n&&n!==t.wrapper&&n!==t.context;)i++,n=n.parentElement;i<o&&(o=i,s=t)}return s}getDistanceToComponent(e,t){let i=0,n=e;for(;n&&n!==t.wrapper&&n!==t.context;)i++,n=n.parentElement;return i}getComponentsByNesting(e){if(!e)return[];const t=this.components.filter(t=>t.wrapper.contains(e)||t.context&&t.context.contains(e));return t.length<=1?t:[...t].sort((t,i)=>this.getDistanceToComponent(e,i)-this.getDistanceToComponent(e,t))}getSequentialHandlersForKey(e,t){const i=this.getComponentsByNesting(e);return 0===i.length?[]:i.map(i=>"Enter"===t?i.onEnterSelfOnly&&i.wrapper!==e?void 0:i.handlers.onEnter:i.handlers.onSpace).filter(e=>"function"==typeof e)}executeSequentialHandlers(e,t){let i=!1,n=!1;for(const s of e){i=!0;if(!1===s(t)){n=!0;break}}return{called:i,stopped:n}}handleGlobalFocusin(e){const t=e.target;this.activeComponent=this.getActiveComponent(t)}handleGlobalKeydown(e){var t;const i=e.target;this.activeComponent=this.getActiveComponentForKey(i,e.key);const s=this.activeComponent,o="Enter"===e.key||" "===e.key||"Space"===e.key;if((s||o)&&this.isAllowedKeybinding(e))switch(e.key){case"Escape":if(!s)break;if(s.isOpened){if(s.handlers.onEsc){const t=s.handlers.onEsc();if(e.preventDefault(),e.stopPropagation(),!1===t){const e=this.findClosestOpenParent(i);(null==e?void 0:e.handlers.onEsc)&&e.handlers.onEsc()}}}else{const t=this.findClosestOpenParent(i);(null==t?void 0:t.handlers.onEsc)&&(t.handlers.onEsc(),e.preventDefault(),e.stopPropagation())}break;case"Enter":{const t=this.getSequentialHandlersForKey(i,"Enter");if(0===t.length)break;const{called:s,stopped:o}=this.executeSequentialHandlers(t,e);if(s&&!(0,n.isFormElement)(i)&&(e.stopPropagation(),e.preventDefault()),o)break;break}case" ":case"Space":{if("INPUT"===i.tagName||"TEXTAREA"===i.tagName)return;const t=this.getActiveComponent(i),n=this.getSequentialHandlersForKey(i,"Space");if(0===n.length)break;const{stopped:s}=this.executeSequentialHandlers(n);(s||(null==t?void 0:t.handlers.onSpace))&&(e.preventDefault(),e.stopPropagation());break}case"ArrowDown":case"ArrowUp":case"ArrowLeft":case"ArrowRight":if(!s)break;if(s.handlers.onArrow){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;s.handlers.onArrow(e),e.preventDefault(),e.stopPropagation()}break;case"Tab":if(!s)break;if(!s.handlers.onTab)break;const o=e.shiftKey?s.handlers.onShiftTab:s.handlers.onTab;o&&o(e);break;case"Home":if(!s)break;s.handlers.onHome&&(s.handlers.onHome(),e.preventDefault(),e.stopPropagation());break;case"End":if(!s)break;s.handlers.onEnd&&(s.handlers.onEnd(),e.preventDefault(),e.stopPropagation());break;default:if(!s)break;if(s.handlers.onFirstLetter&&1===e.key.length&&/^[a-zA-Z]$/.test(e.key)){if(s.handlers.onFirstLetter(e.key),!(null===(t=s.stopPropagation)||void 0===t?void 0:t.onFirstLetter))return;e.preventDefault(),e.stopPropagation()}}}findClosestOpenParent(e){let t=e.parentElement;for(;t;){const e=this.currentlyOpenedComponents.find(e=>e.wrapper===t&&e!==this.activeComponent);if(e)return e;t=t.parentElement}return null}registerComponent(e,t,i=!0,n="",s="",o,l){const r={wrapper:e,handlers:t,isOpened:i,name:n,selector:s,context:o,isRegistered:!0,stopPropagation:l};return this.components.push(r),r}updateComponentState(e,t){e.isOpened=t,t?this.currentlyOpenedComponents.includes(e)||this.currentlyOpenedComponents.push(e):this.currentlyOpenedComponents=this.currentlyOpenedComponents.filter(t=>t!==e)}unregisterComponent(e){this.components=this.components.filter(t=>t!==e),this.currentlyOpenedComponents=this.currentlyOpenedComponents.filter(t=>t!==e)}addAllowedKeybinding(e){this.allowedKeybindings.add(e)}removeAllowedKeybinding(e){this.allowedKeybindings.delete(e)}getAllowedKeybindings(){return Array.from(this.allowedKeybindings)}}},6621(e,t,i){"use strict";
|
|
8
8
|
/*
|
|
9
9
|
* HSAccordion
|
|
10
|
-
* @version: 5.
|
|
10
|
+
* @version: 5.1.0
|
|
11
11
|
* @author: Preline Labs Ltd.
|
|
12
12
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
13
13
|
* Copyright 2024 Preline Labs Ltd.
|
|
14
|
-
*/var
|
|
14
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=n(i(2961));class l extends o.default{constructor(e,t,i){super(e,t,i),this.toggle=this.el.querySelector(".hs-accordion-toggle")||null,this.content=this.el.querySelector(".hs-accordion-content")||null,this.group=this.el.closest(".hs-accordion-group")||null,this.isAlwaysOpened=!1,this.keepOneOpen=!1,this.isToggleStopPropagated=!1,window.$hsAccordionCollection||(window.$hsAccordionCollection=[]),this.update(),this.isToggleStopPropagated=(0,s.stringToBoolean)((0,s.getClassProperty)(this.toggle,"--stop-propagation","false")||"false"),this.keepOneOpen=!!this.group&&(0,s.stringToBoolean)((0,s.getClassProperty)(this.group,"--keep-one-open","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){if(this.el.classList.contains("active")&&this.keepOneOpen)return!1;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 > .hs-accordion.active")&&this.group.querySelector(":scope > .hs-accordion.active")!==this.el){window.$hsAccordionCollection.find(e=>e.element.el===this.group.querySelector(":scope > .hs-accordion.active")).element.hide()}if(this.el.classList.contains("active"))return!1;this.el.classList.add("active"),(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.fireEvent("beforeOpen",this.el),(0,s.dispatch)("beforeOpen.hs.accordion",this.el,this.el),this.content.style.display="block",this.content.style.height="0",setTimeout(()=>{this.content.style.height=`${this.content.scrollHeight}px`,(0,s.afterTransition)(this.content,()=>{this.content.style.display="block",this.content.style.height="",this.fireEvent("open",this.el),(0,s.dispatch)("open.hs.accordion",this.el,this.el)})})}hide(){var e;if(!this.el.classList.contains("active"))return!1;this.el.classList.remove("active"),(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.fireEvent("beforeClose",this.el),(0,s.dispatch)("beforeClose.hs.accordion",this.el,this.el),this.content.style.height=`${this.content.scrollHeight}px`,setTimeout(()=>{this.content.style.height="0"}),(0,s.afterTransition)(this.content,()=>{this.content.style.display="none",this.content.style.height="",this.fireEvent("close",this.el),(0,s.dispatch)("close.hs.accordion",this.el,this.el)})}update(){return this.group=this.el.closest(".hs-accordion-group")||null,!!this.group&&(this.isAlwaysOpened=this.group.hasAttribute("data-hs-accordion-always-open")||!1,!!window.$hsAccordionCollection&&void 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==l?void 0:l.selectable)||void 0===e?void 0:e.length)&&l.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 findInCollection(e){return window.$hsAccordionCollection.find(t=>e instanceof l?t.element.el===e.el:"string"==typeof e?t.element.el===document.querySelector(e):t.element.el===e)||null}static autoInit(){window.$hsAccordionCollection||(window.$hsAccordionCollection=[]),window.$hsAccordionCollection&&(window.$hsAccordionCollection=window.$hsAccordionCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll(".hs-accordion: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 l(e)})}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=l.findInCollection(e);t&&"block"!==t.element.content.style.display&&t.element.show()}static hide(e){const t=l.findInCollection(e),i=t?window.getComputedStyle(t.element.content):null;t&&"none"!==i.display&&t.element.hide()}static treeView(){if(!document.querySelectorAll(".hs-accordion-treeview-root").length)return!1;this.selectable=[],document.querySelectorAll(".hs-accordion-treeview-root").forEach(e=>{const t=null==e?void 0:e.getAttribute("data-hs-accordion-options"),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(".hs-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(".hs-accordion-selectable").forEach(e=>e.classList.remove("selected")),t.classList.add("selected"))}static on(e,t,i){const n=l.findInCollection(t);n&&(n.element.events[e]=i)}}l.onSelectableClick=(e,t,i)=>{e.stopPropagation(),l.toggleSelected(t,i)},t.default=l},2961(e,t){"use strict";
|
|
15
15
|
/*
|
|
16
16
|
* HSBasePlugin
|
|
17
|
-
* @version: 5.
|
|
17
|
+
* @version: 5.1.0
|
|
18
18
|
* @author: Preline Labs Ltd.
|
|
19
19
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
20
20
|
* Copyright 2024 Preline Labs Ltd.
|
|
21
|
-
*/Object.defineProperty(t,"__esModule",{value:!0});t.default=class{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,
|
|
21
|
+
*/Object.defineProperty(t,"__esModule",{value:!0});t.default=class{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,n;let s=e;if(!Array.isArray(s)&&"undefined"!=typeof window){const e=null===(i=this.constructor)||void 0===i?void 0:i.name,t="string"==typeof e&&e.startsWith("HS")?`$hs${e.slice(2)}Collection`:null;t&&(Array.isArray(window[t])||(window[t]=[]),s=window[t])}Array.isArray(s)&&s.push({id:(null===(n=null==t?void 0:t.el)||void 0===n?void 0:n.id)||s.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}}},4701(e,t,i){"use strict";
|
|
22
22
|
/*
|
|
23
23
|
* HSCarousel
|
|
24
|
-
* @version: 5.
|
|
24
|
+
* @version: 5.1.0
|
|
25
25
|
* @author: Preline Labs Ltd.
|
|
26
26
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
27
27
|
* Copyright 2024 Preline Labs Ltd.
|
|
28
|
-
*/var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(292),o=s(i(2961)),l=i(8223);class r extends o.default{constructor(e,t){var i,s,n,o,l;super(e,t);const r=e.getAttribute("data-hs-carousel"),a=r?JSON.parse(r):{},c=Object.assign(Object.assign({},a),t);this.currentIndex=c.currentIndex||0,this.loadingClasses=c.loadingClasses?`${c.loadingClasses}`.split(","):null,this.dotsItemClasses=c.dotsItemClasses?c.dotsItemClasses:null,this.isAutoHeight=void 0!==c.isAutoHeight&&c.isAutoHeight,this.isAutoPlay=void 0!==c.isAutoPlay&&c.isAutoPlay,this.isCentered=void 0!==c.isCentered&&c.isCentered,this.isDraggable=void 0!==c.isDraggable&&c.isDraggable,this.dragThreshold="number"==typeof c.dragThreshold?c.dragThreshold:.2,this.isInfiniteLoop=void 0!==c.isInfiniteLoop&&c.isInfiniteLoop,this.isRTL=void 0!==c.isRTL&&c.isRTL,this.isSnap=void 0!==c.isSnap&&c.isSnap,this.hasSnapSpacers=void 0===c.hasSnapSpacers||c.hasSnapSpacers,this.speed=c.speed||4e3,this.updateDelay=c.updateDelay||0,this.slidesQty=c.slidesQty||1,this.loadingClassesRemove=(null===(i=this.loadingClasses)||void 0===i?void 0:i[0])?this.loadingClasses[0].split(" "):"opacity-0",this.loadingClassesAdd=(null===(s=this.loadingClasses)||void 0===s?void 0:s[1])?this.loadingClasses[1].split(" "):"",this.afterLoadingClassesAdd=(null===(n=this.loadingClasses)||void 0===n?void 0:n[2])?this.loadingClasses[2].split(" "):"",this.container=this.el.querySelector(".hs-carousel")||null,this.inner=this.el.querySelector(".hs-carousel-body")||null,this.slides=this.el.querySelectorAll(".hs-carousel-slide")||[],this.prev=this.el.querySelector(".hs-carousel-prev")||null,this.next=this.el.querySelector(".hs-carousel-next")||null,this.dots=this.el.querySelector(".hs-carousel-pagination")||null,this.info=this.el.querySelector(".hs-carousel-info")||null,this.infoTotal=(null===(o=null==this?void 0:this.info)||void 0===o?void 0:o.querySelector(".hs-carousel-info-total"))||null,this.infoCurrent=(null===(l=null==this?void 0:this.info)||void 0===l?void 0:l.querySelector(".hs-carousel-info-current"))||null,this.sliderWidth=this.el.getBoundingClientRect().width,this.isDragging=!1,this.dragStartX=null,this.dragStartTime=null,this.initialTranslateX=null,this.touchX={start:0,end:0},this.touchY={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));r<n&&(n=r,i=e)}),i&&(s=Array.from(this.slides).findIndex(e=>e===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,this.touchY.start=e.changedTouches[0].screenY}elementTouchEnd(e){this.touchX.end=e.changedTouches[0].screenX,this.touchY.end=e.changedTouches[0].screenY,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.isDraggable||(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.dragStartTime=Date.now(),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?i<n?n:i>e?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()-this.getTargetTranslateX(this.currentIndex),i=this.dragStartTime?Date.now()-this.dragStartTime:1/0,s=e*this.dragThreshold,n=i<=250&&Math.abs(t)>=20;let o=this.currentIndex;t>s||n&&t>0?o=this.currentIndex+1:(t<-s||n&&t<0)&&(o=this.currentIndex-1);const l=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty();o=Math.max(0,Math.min(o,l)),this.inner.classList.remove("dragging"),setTimeout(()=>{this.calculateTransform(o),this.dots&&this.setCurrentDot(),this.dragStartX=null,this.dragStartTime=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]:l.BREAKPOINTS[i])&&(t=this.slidesQty[i])}),t}return this.slidesQty}buildSnapSpacers(){const e=this.inner.querySelector(".hs-snap-before"),t=this.inner.querySelector(".hs-snap-after");e&&e.remove(),t&&t.remove();const i=this.sliderWidth,s=i/2-i/this.getCurrentSlidesQty()/2,o=(0,n.htmlToElement)(`<div class="hs-snap-before" style="height: 100%; width: ${s}px"></div>`),l=(0,n.htmlToElement)(`<div class="hs-snap-after" style="height: 100%; width: ${s}px"></div>`);this.inner.prepend(o),this.inner.appendChild(l)}initDots(){this.el.querySelectorAll(".hs-carousel-pagination-item").length?this.setDots():this.buildDots(),this.dots&&this.setCurrentDot()}buildDots(){this.dots.innerHTML="";const e=!this.isCentered&&this.slidesQty?this.slides.length-(this.getCurrentSlidesQty()-1):this.slides.length;for(let t=0;t<e;t++){const e=this.buildSingleDot(t);this.dots.append(e)}}setDots(){this.dotsItems=this.dots.querySelectorAll(".hs-carousel-pagination-item"),this.dotsItems.forEach((e,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,c=a+l.clientWidth,d=r.top-t.top+s,h=d+l.clientHeight;let u=i,p=s;(a<i||c>i+n)&&(u=c-n),(d<s||h>s+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,n.htmlToElement)("<span></span>");return this.dotsItemClasses&&(0,n.classToClassList)(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,n.debounce)(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.slides.length;t++){const i=this.slides[t];t<=this.currentIndex+e&&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<e?t.classList.add("active"):t.classList.remove("active")})}}setCurrentDot(){const e=(e,t)=>{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 e=this.touchX.end-this.touchX.start,t=this.touchY.end-this.touchY.start,i=Math.abs(e),s=Math.abs(t);if(i<30||i<s)return;const n=this.isRTL?e>0:e<0;this.isInfiniteLoop?n?this.goToNext():this.goToPrev():(n&&this.currentIndex<this.slides.length-this.getCurrentSlidesQty()&&this.goToNext(),!n&&this.currentIndex>0&&this.goToPrev())}getTargetTranslateX(e){const t=this.sliderWidth,i=t/this.getCurrentSlidesQty();let s=e*i;if(this.isCentered&&!this.isSnap){const n=(t-i)/2;if(0===e)s=-n;else if(e>=this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1)){s=this.slides.length*i-t+n}else s=e*i-n}return s}calculateTransform(e){void 0!==e&&(this.currentIndex=e);const t=this.sliderWidth,i=t/this.getCurrentSlidesQty(),s=this.getTargetTranslateX(this.currentIndex);this.isSnap&&!this.isCentered&&this.container.scrollLeft<t&&this.container.scrollLeft+i/2>t&&(this.container.scrollLeft=this.container.scrollWidth),this.isSnap||this.setTransform(s),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()}setTransform(e){this.slides.length>this.getCurrentSlidesQty()?this.inner.style.transform=this.isRTL?`translate(${e}px, 0px)`:`translate(${-e}px, 0px)`:this.inner.style.transform="translate(0px, 0px)"}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(){const e=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty();if(this.currentIndex>0?this.currentIndex--:this.currentIndex=e,this.fireEvent("update",this.currentIndex),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.currentIndex<e?this.currentIndex++:this.currentIndex=0,this.fireEvent("update",this.currentIndex),this.isSnap){const e=this.sliderWidth/this.getCurrentSlidesQty(),t=this.container.scrollWidth-this.container.clientWidth;this.container.scrollBy({left:Math.min(e,t-this.container.scrollLeft),behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()}goTo(e){const t=this.currentIndex;if(this.currentIndex=e,this.fireEvent("update",this.currentIndex),this.isSnap){const e=this.sliderWidth/this.getCurrentSlidesQty(),i=t>this.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.isSnap&&this.hasSnapSpacers&&(this.inner.querySelector(".hs-snap-before").remove(),this.inner.querySelector(".hs-snap-after").remove()),this.dotsItems=null,this.isDragging=!1,this.dragStartX=null,this.dragStartTime=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-hs-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 r(e)})}}t.default=r},2470(e,t,i){"use strict";
|
|
28
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=n(i(2961)),l=i(8223);class r extends o.default{constructor(e,t){var i,n,s,o,l;super(e,t);const r=e.getAttribute("data-hs-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.dragThreshold="number"==typeof d.dragThreshold?d.dragThreshold:.2,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===(n=this.loadingClasses)||void 0===n?void 0:n[1])?this.loadingClasses[1].split(" "):"",this.afterLoadingClassesAdd=(null===(s=this.loadingClasses)||void 0===s?void 0:s[2])?this.loadingClasses[2].split(" "):"",this.container=this.el.querySelector(".hs-carousel")||null,this.inner=this.el.querySelector(".hs-carousel-body")||null,this.slides=this.el.querySelectorAll(".hs-carousel-slide")||[],this.prev=this.el.querySelector(".hs-carousel-prev")||null,this.next=this.el.querySelector(".hs-carousel-next")||null,this.dots=this.el.querySelector(".hs-carousel-pagination")||null,this.info=this.el.querySelector(".hs-carousel-info")||null,this.infoTotal=(null===(o=null==this?void 0:this.info)||void 0===o?void 0:o.querySelector(".hs-carousel-info-total"))||null,this.infoCurrent=(null===(l=null==this?void 0:this.info)||void 0===l?void 0:l.querySelector(".hs-carousel-info-current"))||null,this.sliderWidth=this.el.getBoundingClientRect().width,this.isDragging=!1,this.dragStartX=null,this.dragStartTime=null,this.initialTranslateX=null,this.touchX={start:0,end:0},this.touchY={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,n=null,s=1/0;Array.from(this.inner.children).forEach(e=>{const n=e.getBoundingClientRect(),o=this.inner.getBoundingClientRect(),l=n.left+n.width/2-o.left,r=Math.abs(t-(o.left+l));r<s&&(s=r,i=e)}),i&&(n=Array.from(this.slides).findIndex(e=>e===i)),this.setIndex(n),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,this.touchY.start=e.changedTouches[0].screenY}elementTouchEnd(e){this.touchX.end=e.changedTouches[0].screenX,this.touchY.end=e.changedTouches[0].screenY,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.isDraggable||(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.dragStartTime=Date.now(),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,n=(t-t/this.getCurrentSlidesQty())/2,s=this.isCentered?n:0;this.isCentered&&(e+=n);const o=-e;return this.isRTL?i<s?s:i>e?o:-i:i>s?s:i<-e?o:i})())}handleDragEnd(){if(!this.isDragging)return;this.isDragging=!1;const e=this.sliderWidth/this.getCurrentSlidesQty(),t=this.getTranslateXValue()-this.getTargetTranslateX(this.currentIndex),i=this.dragStartTime?Date.now()-this.dragStartTime:1/0,n=e*this.dragThreshold,s=i<=250&&Math.abs(t)>=20;let o=this.currentIndex;t>n||s&&t>0?o=this.currentIndex+1:(t<-n||s&&t<0)&&(o=this.currentIndex-1);const l=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty();o=Math.max(0,Math.min(o,l)),this.inner.classList.remove("dragging"),setTimeout(()=>{this.calculateTransform(o),this.dots&&this.setCurrentDot(),this.dragStartX=null,this.dragStartTime=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]:l.BREAKPOINTS[i])&&(t=this.slidesQty[i])}),t}return this.slidesQty}buildSnapSpacers(){const e=this.inner.querySelector(".hs-snap-before"),t=this.inner.querySelector(".hs-snap-after");e&&e.remove(),t&&t.remove();const i=this.sliderWidth,n=i/2-i/this.getCurrentSlidesQty()/2,o=(0,s.htmlToElement)(`<div class="hs-snap-before" style="height: 100%; width: ${n}px"></div>`),l=(0,s.htmlToElement)(`<div class="hs-snap-after" style="height: 100%; width: ${n}px"></div>`);this.inner.prepend(o),this.inner.appendChild(l)}initDots(){this.el.querySelectorAll(".hs-carousel-pagination-item").length?this.setDots():this.buildDots(),this.dots&&this.setCurrentDot()}buildDots(){this.dots.innerHTML="";const e=!this.isCentered&&this.slidesQty?this.slides.length-(this.getCurrentSlidesQty()-1):this.slides.length;for(let t=0;t<e;t++){const e=this.buildSingleDot(t);this.dots.append(e)}}setDots(){this.dotsItems=this.dots.querySelectorAll(".hs-carousel-pagination-item"),this.dotsItems.forEach((e,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,n=e.scrollTop,s=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+n,h=c+l.clientHeight;let u=i,p=n;(a<i||d>i+s)&&(u=d-s),(c<n||h>n+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.htmlToElement)("<span></span>");return this.dotsItemClasses&&(0,s.classToClassList)(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.debounce)(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.slides.length;t++){const i=this.slides[t];t<=this.currentIndex+e&&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<e?t.classList.add("active"):t.classList.remove("active")})}}setCurrentDot(){const e=(e,t)=>{let i=!1;const n=Math.floor(this.getCurrentSlidesQty()/2);i=this.isSnap&&!this.hasSnapSpacers?t===(this.getCurrentSlidesQty()%2==0?this.currentIndex-n+1:this.currentIndex-n):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,n=0,s=!1,o=!1;this.isSnap?(i=this.currentIndex,n=this.hasSnapSpacers?this.slides.length-1:this.slides.length-t-1,s=this.hasSnapSpacers?0===i:this.getCurrentSlidesQty()%2==0?i-t<0:i-t===0,o=i>=n&&this.container.scrollLeft+this.container.clientWidth+(parseFloat(e)||0)>=this.container.scrollWidth):(i=this.currentIndex,n=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty(),s=0===i,o=i>=n),s?(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 e=this.touchX.end-this.touchX.start,t=this.touchY.end-this.touchY.start,i=Math.abs(e),n=Math.abs(t);if(i<30||i<n)return;const s=this.isRTL?e>0:e<0;this.isInfiniteLoop?s?this.goToNext():this.goToPrev():(s&&this.currentIndex<this.slides.length-this.getCurrentSlidesQty()&&this.goToNext(),!s&&this.currentIndex>0&&this.goToPrev())}getTargetTranslateX(e){const t=this.sliderWidth,i=t/this.getCurrentSlidesQty();let n=e*i;if(this.isCentered&&!this.isSnap){const s=(t-i)/2;if(0===e)n=-s;else if(e>=this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1)){n=this.slides.length*i-t+s}else n=e*i-s}return n}calculateTransform(e){void 0!==e&&(this.currentIndex=e);const t=this.sliderWidth,i=t/this.getCurrentSlidesQty(),n=this.getTargetTranslateX(this.currentIndex);this.isSnap&&!this.isCentered&&this.container.scrollLeft<t&&this.container.scrollLeft+i/2>t&&(this.container.scrollLeft=this.container.scrollWidth),this.isSnap||this.setTransform(n),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()}setTransform(e){this.slides.length>this.getCurrentSlidesQty()?this.inner.style.transform=this.isRTL?`translate(${e}px, 0px)`:`translate(${-e}px, 0px)`:this.inner.style.transform="translate(0px, 0px)"}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(){const e=this.isCentered?this.slides.length-this.getCurrentSlidesQty()+(this.getCurrentSlidesQty()-1):this.slides.length-this.getCurrentSlidesQty();if(this.currentIndex>0?this.currentIndex--:this.currentIndex=e,this.fireEvent("update",this.currentIndex),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.currentIndex<e?this.currentIndex++:this.currentIndex=0,this.fireEvent("update",this.currentIndex),this.isSnap){const e=this.sliderWidth/this.getCurrentSlidesQty(),t=this.container.scrollWidth-this.container.clientWidth;this.container.scrollBy({left:Math.min(e,t-this.container.scrollLeft),behavior:"smooth"}),this.addCurrentClass(),this.isInfiniteLoop||this.addDisabledClass()}else this.calculateTransform();this.dots&&this.setCurrentDot()}goTo(e){const t=this.currentIndex;if(this.currentIndex=e,this.fireEvent("update",this.currentIndex),this.isSnap){const e=this.sliderWidth/this.getCurrentSlidesQty(),i=t>this.currentIndex?t-this.currentIndex:this.currentIndex-t,n=t>this.currentIndex?-e*i:e*i;this.container.scrollBy({left:n,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.isSnap&&this.hasSnapSpacers&&(this.inner.querySelector(".hs-snap-before").remove(),this.inner.querySelector(".hs-snap-after").remove()),this.dotsItems=null,this.isDragging=!1,this.dragStartX=null,this.dragStartTime=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-hs-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 r(e)})}}t.default=r},2470(e,t,i){"use strict";
|
|
29
29
|
/*
|
|
30
30
|
* HSCollapse
|
|
31
|
-
* @version: 5.
|
|
31
|
+
* @version: 5.1.0
|
|
32
32
|
* @author: Preline Labs Ltd.
|
|
33
33
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
34
34
|
* Copyright 2024 Preline Labs Ltd.
|
|
35
|
-
*/var
|
|
35
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=n(i(2961));class l extends o.default{constructor(e,t,i){super(e,t,i),this.contentId=this.el.dataset.hsCollapse,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(".hs-mega-menu-content.block").forEach(e=>{e.classList.remove("block"),e.classList.add("hidden")})}show(){var e;if(this.animationInProcess||this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.add("open"),(null===(e=null==this?void 0:this.el)||void 0===e?void 0:e.ariaExpanded)&&(this.el.ariaExpanded="true"),this.content.classList.add("open"),this.content.classList.remove("hidden"),this.content.style.height="0",setTimeout(()=>{this.content.style.height=`${this.content.scrollHeight}px`,this.fireEvent("beforeOpen",this.el),(0,s.dispatch)("beforeOpen.hs.collapse",this.el,this.el),(0,s.afterTransition)(this.content,()=>{this.content.style.height="",this.fireEvent("open",this.el),(0,s.dispatch)("open.hs.collapse",this.el,this.el),this.animationInProcess=!1})})}hide(){var e;if(this.animationInProcess||!this.el.classList.contains("open"))return!1;this.animationInProcess=!0,this.el.classList.remove("open"),(null===(e=null==this?void 0:this.el)||void 0===e?void 0:e.ariaExpanded)&&(this.el.ariaExpanded="false"),this.content.style.height=`${this.content.scrollHeight}px`,setTimeout(()=>{this.content.style.height="0"}),this.content.classList.remove("open"),(0,s.afterTransition)(this.content,()=>{this.content.classList.add("hidden"),this.content.style.height="",this.fireEvent("hide",this.el),(0,s.dispatch)("hide.hs.collapse",this.el,this.el),this.animationInProcess=!1}),this.content.querySelectorAll(".hs-mega-menu-content.block").length&&this.hideAllMegaMenuItems()}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 findInCollection(e){return window.$hsCollapseCollection.find(t=>e instanceof l?t.element.el===e.el:"string"==typeof e?t.element.el===document.querySelector(e):t.element.el===e)||null}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(".hs-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=l.findInCollection(e);t&&t.element.content.classList.contains("hidden")&&t.element.show()}static hide(e){const t=l.findInCollection(e);t&&!t.element.content.classList.contains("hidden")&&t.element.hide()}static on(e,t,i){const n=l.findInCollection(t);n&&(n.element.events[e]=i)}}t.default=l},7298(e,t,i){"use strict";
|
|
36
36
|
/*
|
|
37
37
|
* HSComboBox
|
|
38
|
-
* @version: 5.
|
|
38
|
+
* @version: 5.1.0
|
|
39
39
|
* @author: Preline Labs Ltd.
|
|
40
40
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
41
41
|
* Copyright 2024 Preline Labs Ltd.
|
|
42
|
-
*/var s=this&&this.__awaiter||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())})},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(292),l=n(i(2961)),r=n(i(248));class a extends l.default{constructor(e,t,i){var s,n,o,l,r,a,c,d,h,u,p,m,g,v,f,y,b,w,C,S,x,T,L,E,k,I,A,M,O,D,P;super(e,t,i),this.isSearchLengthExceeded=!1,this.lastQuery="";const $=e.getAttribute("data-hs-combo-box"),N=$?JSON.parse($):{},H=Object.assign(Object.assign({},N),t);this.gap=5,this.viewport=null!==(s="string"==typeof(null==H?void 0:H.viewport)?document.querySelector(null==H?void 0:H.viewport):null==H?void 0:H.viewport)&&void 0!==s?s:null,this.preventVisibility=null!==(n=null==H?void 0:H.preventVisibility)&&void 0!==n&&n,this.minSearchLength=null!==(o=null==H?void 0:H.minSearchLength)&&void 0!==o?o:0,this.apiUrl=null!==(l=null==H?void 0:H.apiUrl)&&void 0!==l?l:null,this.apiDataPart=null!==(r=null==H?void 0:H.apiDataPart)&&void 0!==r?r:null,this.apiQuery=null!==(a=null==H?void 0:H.apiQuery)&&void 0!==a?a:null,this.apiSearchQuery=null!==(c=null==H?void 0:H.apiSearchQuery)&&void 0!==c?c:null,this.apiSearchPath=null!==(d=null==H?void 0:H.apiSearchPath)&&void 0!==d?d:null,this.apiSearchDefaultPath=null!==(h=null==H?void 0:H.apiSearchDefaultPath)&&void 0!==h?h:null,this.apiHeaders=null!==(u=null==H?void 0:H.apiHeaders)&&void 0!==u?u:{},this.apiGroupField=null!==(p=null==H?void 0:H.apiGroupField)&&void 0!==p?p:null,this.outputItemTemplate=null!==(m=null==H?void 0:H.outputItemTemplate)&&void 0!==m?m:'<div class="cursor-pointer py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800" data-hs-combo-box-output-item>\n\t\t\t\t<div class="flex justify-between items-center w-full">\n\t\t\t\t\t<span data-hs-combo-box-search-text></span>\n\t\t\t\t\t<span class="hidden hs-combo-box-selected:block">\n\t\t\t\t\t\t<svg class="shrink-0 size-3.5 text-blue-600 dark:text-blue-500" xmlns="http:.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n\t\t\t\t\t\t\t<polyline points="20 6 9 17 4 12"></polyline>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t</div>',this.outputEmptyTemplate=null!==(g=null==H?void 0:H.outputEmptyTemplate)&&void 0!==g?g:'<div class="py-2 px-4 w-full text-sm text-gray-800 rounded-lg dark:bg-neutral-900 dark:text-neutral-200">Nothing found...</div>',this.outputLoaderTemplate=null!==(v=null==H?void 0:H.outputLoaderTemplate)&&void 0!==v?v:'<div class="flex justify-center items-center py-2 px-4 text-sm text-gray-800 rounded-lg bg-white dark:bg-neutral-900 dark:text-neutral-200">\n\t\t\t\t<div class="animate-spin inline-block size-6 border-3 border-current border-t-transparent text-blue-600 rounded-[999px] dark:text-blue-500" role="status" aria-label="loading">\n\t\t\t\t\t<span class="sr-only">Loading...</span>\n\t\t\t\t</div>\n\t\t\t</div>',this.groupingType=null!==(f=null==H?void 0:H.groupingType)&&void 0!==f?f:null,this.groupingTitleTemplate=null!==(y=null==H?void 0:H.groupingTitleTemplate)&&void 0!==y?y:"default"===this.groupingType?'<div class="block mb-1 text-xs font-semibold uppercase text-blue-600 dark:text-blue-500"></div>':'<button type="button" class="py-2 px-3 inline-flex items-center gap-x-2 text-sm font-semibold whitespace-nowrap rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none"></button>',this.tabsWrapperTemplate=null!==(b=null==H?void 0:H.tabsWrapperTemplate)&&void 0!==b?b:'<div class="overflow-x-auto p-4"></div>',this.preventSelection=null!==(w=null==H?void 0:H.preventSelection)&&void 0!==w&&w,this.preventAutoPosition=null!==(C=null==H?void 0:H.preventAutoPosition)&&void 0!==C&&C,this.preventClientFiltering=null!==(S=null==t?void 0:t.preventClientFiltering)&&void 0!==S?S:!!(null==H?void 0:H.apiSearchQuery)||!!(null==H?void 0:H.apiSearchPath),this.isOpenOnFocus=null!==(x=null==H?void 0:H.isOpenOnFocus)&&void 0!==x&&x,this.keepOriginalOrder=null!==(T=null==H?void 0:H.keepOriginalOrder)&&void 0!==T&&T,this.preserveSelectionOnEmpty=null===(L=null==H?void 0:H.preserveSelectionOnEmpty)||void 0===L||L,this.input=null!==(E=this.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==E?E:null,this.output=null!==(k=this.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==k?k:null,this.itemsWrapper=null!==(I=this.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==I?I:null,this.items=null!==(A=Array.from(this.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==A?A:[],this.tabs=[],this.toggle=null!==(M=this.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==M?M:null,this.toggleClose=null!==(O=this.el.querySelector("[data-hs-combo-box-close]"))&&void 0!==O?O:null,this.toggleOpen=null!==(D=this.el.querySelector("[data-hs-combo-box-open]"))&&void 0!==D?D:null,this.outputPlaceholder=null,this.selected=this.value=null!==(P=this.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==P?P:"",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(){const e=this.input.value.trim();e.length<=this.minSearchLength?this.setResultAndRender(""):this.setResultAndRender(e),this.preserveSelectionOnEmpty||""!==e||(this.selected="",this.value="",this.currentData=null),""!==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-hs-combo-box-toggle"))}toggleCloseClick(){this.close()}toggleOpenClick(){this.open()}init(){a.ensureGlobalHandlers(),this.createCollection(window.$hsComboBoxCollection,this),this.build(),"undefined"!=typeof window&&(window.HSAccessibilityObserver||(window.HSAccessibilityObserver=new r.default),this.setupAccessibility())}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,o.dispatch)("select.hs.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=>{const i=t.querySelector("[data-hs-combo-box-value]");i&&e.includes(i.textContent)?t.classList.add("selected"):t.classList.remove("selected")})}setResultAndRender(e=""){const t=(this.preventVisibility?this.input.value:e).trim(),i=t.length<this.minSearchLength;this.isSearchLengthExceeded=i,t!==this.lastQuery?(this.lastQuery=t,this.setResults(t),!i&&(this.apiSearchQuery||this.apiSearchPath||this.apiSearchDefaultPath)&&this.itemsFromJson(),this.updatePlaceholderVisibility()):this.updatePlaceholderVisibility()}setResults(e){this.value=e,this.resultItems(),this.updatePlaceholderVisibility()}updatePlaceholderVisibility(){this.hasVisibleItems()?this.destroyOutputPlaceholder():this.buildOutputPlaceholder()}setGroups(){const e=[];this.items.forEach(t=>{const{group:i}=JSON.parse(t.getAttribute("data-hs-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(){if(this.preventClientFiltering)return this.items.forEach(e=>{e.style.display=""}),!1;"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-hs-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-hs-combo-box-group-title]").forEach(e=>{const t=e.getAttribute("data-hs-combo-box-group-title");this.items.filter(e=>{const{group:i}=JSON.parse(e.getAttribute("data-hs-combo-box-output-item"));return i.name===t&&"block"===e.style.display}).length?e.style.display="block":e.style.display="none"})}isTextExistsAny(e,t){return Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some(e=>e.getAttribute("data-hs-combo-box-search-text").toLowerCase().includes(t.toLowerCase()))}hasVisibleItems(){return!!this.items.length&&this.items.some(e=>{const t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility})}valuesBySelector(e){return Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).reduce((e,t)=>[...e,t.getAttribute("data-hs-combo-box-search-text")],[])}sortItems(){if(this.keepOriginalOrder)return this.items;return this.items.sort((e,t)=>{const i=e.querySelector("[data-hs-combo-box-value]").textContent,s=t.querySelector("[data-hs-combo-box-value]").textContent;return i<s?-1:i>s?1:0})}buildInput(){this.isOpenOnFocus&&(this.onInputFocusListener=()=>this.inputFocus(),this.input.addEventListener("focus",this.onInputFocusListener)),this.onInputInputListener=(0,o.debounce)(()=>this.inputInput()),this.input.addEventListener("input",this.onInputInputListener),this.input.addEventListener("paste",e=>{var t,i,s,n,o;const l=null!==(i=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text"))&&void 0!==i?i:"";e.preventDefault();const r=null!==(s=this.input.selectionStart)&&void 0!==s?s:this.input.value.length,a=null!==(n=this.input.selectionEnd)&&void 0!==n?n:this.input.value.length,c=this.input.value.slice(0,r)+l+this.input.value.slice(a);this.input.value=c,null===(o=this.onInputInputListener)||void 0===o||o.call(this,new InputEvent("input",{inputType:"insertFromPaste",data:l}))})}buildItems(){return s(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()),(null==this?void 0:this.items.length)&&this.items[0].classList.contains("selected")&&(this.currentData=JSON.parse(this.items[0].getAttribute("data-hs-combo-box-item-stored-data")))})}buildOutputLoader(){if(this.outputLoader)return!1;this.outputLoader=(0,o.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)}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,o.htmlToElement)(this.outputEmptyTemplate)),this.appendItemsToWrapper(this.outputPlaceholder)}destroyOutputLoader(){this.outputLoader&&this.outputLoader.remove(),this.outputLoader=null}itemRender(e){var t;const i=e.querySelector("[data-hs-combo-box-value]").textContent,s=null!==(t=JSON.parse(e.getAttribute("data-hs-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,t=0){e.forEach(e=>{const i=(0,o.htmlToElement)(this.outputItemTemplate);i.setAttribute("data-hs-combo-box-item-stored-data",JSON.stringify(e)),i.querySelectorAll("[data-hs-combo-box-output-item-field]").forEach(t=>{const i=t.getAttribute("data-hs-combo-box-output-item-field");let s="";try{const t=JSON.parse(i);s=Array.isArray(t)?t.map(t=>this.getNestedProperty(e,t)).filter(Boolean).join(" "):this.getNestedProperty(e,i)}catch(t){s=this.getNestedProperty(e,i)}t.textContent=null!=s?s:"",!s&&t.hasAttribute("data-hs-combo-box-output-item-hide-if-empty")&&(t.style.display="none")}),i.querySelectorAll("[data-hs-combo-box-search-text]").forEach(t=>{const i=t.getAttribute("data-hs-combo-box-output-item-field");let s="";try{const t=JSON.parse(i);s=Array.isArray(t)?t.map(t=>this.getNestedProperty(e,t)).filter(Boolean).join(" "):this.getNestedProperty(e,i)}catch(t){s=this.getNestedProperty(e,i)}t.setAttribute("data-hs-combo-box-search-text",null!=s?s:"")}),i.querySelectorAll("[data-hs-combo-box-output-item-attr]").forEach(t=>{JSON.parse(t.getAttribute("data-hs-combo-box-output-item-attr")).forEach(i=>{let s=e[i.valueFrom];"class"===i.attr&&t.className?t.className=`${t.className} ${s}`.trim():t.setAttribute(i.attr,s)})}),i.setAttribute("tabIndex",`${t}`),"tabs"!==this.groupingType&&"default"!==this.groupingType||i.setAttribute("data-hs-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-hs-combo-box-value]").textContent,JSON.parse(i.getAttribute("data-hs-combo-box-item-stored-data"))),this.setSelectedByValue(this.valuesBySelector(i))}),this.appendItemsToWrapper(i),t++})}groupDefaultRender(){this.groups.forEach(e=>{const t=(0,o.htmlToElement)(this.groupingTitleTemplate);t.setAttribute("data-hs-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-hs-combo-box-output-item"));return i.name===e.name});this.plainRender(i)})}groupTabsRender(){const e=(0,o.htmlToElement)(this.tabsWrapperTemplate),t=(0,o.htmlToElement)('<div class="flex flex-nowrap gap-x-2"></div>');e.append(t),this.output.insertBefore(e,this.output.firstChild);const i=(0,o.htmlToElement)(this.groupingTitleTemplate);i.setAttribute("data-hs-combo-box-group-title","all"),i.classList.add("--exclude-accessibility","active"),i.innerText="All",this.tabs=[...this.tabs,i],t.append(i),i.addEventListener("click",()=>{this.selectedGroup="all";const e=this.tabs.find(e=>e.getAttribute("data-hs-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,o.htmlToElement)(this.groupingTitleTemplate);i.setAttribute("data-hs-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-hs-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 s(this,void 0,void 0,function*(){if(this.isSearchLengthExceeded)return this.buildOutputPlaceholder(),!1;this.buildOutputLoader();try{this.queryAbortController&&this.queryAbortController.abort();const e=new AbortController;this.queryAbortController=e;const t=`${this.apiQuery}`;let i,s,n=this.apiUrl;!this.apiSearchQuery&&this.apiSearchPath?(s=this.apiSearchDefaultPath&&""===this.value?`/${this.apiSearchDefaultPath}`:`/${this.apiSearchPath}/${this.value.toLowerCase()}`,(this.apiSearchPath||this.apiSearchDefaultPath)&&(n+=s)):(i=`${this.apiSearchQuery}=${this.value.toLowerCase()}`,this.apiQuery&&this.apiSearchQuery?n+=`?${i}&${t}`:this.apiQuery?n+=`?${t}`:this.apiSearchQuery&&(n+=`?${i}`));const l=yield fetch(n,Object.assign(Object.assign({},this.apiHeaders),{signal:e.signal}));if(!l.ok)return this.items=[],this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="",void this.setResults(this.input.value);let r=yield l.json();if(this.apiDataPart&&(r=r[this.apiDataPart]),Array.isArray(r)||(r=[]),(this.apiSearchQuery||this.apiSearchPath)&&(this.items=[]),this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="","tabs"===this.groupingType)this.setApiGroups(r),this.groupTabsRender(),this.jsonItemsRender(r);else if("default"===this.groupingType){let e=0;this.setApiGroups(r),this.groups.forEach(t=>{const i=(0,o.htmlToElement)(this.groupingTitleTemplate);i.setAttribute("data-hs-combo-box-group-title",t.name),i.classList.add("--exclude-accessibility"),i.innerText=t.title;const s=r.filter(e=>e[this.apiGroupField]===t.name);this.itemsWrapper?this.itemsWrapper.append(i):this.output.append(i),this.jsonItemsRender(s,e),e+=s.length})}else this.jsonItemsRender(r);this.setResults(this.input.value.length<=this.minSearchLength?"":this.input.value),this.updatePlaceholderVisibility()}catch(e){console.error("Error fetching items:",e),this.items=[],this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="",this.setResults(this.input.value)}finally{this.queryAbortController&&this.queryAbortController.signal.aborted&&(this.queryAbortController=void 0),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}setHighlighted(e,t,i){t.focus(),i.value=t.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text"),e&&e.classList.remove("hs-combo-box-output-item-highlighted"),t.classList.add("hs-combo-box-output-item-highlighted")}setupAccessibility(){var e;const t=null!==(e=this.itemsWrapper)&&void 0!==e?e:this.output;this.accessibilityComponent=window.HSAccessibilityObserver.registerComponent(this.el,{onEnter:e=>this.onEnter(e),onSpace:()=>this.onEnter(),onEsc:()=>{if(this.isOpened&&(this.close(),this.input&&this.input.focus(),this.preventVisibility))return!1},onArrow:e=>{if(this.isOpened||"ArrowDown"!==e.key){if(this.isOpened)switch(e.key){case"ArrowDown":this.focusMenuItem("next");break;case"ArrowUp":this.focusMenuItem("prev");break;case"Home":this.onStartEnd(!0);break;case"End":this.onStartEnd(!1)}}else this.open()},onTab:e=>{this.isOpened&&(e.preventDefault(),e.stopPropagation(),this.focusMenuItem("next"))},onShiftTab:e=>{this.isOpened&&(e.preventDefault(),e.stopPropagation(),this.focusMenuItem("prev"))}},this.isOpened,"ComboBox","[data-hs-combo-box]",t)}onEnter(e){var t,i,s;if(this.isOpened){const n=this.output.querySelector(".hs-combo-box-output-item-highlighted");if(n){this.close(null!==(i=null===(t=n.querySelector("[data-hs-combo-box-value]"))||void 0===t?void 0:t.getAttribute("data-hs-combo-box-search-text"))&&void 0!==i?i:null,null!==(s=JSON.parse(n.getAttribute("data-hs-combo-box-item-stored-data")))&&void 0!==s?s:null);const o="A"===n.tagName?n:n.querySelector("a[href]");if(null==o?void 0:o.href)return void((null==e?void 0:e.metaKey)||(null==e?void 0:e.ctrlKey)?window.open(o.href,"_blank","noopener"):window.location.href=o.href);this.input&&this.input.focus()}}else this.open()}focusMenuItem(e){var t;const i=null!==(t=this.itemsWrapper)&&void 0!==t?t:this.output;if(!i)return!1;const s=Array.from(i.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter(e=>"none"!==e.style.display);if(!s.length)return!1;const n=i.querySelector(".hs-combo-box-output-item-highlighted"),o=n?s.indexOf(n):-1,l="next"===e?(o+1)%s.length:(o-1+s.length)%s.length;n&&n.classList.remove("hs-combo-box-output-item-highlighted"),s[l].classList.add("hs-combo-box-output-item-highlighted"),s[l].focus(),this.input.value=s[l].querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text")}onStartEnd(e=!0){var t;const i=null!==(t=this.itemsWrapper)&&void 0!==t?t:this.output;if(!i)return!1;const s=Array.from(i.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter(e=>"none"!==e.style.display);if(!s.length)return!1;const n=i.querySelector(".hs-combo-box-output-item-highlighted");this.setHighlighted(n,s[0],this.input)}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.isOpened=!0,this.el.classList.add("active"),window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!0),!1):(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}),this.isOpened=!0,void(window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!0))))}close(e,t=null){var i,s;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.preserveSelectionOnEmpty||""!==this.input.value.trim()||(this.selected="",this.value=""),this.animationInProcess=!0,(null===(i=null==this?void 0:this.input)||void 0===i?void 0:i.ariaExpanded)&&(this.input.ariaExpanded="false"),(null===(s=null==this?void 0:this.toggle)||void 0===s?void 0:s.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.el.classList.remove("active"),this.preventAutoPosition||(this.output.classList.remove("bottom-full","top-full"),this.output.style.marginTop="",this.output.style.marginBottom=""),(0,o.afterTransition)(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"),this.isOpened=!1,void(window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!1))))}recalculateDirection(){(0,o.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=`${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=[],"undefined"!=typeof window&&window.HSAccessibilityObserver&&window.HSAccessibilityObserver.unregisterComponent(this.accessibilityComponent),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(){a.ensureGlobalHandlers(),window.$hsComboBoxCollection&&(window.$hsComboBoxCollection=window.$hsComboBoxCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-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-hs-combo-box"),i=t?JSON.parse(t):{};new a(e,i)}})}static ensureGlobalHandlers(){"undefined"!=typeof window&&(window.$hsComboBoxCollection||(window.$hsComboBoxCollection=[]),a.globalListenersInitialized||(a.globalListenersInitialized=!0,window.addEventListener("click",e=>{const t=e.target;a.closeCurrentlyOpened(t)})))}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-hs-combo-box].active")){const e=window.$hsComboBoxCollection.filter(e=>e.element.isOpened)||null;e&&e.forEach(e=>{e.element.close()})}}}a.globalListenersInitialized=!1,t.default=a},8171(e,t,i){"use strict";
|
|
42
|
+
*/var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(s,o){function l(e){try{a(n.next(e))}catch(e){o(e)}}function r(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(l,r)}a((n=n.apply(e,t||[])).next())})},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(292),l=s(i(2961)),r=s(i(248));class a extends l.default{constructor(e,t,i){var n,s,o,l,r,a,d,c,h,u,p,m,g,v,f,y,b,w,C,x,S,T,k,E,L,I,A,M,O,D,P;super(e,t,i),this.isSearchLengthExceeded=!1,this.lastQuery="";const $=e.getAttribute("data-hs-combo-box"),N=$?JSON.parse($):{},H=Object.assign(Object.assign({},N),t);this.gap=5,this.viewport=null!==(n="string"==typeof(null==H?void 0:H.viewport)?document.querySelector(null==H?void 0:H.viewport):null==H?void 0:H.viewport)&&void 0!==n?n:null,this.preventVisibility=null!==(s=null==H?void 0:H.preventVisibility)&&void 0!==s&&s,this.minSearchLength=null!==(o=null==H?void 0:H.minSearchLength)&&void 0!==o?o:0,this.apiUrl=null!==(l=null==H?void 0:H.apiUrl)&&void 0!==l?l:null,this.apiDataPart=null!==(r=null==H?void 0:H.apiDataPart)&&void 0!==r?r:null,this.apiQuery=null!==(a=null==H?void 0:H.apiQuery)&&void 0!==a?a:null,this.apiSearchQuery=null!==(d=null==H?void 0:H.apiSearchQuery)&&void 0!==d?d:null,this.apiSearchPath=null!==(c=null==H?void 0:H.apiSearchPath)&&void 0!==c?c:null,this.apiSearchDefaultPath=null!==(h=null==H?void 0:H.apiSearchDefaultPath)&&void 0!==h?h:null,this.apiHeaders=null!==(u=null==H?void 0:H.apiHeaders)&&void 0!==u?u:{},this.apiGroupField=null!==(p=null==H?void 0:H.apiGroupField)&&void 0!==p?p:null,this.outputItemTemplate=null!==(m=null==H?void 0:H.outputItemTemplate)&&void 0!==m?m:'<div class="cursor-pointer py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800" data-hs-combo-box-output-item>\n\t\t\t\t<div class="flex justify-between items-center w-full">\n\t\t\t\t\t<span data-hs-combo-box-search-text></span>\n\t\t\t\t\t<span class="hidden hs-combo-box-selected:block">\n\t\t\t\t\t\t<svg class="shrink-0 size-3.5 text-blue-600 dark:text-blue-500" xmlns="http:.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n\t\t\t\t\t\t\t<polyline points="20 6 9 17 4 12"></polyline>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t</div>',this.outputEmptyTemplate=null!==(g=null==H?void 0:H.outputEmptyTemplate)&&void 0!==g?g:'<div class="py-2 px-4 w-full text-sm text-gray-800 rounded-lg dark:bg-neutral-900 dark:text-neutral-200">Nothing found...</div>',this.outputLoaderTemplate=null!==(v=null==H?void 0:H.outputLoaderTemplate)&&void 0!==v?v:'<div class="flex justify-center items-center py-2 px-4 text-sm text-gray-800 rounded-lg bg-white dark:bg-neutral-900 dark:text-neutral-200">\n\t\t\t\t<div class="animate-spin inline-block size-6 border-3 border-current border-t-transparent text-blue-600 rounded-[999px] dark:text-blue-500" role="status" aria-label="loading">\n\t\t\t\t\t<span class="sr-only">Loading...</span>\n\t\t\t\t</div>\n\t\t\t</div>',this.groupingType=null!==(f=null==H?void 0:H.groupingType)&&void 0!==f?f:null,this.groupingTitleTemplate=null!==(y=null==H?void 0:H.groupingTitleTemplate)&&void 0!==y?y:"default"===this.groupingType?'<div class="block mb-1 text-xs font-semibold uppercase text-blue-600 dark:text-blue-500"></div>':'<button type="button" class="py-2 px-3 inline-flex items-center gap-x-2 text-sm font-semibold whitespace-nowrap rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none"></button>',this.tabsWrapperTemplate=null!==(b=null==H?void 0:H.tabsWrapperTemplate)&&void 0!==b?b:'<div class="overflow-x-auto p-4"></div>',this.preventSelection=null!==(w=null==H?void 0:H.preventSelection)&&void 0!==w&&w,this.preventAutoPosition=null!==(C=null==H?void 0:H.preventAutoPosition)&&void 0!==C&&C,this.preventClientFiltering=null!==(x=null==t?void 0:t.preventClientFiltering)&&void 0!==x?x:!!(null==H?void 0:H.apiSearchQuery)||!!(null==H?void 0:H.apiSearchPath),this.isOpenOnFocus=null!==(S=null==H?void 0:H.isOpenOnFocus)&&void 0!==S&&S,this.keepOriginalOrder=null!==(T=null==H?void 0:H.keepOriginalOrder)&&void 0!==T&&T,this.preserveSelectionOnEmpty=null===(k=null==H?void 0:H.preserveSelectionOnEmpty)||void 0===k||k,this.input=null!==(E=this.el.querySelector("[data-hs-combo-box-input]"))&&void 0!==E?E:null,this.output=null!==(L=this.el.querySelector("[data-hs-combo-box-output]"))&&void 0!==L?L:null,this.itemsWrapper=null!==(I=this.el.querySelector("[data-hs-combo-box-output-items-wrapper]"))&&void 0!==I?I:null,this.items=null!==(A=Array.from(this.el.querySelectorAll("[data-hs-combo-box-output-item]")))&&void 0!==A?A:[],this.tabs=[],this.toggle=null!==(M=this.el.querySelector("[data-hs-combo-box-toggle]"))&&void 0!==M?M:null,this.toggleClose=null!==(O=this.el.querySelector("[data-hs-combo-box-close]"))&&void 0!==O?O:null,this.toggleOpen=null!==(D=this.el.querySelector("[data-hs-combo-box-open]"))&&void 0!==D?D:null,this.outputPlaceholder=null,this.selected=this.value=null!==(P=this.el.querySelector("[data-hs-combo-box-input]").value)&&void 0!==P?P:"",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(){const e=this.input.value.trim();e.length<=this.minSearchLength?this.setResultAndRender(""):this.setResultAndRender(e),this.preserveSelectionOnEmpty||""!==e||(this.selected="",this.value="",this.currentData=null),""!==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-hs-combo-box-toggle"))}toggleCloseClick(){this.close()}toggleOpenClick(){this.open()}init(){a.ensureGlobalHandlers(),this.createCollection(window.$hsComboBoxCollection,this),this.build(),"undefined"!=typeof window&&(window.HSAccessibilityObserver||(window.HSAccessibilityObserver=new r.default),this.setupAccessibility())}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,o.dispatch)("select.hs.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=>{const i=t.querySelector("[data-hs-combo-box-value]");i&&e.includes(i.textContent)?t.classList.add("selected"):t.classList.remove("selected")})}setResultAndRender(e=""){const t=(this.preventVisibility?this.input.value:e).trim(),i=t.length<this.minSearchLength;this.isSearchLengthExceeded=i,t!==this.lastQuery?(this.lastQuery=t,this.setResults(t),!i&&(this.apiSearchQuery||this.apiSearchPath||this.apiSearchDefaultPath)&&this.itemsFromJson(),this.updatePlaceholderVisibility()):this.updatePlaceholderVisibility()}setResults(e){this.value=e,this.resultItems(),this.updatePlaceholderVisibility()}updatePlaceholderVisibility(){this.hasVisibleItems()?this.destroyOutputPlaceholder():this.buildOutputPlaceholder()}setGroups(){const e=[];this.items.forEach(t=>{const{group:i}=JSON.parse(t.getAttribute("data-hs-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(){if(this.preventClientFiltering)return this.items.forEach(e=>{e.style.display=""}),!1;"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-hs-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-hs-combo-box-group-title]").forEach(e=>{const t=e.getAttribute("data-hs-combo-box-group-title");this.items.filter(e=>{const{group:i}=JSON.parse(e.getAttribute("data-hs-combo-box-output-item"));return i.name===t&&"block"===e.style.display}).length?e.style.display="block":e.style.display="none"})}isTextExistsAny(e,t){return Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).some(e=>e.getAttribute("data-hs-combo-box-search-text").toLowerCase().includes(t.toLowerCase()))}hasVisibleItems(){return!!this.items.length&&this.items.some(e=>{const t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility})}valuesBySelector(e){return Array.from(e.querySelectorAll("[data-hs-combo-box-search-text]")).reduce((e,t)=>[...e,t.getAttribute("data-hs-combo-box-search-text")],[])}sortItems(){if(this.keepOriginalOrder)return this.items;return this.items.sort((e,t)=>{const i=e.querySelector("[data-hs-combo-box-value]").textContent,n=t.querySelector("[data-hs-combo-box-value]").textContent;return i<n?-1:i>n?1:0})}buildInput(){this.isOpenOnFocus&&(this.onInputFocusListener=()=>this.inputFocus(),this.input.addEventListener("focus",this.onInputFocusListener)),this.onInputInputListener=(0,o.debounce)(()=>this.inputInput()),this.input.addEventListener("input",this.onInputInputListener),this.input.addEventListener("paste",e=>{var t,i,n,s,o;const l=null!==(i=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text"))&&void 0!==i?i:"";e.preventDefault();const r=null!==(n=this.input.selectionStart)&&void 0!==n?n:this.input.value.length,a=null!==(s=this.input.selectionEnd)&&void 0!==s?s:this.input.value.length,d=this.input.value.slice(0,r)+l+this.input.value.slice(a);this.input.value=d,null===(o=this.onInputInputListener)||void 0===o||o.call(this,new InputEvent("input",{inputType:"insertFromPaste",data:l}))})}buildItems(){return n(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()),(null==this?void 0:this.items.length)&&this.items[0].classList.contains("selected")&&(this.currentData=JSON.parse(this.items[0].getAttribute("data-hs-combo-box-item-stored-data")))})}buildOutputLoader(){if(this.outputLoader)return!1;this.outputLoader=(0,o.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)}buildToggle(){var e,t,i,n;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===(n=null==this?void 0:this.input)||void 0===n?void 0:n.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,o.htmlToElement)(this.outputEmptyTemplate)),this.appendItemsToWrapper(this.outputPlaceholder)}destroyOutputLoader(){this.outputLoader&&this.outputLoader.remove(),this.outputLoader=null}itemRender(e){var t;const i=e.querySelector("[data-hs-combo-box-value]").textContent,n=null!==(t=JSON.parse(e.getAttribute("data-hs-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,n),this.setSelectedByValue(this.valuesBySelector(e))})}plainRender(e){e.forEach(e=>{this.itemRender(e)})}jsonItemsRender(e,t=0){e.forEach(e=>{const i=(0,o.htmlToElement)(this.outputItemTemplate);i.setAttribute("data-hs-combo-box-item-stored-data",JSON.stringify(e)),i.querySelectorAll("[data-hs-combo-box-output-item-field]").forEach(t=>{const i=t.getAttribute("data-hs-combo-box-output-item-field");let n="";try{const t=JSON.parse(i);n=Array.isArray(t)?t.map(t=>this.getNestedProperty(e,t)).filter(Boolean).join(" "):this.getNestedProperty(e,i)}catch(t){n=this.getNestedProperty(e,i)}t.textContent=null!=n?n:"",!n&&t.hasAttribute("data-hs-combo-box-output-item-hide-if-empty")&&(t.style.display="none")}),i.querySelectorAll("[data-hs-combo-box-search-text]").forEach(t=>{const i=t.getAttribute("data-hs-combo-box-output-item-field");let n="";try{const t=JSON.parse(i);n=Array.isArray(t)?t.map(t=>this.getNestedProperty(e,t)).filter(Boolean).join(" "):this.getNestedProperty(e,i)}catch(t){n=this.getNestedProperty(e,i)}t.setAttribute("data-hs-combo-box-search-text",null!=n?n:"")}),i.querySelectorAll("[data-hs-combo-box-output-item-attr]").forEach(t=>{JSON.parse(t.getAttribute("data-hs-combo-box-output-item-attr")).forEach(i=>{let n=e[i.valueFrom];"class"===i.attr&&t.className?t.className=`${t.className} ${n}`.trim():t.setAttribute(i.attr,n)})}),i.setAttribute("tabIndex",`${t}`),"tabs"!==this.groupingType&&"default"!==this.groupingType||i.setAttribute("data-hs-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-hs-combo-box-value]").textContent,JSON.parse(i.getAttribute("data-hs-combo-box-item-stored-data"))),this.setSelectedByValue(this.valuesBySelector(i))}),this.appendItemsToWrapper(i),t++})}groupDefaultRender(){this.groups.forEach(e=>{const t=(0,o.htmlToElement)(this.groupingTitleTemplate);t.setAttribute("data-hs-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-hs-combo-box-output-item"));return i.name===e.name});this.plainRender(i)})}groupTabsRender(){const e=(0,o.htmlToElement)(this.tabsWrapperTemplate),t=(0,o.htmlToElement)('<div class="flex flex-nowrap gap-x-2"></div>');e.append(t),this.output.insertBefore(e,this.output.firstChild);const i=(0,o.htmlToElement)(this.groupingTitleTemplate);i.setAttribute("data-hs-combo-box-group-title","all"),i.classList.add("--exclude-accessibility","active"),i.innerText="All",this.tabs=[...this.tabs,i],t.append(i),i.addEventListener("click",()=>{this.selectedGroup="all";const e=this.tabs.find(e=>e.getAttribute("data-hs-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,o.htmlToElement)(this.groupingTitleTemplate);i.setAttribute("data-hs-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-hs-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 n(this,void 0,void 0,function*(){if(this.isSearchLengthExceeded)return this.buildOutputPlaceholder(),!1;this.buildOutputLoader();try{this.queryAbortController&&this.queryAbortController.abort();const e=new AbortController;this.queryAbortController=e;const t=`${this.apiQuery}`;let i,n,s=this.apiUrl;!this.apiSearchQuery&&this.apiSearchPath?(n=this.apiSearchDefaultPath&&""===this.value?`/${this.apiSearchDefaultPath}`:`/${this.apiSearchPath}/${this.value.toLowerCase()}`,(this.apiSearchPath||this.apiSearchDefaultPath)&&(s+=n)):(i=`${this.apiSearchQuery}=${this.value.toLowerCase()}`,this.apiQuery&&this.apiSearchQuery?s+=`?${i}&${t}`:this.apiQuery?s+=`?${t}`:this.apiSearchQuery&&(s+=`?${i}`));const l=yield fetch(s,Object.assign(Object.assign({},this.apiHeaders),{signal:e.signal}));if(!l.ok)return this.items=[],this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="",void this.setResults(this.input.value);let r=yield l.json();if(this.apiDataPart&&(r=r[this.apiDataPart]),Array.isArray(r)||(r=[]),(this.apiSearchQuery||this.apiSearchPath)&&(this.items=[]),this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="","tabs"===this.groupingType)this.setApiGroups(r),this.groupTabsRender(),this.jsonItemsRender(r);else if("default"===this.groupingType){let e=0;this.setApiGroups(r),this.groups.forEach(t=>{const i=(0,o.htmlToElement)(this.groupingTitleTemplate);i.setAttribute("data-hs-combo-box-group-title",t.name),i.classList.add("--exclude-accessibility"),i.innerText=t.title;const n=r.filter(e=>e[this.apiGroupField]===t.name);this.itemsWrapper?this.itemsWrapper.append(i):this.output.append(i),this.jsonItemsRender(n,e),e+=n.length})}else this.jsonItemsRender(r);this.setResults(this.input.value.length<=this.minSearchLength?"":this.input.value),this.updatePlaceholderVisibility()}catch(e){console.error("Error fetching items:",e),this.items=[],this.itemsWrapper?this.itemsWrapper.innerHTML="":this.output.innerHTML="",this.setResults(this.input.value)}finally{this.queryAbortController&&this.queryAbortController.signal.aborted&&(this.queryAbortController=void 0),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}setHighlighted(e,t,i){t.focus(),i.value=t.querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text"),e&&e.classList.remove("hs-combo-box-output-item-highlighted"),t.classList.add("hs-combo-box-output-item-highlighted")}setupAccessibility(){var e;const t=null!==(e=this.itemsWrapper)&&void 0!==e?e:this.output;this.accessibilityComponent=window.HSAccessibilityObserver.registerComponent(this.el,{onEnter:e=>this.onEnter(e),onSpace:()=>this.onEnter(),onEsc:()=>{if(this.isOpened&&(this.close(),this.input&&this.input.focus(),this.preventVisibility))return!1},onArrow:e=>{if(this.isOpened||"ArrowDown"!==e.key){if(this.isOpened)switch(e.key){case"ArrowDown":this.focusMenuItem("next");break;case"ArrowUp":this.focusMenuItem("prev");break;case"Home":this.onStartEnd(!0);break;case"End":this.onStartEnd(!1)}}else this.open()},onTab:e=>{this.isOpened&&(e.preventDefault(),e.stopPropagation(),this.focusMenuItem("next"))},onShiftTab:e=>{this.isOpened&&(e.preventDefault(),e.stopPropagation(),this.focusMenuItem("prev"))}},this.isOpened,"ComboBox","[data-hs-combo-box]",t)}onEnter(e){var t,i,n;if(this.isOpened){const s=this.output.querySelector(".hs-combo-box-output-item-highlighted");if(s){this.close(null!==(i=null===(t=s.querySelector("[data-hs-combo-box-value]"))||void 0===t?void 0:t.getAttribute("data-hs-combo-box-search-text"))&&void 0!==i?i:null,null!==(n=JSON.parse(s.getAttribute("data-hs-combo-box-item-stored-data")))&&void 0!==n?n:null);const o="A"===s.tagName?s:s.querySelector("a[href]");if(null==o?void 0:o.href)return void((null==e?void 0:e.metaKey)||(null==e?void 0:e.ctrlKey)?window.open(o.href,"_blank","noopener"):window.location.href=o.href);this.input&&this.input.focus()}}else this.open()}focusMenuItem(e){var t;const i=null!==(t=this.itemsWrapper)&&void 0!==t?t:this.output;if(!i)return!1;const n=Array.from(i.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter(e=>"none"!==e.style.display);if(!n.length)return!1;const s=i.querySelector(".hs-combo-box-output-item-highlighted"),o=s?n.indexOf(s):-1,l="next"===e?(o+1)%n.length:(o-1+n.length)%n.length;s&&s.classList.remove("hs-combo-box-output-item-highlighted"),n[l].classList.add("hs-combo-box-output-item-highlighted"),n[l].focus(),this.input.value=n[l].querySelector("[data-hs-combo-box-value]").getAttribute("data-hs-combo-box-search-text")}onStartEnd(e=!0){var t;const i=null!==(t=this.itemsWrapper)&&void 0!==t?t:this.output;if(!i)return!1;const n=Array.from(i.querySelectorAll(":scope > *:not(.--exclude-accessibility)")).filter(e=>"none"!==e.style.display);if(!n.length)return!1;const s=i.querySelector(".hs-combo-box-output-item-highlighted");this.setHighlighted(s,n[0],this.input)}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.isOpened=!0,this.el.classList.add("active"),window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!0),!1):(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}),this.isOpened=!0,void(window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!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.preserveSelectionOnEmpty||""!==this.input.value.trim()||(this.selected="",this.value=""),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,o.afterTransition)(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"),this.isOpened=!1,void(window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!1))))}recalculateDirection(){(0,o.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=`${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=[],"undefined"!=typeof window&&window.HSAccessibilityObserver&&window.HSAccessibilityObserver.unregisterComponent(this.accessibilityComponent),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(){a.ensureGlobalHandlers(),window.$hsComboBoxCollection&&(window.$hsComboBoxCollection=window.$hsComboBoxCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-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-hs-combo-box"),i=t?JSON.parse(t):{};new a(e,i)}})}static ensureGlobalHandlers(){"undefined"!=typeof window&&(window.$hsComboBoxCollection||(window.$hsComboBoxCollection=[]),a.globalListenersInitialized||(a.globalListenersInitialized=!0,window.addEventListener("click",e=>{const t=e.target;a.closeCurrentlyOpened(t)})))}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-hs-combo-box].active")){const e=window.$hsComboBoxCollection.filter(e=>e.element.isOpened)||null;e&&e.forEach(e=>{e.element.close()})}}}a.globalListenersInitialized=!1,t.default=a},8171(e,t,i){"use strict";
|
|
43
43
|
/*
|
|
44
44
|
* HSCopyMarkup
|
|
45
|
-
* @version: 5.
|
|
45
|
+
* @version: 5.1.0
|
|
46
46
|
* @author: Preline Labs Ltd.
|
|
47
47
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
48
48
|
* Copyright 2024 Preline Labs Ltd.
|
|
49
|
-
*/var
|
|
49
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=n(i(2961));class l extends o.default{constructor(e,t){super(e,t);const i=e.getAttribute("data-hs-copy-markup"),n=i?JSON.parse(i):{},s=Object.assign(Object.assign({},n),t);this.targetSelector=(null==s?void 0:s.targetSelector)||null,this.wrapperSelector=(null==s?void 0:s.wrapperSelector)||null,this.limit=(null==s?void 0:s.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);this.addToItems(e),this.limit&&this.items.length>=this.limit&&this.el.setAttribute("disabled","disabled"),this.fireEvent("copy",e),(0,s.dispatch)("copy.hs.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);e.removeAttribute("id"),this.target=e}setWrapper(){this.wrapper="string"==typeof this.wrapperSelector?document.querySelector(this.wrapperSelector):this.wrapperSelector}addToItems(e){const t=e.querySelector("[data-hs-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){const t=this.items.indexOf(e);-1!==t&&this.items.splice(t,1),e.remove(),this.limit&&this.items.length<this.limit&&this.el.removeAttribute("disabled"),this.fireEvent("delete",e),(0,s.dispatch)("delete.hs.copyMarkup",e,e)}destroy(){const e=this.wrapper.querySelectorAll("[data-hs-copy-markup-delete-item]");this.el.removeEventListener("click",this.onElementClickListener),e.length&&e.forEach(e=>e.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-hs-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-hs-copy-markup"),i=t?JSON.parse(t):{};new l(e,i)}})}}t.default=l},3747(e,t,i){"use strict";
|
|
50
50
|
/*
|
|
51
51
|
* HSDataTable
|
|
52
|
-
* @version: 5.
|
|
52
|
+
* @version: 5.1.0
|
|
53
53
|
* @author: Preline Labs Ltd.
|
|
54
54
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
55
55
|
* Copyright 2024 Preline Labs Ltd.
|
|
56
|
-
*/var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(292),o=s(i(2961));class l extends o.default{constructor(e,t,i){var s,n,o,l,r,a,c,d,h,u,p,m,g,v,f,y,b,w,C,S,x;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 L=this.el.getAttribute("data-hs-datatable"),E=L?JSON.parse(L):{};this.concatOptions=Object.assign(Object.assign({searching:!0,lengthChange:!1,order:[],columnDefs:[...T]},E),t),this.table=this.el.querySelector("table"),this.searches=null!==(s=Array.from(this.el.querySelectorAll("[data-hs-datatable-search]")))&&void 0!==s?s:null,this.pageEntitiesList=null!==(n=Array.from(this.el.querySelectorAll("[data-hs-datatable-page-entities]")))&&void 0!==n?n:null,this.pagingList=null!==(o=Array.from(this.el.querySelectorAll("[data-hs-datatable-paging]")))&&void 0!==o?o:null,this.pagingPagesList=null!==(l=Array.from(this.el.querySelectorAll("[data-hs-datatable-paging-pages]")))&&void 0!==l?l:null,this.pagingPrevList=null!==(r=Array.from(this.el.querySelectorAll("[data-hs-datatable-paging-prev]")))&&void 0!==r?r:null,this.pagingNextList=null!==(a=Array.from(this.el.querySelectorAll("[data-hs-datatable-paging-next]")))&&void 0!==a?a:null,this.infoList=null!==(c=Array.from(this.el.querySelectorAll("[data-hs-datatable-info]")))&&void 0!==c?c:null,(null===(d=this.concatOptions)||void 0===d?void 0:d.rowSelectingOptions)&&(this.rowSelectingAll=null!==(g=(null===(u=null===(h=this.concatOptions)||void 0===h?void 0:h.rowSelectingOptions)||void 0===u?void 0:u.selectAllSelector)?document.querySelector(null===(m=null===(p=this.concatOptions)||void 0===p?void 0:p.rowSelectingOptions)||void 0===m?void 0:m.selectAllSelector):document.querySelector("[data-hs-datatable-row-selecting-all]"))&&void 0!==g?g:null),(null===(v=this.concatOptions)||void 0===v?void 0:v.rowSelectingOptions)&&(this.rowSelectingIndividual=null!==(b=null===(y=null===(f=this.concatOptions)||void 0===f?void 0:f.rowSelectingOptions)||void 0===y?void 0:y.individualSelector)&&void 0!==b?b:"[data-hs-datatable-row-selecting-individual]"),this.pageEntitiesList.length&&(this.concatOptions.pageLength=parseInt(this.pageEntitiesList[0].value)),this.maxPagesToShow=3,this.isRowSelecting=!!(null===(w=this.concatOptions)||void 0===w?void 0:w.rowSelectingOptions),this.pageBtnClasses=null!==(x=null===(S=null===(C=this.concatOptions)||void 0===C?void 0:C.pagingOptions)||void 0===S?void 0:S.pageBtnClasses)&&void 0!==x?x:null,this.onSearchInputListener=[],this.onPageEntitiesChangeListener=[],this.onSinglePagingClickListener=[],this.onPagingPrevClickListener=[],this.onPagingNextClickListener=[],this.init()}init(){this.createCollection(window.$hsDataTableCollection,this),this.initTable(),this.searches.length&&this.initSearch(),this.pageEntitiesList.length&&this.initPageEntities(),this.pagingList.length&&this.initPaging(),this.pagingPagesList.length&&this.buildPagingPages(),this.pagingPrevList.length&&this.initPagingPrev(),this.pagingNextList.length&&this.initPagingNext(),this.infoList.length&&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.pagingPagesList.forEach(e=>this.updatePaging(e))})}searchInput(e){this.onSearchInput(e.target.value)}pageEntitiesChange(e){this.onEntitiesChange(parseInt(e.target.value),e.target)}pagingPrevClick(){this.onPrevClick()}pagingNextClick(){this.onNextClick()}rowSelectingAllChange(){this.onSelectAllChange()}singlePagingClick(e){this.onPageClick(e)}initSearch(){this.searches.forEach(e=>{this.onSearchInputListener.push({el:e,fn:(0,n.debounce)(e=>this.searchInput(e))}),e.addEventListener("input",this.onSearchInputListener.find(t=>t.el===e).fn)})}onSearchInput(e){this.dataTable.search(e).draw()}initPageEntities(){this.pageEntitiesList.forEach(e=>{this.onPageEntitiesChangeListener.push({el:e,fn:e=>this.pageEntitiesChange(e)}),e.addEventListener("change",this.onPageEntitiesChangeListener.find(t=>t.el===e).fn)})}onEntitiesChange(e,t){const i=this.pageEntitiesList.filter(e=>e!==t);i.length&&i.forEach(t=>{if(window.HSSelect){const i=window.HSSelect.getInstance(t,!0);i&&"element"in i&&i.element.setValue(`${e}`)}else t.value=`${e}`}),this.dataTable.page.len(e).draw()}initInfo(){this.infoList.forEach(e=>{this.initInfoFrom(e),this.initInfoTo(e),this.initInfoLength(e)})}initInfoFrom(e){var t;const i=null!==(t=e.querySelector("[data-hs-datatable-info-from]"))&&void 0!==t?t:null,{start:s}=this.dataTable.page.info();i&&(i.innerText=`${s+1}`)}initInfoTo(e){var t;const i=null!==(t=e.querySelector("[data-hs-datatable-info-to]"))&&void 0!==t?t:null,{end:s}=this.dataTable.page.info();i&&(i.innerText=`${s}`)}initInfoLength(e){var t;const i=null!==(t=e.querySelector("[data-hs-datatable-info-length]"))&&void 0!==t?t:null,{recordsTotal:s}=this.dataTable.page.info();i&&(i.innerText=`${s}`)}updateInfo(){this.initInfo()}initPaging(){this.pagingList.forEach(e=>this.hidePagingIfSinglePage(e))}hidePagingIfSinglePage(e){const{pages:t}=this.dataTable.page.info();t<2?(e.classList.add("hidden"),e.style.display="none"):(e.classList.remove("hidden"),e.style.display="")}initPagingPrev(){this.pagingPrevList.forEach(e=>{this.onPagingPrevClickListener.push({el:e,fn:()=>this.pagingPrevClick()}),e.addEventListener("click",this.onPagingPrevClickListener.find(t=>t.el===e).fn)})}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.pagingNextList.forEach(e=>{this.onPagingNextClickListener.push({el:e,fn:()=>this.pagingNextClick()}),e.addEventListener("click",this.onPagingNextClickListener.find(t=>t.el===e).fn)})}onNextClick(){this.dataTable.page("next").draw("page")}buildPagingPages(){this.pagingPagesList.forEach(e=>this.updatePaging(e))}updatePaging(e){const{page:t,pages:i,length:s}=this.dataTable.page.info(),o=this.dataTable.rows({search:"applied"}).count(),l=Math.ceil(o/s),r=t+1;let a=Math.max(1,r-Math.floor(this.maxPagesToShow/2)),c=Math.min(l,a+(this.maxPagesToShow-1));c-a+1<this.maxPagesToShow&&(a=Math.max(1,c-this.maxPagesToShow+1)),e.innerHTML="",a>1&&(this.buildPagingPage(1,e),a>2&&e.appendChild((0,n.htmlToElement)('<span class="ellipsis">...</span>')));for(let t=a;t<=c;t++)this.buildPagingPage(t,e);c<l&&(c<l-1&&e.appendChild((0,n.htmlToElement)('<span class="ellipsis">...</span>')),this.buildPagingPage(l,e)),this.pagingPrevList.forEach(e=>this.disablePagingArrow(e,0===t)),this.pagingNextList.forEach(e=>this.disablePagingArrow(e,t===i-1)),this.pagingList.forEach(e=>this.hidePagingIfSinglePage(e))}buildPagingPage(e,t){const{page:i}=this.dataTable.page.info(),s=(0,n.htmlToElement)('<button type="button"></button>');s.innerText=`${e}`,s.setAttribute("data-page",`${e}`),this.pageBtnClasses&&(0,n.classToClassList)(this.pageBtnClasses,s),i===e-1&&s.classList.add("active"),this.onSinglePagingClickListener.push({el:s,fn:()=>this.singlePagingClick(e)}),s.addEventListener("click",this.onSinglePagingClickListener.find(e=>e.el===s).fn),t.append(s)}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}destroy(){this.searches&&this.onSearchInputListener.forEach(({el:e,fn:t})=>e.removeEventListener("click",t)),this.pageEntitiesList&&this.onPageEntitiesChangeListener.forEach(({el:e,fn:t})=>e.removeEventListener("change",t)),this.pagingPagesList.length&&(this.onSinglePagingClickListener.forEach(({el:e,fn:t})=>e.removeEventListener("click",t)),this.pagingPagesList.forEach(e=>e.innerHTML="")),this.pagingPrevList.length&&this.onPagingPrevClickListener.forEach(({el:e,fn:t})=>e.removeEventListener("click",t)),this.pagingNextList.length&&this.onPagingNextClickListener.forEach(({el:e,fn:t})=>e.removeEventListener("click",t)),this.rowSelectingAll&&this.rowSelectingAll.removeEventListener("change",this.onRowSelectingAllChangeListener),this.dataTable.destroy(),this.rowSelectingAll=null,this.rowSelectingIndividual=null,window.$hsDataTableCollection=window.$hsDataTableCollection.filter(({element:e})=>e.el!==this.el)}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-hs-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 l(e)})}}t.default=l},1553(e,t,i){"use strict";
|
|
56
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=n(i(2961));class l extends o.default{constructor(e,t,i){var n,s,o,l,r,a,d,c,h,u,p,m,g,v,f,y,b,w,C,x,S;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 k=this.el.getAttribute("data-hs-datatable"),E=k?JSON.parse(k):{};this.concatOptions=Object.assign(Object.assign({searching:!0,lengthChange:!1,order:[],columnDefs:[...T]},E),t),this.table=this.el.querySelector("table"),this.searches=null!==(n=Array.from(this.el.querySelectorAll("[data-hs-datatable-search]")))&&void 0!==n?n:null,this.pageEntitiesList=null!==(s=Array.from(this.el.querySelectorAll("[data-hs-datatable-page-entities]")))&&void 0!==s?s:null,this.pagingList=null!==(o=Array.from(this.el.querySelectorAll("[data-hs-datatable-paging]")))&&void 0!==o?o:null,this.pagingPagesList=null!==(l=Array.from(this.el.querySelectorAll("[data-hs-datatable-paging-pages]")))&&void 0!==l?l:null,this.pagingPrevList=null!==(r=Array.from(this.el.querySelectorAll("[data-hs-datatable-paging-prev]")))&&void 0!==r?r:null,this.pagingNextList=null!==(a=Array.from(this.el.querySelectorAll("[data-hs-datatable-paging-next]")))&&void 0!==a?a:null,this.infoList=null!==(d=Array.from(this.el.querySelectorAll("[data-hs-datatable-info]")))&&void 0!==d?d:null,(null===(c=this.concatOptions)||void 0===c?void 0:c.rowSelectingOptions)&&(this.rowSelectingAll=null!==(g=(null===(u=null===(h=this.concatOptions)||void 0===h?void 0:h.rowSelectingOptions)||void 0===u?void 0:u.selectAllSelector)?document.querySelector(null===(m=null===(p=this.concatOptions)||void 0===p?void 0:p.rowSelectingOptions)||void 0===m?void 0:m.selectAllSelector):document.querySelector("[data-hs-datatable-row-selecting-all]"))&&void 0!==g?g:null),(null===(v=this.concatOptions)||void 0===v?void 0:v.rowSelectingOptions)&&(this.rowSelectingIndividual=null!==(b=null===(y=null===(f=this.concatOptions)||void 0===f?void 0:f.rowSelectingOptions)||void 0===y?void 0:y.individualSelector)&&void 0!==b?b:"[data-hs-datatable-row-selecting-individual]"),this.pageEntitiesList.length&&(this.concatOptions.pageLength=parseInt(this.pageEntitiesList[0].value)),this.maxPagesToShow=3,this.isRowSelecting=!!(null===(w=this.concatOptions)||void 0===w?void 0:w.rowSelectingOptions),this.pageBtnClasses=null!==(S=null===(x=null===(C=this.concatOptions)||void 0===C?void 0:C.pagingOptions)||void 0===x?void 0:x.pageBtnClasses)&&void 0!==S?S:null,this.onSearchInputListener=[],this.onPageEntitiesChangeListener=[],this.onSinglePagingClickListener=[],this.onPagingPrevClickListener=[],this.onPagingNextClickListener=[],this.init()}init(){this.createCollection(window.$hsDataTableCollection,this),this.initTable(),this.searches.length&&this.initSearch(),this.pageEntitiesList.length&&this.initPageEntities(),this.pagingList.length&&this.initPaging(),this.pagingPagesList.length&&this.buildPagingPages(),this.pagingPrevList.length&&this.initPagingPrev(),this.pagingNextList.length&&this.initPagingNext(),this.infoList.length&&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.pagingPagesList.forEach(e=>this.updatePaging(e))})}searchInput(e){this.onSearchInput(e.target.value)}pageEntitiesChange(e){this.onEntitiesChange(parseInt(e.target.value),e.target)}pagingPrevClick(){this.onPrevClick()}pagingNextClick(){this.onNextClick()}rowSelectingAllChange(){this.onSelectAllChange()}singlePagingClick(e){this.onPageClick(e)}initSearch(){this.searches.forEach(e=>{this.onSearchInputListener.push({el:e,fn:(0,s.debounce)(e=>this.searchInput(e))}),e.addEventListener("input",this.onSearchInputListener.find(t=>t.el===e).fn)})}onSearchInput(e){this.dataTable.search(e).draw()}initPageEntities(){this.pageEntitiesList.forEach(e=>{this.onPageEntitiesChangeListener.push({el:e,fn:e=>this.pageEntitiesChange(e)}),e.addEventListener("change",this.onPageEntitiesChangeListener.find(t=>t.el===e).fn)})}onEntitiesChange(e,t){const i=this.pageEntitiesList.filter(e=>e!==t);i.length&&i.forEach(t=>{if(window.HSSelect){const i=window.HSSelect.getInstance(t,!0);i&&"element"in i&&i.element.setValue(`${e}`)}else t.value=`${e}`}),this.dataTable.page.len(e).draw()}initInfo(){this.infoList.forEach(e=>{this.initInfoFrom(e),this.initInfoTo(e),this.initInfoLength(e)})}initInfoFrom(e){var t;const i=null!==(t=e.querySelector("[data-hs-datatable-info-from]"))&&void 0!==t?t:null,{start:n}=this.dataTable.page.info();i&&(i.innerText=`${n+1}`)}initInfoTo(e){var t;const i=null!==(t=e.querySelector("[data-hs-datatable-info-to]"))&&void 0!==t?t:null,{end:n}=this.dataTable.page.info();i&&(i.innerText=`${n}`)}initInfoLength(e){var t;const i=null!==(t=e.querySelector("[data-hs-datatable-info-length]"))&&void 0!==t?t:null,{recordsTotal:n}=this.dataTable.page.info();i&&(i.innerText=`${n}`)}updateInfo(){this.initInfo()}initPaging(){this.pagingList.forEach(e=>this.hidePagingIfSinglePage(e))}hidePagingIfSinglePage(e){const{pages:t}=this.dataTable.page.info();t<2?(e.classList.add("hidden"),e.style.display="none"):(e.classList.remove("hidden"),e.style.display="")}initPagingPrev(){this.pagingPrevList.forEach(e=>{this.onPagingPrevClickListener.push({el:e,fn:()=>this.pagingPrevClick()}),e.addEventListener("click",this.onPagingPrevClickListener.find(t=>t.el===e).fn)})}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.pagingNextList.forEach(e=>{this.onPagingNextClickListener.push({el:e,fn:()=>this.pagingNextClick()}),e.addEventListener("click",this.onPagingNextClickListener.find(t=>t.el===e).fn)})}onNextClick(){this.dataTable.page("next").draw("page")}buildPagingPages(){this.pagingPagesList.forEach(e=>this.updatePaging(e))}updatePaging(e){const{page:t,pages:i,length:n}=this.dataTable.page.info(),o=this.dataTable.rows({search:"applied"}).count(),l=Math.ceil(o/n),r=t+1;let a=Math.max(1,r-Math.floor(this.maxPagesToShow/2)),d=Math.min(l,a+(this.maxPagesToShow-1));d-a+1<this.maxPagesToShow&&(a=Math.max(1,d-this.maxPagesToShow+1)),e.innerHTML="",a>1&&(this.buildPagingPage(1,e),a>2&&e.appendChild((0,s.htmlToElement)('<span class="ellipsis">...</span>')));for(let t=a;t<=d;t++)this.buildPagingPage(t,e);d<l&&(d<l-1&&e.appendChild((0,s.htmlToElement)('<span class="ellipsis">...</span>')),this.buildPagingPage(l,e)),this.pagingPrevList.forEach(e=>this.disablePagingArrow(e,0===t)),this.pagingNextList.forEach(e=>this.disablePagingArrow(e,t===i-1)),this.pagingList.forEach(e=>this.hidePagingIfSinglePage(e))}buildPagingPage(e,t){const{page:i}=this.dataTable.page.info(),n=(0,s.htmlToElement)('<button type="button"></button>');n.innerText=`${e}`,n.setAttribute("data-page",`${e}`),this.pageBtnClasses&&(0,s.classToClassList)(this.pageBtnClasses,n),i===e-1&&n.classList.add("active"),this.onSinglePagingClickListener.push({el:n,fn:()=>this.singlePagingClick(e)}),n.addEventListener("click",this.onSinglePagingClickListener.find(e=>e.el===n).fn),t.append(n)}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}destroy(){this.searches&&this.onSearchInputListener.forEach(({el:e,fn:t})=>e.removeEventListener("click",t)),this.pageEntitiesList&&this.onPageEntitiesChangeListener.forEach(({el:e,fn:t})=>e.removeEventListener("change",t)),this.pagingPagesList.length&&(this.onSinglePagingClickListener.forEach(({el:e,fn:t})=>e.removeEventListener("click",t)),this.pagingPagesList.forEach(e=>e.innerHTML="")),this.pagingPrevList.length&&this.onPagingPrevClickListener.forEach(({el:e,fn:t})=>e.removeEventListener("click",t)),this.pagingNextList.length&&this.onPagingNextClickListener.forEach(({el:e,fn:t})=>e.removeEventListener("click",t)),this.rowSelectingAll&&this.rowSelectingAll.removeEventListener("change",this.onRowSelectingAllChangeListener),this.dataTable.destroy(),this.rowSelectingAll=null,this.rowSelectingIndividual=null,window.$hsDataTableCollection=window.$hsDataTableCollection.filter(({element:e})=>e.el!==this.el)}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-hs-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 l(e)})}}t.default=l},1553(e,t,i){"use strict";
|
|
57
57
|
/*
|
|
58
58
|
* HSDatepicker
|
|
59
|
-
* @version: 5.
|
|
59
|
+
* @version: 5.1.0
|
|
60
60
|
* @author: Preline Labs Ltd.
|
|
61
61
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
62
62
|
* Copyright 2024 Preline Labs Ltd.
|
|
63
|
-
*/var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(292),o=s(i(632)),l=i(3191),r=i(6370),a=i(8852),c=i(292),d=s(i(591)),h=s(i(2961));class u extends h.default{constructor(e,t,i){var s,a,c,d,h,u,p,m,g;super(e,t,i);const v=e.getAttribute("data-hs-datepicker")?JSON.parse(e.getAttribute("data-hs-datepicker")):{};this.dataOptions=Object.assign(Object.assign({},v),t),this.applyUtilityClasses=void 0!==(null===(s=this.dataOptions)||void 0===s?void 0:s.applyUtilityClasses)&&(null===(a=this.dataOptions)||void 0===a?void 0:a.applyUtilityClasses),this.templatesByType=this.applyUtilityClasses?l.templates:r.templatesBasedOnUtility;const f=void 0!==(null===(c=this.dataOptions)||void 0===c?void 0:c.removeDefaultStyles)&&(null===(d=this.dataOptions)||void 0===d?void 0:d.removeDefaultStyles);this.updatedStyles=_.mergeWith(f?{}:o.default.defaultStyles,(null===(h=this.dataOptions)||void 0===h?void 0:h.styles)||{},(e,t)=>{if("string"==typeof e&&"string"==typeof t)return`${e} ${t}`});const y=new Date,b={selectedTheme:null!==(u=this.dataOptions.selectedTheme)&&void 0!==u?u:"",styles:this.updatedStyles,dateMin:null!==(p=this.dataOptions.dateMin)&&void 0!==p?p:y.toISOString().split("T")[0],dateMax:null!==(m=this.dataOptions.dateMax)&&void 0!==m?m:"2470-12-31",mode:null!==(g=this.dataOptions.mode)&&void 0!==g?g:"default",inputMode:void 0===this.dataOptions.inputMode||this.dataOptions.inputMode},w=(e,t)=>i=>{null==e||e(i),null==t||t(i)},C=e=>{this.hasTime(e)&&this.initCustomTime(e)},S={layouts:{month:this.templatesByType.month(b.selectedTheme)},onInit:w(this.dataOptions.onInit,e=>{"custom-select"!==b.mode||this.dataOptions.inputMode||C(e)}),onShow:w(this.dataOptions.onShow,e=>{b.inputMode&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{window.dispatchEvent(new Event("resize"))})}),"custom-select"===b.mode&&(this.updateCustomSelects(e),C(e))}),onHide:w(this.dataOptions.onHide,e=>{"custom-select"===b.mode&&this.destroySelects(e.context.mainElement)}),onUpdate:w(this.dataOptions.onUpdate,e=>{this.updateCalendar(e.context.mainElement)}),onCreateDateEls:w(this.dataOptions.onCreateDateEls,e=>{"custom-select"===b.mode&&this.updateCustomSelects(e)}),onChangeToInput:w(this.dataOptions.onChangeToInput,e=>{if(!e.context.inputElement)return;this.setInputValue(e.context.inputElement,e.context.selectedDates);const t={selectedDates:e.context.selectedDates,selectedTime:e.context.selectedTime,rest:e.context};this.fireEvent("change",t),(0,n.dispatch)("change.hs.datepicker",this.el,t)}),onChangeTime:w(this.dataOptions.onChangeTime,C),onClickYear:w(this.dataOptions.onClickYear,C),onClickMonth:w(this.dataOptions.onClickMonth,C),onClickArrow:w(this.dataOptions.onClickArrow,e=>{"custom-select"===b.mode&&setTimeout(()=>{this.disableNav(),this.disableOptions(),this.updateCalendar(e.context.mainElement)})})};this.concatOptions=_.merge(S,this.dataOptions);const x=Object.assign(Object.assign({},b),{layouts:{default:this.processCustomTemplate(this.templatesByType.default(b.selectedTheme),"default"),multiple:this.processCustomTemplate(this.templatesByType.multiple(b.selectedTheme),"multiple"),year:this.processCustomTemplate(this.templatesByType.year(b.selectedTheme),"default")}});this.concatOptions=_.merge(this.concatOptions,x),this.vanillaCalendar=new o.default(this.el,this.concatOptions),this.init()}init(){var e,t;this.createCollection(window.$hsDatepickerCollection,this),this.vanillaCalendar.init(),(null===(e=this.dataOptions)||void 0===e?void 0:e.selectedDates)&&this.setInputValue(this.vanillaCalendar.context.inputElement,this.formatDateArrayToIndividualDates(null===(t=this.dataOptions)||void 0===t?void 0:t.selectedDates))}getTimeParts(e){const[t,i]=e.split(" "),[s,n]=t.split(":");return[s,n,i]}getCurrentMonthAndYear(e){const t=e.querySelector('[data-vc="month"]'),i=e.querySelector('[data-vc="year"]');return{month:+t.getAttribute("data-vc-month"),year:+i.getAttribute("data-vc-year")}}extractSeparatorFromFormat(e){const t=e.match(/[^A-Za-z0-9]/);return t?t[0]:"."}setInputValue(e,t){var i,s,n,o,l,r,a,c,d;const h=null===(i=this.dataOptions)||void 0===i?void 0:i.dateFormat,u=h?this.extractSeparatorFromFormat(h):null,p=null!==(o=null!=u?u:null===(n=null===(s=this.dataOptions)||void 0===s?void 0:s.inputModeOptions)||void 0===n?void 0:n.dateSeparator)&&void 0!==o?o:".",m=null!==(a=null===(r=null===(l=this.dataOptions)||void 0===l?void 0:l.inputModeOptions)||void 0===r?void 0:r.itemsSeparator)&&void 0!==a?a:", ",g=null!==(d=null===(c=this.dataOptions)||void 0===c?void 0:c.selectionDatesMode)&&void 0!==d?d:"single";if(t.length&&t.length>1)if("multiple"===g){const i=[];t.forEach(e=>i.push(h?this.formatDate(e,h):this.changeDateSeparator(e,p))),e.value=i.join(m)}else{const i=h?this.formatDate(t[0],h):this.changeDateSeparator(t[0],p),s=h?this.formatDate(t[1],h):this.changeDateSeparator(t[1],p);e.value=[i,s].join(m)}else t.length&&1===t.length?e.value=h?this.formatDate(t[0],h):this.changeDateSeparator(t[0],p):e.value=""}getLocalizedTodayText(e){return a.todayTranslations[e]||"Today"}changeDateSeparator(e,t=".",i="-"){var s,n;const o=new Date(e);if(null===(s=this.dataOptions)||void 0===s?void 0:s.replaceTodayWithText){const e=new Date;if(o.toDateString()===e.toDateString()){const e=null===(n=this.dataOptions)||void 0===n?void 0:n.dateLocale;return this.getLocalizedTodayText(e)}}return e.split(i).join(t)}formatDateArrayToIndividualDates(e){var t,i;const s=null!==(i=null===(t=this.dataOptions)||void 0===t?void 0:t.selectionDatesMode)&&void 0!==i?i:"single";return e.flatMap(e=>{if("string"==typeof e){if("today"===e.toLowerCase()){return[(new Date).toISOString().split("T")[0]]}const t=e.match(/^(\d{4}-\d{2}-\d{2})\s*[^a-zA-Z0-9]*\s*(\d{4}-\d{2}-\d{2})$/);if(t){const[e,i,n]=t;return"multiple-ranged"===s?[i,n]:((e,t)=>{const i=new Date(e),s=new Date(t),n=[];for(;i<=s;)n.push(i.toISOString().split("T")[0]),i.setDate(i.getDate()+1);return n})(i.trim(),n.trim())}return[e]}return"number"==typeof e?[new Date(e).toISOString().split("T")[0]]:e instanceof Date?[e.toISOString().split("T")[0]]:[]})}hasTime(e){const{mainElement:t}=e.context,i=t.querySelector("[data-hs-select].--hours"),s=t.querySelector("[data-hs-select].--minutes"),n=t.querySelector("[data-hs-select].--meridiem");return i&&s&&n}createArrowFromTemplate(e,t=!1){if(!t)return e;const i=(0,c.htmlToElement)(e);return(0,c.classToClassList)(t,i),i.outerHTML}concatObjectProperties(e,t){const i={};return new Set([...Object.keys(e||{}),...Object.keys(t||{})]).forEach(s=>{const n=e[s]||"",o=t[s]||"";i[s]=`${n} ${o}`.trim()}),i}updateTemplate(e,t,i){if(!t)return e;const s=JSON.parse(e.match(/data-hs-select='([^']+)'/)[1]),n=this.concatObjectProperties(t,i),o=_.merge(s,n);return e.replace(/data-hs-select='[^']+'/,`data-hs-select='${JSON.stringify(o)}'`)}initCustomTime(e){var t;const{mainElement:i}=e.context,s=this.getTimeParts(null!==(t=e.selectedTime)&&void 0!==t?t:"12:00 PM"),n={hours:i.querySelector("[data-hs-select].--hours"),minutes:i.querySelector("[data-hs-select].--minutes"),meridiem:i.querySelector("[data-hs-select].--meridiem")};Object.entries(n).forEach(([t,n])=>{if(!d.default.getInstance(n,!0)){const o=new d.default(n);o.setValue(s["meridiem"===t?2:"minutes"===t?1:0]),o.el.addEventListener("change.hs.select",n=>{this.destroySelects(i);const o="hours"===t?n.detail.payload:s[0],l="minutes"===t?n.detail.payload:s[1],r="meridiem"===t?n.detail.payload:s[2];e.set({selectedTime:`${o}:${l} ${r}`},{dates:!1,year:!1,month:!1})})}})}initCustomMonths(e){const{mainElement:t}=e.context,i=Array.from(t.querySelectorAll(".--single-month"));i.length&&i.forEach((i,s)=>{const n=i.querySelector("[data-hs-select].--month");if(d.default.getInstance(n,!0))return!1;const o=new d.default(n),{month:l,year:r}=this.getCurrentMonthAndYear(i);o.setValue(`${l}`),o.el.addEventListener("change.hs.select",i=>{this.destroySelects(t),e.set({selectedMonth:+i.detail.payload-s<0?11:+i.detail.payload-s,selectedYear:+i.detail.payload-s<0?+r-1:r},{dates:!1,time:!1})})})}initCustomYears(e){const{mainElement:t}=e.context,i=Array.from(t.querySelectorAll(".--single-month"));i.length&&i.forEach(i=>{const s=i.querySelector("[data-hs-select].--year");if(d.default.getInstance(s,!0))return!1;const n=new d.default(s),{month:o,year:l}=this.getCurrentMonthAndYear(i);n.setValue(`${l}`),n.el.addEventListener("change.hs.select",i=>{const{dateMax:s,displayMonthsCount:n}=this.vanillaCalendar.context,l=new Date(s).getFullYear(),r=new Date(s).getMonth();this.destroySelects(t),e.set({selectedMonth:o>r-n&&+i.detail.payload===l?r-n+1:o,selectedYear:i.detail.payload},{dates:!1,time:!1})})})}generateCustomTimeMarkup(){var e,t,i,s;const n=null===(e=this.updatedStyles)||void 0===e?void 0:e.customSelect,o=n?this.updateTemplate(this.templatesByType.hours(this.concatOptions.selectedTheme),(null==n?void 0:n.shared)||{},(null==n?void 0:n.hours)||{}):this.templatesByType.hours(this.concatOptions.selectedTheme),l=n?this.updateTemplate(this.templatesByType.minutes(this.concatOptions.selectedTheme),(null==n?void 0:n.shared)||{},(null==n?void 0:n.minutes)||{}):this.templatesByType.minutes(this.concatOptions.selectedTheme),r=n?this.updateTemplate(this.templatesByType.meridiem(this.concatOptions.selectedTheme),(null==n?void 0:n.shared)||{},(null==n?void 0:n.meridiem)||{}):this.templatesByType.meridiem(this.concatOptions.selectedTheme);return`<div class="--time">${null!==(s=null===(i=null===(t=null==this?void 0:this.dataOptions)||void 0===t?void 0:t.templates)||void 0===i?void 0:i.time)&&void 0!==s?s:`\n\t\t\t<div class="pt-3 flex justify-center items-center gap-x-2">\n ${o}\n <span class="text-gray-800 ${"light"!==this.concatOptions.selectedTheme?"dark:text-white":""}">:</span>\n ${l}\n ${r}\n </div>\n\t\t`}</div>`}generateCustomMonthMarkup(){var e,t,i;const s=null!==(t=null===(e=null==this?void 0:this.dataOptions)||void 0===e?void 0:e.mode)&&void 0!==t?t:"default",n=null===(i=this.updatedStyles)||void 0===i?void 0:i.customSelect,o=n?this.updateTemplate(this.templatesByType.months(this.concatOptions.selectedTheme),(null==n?void 0:n.shared)||{},(null==n?void 0:n.months)||{}):this.templatesByType.months(this.concatOptions.selectedTheme);return"custom-select"===s?o:"<#Month />"}generateCustomYearMarkup(){var e,t,i,s,n,o,l;if("custom-select"===(null!==(t=null===(e=null==this?void 0:this.dataOptions)||void 0===e?void 0:e.mode)&&void 0!==t?t:"default")){const e=new Date,t=null!==(s=null===(i=null==this?void 0:this.dataOptions)||void 0===i?void 0:i.dateMin)&&void 0!==s?s:e.toISOString().split("T")[0],r=null!==(o=null===(n=null==this?void 0:this.dataOptions)||void 0===n?void 0:n.dateMax)&&void 0!==o?o:"2470-12-31",a=new Date(t),c=new Date(r),d=a.getFullYear(),h=c.getFullYear(),u=()=>{let e="";for(let t=d;t<=h;t++)e+=`<option value="${t}">${t}</option>`;return e},p=this.templatesByType.years(u(),this.concatOptions.selectedTheme),m=null===(l=this.updatedStyles)||void 0===l?void 0:l.customSelect;return m?this.updateTemplate(p,(null==m?void 0:m.shared)||{},(null==m?void 0:m.years)||{}):p}return"<#Year />"}generateCustomArrowPrevMarkup(){var e,t;return(null===(t=null===(e=null==this?void 0:this.dataOptions)||void 0===e?void 0:e.templates)||void 0===t?void 0:t.arrowPrev)?this.createArrowFromTemplate(this.dataOptions.templates.arrowPrev,this.updatedStyles.arrowPrev):"<#ArrowPrev [month] />"}generateCustomArrowNextMarkup(){var e,t;return(null===(t=null===(e=null==this?void 0:this.dataOptions)||void 0===e?void 0:e.templates)||void 0===t?void 0:t.arrowNext)?this.createArrowFromTemplate(this.dataOptions.templates.arrowNext,this.updatedStyles.arrowNext):"<#ArrowNext [month] />"}parseCustomTime(e){return e=e.replace(/<#CustomTime\s*\/>/g,this.generateCustomTimeMarkup())}parseCustomMonth(e){return e=e.replace(/<#CustomMonth\s*\/>/g,this.generateCustomMonthMarkup())}parseCustomYear(e){return e=e.replace(/<#CustomYear\s*\/>/g,this.generateCustomYearMarkup())}parseArrowPrev(e){return e=e.replace(/<#CustomArrowPrev\s*\/>/g,this.generateCustomArrowPrevMarkup())}parseArrowNext(e){return e=e.replace(/<#CustomArrowNext\s*\/>/g,this.generateCustomArrowNextMarkup())}processCustomTemplate(e,t){var i,s,n,o;const l="default"===t?null===(s=null===(i=null==this?void 0:this.dataOptions)||void 0===i?void 0:i.layouts)||void 0===s?void 0:s.default:null===(o=null===(n=null==this?void 0:this.dataOptions)||void 0===n?void 0:n.layouts)||void 0===o?void 0:o.multiple,r=this.parseCustomMonth(null!=l?l:e),a=this.parseCustomYear(r),c=this.parseCustomTime(a),d=this.parseArrowPrev(c);return this.parseArrowNext(d)}disableOptions(){const{mainElement:e,dateMax:t,displayMonthsCount:i}=this.vanillaCalendar.context,s=new Date(t);Array.from(e.querySelectorAll(".--single-month")).forEach((e,t)=>{var n;const o=+(null===(n=e.querySelector('[data-vc="year"]'))||void 0===n?void 0:n.getAttribute("data-vc-year")),l=e.querySelectorAll("[data-hs-select].--month option"),r=e.querySelectorAll("[data-hs-select-dropdown] [data-value]"),a=e=>+e.getAttribute("data-value")>s.getMonth()-i+t+1&&o===s.getFullYear();Array.from(l).forEach(e=>e.toggleAttribute("disabled",a(e))),Array.from(r).forEach(e=>e.classList.toggle("disabled",a(e)))})}disableNav(){const{mainElement:e,dateMax:t,selectedYear:i,selectedMonth:s,displayMonthsCount:n}=this.vanillaCalendar.context,o=new Date(t).getFullYear(),l=e.querySelector('[data-vc-arrow="next"]');l.style.visibility=i===o&&s+n>11?"hidden":""}destroySelects(e){Array.from(e.querySelectorAll("[data-hs-select]")).forEach(e=>{const t=d.default.getInstance(e,!0);t&&t.element.destroy()})}updateSelect(e,t){const i=d.default.getInstance(e,!0);i&&i.element.setValue(t)}updateCalendar(e){const t=e.querySelectorAll(".--single-month");t.length&&t.forEach(e=>{const{month:t,year:i}=this.getCurrentMonthAndYear(e);this.updateSelect(e.querySelector("[data-hs-select].--month"),`${t}`),this.updateSelect(e.querySelector("[data-hs-select].--year"),`${i}`)})}updateCustomSelects(e){setTimeout(()=>{this.disableOptions(),this.disableNav(),this.initCustomMonths(e),this.initCustomYears(e)})}getCurrentState(){return{selectedDates:this.vanillaCalendar.selectedDates,selectedTime:this.vanillaCalendar.selectedTime}}formatDate(e,t){var i,s,n,o,l,r,a;const c=t||(null===(i=this.dataOptions)||void 0===i?void 0:i.dateFormat),d=(null===(s=this.dataOptions)||void 0===s?void 0:s.dateLocale)||void 0;if(!c){const t=null!==(l=null===(o=null===(n=this.dataOptions)||void 0===n?void 0:n.inputModeOptions)||void 0===o?void 0:o.dateSeparator)&&void 0!==l?l:".";return this.changeDateSeparator(e,t)}const h=new Date(e);if(isNaN(h.getTime()))return this.changeDateSeparator(e);let u="",p=0;for(;p<c.length;)if("YYYY"===c.slice(p,p+4))u+=h.getFullYear().toString(),p+=4;else if("dddd"===c.slice(p,p+4)){const e=h.toLocaleDateString(d,{weekday:"long"});if(null===(r=this.dataOptions)||void 0===r?void 0:r.replaceTodayWithText){const t=new Date;u+=h.toDateString()===t.toDateString()?this.getLocalizedTodayText(d):e}else u+=e;p+=4}else if("MMMM"===c.slice(p,p+4))u+=h.toLocaleDateString(d,{month:"long"}),p+=4;else if("ddd"===c.slice(p,p+3)){const e=h.toLocaleDateString(d,{weekday:"short"});if(null===(a=this.dataOptions)||void 0===a?void 0:a.replaceTodayWithText){const t=new Date;u+=h.toDateString()===t.toDateString()?this.getLocalizedTodayText(d):e}else u+=e;p+=3}else"MMM"===c.slice(p,p+3)?(u+=h.toLocaleDateString(d,{month:"short"}),p+=3):"YY"===c.slice(p,p+2)?(u+=h.getFullYear().toString().slice(-2),p+=2):"MM"===c.slice(p,p+2)?(u+=String(h.getMonth()+1).padStart(2,"0"),p+=2):"DD"===c.slice(p,p+2)?(u+=String(h.getDate()).padStart(2,"0"),p+=2):"HH"===c.slice(p,p+2)?(u+=String(h.getHours()).padStart(2,"0"),p+=2):"mm"===c.slice(p,p+2)?(u+=String(h.getMinutes()).padStart(2,"0"),p+=2):"ss"===c.slice(p,p+2)?(u+=String(h.getSeconds()).padStart(2,"0"),p+=2):"Y"===c[p]?(u+=h.getFullYear().toString(),p+=1):"M"===c[p]?(u+=String(h.getMonth()+1),p+=1):"D"===c[p]?(u+=String(h.getDate()),p+=1):"H"===c[p]?(u+=String(h.getHours()),p+=1):"m"===c[p]?(u+=String(h.getMinutes()),p+=1):"s"===c[p]?(u+=String(h.getSeconds()),p+=1):(u+=c[p],p+=1);return u}destroy(){const e=this.el,t=e.id,i=e.parentElement,s=e.nextElementSibling,n={};Array.from(e.attributes).forEach(e=>{n[e.name]=e.value});const o=e.className,l=e.value;this.vanillaCalendar&&(this.vanillaCalendar.destroy(),this.vanillaCalendar=null),window.$hsDatepickerCollection=window.$hsDatepickerCollection.filter(({element:e})=>e.el!==this.el);const r=document.body.contains(e),a=t?document.getElementById(t):null;if(!r&&!a&&i){const e=document.createElement("input");Object.keys(n).forEach(t=>{e.setAttribute(t,n[t])}),e.className=o,e.value=l,s&&s.parentElement===i?i.insertBefore(e,s):i.appendChild(e),this.el=e}}static getInstance(e,t){const i=window.$hsDatepickerCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e));return i?t?i:i.element.el:null}static autoInit(){window.$hsDatepickerCollection||(window.$hsDatepickerCollection=[]),document.querySelectorAll(".hs-datepicker:not(.--prevent-on-load-init)").forEach(e=>{window.$hsDatepickerCollection.find(t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e})||new u(e)})}}t.default=u},8852(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.todayTranslations=void 0,t.todayTranslations={"ru-RU":"сегодня",ru:"сегодня","de-DE":"Heute",de:"Heute","fr-FR":"Aujourd'hui",fr:"Aujourd'hui","es-ES":"Hoy",es:"Hoy","it-IT":"Oggi",it:"Oggi","pt-BR":"Hoje",pt:"Hoje","pl-PL":"Dzisiaj",pl:"Dzisiaj","uk-UA":"Сьогодні",uk:"Сьогодні","zh-CN":"今天",zh:"今天","ja-JP":"今日",ja:"今日","ko-KR":"오늘",ko:"오늘","ar-SA":"اليوم",ar:"اليوم","hi-IN":"आज",hi:"आज","tr-TR":"Bugün",tr:"Bugün","nl-NL":"Vandaag",nl:"Vandaag","sv-SE":"Idag",sv:"Idag","da-DK":"I dag",da:"I dag","no-NO":"I dag",no:"I dag","fi-FI":"Tänään",fi:"Tänään","cs-CZ":"Dnes",cs:"Dnes","sk-SK":"Dnes",sk:"Dnes","hu-HU":"Ma",hu:"Ma","ro-RO":"Astăzi",ro:"Astăzi","bg-BG":"Днес",bg:"Днес","hr-HR":"Danas",hr:"Danas","sr-RS":"Данас",sr:"Данас","sl-SI":"Danes",sl:"Danes","et-EE":"Täna",et:"Täna","lv-LV":"Šodien",lv:"Šodien","lt-LT":"Šiandien",lt:"Šiandien","el-GR":"Σήμερα",el:"Σήμερα","he-IL":"היום",he:"היום","th-TH":"วันนี้",th:"วันนี้","vi-VN":"Hôm nay",vi:"Hôm nay","id-ID":"Hari ini",id:"Hari ini","ms-MY":"Hari ini",ms:"Hari ini","fa-IR":"امروز",fa:"امروز","ur-PK":"آج",ur:"آج","bn-BD":"আজ",bn:"আজ","ta-IN":"இன்று",ta:"இன்று","te-IN":"నేడు",te:"నేడు","ml-IN":"ഇന്ന്",ml:"ഇന്ന്","kn-IN":"ಇಂದು",kn:"ಇಂದು","gu-IN":"આજે",gu:"આજે","pa-IN":"ਅੱਜ",pa:"ਅੱਜ","or-IN":"ଆଜି",or:"ଆଜି","as-IN":"আজি",as:"আজি","ne-NP":"आज",ne:"आज","si-LK":"අද",si:"අද","my-MM":"ယနေ့",my:"ယနေ့","km-KH":"ថ្ងៃនេះ",km:"ថ្ងៃនេះ","lo-LA":"ມື້ນີ້",lo:"ມື້ນີ້","mn-MN":"Өнөөдөр",mn:"Өнөөдөр","ka-GE":"დღეს",ka:"დღეს","hy-AM":"Այսօր",hy:"Այսօր","az-AZ":"Bu gün",az:"Bu gün","kk-KZ":"Бүгін",kk:"Бүгін","ky-KG":"Бүгүн",ky:"Бүгүн","uz-UZ":"Bugun",uz:"Bugun","tg-TJ":"Имрӯз",tg:"Имрӯз","ps-AF":"نن",ps:"نن","ku-IQ":"ئەمڕۆ",ku:"ئەمڕۆ","yi-IL":"היינט",yi:"היינט","lb-LU":"Haut",lb:"Haut","is-IS":"Í dag",is:"Í dag","mt-MT":"Illum",mt:"Illum","cy-GB":"Heddiw",cy:"Heddiw","ga-IE":"Inniu",ga:"Inniu","gd-GB":"An-diugh",gd:"An-diugh","kw-GB":"Hedhyw",kw:"Hedhyw","br-FR":"Hiziv",br:"Hiziv","oc-FR":"Uèi",oc:"Uèi","ca-ES":"Avui",ca:"Avui","eu-ES":"Gaur",eu:"Gaur","gl-ES":"Hoxe",gl:"Hoxe","ast-ES":"Güei",ast:"Güei","an-ES":"Hue",an:"Hue","fur-IT":"Vuê",fur:"Vuê","lij-IT":"Ancheu",lij:"Ancheu","pms-IT":"Ancheuj",pms:"Ancheuj","rm-CH":"Oz",rm:"Oz","gsw-CH":"Hüt",gsw:"Hüt","wae-CH":"Hüt",wae:"Hüt","bar-AT":"Heit",bar:"Heit","ksh-DE":"Hück",ksh:"Hück","nds-DE":"Vundaag",nds:"Vundaag","pfl-DE":"Haid",pfl:"Haid","pdc-US":"Heit",pdc:"Heit","af-ZA":"Vandag",af:"Vandag","zu-ZA":"Namhlanje",zu:"Namhlanje","xh-ZA":"Namhlanje",xh:"Namhlanje","st-ZA":"Kajeno",st:"Kajeno","tn-ZA":"Kajeno",tn:"Kajeno","ve-ZA":"Leno",ve:"Leno","nso-ZA":"Kajeno",nso:"Kajeno","ts-ZA":"Namuntlha",ts:"Namuntlha","ss-ZA":"Lamuhla",ss:"Lamuhla","nr-ZA":"Namhlanje",nr:"Namhlanje","ff-SN":"Hannde",ff:"Hannde","wo-SN":"Tey",wo:"Tey","ig-NG":"Taa",ig:"Taa","yo-NG":"Lónìí",yo:"Lónìí","ha-NG":"Yau",ha:"Yau","sw-KE":"Leo",sw:"Leo","am-ET":"ዛሬ",am:"ዛሬ","ti-ER":"ሎሚ",ti:"ሎሚ","so-SO":"Maanta",so:"Maanta","om-ET":"Har'a",om:"Har'a"}},6370(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.templatesBasedOnUtility=void 0,t.templatesBasedOnUtility={default:(e=!1)=>`<div class="--single-month flex flex-col overflow-hidden">\n <div class="grid grid-cols-5 items-center gap-x-3 mx-1.5 pb-3" data-vc="header">\n <div class="col-span-1">\n <#CustomArrowPrev />\n </div>\n <div class="col-span-3 flex justify-center items-center gap-x-1">\n <#CustomMonth />\n <span class="text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}">/</span>\n <#CustomYear />\n </div>\n <div class="col-span-1 flex justify-end">\n <#CustomArrowNext />\n </div>\n </div>\n <div data-vc="wrapper">\n <div data-vc="content">\n <#Week />\n <#Dates />\n </div>\n </div>\n </div>`,multiple:(e=!1)=>`<div class="relative flex flex-col overflow-hidden">\n <div class="absolute top-2 inset-s-2">\n <#CustomArrowPrev />\n </div>\n <div class="absolute top-2 inset-e-2">\n <#CustomArrowNext />\n </div>\n <div class="sm:flex" data-vc="grid">\n <#Multiple>\n <div class="p-3 space-y-0.5 --single-month" data-vc="column">\n <div class="pb-3" data-vc="header">\n <div class="flex justify-center items-center gap-x-1" data-vc-header="content">\n <#CustomMonth />\n <span class="text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}">/</span>\n <#CustomYear />\n </div>\n </div>\n <div data-vc="wrapper">\n <div data-vc="content">\n <#Week />\n <#Dates />\n </div>\n </div>\n </div>\n <#/Multiple>\n </div>\n </div>`,year:(e=!1)=>`<div class="relative bg-white ${"light"!==e?"dark:bg-neutral-900":""}" data-vc="header" role="toolbar">\n <div class="grid grid-cols-5 items-center gap-x-3 mx-1.5 py-3" data-vc="header">\n <div class="col-span-1">\n <#CustomArrowPrev />\n </div>\n <div class="col-span-3 flex justify-center items-center gap-x-1">\n <#Month />\n <span class="text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}">/</span>\n <#Year />\n </div>\n <div class="col-span-1 flex justify-end">\n <#CustomArrowNext />\n </div>\n </div>\n </div>\n <div data-vc="wrapper">\n <div data-vc="content">\n <#Years />\n </div>\n </div>`,month:(e=!1)=>`<div class="py-3" data-vc="header" role="toolbar">\n <div class="flex justify-center items-center gap-x-1" data-vc-header="content">\n <#Month />\n <span class="text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}">/</span>\n <#Year />\n </div>\n </div>\n <div data-vc="wrapper">\n <div data-vc="content">\n <#Months />\n </div>\n </div>`,years:(e,t=!1)=>`<div class="relative">\n <span class="hidden" data-vc="year"></span>\n <select data-hs-select='{\n "placeholder": "Select year",\n "dropdownScope": "parent",\n "dropdownVerticalFixedPlacement": "bottom",\n "toggleTag": "<button type=\\"button\\"><span data-title></span></button>",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative flex text-nowrap w-full cursor-pointer text-start font-medium text-gray-800 hover:text-gray-600 focus:outline-hidden focus:text-gray-600 before:absolute before:inset-0 before:z-1 ${"light"!==t?"dark:text-neutral-200 dark:hover:text-neutral-300 dark:focus:text-neutral-300":""}",\n "dropdownClasses": "mt-2 z-50 w-20 max-h-60 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg shadow-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==t?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "p-2 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 ${"light"!==t?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span><span class=\\"hidden hs-selected:block\\"><svg class=\\"shrink-0 size-3.5 text-gray-800 ${"light"!==t?"dark:text-neutral-200":""}\\" xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"2\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"><polyline points=\\"20 6 9 17 4 12\\"/></svg></span></div>"\n }' class="hidden --year --prevent-on-load-init">\n ${e}\n </select>\n </div>`,months:(e=!1)=>`<div class="relative">\n <span class="hidden" data-vc="month"></span>\n <select data-hs-select='{\n "placeholder": "Select month",\n "dropdownScope": "parent",\n "dropdownVerticalFixedPlacement": "bottom",\n "toggleTag": "<button type=\\"button\\"><span data-title></span></button>",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative flex text-nowrap w-full cursor-pointer text-start font-medium text-gray-800 hover:text-gray-600 focus:outline-hidden focus:text-gray-600 before:absolute before:inset-0 before:z-1 ${"light"!==e?"dark:text-neutral-200 dark:hover:text-neutral-300 dark:focus:text-neutral-300":""}",\n "dropdownClasses": "mt-2 z-50 w-32 max-h-60 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg shadow-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==e?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "p-2 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg hs-select-disabled:opacity-50 hs-select-disabled:pointer-events-none focus:outline-hidden focus:bg-gray-100 ${"light"!==e?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span><span class=\\"hidden hs-selected:block\\"><svg class=\\"shrink-0 size-3.5 text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}\\" xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"2\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"><polyline points=\\"20 6 9 17 4 12\\"/></svg></span></div>"\n }' class="hidden --month --prevent-on-load-init">\n <option value="0">January</option>\n <option value="1">February</option>\n <option value="2">March</option>\n <option value="3">April</option>\n <option value="4">May</option>\n <option value="5">June</option>\n <option value="6">July</option>\n <option value="7">August</option>\n <option value="8">September</option>\n <option value="9">October</option>\n <option value="10">November</option>\n <option value="11">December</option>\n </select>\n </div>`,hours:(e=!1)=>`<div class="relative">\n <select class="--hours hidden" data-hs-select='{\n "placeholder": "Select option...",\n "dropdownVerticalFixedPlacement": "top",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative py-1 px-2 pe-6 flex text-nowrap w-full cursor-pointer bg-white border border-gray-200 rounded-lg text-start text-sm focus:border-blue-500 focus:ring-blue-500 before:absolute before:inset-0 before:z-1 ${"light"!==e?"dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400":""}",\n "dropdownClasses": "mt-2 z-50 w-full min-w-24 max-h-72 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==e?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "hs-selected:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-neutral-800":""} py-2 px-4 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-gray-700":""} ${"light"!==e?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span></div>"\n }'>\n <option value="01">01</option>\n <option value="02">02</option>\n <option value="03">03</option>\n <option value="04">04</option>\n <option value="05">05</option>\n <option value="06">06</option>\n <option value="07">07</option>\n <option value="08">08</option>\n <option value="09">09</option>\n <option value="10">10</option>\n <option value="11">11</option>\n <option value="12" selected>12</option>\n </select>\n <div class="absolute top-1/2 inset-e-2 -translate-y-1/2">\n <svg class="shrink-0 size-3 text-gray-500 ${"light"!==e?"dark:text-neutral-500":""}" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>\n </div>\n </div>`,minutes:(e=!1)=>`<div class="relative">\n <select class="--minutes hidden" data-hs-select='{\n "placeholder": "Select option...",\n "dropdownVerticalFixedPlacement": "top",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative py-1 px-2 pe-6 flex text-nowrap w-full cursor-pointer bg-white border border-gray-200 rounded-lg text-start text-sm focus:border-blue-500 focus:ring-blue-500 before:absolute before:inset-0 before:z-1 ${"light"!==e?"dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400":""}",\n "dropdownClasses": "mt-2 z-50 w-full min-w-24 max-h-72 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==e?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "hs-selected:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-neutral-800":""} py-2 px-4 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-gray-700":""} ${"light"!==e?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span></div>"\n }'>\n <option value="00" selected>00</option>\n <option value="01">01</option>\n <option value="02">02</option>\n <option value="03">03</option>\n <option value="04">04</option>\n <option value="05">05</option>\n <option value="06">06</option>\n <option value="07">07</option>\n <option value="08">08</option>\n <option value="09">09</option>\n <option value="10">10</option>\n <option value="11">11</option>\n <option value="12">12</option>\n <option value="13">13</option>\n <option value="14">14</option>\n <option value="15">15</option>\n <option value="16">16</option>\n <option value="17">17</option>\n <option value="18">18</option>\n <option value="19">19</option>\n <option value="20">20</option>\n <option value="21">21</option>\n <option value="22">22</option>\n <option value="23">23</option>\n <option value="24">24</option>\n <option value="25">25</option>\n <option value="26">26</option>\n <option value="27">27</option>\n <option value="28">28</option>\n <option value="29">29</option>\n <option value="30">30</option>\n <option value="31">31</option>\n <option value="32">32</option>\n <option value="33">33</option>\n <option value="34">34</option>\n <option value="35">35</option>\n <option value="36">36</option>\n <option value="37">37</option>\n <option value="38">38</option>\n <option value="39">39</option>\n <option value="40">40</option>\n <option value="41">41</option>\n <option value="42">42</option>\n <option value="43">43</option>\n <option value="44">44</option>\n <option value="45">45</option>\n <option value="46">46</option>\n <option value="47">47</option>\n <option value="48">48</option>\n <option value="49">49</option>\n <option value="50">50</option>\n <option value="51">51</option>\n <option value="52">52</option>\n <option value="53">53</option>\n <option value="54">54</option>\n <option value="55">55</option>\n <option value="56">56</option>\n <option value="57">57</option>\n <option value="58">58</option>\n <option value="59">59</option>\n </select>\n <div class="absolute top-1/2 inset-e-2 -translate-y-1/2">\n <svg class="shrink-0 size-3 text-gray-500 ${"light"!==e?"dark:text-neutral-500":""}" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>\n </div>\n </div>`,meridiem:(e=!1)=>`<div class="relative">\n <select class="--meridiem hidden" data-hs-select='{\n "placeholder": "Select option...",\n "dropdownVerticalFixedPlacement": "top",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative py-1 px-2 pe-6 flex text-nowrap w-full cursor-pointer bg-white border border-gray-200 rounded-lg text-start text-sm focus:border-blue-500 focus:ring-blue-500 before:absolute before:inset-0 before:z-1 ${"light"!==e?"dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400":""}",\n "dropdownClasses": "mt-2 z-50 w-full min-w-24 max-h-72 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==e?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "hs-selected:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-neutral-800":""} py-2 px-4 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-gray-700":""} ${"light"!==e?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span></div>"\n }'>\n <option value="PM" selected>PM</option>\n <option value="AM">AM</option>\n </select>\n <div class="absolute top-1/2 inset-e-2 -translate-y-1/2">\n <svg class="shrink-0 size-3 text-gray-500 ${"light"!==e?"dark:text-neutral-500":""}" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>\n </div>\n </div>`}},3191(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.templates=void 0,t.templates={default:(e=!1)=>`<div class="--single-month flex flex-col overflow-hidden">\n <div class="grid grid-cols-5 items-center gap-x-3 mx-1.5 pb-3" data-vc="header">\n <div class="col-span-1">\n <#CustomArrowPrev />\n </div>\n <div class="col-span-3 flex justify-center items-center gap-x-1">\n <#CustomMonth />\n <span class="text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}">/</span>\n <#CustomYear />\n </div>\n <div class="col-span-1 flex justify-end">\n <#CustomArrowNext />\n </div>\n </div>\n <div data-vc="wrapper">\n <div data-vc="content">\n <#Week />\n <#Dates />\n </div>\n </div>\n </div>`,multiple:(e=!1)=>`<div class="relative flex flex-col overflow-hidden">\n <div class="absolute top-2 inset-s-2">\n <#CustomArrowPrev />\n </div>\n <div class="absolute top-2 inset-e-2">\n <#CustomArrowNext />\n </div>\n <div class="sm:flex" data-vc="grid">\n <#Multiple>\n <div class="p-3 space-y-0.5 --single-month" data-vc="column">\n <div class="pb-3" data-vc="header">\n <div class="flex justify-center items-center gap-x-1" data-vc-header="content">\n <#CustomMonth />\n <span class="text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}">/</span>\n <#CustomYear />\n </div>\n </div>\n <div data-vc="wrapper">\n <div data-vc="content">\n <#Week />\n <#Dates />\n </div>\n </div>\n </div>\n <#/Multiple>\n </div>\n </div>`,year:(e=!1)=>`<div class="relative bg-white ${"light"!==e?"dark:bg-neutral-900":""}" data-vc="header" role="toolbar">\n <div class="grid grid-cols-5 items-center gap-x-3 mx-1.5 py-3" data-vc="header">\n <div class="col-span-1">\n <#CustomArrowPrev />\n </div>\n <div class="col-span-3 flex justify-center items-center gap-x-1">\n <#Month />\n <span class="text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}">/</span>\n <#Year />\n </div>\n <div class="col-span-1 flex justify-end">\n <#CustomArrowNext />\n </div>\n </div>\n </div>\n <div data-vc="wrapper">\n <div data-vc="content">\n <#Years />\n </div>\n </div>`,month:(e=!1)=>`<div class="py-3" data-vc="header" role="toolbar">\n <div class="flex justify-center items-center gap-x-1" data-vc-header="content">\n <#Month />\n <span class="text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}">/</span>\n <#Year />\n </div>\n </div>\n <div data-vc="wrapper">\n <div data-vc="content">\n <#Months />\n </div>\n </div>`,years:(e,t=!1)=>`<div class="relative">\n <span class="hidden" data-vc="year"></span>\n <select data-hs-select='{\n "placeholder": "Select year",\n "dropdownScope": "parent",\n "dropdownVerticalFixedPlacement": "bottom",\n "toggleTag": "<button type=\\"button\\"><span data-title></span></button>",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative flex text-nowrap w-full cursor-pointer text-start font-medium text-gray-800 hover:text-gray-600 focus:outline-hidden focus:text-gray-600 before:absolute before:inset-0 before:z-1 ${"light"!==t?"dark:text-neutral-200 dark:hover:text-neutral-300 dark:focus:text-neutral-300":""}",\n "dropdownClasses": "mt-2 z-50 w-20 max-h-60 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg shadow-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==t?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "p-2 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 ${"light"!==t?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span><span class=\\"hidden hs-selected:block\\"><svg class=\\"shrink-0 size-3.5 text-gray-800 ${"light"!==t?"dark:text-neutral-200":""}\\" xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"2\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"><polyline points=\\"20 6 9 17 4 12\\"/></svg></span></div>"\n }' class="hidden --year --prevent-on-load-init">\n ${e}\n </select>\n </div>`,months:(e=!1)=>`<div class="relative">\n <span class="hidden" data-vc="month"></span>\n <select data-hs-select='{\n "placeholder": "Select month",\n "dropdownScope": "parent",\n "dropdownVerticalFixedPlacement": "bottom",\n "toggleTag": "<button type=\\"button\\"><span data-title></span></button>",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative flex text-nowrap w-full cursor-pointer text-start font-medium text-gray-800 hover:text-gray-600 focus:outline-hidden focus:text-gray-600 before:absolute before:inset-0 before:z-1 ${"light"!==e?"dark:text-neutral-200 dark:hover:text-neutral-300 dark:focus:text-neutral-300":""}",\n "dropdownClasses": "mt-2 z-50 w-32 max-h-60 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg shadow-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==e?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "p-2 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg hs-select-disabled:opacity-50 hs-select-disabled:pointer-events-none focus:outline-hidden focus:bg-gray-100 ${"light"!==e?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span><span class=\\"hidden hs-selected:block\\"><svg class=\\"shrink-0 size-3.5 text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}\\" xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"2\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"><polyline points=\\"20 6 9 17 4 12\\"/></svg></span></div>"\n }' class="hidden --month --prevent-on-load-init">\n <option value="0">January</option>\n <option value="1">February</option>\n <option value="2">March</option>\n <option value="3">April</option>\n <option value="4">May</option>\n <option value="5">June</option>\n <option value="6">July</option>\n <option value="7">August</option>\n <option value="8">September</option>\n <option value="9">October</option>\n <option value="10">November</option>\n <option value="11">December</option>\n </select>\n </div>`,hours:(e=!1)=>`<div class="relative">\n <select class="--hours hidden" data-hs-select='{\n "placeholder": "Select option...",\n "dropdownVerticalFixedPlacement": "top",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative py-1 px-2 pe-6 flex text-nowrap w-full cursor-pointer bg-white border border-gray-200 rounded-lg text-start text-sm focus:border-blue-500 focus:ring-blue-500 before:absolute before:inset-0 before:z-1 ${"light"!==e?"dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400":""}",\n "dropdownClasses": "mt-2 z-50 w-full min-w-24 max-h-72 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==e?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "hs-selected:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-neutral-800":""} py-2 px-4 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-gray-700":""} ${"light"!==e?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span></div>"\n }'>\n <option value="01">01</option>\n <option value="02">02</option>\n <option value="03">03</option>\n <option value="04">04</option>\n <option value="05">05</option>\n <option value="06">06</option>\n <option value="07">07</option>\n <option value="08">08</option>\n <option value="09">09</option>\n <option value="10">10</option>\n <option value="11">11</option>\n <option value="12" selected>12</option>\n </select>\n <div class="absolute top-1/2 inset-e-2 -translate-y-1/2">\n <svg class="shrink-0 size-3 text-gray-500 ${"light"!==e?"dark:text-neutral-500":""}" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>\n </div>\n </div>`,minutes:(e=!1)=>`<div class="relative">\n <select class="--minutes hidden" data-hs-select='{\n "placeholder": "Select option...",\n "dropdownVerticalFixedPlacement": "top",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative py-1 px-2 pe-6 flex text-nowrap w-full cursor-pointer bg-white border border-gray-200 rounded-lg text-start text-sm focus:border-blue-500 focus:ring-blue-500 before:absolute before:inset-0 before:z-1 ${"light"!==e?"dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400":""}",\n "dropdownClasses": "mt-2 z-50 w-full min-w-24 max-h-72 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==e?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "hs-selected:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-neutral-800":""} py-2 px-4 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-gray-700":""} ${"light"!==e?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span></div>"\n }'>\n <option value="00" selected>00</option>\n <option value="01">01</option>\n <option value="02">02</option>\n <option value="03">03</option>\n <option value="04">04</option>\n <option value="05">05</option>\n <option value="06">06</option>\n <option value="07">07</option>\n <option value="08">08</option>\n <option value="09">09</option>\n <option value="10">10</option>\n <option value="11">11</option>\n <option value="12">12</option>\n <option value="13">13</option>\n <option value="14">14</option>\n <option value="15">15</option>\n <option value="16">16</option>\n <option value="17">17</option>\n <option value="18">18</option>\n <option value="19">19</option>\n <option value="20">20</option>\n <option value="21">21</option>\n <option value="22">22</option>\n <option value="23">23</option>\n <option value="24">24</option>\n <option value="25">25</option>\n <option value="26">26</option>\n <option value="27">27</option>\n <option value="28">28</option>\n <option value="29">29</option>\n <option value="30">30</option>\n <option value="31">31</option>\n <option value="32">32</option>\n <option value="33">33</option>\n <option value="34">34</option>\n <option value="35">35</option>\n <option value="36">36</option>\n <option value="37">37</option>\n <option value="38">38</option>\n <option value="39">39</option>\n <option value="40">40</option>\n <option value="41">41</option>\n <option value="42">42</option>\n <option value="43">43</option>\n <option value="44">44</option>\n <option value="45">45</option>\n <option value="46">46</option>\n <option value="47">47</option>\n <option value="48">48</option>\n <option value="49">49</option>\n <option value="50">50</option>\n <option value="51">51</option>\n <option value="52">52</option>\n <option value="53">53</option>\n <option value="54">54</option>\n <option value="55">55</option>\n <option value="56">56</option>\n <option value="57">57</option>\n <option value="58">58</option>\n <option value="59">59</option>\n </select>\n <div class="absolute top-1/2 inset-e-2 -translate-y-1/2">\n <svg class="shrink-0 size-3 text-gray-500 ${"light"!==e?"dark:text-neutral-500":""}" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>\n </div>\n </div>`,meridiem:(e=!1)=>`<div class="relative">\n <select class="--meridiem hidden" data-hs-select='{\n "placeholder": "Select option...",\n "dropdownVerticalFixedPlacement": "top",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative py-1 px-2 pe-6 flex text-nowrap w-full cursor-pointer bg-white border border-gray-200 rounded-lg text-start text-sm focus:border-blue-500 focus:ring-blue-500 before:absolute before:inset-0 before:z-1 ${"light"!==e?"dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400":""}",\n "dropdownClasses": "mt-2 z-50 w-full min-w-24 max-h-72 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==e?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "hs-selected:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-neutral-800":""} py-2 px-4 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-gray-700":""} ${"light"!==e?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span></div>"\n }'>\n <option value="PM" selected>PM</option>\n <option value="AM">AM</option>\n </select>\n <div class="absolute top-1/2 inset-e-2 -translate-y-1/2">\n <svg class="shrink-0 size-3 text-gray-500 ${"light"!==e?"dark:text-neutral-500":""}" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>\n </div>\n </div>`}},632(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(9359);class n extends s.Calendar{constructor(e,t){super(e,t);const i=this.set;this.set=(e,t)=>{i&&i.call(this,e,t),e.selectedTime&&this.onChangeTime&&this.onChangeTime(this,null,!0),e.selectedMonth&&this.onClickMonth&&this.onClickMonth(this,null),e.selectedYear&&this.onClickYear&&this.onClickYear(this,null)}}static get defaultStyles(){return{calendar:"vc",controls:"vc-controls",grid:"vc-grid",column:"vc-column",header:"vc-header",headerContent:"vc-header__content",month:"vc-month",year:"vc-year",arrowPrev:"vc-arrow vc-arrow_prev",arrowNext:"vc-arrow vc-arrow_next",wrapper:"vc-wrapper",content:"vc-content",months:"vc-months",monthsMonth:"vc-months__month",years:"vc-years",yearsYear:"vc-years__year",week:"vc-week",weekDay:"vc-week__day",weekNumbers:"vc-week-numbers",weekNumbersTitle:"vc-week-numbers__title",weekNumbersContent:"vc-week-numbers__content",weekNumber:"vc-week-number",dates:"vc-dates",date:"vc-date",dateBtn:"vc-date__btn",datePopup:"vc-date__popup",dateRangeTooltip:"vc-date-range-tooltip",time:"vc-time",timeContent:"vc-time__content",timeHour:"vc-time__hour",timeMinute:"vc-time__minute",timeKeeping:"vc-time__keeping",timeRanges:"vc-time__ranges",timeRange:"vc-time__range"}}logInfo(){console.log("This log is from CustomVanillaCalendar!",this)}}t.default=n},9608(e,t,i){"use strict";
|
|
63
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=i(3465),l=n(i(632)),r=i(3191),a=i(6370),d=i(8852),c=i(292),h=n(i(591)),u=n(i(2961)),p=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}$/.test(e)?(0,o.getDate)(e):new Date(e);class m extends u.default{constructor(e,t,i){var n,d,c,h,u,p,m,g,v;super(e,t,i);const f=e.getAttribute("data-hs-datepicker")?JSON.parse(e.getAttribute("data-hs-datepicker")):{};this.dataOptions=Object.assign(Object.assign({},f),t),this.applyUtilityClasses=void 0!==(null===(n=this.dataOptions)||void 0===n?void 0:n.applyUtilityClasses)&&(null===(d=this.dataOptions)||void 0===d?void 0:d.applyUtilityClasses),this.templatesByType=this.applyUtilityClasses?r.templates:a.templatesBasedOnUtility;const y=void 0!==(null===(c=this.dataOptions)||void 0===c?void 0:c.removeDefaultStyles)&&(null===(h=this.dataOptions)||void 0===h?void 0:h.removeDefaultStyles);this.updatedStyles=_.mergeWith(y?{}:l.default.defaultStyles,(null===(u=this.dataOptions)||void 0===u?void 0:u.styles)||{},(e,t)=>{if("string"==typeof e&&"string"==typeof t)return`${e} ${t}`});const b=new Date,w={selectedTheme:null!==(p=this.dataOptions.selectedTheme)&&void 0!==p?p:"",styles:this.updatedStyles,dateMin:null!==(m=this.dataOptions.dateMin)&&void 0!==m?m:(0,o.getDateString)(b),dateMax:null!==(g=this.dataOptions.dateMax)&&void 0!==g?g:"2470-12-31",mode:null!==(v=this.dataOptions.mode)&&void 0!==v?v:"default",inputMode:void 0===this.dataOptions.inputMode||this.dataOptions.inputMode},C=(e,t)=>i=>{null==e||e(i),null==t||t(i)},x=e=>{this.hasTime(e)&&this.initCustomTime(e)},S={layouts:{month:this.templatesByType.month(w.selectedTheme)},onInit:C(this.dataOptions.onInit,e=>{"custom-select"!==w.mode||this.dataOptions.inputMode||x(e),this.dataOptions.showTodayButton&&e.context.mainElement.addEventListener("click",e=>{e.target.closest("[data-hs-datepicker-today]")&&this.selectToday()})}),onShow:C(this.dataOptions.onShow,e=>{w.inputMode&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{window.dispatchEvent(new Event("resize"))})}),"custom-select"===w.mode&&(this.updateCustomSelects(e),x(e))}),onHide:C(this.dataOptions.onHide,e=>{"custom-select"===w.mode&&this.destroySelects(e.context.mainElement)}),onUpdate:C(this.dataOptions.onUpdate,e=>{this.updateCalendar(e.context.mainElement)}),onCreateDateEls:C(this.dataOptions.onCreateDateEls,e=>{"custom-select"===w.mode&&this.updateCustomSelects(e)}),onChangeToInput:C(this.dataOptions.onChangeToInput,e=>{if(!e.context.inputElement)return;this.setInputValue(e.context.inputElement,e.context.selectedDates);const t={selectedDates:e.context.selectedDates,selectedTime:e.context.selectedTime,rest:e.context};this.fireEvent("change",t),(0,s.dispatch)("change.hs.datepicker",this.el,t),this.shouldCloseOnSelect(e)&&e.hide()}),onChangeTime:C(this.dataOptions.onChangeTime,x),onClickYear:C(this.dataOptions.onClickYear,x),onClickMonth:C(this.dataOptions.onClickMonth,x),onClickArrow:C(this.dataOptions.onClickArrow,e=>{"custom-select"===w.mode&&setTimeout(()=>{this.disableNav(),this.disableOptions(),this.updateCalendar(e.context.mainElement)})})};this.concatOptions=_.merge(S,this.dataOptions);const T=Object.assign(Object.assign({},w),{layouts:{default:this.processCustomTemplate(this.templatesByType.default(w.selectedTheme),"default"),multiple:this.processCustomTemplate(this.templatesByType.multiple(w.selectedTheme),"multiple"),year:this.processCustomTemplate(this.templatesByType.year(w.selectedTheme),"default")}});this.concatOptions=_.merge(this.concatOptions,T),this.vanillaCalendar=new l.default(this.el,this.concatOptions),this.init()}init(){var e,t;this.createCollection(window.$hsDatepickerCollection,this),this.vanillaCalendar.init();const{inputElement:i}=this.vanillaCalendar.context;(null===(e=this.dataOptions)||void 0===e?void 0:e.selectedDates)&&i&&this.setInputValue(i,this.formatDateArrayToIndividualDates(null===(t=this.dataOptions)||void 0===t?void 0:t.selectedDates))}getTimeParts(e){const[t,i]=e.split(" "),[n,s]=t.split(":");return[n,s,i]}getCurrentMonthAndYear(e){const t=e.querySelector('[data-vc="month"]'),i=e.querySelector('[data-vc="year"]');return{month:+t.getAttribute("data-vc-month"),year:+i.getAttribute("data-vc-year")}}extractSeparatorFromFormat(e){const t=e.match(/[^A-Za-z0-9]/);return t?t[0]:"."}setInputValue(e,t){var i,n,s,o,l,r,a,d,c;const h=null===(i=this.dataOptions)||void 0===i?void 0:i.dateFormat,u=h?this.extractSeparatorFromFormat(h):null,p=null!==(o=null!=u?u:null===(s=null===(n=this.dataOptions)||void 0===n?void 0:n.inputModeOptions)||void 0===s?void 0:s.dateSeparator)&&void 0!==o?o:".",m=null!==(a=null===(r=null===(l=this.dataOptions)||void 0===l?void 0:l.inputModeOptions)||void 0===r?void 0:r.itemsSeparator)&&void 0!==a?a:", ",g=null!==(c=null===(d=this.dataOptions)||void 0===d?void 0:d.selectionDatesMode)&&void 0!==c?c:"single";if(t.length&&t.length>1)if("multiple"===g){const i=[];t.forEach(e=>i.push(h?this.formatDate(e,h):this.changeDateSeparator(e,p))),e.value=i.join(m)}else{const i=h?this.formatDate(t[0],h):this.changeDateSeparator(t[0],p),n=h?this.formatDate(t[1],h):this.changeDateSeparator(t[1],p);e.value=[i,n].join(m)}else t.length&&1===t.length?e.value=h?this.formatDate(t[0],h):this.changeDateSeparator(t[0],p):e.value=""}getLocalizedTodayText(e){return d.todayTranslations[e]||"Today"}changeDateSeparator(e,t=".",i="-"){var n,s;const o=p(e);if(null===(n=this.dataOptions)||void 0===n?void 0:n.replaceTodayWithText){const e=new Date;if(o.toDateString()===e.toDateString()){const e=null===(s=this.dataOptions)||void 0===s?void 0:s.dateLocale;return this.getLocalizedTodayText(e)}}return e.split(i).join(t)}formatDateArrayToIndividualDates(e){var t,i;const n=null!==(i=null===(t=this.dataOptions)||void 0===t?void 0:t.selectionDatesMode)&&void 0!==i?i:"single";return e.flatMap(e=>{if("string"==typeof e){if("today"===e.toLowerCase()){const e=new Date;return[(0,o.getDateString)(e)]}const t=e.match(/^(\d{4}-\d{2}-\d{2})\s*[^a-zA-Z0-9]*\s*(\d{4}-\d{2}-\d{2})$/);if(t){const[e,i,s]=t;return"multiple-ranged"===n?[i,s]:((e,t)=>(0,o.parseDates)([`${e}:${t}`]))(i.trim(),s.trim())}return[e]}return"number"==typeof e?[(0,o.getDateString)(new Date(e))]:e instanceof Date?[(0,o.getDateString)(e)]:[]})}hasTime(e){const{mainElement:t}=e.context,i=t.querySelector("[data-hs-select].--hours"),n=t.querySelector("[data-hs-select].--minutes"),s=t.querySelector("[data-hs-select].--meridiem");return i&&n&&s}shouldCloseOnSelect(e){var t,i,n;return!!(null===(i=null===(t=this.dataOptions)||void 0===t?void 0:t.inputModeOptions)||void 0===i?void 0:i.closeOnSelect)&&("single"===(null!==(n=e.selectionDatesMode)&&void 0!==n?n:"single")&&!e.selectionTimeMode&&!this.hasTime(e)&&1===e.context.selectedDates.length)}createArrowFromTemplate(e,t=!1){if(!t)return e;const i=(0,c.htmlToElement)(e);return(0,c.classToClassList)(t,i),i.outerHTML}concatObjectProperties(e,t){const i={};return new Set([...Object.keys(e||{}),...Object.keys(t||{})]).forEach(n=>{const s=e[n]||"",o=t[n]||"";i[n]=`${s} ${o}`.trim()}),i}updateTemplate(e,t,i){if(!t)return e;const n=JSON.parse(e.match(/data-hs-select='([^']+)'/)[1]),s=this.concatObjectProperties(t,i),o=_.merge(n,s);return e.replace(/data-hs-select='[^']+'/,`data-hs-select='${JSON.stringify(o)}'`)}initCustomTime(e){var t;const{mainElement:i}=e.context,n=this.getTimeParts(null!==(t=e.selectedTime)&&void 0!==t?t:"12:00 PM"),s={hours:i.querySelector("[data-hs-select].--hours"),minutes:i.querySelector("[data-hs-select].--minutes"),meridiem:i.querySelector("[data-hs-select].--meridiem")};Object.entries(s).forEach(([t,s])=>{if(!h.default.getInstance(s,!0)){const o=new h.default(s);o.setValue(n["meridiem"===t?2:"minutes"===t?1:0]),o.el.addEventListener("change.hs.select",s=>{this.destroySelects(i);const o="hours"===t?s.detail.payload:n[0],l="minutes"===t?s.detail.payload:n[1],r="meridiem"===t?s.detail.payload:n[2];e.set({selectedTime:`${o}:${l} ${r}`},{dates:!1,year:!1,month:!1})})}})}initCustomMonths(e){const{mainElement:t}=e.context,i=Array.from(t.querySelectorAll(".--single-month"));i.length&&i.forEach((i,n)=>{const s=i.querySelector("[data-hs-select].--month");if(h.default.getInstance(s,!0))return!1;const o=new h.default(s),{month:l,year:r}=this.getCurrentMonthAndYear(i);o.setValue(`${l}`),o.el.addEventListener("change.hs.select",i=>{this.destroySelects(t),e.set({selectedMonth:+i.detail.payload-n<0?11:+i.detail.payload-n,selectedYear:+i.detail.payload-n<0?+r-1:r},{dates:!1,time:!1})})})}initCustomYears(e){const{mainElement:t}=e.context,i=Array.from(t.querySelectorAll(".--single-month"));i.length&&i.forEach(i=>{const n=i.querySelector("[data-hs-select].--year");if(h.default.getInstance(n,!0))return!1;const s=new h.default(n),{month:o,year:l}=this.getCurrentMonthAndYear(i);s.setValue(`${l}`),s.el.addEventListener("change.hs.select",i=>{const{dateMax:n,displayMonthsCount:s}=this.vanillaCalendar.context,l=p(n).getFullYear(),r=p(n).getMonth();this.destroySelects(t),e.set({selectedMonth:o>r-s&&+i.detail.payload===l?r-s+1:o,selectedYear:i.detail.payload},{dates:!1,time:!1})})})}generateCustomTimeMarkup(){var e,t,i,n;const s=null===(e=this.updatedStyles)||void 0===e?void 0:e.customSelect,o=s?this.updateTemplate(this.templatesByType.hours(this.concatOptions.selectedTheme),(null==s?void 0:s.shared)||{},(null==s?void 0:s.hours)||{}):this.templatesByType.hours(this.concatOptions.selectedTheme),l=s?this.updateTemplate(this.templatesByType.minutes(this.concatOptions.selectedTheme),(null==s?void 0:s.shared)||{},(null==s?void 0:s.minutes)||{}):this.templatesByType.minutes(this.concatOptions.selectedTheme),r=s?this.updateTemplate(this.templatesByType.meridiem(this.concatOptions.selectedTheme),(null==s?void 0:s.shared)||{},(null==s?void 0:s.meridiem)||{}):this.templatesByType.meridiem(this.concatOptions.selectedTheme);return`<div class="--time">${null!==(n=null===(i=null===(t=null==this?void 0:this.dataOptions)||void 0===t?void 0:t.templates)||void 0===i?void 0:i.time)&&void 0!==n?n:`\n\t\t\t<div class="pt-3 flex justify-center items-center gap-x-2">\n ${o}\n <span class="text-gray-800 ${"light"!==this.concatOptions.selectedTheme?"dark:text-white":""}">:</span>\n ${l}\n ${r}\n </div>\n\t\t`}</div>`}generateCustomMonthMarkup(){var e,t,i;const n=null!==(t=null===(e=null==this?void 0:this.dataOptions)||void 0===e?void 0:e.mode)&&void 0!==t?t:"default",s=null===(i=this.updatedStyles)||void 0===i?void 0:i.customSelect,o=s?this.updateTemplate(this.templatesByType.months(this.concatOptions.selectedTheme),(null==s?void 0:s.shared)||{},(null==s?void 0:s.months)||{}):this.templatesByType.months(this.concatOptions.selectedTheme);return"custom-select"===n?o:"<#Month />"}generateCustomYearMarkup(){var e,t,i,n,s,l,r;if("custom-select"===(null!==(t=null===(e=null==this?void 0:this.dataOptions)||void 0===e?void 0:e.mode)&&void 0!==t?t:"default")){const e=new Date,t=null!==(n=null===(i=null==this?void 0:this.dataOptions)||void 0===i?void 0:i.dateMin)&&void 0!==n?n:(0,o.getDateString)(e),a=null!==(l=null===(s=null==this?void 0:this.dataOptions)||void 0===s?void 0:s.dateMax)&&void 0!==l?l:"2470-12-31",d=p(t),c=p(a),h=d.getFullYear(),u=c.getFullYear(),m=()=>{let e="";for(let t=h;t<=u;t++)e+=`<option value="${t}">${t}</option>`;return e},g=this.templatesByType.years(m(),this.concatOptions.selectedTheme),v=null===(r=this.updatedStyles)||void 0===r?void 0:r.customSelect;return v?this.updateTemplate(g,(null==v?void 0:v.shared)||{},(null==v?void 0:v.years)||{}):g}return"<#Year />"}generateCustomArrowPrevMarkup(){var e,t;return(null===(t=null===(e=null==this?void 0:this.dataOptions)||void 0===e?void 0:e.templates)||void 0===t?void 0:t.arrowPrev)?this.createArrowFromTemplate(this.dataOptions.templates.arrowPrev,this.updatedStyles.arrowPrev):"<#ArrowPrev [month] />"}generateCustomArrowNextMarkup(){var e,t;return(null===(t=null===(e=null==this?void 0:this.dataOptions)||void 0===e?void 0:e.templates)||void 0===t?void 0:t.arrowNext)?this.createArrowFromTemplate(this.dataOptions.templates.arrowNext,this.updatedStyles.arrowNext):"<#ArrowNext [month] />"}parseCustomTime(e){return e=e.replace(/<#CustomTime\s*\/>/g,this.generateCustomTimeMarkup())}parseCustomMonth(e){return e=e.replace(/<#CustomMonth\s*\/>/g,this.generateCustomMonthMarkup())}parseCustomYear(e){return e=e.replace(/<#CustomYear\s*\/>/g,this.generateCustomYearMarkup())}parseArrowPrev(e){return e=e.replace(/<#CustomArrowPrev\s*\/>/g,this.generateCustomArrowPrevMarkup())}parseArrowNext(e){return e=e.replace(/<#CustomArrowNext\s*\/>/g,this.generateCustomArrowNextMarkup())}generateCustomTodayMarkup(){var e,t;if(!(null===(e=this.dataOptions)||void 0===e?void 0:e.showTodayButton))return"";return`<div class="vc-footer"><button type="button" class="vc-today" data-hs-datepicker-today>${this.getLocalizedTodayText(null===(t=this.dataOptions)||void 0===t?void 0:t.dateLocale)}</button></div>`}parseCustomToday(e){return e=e.replace(/<#CustomToday\s*\/>/g,this.generateCustomTodayMarkup())}selectToday(){const e=new Date,t=e.getFullYear(),i=e.getMonth(),n=[t,String(i+1).padStart(2,"0"),String(e.getDate()).padStart(2,"0")].join("-"),{dateMin:s,dateMax:o}=this.vanillaCalendar.context;if(n<s||n>o)return;if(this.vanillaCalendar.set({selectedYear:t,selectedMonth:i},{year:!0,month:!0}),this.vanillaCalendar.context.selectedDates.includes(n))return;const l=this.vanillaCalendar.context.mainElement.querySelector(`[data-vc-date="${n}"]:not([data-vc-date-disabled]) [data-vc-date-btn]`);null==l||l.click()}processCustomTemplate(e,t){var i,n,s,o;const l="default"===t?null===(n=null===(i=null==this?void 0:this.dataOptions)||void 0===i?void 0:i.layouts)||void 0===n?void 0:n.default:null===(o=null===(s=null==this?void 0:this.dataOptions)||void 0===s?void 0:s.layouts)||void 0===o?void 0:o.multiple,r=this.parseCustomMonth(null!=l?l:e),a=this.parseCustomYear(r),d=this.parseCustomTime(a),c=this.parseArrowPrev(d),h=this.parseArrowNext(c);return this.parseCustomToday(h)}disableOptions(){const{mainElement:e,dateMax:t,displayMonthsCount:i}=this.vanillaCalendar.context,n=p(t);Array.from(e.querySelectorAll(".--single-month")).forEach((e,t)=>{var s;const o=+(null===(s=e.querySelector('[data-vc="year"]'))||void 0===s?void 0:s.getAttribute("data-vc-year")),l=e.querySelectorAll("[data-hs-select].--month option"),r=e.querySelectorAll("[data-hs-select-dropdown] [data-value]"),a=e=>+e.getAttribute("data-value")>n.getMonth()-i+t+1&&o===n.getFullYear();Array.from(l).forEach(e=>e.toggleAttribute("disabled",a(e))),Array.from(r).forEach(e=>e.classList.toggle("disabled",a(e)))})}disableNav(){const{mainElement:e,dateMax:t,selectedYear:i,selectedMonth:n,displayMonthsCount:s}=this.vanillaCalendar.context,o=p(t).getFullYear(),l=e.querySelector('[data-vc-arrow="next"]');l.style.visibility=i===o&&n+s>11?"hidden":""}destroySelects(e){Array.from(e.querySelectorAll("[data-hs-select]")).forEach(e=>{const t=h.default.getInstance(e,!0);t&&t.element.destroy()})}updateSelect(e,t){const i=h.default.getInstance(e,!0);i&&i.element.setValue(t)}updateCalendar(e){const t=e.querySelectorAll(".--single-month");t.length&&t.forEach(e=>{const{month:t,year:i}=this.getCurrentMonthAndYear(e);this.updateSelect(e.querySelector("[data-hs-select].--month"),`${t}`),this.updateSelect(e.querySelector("[data-hs-select].--year"),`${i}`)})}updateCustomSelects(e){setTimeout(()=>{this.disableOptions(),this.disableNav(),this.initCustomMonths(e),this.initCustomYears(e)})}getCurrentState(){return{selectedDates:this.vanillaCalendar.selectedDates,selectedTime:this.vanillaCalendar.selectedTime}}formatDate(e,t){var i,n,s,o,l,r,a;const d=t||(null===(i=this.dataOptions)||void 0===i?void 0:i.dateFormat),c=(null===(n=this.dataOptions)||void 0===n?void 0:n.dateLocale)||void 0;if(!d){const t=null!==(l=null===(o=null===(s=this.dataOptions)||void 0===s?void 0:s.inputModeOptions)||void 0===o?void 0:o.dateSeparator)&&void 0!==l?l:".";return this.changeDateSeparator(e,t)}const h=p(e);if(isNaN(h.getTime()))return this.changeDateSeparator(e);let u="",m=0;for(;m<d.length;)if("YYYY"===d.slice(m,m+4))u+=h.getFullYear().toString(),m+=4;else if("dddd"===d.slice(m,m+4)){const e=h.toLocaleDateString(c,{weekday:"long"});if(null===(r=this.dataOptions)||void 0===r?void 0:r.replaceTodayWithText){const t=new Date;u+=h.toDateString()===t.toDateString()?this.getLocalizedTodayText(c):e}else u+=e;m+=4}else if("MMMM"===d.slice(m,m+4))u+=h.toLocaleDateString(c,{month:"long"}),m+=4;else if("ddd"===d.slice(m,m+3)){const e=h.toLocaleDateString(c,{weekday:"short"});if(null===(a=this.dataOptions)||void 0===a?void 0:a.replaceTodayWithText){const t=new Date;u+=h.toDateString()===t.toDateString()?this.getLocalizedTodayText(c):e}else u+=e;m+=3}else"MMM"===d.slice(m,m+3)?(u+=h.toLocaleDateString(c,{month:"short"}),m+=3):"YY"===d.slice(m,m+2)?(u+=h.getFullYear().toString().slice(-2),m+=2):"MM"===d.slice(m,m+2)?(u+=String(h.getMonth()+1).padStart(2,"0"),m+=2):"DD"===d.slice(m,m+2)?(u+=String(h.getDate()).padStart(2,"0"),m+=2):"HH"===d.slice(m,m+2)?(u+=String(h.getHours()).padStart(2,"0"),m+=2):"mm"===d.slice(m,m+2)?(u+=String(h.getMinutes()).padStart(2,"0"),m+=2):"ss"===d.slice(m,m+2)?(u+=String(h.getSeconds()).padStart(2,"0"),m+=2):"Y"===d[m]?(u+=h.getFullYear().toString(),m+=1):"M"===d[m]?(u+=String(h.getMonth()+1),m+=1):"D"===d[m]?(u+=String(h.getDate()),m+=1):"H"===d[m]?(u+=String(h.getHours()),m+=1):"m"===d[m]?(u+=String(h.getMinutes()),m+=1):"s"===d[m]?(u+=String(h.getSeconds()),m+=1):(u+=d[m],m+=1);return u}destroy(){const e=this.el,t=e.id,i=e.parentElement,n=e.nextElementSibling,s={};Array.from(e.attributes).forEach(e=>{s[e.name]=e.value});const o=e.className,l=e.value;this.vanillaCalendar&&(this.vanillaCalendar.destroy(),this.vanillaCalendar=null),window.$hsDatepickerCollection=window.$hsDatepickerCollection.filter(({element:e})=>e.el!==this.el);const r=document.body.contains(e),a=t?document.getElementById(t):null;if(!r&&!a&&i){const e=document.createElement("input");Object.keys(s).forEach(t=>{e.setAttribute(t,s[t])}),e.className=o,e.value=l,n&&n.parentElement===i?i.insertBefore(e,n):i.appendChild(e),this.el=e}}static getInstance(e,t){const i=window.$hsDatepickerCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e));return i?t?i:i.element.el:null}static autoInit(){window.$hsDatepickerCollection||(window.$hsDatepickerCollection=[]),document.querySelectorAll(".hs-datepicker:not(.--prevent-on-load-init)").forEach(e=>{window.$hsDatepickerCollection.find(t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e})||new m(e)})}}t.default=m},8852(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.todayTranslations=void 0,t.todayTranslations={"ru-RU":"сегодня",ru:"сегодня","de-DE":"Heute",de:"Heute","fr-FR":"Aujourd'hui",fr:"Aujourd'hui","es-ES":"Hoy",es:"Hoy","it-IT":"Oggi",it:"Oggi","pt-BR":"Hoje",pt:"Hoje","pl-PL":"Dzisiaj",pl:"Dzisiaj","uk-UA":"Сьогодні",uk:"Сьогодні","zh-CN":"今天",zh:"今天","ja-JP":"今日",ja:"今日","ko-KR":"오늘",ko:"오늘","ar-SA":"اليوم",ar:"اليوم","hi-IN":"आज",hi:"आज","tr-TR":"Bugün",tr:"Bugün","nl-NL":"Vandaag",nl:"Vandaag","sv-SE":"Idag",sv:"Idag","da-DK":"I dag",da:"I dag","no-NO":"I dag",no:"I dag","fi-FI":"Tänään",fi:"Tänään","cs-CZ":"Dnes",cs:"Dnes","sk-SK":"Dnes",sk:"Dnes","hu-HU":"Ma",hu:"Ma","ro-RO":"Astăzi",ro:"Astăzi","bg-BG":"Днес",bg:"Днес","hr-HR":"Danas",hr:"Danas","sr-RS":"Данас",sr:"Данас","sl-SI":"Danes",sl:"Danes","et-EE":"Täna",et:"Täna","lv-LV":"Šodien",lv:"Šodien","lt-LT":"Šiandien",lt:"Šiandien","el-GR":"Σήμερα",el:"Σήμερα","he-IL":"היום",he:"היום","th-TH":"วันนี้",th:"วันนี้","vi-VN":"Hôm nay",vi:"Hôm nay","id-ID":"Hari ini",id:"Hari ini","ms-MY":"Hari ini",ms:"Hari ini","fa-IR":"امروز",fa:"امروز","ur-PK":"آج",ur:"آج","bn-BD":"আজ",bn:"আজ","ta-IN":"இன்று",ta:"இன்று","te-IN":"నేడు",te:"నేడు","ml-IN":"ഇന്ന്",ml:"ഇന്ന്","kn-IN":"ಇಂದು",kn:"ಇಂದು","gu-IN":"આજે",gu:"આજે","pa-IN":"ਅੱਜ",pa:"ਅੱਜ","or-IN":"ଆଜି",or:"ଆଜି","as-IN":"আজি",as:"আজি","ne-NP":"आज",ne:"आज","si-LK":"අද",si:"අද","my-MM":"ယနေ့",my:"ယနေ့","km-KH":"ថ្ងៃនេះ",km:"ថ្ងៃនេះ","lo-LA":"ມື້ນີ້",lo:"ມື້ນີ້","mn-MN":"Өнөөдөр",mn:"Өнөөдөр","ka-GE":"დღეს",ka:"დღეს","hy-AM":"Այսօր",hy:"Այսօր","az-AZ":"Bu gün",az:"Bu gün","kk-KZ":"Бүгін",kk:"Бүгін","ky-KG":"Бүгүн",ky:"Бүгүн","uz-UZ":"Bugun",uz:"Bugun","tg-TJ":"Имрӯз",tg:"Имрӯз","ps-AF":"نن",ps:"نن","ku-IQ":"ئەمڕۆ",ku:"ئەمڕۆ","yi-IL":"היינט",yi:"היינט","lb-LU":"Haut",lb:"Haut","is-IS":"Í dag",is:"Í dag","mt-MT":"Illum",mt:"Illum","cy-GB":"Heddiw",cy:"Heddiw","ga-IE":"Inniu",ga:"Inniu","gd-GB":"An-diugh",gd:"An-diugh","kw-GB":"Hedhyw",kw:"Hedhyw","br-FR":"Hiziv",br:"Hiziv","oc-FR":"Uèi",oc:"Uèi","ca-ES":"Avui",ca:"Avui","eu-ES":"Gaur",eu:"Gaur","gl-ES":"Hoxe",gl:"Hoxe","ast-ES":"Güei",ast:"Güei","an-ES":"Hue",an:"Hue","fur-IT":"Vuê",fur:"Vuê","lij-IT":"Ancheu",lij:"Ancheu","pms-IT":"Ancheuj",pms:"Ancheuj","rm-CH":"Oz",rm:"Oz","gsw-CH":"Hüt",gsw:"Hüt","wae-CH":"Hüt",wae:"Hüt","bar-AT":"Heit",bar:"Heit","ksh-DE":"Hück",ksh:"Hück","nds-DE":"Vundaag",nds:"Vundaag","pfl-DE":"Haid",pfl:"Haid","pdc-US":"Heit",pdc:"Heit","af-ZA":"Vandag",af:"Vandag","zu-ZA":"Namhlanje",zu:"Namhlanje","xh-ZA":"Namhlanje",xh:"Namhlanje","st-ZA":"Kajeno",st:"Kajeno","tn-ZA":"Kajeno",tn:"Kajeno","ve-ZA":"Leno",ve:"Leno","nso-ZA":"Kajeno",nso:"Kajeno","ts-ZA":"Namuntlha",ts:"Namuntlha","ss-ZA":"Lamuhla",ss:"Lamuhla","nr-ZA":"Namhlanje",nr:"Namhlanje","ff-SN":"Hannde",ff:"Hannde","wo-SN":"Tey",wo:"Tey","ig-NG":"Taa",ig:"Taa","yo-NG":"Lónìí",yo:"Lónìí","ha-NG":"Yau",ha:"Yau","sw-KE":"Leo",sw:"Leo","am-ET":"ዛሬ",am:"ዛሬ","ti-ER":"ሎሚ",ti:"ሎሚ","so-SO":"Maanta",so:"Maanta","om-ET":"Har'a",om:"Har'a"}},6370(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.templatesBasedOnUtility=void 0,t.templatesBasedOnUtility={default:(e=!1)=>`<div class="--single-month flex flex-col overflow-hidden">\n <div class="grid grid-cols-5 items-center gap-x-3 mx-1.5 pb-3" data-vc="header">\n <div class="col-span-1">\n <#CustomArrowPrev />\n </div>\n <div class="col-span-3 flex justify-center items-center gap-x-1">\n <#CustomMonth />\n <span class="text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}">/</span>\n <#CustomYear />\n </div>\n <div class="col-span-1 flex justify-end">\n <#CustomArrowNext />\n </div>\n </div>\n <div data-vc="wrapper">\n <div data-vc="content">\n <#Week />\n <#Dates />\n </div>\n </div>\n <#CustomToday />\n </div>`,multiple:(e=!1)=>`<div class="relative flex flex-col overflow-hidden">\n <div class="absolute top-2 inset-s-2">\n <#CustomArrowPrev />\n </div>\n <div class="absolute top-2 inset-e-2">\n <#CustomArrowNext />\n </div>\n <div class="sm:flex" data-vc="grid">\n <#Multiple>\n <div class="p-3 space-y-0.5 --single-month" data-vc="column">\n <div class="pb-3" data-vc="header">\n <div class="flex justify-center items-center gap-x-1" data-vc-header="content">\n <#CustomMonth />\n <span class="text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}">/</span>\n <#CustomYear />\n </div>\n </div>\n <div data-vc="wrapper">\n <div data-vc="content">\n <#Week />\n <#Dates />\n </div>\n </div>\n </div>\n <#/Multiple>\n </div>\n <#CustomToday />\n </div>`,year:(e=!1)=>`<div class="relative bg-white ${"light"!==e?"dark:bg-neutral-900":""}" data-vc="header" role="toolbar">\n <div class="grid grid-cols-5 items-center gap-x-3 mx-1.5 py-3" data-vc="header">\n <div class="col-span-1">\n <#CustomArrowPrev />\n </div>\n <div class="col-span-3 flex justify-center items-center gap-x-1">\n <#Month />\n <span class="text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}">/</span>\n <#Year />\n </div>\n <div class="col-span-1 flex justify-end">\n <#CustomArrowNext />\n </div>\n </div>\n </div>\n <div data-vc="wrapper">\n <div data-vc="content">\n <#Years />\n </div>\n </div>`,month:(e=!1)=>`<div class="py-3" data-vc="header" role="toolbar">\n <div class="flex justify-center items-center gap-x-1" data-vc-header="content">\n <#Month />\n <span class="text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}">/</span>\n <#Year />\n </div>\n </div>\n <div data-vc="wrapper">\n <div data-vc="content">\n <#Months />\n </div>\n </div>`,years:(e,t=!1)=>`<div class="relative">\n <span class="hidden" data-vc="year"></span>\n <select data-hs-select='{\n "placeholder": "Select year",\n "dropdownScope": "parent",\n "dropdownVerticalFixedPlacement": "bottom",\n "toggleTag": "<button type=\\"button\\"><span data-title></span></button>",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative flex text-nowrap w-full cursor-pointer text-start font-medium text-gray-800 hover:text-gray-600 focus:outline-hidden focus:text-gray-600 before:absolute before:inset-0 before:z-1 ${"light"!==t?"dark:text-neutral-200 dark:hover:text-neutral-300 dark:focus:text-neutral-300":""}",\n "dropdownClasses": "mt-2 z-50 w-20 max-h-60 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg shadow-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==t?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "p-2 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 ${"light"!==t?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span><span class=\\"hidden hs-selected:block\\"><svg class=\\"shrink-0 size-3.5 text-gray-800 ${"light"!==t?"dark:text-neutral-200":""}\\" xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"2\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"><polyline points=\\"20 6 9 17 4 12\\"/></svg></span></div>"\n }' class="hidden --year --prevent-on-load-init">\n ${e}\n </select>\n </div>`,months:(e=!1)=>`<div class="relative">\n <span class="hidden" data-vc="month"></span>\n <select data-hs-select='{\n "placeholder": "Select month",\n "dropdownScope": "parent",\n "dropdownVerticalFixedPlacement": "bottom",\n "toggleTag": "<button type=\\"button\\"><span data-title></span></button>",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative flex text-nowrap w-full cursor-pointer text-start font-medium text-gray-800 hover:text-gray-600 focus:outline-hidden focus:text-gray-600 before:absolute before:inset-0 before:z-1 ${"light"!==e?"dark:text-neutral-200 dark:hover:text-neutral-300 dark:focus:text-neutral-300":""}",\n "dropdownClasses": "mt-2 z-50 w-32 max-h-60 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg shadow-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==e?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "p-2 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg hs-select-disabled:opacity-50 hs-select-disabled:pointer-events-none focus:outline-hidden focus:bg-gray-100 ${"light"!==e?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span><span class=\\"hidden hs-selected:block\\"><svg class=\\"shrink-0 size-3.5 text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}\\" xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"2\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"><polyline points=\\"20 6 9 17 4 12\\"/></svg></span></div>"\n }' class="hidden --month --prevent-on-load-init">\n <option value="0">January</option>\n <option value="1">February</option>\n <option value="2">March</option>\n <option value="3">April</option>\n <option value="4">May</option>\n <option value="5">June</option>\n <option value="6">July</option>\n <option value="7">August</option>\n <option value="8">September</option>\n <option value="9">October</option>\n <option value="10">November</option>\n <option value="11">December</option>\n </select>\n </div>`,hours:(e=!1)=>`<div class="relative">\n <select class="--hours hidden" data-hs-select='{\n "placeholder": "Select option...",\n "dropdownVerticalFixedPlacement": "top",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative py-1 px-2 pe-6 flex text-nowrap w-full cursor-pointer bg-white border border-gray-200 rounded-lg text-start text-sm focus:border-blue-500 focus:ring-blue-500 before:absolute before:inset-0 before:z-1 ${"light"!==e?"dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400":""}",\n "dropdownClasses": "mt-2 z-50 w-full min-w-24 max-h-72 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==e?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "hs-selected:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-neutral-800":""} py-2 px-4 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-gray-700":""} ${"light"!==e?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span></div>"\n }'>\n <option value="01">01</option>\n <option value="02">02</option>\n <option value="03">03</option>\n <option value="04">04</option>\n <option value="05">05</option>\n <option value="06">06</option>\n <option value="07">07</option>\n <option value="08">08</option>\n <option value="09">09</option>\n <option value="10">10</option>\n <option value="11">11</option>\n <option value="12" selected>12</option>\n </select>\n <div class="absolute top-1/2 inset-e-2 -translate-y-1/2">\n <svg class="shrink-0 size-3 text-gray-500 ${"light"!==e?"dark:text-neutral-500":""}" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>\n </div>\n </div>`,minutes:(e=!1)=>`<div class="relative">\n <select class="--minutes hidden" data-hs-select='{\n "placeholder": "Select option...",\n "dropdownVerticalFixedPlacement": "top",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative py-1 px-2 pe-6 flex text-nowrap w-full cursor-pointer bg-white border border-gray-200 rounded-lg text-start text-sm focus:border-blue-500 focus:ring-blue-500 before:absolute before:inset-0 before:z-1 ${"light"!==e?"dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400":""}",\n "dropdownClasses": "mt-2 z-50 w-full min-w-24 max-h-72 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==e?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "hs-selected:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-neutral-800":""} py-2 px-4 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-gray-700":""} ${"light"!==e?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span></div>"\n }'>\n <option value="00" selected>00</option>\n <option value="01">01</option>\n <option value="02">02</option>\n <option value="03">03</option>\n <option value="04">04</option>\n <option value="05">05</option>\n <option value="06">06</option>\n <option value="07">07</option>\n <option value="08">08</option>\n <option value="09">09</option>\n <option value="10">10</option>\n <option value="11">11</option>\n <option value="12">12</option>\n <option value="13">13</option>\n <option value="14">14</option>\n <option value="15">15</option>\n <option value="16">16</option>\n <option value="17">17</option>\n <option value="18">18</option>\n <option value="19">19</option>\n <option value="20">20</option>\n <option value="21">21</option>\n <option value="22">22</option>\n <option value="23">23</option>\n <option value="24">24</option>\n <option value="25">25</option>\n <option value="26">26</option>\n <option value="27">27</option>\n <option value="28">28</option>\n <option value="29">29</option>\n <option value="30">30</option>\n <option value="31">31</option>\n <option value="32">32</option>\n <option value="33">33</option>\n <option value="34">34</option>\n <option value="35">35</option>\n <option value="36">36</option>\n <option value="37">37</option>\n <option value="38">38</option>\n <option value="39">39</option>\n <option value="40">40</option>\n <option value="41">41</option>\n <option value="42">42</option>\n <option value="43">43</option>\n <option value="44">44</option>\n <option value="45">45</option>\n <option value="46">46</option>\n <option value="47">47</option>\n <option value="48">48</option>\n <option value="49">49</option>\n <option value="50">50</option>\n <option value="51">51</option>\n <option value="52">52</option>\n <option value="53">53</option>\n <option value="54">54</option>\n <option value="55">55</option>\n <option value="56">56</option>\n <option value="57">57</option>\n <option value="58">58</option>\n <option value="59">59</option>\n </select>\n <div class="absolute top-1/2 inset-e-2 -translate-y-1/2">\n <svg class="shrink-0 size-3 text-gray-500 ${"light"!==e?"dark:text-neutral-500":""}" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>\n </div>\n </div>`,meridiem:(e=!1)=>`<div class="relative">\n <select class="--meridiem hidden" data-hs-select='{\n "placeholder": "Select option...",\n "dropdownVerticalFixedPlacement": "top",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative py-1 px-2 pe-6 flex text-nowrap w-full cursor-pointer bg-white border border-gray-200 rounded-lg text-start text-sm focus:border-blue-500 focus:ring-blue-500 before:absolute before:inset-0 before:z-1 ${"light"!==e?"dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400":""}",\n "dropdownClasses": "mt-2 z-50 w-full min-w-24 max-h-72 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==e?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "hs-selected:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-neutral-800":""} py-2 px-4 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-gray-700":""} ${"light"!==e?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span></div>"\n }'>\n <option value="PM" selected>PM</option>\n <option value="AM">AM</option>\n </select>\n <div class="absolute top-1/2 inset-e-2 -translate-y-1/2">\n <svg class="shrink-0 size-3 text-gray-500 ${"light"!==e?"dark:text-neutral-500":""}" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>\n </div>\n </div>`}},3191(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.templates=void 0,t.templates={default:(e=!1)=>`<div class="--single-month flex flex-col overflow-hidden">\n <div class="grid grid-cols-5 items-center gap-x-3 mx-1.5 pb-3" data-vc="header">\n <div class="col-span-1">\n <#CustomArrowPrev />\n </div>\n <div class="col-span-3 flex justify-center items-center gap-x-1">\n <#CustomMonth />\n <span class="text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}">/</span>\n <#CustomYear />\n </div>\n <div class="col-span-1 flex justify-end">\n <#CustomArrowNext />\n </div>\n </div>\n <div data-vc="wrapper">\n <div data-vc="content">\n <#Week />\n <#Dates />\n </div>\n </div>\n <#CustomToday />\n </div>`,multiple:(e=!1)=>`<div class="relative flex flex-col overflow-hidden">\n <div class="absolute top-2 inset-s-2">\n <#CustomArrowPrev />\n </div>\n <div class="absolute top-2 inset-e-2">\n <#CustomArrowNext />\n </div>\n <div class="sm:flex" data-vc="grid">\n <#Multiple>\n <div class="p-3 space-y-0.5 --single-month" data-vc="column">\n <div class="pb-3" data-vc="header">\n <div class="flex justify-center items-center gap-x-1" data-vc-header="content">\n <#CustomMonth />\n <span class="text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}">/</span>\n <#CustomYear />\n </div>\n </div>\n <div data-vc="wrapper">\n <div data-vc="content">\n <#Week />\n <#Dates />\n </div>\n </div>\n </div>\n <#/Multiple>\n </div>\n <#CustomToday />\n </div>`,year:(e=!1)=>`<div class="relative bg-white ${"light"!==e?"dark:bg-neutral-900":""}" data-vc="header" role="toolbar">\n <div class="grid grid-cols-5 items-center gap-x-3 mx-1.5 py-3" data-vc="header">\n <div class="col-span-1">\n <#CustomArrowPrev />\n </div>\n <div class="col-span-3 flex justify-center items-center gap-x-1">\n <#Month />\n <span class="text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}">/</span>\n <#Year />\n </div>\n <div class="col-span-1 flex justify-end">\n <#CustomArrowNext />\n </div>\n </div>\n </div>\n <div data-vc="wrapper">\n <div data-vc="content">\n <#Years />\n </div>\n </div>`,month:(e=!1)=>`<div class="py-3" data-vc="header" role="toolbar">\n <div class="flex justify-center items-center gap-x-1" data-vc-header="content">\n <#Month />\n <span class="text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}">/</span>\n <#Year />\n </div>\n </div>\n <div data-vc="wrapper">\n <div data-vc="content">\n <#Months />\n </div>\n </div>`,years:(e,t=!1)=>`<div class="relative">\n <span class="hidden" data-vc="year"></span>\n <select data-hs-select='{\n "placeholder": "Select year",\n "dropdownScope": "parent",\n "dropdownVerticalFixedPlacement": "bottom",\n "toggleTag": "<button type=\\"button\\"><span data-title></span></button>",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative flex text-nowrap w-full cursor-pointer text-start font-medium text-gray-800 hover:text-gray-600 focus:outline-hidden focus:text-gray-600 before:absolute before:inset-0 before:z-1 ${"light"!==t?"dark:text-neutral-200 dark:hover:text-neutral-300 dark:focus:text-neutral-300":""}",\n "dropdownClasses": "mt-2 z-50 w-20 max-h-60 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg shadow-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==t?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "p-2 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 ${"light"!==t?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span><span class=\\"hidden hs-selected:block\\"><svg class=\\"shrink-0 size-3.5 text-gray-800 ${"light"!==t?"dark:text-neutral-200":""}\\" xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"2\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"><polyline points=\\"20 6 9 17 4 12\\"/></svg></span></div>"\n }' class="hidden --year --prevent-on-load-init">\n ${e}\n </select>\n </div>`,months:(e=!1)=>`<div class="relative">\n <span class="hidden" data-vc="month"></span>\n <select data-hs-select='{\n "placeholder": "Select month",\n "dropdownScope": "parent",\n "dropdownVerticalFixedPlacement": "bottom",\n "toggleTag": "<button type=\\"button\\"><span data-title></span></button>",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative flex text-nowrap w-full cursor-pointer text-start font-medium text-gray-800 hover:text-gray-600 focus:outline-hidden focus:text-gray-600 before:absolute before:inset-0 before:z-1 ${"light"!==e?"dark:text-neutral-200 dark:hover:text-neutral-300 dark:focus:text-neutral-300":""}",\n "dropdownClasses": "mt-2 z-50 w-32 max-h-60 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg shadow-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==e?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "p-2 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg hs-select-disabled:opacity-50 hs-select-disabled:pointer-events-none focus:outline-hidden focus:bg-gray-100 ${"light"!==e?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span><span class=\\"hidden hs-selected:block\\"><svg class=\\"shrink-0 size-3.5 text-gray-800 ${"light"!==e?"dark:text-neutral-200":""}\\" xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"2\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"><polyline points=\\"20 6 9 17 4 12\\"/></svg></span></div>"\n }' class="hidden --month --prevent-on-load-init">\n <option value="0">January</option>\n <option value="1">February</option>\n <option value="2">March</option>\n <option value="3">April</option>\n <option value="4">May</option>\n <option value="5">June</option>\n <option value="6">July</option>\n <option value="7">August</option>\n <option value="8">September</option>\n <option value="9">October</option>\n <option value="10">November</option>\n <option value="11">December</option>\n </select>\n </div>`,hours:(e=!1)=>`<div class="relative">\n <select class="--hours hidden" data-hs-select='{\n "placeholder": "Select option...",\n "dropdownVerticalFixedPlacement": "top",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative py-1 px-2 pe-6 flex text-nowrap w-full cursor-pointer bg-white border border-gray-200 rounded-lg text-start text-sm focus:border-blue-500 focus:ring-blue-500 before:absolute before:inset-0 before:z-1 ${"light"!==e?"dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400":""}",\n "dropdownClasses": "mt-2 z-50 w-full min-w-24 max-h-72 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==e?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "hs-selected:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-neutral-800":""} py-2 px-4 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-gray-700":""} ${"light"!==e?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span></div>"\n }'>\n <option value="01">01</option>\n <option value="02">02</option>\n <option value="03">03</option>\n <option value="04">04</option>\n <option value="05">05</option>\n <option value="06">06</option>\n <option value="07">07</option>\n <option value="08">08</option>\n <option value="09">09</option>\n <option value="10">10</option>\n <option value="11">11</option>\n <option value="12" selected>12</option>\n </select>\n <div class="absolute top-1/2 inset-e-2 -translate-y-1/2">\n <svg class="shrink-0 size-3 text-gray-500 ${"light"!==e?"dark:text-neutral-500":""}" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>\n </div>\n </div>`,minutes:(e=!1)=>`<div class="relative">\n <select class="--minutes hidden" data-hs-select='{\n "placeholder": "Select option...",\n "dropdownVerticalFixedPlacement": "top",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative py-1 px-2 pe-6 flex text-nowrap w-full cursor-pointer bg-white border border-gray-200 rounded-lg text-start text-sm focus:border-blue-500 focus:ring-blue-500 before:absolute before:inset-0 before:z-1 ${"light"!==e?"dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400":""}",\n "dropdownClasses": "mt-2 z-50 w-full min-w-24 max-h-72 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==e?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "hs-selected:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-neutral-800":""} py-2 px-4 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-gray-700":""} ${"light"!==e?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span></div>"\n }'>\n <option value="00" selected>00</option>\n <option value="01">01</option>\n <option value="02">02</option>\n <option value="03">03</option>\n <option value="04">04</option>\n <option value="05">05</option>\n <option value="06">06</option>\n <option value="07">07</option>\n <option value="08">08</option>\n <option value="09">09</option>\n <option value="10">10</option>\n <option value="11">11</option>\n <option value="12">12</option>\n <option value="13">13</option>\n <option value="14">14</option>\n <option value="15">15</option>\n <option value="16">16</option>\n <option value="17">17</option>\n <option value="18">18</option>\n <option value="19">19</option>\n <option value="20">20</option>\n <option value="21">21</option>\n <option value="22">22</option>\n <option value="23">23</option>\n <option value="24">24</option>\n <option value="25">25</option>\n <option value="26">26</option>\n <option value="27">27</option>\n <option value="28">28</option>\n <option value="29">29</option>\n <option value="30">30</option>\n <option value="31">31</option>\n <option value="32">32</option>\n <option value="33">33</option>\n <option value="34">34</option>\n <option value="35">35</option>\n <option value="36">36</option>\n <option value="37">37</option>\n <option value="38">38</option>\n <option value="39">39</option>\n <option value="40">40</option>\n <option value="41">41</option>\n <option value="42">42</option>\n <option value="43">43</option>\n <option value="44">44</option>\n <option value="45">45</option>\n <option value="46">46</option>\n <option value="47">47</option>\n <option value="48">48</option>\n <option value="49">49</option>\n <option value="50">50</option>\n <option value="51">51</option>\n <option value="52">52</option>\n <option value="53">53</option>\n <option value="54">54</option>\n <option value="55">55</option>\n <option value="56">56</option>\n <option value="57">57</option>\n <option value="58">58</option>\n <option value="59">59</option>\n </select>\n <div class="absolute top-1/2 inset-e-2 -translate-y-1/2">\n <svg class="shrink-0 size-3 text-gray-500 ${"light"!==e?"dark:text-neutral-500":""}" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>\n </div>\n </div>`,meridiem:(e=!1)=>`<div class="relative">\n <select class="--meridiem hidden" data-hs-select='{\n "placeholder": "Select option...",\n "dropdownVerticalFixedPlacement": "top",\n "toggleClasses": "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative py-1 px-2 pe-6 flex text-nowrap w-full cursor-pointer bg-white border border-gray-200 rounded-lg text-start text-sm focus:border-blue-500 focus:ring-blue-500 before:absolute before:inset-0 before:z-1 ${"light"!==e?"dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400":""}",\n "dropdownClasses": "mt-2 z-50 w-full min-w-24 max-h-72 p-1 space-y-0.5 bg-white border border-gray-200 rounded-lg overflow-hidden overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 ${"light"!==e?"dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900 dark:border-neutral-700":""}",\n "optionClasses": "hs-selected:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-neutral-800":""} py-2 px-4 w-full text-sm text-gray-800 cursor-pointer hover:bg-gray-100 rounded-lg focus:outline-hidden focus:bg-gray-100 ${"light"!==e?"dark:hs-selected:bg-gray-700":""} ${"light"!==e?"dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800":""}",\n "optionTemplate": "<div class=\\"flex justify-between items-center w-full\\"><span data-title></span></div>"\n }'>\n <option value="PM" selected>PM</option>\n <option value="AM">AM</option>\n </select>\n <div class="absolute top-1/2 inset-e-2 -translate-y-1/2">\n <svg class="shrink-0 size-3 text-gray-500 ${"light"!==e?"dark:text-neutral-500":""}" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>\n </div>\n </div>`}},632(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(9359),s=[n.months,n.time,n.motion,n.annotations,n.weeks];class o extends n.Calendar{constructor(e,t){super(e,Object.assign(Object.assign({},t),{extensions:s}));const i=this.set;this.set=(e,t)=>{i&&i.call(this,e,t),e.selectedTime&&this.onChangeTime&&this.onChangeTime(this,null,!0),e.selectedMonth&&this.onClickMonth&&this.onClickMonth(this,null),e.selectedYear&&this.onClickYear&&this.onClickYear(this,null)}}static get defaultStyles(){return{calendar:"vc",controls:"vc-controls",grid:"vc-grid",column:"vc-column",header:"vc-header",headerContent:"vc-header__content",month:"vc-month",year:"vc-year",arrowPrev:"vc-arrow vc-arrow_prev",arrowNext:"vc-arrow vc-arrow_next",wrapper:"vc-wrapper",content:"vc-content",months:"vc-months",monthsMonth:"vc-months__month",years:"vc-years",yearsYear:"vc-years__year",week:"vc-week",weekDay:"vc-week__day",weekNumbers:"vc-week-numbers",weekNumbersTitle:"vc-week-numbers__title",weekNumbersContent:"vc-week-numbers__content",weekNumber:"vc-week-number",dates:"vc-dates",date:"vc-date",dateBtn:"vc-date__btn",datePopup:"vc-date__popup",dateRangeTooltip:"vc-date-range-tooltip",time:"vc-time",timeContent:"vc-time__content",timeHour:"vc-time__hour",timeMinute:"vc-time__minute",timeKeeping:"vc-time__keeping",timeRanges:"vc-time__ranges",timeRange:"vc-time__range"}}logInfo(){console.log("This log is from CustomVanillaCalendar!",this)}}t.default=o},9608(e,t,i){"use strict";
|
|
64
64
|
/*
|
|
65
65
|
* HSDropdown
|
|
66
|
-
* @version: 5.
|
|
66
|
+
* @version: 5.1.0
|
|
67
67
|
* @author: Preline Labs Ltd.
|
|
68
68
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
69
69
|
* Copyright 2024 Preline Labs Ltd.
|
|
70
|
-
*/var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(292),o=i(949),l=s(i(2961)),r=s(i(248)),a=i(8223);class c extends l.default{constructor(e,t,i){super(e,t,i),this.longPressTimer=null,this.openedViaKeyboard=!1,this.onTouchStartListener=null,this.onTouchEndListener=null,this.toggle=this.el.querySelector(":scope > .hs-dropdown-toggle")||this.el.querySelector(":scope > .hs-dropdown-toggle-wrapper > .hs-dropdown-toggle")||this.el.children[0],this.closers=Array.from(this.el.querySelectorAll(":scope .hs-dropdown-close"))||null,this.menu=this.el.querySelector(":scope > .hs-dropdown-menu"),this.eventMode=this.getEventMode(),this.closeMode=(0,n.getClassProperty)(this.el,"--auto-close","true"),this.hasAutofocus=(0,n.stringToBoolean)((0,n.getClassProperty)(this.el,"--has-autofocus","true")||"true"),this.autofocusOnKeyboardOnly=(0,n.stringToBoolean)((0,n.getClassProperty)(this.el,"--autofocus-on-keyboard-only","true")||"true"),this.animationInProcess=!1,this.onCloserClickListener=[],this.toggle&&this.menu&&this.init()}getEventMode(){var e;const t=null===(e=this.el.parentElement)||void 0===e?void 0:e.closest(".hs-dropdown");if(!t)return(0,n.getClassProperty)(this.el,"--trigger","click");t.style.setProperty("--trigger","hs-init");const i=(0,n.getClassProperty)(this.el,"--trigger","");return t.style.removeProperty("--trigger"),i&&"hs-init"!==i?i:"click"}elementMouseEnter(){this.onMouseEnterHandler()}elementMouseLeave(){this.onMouseLeaveHandler()}toggleClick(e){this.onClickHandler(e)}toggleContextMenu(e){e.preventDefault(),this.onContextMenuHandler(e)}handleTouchStart(e){var t,i;e.preventDefault();const s=e.touches[0],n=null!==(t=null==s?void 0:s.clientX)&&void 0!==t?t:0,o=null!==(i=null==s?void 0:s.clientY)&&void 0!==i?i:0;this.longPressTimer=window.setTimeout(()=>{const e=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,view:window,clientX:n,clientY:o});this.toggle&&this.toggle.dispatchEvent(e)},400)}handleTouchEnd(e){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)}closerClick(){this.close()}init(){if(c.ensureGlobalHandlers(),this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle&&this.buildToggle(),this.menu&&this.buildMenu(),this.closers&&this.buildClosers(),(0,n.isIOS)()||(0,n.isIpadOS)()||(this.onElementMouseEnterListener=()=>this.elementMouseEnter(),this.onElementMouseLeaveListener=()=>this.elementMouseLeave(),this.el.addEventListener("mouseenter",this.onElementMouseEnterListener),this.el.addEventListener("mouseleave",this.onElementMouseLeaveListener)),"undefined"!=typeof window&&(window.HSAccessibilityObserver||(window.HSAccessibilityObserver=new r.default),this.setupAccessibility())}resizeHandler(){this.eventMode=this.getEventMode(),this.closeMode=(0,n.getClassProperty)(this.el,"--auto-close","true"),this.hasAutofocus=(0,n.stringToBoolean)((0,n.getClassProperty)(this.el,"--has-autofocus","true")||"true"),this.autofocusOnKeyboardOnly=(0,n.stringToBoolean)((0,n.getClassProperty)(this.el,"--autofocus-on-keyboard-only","true")||"true")}isOpen(){return this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")}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.onTouchStartListener=this.handleTouchStart.bind(this),this.onTouchEndListener=this.handleTouchEnd.bind(this),this.toggle.addEventListener("contextmenu",this.onToggleContextMenuListener),this.toggle.addEventListener("touchstart",this.onTouchStartListener,{passive:!1}),this.toggle.addEventListener("touchend",this.onTouchEndListener),this.toggle.addEventListener("touchmove",this.onTouchEndListener)):(this.onToggleClickListener=e=>this.toggleClick(e),this.toggle.addEventListener("click",this.onToggleClickListener))}buildMenu(){this.menu.role=this.menu.getAttribute("role")||"menu",this.menu.tabIndex=-1;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))),this.menu.addEventListener("click",e=>{const t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||"SELECT"===t.tagName||"BUTTON"===t.tagName||"A"===t.tagName||t.closest("button")||t.closest("a")||t.closest("input")||t.closest("textarea")||t.closest("select")||this.menu.focus()})}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))};c.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){var t;if("hover"===this.eventMode&&window.matchMedia("(hover: hover)").matches&&"mouse"===e.pointerType){const i=e.currentTarget;return"A"===i.tagName&&i.hasAttribute("href")&&"#"!==i.getAttribute("href")||(e.preventDefault(),e.stopPropagation(),null===(t=e.stopImmediatePropagation)||void 0===t||t.call(e)),!1}this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?this.close():this.open()}onMouseEnterHandler(){if("hover"!==this.eventMode)return!1;(!this.el._floatingUI||this.el._floatingUI&&!this.el.classList.contains("open"))&&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()}getNextFocusableElement(e){const t=Array.from(document.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}destroyFloatingUI(){const e=(window.getComputedStyle(this.el).getPropertyValue("--scope")||"").trim();this.menu.classList.remove("block"),this.menu.classList.add("hidden"),this.menu.style.inset=null,this.menu.style.position=null,this.el&&this.el._floatingUI&&(this.el._floatingUI.destroy(),this.el._floatingUI=null),"window"===e&&this.el.appendChild(this.menu),this.animationInProcess=!1}focusElement(){const e=this.menu.querySelector("[autofocus]");if(e)return e.focus(),!0;const t=this.menu.querySelectorAll('[role="menuitem"]:not([hidden])');if(t.length>0){return t[0].focus(),!0}return!1}setupFloatingUI(e){const t=e||this.el,i=window.getComputedStyle(this.el),s=(i.getPropertyValue("--placement")||"").trim(),n=(i.getPropertyValue("--flip")||"true").trim(),l=(i.getPropertyValue("--strategy")||"fixed").trim(),r=(i.getPropertyValue("--offset")||"10").trim(),c=(i.getPropertyValue("--gpu-acceleration")||"true").trim(),d=(window.getComputedStyle(this.el).getPropertyValue("--adaptive")||"adaptive").replace(" ",""),h=l,u=parseInt(r,10),p=a.POSITIONS[s]||"bottom-start",m=[..."true"===n?[(0,o.flip)()]:[],(0,o.offset)(u)],g={placement:p,strategy:h,middleware:m};"fixed"===h&&Object.assign(this.menu.style,{position:h});const v=e=>{const t=this.menu.getBoundingClientRect(),i=window.innerWidth-(window.innerWidth-document.documentElement.clientWidth);return e+t.width>i&&(e=i-t.width),e<0&&(e=0),e},f=()=>{(0,o.computePosition)(t,this.menu,g).then(({x:e,y:t,placement:i})=>{const s=v(e);"absolute"===h&&"none"===d?Object.assign(this.menu.style,{position:h,margin:"0"}):"absolute"===h?Object.assign(this.menu.style,{position:h,transform:`translate3d(${e}px, ${t}px, 0px)`,margin:"0"}):"true"===c?Object.assign(this.menu.style,{position:h,left:"",top:"",inset:"0px auto auto 0px",margin:"0",transform:`translate3d(${"adaptive"===d?s:0}px, ${t}px, 0)`}):Object.assign(this.menu.style,{position:h,left:`${e}px`,top:`${t}px`,transform:""}),this.menu.setAttribute("data-placement",i)})};f();return{update:f,destroy:(0,o.autoUpdate)(t,this.menu,f)}}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.setupFloatingUI(e),i=this.menu.getAttribute("data-placement");return t.update(),t.destroy(),i}open(e,t=!1){if(this.el.classList.contains("open")||this.animationInProcess)return!1;this.openedViaKeyboard=t,this.animationInProcess=!0,this.menu.style.cssText="";const i=e||this.el,s=window.getComputedStyle(this.el),o=(s.getPropertyValue("--scope")||"").trim(),l=(s.getPropertyValue("--strategy")||"fixed").trim();"window"===o&&document.body.appendChild(this.menu),"static"!==l&&(this.el._floatingUI=this.setupFloatingUI(i)),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.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!0),"window"===o&&this.menu.classList.add("open"),this.animationInProcess=!1,!this.hasAutofocus||this.autofocusOnKeyboardOnly&&!this.openedViaKeyboard||this.focusElement(),this.fireEvent("open",this.el),(0,n.dispatch)("open.hs.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")||"").trim();if(this.animationInProcess=!0,"window"===t&&this.menu.classList.remove("open"),window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!1),e){const e=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;let t=!1;const i=()=>{t||(t=!0,this.destroyFloatingUI())};(0,n.afterTransition)(e,i);const s=window.getComputedStyle(e).getPropertyValue("transition-duration"),o=1e3*parseFloat(s)||150;setTimeout(i,o+50)}else this.destroyFloatingUI();(()=>{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.openedViaKeyboard=!1,this.fireEvent("close",this.el),(0,n.dispatch)("close.hs.dropdown",this.el,this.el)})()}forceClearState(){this.destroyFloatingUI(),this.menu.style.margin=null,this.el.classList.remove("open"),this.menu.classList.add("hidden"),this.openedViaKeyboard=!1}destroy(){(0,n.isIOS)()||(0,n.isIpadOS)()||(this.el.removeEventListener("mouseenter",this.onElementMouseEnterListener),this.el.removeEventListener("mouseleave",()=>this.onElementMouseLeaveListener),this.onElementMouseEnterListener=null,this.onElementMouseLeaveListener=null),"contextmenu"===this.eventMode?(this.toggle&&(this.toggle.removeEventListener("contextmenu",this.onToggleContextMenuListener),this.toggle.removeEventListener("touchstart",this.onTouchStartListener),this.toggle.removeEventListener("touchend",this.onTouchEndListener),this.toggle.removeEventListener("touchmove",this.onTouchEndListener)),this.onToggleContextMenuListener=null,this.onTouchStartListener=null,this.onTouchEndListener=null):(this.toggle&&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.destroyFloatingUI(),window.$hsDropdownCollection=window.$hsDropdownCollection.filter(({element:e})=>e.el!==this.el)}static findInCollection(e){return window.$hsDropdownCollection.find(t=>e instanceof c?t.element.el===e.el:"string"==typeof e?t.element.el===document.querySelector(e):t.element.el===e)||null}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:null}static autoInit(){c.ensureGlobalHandlers(),window.$hsDropdownCollection&&(window.$hsDropdownCollection=window.$hsDropdownCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll(".hs-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 c(e)})}static ensureGlobalHandlers(){if("undefined"==typeof window)return;if(window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),c.globalListenersInitialized)return;c.globalListenersInitialized=!0,window.addEventListener("click",e=>{const t=e.target;c.closeCurrentlyOpened(t)}),document.addEventListener("touchstart",e=>{const t=e.target;t.closest(".hs-dropdown")||c.closeCurrentlyOpened(t)},{passive:!0});let e=window.innerWidth;window.addEventListener("resize",()=>{window.innerWidth!==e&&(e=innerWidth,c.closeCurrentlyOpened(null,!1))})}static open(e,t=!1){const i=c.findInCollection(e);i&&i.element.menu.classList.contains("hidden")&&i.element.open(void 0,t)}static close(e){const t=c.findInCollection(e);t&&!t.element.menu.classList.contains("hidden")&&t.element.close()}static closeCurrentlyOpened(e=null,t=!0){const i=e&&e.closest(".hs-dropdown")&&e.closest(".hs-dropdown").parentElement.closest(".hs-dropdown")?e.closest(".hs-dropdown").parentElement.closest(".hs-dropdown"):null;let s=i?window.$hsDropdownCollection.filter(e=>e.element.el.classList.contains("open")&&e.element.menu.closest(".hs-dropdown").parentElement.closest(".hs-dropdown")===i):window.$hsDropdownCollection.filter(e=>e.element.el.classList.contains("open"));if(e){const t=e.closest(".hs-dropdown");if(t)"inside"===(0,n.getClassPropertyAlt)(t,"--auto-close")&&(s=s.filter(e=>e.element.el!==t));else{const t=e.closest(".hs-dropdown-menu");if(t){const e=window.$hsDropdownCollection.find(e=>e.element.menu===t);e&&"inside"===(0,n.getClassPropertyAlt)(e.element.el,"--auto-close")&&(s=s.filter(t=>t.element.el!==e.element.el))}}}s&&s.forEach(e=>{if("false"===e.element.closeMode||"outside"===e.element.closeMode)return!1;e.element.close(t)}),s&&s.forEach(e=>{if("contextmenu"!==(0,n.getClassPropertyAlt)(e.element.el,"--trigger"))return!1;document.body.style.overflow="",document.body.style.paddingRight=""})}setupAccessibility(){this.accessibilityComponent=window.HSAccessibilityObserver.registerComponent(this.el,{onEnter:()=>{var e;const t=document.activeElement;if(!t)return;if(t.closest(".hs-dropdown-menu")){const i=t.closest(".hs-dropdown-toggle, [data-hs-dropdown-toggle]");if(i)return void i.click();const s=t.closest('[role="menuitem"], a, button, [data-hs-dropdown-item]');if((null===(e=null==s?void 0:s.children)||void 0===e?void 0:e.length)>0)return Array.from(s.children).forEach(e=>{e.matches("input[type='checkbox']:not([hidden]), input[type='radio']:not([hidden])")&&e.click()}),void s.focus();if(s){if(t.matches("input, textarea, select"))return;s.click()}return}this.isOpened()?this.close():this.open(void 0,!0)},onSpace:()=>{this.isOpened()||this.open(void 0,!0)},onEsc:()=>{this.isOpened()&&(this.close(),this.toggle&&this.toggle.focus())},onArrow:e=>{if(!e.metaKey)switch(e.key){case"ArrowDown":this.isOpened()?this.focusMenuItem("next"):this.open(void 0,!0);break;case"ArrowUp":this.isOpened()&&this.focusMenuItem("prev");break;case"ArrowRight":this.onArrowX(e,"right");break;case"ArrowLeft":this.onArrowX(e,"left")}},onHome:()=>{this.isOpened()&&this.onStartEnd(!0)},onEnd:()=>{this.isOpened()&&this.onStartEnd(!1)},onTab:()=>this.onTabOut(),onShiftTab:()=>this.onTabOut(),onFirstLetter:e=>{const t=document.activeElement;!(null==t?void 0:t.matches("input, textarea"))&&this.isOpened()&&this.onFirstLetter(e)}},this.isOpened(),"Dropdown",".hs-dropdown",this.menu,{onFirstLetter:!1})}onTabOut(){setTimeout(()=>{const e=document.activeElement,t=e.closest(".hs-dropdown-menu");if(e&&t){const t=e.closest(".hs-dropdown-toggle, [data-hs-dropdown-toggle]");return t?void t.click():void e.focus()}this.isOpened()&&this.close()},100)}onFirstLetter(e){var t;if(!this.isOpened()||!this.menu)return;const i=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden])');if(0===i.length)return;const s=Array.from(i).indexOf(document.activeElement);for(let n=1;n<=i.length;n++){const o=(s+n)%i.length;if(((null===(t=i[o].textContent)||void 0===t?void 0:t.trim().toLowerCase())||"").startsWith(e.toLowerCase()))return void i[o].focus()}i[0].focus()}onArrowX(e,t){if(!this.isOpened())return;e.preventDefault(),e.stopImmediatePropagation();const i=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden])');if(!i.length)return;const s=Array.from(i).indexOf(document.activeElement);let n=-1;n="right"===t?(s+1)%i.length:s>0?s-1:i.length-1,i[n].focus()}onStartEnd(e=!0){if(!this.isOpened())return;const t=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden])');if(!t.length)return;t[e?0:t.length-1].focus()}focusMenuItem(e){const t=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden])');if(!t.length)return;const i=Array.from(t).indexOf(document.activeElement);t["next"===e?(i+1)%t.length:(i-1+t.length)%t.length].focus()}static on(e,t,i){const s=c.findInCollection(t);s&&(s.element.events[e]=i)}isOpened(){return this.isOpen()}containsElement(e){return this.el.contains(e)}}c.globalListenersInitialized=!1,t.default=c},9247(e,t,i){"use strict";
|
|
70
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=i(949),l=n(i(2961)),r=n(i(248)),a=i(8223);class d extends l.default{constructor(e,t,i){super(e,t,i),this.longPressTimer=null,this.openedViaKeyboard=!1,this.onTouchStartListener=null,this.onTouchEndListener=null,this.toggle=this.el.querySelector(":scope > .hs-dropdown-toggle")||this.el.querySelector(":scope > .hs-dropdown-toggle-wrapper > .hs-dropdown-toggle")||this.el.children[0],this.closers=Array.from(this.el.querySelectorAll(":scope .hs-dropdown-close"))||null,this.menu=this.el.querySelector(":scope > .hs-dropdown-menu"),this.eventMode=this.getEventMode(),this.closeMode=(0,s.getClassProperty)(this.el,"--auto-close","true"),this.hasAutofocus=(0,s.stringToBoolean)((0,s.getClassProperty)(this.el,"--has-autofocus","true")||"true"),this.autofocusOnKeyboardOnly=(0,s.stringToBoolean)((0,s.getClassProperty)(this.el,"--autofocus-on-keyboard-only","true")||"true"),this.animationInProcess=!1,this.onCloserClickListener=[],this.toggle&&this.menu&&this.init()}getEventMode(){var e;const t=null===(e=this.el.parentElement)||void 0===e?void 0:e.closest(".hs-dropdown");if(!t)return(0,s.getClassProperty)(this.el,"--trigger","click");t.style.setProperty("--trigger","hs-init");const i=(0,s.getClassProperty)(this.el,"--trigger","");return t.style.removeProperty("--trigger"),i&&"hs-init"!==i?i:"click"}elementMouseEnter(){this.onMouseEnterHandler()}elementMouseLeave(){this.onMouseLeaveHandler()}toggleClick(e){this.onClickHandler(e)}toggleContextMenu(e){e.preventDefault(),this.onContextMenuHandler(e)}handleTouchStart(e){var t,i;e.preventDefault();const n=e.touches[0],s=null!==(t=null==n?void 0:n.clientX)&&void 0!==t?t:0,o=null!==(i=null==n?void 0:n.clientY)&&void 0!==i?i:0;this.longPressTimer=window.setTimeout(()=>{const e=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,view:window,clientX:s,clientY:o});this.toggle&&this.toggle.dispatchEvent(e)},400)}handleTouchEnd(e){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)}closerClick(){this.close()}init(){if(d.ensureGlobalHandlers(),this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle&&this.buildToggle(),this.menu&&this.buildMenu(),this.closers&&this.buildClosers(),(0,s.isIOS)()||(0,s.isIpadOS)()||(this.onElementMouseEnterListener=()=>this.elementMouseEnter(),this.onElementMouseLeaveListener=()=>this.elementMouseLeave(),this.el.addEventListener("mouseenter",this.onElementMouseEnterListener),this.el.addEventListener("mouseleave",this.onElementMouseLeaveListener)),"undefined"!=typeof window&&(window.HSAccessibilityObserver||(window.HSAccessibilityObserver=new r.default),this.setupAccessibility())}resizeHandler(){this.eventMode=this.getEventMode(),this.closeMode=(0,s.getClassProperty)(this.el,"--auto-close","true"),this.hasAutofocus=(0,s.stringToBoolean)((0,s.getClassProperty)(this.el,"--has-autofocus","true")||"true"),this.autofocusOnKeyboardOnly=(0,s.stringToBoolean)((0,s.getClassProperty)(this.el,"--autofocus-on-keyboard-only","true")||"true")}isOpen(){return this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")}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.onTouchStartListener=this.handleTouchStart.bind(this),this.onTouchEndListener=this.handleTouchEnd.bind(this),this.toggle.addEventListener("contextmenu",this.onToggleContextMenuListener),this.toggle.addEventListener("touchstart",this.onTouchStartListener,{passive:!1}),this.toggle.addEventListener("touchend",this.onTouchEndListener),this.toggle.addEventListener("touchmove",this.onTouchEndListener)):(this.onToggleClickListener=e=>this.toggleClick(e),this.toggle.addEventListener("click",this.onToggleClickListener))}buildMenu(){this.menu.role=this.menu.getAttribute("role")||"menu",this.menu.tabIndex=-1;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))),this.menu.addEventListener("click",e=>{const t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||"SELECT"===t.tagName||"BUTTON"===t.tagName||"A"===t.tagName||t.closest("button")||t.closest("a")||t.closest("input")||t.closest("textarea")||t.closest("select")||this.menu.focus()})}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))};d.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){var t;if("hover"===this.eventMode&&window.matchMedia("(hover: hover)").matches&&"mouse"===e.pointerType){const i=e.currentTarget;return"A"===i.tagName&&i.hasAttribute("href")&&"#"!==i.getAttribute("href")||(e.preventDefault(),e.stopPropagation(),null===(t=e.stopImmediatePropagation)||void 0===t||t.call(e)),!1}this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?this.close():this.open()}onMouseEnterHandler(){if("hover"!==this.eventMode)return!1;(!this.el._floatingUI||this.el._floatingUI&&!this.el.classList.contains("open"))&&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()}getNextFocusableElement(e){const t=Array.from(document.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}destroyFloatingUI(){const e=(window.getComputedStyle(this.el).getPropertyValue("--scope")||"").trim();this.menu.classList.remove("block"),this.menu.classList.add("hidden"),this.menu.style.inset=null,this.menu.style.position=null,this.el&&this.el._floatingUI&&(this.el._floatingUI.destroy(),this.el._floatingUI=null),"window"===e&&this.el.appendChild(this.menu),this.animationInProcess=!1}focusElement(){const e=this.menu.querySelector("[autofocus]");if(e)return e.focus(),!0;const t=this.menu.querySelectorAll('[role="menuitem"]:not([hidden])');if(t.length>0){return t[0].focus(),!0}return!1}setupFloatingUI(e){const t=e||this.el,i=window.getComputedStyle(this.el),n=(i.getPropertyValue("--placement")||"").trim(),s=(i.getPropertyValue("--flip")||"true").trim(),l=(i.getPropertyValue("--strategy")||"fixed").trim(),r=(i.getPropertyValue("--offset")||"10").trim(),d=(i.getPropertyValue("--gpu-acceleration")||"true").trim(),c=(window.getComputedStyle(this.el).getPropertyValue("--adaptive")||"adaptive").replace(" ",""),h=l,u=parseInt(r,10),p=a.POSITIONS[n]||"bottom-start",m=[..."true"===s?[(0,o.flip)()]:[],(0,o.offset)(u)],g={placement:p,strategy:h,middleware:m};"fixed"===h&&Object.assign(this.menu.style,{position:h});const v=e=>{const t=this.menu.getBoundingClientRect(),i=window.innerWidth-(window.innerWidth-document.documentElement.clientWidth);return e+t.width>i&&(e=i-t.width),e<0&&(e=0),e},f=()=>{(0,o.computePosition)(t,this.menu,g).then(({x:e,y:t,placement:i})=>{const n=v(e);"absolute"===h&&"none"===c?Object.assign(this.menu.style,{position:h,margin:"0"}):"absolute"===h?Object.assign(this.menu.style,{position:h,transform:`translate3d(${e}px, ${t}px, 0px)`,margin:"0"}):"true"===d?Object.assign(this.menu.style,{position:h,left:"",top:"",inset:"0px auto auto 0px",margin:"0",transform:`translate3d(${"adaptive"===c?n:0}px, ${t}px, 0)`}):Object.assign(this.menu.style,{position:h,left:`${e}px`,top:`${t}px`,transform:""}),this.menu.setAttribute("data-placement",i)})};f();return{update:f,destroy:(0,o.autoUpdate)(t,this.menu,f)}}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.setupFloatingUI(e),i=this.menu.getAttribute("data-placement");return t.update(),t.destroy(),i}open(e,t=!1){if(this.el.classList.contains("open")||this.animationInProcess)return!1;this.openedViaKeyboard=t,this.animationInProcess=!0,this.menu.style.cssText="";const i=e||this.el,n=window.getComputedStyle(this.el),o=(n.getPropertyValue("--scope")||"").trim(),l=(n.getPropertyValue("--strategy")||"fixed").trim();"window"===o&&document.body.appendChild(this.menu),"static"!==l&&(this.el._floatingUI=this.setupFloatingUI(i)),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.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!0),"window"===o&&this.menu.classList.add("open"),this.animationInProcess=!1,!this.hasAutofocus||this.autofocusOnKeyboardOnly&&!this.openedViaKeyboard||this.focusElement(),this.fireEvent("open",this.el),(0,s.dispatch)("open.hs.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")||"").trim();if(this.animationInProcess=!0,"window"===t&&this.menu.classList.remove("open"),window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!1),e){const e=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;let t=!1;const i=()=>{t||(t=!0,this.destroyFloatingUI())};(0,s.afterTransition)(e,i);const n=window.getComputedStyle(e).getPropertyValue("transition-duration"),o=1e3*parseFloat(n)||150;setTimeout(i,o+50)}else this.destroyFloatingUI();(()=>{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.openedViaKeyboard=!1,this.fireEvent("close",this.el),(0,s.dispatch)("close.hs.dropdown",this.el,this.el)})()}forceClearState(){this.destroyFloatingUI(),this.menu.style.margin=null,this.el.classList.remove("open"),this.menu.classList.add("hidden"),this.openedViaKeyboard=!1}destroy(){(0,s.isIOS)()||(0,s.isIpadOS)()||(this.el.removeEventListener("mouseenter",this.onElementMouseEnterListener),this.el.removeEventListener("mouseleave",()=>this.onElementMouseLeaveListener),this.onElementMouseEnterListener=null,this.onElementMouseLeaveListener=null),"contextmenu"===this.eventMode?(this.toggle&&(this.toggle.removeEventListener("contextmenu",this.onToggleContextMenuListener),this.toggle.removeEventListener("touchstart",this.onTouchStartListener),this.toggle.removeEventListener("touchend",this.onTouchEndListener),this.toggle.removeEventListener("touchmove",this.onTouchEndListener)),this.onToggleContextMenuListener=null,this.onTouchStartListener=null,this.onTouchEndListener=null):(this.toggle&&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.destroyFloatingUI(),window.$hsDropdownCollection=window.$hsDropdownCollection.filter(({element:e})=>e.el!==this.el)}static findInCollection(e){return window.$hsDropdownCollection.find(t=>e instanceof d?t.element.el===e.el:"string"==typeof e?t.element.el===document.querySelector(e):t.element.el===e)||null}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:null}static autoInit(){d.ensureGlobalHandlers(),window.$hsDropdownCollection&&(window.$hsDropdownCollection=window.$hsDropdownCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll(".hs-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 d(e)})}static ensureGlobalHandlers(){if("undefined"==typeof window)return;if(window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),d.globalListenersInitialized)return;d.globalListenersInitialized=!0,window.addEventListener("click",e=>{const t=e.target;d.closeCurrentlyOpened(t)}),document.addEventListener("touchstart",e=>{const t=e.target;t.closest(".hs-dropdown")||d.closeCurrentlyOpened(t)},{passive:!0});let e=window.innerWidth;window.addEventListener("resize",()=>{window.innerWidth!==e&&(e=innerWidth,d.closeCurrentlyOpened(null,!1))})}static open(e,t=!1){const i=d.findInCollection(e);i&&i.element.menu.classList.contains("hidden")&&i.element.open(void 0,t)}static close(e){const t=d.findInCollection(e);t&&!t.element.menu.classList.contains("hidden")&&t.element.close()}static closeCurrentlyOpened(e=null,t=!0){const i=e&&e.closest(".hs-dropdown")&&e.closest(".hs-dropdown").parentElement.closest(".hs-dropdown")?e.closest(".hs-dropdown").parentElement.closest(".hs-dropdown"):null;let n=i?window.$hsDropdownCollection.filter(e=>e.element.el.classList.contains("open")&&e.element.menu.closest(".hs-dropdown").parentElement.closest(".hs-dropdown")===i):window.$hsDropdownCollection.filter(e=>e.element.el.classList.contains("open"));if(e){const t=e.closest(".hs-dropdown");if(t)"inside"===(0,s.getClassPropertyAlt)(t,"--auto-close")&&(n=n.filter(e=>e.element.el!==t));else{const t=e.closest(".hs-dropdown-menu");if(t){const e=window.$hsDropdownCollection.find(e=>e.element.menu===t);e&&"inside"===(0,s.getClassPropertyAlt)(e.element.el,"--auto-close")&&(n=n.filter(t=>t.element.el!==e.element.el))}}}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.getClassPropertyAlt)(e.element.el,"--trigger"))return!1;document.body.style.overflow="",document.body.style.paddingRight=""})}setupAccessibility(){this.accessibilityComponent=window.HSAccessibilityObserver.registerComponent(this.el,{onEnter:()=>{var e;const t=document.activeElement;if(!t)return;if(t.closest(".hs-dropdown-menu")){const i=t.closest(".hs-dropdown-toggle, [data-hs-dropdown-toggle]");if(i)return void i.click();const n=t.closest('[role="menuitem"], a, button, [data-hs-dropdown-item]');if((null===(e=null==n?void 0:n.children)||void 0===e?void 0:e.length)>0)return Array.from(n.children).forEach(e=>{e.matches("input[type='checkbox']:not([hidden]), input[type='radio']:not([hidden])")&&e.click()}),void n.focus();if(n){if(t.matches("input, textarea, select"))return;n.click()}return}this.isOpened()?this.close():this.open(void 0,!0)},onSpace:()=>{this.isOpened()||this.open(void 0,!0)},onEsc:()=>{this.isOpened()&&(this.close(),this.toggle&&this.toggle.focus())},onArrow:e=>{if(!e.metaKey)switch(e.key){case"ArrowDown":this.isOpened()?this.focusMenuItem("next"):this.open(void 0,!0);break;case"ArrowUp":this.isOpened()&&this.focusMenuItem("prev");break;case"ArrowRight":this.onArrowX(e,"right");break;case"ArrowLeft":this.onArrowX(e,"left")}},onHome:()=>{this.isOpened()&&this.onStartEnd(!0)},onEnd:()=>{this.isOpened()&&this.onStartEnd(!1)},onTab:()=>this.onTabOut(),onShiftTab:()=>this.onTabOut(),onFirstLetter:e=>{const t=document.activeElement;!(null==t?void 0:t.matches("input, textarea"))&&this.isOpened()&&this.onFirstLetter(e)}},this.isOpened(),"Dropdown",".hs-dropdown",this.menu,{onFirstLetter:!1})}onTabOut(){setTimeout(()=>{const e=document.activeElement,t=e.closest(".hs-dropdown-menu");if(e&&t){const t=e.closest(".hs-dropdown-toggle, [data-hs-dropdown-toggle]");return t?void t.click():void e.focus()}this.isOpened()&&this.close()},100)}onFirstLetter(e){var t;if(!this.isOpened()||!this.menu)return;const i=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden])');if(0===i.length)return;const n=Array.from(i).indexOf(document.activeElement);for(let s=1;s<=i.length;s++){const o=(n+s)%i.length;if(((null===(t=i[o].textContent)||void 0===t?void 0:t.trim().toLowerCase())||"").startsWith(e.toLowerCase()))return void i[o].focus()}i[0].focus()}onArrowX(e,t){if(!this.isOpened())return;e.preventDefault(),e.stopImmediatePropagation();const i=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden])');if(!i.length)return;const n=Array.from(i).indexOf(document.activeElement);let s=-1;s="right"===t?(n+1)%i.length:n>0?n-1:i.length-1,i[s].focus()}onStartEnd(e=!0){if(!this.isOpened())return;const t=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden])');if(!t.length)return;t[e?0:t.length-1].focus()}focusMenuItem(e){const t=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden])');if(!t.length)return;const i=Array.from(t).indexOf(document.activeElement);t["next"===e?(i+1)%t.length:(i-1+t.length)%t.length].focus()}static on(e,t,i){const n=d.findInCollection(t);n&&(n.element.events[e]=i)}isOpened(){return this.isOpen()}containsElement(e){return this.el.contains(e)}}d.globalListenersInitialized=!1,t.default=d},9247(e,t,i){"use strict";
|
|
71
71
|
/*
|
|
72
72
|
* HSFileUpload
|
|
73
|
-
* @version: 5.
|
|
73
|
+
* @version: 5.1.0
|
|
74
74
|
* @author: Preline Labs Ltd.
|
|
75
75
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
76
76
|
* Copyright 2024 Preline Labs Ltd.
|
|
77
|
-
*/var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(292),o=s(i(2961));"undefined"!=typeof Dropzone&&(Dropzone.autoDiscover=!1);class l extends o.default{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-hs-file-upload"),o=n?JSON.parse(n):{};this.previewTemplate=(null===(s=this.el.querySelector("[data-hs-file-upload-preview]"))||void 0===s?void 0:s.innerHTML)||'<div class="p-3 bg-white border border-solid border-gray-300 rounded-xl dark:bg-neutral-800 dark:border-neutral-600">\n\t\t\t<div class="mb-2 flex justify-between items-center">\n\t\t\t\t<div class="flex items-center gap-x-3">\n\t\t\t\t\t<span class="size-8 flex justify-center items-center border border-gray-200 text-gray-500 rounded-lg dark:border-neutral-700 dark:text-neutral-500" data-hs-file-upload-file-icon></span>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<p class="text-sm font-medium text-gray-800 dark:text-white">\n\t\t\t\t\t\t\t<span class="truncate inline-block max-w-75 align-bottom" data-hs-file-upload-file-name></span>.<span data-hs-file-upload-file-ext></span>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<p class="text-xs text-gray-500 dark:text-neutral-500" data-hs-file-upload-file-size></p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="inline-flex items-center gap-x-2">\n\t\t\t\t\t<button type="button" class="text-gray-500 hover:text-gray-800 dark:text-neutral-500 dark:hover:text-neutral-200" data-hs-file-upload-remove>\n\t\t\t\t\t\t<svg class="shrink-0 size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line></svg>\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="flex items-center gap-x-3 whitespace-nowrap">\n\t\t\t\t<div class="flex w-full h-2 bg-gray-200 rounded-full overflow-hidden dark:bg-neutral-700" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" data-hs-file-upload-progress-bar>\n\t\t\t\t\t<div class="flex flex-col justify-center rounded-full overflow-hidden bg-blue-600 text-xs text-white text-center whitespace-nowrap transition-all duration-500 hs-file-upload-complete:bg-green-600 dark:bg-blue-500" style="width: 0" data-hs-file-upload-progress-bar-pane></div>\n\t\t\t\t</div>\n\t\t\t\t<div class="w-10 text-end">\n\t\t\t\t\t<span class="text-sm text-gray-800 dark:text-white">\n\t\t\t\t\t\t<span data-hs-file-upload-progress-bar-value>0</span>%\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>',this.extensions=_.merge({default:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',class:"size-5"},xls:{icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.0243 1.43996H7.08805C6.82501 1.43996 6.57277 1.54445 6.38677 1.73043C6.20077 1.91642 6.09631 2.16868 6.09631 2.43171V6.64796L15.0243 11.856L19.4883 13.7398L23.9523 11.856V6.64796L15.0243 1.43996Z" fill="#21A366"></path><path d="M6.09631 6.64796H15.0243V11.856H6.09631V6.64796Z" fill="#107C41"></path><path d="M22.9605 1.43996H15.0243V6.64796H23.9523V2.43171C23.9523 2.16868 23.8478 1.91642 23.6618 1.73043C23.4758 1.54445 23.2235 1.43996 22.9605 1.43996Z" fill="#33C481"></path><path d="M15.0243 11.856H6.09631V21.2802C6.09631 21.5433 6.20077 21.7955 6.38677 21.9815C6.57277 22.1675 6.82501 22.272 7.08805 22.272H22.9606C23.2236 22.272 23.4759 22.1675 23.6618 21.9815C23.8478 21.7955 23.9523 21.5433 23.9523 21.2802V17.064L15.0243 11.856Z" fill="#185C37"></path><path d="M15.0243 11.856H23.9523V17.064H15.0243V11.856Z" fill="#107C41"></path><path opacity="0.1" d="M12.5446 5.15996H6.09631V19.296H12.5446C12.8073 19.2952 13.0591 19.1904 13.245 19.0046C13.4308 18.8188 13.5355 18.567 13.5363 18.3042V6.1517C13.5355 5.88892 13.4308 5.63712 13.245 5.4513C13.0591 5.26548 12.8073 5.16074 12.5446 5.15996Z" fill="black"></path><path opacity="0.2" d="M11.8006 5.90396H6.09631V20.04H11.8006C12.0633 20.0392 12.3151 19.9344 12.501 19.7486C12.6868 19.5628 12.7915 19.311 12.7923 19.0482V6.8957C12.7915 6.6329 12.6868 6.38114 12.501 6.19532C12.3151 6.0095 12.0633 5.90475 11.8006 5.90396Z" fill="black"></path><path opacity="0.2" d="M11.8006 5.90396H6.09631V18.552H11.8006C12.0633 18.5512 12.3151 18.4464 12.501 18.2606C12.6868 18.0748 12.7915 17.823 12.7923 17.5602V6.8957C12.7915 6.6329 12.6868 6.38114 12.501 6.19532C12.3151 6.0095 12.0633 5.90475 11.8006 5.90396Z" fill="black"></path><path opacity="0.2" d="M11.0566 5.90396H6.09631V18.552H11.0566C11.3193 18.5512 11.5711 18.4464 11.757 18.2606C11.9428 18.0748 12.0475 17.823 12.0483 17.5602V6.8957C12.0475 6.6329 11.9428 6.38114 11.757 6.19532C11.5711 6.0095 11.3193 5.90475 11.0566 5.90396Z" fill="black"></path><path d="M1.13604 5.90396H11.0566C11.3195 5.90396 11.5718 6.00842 11.7578 6.19442C11.9438 6.38042 12.0483 6.63266 12.0483 6.8957V16.8162C12.0483 17.0793 11.9438 17.3315 11.7578 17.5175C11.5718 17.7035 11.3195 17.808 11.0566 17.808H1.13604C0.873012 17.808 0.620754 17.7035 0.434765 17.5175C0.248775 17.3315 0.144287 17.0793 0.144287 16.8162V6.8957C0.144287 6.63266 0.248775 6.38042 0.434765 6.19442C0.620754 6.00842 0.873012 5.90396 1.13604 5.90396Z" fill="#107C41"></path><path d="M2.77283 15.576L5.18041 11.8455L2.9752 8.13596H4.74964L5.95343 10.5071C6.06401 10.7318 6.14015 10.8994 6.18185 11.01H6.19745C6.27683 10.8305 6.35987 10.6559 6.44669 10.4863L7.73309 8.13596H9.36167L7.09991 11.8247L9.41897 15.576H7.68545L6.29489 12.972C6.22943 12.861 6.17387 12.7445 6.12899 12.6238H6.10817C6.06761 12.7419 6.01367 12.855 5.94748 12.9608L4.51676 15.576H2.77283Z" fill="white"></path></svg>',class:"size-5"},doc:{icon:'<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M30.6141 1.91994H9.45071C9.09999 1.91994 8.76367 2.05926 8.51567 2.30725C8.26767 2.55523 8.12839 2.89158 8.12839 3.24228V8.86395L20.0324 12.3359L31.9364 8.86395V3.24228C31.9364 2.89158 31.797 2.55523 31.549 2.30725C31.3011 2.05926 30.9647 1.91994 30.6141 1.91994Z" fill="#41A5EE"></path><path d="M31.9364 8.86395H8.12839V15.8079L20.0324 19.2799L31.9364 15.8079V8.86395Z" fill="#2B7CD3"></path><path d="M31.9364 15.8079H8.12839V22.7519L20.0324 26.2239L31.9364 22.7519V15.8079Z" fill="#185ABD"></path><path d="M31.9364 22.752H8.12839V28.3736C8.12839 28.7244 8.26767 29.0607 8.51567 29.3087C8.76367 29.5567 9.09999 29.696 9.45071 29.696H30.6141C30.9647 29.696 31.3011 29.5567 31.549 29.3087C31.797 29.0607 31.9364 28.7244 31.9364 28.3736V22.752Z" fill="#103F91"></path><path opacity="0.1" d="M16.7261 6.87994H8.12839V25.7279H16.7261C17.0764 25.7269 17.4121 25.5872 17.6599 25.3395C17.9077 25.0917 18.0473 24.756 18.0484 24.4056V8.20226C18.0473 7.8519 17.9077 7.51616 17.6599 7.2684C17.4121 7.02064 17.0764 6.88099 16.7261 6.87994Z" class="fill-black dark:fill-neutral-200" fill="currentColor"></path><path opacity="0.2" d="M15.7341 7.87194H8.12839V26.7199H15.7341C16.0844 26.7189 16.4201 26.5792 16.6679 26.3315C16.9157 26.0837 17.0553 25.748 17.0564 25.3976V9.19426C17.0553 8.84386 16.9157 8.50818 16.6679 8.26042C16.4201 8.01266 16.0844 7.87299 15.7341 7.87194Z" class="fill-black dark:fill-neutral-200" fill="currentColor"></path><path opacity="0.2" d="M15.7341 7.87194H8.12839V24.7359H15.7341C16.0844 24.7349 16.4201 24.5952 16.6679 24.3475C16.9157 24.0997 17.0553 23.764 17.0564 23.4136V9.19426C17.0553 8.84386 16.9157 8.50818 16.6679 8.26042C16.4201 8.01266 16.0844 7.87299 15.7341 7.87194Z" class="fill-black dark:fill-neutral-200" fill="currentColor"></path><path opacity="0.2" d="M14.7421 7.87194H8.12839V24.7359H14.7421C15.0924 24.7349 15.4281 24.5952 15.6759 24.3475C15.9237 24.0997 16.0633 23.764 16.0644 23.4136V9.19426C16.0633 8.84386 15.9237 8.50818 15.6759 8.26042C15.4281 8.01266 15.0924 7.87299 14.7421 7.87194Z" class="fill-black dark:fill-neutral-200" fill="currentColor"></path><path d="M1.51472 7.87194H14.7421C15.0927 7.87194 15.4291 8.01122 15.6771 8.25922C15.925 8.50722 16.0644 8.84354 16.0644 9.19426V22.4216C16.0644 22.7723 15.925 23.1087 15.6771 23.3567C15.4291 23.6047 15.0927 23.7439 14.7421 23.7439H1.51472C1.16401 23.7439 0.827669 23.6047 0.579687 23.3567C0.3317 23.1087 0.192383 22.7723 0.192383 22.4216V9.19426C0.192383 8.84354 0.3317 8.50722 0.579687 8.25922C0.827669 8.01122 1.16401 7.87194 1.51472 7.87194Z" fill="#185ABD"></path><path d="M12.0468 20.7679H10.2612L8.17801 13.9231L5.99558 20.7679H4.20998L2.22598 10.8479H4.01158L5.40038 17.7919L7.48358 11.0463H8.97161L10.9556 17.7919L12.3444 10.8479H14.0308L12.0468 20.7679Z" fill="white"></path></svg>',class:"size-5"},zip:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 22h2a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v18"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><circle cx="10" cy="20" r="2"/><path d="M10 7V6"/><path d="M10 12v-1"/><path d="M10 18v-2"/></svg>',class:"size-5"}},o.extensions),this.singleton=o.singleton,this.concatOptions=Object.assign(Object.assign({clickable:this.el.querySelector("[data-hs-file-upload-trigger]"),previewsContainer:this.el.querySelector("[data-hs-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:this.previewTemplate,autoHideTrigger:!1},o),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-hs-file-upload-clear]"),t=Array.from(this.el.querySelectorAll("[data-hs-file-upload-pseudo-trigger]"));this.dropzone=new Dropzone(this.el,this.concatOptions),this.dropzone.on("addedfile",e=>this.onAddFile(e)),this.dropzone.on("removedfile",()=>this.onRemoveFile()),this.dropzone.on("uploadprogress",(e,t)=>this.onUploadProgress(e,t)),this.dropzone.on("complete",e=>this.onComplete(e)),e&&(e.onclick=()=>{this.dropzone.files.length&&this.dropzone.removeAllFiles(!0)}),t.length&&t.forEach(e=>{e.onclick=()=>{var e,t;(null===(e=this.concatOptions)||void 0===e?void 0:e.clickable)&&(null===(t=this.concatOptions)||void 0===t?void 0:t.clickable).click()}})}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-hs-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-hs-file-upload-file-name]"),n=t.querySelector("[data-hs-file-upload-file-ext]"),o=t.querySelector("[data-hs-file-upload-file-size]"),l=t.querySelector("[data-hs-file-upload-file-icon]"),r=this.el.querySelector("[data-hs-file-upload-trigger]"),a=t.querySelector("[data-dz-thumbnail]"),c=t.querySelector("[data-hs-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"),c&&(c.onclick=()=>this.dropzone.removeFile(e))}onRemoveFile(){const e=this.el.querySelector("[data-hs-file-upload-trigger]");0===this.dropzone.files.length&&this.concatOptions.autoHideTrigger&&(e.style.display="")}onUploadProgress(e,t){const{previewElement:i}=e;if(!i)return!1;const s=i.querySelector("[data-hs-file-upload-progress-bar]"),n=i.querySelector("[data-hs-file-upload-progress-bar-pane]"),o=i.querySelector("[data-hs-file-upload-progress-bar-value]"),l=Math.floor(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 s=(null===(t=this.extensions[e])||void 0===t?void 0:t.icon)?(0,n.htmlToElement)(this.extensions[e].icon):(0,n.htmlToElement)(this.extensions.default.icon);return(0,n.classToClassList)((null===(i=this.extensions[e])||void 0===i?void 0:i.class)?this.extensions[e].class:this.extensions.default.class,s),s}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-hs-file-upload]:not(.--prevent-on-load-init)").forEach(e=>{window.$hsFileUploadCollection.find(t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e})||new l(e)})}}t.default=l},989(e,t,i){"use strict";
|
|
77
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=n(i(2961));"undefined"!=typeof Dropzone&&(Dropzone.autoDiscover=!1);class l extends o.default{constructor(e,t,i){var n;super(e,t,i),this.extensions={},this.el="string"==typeof e?document.querySelector(e):e;const s=this.el.getAttribute("data-hs-file-upload"),o=s?JSON.parse(s):{};this.previewTemplate=(null===(n=this.el.querySelector("[data-hs-file-upload-preview]"))||void 0===n?void 0:n.innerHTML)||'<div class="p-3 bg-white border border-solid border-gray-300 rounded-xl dark:bg-neutral-800 dark:border-neutral-600">\n\t\t\t<div class="mb-2 flex justify-between items-center">\n\t\t\t\t<div class="flex items-center gap-x-3">\n\t\t\t\t\t<span class="size-8 flex justify-center items-center border border-gray-200 text-gray-500 rounded-lg dark:border-neutral-700 dark:text-neutral-500" data-hs-file-upload-file-icon></span>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<p class="text-sm font-medium text-gray-800 dark:text-white">\n\t\t\t\t\t\t\t<span class="truncate inline-block max-w-75 align-bottom" data-hs-file-upload-file-name></span>.<span data-hs-file-upload-file-ext></span>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<p class="text-xs text-gray-500 dark:text-neutral-500" data-hs-file-upload-file-size></p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="inline-flex items-center gap-x-2">\n\t\t\t\t\t<button type="button" class="text-gray-500 hover:text-gray-800 dark:text-neutral-500 dark:hover:text-neutral-200" data-hs-file-upload-remove>\n\t\t\t\t\t\t<svg class="shrink-0 size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line></svg>\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="flex items-center gap-x-3 whitespace-nowrap">\n\t\t\t\t<div class="flex w-full h-2 bg-gray-200 rounded-full overflow-hidden dark:bg-neutral-700" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" data-hs-file-upload-progress-bar>\n\t\t\t\t\t<div class="flex flex-col justify-center rounded-full overflow-hidden bg-blue-600 text-xs text-white text-center whitespace-nowrap transition-all duration-500 hs-file-upload-complete:bg-green-600 dark:bg-blue-500" style="width: 0" data-hs-file-upload-progress-bar-pane></div>\n\t\t\t\t</div>\n\t\t\t\t<div class="w-10 text-end">\n\t\t\t\t\t<span class="text-sm text-gray-800 dark:text-white">\n\t\t\t\t\t\t<span data-hs-file-upload-progress-bar-value>0</span>%\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>',this.extensions=_.merge({default:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',class:"size-5"},xls:{icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.0243 1.43996H7.08805C6.82501 1.43996 6.57277 1.54445 6.38677 1.73043C6.20077 1.91642 6.09631 2.16868 6.09631 2.43171V6.64796L15.0243 11.856L19.4883 13.7398L23.9523 11.856V6.64796L15.0243 1.43996Z" fill="#21A366"></path><path d="M6.09631 6.64796H15.0243V11.856H6.09631V6.64796Z" fill="#107C41"></path><path d="M22.9605 1.43996H15.0243V6.64796H23.9523V2.43171C23.9523 2.16868 23.8478 1.91642 23.6618 1.73043C23.4758 1.54445 23.2235 1.43996 22.9605 1.43996Z" fill="#33C481"></path><path d="M15.0243 11.856H6.09631V21.2802C6.09631 21.5433 6.20077 21.7955 6.38677 21.9815C6.57277 22.1675 6.82501 22.272 7.08805 22.272H22.9606C23.2236 22.272 23.4759 22.1675 23.6618 21.9815C23.8478 21.7955 23.9523 21.5433 23.9523 21.2802V17.064L15.0243 11.856Z" fill="#185C37"></path><path d="M15.0243 11.856H23.9523V17.064H15.0243V11.856Z" fill="#107C41"></path><path opacity="0.1" d="M12.5446 5.15996H6.09631V19.296H12.5446C12.8073 19.2952 13.0591 19.1904 13.245 19.0046C13.4308 18.8188 13.5355 18.567 13.5363 18.3042V6.1517C13.5355 5.88892 13.4308 5.63712 13.245 5.4513C13.0591 5.26548 12.8073 5.16074 12.5446 5.15996Z" fill="black"></path><path opacity="0.2" d="M11.8006 5.90396H6.09631V20.04H11.8006C12.0633 20.0392 12.3151 19.9344 12.501 19.7486C12.6868 19.5628 12.7915 19.311 12.7923 19.0482V6.8957C12.7915 6.6329 12.6868 6.38114 12.501 6.19532C12.3151 6.0095 12.0633 5.90475 11.8006 5.90396Z" fill="black"></path><path opacity="0.2" d="M11.8006 5.90396H6.09631V18.552H11.8006C12.0633 18.5512 12.3151 18.4464 12.501 18.2606C12.6868 18.0748 12.7915 17.823 12.7923 17.5602V6.8957C12.7915 6.6329 12.6868 6.38114 12.501 6.19532C12.3151 6.0095 12.0633 5.90475 11.8006 5.90396Z" fill="black"></path><path opacity="0.2" d="M11.0566 5.90396H6.09631V18.552H11.0566C11.3193 18.5512 11.5711 18.4464 11.757 18.2606C11.9428 18.0748 12.0475 17.823 12.0483 17.5602V6.8957C12.0475 6.6329 11.9428 6.38114 11.757 6.19532C11.5711 6.0095 11.3193 5.90475 11.0566 5.90396Z" fill="black"></path><path d="M1.13604 5.90396H11.0566C11.3195 5.90396 11.5718 6.00842 11.7578 6.19442C11.9438 6.38042 12.0483 6.63266 12.0483 6.8957V16.8162C12.0483 17.0793 11.9438 17.3315 11.7578 17.5175C11.5718 17.7035 11.3195 17.808 11.0566 17.808H1.13604C0.873012 17.808 0.620754 17.7035 0.434765 17.5175C0.248775 17.3315 0.144287 17.0793 0.144287 16.8162V6.8957C0.144287 6.63266 0.248775 6.38042 0.434765 6.19442C0.620754 6.00842 0.873012 5.90396 1.13604 5.90396Z" fill="#107C41"></path><path d="M2.77283 15.576L5.18041 11.8455L2.9752 8.13596H4.74964L5.95343 10.5071C6.06401 10.7318 6.14015 10.8994 6.18185 11.01H6.19745C6.27683 10.8305 6.35987 10.6559 6.44669 10.4863L7.73309 8.13596H9.36167L7.09991 11.8247L9.41897 15.576H7.68545L6.29489 12.972C6.22943 12.861 6.17387 12.7445 6.12899 12.6238H6.10817C6.06761 12.7419 6.01367 12.855 5.94748 12.9608L4.51676 15.576H2.77283Z" fill="white"></path></svg>',class:"size-5"},doc:{icon:'<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M30.6141 1.91994H9.45071C9.09999 1.91994 8.76367 2.05926 8.51567 2.30725C8.26767 2.55523 8.12839 2.89158 8.12839 3.24228V8.86395L20.0324 12.3359L31.9364 8.86395V3.24228C31.9364 2.89158 31.797 2.55523 31.549 2.30725C31.3011 2.05926 30.9647 1.91994 30.6141 1.91994Z" fill="#41A5EE"></path><path d="M31.9364 8.86395H8.12839V15.8079L20.0324 19.2799L31.9364 15.8079V8.86395Z" fill="#2B7CD3"></path><path d="M31.9364 15.8079H8.12839V22.7519L20.0324 26.2239L31.9364 22.7519V15.8079Z" fill="#185ABD"></path><path d="M31.9364 22.752H8.12839V28.3736C8.12839 28.7244 8.26767 29.0607 8.51567 29.3087C8.76367 29.5567 9.09999 29.696 9.45071 29.696H30.6141C30.9647 29.696 31.3011 29.5567 31.549 29.3087C31.797 29.0607 31.9364 28.7244 31.9364 28.3736V22.752Z" fill="#103F91"></path><path opacity="0.1" d="M16.7261 6.87994H8.12839V25.7279H16.7261C17.0764 25.7269 17.4121 25.5872 17.6599 25.3395C17.9077 25.0917 18.0473 24.756 18.0484 24.4056V8.20226C18.0473 7.8519 17.9077 7.51616 17.6599 7.2684C17.4121 7.02064 17.0764 6.88099 16.7261 6.87994Z" class="fill-black dark:fill-neutral-200" fill="currentColor"></path><path opacity="0.2" d="M15.7341 7.87194H8.12839V26.7199H15.7341C16.0844 26.7189 16.4201 26.5792 16.6679 26.3315C16.9157 26.0837 17.0553 25.748 17.0564 25.3976V9.19426C17.0553 8.84386 16.9157 8.50818 16.6679 8.26042C16.4201 8.01266 16.0844 7.87299 15.7341 7.87194Z" class="fill-black dark:fill-neutral-200" fill="currentColor"></path><path opacity="0.2" d="M15.7341 7.87194H8.12839V24.7359H15.7341C16.0844 24.7349 16.4201 24.5952 16.6679 24.3475C16.9157 24.0997 17.0553 23.764 17.0564 23.4136V9.19426C17.0553 8.84386 16.9157 8.50818 16.6679 8.26042C16.4201 8.01266 16.0844 7.87299 15.7341 7.87194Z" class="fill-black dark:fill-neutral-200" fill="currentColor"></path><path opacity="0.2" d="M14.7421 7.87194H8.12839V24.7359H14.7421C15.0924 24.7349 15.4281 24.5952 15.6759 24.3475C15.9237 24.0997 16.0633 23.764 16.0644 23.4136V9.19426C16.0633 8.84386 15.9237 8.50818 15.6759 8.26042C15.4281 8.01266 15.0924 7.87299 14.7421 7.87194Z" class="fill-black dark:fill-neutral-200" fill="currentColor"></path><path d="M1.51472 7.87194H14.7421C15.0927 7.87194 15.4291 8.01122 15.6771 8.25922C15.925 8.50722 16.0644 8.84354 16.0644 9.19426V22.4216C16.0644 22.7723 15.925 23.1087 15.6771 23.3567C15.4291 23.6047 15.0927 23.7439 14.7421 23.7439H1.51472C1.16401 23.7439 0.827669 23.6047 0.579687 23.3567C0.3317 23.1087 0.192383 22.7723 0.192383 22.4216V9.19426C0.192383 8.84354 0.3317 8.50722 0.579687 8.25922C0.827669 8.01122 1.16401 7.87194 1.51472 7.87194Z" fill="#185ABD"></path><path d="M12.0468 20.7679H10.2612L8.17801 13.9231L5.99558 20.7679H4.20998L2.22598 10.8479H4.01158L5.40038 17.7919L7.48358 11.0463H8.97161L10.9556 17.7919L12.3444 10.8479H14.0308L12.0468 20.7679Z" fill="white"></path></svg>',class:"size-5"},zip:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 22h2a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v18"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><circle cx="10" cy="20" r="2"/><path d="M10 7V6"/><path d="M10 12v-1"/><path d="M10 18v-2"/></svg>',class:"size-5"}},o.extensions),this.singleton=o.singleton,this.concatOptions=Object.assign(Object.assign({clickable:this.el.querySelector("[data-hs-file-upload-trigger]"),previewsContainer:this.el.querySelector("[data-hs-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:this.previewTemplate,autoHideTrigger:!1},o),t),this.onReloadButtonClickListener=[],this.onTempFileInputChangeListener=[],this.init()}tempFileInputChange(e,t){var i;const n=null===(i=e.target.files)||void 0===i?void 0:i[0];if(n){const e=n;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-hs-file-upload-clear]"),t=Array.from(this.el.querySelectorAll("[data-hs-file-upload-pseudo-trigger]"));this.dropzone=new Dropzone(this.el,this.concatOptions),this.dropzone.on("addedfile",e=>this.onAddFile(e)),this.dropzone.on("removedfile",()=>this.onRemoveFile()),this.dropzone.on("uploadprogress",(e,t)=>this.onUploadProgress(e,t)),this.dropzone.on("complete",e=>this.onComplete(e)),e&&(e.onclick=()=>{this.dropzone.files.length&&this.dropzone.removeAllFiles(!0)}),t.length&&t.forEach(e=>{e.onclick=()=>{var e,t;(null===(e=this.concatOptions)||void 0===e?void 0:e.clickable)&&(null===(t=this.concatOptions)||void 0===t?void 0:t.clickable).click()}})}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-hs-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),n=t.querySelector("[data-hs-file-upload-file-name]"),s=t.querySelector("[data-hs-file-upload-file-ext]"),o=t.querySelector("[data-hs-file-upload-file-size]"),l=t.querySelector("[data-hs-file-upload-file-icon]"),r=this.el.querySelector("[data-hs-file-upload-trigger]"),a=t.querySelector("[data-dz-thumbnail]"),d=t.querySelector("[data-hs-file-upload-remove]");n&&(n.textContent=i.name),s&&(s.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-hs-file-upload-trigger]");0===this.dropzone.files.length&&this.concatOptions.autoHideTrigger&&(e.style.display="")}onUploadProgress(e,t){const{previewElement:i}=e;if(!i)return!1;const n=i.querySelector("[data-hs-file-upload-progress-bar]"),s=i.querySelector("[data-hs-file-upload-progress-bar-pane]"),o=i.querySelector("[data-hs-file-upload-progress-bar-value]"),l=Math.floor(t);n&&n.setAttribute("aria-valuenow",`${l}`),s&&(s.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.htmlToElement)(this.extensions[e].icon):(0,s.htmlToElement)(this.extensions.default.icon);return(0,s.classToClassList)((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-hs-file-upload]:not(.--prevent-on-load-init)").forEach(e=>{window.$hsFileUploadCollection.find(t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e})||new l(e)})}}t.default=l},989(e,t,i){"use strict";
|
|
78
78
|
/*
|
|
79
79
|
* HSInputNumber
|
|
80
|
-
* @version: 5.
|
|
80
|
+
* @version: 5.1.0
|
|
81
81
|
* @author: Preline Labs Ltd.
|
|
82
82
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
83
83
|
* Copyright 2024 Preline Labs Ltd.
|
|
84
|
-
*/var
|
|
84
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=n(i(2961));class l extends o.default{constructor(e,t){super(e,t),this.input=this.el.querySelector("[data-hs-input-number-input]")||null,this.increment=this.el.querySelector("[data-hs-input-number-increment]")||null,this.decrement=this.el.querySelector("[data-hs-input-number-decrement]")||null;const i=this.el.dataset.hsInputNumber,n=i?JSON.parse(i):{step:1},s=Object.assign(Object.assign({},n),t);this.minInputValue="min"in s?s.min:0,this.maxInputValue="max"in s?s.max:null,this.step="step"in s&&s.step>0?s.step:1,this.forceBlankValue="forceBlankValue"in s&&s.forceBlankValue,this.input&&this.checkIsNumberAndConvert(),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.forceBlankValue||(this.inputValue=0,this.input.value="0")}cleanAndExtractNumber(e){const t=[];let i=!1,n=!1;e.split("").forEach((e,s)=>{e>="0"&&e<="9"?t.push(e):"."!==e||i?"-"!==e||n||0!==t.length||(t.push(e),n=!0):(t.push(e),i=!0)});const s=t.join(""),o=parseFloat(s);return isNaN(o)?null:o}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.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.dispatch)("change.hs.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-hs-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 l(e)})}}t.default=l},69(e,t,i){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});
|
|
85
85
|
/*
|
|
86
86
|
* HSLayoutSplitter
|
|
87
|
-
* @version: 5.
|
|
87
|
+
* @version: 5.1.0
|
|
88
88
|
* @author: Preline Labs Ltd.
|
|
89
89
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
90
90
|
* Copyright 2024 Preline Labs Ltd.
|
|
91
91
|
*/
|
|
92
|
-
const n=i(292),o=s(i(2961));class l extends o.default{constructor(e,t){var i;super(e,t);const s=e.getAttribute("data-hs-layout-splitter"),n=s?JSON.parse(s):{},o=Object.assign(Object.assign({},n),t);this.horizontalSplitterClasses=(null==o?void 0:o.horizontalSplitterClasses)||null,this.horizontalSplitterTemplate=(null==o?void 0:o.horizontalSplitterTemplate)||"<div></div>",this.verticalSplitterClasses=(null==o?void 0:o.verticalSplitterClasses)||null,this.verticalSplitterTemplate=(null==o?void 0:o.verticalSplitterTemplate)||"<div></div>",this.isSplittersAddedManually=null!==(i=null==o?void 0:o.isSplittersAddedManually)&&void 0!==i&&i,this.horizontalSplitters=[],this.horizontalControls=[],this.verticalSplitters=[],this.verticalControls=[],this.isDragging=!1,this.activeSplitter=null,this.onControlPointerDownListener=[],this.init()}controlPointerDown(e){this.isDragging=!0,this.activeSplitter=e,this.onPointerDownHandler(e)}controlPointerUp(){this.isDragging=!1,this.activeSplitter=null,this.onPointerUpHandler()}init(){l.ensureGlobalHandlers(),this.createCollection(window.$hsLayoutSplitterCollection,this),this.buildSplitters(),l.isListenersInitialized||(document.addEventListener("pointermove",l.onDocumentPointerMove),document.addEventListener("pointerup",l.onDocumentPointerUp),l.isListenersInitialized=!0)}buildSplitters(){this.buildHorizontalSplitters(),this.buildVerticalSplitters()}buildHorizontalSplitters(){const e=this.el.querySelectorAll("[data-hs-layout-splitter-horizontal-group]");e.length&&(e.forEach(e=>{this.horizontalSplitters.push({el:e,items:Array.from(e.querySelectorAll(":scope > [data-hs-layout-splitter-item]"))})}),this.updateHorizontalSplitter())}buildVerticalSplitters(){const e=this.el.querySelectorAll("[data-hs-layout-splitter-vertical-group]");e.length&&(e.forEach(e=>{this.verticalSplitters.push({el:e,items:Array.from(e.querySelectorAll(":scope > [data-hs-layout-splitter-item]"))})}),this.updateVerticalSplitter())}buildControl(e,t,i="horizontal"){let s;if(this.isSplittersAddedManually){if(s=null==t?void 0:t.previousElementSibling,!s)return!1;s.style.display=""}else s=(0,n.htmlToElement)("horizontal"===i?this.horizontalSplitterTemplate:this.verticalSplitterTemplate),(0,n.classToClassList)("horizontal"===i?this.horizontalSplitterClasses:this.verticalSplitterClasses,s),s.classList.add("hs-layout-splitter-control");const o={el:s,direction:i,prev:e,next:t};"horizontal"===i?this.horizontalControls.push(o):this.verticalControls.push(o),this.bindListeners(o),t&&!this.isSplittersAddedManually&&e.insertAdjacentElement("afterend",s)}getSplitterItemParsedParam(e){const t=e.getAttribute("data-hs-layout-splitter-item");return(0,n.isJson)(t)?JSON.parse(t):t}getContainerSize(e,t){return t?e.getBoundingClientRect().width:e.getBoundingClientRect().height}getMaxFlexSize(e,t,i){const s=this.getSplitterItemSingleParam(e,t);return"number"==typeof s?s/100*i:0}updateHorizontalSplitter(){this.horizontalSplitters.forEach(({items:e})=>{e.forEach(e=>{this.updateSingleSplitter(e)}),e.forEach((t,i)=>{i>=e.length-1?this.buildControl(t,null):this.buildControl(t,e[i+1])})})}updateSingleSplitter(e){const t=e.getAttribute("data-hs-layout-splitter-item"),i=(0,n.isJson)(t)?JSON.parse(t):t,s=(0,n.isJson)(t)?i.dynamicSize:t;e.style.flex=`${s} 1 0`}updateVerticalSplitter(){this.verticalSplitters.forEach(({items:e})=>{e.forEach(e=>{this.updateSingleSplitter(e)}),e.forEach((t,i)=>{i>=e.length-1?this.buildControl(t,null,"vertical"):this.buildControl(t,e[i+1],"vertical")})})}updateSplitterItemParam(e,t){const i=this.getSplitterItemParsedParam(e),s=t.toFixed(1),n="object"==typeof i?JSON.stringify(Object.assign(Object.assign({},i),{dynamicSize:+s})):s;e.setAttribute("data-hs-layout-splitter-item",n)}onPointerDownHandler(e){const{el:t,prev:i,next:s}=e;t.classList.add("dragging"),i.classList.add("dragging"),s.classList.add("dragging"),document.body.style.userSelect="none"}onPointerUpHandler(){document.body.style.userSelect=""}onPointerMoveHandler(e,t,i){const{prev:s,next:n}=t,o=t.el.closest("horizontal"===i?"[data-hs-layout-splitter-horizontal-group]":"[data-hs-layout-splitter-vertical-group]"),l="horizontal"===i,r=this.getContainerSize(o,l),a=this.calculateAvailableSize(o,s,n,l,r),c=this.calculateResizedSizes(e,s,a,l),d=this.enforceLimits(c,s,n,r,a);this.applySizes(s,n,d,r)}bindListeners(e){const{el:t}=e;this.onControlPointerDownListener.push({el:t,fn:()=>this.controlPointerDown(e)}),t.addEventListener("pointerdown",this.onControlPointerDownListener.find(e=>e.el===t).fn)}calculateAvailableSize(e,t,i,s,n){const o=e.querySelectorAll(":scope > [data-hs-layout-splitter-item]");return n-Array.from(o).reduce((e,n)=>{if(n===t||n===i)return e;const o=n.getBoundingClientRect();return e+("fixed"===window.getComputedStyle(n).position?0:s?o.width:o.height)},0)}calculateResizedSizes(e,t,i,s){const n=s?t.getBoundingClientRect().left:t.getBoundingClientRect().top;let o=Math.max(0,Math.min((s?e.clientX:e.clientY)-n,i));return{previousSize:o,nextSize:i-o}}enforceLimits(e,t,i,s,o){const l=this.getMaxFlexSize(t,"minSize",s),r=this.getMaxFlexSize(i,"minSize",s),a=this.getMaxFlexSize(t,"preLimitSize",s),c=this.getMaxFlexSize(i,"preLimitSize",s);let{previousSize:d,nextSize:h}=e;h<r?(h=r,d=o-h):d<l&&(d=l,h=o-d);const u={prev:t,next:i,previousSize:d.toFixed(),previousFlexSize:d/s*100,previousPreLimitSize:a,previousPreLimitFlexSize:a/s*100,previousMinSize:l,previousMinFlexSize:l/s*100,nextSize:h.toFixed(),nextFlexSize:h/s*100,nextPreLimitSize:c,nextPreLimitFlexSize:c/s*100,nextMinSize:r,nextMinFlexSize:r/s*100,static:{prev:{minSize:this.getSplitterItemSingleParam(t,"minSize"),preLimitSize:this.getSplitterItemSingleParam(t,"preLimitSize")},next:{minSize:this.getSplitterItemSingleParam(i,"minSize"),preLimitSize:this.getSplitterItemSingleParam(i,"preLimitSize")}}};return h<r?(this.fireEvent("onNextLimit",u),(0,n.dispatch)("onNextLimit.hs.layoutSplitter",this.el,u)):d<l&&(this.fireEvent("onPrevLimit",u),(0,n.dispatch)("onPrevLimit.hs.layoutSplitter",this.el,u)),d<=a&&(this.fireEvent("onPrevPreLimit",u),(0,n.dispatch)("onPrevPreLimit.hs.layoutSplitter",this.el,u)),h<=c&&(this.fireEvent("onNextPreLimit",u),(0,n.dispatch)("onNextPreLimit.hs.layoutSplitter",this.el,u)),this.fireEvent("drag",u),(0,n.dispatch)("drag.hs.layoutSplitter",this.el,u),{previousSize:d,nextSize:h}}applySizes(e,t,i,s){const{previousSize:n,nextSize:o}=i,l=n/s*100;this.updateSplitterItemParam(e,l),e.style.flex=`${l.toFixed(1)} 1 0`;const r=o/s*100;this.updateSplitterItemParam(t,r),t.style.flex=`${r.toFixed(1)} 1 0`}getSplitterItemSingleParam(e,t){try{return this.getSplitterItemParsedParam(e)[t]}catch(e){return console.log("There is no parameter with this name in the object."),!1}}getData(e){var t,i;const s=e.closest("[data-hs-layout-splitter-horizontal-group], [data-hs-layout-splitter-vertical-group]");if(!s)throw new Error("Element is not inside a valid layout splitter container.");const n=s.matches("[data-hs-layout-splitter-horizontal-group]"),o=this.getContainerSize(s,n),l=this.getSplitterItemSingleParam(e,"dynamicSize")||0,r=this.getMaxFlexSize(e,"minSize",o),a=this.getMaxFlexSize(e,"preLimitSize",o),c=r/o*100,d=a/o*100;return{el:e,dynamicSize:+(l/100*o).toFixed(),dynamicFlexSize:l,minSize:+r.toFixed(),minFlexSize:c,preLimitSize:+a.toFixed(),preLimitFlexSize:d,static:{minSize:null!==(t=this.getSplitterItemSingleParam(e,"minSize"))&&void 0!==t?t:null,preLimitSize:null!==(i=this.getSplitterItemSingleParam(e,"preLimitSize"))&&void 0!==i?i:null}}}setSplitterItemSize(e,t){this.updateSplitterItemParam(e,t),e.style.flex=`${t.toFixed(1)} 1 0`}updateFlexValues(e){let t=0;const i=window.innerWidth;if(e.forEach(({id:e,breakpoints:s})=>{const n=document.getElementById(e);if(n){const e=(e=>{const t=Object.keys(e).map(Number).sort((e,t)=>e-t);for(let s=t.length-1;s>=0;s--)if(i>=t[s])return e[t[s]];return 0})(s);this.updateSplitterItemParam(n,e),n.style.flex=`${e.toFixed(1)} 1 0`,t+=e}}),100!==t){const i=100/t;e.forEach(({id:e})=>{const t=document.getElementById(e);if(t){const e=parseFloat(t.style.flex.split(" ")[0])*i;this.updateSplitterItemParam(t,e),t.style.flex=`${e.toFixed(1)} 1 0`}})}}destroy(){this.onControlPointerDownListener&&(this.onControlPointerDownListener.forEach(({el:e,fn:t})=>{e.removeEventListener("pointerdown",t)}),this.onControlPointerDownListener=null),this.horizontalSplitters.forEach(({items:e})=>{e.forEach(e=>{e.style.flex=""})}),this.verticalSplitters.forEach(({items:e})=>{e.forEach(e=>{e.style.flex=""})}),this.horizontalControls.forEach(({el:e})=>{this.isSplittersAddedManually?e.style.display="none":e.remove()}),this.verticalControls.forEach(({el:e})=>{this.isSplittersAddedManually?e.style.display="none":e.remove()}),this.horizontalControls=[],this.verticalControls=[],window.$hsLayoutSplitterCollection=window.$hsLayoutSplitterCollection.filter(({element:e})=>e.el!==this.el),0===window.$hsLayoutSplitterCollection.length&&l.isListenersInitialized&&(document.removeEventListener("pointermove",l.onDocumentPointerMove),document.removeEventListener("pointerup",l.onDocumentPointerUp),l.isListenersInitialized=!1)}static findInCollection(e){return window.$hsLayoutSplitterCollection.find(t=>e instanceof l?t.element.el===e.el:"string"==typeof e?t.element.el===document.querySelector(e):t.element.el===e)||null}static autoInit(){l.ensureGlobalHandlers(),window.$hsLayoutSplitterCollection&&(window.$hsLayoutSplitterCollection=window.$hsLayoutSplitterCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-layout-splitter]:not(.--prevent-on-load-init)").forEach(e=>{window.$hsLayoutSplitterCollection.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 ensureGlobalHandlers(){"undefined"!=typeof window&&(window.$hsLayoutSplitterCollection||(window.$hsLayoutSplitterCollection=[]),l.isWindowListenersInitialized||(l.isWindowListenersInitialized=!0,window.addEventListener("pointerup",()=>{if(!window.$hsLayoutSplitterCollection)return!1;const e=document.querySelector(".hs-layout-splitter-control.dragging"),t=document.querySelectorAll("[data-hs-layout-splitter-item].dragging");if(!e)return!1;const i=l.getInstance(e.closest("[data-hs-layout-splitter]"),!0);e.classList.remove("dragging"),t.forEach(e=>e.classList.remove("dragging")),i.element.isDragging=!1})))}static getInstance(e,t){const i=window.$hsLayoutSplitterCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e));return i?t?i:i.element.el:null}static on(e,t,i){const s=l.findInCollection(t);s&&(s.element.events[e]=i)}}l.isListenersInitialized=!1,l.isWindowListenersInitialized=!1,l.onDocumentPointerMove=e=>{const t=document.querySelector(".hs-layout-splitter-control.dragging");if(!t)return;const i=l.getInstance(t.closest("[data-hs-layout-splitter]"),!0);if(!i||!i.element.isDragging)return;const s=i.element.activeSplitter;s&&("vertical"===s.direction?i.element.onPointerMoveHandler(e,s,"vertical"):i.element.onPointerMoveHandler(e,s,"horizontal"))},l.onDocumentPointerUp=()=>{const e=document.querySelector(".hs-layout-splitter-control.dragging");if(!e)return;const t=l.getInstance(e.closest("[data-hs-layout-splitter]"),!0);t&&t.element.controlPointerUp()},t.default=l},4343(e,t,i){"use strict";
|
|
92
|
+
const s=i(292),o=n(i(2961));class l extends o.default{constructor(e,t){var i;super(e,t);const n=e.getAttribute("data-hs-layout-splitter"),s=n?JSON.parse(n):{},o=Object.assign(Object.assign({},s),t);this.horizontalSplitterClasses=(null==o?void 0:o.horizontalSplitterClasses)||null,this.horizontalSplitterTemplate=(null==o?void 0:o.horizontalSplitterTemplate)||"<div></div>",this.verticalSplitterClasses=(null==o?void 0:o.verticalSplitterClasses)||null,this.verticalSplitterTemplate=(null==o?void 0:o.verticalSplitterTemplate)||"<div></div>",this.isSplittersAddedManually=null!==(i=null==o?void 0:o.isSplittersAddedManually)&&void 0!==i&&i,this.horizontalSplitters=[],this.horizontalControls=[],this.verticalSplitters=[],this.verticalControls=[],this.isDragging=!1,this.activeSplitter=null,this.onControlPointerDownListener=[],this.init()}controlPointerDown(e){this.isDragging=!0,this.activeSplitter=e,this.onPointerDownHandler(e)}controlPointerUp(){this.isDragging=!1,this.activeSplitter=null,this.onPointerUpHandler()}init(){l.ensureGlobalHandlers(),this.createCollection(window.$hsLayoutSplitterCollection,this),this.buildSplitters(),l.isListenersInitialized||(document.addEventListener("pointermove",l.onDocumentPointerMove),document.addEventListener("pointerup",l.onDocumentPointerUp),l.isListenersInitialized=!0)}buildSplitters(){this.buildHorizontalSplitters(),this.buildVerticalSplitters()}buildHorizontalSplitters(){const e=this.el.querySelectorAll("[data-hs-layout-splitter-horizontal-group]");e.length&&(e.forEach(e=>{this.horizontalSplitters.push({el:e,items:Array.from(e.querySelectorAll(":scope > [data-hs-layout-splitter-item]"))})}),this.updateHorizontalSplitter())}buildVerticalSplitters(){const e=this.el.querySelectorAll("[data-hs-layout-splitter-vertical-group]");e.length&&(e.forEach(e=>{this.verticalSplitters.push({el:e,items:Array.from(e.querySelectorAll(":scope > [data-hs-layout-splitter-item]"))})}),this.updateVerticalSplitter())}buildControl(e,t,i="horizontal"){let n;if(this.isSplittersAddedManually){if(n=null==t?void 0:t.previousElementSibling,!n)return!1;n.style.display=""}else n=(0,s.htmlToElement)("horizontal"===i?this.horizontalSplitterTemplate:this.verticalSplitterTemplate),(0,s.classToClassList)("horizontal"===i?this.horizontalSplitterClasses:this.verticalSplitterClasses,n),n.classList.add("hs-layout-splitter-control");const o={el:n,direction:i,prev:e,next:t};"horizontal"===i?this.horizontalControls.push(o):this.verticalControls.push(o),this.bindListeners(o),t&&!this.isSplittersAddedManually&&e.insertAdjacentElement("afterend",n)}getSplitterItemParsedParam(e){const t=e.getAttribute("data-hs-layout-splitter-item");return(0,s.isJson)(t)?JSON.parse(t):t}getContainerSize(e,t){return t?e.getBoundingClientRect().width:e.getBoundingClientRect().height}getMaxFlexSize(e,t,i){const n=this.getSplitterItemSingleParam(e,t);return"number"==typeof n?n/100*i:0}updateHorizontalSplitter(){this.horizontalSplitters.forEach(({items:e})=>{e.forEach(e=>{this.updateSingleSplitter(e)}),e.forEach((t,i)=>{i>=e.length-1?this.buildControl(t,null):this.buildControl(t,e[i+1])})})}updateSingleSplitter(e){const t=e.getAttribute("data-hs-layout-splitter-item"),i=(0,s.isJson)(t)?JSON.parse(t):t,n=(0,s.isJson)(t)?i.dynamicSize:t;e.style.flex=`${n} 1 0`}updateVerticalSplitter(){this.verticalSplitters.forEach(({items:e})=>{e.forEach(e=>{this.updateSingleSplitter(e)}),e.forEach((t,i)=>{i>=e.length-1?this.buildControl(t,null,"vertical"):this.buildControl(t,e[i+1],"vertical")})})}updateSplitterItemParam(e,t){const i=this.getSplitterItemParsedParam(e),n=t.toFixed(1),s="object"==typeof i?JSON.stringify(Object.assign(Object.assign({},i),{dynamicSize:+n})):n;e.setAttribute("data-hs-layout-splitter-item",s)}onPointerDownHandler(e){const{el:t,prev:i,next:n}=e;t.classList.add("dragging"),i.classList.add("dragging"),n.classList.add("dragging"),document.body.style.userSelect="none"}onPointerUpHandler(){document.body.style.userSelect=""}onPointerMoveHandler(e,t,i){const{prev:n,next:s}=t,o=t.el.closest("horizontal"===i?"[data-hs-layout-splitter-horizontal-group]":"[data-hs-layout-splitter-vertical-group]"),l="horizontal"===i,r=this.getContainerSize(o,l),a=this.calculateAvailableSize(o,n,s,l,r),d=this.calculateResizedSizes(e,n,a,l),c=this.enforceLimits(d,n,s,r,a);this.applySizes(n,s,c,r)}bindListeners(e){const{el:t}=e;this.onControlPointerDownListener.push({el:t,fn:()=>this.controlPointerDown(e)}),t.addEventListener("pointerdown",this.onControlPointerDownListener.find(e=>e.el===t).fn)}calculateAvailableSize(e,t,i,n,s){const o=e.querySelectorAll(":scope > [data-hs-layout-splitter-item]");return s-Array.from(o).reduce((e,s)=>{if(s===t||s===i)return e;const o=s.getBoundingClientRect();return e+("fixed"===window.getComputedStyle(s).position?0:n?o.width:o.height)},0)}calculateResizedSizes(e,t,i,n){const s=n?t.getBoundingClientRect().left:t.getBoundingClientRect().top;let o=Math.max(0,Math.min((n?e.clientX:e.clientY)-s,i));return{previousSize:o,nextSize:i-o}}enforceLimits(e,t,i,n,o){const l=this.getMaxFlexSize(t,"minSize",n),r=this.getMaxFlexSize(i,"minSize",n),a=this.getMaxFlexSize(t,"preLimitSize",n),d=this.getMaxFlexSize(i,"preLimitSize",n);let{previousSize:c,nextSize:h}=e;h<r?(h=r,c=o-h):c<l&&(c=l,h=o-c);const u={prev:t,next:i,previousSize:c.toFixed(),previousFlexSize:c/n*100,previousPreLimitSize:a,previousPreLimitFlexSize:a/n*100,previousMinSize:l,previousMinFlexSize:l/n*100,nextSize:h.toFixed(),nextFlexSize:h/n*100,nextPreLimitSize:d,nextPreLimitFlexSize:d/n*100,nextMinSize:r,nextMinFlexSize:r/n*100,static:{prev:{minSize:this.getSplitterItemSingleParam(t,"minSize"),preLimitSize:this.getSplitterItemSingleParam(t,"preLimitSize")},next:{minSize:this.getSplitterItemSingleParam(i,"minSize"),preLimitSize:this.getSplitterItemSingleParam(i,"preLimitSize")}}};return h<r?(this.fireEvent("onNextLimit",u),(0,s.dispatch)("onNextLimit.hs.layoutSplitter",this.el,u)):c<l&&(this.fireEvent("onPrevLimit",u),(0,s.dispatch)("onPrevLimit.hs.layoutSplitter",this.el,u)),c<=a&&(this.fireEvent("onPrevPreLimit",u),(0,s.dispatch)("onPrevPreLimit.hs.layoutSplitter",this.el,u)),h<=d&&(this.fireEvent("onNextPreLimit",u),(0,s.dispatch)("onNextPreLimit.hs.layoutSplitter",this.el,u)),this.fireEvent("drag",u),(0,s.dispatch)("drag.hs.layoutSplitter",this.el,u),{previousSize:c,nextSize:h}}applySizes(e,t,i,n){const{previousSize:s,nextSize:o}=i,l=s/n*100;this.updateSplitterItemParam(e,l),e.style.flex=`${l.toFixed(1)} 1 0`;const r=o/n*100;this.updateSplitterItemParam(t,r),t.style.flex=`${r.toFixed(1)} 1 0`}getSplitterItemSingleParam(e,t){try{return this.getSplitterItemParsedParam(e)[t]}catch(e){return console.log("There is no parameter with this name in the object."),!1}}getData(e){var t,i;const n=e.closest("[data-hs-layout-splitter-horizontal-group], [data-hs-layout-splitter-vertical-group]");if(!n)throw new Error("Element is not inside a valid layout splitter container.");const s=n.matches("[data-hs-layout-splitter-horizontal-group]"),o=this.getContainerSize(n,s),l=this.getSplitterItemSingleParam(e,"dynamicSize")||0,r=this.getMaxFlexSize(e,"minSize",o),a=this.getMaxFlexSize(e,"preLimitSize",o),d=r/o*100,c=a/o*100;return{el:e,dynamicSize:+(l/100*o).toFixed(),dynamicFlexSize:l,minSize:+r.toFixed(),minFlexSize:d,preLimitSize:+a.toFixed(),preLimitFlexSize:c,static:{minSize:null!==(t=this.getSplitterItemSingleParam(e,"minSize"))&&void 0!==t?t:null,preLimitSize:null!==(i=this.getSplitterItemSingleParam(e,"preLimitSize"))&&void 0!==i?i:null}}}setSplitterItemSize(e,t){this.updateSplitterItemParam(e,t),e.style.flex=`${t.toFixed(1)} 1 0`}updateFlexValues(e){let t=0;const i=window.innerWidth;if(e.forEach(({id:e,breakpoints:n})=>{const s=document.getElementById(e);if(s){const e=(e=>{const t=Object.keys(e).map(Number).sort((e,t)=>e-t);for(let n=t.length-1;n>=0;n--)if(i>=t[n])return e[t[n]];return 0})(n);this.updateSplitterItemParam(s,e),s.style.flex=`${e.toFixed(1)} 1 0`,t+=e}}),100!==t){const i=100/t;e.forEach(({id:e})=>{const t=document.getElementById(e);if(t){const e=parseFloat(t.style.flex.split(" ")[0])*i;this.updateSplitterItemParam(t,e),t.style.flex=`${e.toFixed(1)} 1 0`}})}}destroy(){this.onControlPointerDownListener&&(this.onControlPointerDownListener.forEach(({el:e,fn:t})=>{e.removeEventListener("pointerdown",t)}),this.onControlPointerDownListener=null),this.horizontalSplitters.forEach(({items:e})=>{e.forEach(e=>{e.style.flex=""})}),this.verticalSplitters.forEach(({items:e})=>{e.forEach(e=>{e.style.flex=""})}),this.horizontalControls.forEach(({el:e})=>{this.isSplittersAddedManually?e.style.display="none":e.remove()}),this.verticalControls.forEach(({el:e})=>{this.isSplittersAddedManually?e.style.display="none":e.remove()}),this.horizontalControls=[],this.verticalControls=[],window.$hsLayoutSplitterCollection=window.$hsLayoutSplitterCollection.filter(({element:e})=>e.el!==this.el),0===window.$hsLayoutSplitterCollection.length&&l.isListenersInitialized&&(document.removeEventListener("pointermove",l.onDocumentPointerMove),document.removeEventListener("pointerup",l.onDocumentPointerUp),l.isListenersInitialized=!1)}static findInCollection(e){return window.$hsLayoutSplitterCollection.find(t=>e instanceof l?t.element.el===e.el:"string"==typeof e?t.element.el===document.querySelector(e):t.element.el===e)||null}static autoInit(){l.ensureGlobalHandlers(),window.$hsLayoutSplitterCollection&&(window.$hsLayoutSplitterCollection=window.$hsLayoutSplitterCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-layout-splitter]:not(.--prevent-on-load-init)").forEach(e=>{window.$hsLayoutSplitterCollection.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 ensureGlobalHandlers(){"undefined"!=typeof window&&(window.$hsLayoutSplitterCollection||(window.$hsLayoutSplitterCollection=[]),l.isWindowListenersInitialized||(l.isWindowListenersInitialized=!0,window.addEventListener("pointerup",()=>{if(!window.$hsLayoutSplitterCollection)return!1;const e=document.querySelector(".hs-layout-splitter-control.dragging"),t=document.querySelectorAll("[data-hs-layout-splitter-item].dragging");if(!e)return!1;const i=l.getInstance(e.closest("[data-hs-layout-splitter]"),!0);e.classList.remove("dragging"),t.forEach(e=>e.classList.remove("dragging")),i.element.isDragging=!1})))}static getInstance(e,t){const i=window.$hsLayoutSplitterCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e));return i?t?i:i.element.el:null}static on(e,t,i){const n=l.findInCollection(t);n&&(n.element.events[e]=i)}}l.isListenersInitialized=!1,l.isWindowListenersInitialized=!1,l.onDocumentPointerMove=e=>{const t=document.querySelector(".hs-layout-splitter-control.dragging");if(!t)return;const i=l.getInstance(t.closest("[data-hs-layout-splitter]"),!0);if(!i||!i.element.isDragging)return;const n=i.element.activeSplitter;n&&("vertical"===n.direction?i.element.onPointerMoveHandler(e,n,"vertical"):i.element.onPointerMoveHandler(e,n,"horizontal"))},l.onDocumentPointerUp=()=>{const e=document.querySelector(".hs-layout-splitter-control.dragging");if(!e)return;const t=l.getInstance(e.closest("[data-hs-layout-splitter]"),!0);t&&t.element.controlPointerUp()},t.default=l},4343(e,t,i){"use strict";
|
|
93
93
|
/*
|
|
94
94
|
* HSOverlay
|
|
95
|
-
* @version: 5.
|
|
95
|
+
* @version: 5.1.0
|
|
96
96
|
* @author: Preline Labs Ltd.
|
|
97
97
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
98
98
|
* Copyright 2024 Preline Labs Ltd.
|
|
99
|
-
*/var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(292),o=i(8223),l=s(i(2961)),r=s(i(248));class a extends l.default{constructor(e,t,i){var s,l,r,a,c,d,h;super(e,t,i),this.lastFocusedToggle=null,this.initialZIndex=0,window.$hsOverlayCollection||(window.$hsOverlayCollection=[]),this.toggleButtons=Array.from(document.querySelectorAll(`[data-hs-overlay="#${this.el.id}"]`));const u=this.collectToggleParameters(this.toggleButtons);this.toggleMinifierButtons=Array.from(document.querySelectorAll(`[data-hs-overlay-minifier="#${this.el.id}"]`));const p=e.getAttribute("data-hs-overlay-options"),m=p?JSON.parse(p):{},g=Object.assign(Object.assign(Object.assign({},m),u),t);this.hiddenClass=(null==g?void 0:g.hiddenClass)||"hidden",this.emulateScrollbarSpace=(null==g?void 0:g.emulateScrollbarSpace)||!1,this.isClosePrev=null===(s=null==g?void 0:g.isClosePrev)||void 0===s||s,this.backdropClasses=null!==(l=null==g?void 0:g.backdropClasses)&&void 0!==l?l:"hs-overlay-backdrop transition duration fixed inset-0 bg-gray-900/50 dark:bg-neutral-900/80",this.backdropParent="string"==typeof g.backdropParent?document.querySelector(g.backdropParent):document.body,this.backdropExtraClasses=null!==(r=null==g?void 0:g.backdropExtraClasses)&&void 0!==r?r:"",this.moveOverlayToBody=(null==g?void 0:g.moveOverlayToBody)||null,this.isToggleClassesImmediately=null!==(a=null==g?void 0:g.isToggleClassesImmediately)&&void 0!==a?a:(0,n.stringToBoolean)((0,n.getClassProperty)(this.el,"--toggle-classes-immediately","false")||"false"),this.openNextOverlay=!1,this.autoHide=null,this.initContainer=(null===(c=this.el)||void 0===c?void 0:c.parentElement)||null,this.isCloseWhenClickInside=(0,n.stringToBoolean)((0,n.getClassProperty)(this.el,"--close-when-click-inside","false")||"false"),this.isTabAccessibilityLimited=(0,n.stringToBoolean)((0,n.getClassProperty)(this.el,"--tab-accessibility-limited","true")||"true"),this.isLayoutAffect=(0,n.stringToBoolean)((0,n.getClassProperty)(this.el,"--is-layout-affect","false")||"false"),this.hasAutofocus=(0,n.stringToBoolean)((0,n.getClassProperty)(this.el,"--has-autofocus","true")||"true"),this.hasDynamicZIndex=(0,n.stringToBoolean)((0,n.getClassProperty)(this.el,"--has-dynamic-z-index","false")||"false"),this.hasAbilityToCloseOnBackdropClick=(0,n.stringToBoolean)(this.el.getAttribute("data-hs-overlay-keyboard")||"true"),this.isScrollInsideViewport="inside-viewport"===(0,n.getClassProperty)(this.el,"--overlay-scroll-behavior"),this.onScrollInsideViewportClickListener=null;const v=(0,n.getClassProperty)(this.el,"--auto-close"),f=(0,n.getClassProperty)(this.el,"--auto-close-equality-type"),y=(0,n.getClassProperty)(this.el,"--opened");this.autoClose=!isNaN(+v)&&isFinite(+v)?+v:o.BREAKPOINTS[v]||null,this.autoCloseEqualityType=null!==(d=f)&&void 0!==d?d:null,this.openedBreakpoint=(!isNaN(+y)&&isFinite(+y)?+y:o.BREAKPOINTS[y])||null,this.animationTarget=(null===(h=null==this?void 0:this.el)||void 0===h?void 0:h.querySelector(".hs-overlay-animation-target"))||this.el,this.initialZIndex=parseInt(getComputedStyle(this.el).zIndex,10),this.onElementClickListener=[],this.onElementMinifierClickListener=[],this.initiallyOpened=this.isOpened(),this.init()}elementClick(){const e=()=>{const e={el:this.el,isOpened:!!this.el.classList.contains("open")};this.fireEvent("toggleClicked",e),(0,n.dispatch)("toggleClicked.hs.overlay",this.el,e)};this.el.classList.contains("opened")?this.close(!1,e):this.open(e)}elementMinifierClick(){const e=()=>{const e={el:this.el,isMinified:!!this.el.classList.contains("minified")};this.fireEvent("toggleMinifierClicked",e),(0,n.dispatch)("toggleMinifierClicked.hs.overlay",this.el,e)};this.el.classList.contains("minified")?this.minify(!1,e):this.minify(!0,e)}minify(e,t=null){e?(this.el.classList.add("minified"),document.body.classList.add("hs-overlay-minified"),t&&t()):(this.el.classList.remove("minified"),document.body.classList.remove("hs-overlay-minified"),t&&t())}overlayClick(e){e.target.id&&e.target.id===this.el.id&&this.isCloseWhenClickInside&&this.hasAbilityToCloseOnBackdropClick&&this.close()}backdropClick(){this.close()}init(){if(this.createCollection(window.$hsOverlayCollection,this),this.isLayoutAffect&&this.openedBreakpoint){const e=a.getInstance(this.el,!0);a.setOpened(this.openedBreakpoint,e)}this.onOverlayClickListener=e=>this.overlayClick(e),this.el.addEventListener("click",this.onOverlayClickListener),this.toggleButtons.length&&this.buildToggleButtons(this.toggleButtons),this.toggleMinifierButtons.length&&this.buildToggleMinifierButtons(),"undefined"!=typeof window&&(window.HSAccessibilityObserver||(window.HSAccessibilityObserver=new r.default),this.setupAccessibility())}buildToggleButtons(e){e.forEach(e=>{this.el.classList.contains("opened")?e.ariaExpanded="true":e.ariaExpanded="false",this.onElementClickListener.push({el:e,fn:()=>this.elementClick()}),e.addEventListener("click",this.onElementClickListener.find(t=>t.el===e).fn)})}buildToggleMinifierButtons(){this.toggleMinifierButtons.forEach(e=>{this.el.classList.contains("minified")?e.ariaExpanded="true":e.ariaExpanded="false",this.onElementMinifierClickListener.push({el:e,fn:()=>this.elementMinifierClick()}),e.addEventListener("click",this.onElementMinifierClickListener.find(t=>t.el===e).fn)})}hideAuto(){const e=parseInt((0,n.getClassProperty)(this.el,"--auto-hide","0"));e&&(this.autoHide=setTimeout(()=>{this.close()},e))}checkTimer(){this.autoHide&&(clearTimeout(this.autoHide),this.autoHide=null)}buildBackdrop(){const e=this.el.classList.value.split(" "),t=parseInt(window.getComputedStyle(this.el).getPropertyValue("z-index")),i=this.el.getAttribute("data-hs-overlay-backdrop-container")||!1;this.backdrop=document.createElement("div");let s=`${this.backdropClasses} ${this.backdropExtraClasses}`;const o="static"!==(0,n.getClassProperty)(this.el,"--overlay-backdrop","true"),l="false"===(0,n.getClassProperty)(this.el,"--overlay-backdrop","true");this.backdrop.id=`${this.el.id}-backdrop`,"style"in this.backdrop&&(this.backdrop.style.zIndex=""+(t-1));for(const t of e)(t.startsWith("hs-overlay-backdrop-open:")||t.includes(":hs-overlay-backdrop-open:"))&&(s+=` ${t}`);l||(i&&(this.backdrop=document.querySelector(i).cloneNode(!0),this.backdrop.classList.remove("hidden"),s=`${this.backdrop.classList.toString()}`,this.backdrop.classList.value=""),o&&(this.onBackdropClickListener=()=>this.backdropClick(),this.backdrop.addEventListener("click",this.onBackdropClickListener,!0)),this.backdrop.setAttribute("data-hs-overlay-backdrop-template",""),this.backdropParent.appendChild(this.backdrop),setTimeout(()=>{this.backdrop.classList.value=s}))}destroyBackdrop(){const e=document.querySelector(`#${this.el.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,n.afterTransition)(e,()=>{e.remove()}))}focusElement(){const e=this.el.querySelector("[autofocus]");if(!e)return!1;e.focus()}getBodyCurrentScrollbarSize(){return Math.max(window.innerWidth-document.documentElement.clientWidth,0)}collectToggleParameters(e){let t={};return e.forEach(e=>{const i=e.getAttribute("data-hs-overlay-options"),s=i?JSON.parse(i):{};t=Object.assign(Object.assign({},t),s)}),t}isElementVisible(){const e=window.getComputedStyle(this.el);if("none"===e.display||"hidden"===e.visibility||"0"===e.opacity)return!1;const t=this.el.getBoundingClientRect();if(0===t.width||0===t.height)return!1;let i=this.el.parentElement;for(;i;){const e=window.getComputedStyle(i);if("none"===e.display||"hidden"===e.visibility||"0"===e.opacity)return!1;i=i.parentElement}return!0}isOpened(){return this.el.classList.contains("open")&&!this.el.classList.contains(this.hiddenClass)}open(e=null){window.$hsOverlayCollection||(window.$hsOverlayCollection=[]),this.el.classList.contains("minified")&&this.minify(!1),this.hasDynamicZIndex&&(a.currentZIndex<this.initialZIndex&&(a.currentZIndex=this.initialZIndex),a.currentZIndex++,this.el.style.zIndex=`${a.currentZIndex}`);const t=document.querySelectorAll(".hs-overlay.open"),i=window.$hsOverlayCollection.find(e=>Array.from(t).includes(e.element.el)&&!e.element.isLayoutAffect),s=document.querySelectorAll(`[data-hs-overlay="#${this.el.id}"]`),o="true"!==(0,n.getClassProperty)(this.el,"--body-scroll","false");if(this.lastFocusedToggle=document.activeElement,this.isClosePrev&&i)return this.openNextOverlay=!0,i.element.close().then(()=>{this.open(),this.openNextOverlay=!1});o&&(this.emulateScrollbarSpace&&(document.body.style.paddingRight=`${this.getBodyCurrentScrollbarSize()}px`),document.body.style.overflow="hidden"),this.buildBackdrop(),this.checkTimer(),this.hideAuto(),s.forEach(e=>{e.ariaExpanded&&(e.ariaExpanded="true")}),this.el.classList.remove(this.hiddenClass),this.el.setAttribute("aria-overlay","true"),this.el.setAttribute("tabindex","-1");const l=()=>{if(this.el.classList.contains("opened"))return!1;this.el.classList.add("open","opened"),this.isLayoutAffect&&document.body.classList.add("hs-overlay-body-open"),!this.initiallyOpened&&this.hasAutofocus&&(this.el.focus({preventScroll:!0}),this.el.style.outline="none"),this.initiallyOpened=!1,this.fireEvent("open",this.el),(0,n.dispatch)("open.hs.overlay",this.el,this.el),window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!0),this.hasAutofocus&&this.focusElement(),"function"==typeof e&&e(),this.isScrollInsideViewport&&(this.el.style.pointerEvents="auto",this.onScrollInsideViewportClickListener=e=>{e.target===this.el&&this.hasAbilityToCloseOnBackdropClick&&this.close()},this.el.addEventListener("click",this.onScrollInsideViewportClickListener)),this.isElementVisible()&&a.openedItemsQty++};this.isToggleClassesImmediately?l():setTimeout(l,50)}close(e=!1,t=null){window.$hsOverlayCollection||(window.$hsOverlayCollection=[]),this.isElementVisible()&&(a.openedItemsQty=a.openedItemsQty<=0?0:a.openedItemsQty-1),0===a.openedItemsQty&&this.isLayoutAffect&&document.body.classList.remove("hs-overlay-body-open");const i=e=>{if(this.el.classList.contains("open"))return!1;document.querySelectorAll(`[data-hs-overlay="#${this.el.id}"]`).forEach(e=>{e.ariaExpanded&&(e.ariaExpanded="false")}),this.el.classList.add(this.hiddenClass),this.hasDynamicZIndex&&(this.el.style.zIndex=""),this.destroyBackdrop(),this.fireEvent("close",this.el),(0,n.dispatch)("close.hs.overlay",this.el,this.el),window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!1);if(window.$hsOverlayCollection.some(e=>e.element.el.classList.contains("opened")&&!e.element.isLayoutAffect)||(document.body.style.overflow="",this.emulateScrollbarSpace&&(document.body.style.paddingRight="")),this.lastFocusedToggle&&(this.lastFocusedToggle.focus(),this.lastFocusedToggle=null),e(this.el),"function"==typeof t&&t(),0===a.openedItemsQty){if(!this.isLayoutAffect){window.$hsOverlayCollection.some(e=>e.element.isLayoutAffect&&e.element.el.classList.contains("opened"))||document.body.classList.remove("hs-overlay-body-open")}this.hasDynamicZIndex&&(a.currentZIndex=0)}};return new Promise(t=>{this.el.classList.remove("open","opened"),this.el.removeAttribute("aria-overlay"),this.el.removeAttribute("tabindex"),this.el.style.outline="",this.isScrollInsideViewport&&(this.el.style.pointerEvents="",this.onScrollInsideViewportClickListener&&(this.el.removeEventListener("click",this.onScrollInsideViewportClickListener),this.onScrollInsideViewportClickListener=null)),e||this.isToggleClassesImmediately?i(t):(0,n.afterTransition)(this.animationTarget,()=>i(t))})}updateToggles(){const e=Array.from(document.querySelectorAll(`[data-hs-overlay="#${this.el.id}"]`)).filter(e=>!this.toggleButtons.includes(e));e.length&&(this.toggleButtons.push(...e),this.buildToggleButtons(e)),this.toggleButtons=this.toggleButtons.filter(e=>{var t;if(document.contains(e))return!0;const i=null===(t=this.onElementClickListener)||void 0===t?void 0:t.find(t=>t.el===e);return i&&e.removeEventListener("click",i.fn),!1})}destroy(){window.$hsOverlayCollection&&(this.el.classList.remove("open","opened",this.hiddenClass),this.isLayoutAffect&&document.body.classList.remove("hs-overlay-body-open"),this.el.removeEventListener("click",this.onOverlayClickListener),this.onElementClickListener.length&&(this.onElementClickListener.forEach(({el:e,fn:t})=>{e.removeEventListener("click",t)}),this.onElementClickListener=null),this.backdrop&&this.backdrop.removeEventListener("click",this.onBackdropClickListener),this.backdrop&&(this.backdrop.remove(),this.backdrop=null),this.onScrollInsideViewportClickListener&&(this.el.removeEventListener("click",this.onScrollInsideViewportClickListener),this.onScrollInsideViewportClickListener=null),window.$hsOverlayCollection=window.$hsOverlayCollection.filter(({element:e})=>e.el!==this.el))}static findInCollection(e){return window.$hsOverlayCollection&&window.$hsOverlayCollection.find(t=>e instanceof a?t.element.el===e.el:"string"==typeof e?t.element.el===document.querySelector(e):t.element.el===e)||null}static getInstance(e,t){const i="string"==typeof e?document.querySelector(e):e,s=(null==i?void 0:i.getAttribute("data-hs-overlay"))?i.getAttribute("data-hs-overlay"):e,n=window.$hsOverlayCollection.find(e=>e.element.el===("string"==typeof s?document.querySelector(s):s)||e.element.el===("string"==typeof s?document.querySelector(s):s));return n?t?n:n.element.el:null}static autoInit(){window.$hsOverlayCollection||(window.$hsOverlayCollection=[]),window.$hsOverlayCollection&&(window.$hsOverlayCollection=window.$hsOverlayCollection.filter(({element:e})=>document.contains(e.el))),a.openedItemsQty=window.$hsOverlayCollection.filter(({element:e})=>e.el.classList.contains("opened")).length,document.querySelectorAll(".hs-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 a(e)}),window.$hsOverlayCollection.forEach(({element:e})=>{e.updateToggles()})}static open(e){const t=a.findInCollection(e);t&&t.element.el.classList.contains(t.element.hiddenClass)&&t.element.open()}static close(e){const t=a.findInCollection(e);t&&!t.element.el.classList.contains(t.element.hiddenClass)&&t.element.close()}static minify(e,t){const i=a.findInCollection(e);i&&i.element.minify(t)}static setOpened(e,t){document.body.clientWidth>=e?(t.element.el.classList.contains("minified")&&t.element.minify(!1),document.body.classList.add("hs-overlay-body-open"),t.element.open()):t.element.close(!0)}moveFocusWithinOverlay(e,t){if(!this.isOpened()||!this.isTabAccessibilityLimited)return;const i=Array.from(this.el.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(e=>!e.hidden&&"none"!==window.getComputedStyle(e).display);if(0===i.length)return;const s=this.el.querySelector(":focus"),n=s?i.indexOf(s):-1;"prev"===t?n<=0?i[i.length-1].focus():i[n-1].focus():n===i.length-1?i[0].focus():i[n+1].focus(),e.preventDefault()}setupAccessibility(){this.accessibilityComponent=window.HSAccessibilityObserver.registerComponent(this.el,{onEnter:()=>{this.isOpened()||this.open()},onEsc:()=>{this.isOpened()&&this.hasAbilityToCloseOnBackdropClick&&this.close()},onTab:e=>this.moveFocusWithinOverlay(e,"next"),onShiftTab:e=>this.moveFocusWithinOverlay(e,"prev")},this.isOpened(),"Overlay",".hs-overlay"),this.toggleButtons.forEach(e=>{window.HSAccessibilityObserver.registerComponent(e,{onEnter:()=>{this.isOpened()?this.close():this.open()},onEsc:()=>{this.isOpened()&&this.hasAbilityToCloseOnBackdropClick&&this.close()}},this.isOpened(),"Overlay Toggle",`[data-hs-overlay="#${this.el.id}"]`)})}static on(e,t,i){const s=a.findInCollection(t);s&&(s.element.events[e]=i)}}a.openedItemsQty=0,a.currentZIndex=0,t.default=a},4061(e,t,i){"use strict";
|
|
99
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=i(8223),l=n(i(2961)),r=n(i(248));class a extends l.default{constructor(e,t,i){var n,l,r,a,d,c,h;super(e,t,i),this.lastFocusedToggle=null,this.initialZIndex=0,window.$hsOverlayCollection||(window.$hsOverlayCollection=[]),this.toggleButtons=Array.from(document.querySelectorAll(`[data-hs-overlay="#${this.el.id}"]`));const u=this.collectToggleParameters(this.toggleButtons);this.toggleMinifierButtons=Array.from(document.querySelectorAll(`[data-hs-overlay-minifier="#${this.el.id}"]`));const p=e.getAttribute("data-hs-overlay-options"),m=p?JSON.parse(p):{},g=Object.assign(Object.assign(Object.assign({},m),u),t);this.hiddenClass=(null==g?void 0:g.hiddenClass)||"hidden",this.emulateScrollbarSpace=(null==g?void 0:g.emulateScrollbarSpace)||!1,this.isClosePrev=null===(n=null==g?void 0:g.isClosePrev)||void 0===n||n,this.backdropClasses=null!==(l=null==g?void 0:g.backdropClasses)&&void 0!==l?l:"hs-overlay-backdrop transition duration fixed inset-0 bg-gray-900/50 dark:bg-neutral-900/80",this.backdropParent="string"==typeof g.backdropParent?document.querySelector(g.backdropParent):document.body,this.backdropExtraClasses=null!==(r=null==g?void 0:g.backdropExtraClasses)&&void 0!==r?r:"",this.moveOverlayToBody=(null==g?void 0:g.moveOverlayToBody)||null,this.isToggleClassesImmediately=null!==(a=null==g?void 0:g.isToggleClassesImmediately)&&void 0!==a?a:(0,s.stringToBoolean)((0,s.getClassProperty)(this.el,"--toggle-classes-immediately","false")||"false"),this.openNextOverlay=!1,this.autoHide=null,this.initContainer=(null===(d=this.el)||void 0===d?void 0:d.parentElement)||null,this.isCloseWhenClickInside=(0,s.stringToBoolean)((0,s.getClassProperty)(this.el,"--close-when-click-inside","false")||"false"),this.isTabAccessibilityLimited=(0,s.stringToBoolean)((0,s.getClassProperty)(this.el,"--tab-accessibility-limited","true")||"true"),this.isLayoutAffect=(0,s.stringToBoolean)((0,s.getClassProperty)(this.el,"--is-layout-affect","false")||"false"),this.hasAutofocus=(0,s.stringToBoolean)((0,s.getClassProperty)(this.el,"--has-autofocus","true")||"true"),this.hasDynamicZIndex=(0,s.stringToBoolean)((0,s.getClassProperty)(this.el,"--has-dynamic-z-index","false")||"false"),this.hasAbilityToCloseOnBackdropClick=(0,s.stringToBoolean)(this.el.getAttribute("data-hs-overlay-keyboard")||"true"),this.isScrollInsideViewport="inside-viewport"===(0,s.getClassProperty)(this.el,"--overlay-scroll-behavior"),this.onScrollInsideViewportClickListener=null;const v=(0,s.getClassProperty)(this.el,"--auto-close"),f=(0,s.getClassProperty)(this.el,"--auto-close-equality-type"),y=(0,s.getClassProperty)(this.el,"--opened");this.autoClose=!isNaN(+v)&&isFinite(+v)?+v:o.BREAKPOINTS[v]||null,this.autoCloseEqualityType=null!==(c=f)&&void 0!==c?c:null,this.openedBreakpoint=(!isNaN(+y)&&isFinite(+y)?+y:o.BREAKPOINTS[y])||null,this.animationTarget=(null===(h=null==this?void 0:this.el)||void 0===h?void 0:h.querySelector(".hs-overlay-animation-target"))||this.el,this.initialZIndex=parseInt(getComputedStyle(this.el).zIndex,10),this.onElementClickListener=[],this.onElementMinifierClickListener=[],this.initiallyOpened=this.isOpened(),this.init()}elementClick(){const e=()=>{const e={el:this.el,isOpened:!!this.el.classList.contains("open")};this.fireEvent("toggleClicked",e),(0,s.dispatch)("toggleClicked.hs.overlay",this.el,e)};this.el.classList.contains("opened")?this.close(!1,e):this.open(e)}elementMinifierClick(){const e=()=>{const e={el:this.el,isMinified:!!this.el.classList.contains("minified")};this.fireEvent("toggleMinifierClicked",e),(0,s.dispatch)("toggleMinifierClicked.hs.overlay",this.el,e)};this.el.classList.contains("minified")?this.minify(!1,e):this.minify(!0,e)}minify(e,t=null){e?(this.el.classList.add("minified"),document.body.classList.add("hs-overlay-minified"),t&&t()):(this.el.classList.remove("minified"),document.body.classList.remove("hs-overlay-minified"),t&&t())}overlayClick(e){e.target.id&&e.target.id===this.el.id&&this.isCloseWhenClickInside&&this.hasAbilityToCloseOnBackdropClick&&this.close()}backdropClick(){this.close()}init(){if(this.createCollection(window.$hsOverlayCollection,this),this.isLayoutAffect&&this.openedBreakpoint){const e=a.getInstance(this.el,!0);a.setOpened(this.openedBreakpoint,e)}this.onOverlayClickListener=e=>this.overlayClick(e),this.el.addEventListener("click",this.onOverlayClickListener),this.toggleButtons.length&&this.buildToggleButtons(this.toggleButtons),this.toggleMinifierButtons.length&&this.buildToggleMinifierButtons(),"undefined"!=typeof window&&(window.HSAccessibilityObserver||(window.HSAccessibilityObserver=new r.default),this.setupAccessibility())}buildToggleButtons(e){e.forEach(e=>{this.el.classList.contains("opened")?e.ariaExpanded="true":e.ariaExpanded="false",this.onElementClickListener.push({el:e,fn:()=>this.elementClick()}),e.addEventListener("click",this.onElementClickListener.find(t=>t.el===e).fn)})}buildToggleMinifierButtons(){this.toggleMinifierButtons.forEach(e=>{this.el.classList.contains("minified")?e.ariaExpanded="true":e.ariaExpanded="false",this.onElementMinifierClickListener.push({el:e,fn:()=>this.elementMinifierClick()}),e.addEventListener("click",this.onElementMinifierClickListener.find(t=>t.el===e).fn)})}hideAuto(){const e=parseInt((0,s.getClassProperty)(this.el,"--auto-hide","0"));e&&(this.autoHide=setTimeout(()=>{this.close()},e))}checkTimer(){this.autoHide&&(clearTimeout(this.autoHide),this.autoHide=null)}buildBackdrop(){const e=this.el.classList.value.split(" "),t=parseInt(window.getComputedStyle(this.el).getPropertyValue("z-index")),i=this.el.getAttribute("data-hs-overlay-backdrop-container")||!1;this.backdrop=document.createElement("div");let n=`${this.backdropClasses} ${this.backdropExtraClasses}`;const o="static"!==(0,s.getClassProperty)(this.el,"--overlay-backdrop","true"),l="false"===(0,s.getClassProperty)(this.el,"--overlay-backdrop","true");this.backdrop.id=`${this.el.id}-backdrop`,"style"in this.backdrop&&(this.backdrop.style.zIndex=""+(t-1));for(const t of e)(t.startsWith("hs-overlay-backdrop-open:")||t.includes(":hs-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-hs-overlay-backdrop-template",""),this.backdropParent.appendChild(this.backdrop),setTimeout(()=>{this.backdrop.classList.value=n}))}destroyBackdrop(){const e=document.querySelector(`#${this.el.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.afterTransition)(e,()=>{e.remove()}))}focusElement(){const e=this.el.querySelector("[autofocus]");if(!e)return!1;e.focus()}getBodyCurrentScrollbarSize(){return Math.max(window.innerWidth-document.documentElement.clientWidth,0)}collectToggleParameters(e){let t={};return e.forEach(e=>{const i=e.getAttribute("data-hs-overlay-options"),n=i?JSON.parse(i):{};t=Object.assign(Object.assign({},t),n)}),t}isElementVisible(){const e=window.getComputedStyle(this.el);if("none"===e.display||"hidden"===e.visibility||"0"===e.opacity)return!1;const t=this.el.getBoundingClientRect();if(0===t.width||0===t.height)return!1;let i=this.el.parentElement;for(;i;){const e=window.getComputedStyle(i);if("none"===e.display||"hidden"===e.visibility||"0"===e.opacity)return!1;i=i.parentElement}return!0}isOpened(){return this.el.classList.contains("open")&&!this.el.classList.contains(this.hiddenClass)}open(e=null){window.$hsOverlayCollection||(window.$hsOverlayCollection=[]),this.el.classList.contains("minified")&&this.minify(!1),this.hasDynamicZIndex&&(a.currentZIndex<this.initialZIndex&&(a.currentZIndex=this.initialZIndex),a.currentZIndex++,this.el.style.zIndex=`${a.currentZIndex}`);const t=document.querySelectorAll(".hs-overlay.open"),i=window.$hsOverlayCollection.find(e=>Array.from(t).includes(e.element.el)&&!e.element.isLayoutAffect),n=document.querySelectorAll(`[data-hs-overlay="#${this.el.id}"]`),o="true"!==(0,s.getClassProperty)(this.el,"--body-scroll","false");if(this.lastFocusedToggle=document.activeElement,this.isClosePrev&&i)return this.openNextOverlay=!0,i.element.close().then(()=>{this.open(),this.openNextOverlay=!1});o&&(this.emulateScrollbarSpace&&(document.body.style.paddingRight=`${this.getBodyCurrentScrollbarSize()}px`),document.body.style.overflow="hidden"),this.buildBackdrop(),this.checkTimer(),this.hideAuto(),n.forEach(e=>{e.ariaExpanded&&(e.ariaExpanded="true")}),this.el.classList.remove(this.hiddenClass),this.el.setAttribute("aria-overlay","true"),this.el.setAttribute("tabindex","-1");const l=()=>{if(this.el.classList.contains("opened"))return!1;this.el.classList.add("open","opened"),this.isLayoutAffect&&document.body.classList.add("hs-overlay-body-open"),!this.initiallyOpened&&this.hasAutofocus&&(this.el.focus({preventScroll:!0}),this.el.style.outline="none"),this.initiallyOpened=!1,this.fireEvent("open",this.el),(0,s.dispatch)("open.hs.overlay",this.el,this.el),window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!0),this.hasAutofocus&&this.focusElement(),"function"==typeof e&&e(),this.isScrollInsideViewport&&(this.el.style.pointerEvents="auto",this.onScrollInsideViewportClickListener=e=>{e.target===this.el&&this.hasAbilityToCloseOnBackdropClick&&this.close()},this.el.addEventListener("click",this.onScrollInsideViewportClickListener)),this.isElementVisible()&&a.openedItemsQty++};this.isToggleClassesImmediately?l():setTimeout(l,50)}close(e=!1,t=null){window.$hsOverlayCollection||(window.$hsOverlayCollection=[]),this.isElementVisible()&&(a.openedItemsQty=a.openedItemsQty<=0?0:a.openedItemsQty-1),0===a.openedItemsQty&&this.isLayoutAffect&&document.body.classList.remove("hs-overlay-body-open");const i=e=>{if(this.el.classList.contains("open"))return!1;document.querySelectorAll(`[data-hs-overlay="#${this.el.id}"]`).forEach(e=>{e.ariaExpanded&&(e.ariaExpanded="false")}),this.el.classList.add(this.hiddenClass),this.hasDynamicZIndex&&(this.el.style.zIndex=""),this.destroyBackdrop(),this.fireEvent("close",this.el),(0,s.dispatch)("close.hs.overlay",this.el,this.el),window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!1);if(window.$hsOverlayCollection.some(e=>e.element.el.classList.contains("opened")&&!e.element.isLayoutAffect)||(document.body.style.overflow="",this.emulateScrollbarSpace&&(document.body.style.paddingRight="")),this.lastFocusedToggle&&(this.lastFocusedToggle.focus(),this.lastFocusedToggle=null),e(this.el),"function"==typeof t&&t(),0===a.openedItemsQty){if(!this.isLayoutAffect){window.$hsOverlayCollection.some(e=>e.element.isLayoutAffect&&e.element.el.classList.contains("opened"))||document.body.classList.remove("hs-overlay-body-open")}this.hasDynamicZIndex&&(a.currentZIndex=0)}};return new Promise(t=>{this.el.classList.remove("open","opened"),this.el.removeAttribute("aria-overlay"),this.el.removeAttribute("tabindex"),this.el.style.outline="",this.isScrollInsideViewport&&(this.el.style.pointerEvents="",this.onScrollInsideViewportClickListener&&(this.el.removeEventListener("click",this.onScrollInsideViewportClickListener),this.onScrollInsideViewportClickListener=null)),e||this.isToggleClassesImmediately?i(t):(0,s.afterTransition)(this.animationTarget,()=>i(t))})}updateToggles(){const e=Array.from(document.querySelectorAll(`[data-hs-overlay="#${this.el.id}"]`)).filter(e=>!this.toggleButtons.includes(e));e.length&&(this.toggleButtons.push(...e),this.buildToggleButtons(e)),this.toggleButtons=this.toggleButtons.filter(e=>{var t;if(document.contains(e))return!0;const i=null===(t=this.onElementClickListener)||void 0===t?void 0:t.find(t=>t.el===e);return i&&e.removeEventListener("click",i.fn),!1})}destroy(){window.$hsOverlayCollection&&(this.el.classList.remove("open","opened",this.hiddenClass),this.isLayoutAffect&&document.body.classList.remove("hs-overlay-body-open"),this.el.removeEventListener("click",this.onOverlayClickListener),this.onElementClickListener.length&&(this.onElementClickListener.forEach(({el:e,fn:t})=>{e.removeEventListener("click",t)}),this.onElementClickListener=null),this.backdrop&&this.backdrop.removeEventListener("click",this.onBackdropClickListener),this.backdrop&&(this.backdrop.remove(),this.backdrop=null),this.onScrollInsideViewportClickListener&&(this.el.removeEventListener("click",this.onScrollInsideViewportClickListener),this.onScrollInsideViewportClickListener=null),window.$hsOverlayCollection=window.$hsOverlayCollection.filter(({element:e})=>e.el!==this.el))}static findInCollection(e){return window.$hsOverlayCollection&&window.$hsOverlayCollection.find(t=>e instanceof a?t.element.el===e.el:"string"==typeof e?t.element.el===document.querySelector(e):t.element.el===e)||null}static getInstance(e,t){const i="string"==typeof e?document.querySelector(e):e,n=(null==i?void 0:i.getAttribute("data-hs-overlay"))?i.getAttribute("data-hs-overlay"):e,s=window.$hsOverlayCollection.find(e=>e.element.el===("string"==typeof n?document.querySelector(n):n)||e.element.el===("string"==typeof n?document.querySelector(n):n));return s?t?s:s.element.el:null}static autoInit(){window.$hsOverlayCollection||(window.$hsOverlayCollection=[]),window.$hsOverlayCollection&&(window.$hsOverlayCollection=window.$hsOverlayCollection.filter(({element:e})=>document.contains(e.el))),a.openedItemsQty=window.$hsOverlayCollection.filter(({element:e})=>e.el.classList.contains("opened")).length,document.querySelectorAll(".hs-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 a(e)}),window.$hsOverlayCollection.forEach(({element:e})=>{e.updateToggles()})}static open(e){const t=a.findInCollection(e);t&&t.element.el.classList.contains(t.element.hiddenClass)&&t.element.open()}static close(e){const t=a.findInCollection(e);t&&!t.element.el.classList.contains(t.element.hiddenClass)&&t.element.close()}static minify(e,t){const i=a.findInCollection(e);i&&i.element.minify(t)}static setOpened(e,t){document.body.clientWidth>=e?(t.element.el.classList.contains("minified")&&t.element.minify(!1),document.body.classList.add("hs-overlay-body-open"),t.element.open()):t.element.close(!0)}moveFocusWithinOverlay(e,t){if(!this.isOpened()||!this.isTabAccessibilityLimited)return;const i=Array.from(this.el.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(e=>!e.hidden&&"none"!==window.getComputedStyle(e).display);if(0===i.length)return;const n=this.el.querySelector(":focus"),s=n?i.indexOf(n):-1;"prev"===t?s<=0?i[i.length-1].focus():i[s-1].focus():s===i.length-1?i[0].focus():i[s+1].focus(),e.preventDefault()}setupAccessibility(){this.accessibilityComponent=window.HSAccessibilityObserver.registerComponent(this.el,{onEnter:()=>{this.isOpened()||this.open()},onEsc:()=>{this.isOpened()&&this.hasAbilityToCloseOnBackdropClick&&this.close()},onTab:e=>this.moveFocusWithinOverlay(e,"next"),onShiftTab:e=>this.moveFocusWithinOverlay(e,"prev")},this.isOpened(),"Overlay",".hs-overlay"),this.accessibilityComponent.onEnterSelfOnly=!0,this.toggleButtons.forEach(e=>{window.HSAccessibilityObserver.registerComponent(e,{onEnter:()=>{this.isOpened()?this.close():this.open()},onEsc:()=>{this.isOpened()&&this.hasAbilityToCloseOnBackdropClick&&this.close()}},this.isOpened(),"Overlay Toggle",`[data-hs-overlay="#${this.el.id}"]`)})}static on(e,t,i){const n=a.findInCollection(t);n&&(n.element.events[e]=i)}}a.openedItemsQty=0,a.currentZIndex=0,t.default=a},4061(e,t,i){"use strict";
|
|
100
100
|
/*
|
|
101
101
|
* HSPinInput
|
|
102
|
-
* @version: 5.
|
|
102
|
+
* @version: 5.1.0
|
|
103
103
|
* @author: Preline Labs Ltd.
|
|
104
104
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
105
105
|
* Copyright 2024 Preline Labs Ltd.
|
|
106
|
-
*/var
|
|
106
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=n(i(2961));class l extends o.default{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-hs-pin-input"),n=i?JSON.parse(i):{},s=Object.assign(Object.assign({},n),t);this.items=this.el.querySelectorAll("[data-hs-pin-input-item]"),this.currentItem=null,this.currentValue=new Array(this.items.length).fill(""),this.placeholders=[],this.availableCharsRE=new RegExp((null==s?void 0:s.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(t<this.items.length-1&&this.items[t+1].focus(),!this.currentValue.includes("")){const e={currentValue:this.currentValue};this.fireEvent("completed",e),(0,s.dispatch)("completed.hs.pinInput",this.el,e)}this.toggleCompleted()}else t>0&&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-hs-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 l(e)})}}t.default=l},4808(e,t,i){"use strict";
|
|
107
107
|
/*
|
|
108
108
|
* HSRangeSlider
|
|
109
|
-
* @version: 5.
|
|
109
|
+
* @version: 5.1.0
|
|
110
110
|
* @author: Preline Labs Ltd.
|
|
111
111
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
112
112
|
* Copyright 2024 Preline Labs Ltd.
|
|
113
|
-
*/var
|
|
113
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=n(i(2961));class o extends s.default{constructor(e,t,i){var n;if(super(e,t||{},i),!o.isAvailable())throw new Error(o.unavailableMessage);const s=e.getAttribute("data-hs-range-slider"),l=s?JSON.parse(s):{};this.concatOptions=Object.assign(Object.assign(Object.assign({},l),t),{cssClasses:Object.assign(Object.assign({},noUiSlider.cssClasses),this.processClasses(l.cssClasses))}),this.wrapper=this.concatOptions.wrapper||e.closest(".hs-range-slider-wrapper")||null,this.currentValue=this.concatOptions.currentValue?Array.from(this.concatOptions.currentValue):Array.from((null===(n=this.wrapper)||void 0===n?void 0:n.querySelectorAll(".hs-range-slider-current-value"))||[]),this.icons=this.concatOptions.icons||{},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,n,s,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===(n=this.concatOptions)||void 0===n?void 0:n.formatter))?this.thousandsSeparatorAndDecimalPointsFormatter():("object"==typeof(null===(s=this.concatOptions)||void 0===s?void 0:s.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.currentValue&&this.currentValue.length>0&&this.el.noUiSlider.on("update",e=>{this.updateCurrentValue(e)}),this.concatOptions.disabled&&this.setDisabled(),this.icons.handle&&this.buildHandleIcon()}formatValue(e){var t,i,n,s,o,l,r,a,d;let c="";return"object"==typeof(null===(t=this.concatOptions)||void 0===t?void 0:t.formatter)?((null===(n=null===(i=this.concatOptions)||void 0===i?void 0:i.formatter)||void 0===n?void 0:n.prefix)&&(c+=null===(o=null===(s=this.concatOptions)||void 0===s?void 0:s.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")}buildHandleIcon(){if(!this.icons.handle)return!1;const e=this.el.querySelector(".noUi-handle");if(!e)return!1;e.innerHTML=this.icons.handle}updateCurrentValue(e){this.currentValue&&0!==this.currentValue.length&&e.forEach((e,t)=>{var i;const n=null===(i=this.currentValue)||void 0===i?void 0:i[t];if(!n)return;const s=this.format?this.format.to(e).toString():e.toString();n instanceof HTMLInputElement?n.value=s:n.textContent=s})}destroy(){this.el.noUiSlider.destroy(),this.format=null,window.$hsRangeSliderCollection=window.$hsRangeSliderCollection.filter(({element:e})=>e.el!==this.el)}static isAvailable(){return"undefined"!=typeof noUiSlider}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(){const e="[data-hs-range-slider]:not(.--prevent-on-load-init)";o.isAvailable()?(window.$hsRangeSliderCollection||(window.$hsRangeSliderCollection=[]),window.$hsRangeSliderCollection&&(window.$hsRangeSliderCollection=window.$hsRangeSliderCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll(e).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 o(e)})):document.querySelectorAll(e).length&&console.error(o.unavailableMessage)}}o.unavailableMessage="HSRangeSlider: noUiSlider is not available, please add it to the page.",t.default=o},1148(e,t,i){"use strict";
|
|
114
114
|
/*
|
|
115
115
|
* HSRemoveElement
|
|
116
|
-
* @version: 5.
|
|
116
|
+
* @version: 5.1.0
|
|
117
117
|
* @author: Preline Labs Ltd.
|
|
118
118
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
119
119
|
* Copyright 2024 Preline Labs Ltd.
|
|
120
|
-
*/var
|
|
120
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=n(i(2961));class l extends o.default{constructor(e,t){super(e,t);const i=e.getAttribute("data-hs-remove-element-options"),n=i?JSON.parse(i):{},s=Object.assign(Object.assign({},n),t);this.removeTargetId=this.el.getAttribute("data-hs-remove-element"),this.removeTarget=document.querySelector(this.removeTargetId),this.removeTargetAnimationClass=(null==s?void 0:s.removeTargetAnimationClass)||"hs-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.afterTransition)(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){const i=window.$hsRemoveElementCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e)||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-hs-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 l(e)})}}t.default=l},5308(e,t,i){"use strict";
|
|
121
121
|
/*
|
|
122
122
|
* HSScrollNav
|
|
123
|
-
* @version: 5.
|
|
123
|
+
* @version: 5.1.0
|
|
124
124
|
* @author: Preline Labs Ltd.
|
|
125
125
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
126
126
|
* Copyright 2024 Preline Labs Ltd.
|
|
127
|
-
*/var
|
|
127
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=n(i(2961));class l extends o.default{constructor(e,t){var i,n;super(e,t);const s=e.getAttribute("data-hs-scroll-nav"),o=s?JSON.parse(s):{},l=Object.assign(Object.assign(Object.assign({},{paging:!0,autoCentering:!1}),o),t);this.paging=null===(i=l.paging)||void 0===i||i,this.autoCentering=null!==(n=l.autoCentering)&&void 0!==n&&n,this.body=this.el.querySelector(".hs-scroll-nav-body"),this.items=this.body?Array.from(this.body.querySelectorAll(":scope > *")):[],this.prev=this.el.querySelector(".hs-scroll-nav-prev")||null,this.next=this.el.querySelector(".hs-scroll-nav-next")||null,this.setCurrentState(),this.init()}init(){if(!this.body||!this.items.length)return!1;this.createCollection(window.$hsScrollNavCollection,this),this.setCurrentState(),this.paging?(this.prev&&this.buildPrev(),this.next&&this.buildNext()):(this.prev&&this.buildPrevSingle(),this.next&&this.buildNextSingle()),this.autoCentering&&this.scrollToActiveElement(),this.body.addEventListener("scroll",(0,s.debounce)(()=>this.setCurrentState(),200)),window.addEventListener("resize",(0,s.debounce)(()=>{this.setCurrentState(),this.autoCentering&&this.scrollToActiveElement()},200))}setCurrentState(){this.currentState={first:this.getFirstVisibleItem(),last:this.getLastVisibleItem(),center:this.getCenterVisibleItem()},this.prev&&this.setPrevToDisabled(),this.next&&this.setNextToDisabled()}setPrevToDisabled(){this.currentState.first===this.items[0]?(this.prev.setAttribute("disabled","disabled"),this.prev.classList.add("disabled")):(this.prev.removeAttribute("disabled"),this.prev.classList.remove("disabled"))}setNextToDisabled(){this.currentState.last===this.items[this.items.length-1]?(this.next.setAttribute("disabled","disabled"),this.next.classList.add("disabled")):(this.next.removeAttribute("disabled"),this.next.classList.remove("disabled"))}buildPrev(){this.prev&&this.prev.addEventListener("click",()=>{const e=this.currentState.first;if(!e)return;const t=this.getVisibleItemsCount();let i=e;for(let e=0;e<t&&i.previousElementSibling;e++)i=i.previousElementSibling;this.goTo(i)})}buildNext(){this.next&&this.next.addEventListener("click",()=>{const e=this.currentState.last;if(!e)return;const t=this.getVisibleItemsCount();let i=e;for(let e=0;e<t&&i.nextElementSibling;e++)i=i.nextElementSibling;this.goTo(i)})}buildPrevSingle(){var e;null===(e=this.prev)||void 0===e||e.addEventListener("click",()=>{const e=this.currentState.first;if(!e)return;const t=e.previousElementSibling;t&&this.goTo(t)})}buildNextSingle(){var e;null===(e=this.next)||void 0===e||e.addEventListener("click",()=>{const e=this.currentState.last;if(!e)return;const t=e.nextElementSibling;t&&this.goTo(t)})}getCenterVisibleItem(){const e=this.body.scrollLeft+this.body.clientWidth/2;let t=null,i=1/0;return this.items.forEach(n=>{const s=n.offsetLeft+n.offsetWidth/2,o=Math.abs(s-e);o<i&&(i=o,t=n)}),t}getFirstVisibleItem(){const e=this.body.getBoundingClientRect();for(let t of this.items){const i=t.getBoundingClientRect();if(i.left>=e.left&&i.right<=e.right)return t}return null}getLastVisibleItem(){const e=this.body.getBoundingClientRect();for(let t=this.items.length-1;t>=0;t--){const i=this.items[t],n=i.getBoundingClientRect();if(n.left<e.right&&n.right>e.left)return i}return null}getVisibleItemsCount(){const e=this.body.clientWidth;let t=0,i=0;for(let n of this.items){if(i+=n.offsetWidth,!(i<=e))break;t++}return t}scrollToActiveElement(){const e=this.body.querySelector(".active");if(!e)return!1;this.centerElement(e)}getCurrentState(){return this.currentState}goTo(e,t){e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"});new IntersectionObserver((i,n)=>{i.forEach(i=>{i.target===e&&i.isIntersecting&&("function"==typeof t&&t(),n.disconnect())})},{root:this.body,threshold:1}).observe(e)}centerElement(e,t="smooth"){if(!this.body.contains(e))return;const i=e.offsetLeft+e.offsetWidth/2-this.body.clientWidth/2;this.body.scrollTo({left:i,behavior:t})}destroy(){this.paging?(this.prev&&this.prev.removeEventListener("click",this.buildPrev),this.next&&this.next.removeEventListener("click",this.buildNext)):(this.prev&&this.prev.removeEventListener("click",this.buildPrevSingle),this.next&&this.next.removeEventListener("click",this.buildNextSingle)),window.removeEventListener("resize",(0,s.debounce)(()=>this.setCurrentState(),200)),window.$hsScrollNavCollection=window.$hsScrollNavCollection.filter(({element:e})=>e.el!==this.el)}static getInstance(e,t){const i=window.$hsScrollNavCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e)||t.element.el===("string"==typeof e?document.querySelector(e):e));return i?t?i:i.element.el:null}static autoInit(){window.$hsScrollNavCollection||(window.$hsScrollNavCollection=[]),window.$hsScrollNavCollection&&(window.$hsRemoveElementCollection=window.$hsRemoveElementCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-scroll-nav]:not(.--prevent-on-load-init)").forEach(e=>{window.$hsScrollNavCollection.find(t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e})||new l(e)})}}t.default=l},9948(e,t,i){"use strict";
|
|
128
128
|
/*
|
|
129
129
|
* HSScrollspy
|
|
130
|
-
* @version: 5.
|
|
130
|
+
* @version: 5.1.0
|
|
131
131
|
* @author: Preline Labs Ltd.
|
|
132
132
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
133
133
|
* Copyright 2024 Preline Labs Ltd.
|
|
134
|
-
*/var
|
|
134
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=n(i(2961));class l extends o.default{constructor(e,t={}){super(e,t),this.isScrollingDown=!1,this.lastScrollTop=0;const i=e.getAttribute("data-hs-scrollspy-options"),n=i?JSON.parse(i):{},s=Object.assign(Object.assign({},n),t);this.ignoreScrollUp=void 0!==s.ignoreScrollUp&&s.ignoreScrollUp,this.links=this.el.querySelectorAll("[href]"),this.sections=[],this.scrollableId=this.el.getAttribute("data-hs-scrollspy-scrollable-parent"),this.scrollable=this.scrollableId?document.querySelector(this.scrollableId):document,this.onLinkClickListener=[],this.init()}scrollableScroll(e){const t=this.scrollable instanceof HTMLElement?this.scrollable.scrollTop:window.scrollY;this.isScrollingDown=t>this.lastScrollTop,this.lastScrollTop=t<=0?0:t,Array.from(this.sections).forEach(t=>{if(!t.getAttribute("id"))return!1;this.update(e,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.onPopstateListener=e=>this.handlePopstate(e),this.scrollable.addEventListener("scroll",this.onScrollableScrollListener),window.addEventListener("popstate",this.onPopstateListener),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)})}determineScrollDirection(e){const t=this.el.querySelector("a.active");if(!t)return!0;const i=Array.from(this.links).indexOf(t),n=Array.from(this.links).indexOf(e);return-1===n||n>i}linkClick(e,t){e.preventDefault();const i=t.getAttribute("href");if(!i||"javascript:;"===i)return;(i?document.querySelector(i):null)&&(this.isScrollingDown=this.determineScrollDirection(t),this.scrollTo(t))}update(e,t){const i=parseInt((0,s.getClassProperty)(this.el,"--scrollspy-offset","0")),n=parseInt((0,s.getClassProperty)(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(this.ignoreScrollUp||this.isScrollingDown?l<=0&&l+r>0:l<=0&&l<r){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-hs-scrollspy-group]");if(t){const e=t.querySelector("[href]");e&&e.classList.add("active")}}this.fireEvent("afterScroll",e),(0,s.dispatch)("afterScroll.hs.scrollspy",e,this.el)}}handlePopstate(e){const t=window.location.hash;if(!t)return;const i=this.el.querySelector(`[href="${t}"]`);if(!i)return;const n=document.querySelector(t);if(!n)return;this.isScrollingDown=this.determineScrollDirection(i);const o=parseInt((0,s.getClassProperty)(this.el,"--scrollspy-offset","0")),l=parseInt((0,s.getClassProperty)(n,"--scrollspy-offset"))||o,r=this.scrollable===document?0:this.scrollable.offsetTop,a=n.offsetTop-l-r,d=this.scrollable===document?window:this.scrollable;"scrollTo"in d&&d.scrollTo({top:a,left:0,behavior:"smooth"})}scrollTo(e){const t=e.getAttribute("href"),i=document.querySelector(t),n=parseInt((0,s.getClassProperty)(this.el,"--scrollspy-offset","0")),o=parseInt((0,s.getClassProperty)(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.pushState(null,null,e.getAttribute("href")),"scrollTo"in a&&a.scrollTo({top:r,left:0,behavior:"smooth"})},c=this.fireEvent("beforeScroll",this.el);(0,s.dispatch)("beforeScroll.hs.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),window.removeEventListener("popstate",this.onPopstateListener),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-hs-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 l(e)})}}t.default=l},591(e,t,i){"use strict";
|
|
135
135
|
/*
|
|
136
136
|
* HSSelect
|
|
137
|
-
* @version: 5.
|
|
137
|
+
* @version: 5.1.0
|
|
138
138
|
* @author: Preline Labs Ltd.
|
|
139
139
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
140
140
|
* Copyright 2024 Preline Labs Ltd.
|
|
141
|
-
*/var s=this&&this.__awaiter||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())})},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(292),l=n(i(2961)),r=n(i(248)),a=i(8223);class c extends l.default{constructor(e,t){var i,s,n,o,l;super(e,t),this.disabledObserver=null,this.remoteSearchAbortController=null,this.loadMoreAbortController=null,this.requestId=0,this.lastQuery="",this.isLoadEventFired=!1,this.optionId=0;const r=e.getAttribute("data-hs-select"),a=r?JSON.parse(r):{},c=Object.assign(Object.assign({},a),t);this.value=(null==c?void 0:c.value)||this.el.value||null,this.placeholder=(null==c?void 0:c.placeholder)||"Select...",this.hasSearch=(null==c?void 0:c.hasSearch)||!1,this.minSearchLength=null!==(i=null==c?void 0:c.minSearchLength)&&void 0!==i?i:0,this.preventSearchFocus=(null==c?void 0:c.preventSearchFocus)||!1,this.preventSearchInsideDescription=(null==c?void 0:c.preventSearchInsideDescription)||!1,this.mode=(null==c?void 0:c.mode)||"default",this.viewport=void 0!==(null==c?void 0:c.viewport)?document.querySelector(null==c?void 0:c.viewport):null,this.scrollToSelected=void 0!==(null==c?void 0:c.scrollToSelected)&&(null==c?void 0:c.scrollToSelected),this._isOpened=Boolean(null==c?void 0:c.isOpened)||!1,this.isMultiple=this.el.hasAttribute("multiple")||!1,this.isDisabled=this.el.hasAttribute("disabled")||!1,this.selectedItems=[],this.apiUrl=(null==c?void 0:c.apiUrl)||null,this.apiQuery=(null==c?void 0:c.apiQuery)||null,this.apiOptions=(null==c?void 0:c.apiOptions)||null,this.apiSearchQueryKey=(null==c?void 0:c.apiSearchQueryKey)||null,this.apiDataPart=(null==c?void 0:c.apiDataPart)||null,this.apiLoadMore=!0===(null==c?void 0:c.apiLoadMore)?{perPage:10,scrollThreshold:100}:"object"==typeof(null==c?void 0:c.apiLoadMore)&&null!==(null==c?void 0:c.apiLoadMore)&&{perPage:c.apiLoadMore.perPage||10,scrollThreshold:c.apiLoadMore.scrollThreshold||100},this.apiPageStart="number"==typeof(null==c?void 0:c.apiPageStart)?c.apiPageStart:void 0,this.apiTotalPath="string"==typeof(null==c?void 0:c.apiTotalPath)?c.apiTotalPath:null,this.apiFieldsMap=(null==c?void 0:c.apiFieldsMap)||null,this.apiIconTag=(null==c?void 0:c.apiIconTag)||null,this.apiSelectedValues=(null==c?void 0:c.apiSelectedValues)||null,this.currentPage=0,this.isLoading=!1,this.hasMore=!0,this.wrapperClasses=(null==c?void 0:c.wrapperClasses)||null,this.toggleTag=(null==c?void 0:c.toggleTag)||null,this.toggleClasses=(null==c?void 0:c.toggleClasses)||null,this.toggleCountText=void 0===typeof(null==c?void 0:c.toggleCountText)?null:c.toggleCountText,this.toggleCountTextPlacement=(null==c?void 0:c.toggleCountTextPlacement)||"postfix",this.toggleCountTextMinItems=(null==c?void 0:c.toggleCountTextMinItems)||1,this.toggleCountTextMode=(null==c?void 0:c.toggleCountTextMode)||"countAfterLimit",this.toggleSeparators={items:(null===(s=null==c?void 0:c.toggleSeparators)||void 0===s?void 0:s.items)||", ",betweenItemsAndCounter:(null===(n=null==c?void 0:c.toggleSeparators)||void 0===n?void 0:n.betweenItemsAndCounter)||"and"},this.tagsItemTemplate=(null==c?void 0:c.tagsItemTemplate)||null,this.tagsItemClasses=(null==c?void 0:c.tagsItemClasses)||null,this.tagsInputId=(null==c?void 0:c.tagsInputId)||null,this.tagsInputClasses=(null==c?void 0:c.tagsInputClasses)||null,this.dropdownTag=(null==c?void 0:c.dropdownTag)||null,this.dropdownClasses=(null==c?void 0:c.dropdownClasses)||null,this.dropdownDirectionClasses=(null==c?void 0:c.dropdownDirectionClasses)||null,this.dropdownSpace=(null==c?void 0:c.dropdownSpace)||10,this.dropdownPlacement=(null==c?void 0:c.dropdownPlacement)||null,this.dropdownVerticalFixedPlacement=(null==c?void 0:c.dropdownVerticalFixedPlacement)||null,this.dropdownScope=(null==c?void 0:c.dropdownScope)||"parent",this.dropdownAutoPlacement=(null==c?void 0:c.dropdownAutoPlacement)||!1,this.searchTemplate=(null==c?void 0:c.searchTemplate)||null,this.searchWrapperTemplate=(null==c?void 0:c.searchWrapperTemplate)||null,this.searchWrapperClasses=(null==c?void 0:c.searchWrapperClasses)||"bg-white p-2 sticky top-0",this.searchId=(null==c?void 0:c.searchId)||null,this.searchLimit=(null==c?void 0:c.searchLimit)||1/0,this.isSearchDirectMatch=void 0===(null==c?void 0:c.isSearchDirectMatch)||c.isSearchDirectMatch,this.searchMatchMode=(null==c?void 0:c.searchMatchMode)||(this.isSearchDirectMatch?"substring":"chars-sequence"),this.searchClasses=(null==c?void 0:c.searchClasses)||"block w-[calc(100%-32px)] text-sm border-gray-200 rounded-md focus:border-blue-500 focus:ring-blue-500 dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 py-2 px-3 my-2 mx-4",this.searchPlaceholder=(null==c?void 0:c.searchPlaceholder)||"Search...",this.searchNoResultTemplate=(null==c?void 0:c.searchNoResultTemplate)||"<span></span>",this.searchNoResultText=(null==c?void 0:c.searchNoResultText)||"No results found",this.searchNoResultClasses=(null==c?void 0:c.searchNoResultClasses)||"px-4 text-sm text-gray-800 dark:text-neutral-200",this.optionAllowEmptyOption=void 0!==(null==c?void 0:c.optionAllowEmptyOption)&&(null==c?void 0:c.optionAllowEmptyOption),this.optionTemplate=(null==c?void 0:c.optionTemplate)||null,this.optionTag=(null==c?void 0:c.optionTag)||null,this.optionClasses=(null==c?void 0:c.optionClasses)||null,this.optgroupTag=(null==c?void 0:c.optgroupTag)||null,this.optgroupClasses=(null==c?void 0:c.optgroupClasses)||null,this.extraMarkup=(null==c?void 0:c.extraMarkup)||null,this.descriptionClasses=(null==c?void 0:c.descriptionClasses)||null,this.iconClasses=(null==c?void 0:c.iconClasses)||null,this.isAddTagOnEnter=null===(o=null==c?void 0:c.isAddTagOnEnter)||void 0===o||o,this.isSelectedOptionOnTop=null!==(l=null==c?void 0:c.isSelectedOptionOnTop)&&void 0!==l&&l,this.animationInProcess=!1,this.selectOptions=[],this.staticOptions=[],this.remoteOptions=[],this.tagsInputHelper=null,this.disabledObserver=new MutationObserver(e=>{e.some(e=>"disabled"===e.attributeName)&&this.setDisabledState(this.el.hasAttribute("disabled"))}),this.disabledObserver.observe(this.el,{attributes:!0,attributeFilter:["disabled"]}),this.init()}wrapperClick(e){e.target.closest("[data-hs-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.apiUrl||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.buildOriginalOption(t,t),this.dropdown.querySelector(`[data-value="${t}"]`).click(),this.resetTagsInputField()}}searchInput(e){const t=e.target.value;this.lastQuery=t,this.apiUrl?this.remoteSearch(t):this.searchOptions(t)}setValue(e){if(this.value=e,this.clearSelections(),Array.isArray(e))if("tags"===this.mode){this.unselectMultipleItems(),this.selectMultipleItems(),this.selectedItems=[];this.wrapper.querySelectorAll("[data-tag-value]").forEach(e=>e.remove()),this.setTagsItems(),this.reassignTagsInputPlaceholder(this.hasValue()?"":this.placeholder)}else this.toggleTextWrapper.innerHTML=this.hasValue()?this.stringFromValue():this.placeholder,this.unselectMultipleItems(),this.selectMultipleItems();else this.setToggleTitle(),this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.selectSingleItem()}setDisabledState(e){this.isDisabled=e;const t="tags"===this.mode?this.wrapper:this.toggle;null==t||t.classList.toggle("disabled",e),e&&this.isOpened()&&this.close()}hasValue(){return this.isMultiple?Array.isArray(this.value)&&this.value.length>0&&this.value.some(e=>null!=e&&""!==e):null!==this.value&&void 0!==this.value&&""!==this.value}init(){c.ensureGlobalHandlers(),this.createCollection(window.$hsSelectCollection,this),this.build(),"undefined"!=typeof window&&(window.HSAccessibilityObserver||(window.HSAccessibilityObserver=new r.default),this.setupAccessibility())}build(){this.el.style.display="none";if(this.el.querySelectorAll("option").length&&this.setOptions(),this.optionAllowEmptyOption&&!this.value&&(this.value=""),this.isMultiple){const e=this.el.querySelectorAll("option"),t=Array.from(e).filter(e=>e.selected),i=[];t.forEach(e=>{i.push(e.value)}),this.value=i}this.buildWrapper(),"tags"===this.mode?this.buildTags():this.buildToggle(),this.buildDropdown(),this.extraMarkup&&this.buildExtraMarkup(),this.apiUrl||this.fireLoadEvent()}fireLoadEvent(){this.isLoadEventFired||(this.isLoadEventFired=!0,setTimeout(()=>{this.fireEvent("load",this.el),(0,o.dispatch)("load.hs.select",this.el,this.el)}))}setOptions(){const e=this.el.querySelectorAll("option");Array.from(e).filter(e=>this.optionAllowEmptyOption||!this.optionAllowEmptyOption&&e.value&&""!==e.value).forEach(e=>{var t;const i=e.getAttribute("data-hs-select-option"),s={title:e.textContent,val:e.value,disabled:e.disabled,options:i&&"undefined"!==i?JSON.parse(i):null,optgroupName:"OPTGROUP"===(null===(t=e.parentElement)||void 0===t?void 0:t.tagName)?e.parentElement.label:null};this.selectOptions=[...this.selectOptions,s],this.apiUrl&&(this.staticOptions=[...this.staticOptions,s],e.setAttribute("data-static","true"))})}buildWrapper(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("hs-select","relative"),this.setDisabledState(this.isDisabled),"tags"===this.mode&&(this.onWrapperClickListener=e=>this.wrapperClick(e),this.wrapper.addEventListener("click",this.onWrapperClickListener)),this.wrapperClasses&&(0,o.classToClassList)(this.wrapperClasses,this.wrapper),this.el.before(this.wrapper),this.wrapper.append(this.el)}buildExtraMarkup(){const e=e=>{const t=(0,o.htmlToElement)(e);return this.wrapper.append(t),t},t=e=>{e.classList.contains("--prevent-click")||e.addEventListener("click",e=>{e.stopPropagation(),this.isDisabled||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,s;this.toggleTextWrapper=document.createElement("span"),this.toggleTextWrapper.classList.add("truncate"),this.toggle=(0,o.htmlToElement)(this.toggleTag||"<div></div>"),i=this.toggle.querySelector("[data-icon]"),s=this.toggle.querySelector("[data-title]"),!this.isMultiple&&i&&this.setToggleIcon(),!this.isMultiple&&s&&this.setToggleTitle(),this.isMultiple?this.toggleTextWrapper.innerHTML=this.hasValue()?this.stringFromValue():this.placeholder:this.toggleTextWrapper.innerHTML=(null===(e=this.getItemByValue(this.value))||void 0===e?void 0:e.title)||this.placeholder,s||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,o.classToClassList)(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,t,i,s;const n=this.getItemByValue(this.value),l=this.toggle.querySelector("[data-icon]");if(l){l.innerHTML="";const r=null===(t=null===(e=null==n?void 0:n.options)||void 0===e?void 0:e.apiFields)||void 0===t?void 0:t.icon,a=null==n?void 0:n[null===(i=this.apiFieldsMap)||void 0===i?void 0:i.icon],c=null===(s=null==n?void 0:n.options)||void 0===s?void 0:s.icon,d=(0,o.htmlToElement)((this.apiUrl||r)&&this.apiIconTag?this.apiIconTag||"":c||"");this.value&&(r?d.src=r:this.apiUrl&&this.apiIconTag&&a?d.src=a:c&&"string"==typeof c&&!c.trim().startsWith("<")&&(d.src=c)),l.append(d),(d instanceof HTMLImageElement?d.src:d)?l.classList.remove("hidden"):l.classList.add("hidden")}}setToggleTitle(){const e=this.toggle.querySelector("[data-title]");let t=this.placeholder;if(this.optionAllowEmptyOption&&""===this.value){const e=this.selectOptions.find(e=>""===e.val);t=(null==e?void 0:e.title)||this.placeholder}else if(this.value)if(this.apiUrl){const e=this.staticOptions.find(e=>e.val===this.value);if(e)t=e.title;else{const e=this.remoteOptions.find(e=>`${e[this.apiFieldsMap.val]}`===this.value||`${e[this.apiFieldsMap.title]}`===this.value);e&&(t=e[this.apiFieldsMap.title])}}else{const e=this.selectOptions.find(e=>e.val===this.value);e&&(t=e.title)}e?(e.innerHTML=t,e.classList.add("truncate"),this.toggle.append(e)):this.toggleTextWrapper.innerHTML=t}buildTags(){this.isDisabled&&this.wrapper.classList.add("disabled"),this.wrapper.setAttribute("tabindex","0"),this.buildTagsInput(),this.setTagsItems()}reassignTagsInputPlaceholder(e){this.tagsInput.placeholder=e,this.tagsInputHelper.innerHTML=e,this.calculateInputWidth()}buildTagsItem(e){var t,i,s,n,l,r,a,c;const d=this.getItemByValue(e);let h,u,p,m;const g=document.createElement("div");if(g.setAttribute("data-tag-value",e),this.tagsItemClasses&&(0,o.classToClassList)(this.tagsItemClasses,g),this.tagsItemTemplate&&(h=(0,o.htmlToElement)(this.tagsItemTemplate),g.append(h)),(null===(t=null==d?void 0:d.options)||void 0===t?void 0:t.icon)||this.apiIconTag){const e=(0,o.htmlToElement)(this.apiUrl&&this.apiIconTag?this.apiIconTag:null===(i=null==d?void 0:d.options)||void 0===i?void 0:i.icon);if(this.apiUrl&&this.apiIconTag){const t=d[this.apiFieldsMap.icon]||(null===(n=null===(s=null==d?void 0:d.options)||void 0===s?void 0:s.apiFields)||void 0===n?void 0:n.icon)||(null===(l=null==d?void 0:d.options)||void 0===l?void 0:l.icon)||"";t&&(e.src=t)}m=h?h.querySelector("[data-icon]"):document.createElement("span"),m.append(e),h||g.append(m)}!h||!h.querySelector("[data-icon]")||(null===(r=null==d?void 0:d.options)||void 0===r?void 0:r.icon)||this.apiUrl||this.apiIconTag||d[null===(a=this.apiFieldsMap)||void 0===a?void 0:a.icon]||h.querySelector("[data-icon]").classList.add("hidden"),u=h?h.querySelector("[data-title]"):document.createElement("span"),this.apiUrl&&(null===(c=this.apiFieldsMap)||void 0===c?void 0:c.title)&&d[this.apiFieldsMap.title]?u.textContent=d[this.apiFieldsMap.title]:u.textContent=d.title||"",h||g.append(u),h?p=h.querySelector("[data-remove]"):(p=document.createElement("span"),p.textContent="X",g.append(p)),p.addEventListener("click",()=>{this.value=this.value.filter(t=>t!==e),this.selectedItems=this.selectedItems.filter(t=>t!==e),this.hasValue()||this.reassignTagsInputPlaceholder(this.placeholder),this.unselectMultipleItems(),this.selectMultipleItems(),g.remove(),this.triggerChangeEventForNativeSelect()}),this.wrapper.append(g)}getItemByValue(e){if(this.apiUrl){const t=this.staticOptions.find(t=>t.val===e);return t||this.remoteOptions.find(t=>`${t[this.apiFieldsMap.val]}`===e||t[this.apiFieldsMap.title]===e)}return this.selectOptions.find(t=>t.val===e)}setTagsItems(){if(this.value){(Array.isArray(this.value)?this.value:null!=this.value?[this.value]:[]).forEach(e=>{this.selectedItems.includes(e)||this.buildTagsItem(e),this.selectedItems=this.selectedItems.includes(e)?this.selectedItems:[...this.selectedItems,e]})}this._isOpened&&this.floatingUIInstance&&this.floatingUIInstance.update()}buildTagsInput(){this.tagsInput=document.createElement("input"),this.tagsInputId&&(this.tagsInput.id=this.tagsInputId),this.tagsInputClasses&&(0,o.classToClassList)(this.tagsInputClasses,this.tagsInput),this.tagsInput.setAttribute("tabindex","-1"),this.onTagsInputFocusListener=()=>this.tagsInputFocus(),this.onTagsInputInputListener=()=>this.tagsInputInput(),this.onTagsInputInputSecondListener=(0,o.debounce)(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.hasValue()?"":this.placeholder)})}buildDropdown(){if(this.dropdown=(0,o.htmlToElement)(this.dropdownTag||"<div></div>"),this.dropdown.setAttribute("data-hs-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,o.classToClassList)(this.dropdownClasses,this.dropdown),this.wrapper&&this.wrapper.append(this.dropdown),this.dropdown&&this.hasSearch&&this.buildSearch(),this.selectOptions){let e="";this.selectOptions.forEach((t,i)=>{t.optgroupName&&t.optgroupName!==e&&(this.hasOptgroup=!0,e=t.optgroupName,this.buildOptgroup(e)),this.buildOption(t.title,t.val,t.disabled,t.selected,t.options,`${i}`,void 0,!!this.apiUrl)}),e=""}this.apiUrl&&this.optionsFromRemoteData().then(()=>this.fireLoadEvent()),this.apiUrl||(this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")),"window"===this.dropdownScope&&this.buildFloatingUI(),this.dropdown&&this.apiLoadMore&&this.setupInfiniteScroll()}buildOptgroup(e){const t=(0,o.htmlToElement)(this.optgroupTag||"<div></div>");t.textContent=e,t.setAttribute("data-optgroup",""),this.optgroupClasses&&(0,o.classToClassList)(this.optgroupClasses,t),this.dropdown.append(t)}setupInfiniteScroll(){this.dropdown.addEventListener("scroll",this.handleScroll.bind(this))}handleScroll(){return s(this,void 0,void 0,function*(){if(!this.dropdown||this.isLoading||!this.hasMore||!this.apiLoadMore)return;const{scrollTop:e,scrollHeight:t,clientHeight:i}=this.dropdown;t-e-i<("object"==typeof this.apiLoadMore?this.apiLoadMore.scrollThreshold:100)&&(yield this.loadMore())})}loadMore(){return s(this,void 0,void 0,function*(){var e,t,i,s,n,l,r,a,c,d,h,u;if(!this.apiUrl||this.isLoading||!this.hasMore||!this.apiLoadMore)return;const p=this.requestId;this.isLoading=!0;try{let m;try{m=new URL(this.apiUrl)}catch(e){m=new URL(this.apiUrl,window.location.origin)}const g=(null!==(e=this.lastQuery)&&void 0!==e?e:"").trim().toLowerCase(),v=new URLSearchParams(null!==(t=this.apiQuery)&&void 0!==t?t:""),f=null!==(i=this.apiSearchQueryKey)&&void 0!==i?i:"q";""!==g&&v.set(f,g),m.search=v.toString();const y=(null===(s=this.apiFieldsMap)||void 0===s?void 0:s.page)||(null===(n=this.apiFieldsMap)||void 0===n?void 0:n.offset)||"page",b=!!(null===(l=this.apiFieldsMap)||void 0===l?void 0:l.offset),w="object"==typeof this.apiLoadMore?this.apiLoadMore.perPage:10,C=this.currentPage+1;if(b){const e=this.currentPage*w;m.searchParams.set(y,String(e))}else m.searchParams.set(y,String(C));if(m.searchParams.set((null===(r=this.apiFieldsMap)||void 0===r?void 0:r.limit)||"limit",String(w)),this.loadMoreAbortController)try{this.loadMoreAbortController.abort()}catch(e){}this.loadMoreAbortController=new AbortController;const S=Object.assign(Object.assign({},this.apiOptions||{}),{signal:this.loadMoreAbortController.signal});this.fireEvent("request",{url:m.toString()}),(0,o.dispatch)("request.hs.select",this.el,{url:m.toString()});const x=yield fetch(m.toString(),S),T=yield x.json();if(p!==this.requestId)return void(this.isLoading=!1);const L=this.apiDataPart?null!==(c=null!==(a=T[this.apiDataPart])&&void 0!==a?a:T.results)&&void 0!==c?c:T:null!==(d=T.results)&&void 0!==d?d:T;this.fireEvent("requestCompleted",{url:m.toString(),data:L}),(0,o.dispatch)("requestCompleted.hs.select",this.el,{url:m.toString(),data:L});const E=(e,t)=>t.split(".").reduce((e,t)=>e?e[t]:void 0,e);let k=null;if(this.apiTotalPath){const e=E(T,this.apiTotalPath);k="number"==typeof e?e:null}else k=null!==(u=null!==(h="number"==typeof T.count?T.count:null)&&void 0!==h?h:"number"==typeof T.total?T.total:null)&&void 0!==u?u:T.info&&"number"==typeof T.info.count?T.info.count:null;if(L&&L.length>0){if(this.remoteOptions=[...this.remoteOptions||[],...L],this.buildOptionsFromRemoteData(L),"number"==typeof k){const e=C*w;this.hasMore=e<k}else this.hasMore=L.length===w;this.currentPage=C}else this.hasMore=!1}catch(e){this.hasMore=!1,"AbortError"!==(null==e?void 0:e.name)&&(console.error("Error loading more options:",e),this.fireEvent("requestCompleted",{url:this.apiUrl,error:e}),(0,o.dispatch)("requestCompleted.hs.select",this.el,{url:this.apiUrl,error:e}))}finally{this.isLoading=!1}})}buildFloatingUI(){if("undefined"!=typeof FloatingUIDOM&&FloatingUIDOM.computePosition){document.body.appendChild(this.dropdown);const e="tags"===this.mode?this.wrapper:this.toggle,t=[FloatingUIDOM.offset([0,5])];this.dropdownAutoPlacement&&"function"==typeof FloatingUIDOM.flip&&t.push(FloatingUIDOM.flip({fallbackPlacements:["bottom-start","bottom-end","top-start","top-end"]}));const i={placement:a.POSITIONS[this.dropdownPlacement]||"bottom",strategy:"fixed",middleware:t},s=()=>{Object.assign(this.dropdown.style,{marginLeft:"",marginTop:"",marginRight:"",marginBottom:""}),FloatingUIDOM.computePosition(e,this.dropdown,i).then(({x:e,y:t,placement:i})=>{Object.assign(this.dropdown.style,{position:"fixed",left:`${e}px`,top:`${t}px`,["margin"+(i.startsWith("bottom")||i.startsWith("top")?"Top":i.startsWith("right")?"Left":"Right")]:`${i.startsWith("top")?"-":""}${this.dropdownSpace}px`}),this.dropdown.setAttribute("data-placement",i)})};s();const n=FloatingUIDOM.autoUpdate(e,this.dropdown,s);this.floatingUIInstance={update:s,destroy:n}}else console.error("FloatingUIDOM not found! Please enable it on the page.")}updateDropdownWidth(){const e="tags"===this.mode?this.wrapper:this.toggle;this.dropdown.style.width=`${e.clientWidth}px`}buildSearch(){var e,t,i;if(!this.hasSearch)return;if("tags"===this.mode){const s=null!==(i=null!==(e=this.tagsInput)&&void 0!==e?e:null===(t=this.wrapper)||void 0===t?void 0:t.querySelector(":scope input"))&&void 0!==i?i:this.el.querySelector(":scope input");return s?(this.search=s,this.searchPlaceholder&&(this.search.placeholder=this.searchPlaceholder),this.searchId&&(this.search.id=this.searchId),this.searchClasses&&(0,o.classToClassList)(this.searchClasses,this.search),void(this.apiUrl&&(this.onSearchInputListener=(0,o.debounce)(e=>this.searchInput(e)),this.search.addEventListener("input",this.onSearchInputListener)))):void 0}let s;this.searchWrapper=(0,o.htmlToElement)(this.searchWrapperTemplate||"<div></div>"),this.searchWrapperClasses&&(0,o.classToClassList)(this.searchWrapperClasses,this.searchWrapper),s=this.searchWrapper.querySelector("[data-input]");const n=(0,o.htmlToElement)(this.searchTemplate||'<input type="text">');this.search="INPUT"===n.tagName?n:n.querySelector(":scope input"),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,o.classToClassList)(this.searchClasses,this.search),this.searchId&&(this.search.id=this.searchId),this.onSearchInputListener=(0,o.debounce)(e=>this.searchInput(e)),this.search.addEventListener("input",this.onSearchInputListener),s?s.append(n):this.searchWrapper.append(n),this.dropdown.append(this.searchWrapper)}buildOption(e,t,i=!1,s=!1,n,l="1",r,a=!1){var c,d,h,u,p;let m=null,g=null,v=null,f=null;const y=(0,o.htmlToElement)(this.optionTag||"<div></div>");if(y.setAttribute("data-value",t),y.setAttribute("data-title-value",e),y.setAttribute("tabIndex",l),y.classList.add("cursor-pointer"),y.setAttribute("data-id",r||`${this.optionId}`),a&&y.setAttribute("data-static","true"),r||this.optionId++,i&&y.classList.add("disabled"),s&&(this.isMultiple?this.value=[...this.value,t]:this.value=t),this.optionTemplate&&(m=(0,o.htmlToElement)(this.optionTemplate),y.append(m)),m?(g=m.querySelector("[data-title]"),g.textContent=e||""):y.textContent=e||"",n){const t=null!==(d=null===(c=n.apiFields)||void 0===c?void 0:c.icon)&&void 0!==d?d:n.icon,i=null!==(u=null===(h=n.apiFields)||void 0===h?void 0:h.description)&&void 0!==u?u:n.description;if(t){const i=(0,o.htmlToElement)(null!==(p=this.apiIconTag)&&void 0!==p?p:t);if(i.classList.add("max-w-full"),(this.apiUrl||n.apiFields)&&(i.setAttribute("alt",e),i.setAttribute("src",t)),m)v=m.querySelector("[data-icon]"),v.append(i);else{const e=(0,o.htmlToElement)("<div></div>");this.iconClasses&&(0,o.classToClassList)(this.iconClasses,e),e.append(i),y.append(e)}}if(Array.isArray(n.additionalClasses)&&n.additionalClasses.forEach(([e,t])=>{const i=e?y.querySelector(e):y;i&&t.forEach(e=>i.classList.add(e))}),i)if(y.dataset.description=i,m)f=m.querySelector("[data-description]"),f&&f.append(i);else{const e=(0,o.htmlToElement)("<div></div>");e.textContent=i,this.descriptionClasses&&(0,o.classToClassList)(this.descriptionClasses,e),y.append(e)}}m&&m.querySelector("[data-icon]")&&!n&&!(null==n?void 0:n.icon)&&m.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(t):this.value===t)&&y.classList.add("selected"),i||y.addEventListener("click",()=>this.onSelectOption(t)),this.optionClasses&&(0,o.classToClassList)(this.optionClasses,y),this.dropdown&&this.dropdown.append(y),s&&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],o.id=`${i}`),e[this.apiFieldsMap.val]&&(n=`${e[this.apiFieldsMap.val]}`,o.val=n),e[this.apiFieldsMap.title]&&(s=e[this.apiFieldsMap.title],o.title=s,e[this.apiFieldsMap.val]||(n=s,o.val=n)),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]});const l=this.staticOptions.findIndex(e=>e.val===n);if(-1!==l)return void this.mergeRemoteDataIntoStaticOption(l,n,o,t);if(!this.dropdown.querySelector(`[data-value="${n}"]`)){const e=!!this.apiSelectedValues&&(Array.isArray(this.apiSelectedValues)?this.apiSelectedValues.includes(n):this.apiSelectedValues===n);this.buildOriginalOption(s,n,i,!1,e,o),this.buildOptionFromRemoteData(s,n,!1,e,`${t}`,i,o),e&&(this.isMultiple?(this.value||(this.value=[]),Array.isArray(this.value)&&(this.value=[...this.value,n])):this.value=n,this.toggle&&(this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.toggle.querySelector("[data-icon]")&&this.setToggleIcon()))}}),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")}mergeRemoteDataIntoStaticOption(e,t,i,s){const n=this.staticOptions[e];n.options||(n.options={}),n.options.apiFields||(n.options.apiFields={}),i.title&&(n.title=i.title),i.icon&&(n.options.apiFields.icon=i.icon),i.description&&(n.options.apiFields.description=i.description),Object.keys(i.rest).forEach(e=>{n.options.apiFields[e]=i.rest[e]});const l=this.dropdown.querySelector(`[data-value="${t}"][data-static]`);if(l){if(l.setAttribute("tabIndex",`${s}`),i.id&&l.setAttribute("data-id",`${i.id}`),i.title){l.setAttribute("data-title-value",i.title);const e=l.querySelector("[data-title]");e&&(e.textContent=i.title)}if(i.icon){const e=l.querySelector("[data-icon]");if(e){e.innerHTML="";const t=(0,o.htmlToElement)(this.apiIconTag||"<img />");t.classList.add("max-w-full"),t.setAttribute("alt",n.title),t.setAttribute("src",i.icon),e.append(t)}}if(i.description){l.dataset.description=i.description;const e=l.querySelector("[data-description]");e&&(e.textContent=i.description)}}const r=this.el.querySelector(`option[value="${t}"][data-static]`);if(r){i.id&&r.setAttribute("data-id",`${i.id}`),i.title&&(r.textContent=i.title);const e={id:i.id||"",val:i.val||"",title:i.title||"",icon:i.icon||null,description:i.description||null,rest:i.rest};r.setAttribute("data-hs-select-option",JSON.stringify(e))}const a=this.selectOptions.findIndex(e=>e.val===t);-1!==a&&(this.selectOptions[a]=n);(this.isMultiple?Array.isArray(this.value)&&this.value.includes(t):this.value===t)&&this.toggle&&(i.title&&(this.toggle.querySelector("[data-title]")?this.setToggleTitle():this.toggleTextWrapper&&(this.isMultiple?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=i.title)),i.icon&&this.toggle.querySelector("[data-icon]")&&this.setToggleIcon())}optionsFromRemoteData(){return s(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 s(this,arguments,void 0,function*(e="",t){var i,s,n,l,r,a,c,d,h,u;try{let p;try{p=new URL(this.apiUrl)}catch(e){try{p=new URL(this.apiUrl,window.location.origin)}catch(e){return console.error("Invalid API URL:",this.apiUrl),null}}const m=new URLSearchParams(null!==(i=this.apiQuery)&&void 0!==i?i:""),g=null!==(s=this.apiOptions)&&void 0!==s?s:{},v=Object.assign({},g);t&&(v.signal=t);const f=null!==(n=this.apiSearchQueryKey)&&void 0!==n?n:"q",y=(null!=e?e:"").trim().toLowerCase();if(""!==y&&m.set(f,y),this.apiLoadMore){const e="object"==typeof this.apiLoadMore?this.apiLoadMore.perPage:10,t=null!==(c=null!==(r=null===(l=this.apiFieldsMap)||void 0===l?void 0:l.page)&&void 0!==r?r:null===(a=this.apiFieldsMap)||void 0===a?void 0:a.offset)&&void 0!==c?c:"page",i=null!==(h=null===(d=this.apiFieldsMap)||void 0===d?void 0:d.limit)&&void 0!==h?h:"limit",s=Boolean(null===(u=this.apiFieldsMap)||void 0===u?void 0:u.offset)?0:1,n="number"==typeof this.apiPageStart?this.apiPageStart:s;m.delete(t),m.delete(i),m.set(t,String(n)),m.set(i,String(e))}p.search=m.toString(),this.fireEvent("request",{url:p.toString()}),(0,o.dispatch)("request.hs.select",this.el,{url:p.toString()});const b=yield fetch(p.toString(),v),w=yield b.json(),C=this.apiDataPart?w[this.apiDataPart]:w;return this.fireEvent("requestCompleted",{url:p.toString(),data:C}),(0,o.dispatch)("requestCompleted.hs.select",this.el,{url:p.toString(),data:C}),C}catch(e){"AbortError"!==(null==e?void 0:e.name)&&(console.error(e),this.fireEvent("requestCompleted",{url:this.apiUrl,error:e}),(0,o.dispatch)("requestCompleted.hs.select",this.el,{url:this.apiUrl,error:e}))}})}sortElements(e,t){if(this.hasOptgroup)return;const i=Array.from(e.querySelectorAll(t));this.isSelectedOptionOnTop&&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,i)=>{e.appendChild(t),t.hasAttribute("tabindex")&&t.setAttribute("tabIndex",`${i}`)})}remoteSearch(e){return s(this,void 0,void 0,function*(){var t,i,s,n;if(this.requestId++,this.remoteSearchAbortController)try{this.remoteSearchAbortController.abort()}catch(e){}if(this.loadMoreAbortController)try{this.loadMoreAbortController.abort()}catch(e){}if(this.remoteSearchAbortController=new AbortController,this.currentPage=0,this.hasMore=!0,this.isLoading=!1,this.filterStaticOptions(e),e.length<=this.minSearchLength){const e=yield this.apiRequest("",null===(t=this.remoteSearchAbortController)||void 0===t?void 0:t.signal);if(!e)return!1;const s=Boolean(null===(i=this.apiFieldsMap)||void 0===i?void 0:i.offset)?0:1,n="number"==typeof this.apiPageStart?this.apiPageStart:s;this.currentPage=n;const o=Array.isArray(this.value)?this.value:this.value?[this.value]:[],l=this.remoteOptions.filter(e=>{var t;return o.includes(`${e[null===(t=this.apiFieldsMap)||void 0===t?void 0:t.val]}`)}),r=new Set(e.map(e=>{var t;return`${e[null===(t=this.apiFieldsMap)||void 0===t?void 0:t.val]}`}));return this.remoteOptions=[...e,...l.filter(e=>{var t;return!r.has(`${e[null===(t=this.apiFieldsMap)||void 0===t?void 0:t.val]}`)})],Array.from(this.dropdown.querySelectorAll("[data-value]:not([data-static])")).forEach(e=>{o.includes(e.getAttribute("data-value"))||e.remove()}),Array.from(this.el.querySelectorAll("option[value][data-hs-select-option]:not([data-static])")).forEach(e=>{o.includes(e.value)||e.remove()}),e.length?this.buildOptionsFromRemoteData(e):console.log("No data responded!"),!1}const o=yield this.apiRequest(e,null===(s=this.remoteSearchAbortController)||void 0===s?void 0:s.signal);if(!o)return;const l=Boolean(null===(n=this.apiFieldsMap)||void 0===n?void 0:n.offset)?0:1,r="number"==typeof this.apiPageStart?this.apiPageStart:l;this.currentPage=r;const a=Array.isArray(this.value)?this.value:this.value?[this.value]:[],c=this.remoteOptions.filter(e=>{var t;return a.includes(`${e[null===(t=this.apiFieldsMap)||void 0===t?void 0:t.val]}`)}),d=new Set(o.map(e=>{var t;return`${e[null===(t=this.apiFieldsMap)||void 0===t?void 0:t.val]}`}));this.remoteOptions=[...o,...c.filter(e=>{var t;return!d.has(`${e[null===(t=this.apiFieldsMap)||void 0===t?void 0:t.val]}`)})];let h=o.map(e=>`${e.id}`),u=null;const p=this.dropdown.querySelectorAll("[data-value]:not([data-static])");this.el.querySelectorAll("[data-hs-select-option]:not([data-static])").forEach(e=>{var t;const i=e.getAttribute("data-id");h.includes(i)||(null===(t=this.value)||void 0===t?void 0:t.includes(e.value))||this.destroyOriginalOption(e.value)}),p.forEach(e=>{var t;const i=e.getAttribute("data-id");h.includes(i)||(null===(t=this.value)||void 0===t?void 0:t.includes(e.getAttribute("data-value")))?h=h.filter(e=>e!==i):this.destroyOption(e.getAttribute("data-value"))}),u=o.filter(e=>h.includes(`${e.id}`)),u.length?this.buildOptionsFromRemoteData(u):console.log("No data responded!")})}filterStaticOptions(e){const t=this.dropdown.querySelectorAll("[data-value][data-static]"),i=e.trim().toLowerCase();t.forEach(e=>{var t,s;if(i.length<=this.minSearchLength)e.classList.remove("hidden");else{const n=(null===(t=e.getAttribute("data-title-value"))||void 0===t?void 0:t.toLowerCase())||"",o=(null===(s=e.dataset.description)||void 0===s?void 0:s.toLowerCase())||"";this.optionMatchesQuery(i,n,o)?e.classList.remove("hidden"):e.classList.add("hidden")}})}normalizeSearchText(e=""){return e.toLocaleLowerCase().replace(/\s+/g," ").trim()}tokenizeSearchQuery(e){return this.normalizeSearchText(e).split(" ").filter(Boolean)}charsSequenceMatch(e,t){const i=e.split("").map(e=>/\w/.test(e)?`${e}[\\W_]*`:"\\W*").join("");return new RegExp(i,"i").test(t)}optionMatchesQuery(e,t,i=""){const s=this.normalizeSearchText(e);if(!s)return!0;const n=this.normalizeSearchText(t),o=this.normalizeSearchText(i),l=this.preventSearchInsideDescription?[n]:[n,o];if("token-all"===this.searchMatchMode){const e=this.tokenizeSearchQuery(s);return l.some(t=>e.every(e=>t.includes(e)))}if("hybrid"===this.searchMatchMode){const e=this.tokenizeSearchQuery(s);return l.some(t=>{const i=e.every(e=>t.includes(e)),n=this.charsSequenceMatch(s,t);return i||n})}return"chars-sequence"===this.searchMatchMode?l.some(e=>this.charsSequenceMatch(s,e)):l.some(e=>e.includes(s))}destroyOption(e){const t=this.dropdown.querySelector(`[data-value="${e}"]`);if(!t)return!1;t.remove()}buildOriginalOption(e,t,i,s,n,l){const r=(0,o.htmlToElement)("<option></option>");r.setAttribute("value",t),s&&r.setAttribute("disabled","disabled"),n&&r.setAttribute("selected","selected"),i&&r.setAttribute("data-id",i),r.setAttribute("data-hs-select-option",JSON.stringify(null!=l?l:null)),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?(Array.isArray(this.value)||(this.value=[]),this.value=this.value.includes(e)?this.value.filter(t=>t!==e):[...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.hasValue()||"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,o.dispatch)("change.hs.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(){const e=this.el.querySelectorAll("option");Array.from(this.dropdown.children).forEach(e=>{e.classList.contains("selected")&&e.classList.remove("selected")}),Array.from(e).forEach(e=>{e.selected&&(e.selected=!1)})}setNewValue(){if("tags"===this.mode)this.setTagsItems();else if(this.optionAllowEmptyOption&&""===this.value){const e=this.selectOptions.find(e=>""===e.val);this.toggleTextWrapper.innerHTML=(null==e?void 0:e.title)||this.placeholder}else if(this.hasValue())if(this.apiUrl){const e=this.dropdown.querySelector(`[data-value="${this.value}"]`);if(e)this.toggleTextWrapper.innerHTML=e.getAttribute("data-title-value")||this.placeholder;else{const e=this.staticOptions.find(e=>e.val===this.value);if(e)this.toggleTextWrapper.innerHTML=e.title;else{const e=this.remoteOptions.find(e=>(e[this.apiFieldsMap.val]?`${e[this.apiFieldsMap.val]}`:e[this.apiFieldsMap.title])===this.value);this.toggleTextWrapper.innerHTML=e?`${e[this.apiFieldsMap.title]}`:this.stringFromValue()}}}else this.toggleTextWrapper.innerHTML=this.stringFromValue();else this.toggleTextWrapper.innerHTML=this.placeholder}stringFromValueBasic(e){var t;const i=[];let s="";if(e.forEach(e=>{this.isMultiple?Array.isArray(this.value)&&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(){if(!this.dropdown)return this.stringFromValueBasic(this.selectOptions);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?Array.isArray(this.value)&&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(){const e=this.el.querySelectorAll("option");Array.from(e).find(e=>this.value===e.value).selected=!0;const t=Array.from(this.dropdown.children).find(e=>this.value===e.getAttribute("data-value"));t&&t.classList.add("selected"),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")}selectMultipleItems(){if(!Array.isArray(this.value))return;const e=this.el.querySelectorAll("option");Array.from(this.dropdown.children).filter(e=>this.value.includes(e.getAttribute("data-value"))).forEach(e=>e.classList.add("selected")),Array.from(e).filter(e=>this.value.includes(e.value)).forEach(e=>e.selected=!0),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")}unselectMultipleItems(){const e=this.el.querySelectorAll("option");Array.from(this.dropdown.children).forEach(e=>e.classList.remove("selected")),Array.from(e).forEach(e=>e.selected=!1),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")}searchOptions(e){if(e.length<=this.minSearchLength){this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null);return this.dropdown.querySelectorAll("[data-value]").forEach(e=>{e.classList.remove("hidden")}),!1}this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,o.htmlToElement)(this.searchNoResultTemplate),this.searchNoResult.innerText=this.searchNoResultText,(0,o.classToClassList)(this.searchNoResultClasses,this.searchNoResult);const t=this.dropdown.querySelectorAll("[data-value]");let i,s=!1;this.searchLimit&&(i=0),t.forEach(t=>{var n;const o=t.getAttribute("data-title-value")||"",l=(null===(n=null==t?void 0:t.dataset)||void 0===n?void 0:n.description)||"";!this.optionMatchesQuery(e,o,l)||this.searchLimit&&i>=this.searchLimit?t.classList.add("hidden"):(t.classList.remove("hidden"),s=!0,this.searchLimit&&i++)}),s||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()}setupAccessibility(){this.accessibilityComponent=window.HSAccessibilityObserver.registerComponent(this.wrapper,{onEnter:()=>{if(this._isOpened){const e=this.dropdown.querySelector(".hs-select-option-highlighted");e&&(this.onSelectOption(e.getAttribute("data-value")||""),this._isOpened&&e.focus())}else this.open()},onSpace:()=>{if(this._isOpened){const e=this.dropdown.querySelector(".hs-select-option-highlighted");e&&(this.onSelectOption(e.getAttribute("data-value")||""),this._isOpened&&e.focus())}else this.open()},onEsc:()=>{this._isOpened&&this.close(!0)},onArrow:e=>{if(!e.metaKey)if(this._isOpened||"ArrowDown"!==e.key){if(this._isOpened)switch(e.key){case"ArrowDown":this.focusMenuItem("next");break;case"ArrowUp":this.focusMenuItem("prev");break;case"Home":this.onStartEnd(!0);break;case"End":this.onStartEnd(!1)}}else this.open()},onHome:()=>{this._isOpened&&this.onStartEnd(!0)},onEnd:()=>{this._isOpened&&this.onStartEnd(!1)},onTab:()=>{this._isOpened&&this.close()},onShiftTab:()=>{this._isOpened&&this.close()}},this._isOpened,"Select",".hs-select",this.dropdown)}focusMenuItem(e){const t=Array.from(this.dropdown.querySelectorAll(":scope > *:not(.hidden)")).filter(e=>!e.classList.contains("disabled")&&!e.hasAttribute("data-optgroup"));if(!t.length)return;const i=this.dropdown.querySelector(".hs-select-option-highlighted"),s=i?t.indexOf(i):-1,n="next"===e?(s+1)%t.length:(s-1+t.length)%t.length;i&&i.classList.remove("hs-select-option-highlighted"),t[n].classList.add("hs-select-option-highlighted"),t[n].focus()}onStartEnd(e=!0){if(!this.dropdown)return;const t=Array.from(this.dropdown.querySelectorAll(":scope > *:not(.hidden)")).filter(e=>!e.classList.contains("disabled"));if(!t.length)return;const i=this.dropdown.querySelector(".hs-select-option-highlighted");i&&i.classList.remove("hs-select-option-highlighted");const s=e?0:t.length-1;t[s].classList.add("hs-select-option-highlighted"),t[s].focus()}destroy(){var e;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 t=this.el.parentElement.parentElement;this.el.classList.add("hidden"),this.el.style.display="",t.prepend(this.el),t.querySelector(".hs-select").remove(),this.wrapper=null,null===(e=this.disabledObserver)||void 0===e||e.disconnect(),this.disabledObserver=null,window.$hsSelectCollection=window.$hsSelectCollection.filter(({element:e})=>e.el!==this.el)}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"),"window"!==this.dropdownScope&&this.recalculateDirection(),setTimeout(()=>{var e;if((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.floatingUIInstance&&"window"===this.dropdownScope&&(this.floatingUIInstance.update(),this.dropdown.classList.remove("invisible")),this.hasSearch&&!this.preventSearchFocus&&this.search.focus(),this.animationInProcess=!1,this.scrollToSelected&&this.dropdown){const e=this.dropdown.querySelector(".selected");if(e){const t=this.dropdown.clientHeight,i=e.offsetTop-t/2+e.clientHeight/2;this.dropdown.scrollTop=i}}}),this._isOpened=!0,window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,this._isOpened)}close(e=!1){var t,i,s,n;if(this.animationInProcess)return!1;this.animationInProcess=!0,(null===(t=null==this?void 0:this.toggle)||void 0===t?void 0:t.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(null===(i=this.dropdownDirectionClasses)||void 0===i?void 0:i.bottom)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(null===(s=this.dropdownDirectionClasses)||void 0===s?void 0:s.top)&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",(0,o.afterTransition)(this.dropdown,()=>{var t;this.dropdown.classList.add("hidden"),this.hasSearch&&"tags"!==this.mode&&(this.search.value="",this.apiUrl?this.filterStaticOptions(""):this.search.dispatchEvent(new Event("input",{bubbles:!0})),this.search.blur()),e&&((null===(t=this.mode)||void 0===t?void 0:t.includes("tags"))?this.wrapper.focus():this.toggle.focus()),this.animationInProcess=!1}),null===(n=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===n||n.classList.remove("hs-select-option-highlighted"),this._isOpened=!1,window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,this._isOpened)}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),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")}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(),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")}recalculateDirection(){var e,t,i,s;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,o.isEnoughSpace)(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===(s=this.dropdownDirectionClasses)||void 0===s?void 0:s.bottom)&&this.dropdown.classList.add(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom=`${this.dropdownSpace}px`)}isOpened(){return this._isOpened||!1}containsElement(e){var t;return(null===(t=this.wrapper)||void 0===t?void 0:t.contains(e))||!1}containsDropdownElement(e){var t;return(null===(t=this.dropdown)||void 0===t?void 0:t.contains(e))||!1}static findInCollection(e){return c.ensureGlobalHandlers(),window.$hsSelectCollection.find(t=>e instanceof c?t.element.el===e.el:"string"==typeof e?t.element.el===document.querySelector(e):t.element.el===e)||null}static getInstance(e,t){c.ensureGlobalHandlers();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(){c.ensureGlobalHandlers(),window.$hsSelectCollection&&(window.$hsSelectCollection=window.$hsSelectCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-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-hs-select"),i=t?JSON.parse(t):{};new c(e,i)}})}static ensureGlobalHandlers(){"undefined"!=typeof window&&(window.$hsSelectCollection||(window.$hsSelectCollection=[]),c.globalListenersInitialized||(c.globalListenersInitialized=!0,window.addEventListener("click",e=>{const t=e.target;c.closeCurrentlyOpened(t)})))}static open(e){const t=c.findInCollection(e);t&&!t.element.isOpened()&&t.element.open()}static close(e){const t=c.findInCollection(e);t&&t.element.isOpened()&&t.element.close()}static closeCurrentlyOpened(e=null){if(!e.closest(".hs-select.active")&&!e.closest("[data-hs-select-dropdown].opened")){const e=window.$hsSelectCollection.filter(e=>e.element.isOpened())||null;e&&e.forEach(e=>{e.element.close()})}}}c.globalListenersInitialized=!1,t.default=c},8572(e,t,i){"use strict";
|
|
141
|
+
*/var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(s,o){function l(e){try{a(n.next(e))}catch(e){o(e)}}function r(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(l,r)}a((n=n.apply(e,t||[])).next())})},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(292),l=s(i(2961)),r=s(i(248)),a=i(8223);class d extends l.default{constructor(e,t){var i,n,s,o,l;super(e,t),this.disabledObserver=null,this.remoteSearchAbortController=null,this.loadMoreAbortController=null,this.requestId=0,this.lastQuery="",this.isLoadEventFired=!1,this.optionId=0;const r=e.getAttribute("data-hs-select"),a=r?JSON.parse(r):{},d=Object.assign(Object.assign({},a),t);this.value=(null==d?void 0:d.value)||this.el.value||null,this.placeholder=(null==d?void 0:d.placeholder)||"Select...",this.hasSearch=(null==d?void 0:d.hasSearch)||!1,this.minSearchLength=null!==(i=null==d?void 0:d.minSearchLength)&&void 0!==i?i:0,this.preventSearchFocus=(null==d?void 0:d.preventSearchFocus)||!1,this.preventSearchInsideDescription=(null==d?void 0:d.preventSearchInsideDescription)||!1,this.mode=(null==d?void 0:d.mode)||"default",this.viewport=void 0!==(null==d?void 0:d.viewport)?document.querySelector(null==d?void 0:d.viewport):null,this.scrollToSelected=void 0!==(null==d?void 0:d.scrollToSelected)&&(null==d?void 0:d.scrollToSelected),this._isOpened=Boolean(null==d?void 0:d.isOpened)||!1,this.isMultiple=this.el.hasAttribute("multiple")||!1,this.isDisabled=this.el.hasAttribute("disabled")||!1,this.selectedItems=[],this.apiUrl=(null==d?void 0:d.apiUrl)||null,this.apiQuery=(null==d?void 0:d.apiQuery)||null,this.apiOptions=(null==d?void 0:d.apiOptions)||null,this.apiSearchQueryKey=(null==d?void 0:d.apiSearchQueryKey)||null,this.apiDataPart=(null==d?void 0:d.apiDataPart)||null,this.apiLoadMore=!0===(null==d?void 0:d.apiLoadMore)?{perPage:10,scrollThreshold:100}:"object"==typeof(null==d?void 0:d.apiLoadMore)&&null!==(null==d?void 0:d.apiLoadMore)&&{perPage:d.apiLoadMore.perPage||10,scrollThreshold:d.apiLoadMore.scrollThreshold||100},this.apiPageStart="number"==typeof(null==d?void 0:d.apiPageStart)?d.apiPageStart:void 0,this.apiTotalPath="string"==typeof(null==d?void 0:d.apiTotalPath)?d.apiTotalPath:null,this.apiFieldsMap=(null==d?void 0:d.apiFieldsMap)||null,this.apiIconTag=(null==d?void 0:d.apiIconTag)||null,this.apiSelectedValues=(null==d?void 0:d.apiSelectedValues)||null,this.currentPage=0,this.isLoading=!1,this.hasMore=!0,this.wrapperClasses=(null==d?void 0:d.wrapperClasses)||null,this.toggleTag=(null==d?void 0:d.toggleTag)||null,this.toggleClasses=(null==d?void 0:d.toggleClasses)||null,this.toggleCountText=void 0===typeof(null==d?void 0:d.toggleCountText)?null:d.toggleCountText,this.toggleCountTextPlacement=(null==d?void 0:d.toggleCountTextPlacement)||"postfix",this.toggleCountTextMinItems=(null==d?void 0:d.toggleCountTextMinItems)||1,this.toggleCountTextMode=(null==d?void 0:d.toggleCountTextMode)||"countAfterLimit",this.toggleSeparators={items:(null===(n=null==d?void 0:d.toggleSeparators)||void 0===n?void 0:n.items)||", ",betweenItemsAndCounter:(null===(s=null==d?void 0:d.toggleSeparators)||void 0===s?void 0:s.betweenItemsAndCounter)||"and"},this.tagsItemTemplate=(null==d?void 0:d.tagsItemTemplate)||null,this.tagsItemClasses=(null==d?void 0:d.tagsItemClasses)||null,this.tagsInputId=(null==d?void 0:d.tagsInputId)||null,this.tagsInputClasses=(null==d?void 0:d.tagsInputClasses)||null,this.dropdownTag=(null==d?void 0:d.dropdownTag)||null,this.dropdownClasses=(null==d?void 0:d.dropdownClasses)||null,this.dropdownDirectionClasses=(null==d?void 0:d.dropdownDirectionClasses)||null,this.dropdownSpace=(null==d?void 0:d.dropdownSpace)||10,this.dropdownPlacement=(null==d?void 0:d.dropdownPlacement)||null,this.dropdownVerticalFixedPlacement=(null==d?void 0:d.dropdownVerticalFixedPlacement)||null,this.dropdownScope=(null==d?void 0:d.dropdownScope)||"parent",this.dropdownAutoPlacement=(null==d?void 0:d.dropdownAutoPlacement)||!1,this.searchTemplate=(null==d?void 0:d.searchTemplate)||null,this.searchWrapperTemplate=(null==d?void 0:d.searchWrapperTemplate)||null,this.searchWrapperClasses=(null==d?void 0:d.searchWrapperClasses)||"bg-white p-2 sticky top-0",this.searchId=(null==d?void 0:d.searchId)||null,this.searchLimit=(null==d?void 0:d.searchLimit)||1/0,this.isSearchDirectMatch=void 0===(null==d?void 0:d.isSearchDirectMatch)||d.isSearchDirectMatch,this.searchMatchMode=(null==d?void 0:d.searchMatchMode)||(this.isSearchDirectMatch?"substring":"chars-sequence"),this.searchClasses=(null==d?void 0:d.searchClasses)||"block w-[calc(100%-32px)] text-sm border-gray-200 rounded-md focus:border-blue-500 focus:ring-blue-500 dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 py-2 px-3 my-2 mx-4",this.searchPlaceholder=(null==d?void 0:d.searchPlaceholder)||"Search...",this.searchNoResultTemplate=(null==d?void 0:d.searchNoResultTemplate)||"<span></span>",this.searchNoResultText=(null==d?void 0:d.searchNoResultText)||"No results found",this.searchNoResultClasses=(null==d?void 0:d.searchNoResultClasses)||"px-4 text-sm text-gray-800 dark:text-neutral-200",this.optionAllowEmptyOption=void 0!==(null==d?void 0:d.optionAllowEmptyOption)&&(null==d?void 0:d.optionAllowEmptyOption),this.optionValueAsTitle=void 0!==(null==d?void 0:d.optionValueAsTitle)&&(null==d?void 0:d.optionValueAsTitle),this.optionTemplate=(null==d?void 0:d.optionTemplate)||null,this.optionTag=(null==d?void 0:d.optionTag)||null,this.optionClasses=(null==d?void 0:d.optionClasses)||null,this.optgroupTag=(null==d?void 0:d.optgroupTag)||null,this.optgroupClasses=(null==d?void 0:d.optgroupClasses)||null,this.extraMarkup=(null==d?void 0:d.extraMarkup)||null,this.descriptionClasses=(null==d?void 0:d.descriptionClasses)||null,this.iconClasses=(null==d?void 0:d.iconClasses)||null,this.isAddTagOnEnter=null===(o=null==d?void 0:d.isAddTagOnEnter)||void 0===o||o,this.isSelectedOptionOnTop=null!==(l=null==d?void 0:d.isSelectedOptionOnTop)&&void 0!==l&&l,this.animationInProcess=!1,this.selectOptions=[],this.staticOptions=[],this.remoteOptions=[],this.tagsInputHelper=null,this.disabledObserver=new MutationObserver(e=>{e.some(e=>"disabled"===e.attributeName)&&this.setDisabledState(this.el.hasAttribute("disabled"))}),this.disabledObserver.observe(this.el,{attributes:!0,attributeFilter:["disabled"]}),this.init()}wrapperClick(e){e.target.closest("[data-hs-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.apiUrl||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.buildOriginalOption(t,t),this.dropdown.querySelector(`[data-value="${t}"]`).click(),this.resetTagsInputField()}}searchInput(e){const t=e.target.value;this.lastQuery=t,this.apiUrl?this.remoteSearch(t):this.searchOptions(t)}setValue(e){if(this.value=e,this.clearSelections(),Array.isArray(e))if("tags"===this.mode){this.unselectMultipleItems(),this.selectMultipleItems(),this.selectedItems=[];this.wrapper.querySelectorAll("[data-tag-value]").forEach(e=>e.remove()),this.setTagsItems(),this.reassignTagsInputPlaceholder(this.hasValue()?"":this.placeholder)}else this.setToggleText(this.toggleTextWrapper,this.hasValue()?this.stringFromValue():null),this.unselectMultipleItems(),this.selectMultipleItems();else this.setToggleTitle(),this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.selectSingleItem()}setDisabledState(e){this.isDisabled=e;const t="tags"===this.mode?this.wrapper:this.toggle;null==t||t.classList.toggle("disabled",e),e&&this.isOpened()&&this.close()}hasValue(){return this.isMultiple?Array.isArray(this.value)&&this.value.length>0&&this.value.some(e=>null!=e&&""!==e):null!==this.value&&void 0!==this.value&&""!==this.value}init(){d.ensureGlobalHandlers(),this.createCollection(window.$hsSelectCollection,this),this.build(),"undefined"!=typeof window&&(window.HSAccessibilityObserver||(window.HSAccessibilityObserver=new r.default),this.setupAccessibility())}build(){this.el.style.display="none";if(this.el.querySelectorAll("option").length&&this.setOptions(),this.optionAllowEmptyOption&&!this.value&&(this.value=""),this.isMultiple){const e=this.el.querySelectorAll("option"),t=Array.from(e).filter(e=>e.selected),i=[];t.forEach(e=>{i.push(e.value)}),this.value=i}this.buildWrapper(),"tags"===this.mode?this.buildTags():this.buildToggle(),this.buildDropdown(),this.extraMarkup&&this.buildExtraMarkup(),this.apiUrl||this.fireLoadEvent()}fireLoadEvent(){this.isLoadEventFired||(this.isLoadEventFired=!0,setTimeout(()=>{this.fireEvent("load",this.el),(0,o.dispatch)("load.hs.select",this.el,this.el)}))}setOptions(){const e=this.el.querySelectorAll("option");Array.from(e).filter(e=>this.optionAllowEmptyOption||!this.optionAllowEmptyOption&&e.value&&""!==e.value).forEach(e=>{var t;const i=e.getAttribute("data-hs-select-option"),n={title:e.textContent,val:e.value,disabled:e.disabled,options:i&&"undefined"!==i?JSON.parse(i):null,optgroupName:"OPTGROUP"===(null===(t=e.parentElement)||void 0===t?void 0:t.tagName)?e.parentElement.label:null};this.selectOptions=[...this.selectOptions,n],this.apiUrl&&(this.staticOptions=[...this.staticOptions,n],e.setAttribute("data-static","true"))})}buildWrapper(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("hs-select","relative"),this.setDisabledState(this.isDisabled),"tags"===this.mode&&(this.onWrapperClickListener=e=>this.wrapperClick(e),this.wrapper.addEventListener("click",this.onWrapperClickListener)),this.wrapperClasses&&(0,o.classToClassList)(this.wrapperClasses,this.wrapper),this.el.before(this.wrapper),this.wrapper.append(this.el)}buildExtraMarkup(){const e=e=>{const t=(0,o.htmlToElement)(e);return this.wrapper.append(t),t},t=e=>{e.classList.contains("--prevent-click")||e.addEventListener("click",e=>{e.stopPropagation(),this.isDisabled||this.toggleFn()})};if(Array.isArray(this.extraMarkup))this.extraMarkup.forEach(i=>{const n=e(i);t(n)});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,o.htmlToElement)(this.toggleTag||"<div></div>"),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.setToggleText(this.toggleTextWrapper,this.hasValue()?this.stringFromValue():null):this.setToggleText(this.toggleTextWrapper,(null===(e=this.getItemByValue(this.value))||void 0===e?void 0:e.title)||null),n||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&(0,o.classToClassList)(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,t,i,n;const s=this.getItemByValue(this.value),l=this.toggle.querySelector("[data-icon]");if(l){l.innerHTML="";const r=null===(t=null===(e=null==s?void 0:s.options)||void 0===e?void 0:e.apiFields)||void 0===t?void 0:t.icon,a=null==s?void 0:s[null===(i=this.apiFieldsMap)||void 0===i?void 0:i.icon],d=null===(n=null==s?void 0:s.options)||void 0===n?void 0:n.icon,c=(0,o.htmlToElement)((this.apiUrl||r)&&this.apiIconTag?this.apiIconTag||"":d||"");this.value&&(r?c.src=r:this.apiUrl&&this.apiIconTag&&a?c.src=a:d&&"string"==typeof d&&!d.trim().startsWith("<")&&(c.src=d)),l.append(c),(c instanceof HTMLImageElement?c.src:c)?l.classList.remove("hidden"):l.classList.add("hidden")}}setToggleText(e,t){null===t?e.innerHTML=this.placeholder:e.textContent=t}setToggleTitle(){const e=this.toggle.querySelector("[data-title]");let t=null;if(this.optionAllowEmptyOption&&""===this.value){const e=this.selectOptions.find(e=>""===e.val);t=(null==e?void 0:e.title)||null}else if(this.value)if(this.apiUrl){const e=this.staticOptions.find(e=>e.val===this.value);if(e)t=e.title;else{const e=this.remoteOptions.find(e=>`${e[this.apiFieldsMap.val]}`===this.value||`${e[this.apiFieldsMap.title]}`===this.value);e&&(t=e[this.apiFieldsMap.title])}}else{const e=this.selectOptions.find(e=>e.val===this.value);e&&(t=e.title)}e?(this.setToggleText(e,t),e.classList.add("truncate"),this.toggle.append(e)):this.setToggleText(this.toggleTextWrapper,t)}buildTags(){this.isDisabled&&this.wrapper.classList.add("disabled"),this.wrapper.setAttribute("tabindex","0"),this.buildTagsInput(),this.setTagsItems()}reassignTagsInputPlaceholder(e){this.tagsInput.placeholder=e,this.calculateInputWidth()}buildTagsItem(e){var t,i,n,s,l,r,a,d;const c=this.getItemByValue(e);let h,u,p,m;const g=document.createElement("div");if(g.setAttribute("data-tag-value",e),this.tagsItemClasses&&(0,o.classToClassList)(this.tagsItemClasses,g),this.tagsItemTemplate&&(h=(0,o.htmlToElement)(this.tagsItemTemplate),g.append(h)),(null===(t=null==c?void 0:c.options)||void 0===t?void 0:t.icon)||this.apiIconTag){const e=(0,o.htmlToElement)(this.apiUrl&&this.apiIconTag?this.apiIconTag:null===(i=null==c?void 0:c.options)||void 0===i?void 0:i.icon);if(this.apiUrl&&this.apiIconTag){const t=c[this.apiFieldsMap.icon]||(null===(s=null===(n=null==c?void 0:c.options)||void 0===n?void 0:n.apiFields)||void 0===s?void 0:s.icon)||(null===(l=null==c?void 0:c.options)||void 0===l?void 0:l.icon)||"";t&&(e.src=t)}m=h?h.querySelector("[data-icon]"):document.createElement("span"),m.append(e),h||g.append(m)}!h||!h.querySelector("[data-icon]")||(null===(r=null==c?void 0:c.options)||void 0===r?void 0:r.icon)||this.apiUrl||this.apiIconTag||c[null===(a=this.apiFieldsMap)||void 0===a?void 0:a.icon]||h.querySelector("[data-icon]").classList.add("hidden"),u=h?h.querySelector("[data-title]"):document.createElement("span"),this.apiUrl&&(null===(d=this.apiFieldsMap)||void 0===d?void 0:d.title)&&c[this.apiFieldsMap.title]?u.textContent=c[this.apiFieldsMap.title]:u.textContent=c.title||"",h||g.append(u),h?p=h.querySelector("[data-remove]"):(p=document.createElement("span"),p.textContent="X",g.append(p)),p.addEventListener("click",()=>{this.value=this.value.filter(t=>t!==e),this.selectedItems=this.selectedItems.filter(t=>t!==e),this.hasValue()||this.reassignTagsInputPlaceholder(this.placeholder),this.unselectMultipleItems(),this.selectMultipleItems(),g.remove(),this.triggerChangeEventForNativeSelect()}),this.wrapper.append(g)}getItemByValue(e){if(this.apiUrl){const t=this.staticOptions.find(t=>t.val===e);return t||this.remoteOptions.find(t=>`${t[this.apiFieldsMap.val]}`===e||t[this.apiFieldsMap.title]===e)}return this.selectOptions.find(t=>t.val===e)}setTagsItems(){if(this.value){(Array.isArray(this.value)?this.value:null!=this.value?[this.value]:[]).forEach(e=>{this.selectedItems.includes(e)||this.buildTagsItem(e),this.selectedItems=this.selectedItems.includes(e)?this.selectedItems:[...this.selectedItems,e]})}this._isOpened&&this.floatingUIInstance&&this.floatingUIInstance.update()}buildTagsInput(){this.tagsInput=document.createElement("input"),this.tagsInputId&&(this.tagsInput.id=this.tagsInputId),this.tagsInputClasses&&(0,o.classToClassList)(this.tagsInputClasses,this.tagsInput),this.tagsInput.setAttribute("tabindex","-1"),this.onTagsInputFocusListener=()=>this.tagsInputFocus(),this.onTagsInputInputListener=()=>this.tagsInputInput(),this.onTagsInputInputSecondListener=(0,o.debounce)(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.hasValue()?"":this.placeholder)})}buildDropdown(){if(this.dropdown=(0,o.htmlToElement)(this.dropdownTag||"<div></div>"),this.dropdown.setAttribute("data-hs-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,o.classToClassList)(this.dropdownClasses,this.dropdown),this.wrapper&&this.wrapper.append(this.dropdown),this.dropdown&&this.hasSearch&&this.buildSearch(),this.selectOptions){let e="";this.selectOptions.forEach((t,i)=>{t.optgroupName&&t.optgroupName!==e&&(this.hasOptgroup=!0,e=t.optgroupName,this.buildOptgroup(e)),this.buildOption(t.title,t.val,t.disabled,t.selected,t.options,`${i}`,void 0,!!this.apiUrl)}),e=""}this.apiUrl&&this.optionsFromRemoteData().then(()=>this.fireLoadEvent()),this.apiUrl||(this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")),"window"===this.dropdownScope&&this.buildFloatingUI(),this.dropdown&&this.apiLoadMore&&this.setupInfiniteScroll()}buildOptgroup(e){const t=(0,o.htmlToElement)(this.optgroupTag||"<div></div>");t.textContent=e,t.setAttribute("data-optgroup",""),this.optgroupClasses&&(0,o.classToClassList)(this.optgroupClasses,t),this.dropdown.append(t)}setupInfiniteScroll(){this.dropdown.addEventListener("scroll",this.handleScroll.bind(this))}handleScroll(){return n(this,void 0,void 0,function*(){if(!this.dropdown||this.isLoading||!this.hasMore||!this.apiLoadMore)return;const{scrollTop:e,scrollHeight:t,clientHeight:i}=this.dropdown;t-e-i<("object"==typeof this.apiLoadMore?this.apiLoadMore.scrollThreshold:100)&&(yield this.loadMore())})}loadMore(){return n(this,void 0,void 0,function*(){var e,t,i,n,s,l,r,a,d,c,h,u;if(!this.apiUrl||this.isLoading||!this.hasMore||!this.apiLoadMore)return;const p=this.requestId;this.isLoading=!0;try{let m;try{m=new URL(this.apiUrl)}catch(e){m=new URL(this.apiUrl,window.location.origin)}const g=(null!==(e=this.lastQuery)&&void 0!==e?e:"").trim().toLowerCase(),v=new URLSearchParams(null!==(t=this.apiQuery)&&void 0!==t?t:""),f=null!==(i=this.apiSearchQueryKey)&&void 0!==i?i:"q";""!==g&&v.set(f,g),m.search=v.toString();const y=(null===(n=this.apiFieldsMap)||void 0===n?void 0:n.page)||(null===(s=this.apiFieldsMap)||void 0===s?void 0:s.offset)||"page",b=!!(null===(l=this.apiFieldsMap)||void 0===l?void 0:l.offset),w="object"==typeof this.apiLoadMore?this.apiLoadMore.perPage:10,C=this.currentPage+1;if(b){const e=this.currentPage*w;m.searchParams.set(y,String(e))}else m.searchParams.set(y,String(C));if(m.searchParams.set((null===(r=this.apiFieldsMap)||void 0===r?void 0:r.limit)||"limit",String(w)),this.loadMoreAbortController)try{this.loadMoreAbortController.abort()}catch(e){}this.loadMoreAbortController=new AbortController;const x=Object.assign(Object.assign({},this.apiOptions||{}),{signal:this.loadMoreAbortController.signal});this.fireEvent("request",{url:m.toString()}),(0,o.dispatch)("request.hs.select",this.el,{url:m.toString()});const S=yield fetch(m.toString(),x),T=yield S.json();if(p!==this.requestId)return void(this.isLoading=!1);const k=this.apiDataPart?null!==(d=null!==(a=T[this.apiDataPart])&&void 0!==a?a:T.results)&&void 0!==d?d:T:null!==(c=T.results)&&void 0!==c?c:T;this.fireEvent("requestCompleted",{url:m.toString(),data:k}),(0,o.dispatch)("requestCompleted.hs.select",this.el,{url:m.toString(),data:k});const E=(e,t)=>t.split(".").reduce((e,t)=>e?e[t]:void 0,e);let L=null;if(this.apiTotalPath){const e=E(T,this.apiTotalPath);L="number"==typeof e?e:null}else L=null!==(u=null!==(h="number"==typeof T.count?T.count:null)&&void 0!==h?h:"number"==typeof T.total?T.total:null)&&void 0!==u?u:T.info&&"number"==typeof T.info.count?T.info.count:null;if(k&&k.length>0){if(this.remoteOptions=[...this.remoteOptions||[],...k],this.buildOptionsFromRemoteData(k),"number"==typeof L){const e=C*w;this.hasMore=e<L}else this.hasMore=k.length===w;this.currentPage=C}else this.hasMore=!1}catch(e){this.hasMore=!1,"AbortError"!==(null==e?void 0:e.name)&&(console.error("Error loading more options:",e),this.fireEvent("requestCompleted",{url:this.apiUrl,error:e}),(0,o.dispatch)("requestCompleted.hs.select",this.el,{url:this.apiUrl,error:e}))}finally{this.isLoading=!1}})}buildFloatingUI(){if("undefined"!=typeof FloatingUIDOM&&FloatingUIDOM.computePosition){document.body.appendChild(this.dropdown);const e="tags"===this.mode?this.wrapper:this.toggle,t=[FloatingUIDOM.offset([0,5])];this.dropdownAutoPlacement&&"function"==typeof FloatingUIDOM.flip&&t.push(FloatingUIDOM.flip({fallbackPlacements:["bottom-start","bottom-end","top-start","top-end"]}));const i={placement:a.POSITIONS[this.dropdownPlacement]||"bottom",strategy:"fixed",middleware:t},n=()=>{Object.assign(this.dropdown.style,{marginLeft:"",marginTop:"",marginRight:"",marginBottom:""}),FloatingUIDOM.computePosition(e,this.dropdown,i).then(({x:e,y:t,placement:i})=>{Object.assign(this.dropdown.style,{position:"fixed",left:`${e}px`,top:`${t}px`,["margin"+(i.startsWith("bottom")||i.startsWith("top")?"Top":i.startsWith("right")?"Left":"Right")]:`${i.startsWith("top")?"-":""}${this.dropdownSpace}px`}),this.dropdown.setAttribute("data-placement",i)})};n();const s=FloatingUIDOM.autoUpdate(e,this.dropdown,n);this.floatingUIInstance={update:n,destroy:s}}else console.error("FloatingUIDOM not found! Please enable it on the page.")}updateDropdownWidth(){const e="tags"===this.mode?this.wrapper:this.toggle;this.dropdown.style.width=`${e.clientWidth}px`}buildSearch(){var e,t,i;if(!this.hasSearch)return;if("tags"===this.mode){const n=null!==(i=null!==(e=this.tagsInput)&&void 0!==e?e:null===(t=this.wrapper)||void 0===t?void 0:t.querySelector(":scope input"))&&void 0!==i?i:this.el.querySelector(":scope input");return n?(this.search=n,this.searchPlaceholder&&(this.search.placeholder=this.searchPlaceholder),this.searchId&&(this.search.id=this.searchId),this.searchClasses&&(0,o.classToClassList)(this.searchClasses,this.search),void(this.apiUrl&&(this.onSearchInputListener=(0,o.debounce)(e=>this.searchInput(e)),this.search.addEventListener("input",this.onSearchInputListener)))):void 0}let n;this.searchWrapper=(0,o.htmlToElement)(this.searchWrapperTemplate||"<div></div>"),this.searchWrapperClasses&&(0,o.classToClassList)(this.searchWrapperClasses,this.searchWrapper),n=this.searchWrapper.querySelector("[data-input]");const s=(0,o.htmlToElement)(this.searchTemplate||'<input type="text">');this.search="INPUT"===s.tagName?s:s.querySelector(":scope input"),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&(0,o.classToClassList)(this.searchClasses,this.search),this.searchId&&(this.search.id=this.searchId),this.onSearchInputListener=(0,o.debounce)(e=>this.searchInput(e)),this.search.addEventListener("input",this.onSearchInputListener),n?n.append(s):this.searchWrapper.append(s),this.dropdown.append(this.searchWrapper)}buildOption(e,t,i=!1,n=!1,s,l="1",r,a=!1){var d,c,h,u,p;let m=null,g=null,v=null,f=null;const y=(0,o.htmlToElement)(this.optionTag||"<div></div>");y.setAttribute("data-value",t),y.setAttribute("data-title-value",e),y.setAttribute("tabIndex",l),y.classList.add("cursor-pointer"),y.setAttribute("data-id",r||`${this.optionId}`),a&&y.setAttribute("data-static","true"),r||this.optionId++,i&&y.classList.add("disabled"),n&&(this.isMultiple?this.value=[...this.value,t]:this.value=t),this.optionTemplate&&(m=(0,o.htmlToElement)(this.optionTemplate),y.append(m));const b=this.optionValueAsTitle?t:e;if(m?(g=m.querySelector("[data-title]"),g.textContent=b||""):y.textContent=b||"",s){const t=null!==(c=null===(d=s.apiFields)||void 0===d?void 0:d.icon)&&void 0!==c?c:s.icon,i=null!==(u=null===(h=s.apiFields)||void 0===h?void 0:h.description)&&void 0!==u?u:s.description;if(t){const i=(0,o.htmlToElement)(null!==(p=this.apiIconTag)&&void 0!==p?p:t);if(i.classList.add("max-w-full"),(this.apiUrl||s.apiFields)&&(i.setAttribute("alt",e),i.setAttribute("src",t)),m)v=m.querySelector("[data-icon]"),v.append(i);else{const e=(0,o.htmlToElement)("<div></div>");this.iconClasses&&(0,o.classToClassList)(this.iconClasses,e),e.append(i),y.append(e)}}if(Array.isArray(s.additionalClasses)&&s.additionalClasses.forEach(([e,t])=>{const i=e?y.querySelector(e):y;i&&t.forEach(e=>i.classList.add(e))}),i)if(y.dataset.description=i,m)f=m.querySelector("[data-description]"),f&&f.append(i);else{const e=(0,o.htmlToElement)("<div></div>");e.textContent=i,this.descriptionClasses&&(0,o.classToClassList)(this.descriptionClasses,e),y.append(e)}}m&&m.querySelector("[data-icon]")&&!s&&!(null==s?void 0:s.icon)&&m.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(t):this.value===t)&&y.classList.add("selected"),i||y.addEventListener("click",()=>this.onSelectOption(t)),this.optionClasses&&(0,o.classToClassList)(this.optionClasses,y),this.dropdown&&this.dropdown.append(y),n&&this.setNewValue()}buildOptionFromRemoteData(e,t,i=!1,n=!1,s="1",o,l){s?this.buildOption(e,t,i,n,l,s,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,n="",s="";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],o.id=`${i}`),e[this.apiFieldsMap.val]&&(s=`${e[this.apiFieldsMap.val]}`,o.val=s),e[this.apiFieldsMap.title]&&(n=e[this.apiFieldsMap.title],o.title=n,e[this.apiFieldsMap.val]||(s=n,o.val=s)),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]});const l=this.staticOptions.findIndex(e=>e.val===s);if(-1!==l)return void this.mergeRemoteDataIntoStaticOption(l,s,o,t);if(!this.dropdown.querySelector(`[data-value="${s}"]`)){const e=!!this.apiSelectedValues&&(Array.isArray(this.apiSelectedValues)?this.apiSelectedValues.includes(s):this.apiSelectedValues===s);this.buildOriginalOption(n,s,i,!1,e,o),this.buildOptionFromRemoteData(n,s,!1,e,`${t}`,i,o),e&&(this.isMultiple?(this.value||(this.value=[]),Array.isArray(this.value)&&(this.value=[...this.value,s])):this.value=s,this.toggle&&(this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.toggle.querySelector("[data-icon]")&&this.setToggleIcon()))}}),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")}mergeRemoteDataIntoStaticOption(e,t,i,n){const s=this.staticOptions[e];s.options||(s.options={}),s.options.apiFields||(s.options.apiFields={}),i.title&&(s.title=i.title),i.icon&&(s.options.apiFields.icon=i.icon),i.description&&(s.options.apiFields.description=i.description),Object.keys(i.rest).forEach(e=>{s.options.apiFields[e]=i.rest[e]});const l=this.dropdown.querySelector(`[data-value="${t}"][data-static]`);if(l){if(l.setAttribute("tabIndex",`${n}`),i.id&&l.setAttribute("data-id",`${i.id}`),i.title){l.setAttribute("data-title-value",i.title);const e=l.querySelector("[data-title]");e&&(e.textContent=i.title)}if(i.icon){const e=l.querySelector("[data-icon]");if(e){e.innerHTML="";const t=(0,o.htmlToElement)(this.apiIconTag||"<img />");t.classList.add("max-w-full"),t.setAttribute("alt",s.title),t.setAttribute("src",i.icon),e.append(t)}}if(i.description){l.dataset.description=i.description;const e=l.querySelector("[data-description]");e&&(e.textContent=i.description)}}const r=this.el.querySelector(`option[value="${t}"][data-static]`);if(r){i.id&&r.setAttribute("data-id",`${i.id}`),i.title&&(r.textContent=i.title);const e={id:i.id||"",val:i.val||"",title:i.title||"",icon:i.icon||null,description:i.description||null,rest:i.rest};r.setAttribute("data-hs-select-option",JSON.stringify(e))}const a=this.selectOptions.findIndex(e=>e.val===t);-1!==a&&(this.selectOptions[a]=s);(this.isMultiple?Array.isArray(this.value)&&this.value.includes(t):this.value===t)&&this.toggle&&(i.title&&(this.toggle.querySelector("[data-title]")?this.setToggleTitle():this.toggleTextWrapper&&(this.isMultiple?this.setToggleText(this.toggleTextWrapper,this.stringFromValue()):this.setToggleText(this.toggleTextWrapper,i.title))),i.icon&&this.toggle.querySelector("[data-icon]")&&this.setToggleIcon())}optionsFromRemoteData(){return n(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 n(this,arguments,void 0,function*(e="",t){var i,n,s,l,r,a,d,c,h,u;try{let p;try{p=new URL(this.apiUrl)}catch(e){try{p=new URL(this.apiUrl,window.location.origin)}catch(e){return console.error("Invalid API URL:",this.apiUrl),null}}const m=new URLSearchParams(null!==(i=this.apiQuery)&&void 0!==i?i:""),g=null!==(n=this.apiOptions)&&void 0!==n?n:{},v=Object.assign({},g);t&&(v.signal=t);const f=null!==(s=this.apiSearchQueryKey)&&void 0!==s?s:"q",y=(null!=e?e:"").trim().toLowerCase();if(""!==y&&m.set(f,y),this.apiLoadMore){const e="object"==typeof this.apiLoadMore?this.apiLoadMore.perPage:10,t=null!==(d=null!==(r=null===(l=this.apiFieldsMap)||void 0===l?void 0:l.page)&&void 0!==r?r:null===(a=this.apiFieldsMap)||void 0===a?void 0:a.offset)&&void 0!==d?d:"page",i=null!==(h=null===(c=this.apiFieldsMap)||void 0===c?void 0:c.limit)&&void 0!==h?h:"limit",n=Boolean(null===(u=this.apiFieldsMap)||void 0===u?void 0:u.offset)?0:1,s="number"==typeof this.apiPageStart?this.apiPageStart:n;m.delete(t),m.delete(i),m.set(t,String(s)),m.set(i,String(e))}p.search=m.toString(),this.fireEvent("request",{url:p.toString()}),(0,o.dispatch)("request.hs.select",this.el,{url:p.toString()});const b=yield fetch(p.toString(),v),w=yield b.json(),C=this.apiDataPart?w[this.apiDataPart]:w;return this.fireEvent("requestCompleted",{url:p.toString(),data:C}),(0,o.dispatch)("requestCompleted.hs.select",this.el,{url:p.toString(),data:C}),C}catch(e){"AbortError"!==(null==e?void 0:e.name)&&(console.error(e),this.fireEvent("requestCompleted",{url:this.apiUrl,error:e}),(0,o.dispatch)("requestCompleted.hs.select",this.el,{url:this.apiUrl,error:e}))}})}sortElements(e,t){if(this.hasOptgroup)return;const i=Array.from(e.querySelectorAll(t));this.isSelectedOptionOnTop&&i.sort((e,t)=>{const i=e.classList.contains("selected")||e.hasAttribute("selected"),n=t.classList.contains("selected")||t.hasAttribute("selected");return i&&!n?-1:!i&&n?1:0}),i.forEach((t,i)=>{e.appendChild(t),t.hasAttribute("tabindex")&&t.setAttribute("tabIndex",`${i}`)})}remoteSearch(e){return n(this,void 0,void 0,function*(){var t,i,n,s;if(this.requestId++,this.remoteSearchAbortController)try{this.remoteSearchAbortController.abort()}catch(e){}if(this.loadMoreAbortController)try{this.loadMoreAbortController.abort()}catch(e){}if(this.remoteSearchAbortController=new AbortController,this.currentPage=0,this.hasMore=!0,this.isLoading=!1,this.filterStaticOptions(e),e.length<=this.minSearchLength){const e=yield this.apiRequest("",null===(t=this.remoteSearchAbortController)||void 0===t?void 0:t.signal);if(!e)return!1;const n=Boolean(null===(i=this.apiFieldsMap)||void 0===i?void 0:i.offset)?0:1,s="number"==typeof this.apiPageStart?this.apiPageStart:n;this.currentPage=s;const o=Array.isArray(this.value)?this.value:this.value?[this.value]:[],l=this.remoteOptions.filter(e=>{var t;return o.includes(`${e[null===(t=this.apiFieldsMap)||void 0===t?void 0:t.val]}`)}),r=new Set(e.map(e=>{var t;return`${e[null===(t=this.apiFieldsMap)||void 0===t?void 0:t.val]}`}));return this.remoteOptions=[...e,...l.filter(e=>{var t;return!r.has(`${e[null===(t=this.apiFieldsMap)||void 0===t?void 0:t.val]}`)})],Array.from(this.dropdown.querySelectorAll("[data-value]:not([data-static])")).forEach(e=>{o.includes(e.getAttribute("data-value"))||e.remove()}),Array.from(this.el.querySelectorAll("option[value][data-hs-select-option]:not([data-static])")).forEach(e=>{o.includes(e.value)||e.remove()}),e.length?this.buildOptionsFromRemoteData(e):console.log("No data responded!"),!1}const o=yield this.apiRequest(e,null===(n=this.remoteSearchAbortController)||void 0===n?void 0:n.signal);if(!o)return;const l=Boolean(null===(s=this.apiFieldsMap)||void 0===s?void 0:s.offset)?0:1,r="number"==typeof this.apiPageStart?this.apiPageStart:l;this.currentPage=r;const a=Array.isArray(this.value)?this.value:this.value?[this.value]:[],d=this.remoteOptions.filter(e=>{var t;return a.includes(`${e[null===(t=this.apiFieldsMap)||void 0===t?void 0:t.val]}`)}),c=new Set(o.map(e=>{var t;return`${e[null===(t=this.apiFieldsMap)||void 0===t?void 0:t.val]}`}));this.remoteOptions=[...o,...d.filter(e=>{var t;return!c.has(`${e[null===(t=this.apiFieldsMap)||void 0===t?void 0:t.val]}`)})];let h=o.map(e=>`${e.id}`),u=null;const p=this.dropdown.querySelectorAll("[data-value]:not([data-static])");this.el.querySelectorAll("[data-hs-select-option]:not([data-static])").forEach(e=>{var t;const i=e.getAttribute("data-id");h.includes(i)||(null===(t=this.value)||void 0===t?void 0:t.includes(e.value))||this.destroyOriginalOption(e.value)}),p.forEach(e=>{var t;const i=e.getAttribute("data-id");h.includes(i)||(null===(t=this.value)||void 0===t?void 0:t.includes(e.getAttribute("data-value")))?h=h.filter(e=>e!==i):this.destroyOption(e.getAttribute("data-value"))}),u=o.filter(e=>h.includes(`${e.id}`)),u.length?this.buildOptionsFromRemoteData(u):console.log("No data responded!")})}filterStaticOptions(e){const t=this.dropdown.querySelectorAll("[data-value][data-static]"),i=e.trim().toLowerCase();t.forEach(e=>{var t,n;if(i.length<=this.minSearchLength)e.classList.remove("hidden");else{const s=(null===(t=e.getAttribute("data-title-value"))||void 0===t?void 0:t.toLowerCase())||"",o=(null===(n=e.dataset.description)||void 0===n?void 0:n.toLowerCase())||"";this.optionMatchesQuery(i,s,o)?e.classList.remove("hidden"):e.classList.add("hidden")}})}normalizeSearchText(e=""){return e.toLocaleLowerCase().replace(/\s+/g," ").trim()}tokenizeSearchQuery(e){return this.normalizeSearchText(e).split(" ").filter(Boolean)}charsSequenceMatch(e,t){const i=e.split("").map(e=>/\w/.test(e)?`${e}[\\W_]*`:"\\W*").join("");return new RegExp(i,"i").test(t)}optionMatchesQuery(e,t,i=""){const n=this.normalizeSearchText(e);if(!n)return!0;const s=this.normalizeSearchText(t),o=this.normalizeSearchText(i),l=this.preventSearchInsideDescription?[s]:[s,o];if("token-all"===this.searchMatchMode){const e=this.tokenizeSearchQuery(n);return l.some(t=>e.every(e=>t.includes(e)))}if("hybrid"===this.searchMatchMode){const e=this.tokenizeSearchQuery(n);return l.some(t=>{const i=e.every(e=>t.includes(e)),s=this.charsSequenceMatch(n,t);return i||s})}return"chars-sequence"===this.searchMatchMode?l.some(e=>this.charsSequenceMatch(n,e)):l.some(e=>e.includes(n))}destroyOption(e){const t=this.dropdown.querySelector(`[data-value="${e}"]`);if(!t)return!1;t.remove()}buildOriginalOption(e,t,i,n,s,l){const r=(0,o.htmlToElement)("<option></option>");r.setAttribute("value",t),n&&r.setAttribute("disabled","disabled"),s&&r.setAttribute("selected","selected"),i&&r.setAttribute("data-id",i),r.setAttribute("data-hs-select-option",JSON.stringify(null!=l?l:null)),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(){if(!this.tagsInputHelper)return;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,n=this.wrapper.offsetWidth-(parseInt(window.getComputedStyle(this.wrapper).paddingLeft)+parseInt(window.getComputedStyle(this.wrapper).paddingRight));this.tagsInput.style.width=`${Math.min(i,n)+2}px`}adjustInputWidth(){this.buildTagsInputHelper(),this.calculateInputWidth()}onSelectOption(e){if(this.clearSelections(),this.isMultiple?(Array.isArray(this.value)||(this.value=[]),this.value=this.value.includes(e)?this.value.filter(t=>t!==e):[...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.hasValue()||"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,o.dispatch)("change.hs.select",this.el,this.value)}addSelectOption(e,t,i,n,s){this.selectOptions=[...this.selectOptions,{title:e,val:t,disabled:i,selected:n,options:s}]}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(){const e=this.el.querySelectorAll("option");Array.from(this.dropdown.children).forEach(e=>{e.classList.contains("selected")&&e.classList.remove("selected")}),Array.from(e).forEach(e=>{e.selected&&(e.selected=!1)})}setNewValue(){if("tags"===this.mode)this.setTagsItems();else if(this.optionAllowEmptyOption&&""===this.value){const e=this.selectOptions.find(e=>""===e.val);this.setToggleText(this.toggleTextWrapper,(null==e?void 0:e.title)||null)}else if(this.hasValue())if(this.apiUrl){const e=this.dropdown.querySelector(`[data-value="${this.value}"]`);if(e)this.setToggleText(this.toggleTextWrapper,e.getAttribute("data-title-value")||null);else{const e=this.staticOptions.find(e=>e.val===this.value);if(e)this.setToggleText(this.toggleTextWrapper,e.title);else{const e=this.remoteOptions.find(e=>(e[this.apiFieldsMap.val]?`${e[this.apiFieldsMap.val]}`:e[this.apiFieldsMap.title])===this.value);this.setToggleText(this.toggleTextWrapper,e?`${e[this.apiFieldsMap.title]}`:this.stringFromValue())}}}else this.setToggleText(this.toggleTextWrapper,this.stringFromValue());else this.setToggleText(this.toggleTextWrapper,null)}stringFromValueBasic(e){var t;const i=[];let n="";if(e.forEach(e=>{this.isMultiple?Array.isArray(this.value)&&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),s=[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)&&s.push(this.toggleSeparators.betweenItemsAndCounter),this.toggleCountText)switch(this.toggleCountTextPlacement){case"postfix-no-space":s.push(`${o}${this.toggleCountText}`);break;case"prefix-no-space":s.push(`${this.toggleCountText}${o}`);break;case"prefix":s.push(`${this.toggleCountText} ${o}`);break;default:s.push(`${o} ${this.toggleCountText}`)}n=s.join(" ")}else n=`${i.length} ${this.toggleCountText}`;else n=i.join(this.toggleSeparators.items);return n}stringFromValueRemoteData(){if(!this.dropdown)return this.stringFromValueBasic(this.selectOptions);const e=this.dropdown.querySelectorAll("[data-title-value]"),t=[];let i="";if(e.forEach(e=>{const i=e.getAttribute("data-value"),n=e.getAttribute("data-title-value");this.isMultiple?Array.isArray(this.value)&&this.value.includes(i)&&t.push(n):this.value===i&&t.push(n)}),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(){const e=this.el.querySelectorAll("option");Array.from(e).find(e=>this.value===e.value).selected=!0;const t=Array.from(this.dropdown.children).find(e=>this.value===e.getAttribute("data-value"));t&&t.classList.add("selected"),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")}selectMultipleItems(){if(!Array.isArray(this.value))return;const e=this.el.querySelectorAll("option");Array.from(this.dropdown.children).filter(e=>this.value.includes(e.getAttribute("data-value"))).forEach(e=>e.classList.add("selected")),Array.from(e).filter(e=>this.value.includes(e.value)).forEach(e=>e.selected=!0),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")}unselectMultipleItems(){const e=this.el.querySelectorAll("option");Array.from(this.dropdown.children).forEach(e=>e.classList.remove("selected")),Array.from(e).forEach(e=>e.selected=!1),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")}searchOptions(e){if(e.length<=this.minSearchLength){this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null);return this.dropdown.querySelectorAll("[data-value]").forEach(e=>{e.classList.remove("hidden")}),!1}this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=(0,o.htmlToElement)(this.searchNoResultTemplate),this.searchNoResult.innerText=this.searchNoResultText,(0,o.classToClassList)(this.searchNoResultClasses,this.searchNoResult);const t=this.dropdown.querySelectorAll("[data-value]");let i,n=!1;this.searchLimit&&(i=0),t.forEach(t=>{var s;const o=t.getAttribute("data-title-value")||"",l=(null===(s=null==t?void 0:t.dataset)||void 0===s?void 0:s.description)||"";!this.optionMatchesQuery(e,o,l)||this.searchLimit&&i>=this.searchLimit?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()}setupAccessibility(){this.accessibilityComponent=window.HSAccessibilityObserver.registerComponent(this.wrapper,{onEnter:()=>{if(this._isOpened){const e=this.dropdown.querySelector(".hs-select-option-highlighted");e&&(this.onSelectOption(e.getAttribute("data-value")||""),this._isOpened&&e.focus())}else this.open()},onSpace:()=>{if(this._isOpened){const e=this.dropdown.querySelector(".hs-select-option-highlighted");e&&(this.onSelectOption(e.getAttribute("data-value")||""),this._isOpened&&e.focus())}else this.open()},onEsc:()=>{this._isOpened&&this.close(!0)},onArrow:e=>{if(!e.metaKey)if(this._isOpened||"ArrowDown"!==e.key){if(this._isOpened)switch(e.key){case"ArrowDown":this.focusMenuItem("next");break;case"ArrowUp":this.focusMenuItem("prev");break;case"Home":this.onStartEnd(!0);break;case"End":this.onStartEnd(!1)}}else this.open()},onHome:()=>{this._isOpened&&this.onStartEnd(!0)},onEnd:()=>{this._isOpened&&this.onStartEnd(!1)},onTab:()=>{this._isOpened&&this.close()},onShiftTab:()=>{this._isOpened&&this.close()}},this._isOpened,"Select",".hs-select",this.dropdown)}focusMenuItem(e){const t=Array.from(this.dropdown.querySelectorAll(":scope > *:not(.hidden)")).filter(e=>!e.classList.contains("disabled")&&!e.hasAttribute("data-optgroup"));if(!t.length)return;const i=this.dropdown.querySelector(".hs-select-option-highlighted"),n=i?t.indexOf(i):-1,s="next"===e?(n+1)%t.length:(n-1+t.length)%t.length;i&&i.classList.remove("hs-select-option-highlighted"),t[s].classList.add("hs-select-option-highlighted"),t[s].focus()}onStartEnd(e=!0){if(!this.dropdown)return;const t=Array.from(this.dropdown.querySelectorAll(":scope > *:not(.hidden)")).filter(e=>!e.classList.contains("disabled"));if(!t.length)return;const i=this.dropdown.querySelector(".hs-select-option-highlighted");i&&i.classList.remove("hs-select-option-highlighted");const n=e?0:t.length-1;t[n].classList.add("hs-select-option-highlighted"),t[n].focus()}destroy(){var e;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 t=this.el.parentElement.parentElement;this.el.classList.add("hidden"),this.el.style.display="",t.prepend(this.el),t.querySelector(".hs-select").remove(),this.wrapper=null,null===(e=this.disabledObserver)||void 0===e||e.disconnect(),this.disabledObserver=null,window.$hsSelectCollection=window.$hsSelectCollection.filter(({element:e})=>e.el!==this.el)}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"),"window"!==this.dropdownScope&&this.recalculateDirection(),setTimeout(()=>{var e;if((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.floatingUIInstance&&"window"===this.dropdownScope&&(this.floatingUIInstance.update(),this.dropdown.classList.remove("invisible")),this.hasSearch&&!this.preventSearchFocus&&this.search.focus(),this.animationInProcess=!1,this.scrollToSelected&&this.dropdown){const e=this.dropdown.querySelector(".selected");if(e){const t=this.dropdown.clientHeight,i=e.offsetTop-t/2+e.clientHeight/2;this.dropdown.scrollTop=i}}}),this._isOpened=!0,window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,this._isOpened)}close(e=!1){var t,i,n,s;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,o.afterTransition)(this.dropdown,()=>{var t;this.dropdown.classList.add("hidden"),this.hasSearch&&"tags"!==this.mode&&(this.search.value="",this.apiUrl?this.filterStaticOptions(""):this.search.dispatchEvent(new Event("input",{bubbles:!0})),this.search.blur()),e&&((null===(t=this.mode)||void 0===t?void 0:t.includes("tags"))?this.wrapper.focus():this.toggle.focus()),this.animationInProcess=!1}),null===(s=this.dropdown.querySelector(".hs-select-option-highlighted"))||void 0===s||s.classList.remove("hs-select-option-highlighted"),this._isOpened=!1,window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,this._isOpened)}addOption(e){let t=`${this.selectOptions.length}`;const i=e=>{const{title:i,val:n,disabled:s,selected:o,options:l}=e;!!this.selectOptions.some(e=>e.val===n)||(this.addSelectOption(i,n,s,o,l),this.buildOption(i,n,s,o,l,t),this.buildOriginalOption(i,n,null,s,o,l),o&&!this.isMultiple&&this.onSelectOption(n))};Array.isArray(e)?e.forEach(e=>{i(e)}):i(e),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")}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(),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")}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,o.isEnoughSpace)(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`)}isOpened(){return this._isOpened||!1}containsElement(e){var t;return(null===(t=this.wrapper)||void 0===t?void 0:t.contains(e))||!1}containsDropdownElement(e){var t;return(null===(t=this.dropdown)||void 0===t?void 0:t.contains(e))||!1}static findInCollection(e){return d.ensureGlobalHandlers(),window.$hsSelectCollection.find(t=>e instanceof d?t.element.el===e.el:"string"==typeof e?t.element.el===document.querySelector(e):t.element.el===e)||null}static getInstance(e,t){d.ensureGlobalHandlers();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(){d.ensureGlobalHandlers(),window.$hsSelectCollection&&(window.$hsSelectCollection=window.$hsSelectCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-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-hs-select"),i=t?JSON.parse(t):{};new d(e,i)}})}static ensureGlobalHandlers(){"undefined"!=typeof window&&(window.$hsSelectCollection||(window.$hsSelectCollection=[]),d.globalListenersInitialized||(d.globalListenersInitialized=!0,window.addEventListener("click",e=>{const t=e.target;d.closeCurrentlyOpened(t)})))}static open(e){const t=d.findInCollection(e);t&&!t.element.isOpened()&&t.element.open()}static close(e){const t=d.findInCollection(e);t&&t.element.isOpened()&&t.element.close()}static closeCurrentlyOpened(e=null){if(!e.closest(".hs-select.active")&&!e.closest("[data-hs-select-dropdown].opened")){const e=window.$hsSelectCollection.filter(e=>e.element.isOpened())||null;e&&e.forEach(e=>{e.element.close()})}}}d.globalListenersInitialized=!1,t.default=d},8572(e,t,i){"use strict";
|
|
142
142
|
/*
|
|
143
143
|
* HSStepper
|
|
144
|
-
* @version: 5.
|
|
144
|
+
* @version: 5.1.0
|
|
145
145
|
* @author: Preline Labs Ltd.
|
|
146
146
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
147
147
|
* Copyright 2024 Preline Labs Ltd.
|
|
148
|
-
*/var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(292),o=s(i(2961));class l extends o.default{constructor(e,t){super(e,t);const i=e.getAttribute("data-hs-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("success","skipped")),t.isCompleted&&(t.isCompleted=!1,t.isSkip=!1,t.el.classList.remove("success","skipped")),"linear"===this.mode&&this.currentIndex!==this.totalSteps&&(this.nextBtn&&(this.nextBtn.style.display=""),this.completeStepBtn&&(this.completeStepBtn.style.display="")),this.showSkipButton(),this.showFinishButton(),this.showCompleteStepButton()}}nextClick(){var e;if(this.fireEvent("beforeNext",this.currentIndex),(0,n.dispatch)("beforeNext.hs.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,n.dispatch)("beforeFinish.hs.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-hs-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,hasError:a=!1}=JSON.parse(e.getAttribute("data-hs-stepper-nav-item"));s&&e.classList.add("success"),n&&e.classList.add("skipped"),l&&("BUTTON"!==e.tagName&&"INPUT"!==e.tagName||e.setAttribute("disabled","disabled"),e.classList.add("disabled")),a&&e.classList.add("error"),this.navItems.push({index:t,isFinal:i,isCompleted:s,isSkip:n,isOptional:o,isDisabled:l,isProcessed:r,hasError: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,n.dispatch)("active.hs.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.hasError=!0,e.el.classList.add("error")}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-hs-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-hs-stepper-content-item"));s&&e.classList.add("success"),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.hasError=!1,e.isCompleted=!1,e.isDisabled=!1,e.el.classList.remove("error","success"),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-hs-stepper-back-btn]"),this.nextBtn=this.el.querySelector("[data-hs-stepper-next-btn]"),this.skipBtn=this.el.querySelector("[data-hs-stepper-skip-btn]"),this.completeStepBtn=this.el.querySelector("[data-hs-stepper-complete-step-btn]"),this.finishBtn=this.el.querySelector("[data-hs-stepper-finish-btn]"),this.resetBtn=this.el.querySelector("[data-hs-stepper-reset-btn]"),this.buildBackButton(),this.buildNextButton(),this.buildSkipButton(),this.buildCompleteStepButton(),this.buildFinishButton(),this.buildResetButton()}buildBackButton(){this.backBtn&&(this.checkForTheFirstStep(),this.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,n.dispatch)("back.hs.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,n.dispatch)("next.hs.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.hasError=!1,e.isDisabled=!1,t.isSkip=!1,e.el.classList.remove("skipped","success","error"),t.el.classList.remove("skipped","success","error")}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,n.dispatch)("skip.hs.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-hs-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("success")}showCompleteStepButton(){if(!this.completeStepBtn)return;1===this.getUncompletedSteps().length?this.completeStepBtn.style.display="none":this.completeStepBtn.style.display=""}handleCompleteStepButtonClick(){this.setCompleteItem(),this.fireEvent("complete",this.currentIndex),(0,n.dispatch)("complete.hs.stepper",this.el,this.currentIndex),this.handleNextButtonClick(!1),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton()}buildFinishButton(){this.finishBtn&&(this.isCompleted&&this.setCompleted(),this.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 s=this.navItems.find(({index:e})=>e===this.currentIndex);(s?s.el:null).classList.remove("active"),i.style.display="block",this.backBtn&&(this.backBtn.style.display="none"),this.nextBtn&&(this.nextBtn.style.display="none"),this.skipBtn&&(this.skipBtn.style.display="none"),this.completeStepBtn&&(this.completeStepBtn.style.display="none"),this.finishBtn&&(this.finishBtn.style.display="none"),this.resetBtn&&(this.resetBtn.style.display=""),t.length<=1&&(this.isCompleted=!0,this.setCompleted()),this.fireEvent("finish",this.currentIndex),(0,n.dispatch)("finish.hs.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("success","skipped")}),this.contentItems.forEach(e=>{const{el:t}=e;e.isSkip=!1,e.isCompleted=!1,this.unsetCurrentContentItemActions(t),t.classList.remove("success","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,n.dispatch)("reset.hs.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"))}goToFinish(){this.handleFinishButtonClick()}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-hs-stepper-nav-item]").forEach(e=>{e.classList.remove("active","success","skipped","disabled","error"),"BUTTON"!==e.tagName&&"INPUT"!==e.tagName||e.removeAttribute("disabled")}),this.el.querySelectorAll("[data-hs-stepper-content-item]").forEach(e=>{e.classList.remove("success","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-hs-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 l(e)})}}t.default=l},8962(e,t,i){"use strict";
|
|
148
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=n(i(2961));class l extends o.default{constructor(e,t){super(e,t);const i=e.getAttribute("data-hs-stepper"),n=i?JSON.parse(i):{},s=Object.assign(Object.assign({},n),t);this.currentIndex=(null==s?void 0:s.currentIndex)||1,this.mode=(null==s?void 0:s.mode)||"linear",this.isCompleted=void 0!==(null==s?void 0:s.isCompleted)&&(null==s?void 0:s.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("success","skipped")),t.isCompleted&&(t.isCompleted=!1,t.isSkip=!1,t.el.classList.remove("success","skipped")),"linear"===this.mode&&this.currentIndex!==this.totalSteps&&(this.nextBtn&&(this.nextBtn.style.display=""),this.completeStepBtn&&(this.completeStepBtn.style.display="")),this.showSkipButton(),this.showFinishButton(),this.showCompleteStepButton()}}nextClick(){var e;if(this.fireEvent("beforeNext",this.currentIndex),(0,s.dispatch)("beforeNext.hs.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.dispatch)("beforeFinish.hs.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-hs-stepper-nav-item]").forEach(e=>this.addNavItem(e)),this.navItems.forEach(e=>this.buildNavItem(e))}buildNavItem(e){const{index:t,isDisabled:i,el:n}=e;t===this.currentIndex&&this.setCurrentNavItem(),("linear"!==this.mode||i)&&(this.onNavItemClickListener.push({el:n,fn:()=>this.navItemClick(e)}),n.addEventListener("click",this.onNavItemClickListener.find(e=>e.el===n).fn))}addNavItem(e){const{index:t,isFinal:i=!1,isCompleted:n=!1,isSkip:s=!1,isOptional:o=!1,isDisabled:l=!1,isProcessed:r=!1,hasError:a=!1}=JSON.parse(e.getAttribute("data-hs-stepper-nav-item"));n&&e.classList.add("success"),s&&e.classList.add("skipped"),l&&("BUTTON"!==e.tagName&&"INPUT"!==e.tagName||e.setAttribute("disabled","disabled"),e.classList.add("disabled")),a&&e.classList.add("error"),this.navItems.push({index:t,isFinal:i,isCompleted:n,isSkip:s,isOptional:o,isDisabled:l,isProcessed:r,hasError: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.dispatch)("active.hs.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.hasError=!0,e.el.classList.add("error")}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-hs-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:n=!1,isSkip:s=!1}=JSON.parse(e.getAttribute("data-hs-stepper-content-item"));n&&e.classList.add("success"),s&&e.classList.add("skipped"),this.contentItems.push({index:t,isFinal:i,isCompleted:n,isSkip:s,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.hasError=!1,e.isCompleted=!1,e.isDisabled=!1,e.el.classList.remove("error","success"),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-hs-stepper-back-btn]"),this.nextBtn=this.el.querySelector("[data-hs-stepper-next-btn]"),this.skipBtn=this.el.querySelector("[data-hs-stepper-skip-btn]"),this.completeStepBtn=this.el.querySelector("[data-hs-stepper-complete-step-btn]"),this.finishBtn=this.el.querySelector("[data-hs-stepper-finish-btn]"),this.resetBtn=this.el.querySelector("[data-hs-stepper-reset-btn]"),this.buildBackButton(),this.buildNextButton(),this.buildSkipButton(),this.buildCompleteStepButton(),this.buildFinishButton(),this.buildResetButton()}buildBackButton(){this.backBtn&&(this.checkForTheFirstStep(),this.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.dispatch)("back.hs.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.dispatch)("next.hs.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.hasError=!1,e.isDisabled=!1,t.isSkip=!1,e.el.classList.remove("skipped","success","error"),t.el.classList.remove("skipped","success","error")}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.dispatch)("skip.hs.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-hs-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("success")}showCompleteStepButton(){if(!this.completeStepBtn)return;1===this.getUncompletedSteps().length?this.completeStepBtn.style.display="none":this.completeStepBtn.style.display=""}handleCompleteStepButtonClick(){this.setCompleteItem(),this.fireEvent("complete",this.currentIndex),(0,s.dispatch)("complete.hs.stepper",this.el,this.currentIndex),this.handleNextButtonClick(!1),this.showFinishButton(),this.showCompleteStepButton(),this.checkForTheFirstStep(),this.completeStepBtn&&this.changeTextAndDisableCompleteButtonIfStepCompleted(),this.showSkipButton()}buildFinishButton(){this.finishBtn&&(this.isCompleted&&this.setCompleted(),this.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.dispatch)("finish.hs.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("success","skipped")}),this.contentItems.forEach(e=>{const{el:t}=e;e.isSkip=!1,e.isCompleted=!1,this.unsetCurrentContentItemActions(t),t.classList.remove("success","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.dispatch)("reset.hs.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"))}goToFinish(){this.handleFinishButtonClick()}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-hs-stepper-nav-item]").forEach(e=>{e.classList.remove("active","success","skipped","disabled","error"),"BUTTON"!==e.tagName&&"INPUT"!==e.tagName||e.removeAttribute("disabled")}),this.el.querySelectorAll("[data-hs-stepper-content-item]").forEach(e=>{e.classList.remove("success","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-hs-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 l(e)})}}t.default=l},8962(e,t,i){"use strict";
|
|
149
149
|
/*
|
|
150
150
|
* HSStrongPassword
|
|
151
|
-
* @version: 5.
|
|
151
|
+
* @version: 5.1.0
|
|
152
152
|
* @author: Preline Labs Ltd.
|
|
153
153
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
154
154
|
* Copyright 2024 Preline Labs Ltd.
|
|
155
|
-
*/var
|
|
155
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=n(i(2961));class l extends o.default{constructor(e,t){super(e,t),this.isOpened=!1,this.strength=0,this.passedRules=new Set;const i=e.getAttribute("data-hs-strong-password"),n=i?JSON.parse(i):{},s=Object.assign(Object.assign({},n),t);this.target=(null==s?void 0:s.target)?"string"==typeof(null==s?void 0:s.target)?document.querySelector(s.target):s.target:null,this.hints=(null==s?void 0:s.hints)?"string"==typeof(null==s?void 0:s.hints)?document.querySelector(s.hints):s.hints:null,this.stripClasses=(null==s?void 0:s.stripClasses)||null,this.minLength=(null==s?void 0:s.minLength)||6,this.mode=(null==s?void 0:s.mode)||"default",this.popoverSpace=(null==s?void 0:s.popoverSpace)||10,this.checksExclude=(null==s?void 0:s.checksExclude)||[],this.availableChecks=["lowercase","uppercase","numbers","special-characters","min-length"].filter(e=>!this.checksExclude.includes(e)),this.specialCharactersSet=(null==s?void 0:s.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<this.availableChecks.length;e++){const e=(0,s.htmlToElement)("<div></div>");(0,s.classToClassList)(this.stripClasses,e),this.el.append(e)}}buildHints(){this.weakness=this.hints.querySelector("[data-hs-strong-password-hints-weakness-text]")||null,this.rules=Array.from(this.hints.querySelectorAll("[data-hs-strong-password-hints-rule-text]"))||null,this.rules.forEach(e=>{var t;const i=e.getAttribute("data-hs-strong-password-hints-rule-text");(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-hs-strong-password-hints-weakness-text"),t=JSON.parse(e);this.weakness.textContent=t[this.strength]}setRulesText(){this.rules.forEach(e=>{const t=e.getAttribute("data-hs-strong-password-hints-rule-text");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 n=0;return this.availableChecks.includes("lowercase")&&e.match(i.lowercase)&&(n+=1,t.add("lowercase")),this.availableChecks.includes("uppercase")&&e.match(i.uppercase)&&(n+=1,t.add("uppercase")),this.availableChecks.includes("numbers")&&e.match(i.numbers)&&(n+=1,t.add("numbers")),this.availableChecks.includes("special-characters")&&e.match(i["special-characters"])&&(n+=1,t.add("special-characters")),this.availableChecks.includes("min-length")&&e.length>=this.minLength&&(n+=1,t.add("min-length")),e.length||(n=0),n===this.availableChecks.length?this.el.classList.add("accepted"):this.el.classList.remove("accepted"),this.strength=n,this.passedRules=t,{strength:this.strength,rules:this.passedRules}}checkIfPassed(e,t=!1){const i=e.querySelector("[data-check]"),n=e.querySelector("[data-uncheck]");t?(e.classList.add("active"),i.classList.remove("hidden"),n.classList.add("hidden")):(e.classList.remove("active"),i.classList.add("hidden"),n.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.dispatch)("change.hs.strongPassword",this.el,n)}hideStrips(e){Array.from(this.el.children).forEach((t,i)=>{i<e?t.classList.add("passed"):t.classList.remove("passed")})}recalculateDirection(){(0,s.isEnoughSpace)(this.hints,this.target,"bottom",this.popoverSpace)?(this.hints.classList.remove("bottom-full"),this.hints.classList.add("top-full"),this.hints.style.marginBottom="",this.hints.style.marginTop=`${this.popoverSpace}px`):(this.hints.classList.remove("top-full"),this.hints.classList.add("bottom-full"),this.hints.style.marginTop="",this.hints.style.marginBottom=`${this.popoverSpace}px`)}destroy(){this.target.removeEventListener("input",this.onTargetInputListener),this.target.removeEventListener("focus",this.onTargetFocusListener),this.target.removeEventListener("blur",this.onTargetBlurListener),this.target.removeEventListener("input",this.onTargetInputSecondListener),this.target.removeEventListener("input",this.onTargetInputThirdListener),window.$hsStrongPasswordCollection=window.$hsStrongPasswordCollection.filter(({element:e})=>e.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-hs-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-hs-strong-password"),i=t?JSON.parse(t):{};new l(e,i)}})}}t.default=l},5803(e,t,i){"use strict";
|
|
156
156
|
/*
|
|
157
157
|
* HSTabs
|
|
158
|
-
* @version: 5.
|
|
158
|
+
* @version: 5.1.0
|
|
159
159
|
* @author: Preline Labs Ltd.
|
|
160
160
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
161
161
|
* Copyright 2024 Preline Labs Ltd.
|
|
162
|
-
*/var
|
|
162
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=n(i(2961)),l=n(i(248)),r=i(8223);class a extends o.default{constructor(e,t,i){var n,s;super(e,t,i);const o=e.getAttribute("data-hs-tabs"),l=o?JSON.parse(o):{},a=Object.assign(Object.assign({},l),t);this.eventType=null!==(n=a.eventType)&&void 0!==n?n:"click",this.preventNavigationResolution="number"==typeof a.preventNavigationResolution?a.preventNavigationResolution:r.BREAKPOINTS[a.preventNavigationResolution]||null,this.toggles=this.el.querySelectorAll("[data-hs-tab]"),this.extraToggleId=this.el.getAttribute("data-hs-tab-select"),this.extraToggle=this.extraToggleId?document.querySelector(this.extraToggleId):null,this.current=Array.from(this.toggles).find(e=>e.classList.contains("active")),this.currentContentId=(null===(s=this.current)||void 0===s?void 0:s.getAttribute("data-hs-tab"))||null,this.currentContent=this.currentContentId?document.querySelector(this.currentContentId):null,this.prev=null,this.prevContentId=null,this.prevContent=null,this.onToggleHandler=[],this.init()}toggle(e){this.open(e)}extraToggleChange(e){this.change(e)}init(){this.createCollection(window.$hsTabsCollection,this),this.toggles.forEach(e=>{const t=t=>{"click"===this.eventType&&this.preventNavigationResolution&&document.body.clientWidth<=+this.preventNavigationResolution&&t.preventDefault(),this.toggle(e)},i=e=>{this.preventNavigationResolution&&document.body.clientWidth<=+this.preventNavigationResolution&&e.preventDefault()};this.onToggleHandler.push({el:e,fn:t,preventClickFn:i}),"click"===this.eventType?e.addEventListener("click",t):(e.addEventListener("mouseenter",t),e.addEventListener("click",i))}),this.extraToggle&&(this.onExtraToggleChangeListener=e=>this.extraToggleChange(e),this.extraToggle.addEventListener("change",this.onExtraToggleChangeListener)),"undefined"!=typeof window&&(window.HSAccessibilityObserver||(window.HSAccessibilityObserver=new l.default),this.setupAccessibility())}open(e){var t,i,n,o,l;this.prev=this.current,this.prevContentId=this.currentContentId,this.prevContent=this.currentContent,this.current=e,this.currentContentId=e.getAttribute("data-hs-tab"),this.currentContent=this.currentContentId?document.querySelector(this.currentContentId):null,(null===(t=null==this?void 0:this.prev)||void 0===t?void 0:t.ariaSelected)&&(this.prev.ariaSelected="false"),null===(i=this.prev)||void 0===i||i.classList.remove("active"),null===(n=this.prevContent)||void 0===n||n.classList.add("hidden"),(null===(o=null==this?void 0:this.current)||void 0===o?void 0:o.ariaSelected)&&(this.current.ariaSelected="true"),this.current.classList.add("active"),null===(l=this.currentContent)||void 0===l||l.classList.remove("hidden"),this.fireEvent("change",{el:e,prev:this.prevContentId,current:this.currentContentId,tabsId:this.el.id}),(0,s.dispatch)("change.hs.tab",e,{el:e,prev:this.prevContentId,current:this.currentContentId,tabsId:this.el.id})}change(e){const t=document.querySelector(`[data-hs-tab="${e.target.value}"]`);t&&("hover"===this.eventType?t.dispatchEvent(new Event("mouseenter")):t.click())}setupAccessibility(){this.accessibilityComponent=window.HSAccessibilityObserver.registerComponent(this.el,{onArrow:e=>{if(e.metaKey)return;const t="true"===this.el.getAttribute("data-hs-tabs-vertical")||"vertical"===this.el.getAttribute("aria-orientation");switch(e.key){case t?"ArrowUp":"ArrowLeft":this.onArrow(!0);break;case t?"ArrowDown":"ArrowRight":this.onArrow(!1);break;case"Home":this.onStartEnd(!0);break;case"End":this.onStartEnd(!1)}}},!0,"Tabs",'[role="tablist"]')}onArrow(e=!0){const t=e?Array.from(this.toggles).reverse():Array.from(this.toggles),i=t.find(e=>document.activeElement===e);let n=t.findIndex(e=>e===i);n=n+1<t.length?n+1:0,t[n].focus(),t[n].click()}onStartEnd(e=!0){const t=e?Array.from(this.toggles):Array.from(this.toggles).reverse();t.length&&(t[0].focus(),t[0].click())}destroy(){this.toggles.forEach(e=>{var t;const i=null===(t=this.onToggleHandler)||void 0===t?void 0:t.find(({el:t})=>t===e);i&&("click"===this.eventType?e.removeEventListener("click",i.fn):(e.removeEventListener("mouseenter",i.fn),e.removeEventListener("click",i.preventClickFn)))}),this.onToggleHandler=[],this.extraToggle&&this.extraToggle.removeEventListener("change",this.onExtraToggleChangeListener),"undefined"!=typeof window&&window.HSAccessibilityObserver&&window.HSAccessibilityObserver.unregisterComponent(this.accessibilityComponent),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=[]),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 a(e)})}static open(e){const t=window.$hsTabsCollection.find(t=>Array.from(t.element.toggles).includes("string"==typeof e?document.querySelector(e):e)),i=t?Array.from(t.element.toggles).find(t=>t===("string"==typeof e?document.querySelector(e):e)):null;i&&!i.classList.contains("active")&&t.element.open(i)}static on(e,t,i){const n=window.$hsTabsCollection.find(e=>Array.from(e.element.toggles).includes("string"==typeof t?document.querySelector(t):t));n&&(n.element.events[e]=i)}}t.default=a},6473(e,t,i){"use strict";
|
|
163
163
|
/*
|
|
164
164
|
* HSTextareaAutoHeight
|
|
165
|
-
* @version: 5.
|
|
165
|
+
* @version: 5.1.0
|
|
166
166
|
* @author: Preline Labs Ltd.
|
|
167
167
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
168
168
|
* Copyright 2024 Preline Labs Ltd.
|
|
169
|
-
*/var
|
|
169
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=n(i(2961));class o extends s.default{constructor(e,t){super(e,t);const i=e.getAttribute("data-hs-copy-markup"),n=i?JSON.parse(i):{},s=Object.assign(Object.assign({},n),t);this.defaultHeight=(null==s?void 0:s.defaultHeight)||0,this.init()}elementInput(){this.textareaSetHeight(3)}init(){this.createCollection(window.$hsTextareaAutoHeightCollection,this),this.setAutoHeight()}setAutoHeight(){this.isParentHidden()?this.callbackAccordingToType():this.textareaSetHeight(3),this.onElementInputListener=()=>this.elementInput(),this.el.addEventListener("input",this.onElementInputListener)}textareaSetHeight(e=0){this.el.style.height="auto",this.el.style.height=this.checkIfOneLine()&&this.defaultHeight?`${this.defaultHeight}px`:`${this.el.scrollHeight+e}px`}checkIfOneLine(){const e=this.el.clientHeight;return!(this.el.scrollHeight>e)}isParentHidden(){return this.el.closest(".hs-overlay.hidden")||this.el.closest('[role="tabpanel"].hidden')||this.el.closest(".hs-collapse.hidden")}parentType(){return this.el.closest(".hs-collapse")?"collapse":this.el.closest(".hs-overlay")?"overlay":!!this.el.closest('[role="tabpanel"]')&&"tabs"}callbackAccordingToType(){var e;if("collapse"===this.parentType()){const e=this.el.closest(".hs-collapse").id,{element:t}=window.HSCollapse.getInstance(`[data-hs-collapse="#${e}"]`,!0);t.on("beforeOpen",()=>{if(!this.el)return!1;this.textareaSetHeight(3)})}else if("overlay"===this.parentType()){const e=window.HSOverlay.getInstance(this.el.closest(".hs-overlay"),!0);e.element.on("open",()=>{window.$hsTextareaAutoHeightCollection.filter(({element:t})=>t.el.closest(".hs-overlay")===e.element.el).forEach(({element:e})=>e.textareaSetHeight(3))})}else{if("tabs"!==this.parentType())return!1;{const t=null===(e=this.el.closest('[role="tabpanel"]'))||void 0===e?void 0:e.id,i=document.querySelector(`[data-hs-tab="#${t}"]`).closest('[role="tablist"]'),{element:n}=window.HSTabs.getInstance(i,!0)||null;n.on("change",e=>{const t=document.querySelectorAll(`${e.current} [data-hs-textarea-auto-height]`);if(!t.length)return!1;t.forEach(e=>{const t=window.HSTextareaAutoHeight.getInstance(e,!0)||null;t&&t.element.textareaSetHeight(3)})})}}}destroy(){this.el.removeEventListener("input",this.onElementInputListener),window.$hsTextareaAutoHeightCollection=window.$hsTextareaAutoHeightCollection.filter(({element:e})=>e.el!==this.el)}static getInstance(e,t){const i=window.$hsTextareaAutoHeightCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e));return i?t?i:i.element:null}static autoInit(){window.$hsTextareaAutoHeightCollection||(window.$hsTextareaAutoHeightCollection=[]),window.$hsTextareaAutoHeightCollection&&(window.$hsTextareaAutoHeightCollection=window.$hsTextareaAutoHeightCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-textarea-auto-height]:not(.--prevent-on-load-init)").forEach(e=>{if(!window.$hsTextareaAutoHeightCollection.find(t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e})){const t=e.getAttribute("data-hs-textarea-auto-height"),i=t?JSON.parse(t):{};new o(e,i)}})}}t.default=o},9419(e,t,i){"use strict";
|
|
170
170
|
/*
|
|
171
171
|
* HSThemeSwitch
|
|
172
|
-
* @version: 5.
|
|
172
|
+
* @version: 5.1.0
|
|
173
173
|
* @author: Preline Labs Ltd.
|
|
174
174
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
175
175
|
* Copyright 2024 Preline Labs Ltd.
|
|
176
|
-
*/var
|
|
176
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=n(i(2961));class o extends s.default{constructor(e,t){super(e,t);const i=e.getAttribute("data-hs-theme-switch"),n=i?JSON.parse(i):{},s=Object.assign(Object.assign({},n),t);this.theme=(null==s?void 0:s.theme)||localStorage.getItem("hs_theme")||"default",this.type=(null==s?void 0:s.type)||"change",this.init()}elementChange(e){const t=e.target.checked?"dark":"default";this.setAppearance(t),this.toggleObserveSystemTheme()}elementClick(e){this.setAppearance(e),this.toggleObserveSystemTheme()}init(){this.createCollection(window.$hsThemeSwitchCollection,this),"default"!==this.theme&&this.setAppearance(),"click"===this.type?this.buildSwitchTypeOfClick():this.buildSwitchTypeOfChange()}buildSwitchTypeOfChange(){this.el.checked="dark"===this.theme,this.toggleObserveSystemTheme(),this.onElementChangeListener=e=>this.elementChange(e),this.el.addEventListener("change",this.onElementChangeListener)}buildSwitchTypeOfClick(){const e=this.el.getAttribute("data-hs-theme-click-value");this.toggleObserveSystemTheme(),this.onElementClickListener=()=>this.elementClick(e),this.el.addEventListener("click",this.onElementClickListener)}setResetStyles(){const e=document.createElement("style");return e.innerText="*{transition: unset !important;}",e.setAttribute("data-hs-appearance-onload-styles",""),document.head.appendChild(e),e}addSystemThemeObserver(){o.systemThemeObserver||(o.systemThemeObserver=e=>{var t;null===(t=window.$hsThemeSwitchCollection)||void 0===t||t.forEach(e=>{"auto"===localStorage.getItem("hs_theme")&&e.element.setAppearance("auto",!1)})},window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",o.systemThemeObserver))}removeSystemThemeObserver(){o.systemThemeObserver&&(window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",o.systemThemeObserver),o.systemThemeObserver=null)}toggleObserveSystemTheme(){"auto"===localStorage.getItem("hs_theme")?this.addSystemThemeObserver():this.removeSystemThemeObserver()}setAppearance(e=this.theme,t=!0,i=!0){const n=document.querySelector("html"),s=this.setResetStyles();t&&localStorage.setItem("hs_theme",e);let o=e;"default"===o&&(o="light"),"auto"===o&&(o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),n.classList.remove("light","dark","default","auto"),"auto"===e?n.classList.add("auto",o):n.classList.add(o),setTimeout(()=>s.remove()),i&&window.dispatchEvent(new CustomEvent("on-hs-appearance-change",{detail:e}))}destroy(){"change"===this.type&&this.el.removeEventListener("change",this.onElementChangeListener),"click"===this.type&&this.el.removeEventListener("click",this.onElementClickListener),window.$hsThemeSwitchCollection=window.$hsThemeSwitchCollection.filter(({element:e})=>e.el!==this.el)}static getInstance(e,t){const i=window.$hsThemeSwitchCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e));return i?t?i:i.element.el:null}static autoInit(){window.$hsThemeSwitchCollection||(window.$hsThemeSwitchCollection=[]),window.$hsThemeSwitchCollection&&(window.$hsThemeSwitchCollection=window.$hsThemeSwitchCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-theme-switch]:not(.--prevent-on-load-init)").forEach(e=>{window.$hsThemeSwitchCollection.find(t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e})||new o(e,{type:"change"})}),document.querySelectorAll("[data-hs-theme-click-value]:not(.--prevent-on-load-init)").forEach(e=>{window.$hsThemeSwitchCollection.find(t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e})||new o(e,{type:"click"})})}}o.systemThemeObserver=null,t.default=o},1717(e,t,i){"use strict";
|
|
177
177
|
/*
|
|
178
178
|
* HSToggleCount
|
|
179
|
-
* @version: 5.
|
|
179
|
+
* @version: 5.1.0
|
|
180
180
|
* @author: Preline Labs Ltd.
|
|
181
181
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
182
182
|
* Copyright 2024 Preline Labs Ltd.
|
|
183
|
-
*/var
|
|
183
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=n(i(2961));class o extends s.default{constructor(e,t){super(e,t);const i=e.getAttribute("data-hs-toggle-count"),n=i?JSON.parse(i):{},s=Object.assign(Object.assign({},n),t);this.target=(null==s?void 0:s.target)?"string"==typeof(null==s?void 0:s.target)?document.querySelector(s.target):s.target:null,this.min=(null==s?void 0:s.min)||0,this.max=(null==s?void 0:s.max)||0,this.duration=(null==s?void 0:s.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 n=s=>{i||(i=s);const o=Math.min((s-i)/this.duration,1);this.el.innerText=String(Math.floor(o*(t-e)+e)),o<1&&window.requestAnimationFrame(n)};window.requestAnimationFrame(n)}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-hs-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 o(e)})}}t.default=o},8549(e,t,i){"use strict";
|
|
184
184
|
/*
|
|
185
185
|
* HSTogglePassword
|
|
186
|
-
* @version: 5.
|
|
186
|
+
* @version: 5.1.0
|
|
187
187
|
* @author: Preline Labs Ltd.
|
|
188
188
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
189
189
|
* Copyright 2024 Preline Labs Ltd.
|
|
190
|
-
*/var
|
|
190
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=n(i(2961));class l extends o.default{constructor(e,t){super(e,t);const i=e.getAttribute("data-hs-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.isFormElement)(this.el)?"change":"click",this.isMultiple=this.target.length>1&&!!this.el.closest("[data-hs-toggle-password-group]"),this.target&&this.init()}elementAction(){this.isShown?this.hide():this.show(),this.fireEvent("toggle",this.target),(0,s.dispatch)("toggle.hs.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-hs-toggle-password-group]").querySelectorAll("[data-hs-toggle-password]"),t=[];return e.forEach(e=>{t.push(l.getInstance(e))}),t}show(){if(this.isMultiple){this.getMultipleToggles().forEach(e=>!!e&&(e.isShown=!0)),this.el.closest("[data-hs-toggle-password-group]").classList.add("active")}else this.isShown=!0,this.el.classList.add("active");this.target.forEach(e=>{e.type="text"})}hide(){if(this.isMultiple){this.getMultipleToggles().forEach(e=>!!e&&(e.isShown=!1)),this.el.closest("[data-hs-toggle-password-group]").classList.remove("active")}else this.isShown=!1,this.el.classList.remove("active");this.target.forEach(e=>{e.type="password"})}destroy(){this.isMultiple?this.el.closest("[data-hs-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-hs-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 l(e)})}}t.default=l},4986(e,t,i){"use strict";
|
|
191
191
|
/*
|
|
192
192
|
* HSTooltip
|
|
193
|
-
* @version: 5.
|
|
193
|
+
* @version: 5.1.0
|
|
194
194
|
* @author: Preline Labs Ltd.
|
|
195
195
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
196
196
|
* Copyright 2024 Preline Labs Ltd.
|
|
197
|
-
*/var
|
|
197
|
+
*/var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(s,o){function l(e){try{a(n.next(e))}catch(e){o(e)}}function r(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(l,r)}a((n=n.apply(e,t||[])).next())})},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(949),l=i(292),r=s(i(2961)),a=i(8223);class d extends r.default{constructor(e,t,i){super(e,t,i),this.cleanupAutoUpdate=null,window.$hsTooltipCollection||(window.$hsTooltipCollection=[]),this.el&&(this.toggle=this.el.querySelector(".hs-tooltip-toggle")||this.el,this.content=this.el.querySelector(".hs-tooltip-content"),this.eventMode=(0,l.getClassProperty)(this.el,"--trigger")||"hover",this.preventFloatingUI=(0,l.getClassProperty)(this.el,"--prevent-popper","false"),this.placement=(0,l.getClassProperty)(this.el,"--placement")||"top",this.strategy=(0,l.getClassProperty)(this.el,"--strategy"),this.scope=(0,l.getClassProperty)(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)}hideOtherTooltips(){window.$hsTooltipCollection&&window.$hsTooltipCollection.forEach(({element:e})=>e.el!==this.el&&(!!e.el.classList.contains("show")&&void e.hide()))}init(){this.createCollection(window.$hsTooltipCollection,this),this.onToggleFocusListener=()=>this.enter(),this.onToggleBlurListener=()=>this.hide(),this.toggle.addEventListener("focus",this.onToggleFocusListener),this.toggle.addEventListener("blur",this.onToggleBlurListener),"focus"===this.eventMode?(this.onToggleTouchListener=e=>{"touch"===e.pointerType&&this.enter()},this.toggle.addEventListener("pointerdown",this.onToggleTouchListener),this.onDocumentTouchListener=e=>{"touch"===e.pointerType&&(this.el.contains(e.target)||this.leave())},document.addEventListener("pointerdown",this.onDocumentTouchListener)):"click"===this.eventMode?(this.onToggleClickListener=()=>this.toggleClick(),this.toggle.addEventListener("click",this.onToggleClickListener)):"hover"===this.eventMode&&(this.onToggleMouseEnterListener=()=>this.toggleMouseEnter(),this.onToggleMouseLeaveListener=()=>this.toggleMouseLeave(),this.toggle.addEventListener("mouseenter",this.onToggleMouseEnterListener),this.toggle.addEventListener("mouseleave",this.onToggleMouseLeaveListener))}enter(){this._show()}leave(){this.hide()}click(){if(this.el.classList.contains("show"))return!1;this._show(),this.onToggleHandleListener=()=>{setTimeout(()=>this.toggleHandle())},this.toggle.addEventListener("click",this.onToggleHandleListener,!0),this.toggle.addEventListener("blur",this.onToggleHandleListener,!0)}focus(){this._show()}positionTooltip(e){return n(this,void 0,void 0,function*(){const t="auto"===e?"top":e,i="auto"===e?["bottom","left","right"]:this.getFallbackPlacements(t),n=[(0,o.offset)(5),(0,o.flip)({fallbackPlacements:i})];return yield(0,o.computePosition)(this.toggle,this.content,{placement:t,strategy:this.strategy||"fixed",middleware:n})})}getFallbackPlacements(e){switch(e){case"top":return["bottom","left","right"];case"bottom":return["top","left","right"];case"left":return["right","top","bottom"];case"right":return["left","top","bottom"];case"top-start":return["bottom-start","top-end","bottom-end"];case"top-end":return["bottom-end","top-start","bottom-start"];case"bottom-start":return["top-start","bottom-end","top-end"];case"bottom-end":return["top-end","bottom-start","top-start"];case"left-start":return["right-start","left-end","right-end"];case"left-end":return["right-end","left-start","right-start"];case"right-start":return["left-start","right-end","left-end"];case"right-end":return["left-end","right-start","left-start"];default:return["top","bottom","left","right"]}}applyTooltipPosition(e,t,i){Object.assign(this.content.style,{position:this.strategy||"fixed",left:`${e}px`,top:`${t}px`}),this.content.setAttribute("data-placement",i)}buildFloatingUI(){"window"===this.scope&&document.body.appendChild(this.content);const e=this.placement.startsWith("auto"),t=(0,l.getClassProperty)(this.el,"--placement"),i=e||(!t||""===t)?"auto":a.POSITIONS[this.placement]||this.placement;this.positionTooltip(i).then(e=>{this.applyTooltipPosition(e.x,e.y,e.placement)}),this.cleanupAutoUpdate=(0,o.autoUpdate)(this.toggle,this.content,()=>{this.positionTooltip(i).then(e=>{Object.assign(this.content.style,{position:this.strategy||"fixed",left:`${e.x}px`,top:`${e.y}px`}),this.content.setAttribute("data-placement",e.placement)})})}_show(){if(this.el.classList.contains("show"))return!1;this.hideOtherTooltips(),this.content.classList.remove("hidden"),"window"===this.scope&&this.content.classList.add("show"),"false"!==this.preventFloatingUI||this.cleanupAutoUpdate||this.buildFloatingUI(),setTimeout(()=>{this.el.classList.add("show"),this.fireEvent("show",this.el),(0,l.dispatch)("show.hs.tooltip",this.el,this.el)})}show(){"click"===this.eventMode?this.click():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.preventFloatingUI&&this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null),this.fireEvent("hide",this.el),(0,l.dispatch)("hide.hs.tooltip",this.el,this.el),(0,l.afterTransition)(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"),this.toggle.removeEventListener("focus",this.onToggleFocusListener),this.toggle.removeEventListener("blur",this.onToggleBlurListener),"focus"===this.eventMode?(this.onToggleTouchListener&&this.toggle.removeEventListener("pointerdown",this.onToggleTouchListener),this.onDocumentTouchListener&&document.removeEventListener("pointerdown",this.onDocumentTouchListener)):"click"===this.eventMode?this.toggle.removeEventListener("click",this.onToggleClickListener):"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.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null),window.$hsTooltipCollection=window.$hsTooltipCollection.filter(({element:e})=>e.el!==this.el)}static findInCollection(e){return window.$hsTooltipCollection.find(t=>e instanceof d?t.element.el===e.el:"string"==typeof e?t.element.el===document.querySelector(e):t.element.el===e)||null}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(".hs-tooltip:not(.--prevent-on-load-init)").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 d(e)})}static show(e){const t=d.findInCollection(e);t&&t.element.show()}static hide(e){const t=d.findInCollection(e);t&&t.element.hide()}static on(e,t,i){const n=d.findInCollection(t);n&&(n.element.events[e]=i)}}t.default=d},4957(e,t,i){"use strict";
|
|
198
198
|
/*
|
|
199
199
|
* HSTreeView
|
|
200
|
-
* @version: 5.
|
|
200
|
+
* @version: 5.1.0
|
|
201
201
|
* @author: Preline Labs Ltd.
|
|
202
202
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
203
203
|
* Copyright 2024 Preline Labs Ltd.
|
|
204
|
-
*/var
|
|
204
|
+
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(292),o=n(i(2961));class l extends o.default{constructor(e,t,i){var n;super(e,t,i),this.items=[];const s=e.getAttribute("data-hs-tree-view"),o=s?JSON.parse(s):{},l=Object.assign(Object.assign({},o),t);this.controlBy=(null==l?void 0:l.controlBy)||"button",this.autoSelectChildren=(null==l?void 0:l.autoSelectChildren)||!1,this.isIndeterminate=null===(n=null==l?void 0:l.isIndeterminate)||void 0===n||n,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.dispatch)("click.hs.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),l.group+=1,this.initItems()}initItems(){this.el.querySelectorAll("[data-hs-tree-view-item]").forEach((e,t)=>{var i,n;const s=JSON.parse(e.getAttribute("data-hs-tree-view-item"));e.id||(e.id=`tree-view-item-${l.group}-${t}`);const o=Object.assign(Object.assign({},s),{id:null!==(i=s.id)&&void 0!==i?i:e.id,path:this.getPath(e),isSelected:null!==(n=s.isSelected)&&void 0!==n&&n});this.items.push(o),"checkbox"===this.controlBy?this.controlByCheckbox(e,o):this.controlByButton(e,o)})}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 n=e.closest("[data-hs-tree-view-item]");for(;n;){const e=JSON.parse(n.getAttribute("data-hs-tree-view-item"));i.push(e.value),n=null===(t=n.parentElement)||void 0===t?void 0:t.closest("[data-hs-tree-view-item]")}return i.reverse().join("/")}unselectItem(e=null){let t=this.getSelectedItems();e&&(t=t.filter(t=>t.id!==e.id)),t.length&&t.forEach(e=>{document.querySelector(`#${e.id}`).classList.remove("selected"),this.changeItemProp(e.id,"isSelected",!1)})}selectItem(e,t){t.isSelected?(e.classList.remove("selected"),this.changeItemProp(t.id,"isSelected",!1)):(e.classList.add("selected"),this.changeItemProp(t.id,"isSelected",!0))}selectChildren(e,t){const i=e.querySelectorAll("[data-hs-tree-view-item]");Array.from(i).filter(e=>!e.classList.contains("disabled")).forEach(e=>{const i=e.id?this.getItem(e.id):null;if(!i)return!1;t.isSelected?(e.classList.add("selected"),this.changeItemProp(i.id,"isSelected",!0)):(e.classList.remove("selected"),this.changeItemProp(i.id,"isSelected",!1));const n=this.getItem(e.id),s=e.querySelector(`input[value="${n.value}"]`);this.isIndeterminate&&(s.indeterminate=!1),n.isSelected?s.checked=!0:s.checked=!1})}toggleParent(e){var t,i;let n=null===(t=e.parentElement)||void 0===t?void 0:t.closest("[data-hs-tree-view-item]");for(;n;){const e=n.querySelectorAll("[data-hs-tree-view-item]:not(.disabled)"),t=JSON.parse(n.getAttribute("data-hs-tree-view-item")),s=n.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?(n.classList.remove("selected"),this.changeItemProp(n.id,"isSelected",!1),s.checked=!1):(n.classList.add("selected"),this.changeItemProp(n.id,"isSelected",!0),s.checked=!0),this.isIndeterminate&&(l>0&&l<e.length?s.indeterminate=!0:s.indeterminate=!1),n=null===(i=n.parentElement)||void 0===i?void 0:i.closest("[data-hs-tree-view-item]")}}update(){this.items.map(e=>{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(n=>(n.id===e&&(n[t]=i),n))}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),l.group-=1}static findInCollection(e){return window.$hsTreeViewCollection.find(t=>e instanceof l?t.element.el===e.el:"string"==typeof e?t.element.el===document.querySelector(e):t.element.el===e)||null}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-hs-tree-view]:not(.--prevent-on-load-init)").forEach(e=>{window.$hsTreeViewCollection.find(t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e})||new l(e)})}static on(e,t,i){const n=l.findInCollection(t);n&&(n.element.events[e]=i)}}l.group=0,t.default=l},292(e,t){"use strict";
|
|
205
205
|
/*
|
|
206
|
-
* @version: 5.
|
|
206
|
+
* @version: 5.1.0
|
|
207
207
|
* @author: Preline Labs Ltd.
|
|
208
208
|
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
|
|
209
209
|
* Copyright 2024 Preline Labs Ltd.
|
|
210
|
-
*/Object.defineProperty(t,"__esModule",{value:!0}),t.stringToBoolean=t.menuSearchHistory=t.isScrollable=t.isParentOrElementHidden=t.isJson=t.isIpadOS=t.isIOS=t.isFormElement=t.isFocused=t.isEnoughSpace=t.isDirectChild=t.htmlToElement=t.getZIndex=t.getHighestZIndex=t.getClassPropertyAlt=t.getClassProperty=t.dispatch=t.debounce=t.classToClassList=t.afterTransition=void 0;t.stringToBoolean=e=>"true"===e;t.getClassProperty=(e,t,i="")=>(window.getComputedStyle(e).getPropertyValue(t)||i).replace(" ","");t.getClassPropertyAlt=(e,t,i="")=>{let
|
|
211
|
-
/*! name: vanilla-calendar-pro v3.
|
|
212
|
-
!function(e){"use strict";var t=Object.defineProperty,i=Object.defineProperties,s=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,r=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,a=(e,t)=>{for(var i in t||(t={}))o.call(t,i)&&r(e,i,t[i]);if(n)for(var i of n(t))l.call(t,i)&&r(e,i,t[i]);return e},c=(e,t,i)=>(r(e,"symbol"!=typeof t?t+"":t,i),i);const d=e=>`${e} is not found, check the first argument passed to new Calendar.`,h='The calendar has not been initialized, please initialize it using the "init()" method first.',u="You specified an incorrect language label or did not specify the required number of values for «locale.weekdays» or «locale.months».",p="The value of the time property can be: false, 12 or 24.",m="For the «multiple» calendar type, the «displayMonthsCount» parameter can have a value from 2 to 12, and for all others it cannot be greater than 1.",g=(e,t,i)=>{e.context[t]=i},v=new WeakSet,f="data-vc-prev-tabindex",y=e=>e.tabIndex>=0&&!e.hasAttribute("disabled")&&"true"!==e.getAttribute("aria-disabled"),b=e=>{if(e.hasAttribute(f))return;const t=e.getAttribute("tabindex");e.setAttribute(f,null!=t?t:"")},w=e=>{if(!e.hasAttribute(f))return;const t=e.getAttribute(f);""===t||null===t?e.removeAttribute("tabindex"):e.setAttribute("tabindex",t),e.removeAttribute(f)},C=e=>{e.context.isShowInInputMode&&e.context.currentType&&(e.context.mainElement.dataset.vcCalendarHidden="",g(e,"isShowInInputMode",!1),e.inputMode&&(e=>{y(e)&&(b(e),e.tabIndex=-1);const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>y(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;t.nextNode();){const e=t.currentNode;b(e),e.tabIndex=-1}})(e.context.mainElement),e.context.cleanupHandlers[0]&&(e.context.cleanupHandlers.forEach(e=>e()),g(e,"cleanupHandlers",[])),e.inputMode&&e.context.inputElement&&e.context.mainElement.contains(document.activeElement)&&(("function"==typeof e.openOnFocus||!0===e.openOnFocus)&&(e=>{v.add(e)})(e),e.context.inputElement.focus()),e.onHide&&e.onHide(e))};function S(e){if(!e||!e.getBoundingClientRect)return{top:0,bottom:0,left:0,right:0};const t=e.getBoundingClientRect(),i=document.documentElement;return{bottom:t.bottom,right:t.right,top:t.top+window.scrollY-i.clientTop,left:t.left+window.scrollX-i.clientLeft}}function x(){return{vw:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),vh:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}function T(e){const{top:t,left:i}={left:window.scrollX||document.documentElement.scrollLeft||0,top:window.scrollY||document.documentElement.scrollTop||0},{top:s,left:n}=S(e),{vh:o,vw:l}=x(),r=s-t,a=n-i;return{top:r,bottom:o-(r+e.clientHeight),left:a,right:l-(a+e.clientWidth)}}function L(e,t,i=5){const s={top:!0,bottom:!0,left:!0,right:!0},n=[];if(!t||!e)return{canShow:s,parentPositions:n};const{bottom:o,top:l}=T(e),{top:r,left:a}=S(e),{height:c,width:d}=t.getBoundingClientRect(),{vh:h,vw:u}=x(),p=u/2,m=h/2;return[{condition:r<m,position:"top"},{condition:r>m,position:"bottom"},{condition:a<p,position:"left"},{condition:a>p,position:"right"}].forEach(({condition:e,position:t})=>{e&&n.push(t)}),Object.assign(s,{top:c<=l-i,bottom:c<=o-i,left:d<=a,right:d<=u-a}),{canShow:s,parentPositions:n}}const E=(e,t)=>{var i;e.popups&&(null==(i=Object.entries(e.popups))||i.forEach(([i,s])=>((e,t,i,s)=>{var n;const o=s.querySelector(`[data-vc-date="${t}"]`),l=null==o?void 0:o.querySelector("[data-vc-date-btn]");if(!o||!l)return;if((null==i?void 0:i.modifier)&&l.classList.add(...i.modifier.trim().split(" ")),!(null==i?void 0:i.html))return;const r=document.createElement("div");r.className=e.styles.datePopup,r.dataset.vcDatePopup="",r.innerHTML=e.sanitizerHTML(i.html),l.ariaExpanded="true",l.ariaLabel=`${l.ariaLabel}, ${null==(n=null==r?void 0:r.textContent)?void 0:n.replace(/^\s+|\s+(?=\s)|\s+$/g,"").replace(/ /g," ")}`,o.appendChild(r),requestAnimationFrame(()=>{if(!r)return;const{canShow:e}=L(o,r),t=e.bottom?o.offsetHeight:-r.offsetHeight,i=e.left&&!e.right?o.offsetWidth-r.offsetWidth/2:!e.left&&e.right?r.offsetWidth/2:0;Object.assign(r.style,{left:`${i}px`,top:`${t}px`})})})(e,i,s,t)))},k=e=>new Date(`${e}T00:00:00`),I=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,A=e=>e.reduce((e,t)=>{if(t instanceof Date||"number"==typeof t){const i=t instanceof Date?t:new Date(t);e.push(i.toISOString().substring(0,10))}else t.match(/^(\d{4}-\d{2}-\d{2})$/g)?e.push(t):t.replace(/(\d{4}-\d{2}-\d{2}).*?(\d{4}-\d{2}-\d{2})/g,(t,i,s)=>{const n=k(i),o=k(s),l=new Date(n.getTime());for(;l<=o;l.setDate(l.getDate()+1))e.push(I(l));return t});return e},[]),M=(e,t,i,s="")=>{t?e.setAttribute(i,s):e.getAttribute(i)===s&&e.removeAttribute(i)},O=(e,t,i,s,n,o,l)=>{var r,a,c,d;const h=k(e.context.displayDateMin)>k(o)||k(e.context.displayDateMax)<k(o)||(null==(r=e.context.disableDates)?void 0:r.includes(o))||!e.selectionMonthsMode&&"current"!==l||!e.selectionYearsMode&&k(o).getFullYear()!==t;M(i,h,"data-vc-date-disabled"),s&&M(s,h,"aria-disabled","true"),s&&M(s,h,"tabindex","-1"),M(i,!e.disableToday&&e.context.dateToday===o,"data-vc-date-today"),M(i,!e.disableToday&&e.context.dateToday===o,"aria-current","date"),M(i,null==(a=e.selectedWeekends)?void 0:a.includes(n),"data-vc-date-weekend");const u=(null==(c=e.selectedHolidays)?void 0:c[0])?A(e.selectedHolidays):[];if(M(i,u.includes(o),"data-vc-date-holiday"),(null==(d=e.context.selectedDates)?void 0:d.includes(o))?(i.setAttribute("data-vc-date-selected",""),s&&s.setAttribute("aria-selected","true"),e.context.selectedDates.length>1&&"multiple-ranged"===e.selectionDatesMode&&(e.context.selectedDates[0]===o&&e.context.selectedDates[e.context.selectedDates.length-1]===o?i.setAttribute("data-vc-date-selected","first-and-last"):e.context.selectedDates[0]===o?i.setAttribute("data-vc-date-selected","first"):e.context.selectedDates[e.context.selectedDates.length-1]===o&&i.setAttribute("data-vc-date-selected","last"),e.context.selectedDates[0]!==o&&e.context.selectedDates[e.context.selectedDates.length-1]!==o&&i.setAttribute("data-vc-date-selected","middle"))):i.hasAttribute("data-vc-date-selected")&&(i.removeAttribute("data-vc-date-selected"),s&&s.removeAttribute("aria-selected")),!e.context.disableDates.includes(o)&&e.enableEdgeDatesOnly&&e.context.selectedDates.length>1&&"multiple-ranged"===e.selectionDatesMode){const t=k(e.context.selectedDates[0]),s=k(e.context.selectedDates[e.context.selectedDates.length-1]),n=k(o);M(i,n>t&&n<s,"data-vc-date-selected","middle")}},D=(e,t)=>{const i=k(e),s=(i.getDay()-t+7)%7;i.setDate(i.getDate()+4-s);const n=new Date(i.getFullYear(),0,1),o=Math.ceil(((+i-+n)/864e5+1)/7);return{year:i.getFullYear(),week:o}},P=(e,t,i,s,n,o)=>{const l=k(n).getDay(),r="string"==typeof e.locale&&e.locale.length?e.locale:"en",a=document.createElement("div");let c;a.className=e.styles.date,a.dataset.vcDate=n,a.dataset.vcDateMonth=o,a.dataset.vcDateWeekDay=String(l),a.role="gridcell",("current"===o||e.displayDatesOutside)&&(c=document.createElement("button"),c.className=e.styles.dateBtn,c.type="button",c.ariaLabel=((e,t,i)=>new Date(`${e}T00:00:00.000Z`).toLocaleString(t,i))(n,r,{dateStyle:"long",timeZone:"UTC"}),c.dataset.vcDateBtn="",c.innerText=String(s),a.appendChild(c)),e.enableWeekNumbers&&((e,t,i)=>{const s=D(i,e.firstWeekday);s&&(t.dataset.vcDateWeekNumber=String(s.week))})(e,a,n),((e,t,i)=>{var s,n,o,l,r;const a=null==(s=e.disableWeekdays)?void 0:s.includes(i),c=e.disableAllDates&&!!(null==(n=e.context.enableDates)?void 0:n[0]);!a&&!c||(null==(o=e.context.enableDates)?void 0:o.includes(t))||(null==(l=e.context.disableDates)?void 0:l.includes(t))||(e.context.disableDates.push(t),null==(r=e.context.disableDates)||r.sort((e,t)=>+new Date(e)-+new Date(t)))})(e,n,l),O(e,t,a,c,l,n,o),i.addDate(a),e.onCreateDateEls&&e.onCreateDateEls(e,a)},$=e=>{const t=new Date(e.context.selectedYear,e.context.selectedMonth,1),i=e.context.mainElement.querySelectorAll('[data-vc="dates"]'),s=e.context.mainElement.querySelectorAll('[data-vc-week="numbers"]');i.forEach((i,n)=>{e.selectionDatesMode||(i.dataset.vcDatesDisabled=""),i.textContent="";const o=new Date(t);o.setMonth(o.getMonth()+n);const l=o.getMonth(),r=o.getFullYear(),a=(new Date(r,l,1).getDay()-e.firstWeekday+7)%7,c=new Date(r,l+1,0).getDate(),d=a+c,h=Math.ceil(d/7),u=7*h-d,p=[];for(let t=0;t<h;t++){const t=document.createElement("div");t.className=e.styles.datesRow,t.setAttribute("data-vc-dates","row"),t.setAttribute("role","row"),p.push(t)}let m=0,g=0;const v={addDate:e=>{p[m].appendChild(e),g++,g>=7&&(m++,g=0)}};((e,t,i,s,n)=>{let o=new Date(i,s,0).getDate()-(n-1);const l=0===s?i-1:i,r=0===s?12:s<10?`0${s}`:s;for(let s=n;s>0;s--,o++)P(e,i,t,o,`${l}-${r}-${o}`,"prev")})(e,v,r,l,a),((e,t,i,s,n)=>{for(let o=1;o<=i;o++){const i=new Date(s,n,o);P(e,s,t,o,I(i),"current")}})(e,v,c,r,l),((e,t,i,s,n)=>{const o=n+1===12?s+1:s,l=n+1===12?"01":n+2<10?`0${n+2}`:n+2;for(let n=1;n<=i;n++){const i=n<10?`0${n}`:String(n);P(e,s,t,n,`${o}-${l}-${i}`,"next")}})(e,v,u,r,l);for(const e of p)i.appendChild(e);E(e,i),((e,t,i,s,n)=>{if(!e.enableWeekNumbers)return;s.textContent="";const o=document.createElement("b");o.className=e.styles.weekNumbersTitle,o.innerText="#",o.dataset.vcWeekNumbers="title",s.appendChild(o);const l=document.createElement("div");l.className=e.styles.weekNumbersContent,l.dataset.vcWeekNumbers="content",s.appendChild(l);const r=document.createElement("button");r.type="button",r.className=e.styles.weekNumber;const a=n.querySelectorAll("[data-vc-date]"),c=Math.ceil((t+i)/7);for(let t=0;t<c;t++){const i=a[0===t?6:7*t].dataset.vcDate,s=D(i,e.firstWeekday);if(!s)return;const n=r.cloneNode(!0);n.innerText=String(s.week),n.dataset.vcWeekNumber=String(s.week),n.dataset.vcWeekYear=String(s.year),n.role="rowheader",n.ariaLabel=`${s.week}`,l.appendChild(n)}})(e,a,c,s[n],i)})},N=e=>`\n <div class="${e.styles.header}" data-vc="header" role="toolbar" aria-label="${e.labels.navigation}">\n <#ArrowPrev [month] />\n <div class="${e.styles.headerContent}" data-vc-header="content">\n <#Month />\n <#Year />\n </div>\n <#ArrowNext [month] />\n </div>\n <div class="${e.styles.wrapper}" data-vc="wrapper">\n <#WeekNumbers />\n <div class="${e.styles.content}" data-vc="content" role="grid">\n <#Week />\n <#Dates />\n <#DateRangeTooltip />\n </div>\n </div>\n <#ControlTime />\n`,H=e=>`\n <div class="${e.styles.header}" data-vc="header" role="toolbar" aria-label="${e.labels.navigation}">\n <div class="${e.styles.headerContent}" data-vc-header="content">\n <#Month />\n <#Year />\n </div>\n </div>\n <div class="${e.styles.wrapper}" data-vc="wrapper">\n <div class="${e.styles.content}" data-vc="content">\n <#Months />\n </div>\n </div>\n`,B=e=>`\n <div class="${e.styles.controls}" data-vc="controls" role="toolbar" aria-label="${e.labels.navigation}">\n <#ArrowPrev [month] />\n <#ArrowNext [month] />\n </div>\n <div class="${e.styles.grid}" data-vc="grid">\n <#Multiple>\n <div class="${e.styles.column}" data-vc="column" role="region">\n <div class="${e.styles.header}" data-vc="header">\n <div class="${e.styles.headerContent}" data-vc-header="content">\n <#Month />\n <#Year />\n </div>\n </div>\n <div class="${e.styles.wrapper}" data-vc="wrapper">\n <#WeekNumbers />\n <div class="${e.styles.content}" data-vc="content" role="grid">\n <#Week />\n <#Dates />\n </div>\n </div>\n </div>\n <#/Multiple>\n <#DateRangeTooltip />\n </div>\n <#ControlTime />\n`,q=e=>`\n <div class="${e.styles.header}" data-vc="header" role="toolbar" aria-label="${e.labels.navigation}">\n <#ArrowPrev [year] />\n <div class="${e.styles.headerContent}" data-vc-header="content">\n <#Month />\n <#Year />\n </div>\n <#ArrowNext [year] />\n </div>\n <div class="${e.styles.wrapper}" data-vc="wrapper">\n <div class="${e.styles.content}" data-vc="content">\n <#Years />\n </div>\n </div>\n`,F={ArrowNext:(e,t)=>`<button type="button" class="${e.styles.arrowNext}" data-vc-arrow="next" aria-label="${e.labels.arrowNext[t]}"></button>`,ArrowPrev:(e,t)=>`<button type="button" class="${e.styles.arrowPrev}" data-vc-arrow="prev" aria-label="${e.labels.arrowPrev[t]}"></button>`,ControlTime:e=>e.selectionTimeMode?`<div class="${e.styles.time}" data-vc="time" role="group" aria-label="${e.labels.selectingTime}"></div>`:"",Dates:e=>`<div class="${e.styles.dates}" data-vc="dates" aria-live="assertive" aria-label="${e.labels.dates}" ${"multiple"===e.type?"aria-multiselectable":""}></div>`,DateRangeTooltip:e=>e.onCreateDateRangeTooltip?`<div class="${e.styles.dateRangeTooltip}" data-vc-date-range-tooltip="hidden"></div>`:"",Month:e=>`<button type="button" class="${e.styles.month}" data-vc="month"></button>`,Months:e=>`<div class="${e.styles.months}" data-vc="months" role="grid" aria-live="assertive" aria-label="${e.labels.months}"></div>`,Week:e=>`<div class="${e.styles.week}" data-vc="week" role="row" aria-label="${e.labels.week}"></div>`,WeekNumbers:e=>e.enableWeekNumbers?`<div class="${e.styles.weekNumbers}" data-vc-week="numbers" role="row" aria-label="${e.labels.weekNumber}"></div>`:"",Year:e=>`<button type="button" class="${e.styles.year}" data-vc="year"></button>`,Years:e=>`<div class="${e.styles.years}" data-vc="years" role="grid" aria-live="assertive" aria-label="${e.labels.years}"></div>`},_=(e,t)=>t.replace(/[\n\t]/g,"").replace(/<#(?!\/?Multiple)(.*?)>/g,(t,i)=>{const s=(i.match(/\[(.*?)\]/)||[])[1],n=i.replace(/[/\s\n\t]|\[(.*?)\]/g,""),o=F[n],l=o?o(e,null!=s?s:null):"";return e.sanitizerHTML(l)}).replace(/[\n\t]/g,""),R=(e,t)=>{const i={default:N,month:H,year:q,multiple:B};if(Object.keys(i).forEach(t=>{const s=t;e.layouts[s].length||(e.layouts[s]=i[s](e))}),e.context.mainElement.className=e.styles.calendar,e.context.mainElement.dataset.vc="calendar",e.context.mainElement.dataset.vcType=e.context.currentType,e.context.mainElement.role="application",e.context.mainElement.tabIndex=0,e.context.mainElement.ariaLabel=e.labels.application,"multiple"!==e.context.currentType){if("multiple"===e.type&&t){const i=e.context.mainElement.querySelector('[data-vc="controls"]'),s=e.context.mainElement.querySelector('[data-vc="grid"]'),n=t.closest('[data-vc="column"]');return i&&i.remove(),s&&(s.dataset.vcGrid="hidden"),n&&(n.dataset.vcColumn=e.context.currentType),void(n&&(n.innerHTML=e.sanitizerHTML(_(e,e.layouts[e.context.currentType]))))}e.context.mainElement.innerHTML=e.sanitizerHTML(_(e,e.layouts[e.context.currentType]))}else e.context.mainElement.innerHTML=e.sanitizerHTML(((e,t)=>t.replace(new RegExp("<#Multiple>(.*?)<#\\/Multiple>","gs"),(t,i)=>{const s=Array(e.context.displayMonthsCount).fill(i).join("");return e.sanitizerHTML(s)}).replace(/[\n\t]/g,""))(e,_(e,e.layouts[e.context.currentType])))},V=(e,t,i,s)=>{e.style.visibility=i?"hidden":"",t.style.visibility=s?"hidden":""},j=e=>{if("month"===e.context.currentType)return;const t=e.context.mainElement.querySelector('[data-vc-arrow="prev"]'),i=e.context.mainElement.querySelector('[data-vc-arrow="next"]');if(!t||!i)return;const s={default:()=>((e,t,i)=>{const s=k(I(new Date(e.context.selectedYear,e.context.selectedMonth,1))),n=new Date(s.getTime()),o=new Date(s.getTime());n.setMonth(n.getMonth()-e.monthsToSwitch),o.setMonth(o.getMonth()+e.monthsToSwitch);const l=k(e.context.dateMin),r=k(e.context.dateMax);e.selectionYearsMode||(l.setFullYear(s.getFullYear()),r.setFullYear(s.getFullYear()));const a=!e.selectionMonthsMode||n.getFullYear()<l.getFullYear()||n.getFullYear()===l.getFullYear()&&n.getMonth()<l.getMonth(),c=!e.selectionMonthsMode||o.getFullYear()>r.getFullYear()||o.getFullYear()===r.getFullYear()&&o.getMonth()>r.getMonth()-(e.context.displayMonthsCount-1);V(t,i,a,c)})(e,t,i),year:()=>((e,t,i)=>{const s=k(e.context.dateMin),n=k(e.context.dateMax),o=!!(s.getFullYear()&&e.context.displayYear-7<=s.getFullYear()),l=!!(n.getFullYear()&&e.context.displayYear+7>=n.getFullYear());V(t,i,o,l)})(e,t,i)};s["multiple"===e.context.currentType?"default":e.context.currentType]()},z=e=>{const t=e.context.mainElement.querySelectorAll('[data-vc="month"]'),i=e.context.mainElement.querySelectorAll('[data-vc="year"]'),s=new Date(e.context.selectedYear,e.context.selectedMonth,1);[t,i].forEach(t=>null==t?void 0:t.forEach((t,i)=>((e,t,i,s,n)=>{const o=new Date(s.setFullYear(e.context.selectedYear,e.context.selectedMonth+i)).getFullYear(),l=new Date(s.setMonth(e.context.selectedMonth+i)).getMonth(),r=e.context.locale.months.long[l],a=t.closest('[data-vc="column"]');a&&(a.ariaLabel=`${r} ${o}`);const c={month:{id:l,label:r},year:{id:o,label:o}};t.innerText=String(c[n].label),t.dataset[`vc${n.charAt(0).toUpperCase()+n.slice(1)}`]=String(c[n].id),t.ariaLabel=`${e.labels[n]} ${c[n].label}`;const d={month:e.selectionMonthsMode,year:e.selectionYearsMode},h=!1===d[n]||"only-arrows"===d[n];h&&(t.tabIndex=-1),t.disabled=h})(e,t,i,s,t.dataset.vc)))},W=(e,t,i,s,n)=>{var o;const l={month:"[data-vc-months-month]",year:"[data-vc-years-year]"},r={month:{selected:"data-vc-months-month-selected",aria:"aria-selected",value:"vcMonthsMonth",selectedProperty:"selectedMonth"},year:{selected:"data-vc-years-year-selected",aria:"aria-selected",value:"vcYearsYear",selectedProperty:"selectedYear"}};n&&(null==(o=e.context.mainElement.querySelectorAll(l[i]))||o.forEach(e=>{e.removeAttribute(r[i].selected),e.removeAttribute(r[i].aria)}),g(e,r[i].selectedProperty,Number(t.dataset[r[i].value])),z(e),"year"===i&&j(e)),s&&(t.setAttribute(r[i].selected,""),t.setAttribute(r[i].aria,"true"))},U=(e,t)=>{var i;if("multiple"!==e.type)return{currentValue:null,columnID:0};const s=e.context.mainElement.querySelectorAll('[data-vc="column"]'),n=Array.from(s).findIndex(e=>e.closest(`[data-vc-column="${t}"]`));return{currentValue:n>=0?Number(null==(i=s[n].querySelector(`[data-vc="${t}"]`))?void 0:i.getAttribute(`data-vc-${t}`)):null,columnID:Math.max(n,0)}},Y=(e,t,i,s,n,o,l)=>{const r=t.cloneNode(!1);return r.className=e.styles.monthsMonth,r.innerText=s,r.ariaLabel=n,r.role="gridcell",r.dataset.vcMonthsMonth=`${l}`,o&&(r.ariaDisabled="true"),o&&(r.tabIndex=-1),r.disabled=o,W(e,r,"month",i===l,!1),r},K=(e,t)=>{var i,s;const n=null==(i=null==t?void 0:t.closest('[data-vc="header"]'))?void 0:i.querySelector('[data-vc="year"]'),o=n?Number(n.dataset.vcYear):e.context.selectedYear,l=(null==t?void 0:t.dataset.vcMonth)?Number(t.dataset.vcMonth):e.context.selectedMonth;g(e,"currentType","month"),R(e,t),z(e);const r=e.context.mainElement.querySelector('[data-vc="months"]');if(!e.selectionMonthsMode||!r)return;const a=e.monthsToSwitch>1?e.context.locale.months.long.map((t,i)=>l-e.monthsToSwitch*i).concat(e.context.locale.months.long.map((t,i)=>l+e.monthsToSwitch*i)).filter(e=>e>=0&&e<=12):Array.from(Array(12).keys()),c=document.createElement("button");c.type="button";for(let t=0;t<12;t++){const i=k(e.context.dateMin),s=k(e.context.dateMax),n=e.context.displayMonthsCount-1,{columnID:d}=U(e,"month"),h=o<=i.getFullYear()&&t<i.getMonth()+d||o>=s.getFullYear()&&t>s.getMonth()-n+d||o>s.getFullYear()||t!==l&&!a.includes(t),u=Y(e,c,l,e.context.locale.months.short[t],e.context.locale.months.long[t],h,t);r.appendChild(u),e.onCreateMonthEls&&e.onCreateMonthEls(e,u)}null==(s=e.context.mainElement.querySelector("[data-vc-months-month]:not([disabled])"))||s.focus()},Q=(e,t,i,s,n)=>`\n <label class="${t}" data-vc-time-input="${e}">\n <input type="text" name="${e}" maxlength="2" aria-label="${i[`input${e.charAt(0).toUpperCase()+e.slice(1)}`]}" value="${s}" ${n?"disabled":""}>\n </label>\n`,J=(e,t,i,s,n,o,l)=>`\n <label class="${t}" data-vc-time-range="${e}">\n <input type="range" name="${e}" min="${s}" max="${n}" step="${o}" aria-label="${i[`range${e.charAt(0).toUpperCase()+e.slice(1)}`]}" value="${l}">\n </label>\n`,Z=(e,t,i,s)=>{({hour:()=>g(e,"selectedHours",i),minute:()=>g(e,"selectedMinutes",i)})[s](),g(e,"selectedTime",`${e.context.selectedHours}:${e.context.selectedMinutes}${e.context.selectedKeeping?` ${e.context.selectedKeeping}`:""}`),e.onChangeTime&&e.onChangeTime(e,t,!1),e.inputMode&&e.context.inputElement&&e.context.mainElement&&e.onChangeToInput&&e.onChangeToInput(e,t)},G=(e,t)=>{var i;return(null==(i={0:{AM:"00",PM:"12"},1:{AM:"01",PM:"13"},2:{AM:"02",PM:"14"},3:{AM:"03",PM:"15"},4:{AM:"04",PM:"16"},5:{AM:"05",PM:"17"},6:{AM:"06",PM:"18"},7:{AM:"07",PM:"19"},8:{AM:"08",PM:"20"},9:{AM:"09",PM:"21"},10:{AM:"10",PM:"22"},11:{AM:"11",PM:"23"},12:{AM:"00",PM:"12"}}[Number(e)])?void 0:i[t])||String(e)},X=e=>({0:"12",13:"01",14:"02",15:"03",16:"04",17:"05",18:"06",19:"07",20:"08",21:"09",22:"10",23:"11"}[Number(e)]||String(e)),ee=(e,t,i,s)=>{e.value=i,t.value=s},te=(e,t,i,s,n,o,l)=>{const r={hour:(r,a,c)=>{if(!e.selectionTimeMode)return;const d={12:()=>{if(!e.context.selectedKeeping)return;const d=Number(G(a,e.context.selectedKeeping));if(!(d<=o&&d>=l))return ee(i,t,e.context.selectedHours,e.context.selectedHours),void(e.onChangeTime&&e.onChangeTime(e,c,!0));ee(i,t,X(a),G(a,e.context.selectedKeeping)),r>12&&((e,t,i)=>{t&&i&&(g(e,"selectedKeeping",i),t.innerText=i)})(e,s,"PM"),Z(e,c,X(a),n)},24:()=>{if(!(r<=o&&r>=l))return ee(i,t,e.context.selectedHours,e.context.selectedHours),void(e.onChangeTime&&e.onChangeTime(e,c,!0));ee(i,t,a,a),Z(e,c,a,n)}};d[e.selectionTimeMode]()},minute:(s,r,a)=>{if(!(s<=o&&s>=l))return i.value=e.context.selectedMinutes,void(e.onChangeTime&&e.onChangeTime(e,a,!0));i.value=r,t.value=r,Z(e,a,r,n)}},a=e=>{const t=Number(i.value),s=i.value.padStart(2,"0");r[n]&&r[n](t,s,e)};return i.addEventListener("change",a),()=>{i.removeEventListener("change",a)}},ie=(e,t,i,s,n)=>{const o=o=>{const l=Number(t.value),r=t.value.padStart(2,"0"),a="hour"===n,c=24===e.selectionTimeMode,d=l>0&&l<12;a&&!c&&((e,t,i)=>{t&&(g(e,"selectedKeeping",i),t.innerText=i)})(e,s,0===l||d?"AM":"PM"),((e,t,i,s,n)=>{t.value=n,Z(e,i,n,s)})(e,i,o,n,!a||c||d?r:X(t.value))};return t.addEventListener("input",o),()=>{t.removeEventListener("input",o)}},se=e=>e.setAttribute("data-vc-input-focus",""),ne=e=>e.removeAttribute("data-vc-input-focus"),oe=(e,t)=>{const i=t.querySelector('[data-vc-time-range="hour"] input[name="hour"]'),s=t.querySelector('[data-vc-time-range="minute"] input[name="minute"]'),n=t.querySelector('[data-vc-time-input="hour"] input[name="hour"]'),o=t.querySelector('[data-vc-time-input="minute"] input[name="minute"]'),l=t.querySelector('[data-vc-time="keeping"]');if(!(i&&s&&n&&o))return;const r=e=>{e.target===i&&se(n),e.target===s&&se(o)},a=e=>{e.target===i&&ne(n),e.target===s&&ne(o)};return t.addEventListener("mouseover",r),t.addEventListener("mouseout",a),te(e,i,n,l,"hour",e.timeMaxHour,e.timeMinHour),te(e,s,o,l,"minute",e.timeMaxMinute,e.timeMinMinute),ie(e,i,n,l,"hour"),ie(e,s,o,l,"minute"),l&&((e,t,i,s,n)=>{const o=o=>{const l="AM"===e.context.selectedKeeping?"PM":"AM",r=G(e.context.selectedHours,l);Number(r)<=s&&Number(r)>=n?(g(e,"selectedKeeping",l),i.value=r,Z(e,o,e.context.selectedHours,"hour"),t.ariaLabel=`${e.labels.btnKeeping} ${e.context.selectedKeeping}`,t.innerText=e.context.selectedKeeping):e.onChangeTime&&e.onChangeTime(e,o,!0)};t.addEventListener("click",o)})(e,l,i,e.timeMaxHour,e.timeMinHour),()=>{t.removeEventListener("mouseover",r),t.removeEventListener("mouseout",a)}},le=e=>{const t=e.selectedWeekends?[...e.selectedWeekends]:[],i=[...e.context.locale.weekdays.long].reduce((i,s,n)=>[...i,{id:n,titleShort:e.context.locale.weekdays.short[n],titleLong:s,isWeekend:t.includes(n)}],[]),s=[...i.slice(e.firstWeekday),...i.slice(0,e.firstWeekday)];e.context.mainElement.querySelectorAll('[data-vc="week"]').forEach(t=>{const i=e.onClickWeekDay?document.createElement("button"):document.createElement("b");e.onClickWeekDay&&(i.type="button"),s.forEach(s=>{const n=i.cloneNode(!0);n.innerText=s.titleShort,n.className=e.styles.weekDay,n.role="columnheader",n.ariaLabel=s.titleLong,n.dataset.vcWeekDay=String(s.id),s.isWeekend&&(n.dataset.vcWeekDayOff=""),t.appendChild(n)})})},re=(e,t,i,s,n)=>{const o=t.cloneNode(!1);return o.className=e.styles.yearsYear,o.innerText=String(n),o.ariaLabel=String(n),o.role="gridcell",o.dataset.vcYearsYear=`${n}`,s&&(o.ariaDisabled="true"),s&&(o.tabIndex=-1),o.disabled=s,W(e,o,"year",i===n,!1),o},ae=(e,t)=>{var i;const s=(null==t?void 0:t.dataset.vcYear)?Number(t.dataset.vcYear):e.context.selectedYear;g(e,"currentType","year"),R(e,t),z(e),j(e);const n=e.context.mainElement.querySelector('[data-vc="years"]');if(!e.selectionYearsMode||!n)return;const o="multiple"!==e.type||e.context.selectedYear===s?0:1,l=document.createElement("button");l.type="button";for(let t=e.context.displayYear-7;t<e.context.displayYear+8;t++){const i=t<k(e.context.dateMin).getFullYear()+o||t>k(e.context.dateMax).getFullYear(),r=re(e,l,s,i,t);n.appendChild(r),e.onCreateYearEls&&e.onCreateYearEls(e,r)}null==(i=e.context.mainElement.querySelector("[data-vc-years-year]:not([disabled])"))||i.focus()},ce={value:!1,set:()=>ce.value=!0,check:()=>ce.value},de=(e,t)=>e.dataset.vcTheme=t,he=(e,t)=>{if(de(e.context.mainElement,t.matches?"dark":"light"),"system"!==e.selectedTheme||ce.check())return;const i=e=>{const t=document.querySelectorAll('[data-vc="calendar"]');null==t||t.forEach(t=>de(t,e.matches?"dark":"light"))};t.addEventListener?t.addEventListener("change",i):t.addListener(i),ce.set()},ue=(e,t)=>{const i=e.themeAttrDetect.length?document.querySelector(e.themeAttrDetect):null,s=e.themeAttrDetect.replace(/^.*\[(.+)\]/g,(e,t)=>t);if(!i||"system"===i.getAttribute(s))return void he(e,t);const n=i.getAttribute(s);n?(de(e.context.mainElement,n),((e,t,i)=>{new MutationObserver(e=>{for(let s=0;s<e.length;s++)if(e[s].attributeName===t){i();break}}).observe(e,{attributes:!0})})(i,s,()=>{const t=i.getAttribute(s);t&&de(e.context.mainElement,t)})):he(e,t)},pe=e=>e.charAt(0).toUpperCase()+e.slice(1).replace(/\./,""),me=e=>{var t,i,s,n,o,l,r,c;if(!(e.context.locale.weekdays.short[6]&&e.context.locale.weekdays.long[6]&&e.context.locale.months.short[11]&&e.context.locale.months.long[11]))if("string"==typeof e.locale){if("string"==typeof e.locale&&!e.locale.length)throw new Error(u);Array.from({length:7},(t,i)=>((e,t,i)=>{const s=new Date(`1978-01-0${t+1}T00:00:00.000Z`),n=s.toLocaleString(i,{weekday:"short",timeZone:"UTC"}),o=s.toLocaleString(i,{weekday:"long",timeZone:"UTC"});e.context.locale.weekdays.short.push(pe(n)),e.context.locale.weekdays.long.push(pe(o))})(e,i,e.locale)),Array.from({length:12},(t,i)=>((e,t,i)=>{const s=new Date(`1978-${String(t+1).padStart(2,"0")}-01T00:00:00.000Z`),n=s.toLocaleString(i,{month:"short",timeZone:"UTC"}),o=s.toLocaleString(i,{month:"long",timeZone:"UTC"});e.context.locale.months.short.push(pe(n)),e.context.locale.months.long.push(pe(o))})(e,i,e.locale))}else{if(!((null==(i=null==(t=e.locale)?void 0:t.weekdays)?void 0:i.short[6])&&(null==(n=null==(s=e.locale)?void 0:s.weekdays)?void 0:n.long[6])&&(null==(l=null==(o=e.locale)?void 0:o.months)?void 0:l.short[11])&&(null==(c=null==(r=e.locale)?void 0:r.months)?void 0:c.long[11])))throw new Error(u);g(e,"locale",a({},e.locale))}},ge=e=>{const t={default:()=>{le(e),$(e)},multiple:()=>{le(e),$(e)},month:()=>K(e),year:()=>ae(e)};(e=>{"not all"!==window.matchMedia("(prefers-color-scheme)").media?"system"===e.selectedTheme?ue(e,window.matchMedia("(prefers-color-scheme: dark)")):de(e.context.mainElement,e.selectedTheme):de(e.context.mainElement,"light")})(e),me(e),R(e),z(e),j(e),(e=>{const t=e.context.mainElement.querySelector('[data-vc="time"]');if(!e.selectionTimeMode||!t)return;const[i,s]=[e.timeMinHour,e.timeMaxHour],[n,o]=[e.timeMinMinute,e.timeMaxMinute],l=e.context.selectedKeeping?G(e.context.selectedHours,e.context.selectedKeeping):e.context.selectedHours,r="range"===e.timeControls;var a;t.innerHTML=e.sanitizerHTML(`\n <div class="${e.styles.timeContent}" data-vc-time="content">\n ${Q("hour",e.styles.timeHour,e.labels,e.context.selectedHours,r)}\n ${Q("minute",e.styles.timeMinute,e.labels,e.context.selectedMinutes,r)}\n ${12===e.selectionTimeMode?(a=e.context.selectedKeeping,`<button type="button" class="${e.styles.timeKeeping}" aria-label="${e.labels.btnKeeping} ${a}" data-vc-time="keeping" ${r?"disabled":""}>${a}</button>`):""}\n </div>\n <div class="${e.styles.timeRanges}" data-vc-time="ranges">\n ${J("hour",e.styles.timeRange,e.labels,i,s,e.timeStepHour,l)}\n ${J("minute",e.styles.timeRange,e.labels,n,o,e.timeStepMinute,e.context.selectedMinutes)}\n </div>\n `),oe(e,t)})(e),t[e.context.currentType]()},ve=e=>{const t=t=>{var i;const s=t.target;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)||"button"!==s.localName)return;const n=Array.from(e.context.mainElement.querySelectorAll('[data-vc="calendar"] button')),o=n.indexOf(s);if(-1===o)return;const l=(r=n[o]).hasAttribute("data-vc-date-btn")?7:r.hasAttribute("data-vc-months-month")?4:r.hasAttribute("data-vc-years-year")?5:1;var r;const a=(0,{ArrowUp:()=>Math.max(0,o-l),ArrowDown:()=>Math.min(n.length-1,o+l),ArrowLeft:()=>Math.max(0,o-1),ArrowRight:()=>Math.min(n.length-1,o+1)}[t.key])();null==(i=n[a])||i.focus()};return e.context.mainElement.addEventListener("keydown",t),()=>e.context.mainElement.removeEventListener("keydown",t)},fe=(e,t)=>{const i=k(I(new Date(e.context.selectedYear,e.context.selectedMonth,1)));({prev:()=>i.setMonth(i.getMonth()-e.monthsToSwitch),next:()=>i.setMonth(i.getMonth()+e.monthsToSwitch)})[t](),g(e,"selectedMonth",i.getMonth()),g(e,"selectedYear",i.getFullYear()),z(e),j(e),$(e)},ye=(e,t)=>void 0===t||("function"==typeof t?t(e):t),be=e=>ye(e,e.enableDateToggle),we=(e,t,i)=>{const s=t.dataset.vcDate,n=t.closest("[data-vc-date][data-vc-date-selected]"),o=be(e);if(n&&!o)return;const l=n?e.context.selectedDates.filter(e=>e!==s):i?[...e.context.selectedDates,s]:[s];g(e,"selectedDates",l)},Ce=(e,t,i)=>{if(!t)return;if(!i)return t.dataset.vcDateRangeTooltip="hidden",void(t.textContent="");const s=e.context.mainElement.getBoundingClientRect(),n=i.getBoundingClientRect();t.style.left=n.left-s.left+n.width/2+"px",t.style.top=n.bottom-s.top-n.height+"px",t.dataset.vcDateRangeTooltip="visible",t.innerHTML=e.sanitizerHTML(e.onCreateDateRangeTooltip(e,i,t,n,s))},Se={self:null,lastDateEl:null,isHovering:!1,rangeMin:void 0,rangeMax:void 0,tooltipEl:null,timeoutId:null},xe=(e,t,i)=>{var s,n,o;if(!(null==(n=null==(s=Se.self)?void 0:s.context)?void 0:n.selectedDates[0]))return;const l=I(e);(null==(o=Se.self.context.disableDates)?void 0:o.includes(l))||(Se.self.context.mainElement.querySelectorAll(`[data-vc-date="${l}"]`).forEach(e=>e.dataset.vcDateHover=""),t.forEach(e=>e.dataset.vcDateHover="first"),i.forEach(e=>{"first"===e.dataset.vcDateHover?e.dataset.vcDateHover="first-and-last":e.dataset.vcDateHover="last"}))},Te=()=>{var e,t;(null==(t=null==(e=Se.self)?void 0:e.context)?void 0:t.mainElement)&&Se.self.context.mainElement.querySelectorAll("[data-vc-date-hover]").forEach(e=>e.removeAttribute("data-vc-date-hover"))},Le=e=>t=>{const i=t.target;Se.isHovering||(Se.isHovering=!0,requestAnimationFrame(()=>{e(i),Se.isHovering=!1}))},Ee=Le(e=>{var t,i;if(!e||!(null==(i=null==(t=Se.self)?void 0:t.context)?void 0:i.selectedDates[0]))return;if(!e.closest('[data-vc="dates"]'))return Se.lastDateEl=null,Ce(Se.self,Se.tooltipEl,null),void Te();const s=e.closest("[data-vc-date]");if(!s||Se.lastDateEl===s)return;Se.lastDateEl=s,Ce(Se.self,Se.tooltipEl,s),Te();const n=s.dataset.vcDate,o=k(Se.self.context.selectedDates[0]),l=k(n),r=Se.self.context.mainElement.querySelectorAll(`[data-vc-date="${Se.self.context.selectedDates[0]}"]`),a=Se.self.context.mainElement.querySelectorAll(`[data-vc-date="${n}"]`),[c,d]=o<l?[r,a]:[a,r],[h,u]=o<l?[o,l]:[l,o];for(let e=new Date(h);e<=u;e.setDate(e.getDate()+1))xe(e,c,d)}),ke=Le(e=>{const t=null==e?void 0:e.closest("[data-vc-date-selected]");if(!t&&Se.lastDateEl)return Se.lastDateEl=null,void Ce(Se.self,Se.tooltipEl,null);t&&Se.lastDateEl!==t&&(Se.lastDateEl=t,Ce(Se.self,Se.tooltipEl,t))}),Ie=e=>{Se.self&&"Escape"===e.key&&(Se.lastDateEl=null,g(Se.self,"selectedDates",[]),Se.self.context.mainElement.removeEventListener("mousemove",Ee),Se.self.context.mainElement.removeEventListener("keydown",Ie),Ce(Se.self,Se.tooltipEl,null),Te())},Ae=()=>{null!==Se.timeoutId&&clearTimeout(Se.timeoutId),Se.timeoutId=setTimeout(()=>{Se.lastDateEl=null,Ce(Se.self,Se.tooltipEl,null),Te()},50)},Me=(e,t)=>{Se.self=e,Se.lastDateEl=t,Te(),e.disableDatesGaps&&(Se.rangeMin=Se.rangeMin?Se.rangeMin:e.context.displayDateMin,Se.rangeMax=Se.rangeMax?Se.rangeMax:e.context.displayDateMax),e.onCreateDateRangeTooltip&&(Se.tooltipEl=e.context.mainElement.querySelector("[data-vc-date-range-tooltip]"));const i=null==t?void 0:t.dataset.vcDate;if(i){const t=1===e.context.selectedDates.length&&e.context.selectedDates[0].includes(i),s=t&&!be(e)?[i,i]:t&&be(e)?[]:e.context.selectedDates.length>1?[i]:[...e.context.selectedDates,i];g(e,"selectedDates",s),e.context.selectedDates.length>1&&e.context.selectedDates.sort((e,t)=>+new Date(e)-+new Date(t))}({set:()=>(e.disableDatesGaps&&(()=>{var e,t,i,s;if(!(null==(i=null==(t=null==(e=Se.self)?void 0:e.context)?void 0:t.selectedDates)?void 0:i[0])||!(null==(s=Se.self.context.disableDates)?void 0:s[0]))return;const n=k(Se.self.context.selectedDates[0]),[o,l]=Se.self.context.disableDates.map(e=>k(e)).reduce(([e,t],i)=>[n>=i?i:e,n<i&&null===t?i:t],[null,null]);o&&g(Se.self,"displayDateMin",I(new Date(o.setDate(o.getDate()+1)))),l&&g(Se.self,"displayDateMax",I(new Date(l.setDate(l.getDate()-1)))),Se.self.disableDatesPast&&!Se.self.disableAllDates&&k(Se.self.context.displayDateMin)<k(Se.self.context.dateToday)&&g(Se.self,"displayDateMin",Se.self.context.dateToday)})(),Ce(Se.self,Se.tooltipEl,t),Se.self.context.mainElement.removeEventListener("mousemove",ke),Se.self.context.mainElement.removeEventListener("mouseleave",Ae),Se.self.context.mainElement.removeEventListener("keydown",Ie),Se.self.context.mainElement.addEventListener("mousemove",Ee),Se.self.context.mainElement.addEventListener("mouseleave",Ae),Se.self.context.mainElement.addEventListener("keydown",Ie),()=>{Se.self.context.mainElement.removeEventListener("mousemove",Ee),Se.self.context.mainElement.removeEventListener("mouseleave",Ae),Se.self.context.mainElement.removeEventListener("keydown",Ie)}),reset:()=>{const[i,s]=[e.context.selectedDates[0],e.context.selectedDates[e.context.selectedDates.length-1]],n=e.context.selectedDates[0]!==e.context.selectedDates[e.context.selectedDates.length-1],o=A([`${i}:${s}`]).filter(t=>!e.context.disableDates.includes(t)),l=n?e.enableEdgeDatesOnly?[i,s]:o:[e.context.selectedDates[0],e.context.selectedDates[0]];if(g(e,"selectedDates",l),e.disableDatesGaps&&(g(e,"displayDateMin",Se.rangeMin),g(e,"displayDateMax",Se.rangeMax)),Se.self.context.mainElement.removeEventListener("mousemove",Ee),Se.self.context.mainElement.removeEventListener("mouseleave",Ae),Se.self.context.mainElement.removeEventListener("keydown",Ie),e.onCreateDateRangeTooltip)return e.context.selectedDates[0]||(Se.self.context.mainElement.removeEventListener("mousemove",ke),Se.self.context.mainElement.removeEventListener("mouseleave",Ae),Ce(Se.self,Se.tooltipEl,null)),e.context.selectedDates[0]&&(Se.self.context.mainElement.addEventListener("mousemove",ke),Se.self.context.mainElement.addEventListener("mouseleave",Ae),Ce(Se.self,Se.tooltipEl,t)),()=>{Se.self.context.mainElement.removeEventListener("mousemove",ke),Se.self.context.mainElement.removeEventListener("mouseleave",Ae)}}})[1===e.context.selectedDates.length?"set":"reset"]()},Oe=e=>{e.context.mainElement.querySelectorAll("[data-vc-date]").forEach(t=>{const i=t.querySelector("[data-vc-date-btn]"),s=t.dataset.vcDate,n=k(s).getDay();O(e,e.context.selectedYear,t,i,n,s,"current")})},De=["month","year"],Pe=(e,t,i)=>{const{currentValue:s,columnID:n}=U(e,t);return"month"===e.context.currentType&&n>=0?i-n:"year"===e.context.currentType&&e.context.selectedYear!==s?i-1:i},$e=(e,t,i,s)=>{var n;const o={year:()=>{if("multiple"===e.type)return((e,t)=>{const i=Pe(e,"year",Number(t.dataset.vcYearsYear)),s=k(e.context.dateMin),n=k(e.context.dateMax),o=e.context.displayMonthsCount-1,{columnID:l}=U(e,"year"),r=e.context.selectedMonth<s.getMonth()&&i<=s.getFullYear(),a=e.context.selectedMonth>n.getMonth()-o+l&&i>=n.getFullYear(),c=i<s.getFullYear(),d=i>n.getFullYear(),h=r||c?s.getFullYear():a||d?n.getFullYear():i,u=r||c?s.getMonth():a||d?n.getMonth()-o+l:e.context.selectedMonth;g(e,"selectedYear",h),g(e,"selectedMonth",u)})(e,s);g(e,"selectedYear",Number(s.dataset.vcYearsYear))},month:()=>{if("multiple"===e.type)return((e,t)=>{const i=t.closest('[data-vc-column="month"]').querySelector('[data-vc="year"]'),s=Pe(e,"month",Number(t.dataset.vcMonthsMonth)),n=Number(i.dataset.vcYear),o=k(e.context.dateMin),l=k(e.context.dateMax),r=s<o.getMonth()&&n<=o.getFullYear(),a=s>l.getMonth()&&n>=l.getFullYear();g(e,"selectedYear",n),g(e,"selectedMonth",r?o.getMonth():a?l.getMonth():s)})(e,s);g(e,"selectedMonth",Number(s.dataset.vcMonthsMonth))}};o[i](),{year:()=>{var i;return null==(i=e.onClickYear)?void 0:i.call(e,e,t)},month:()=>{var i;return null==(i=e.onClickMonth)?void 0:i.call(e,e,t)}}[i](),e.context.currentType!==e.type?(g(e,"currentType",e.type),ge(e),null==(n=e.context.mainElement.querySelector(`[data-vc="${i}"]`))||n.focus()):W(e,s,i,!0,!0)},Ne=(e,t)=>{const i={month:e.selectionMonthsMode,year:e.selectionYearsMode};De.forEach(s=>{i[s]&&t.target&&((e,t,i)=>{var s;const n=t.target,o=n.closest(`[data-vc="${i}"]`),l={year:()=>ae(e,n),month:()=>K(e,n)};if(o&&e.onClickTitle&&e.onClickTitle(e,t),o&&e.context.currentType!==i)return l[i]();const r=n.closest(`[data-vc-${i}s-${i}]`);if(r)return $e(e,t,i,r);const a=n.closest('[data-vc="grid"]'),c=n.closest('[data-vc="column"]');(e.context.currentType===i&&o||"multiple"===e.type&&e.context.currentType===i&&a&&!c)&&(g(e,"currentType",e.type),ge(e),null==(s=e.context.mainElement.querySelector(`[data-vc="${i}"]`))||s.focus())})(e,t,s)})},He=e=>{const t=t=>{((e,t)=>{const i=t.target.closest("[data-vc-arrow]");if(i){if(["default","multiple"].includes(e.context.currentType))fe(e,i.dataset.vcArrow);else if("year"===e.context.currentType&&void 0!==e.context.displayYear){const s={prev:-15,next:15}[i.dataset.vcArrow];g(e,"displayYear",e.context.displayYear+s),ae(e,t.target)}e.onClickArrow&&e.onClickArrow(e,t)}})(e,t),((e,t)=>{if(!e.onClickWeekDay)return;const i=t.target.closest("[data-vc-week-day]"),s=t.target.closest('[data-vc="column"]'),n=s?s.querySelectorAll("[data-vc-date-week-day]"):e.context.mainElement.querySelectorAll("[data-vc-date-week-day]");if(!i||!n[0])return;const o=Number(i.dataset.vcWeekDay),l=Array.from(n).filter(e=>Number(e.dataset.vcDateWeekDay)===o);e.onClickWeekDay(e,o,l,t)})(e,t),((e,t)=>{if(!e.enableWeekNumbers||!e.onClickWeekNumber)return;const i=t.target.closest("[data-vc-week-number]"),s=e.context.mainElement.querySelectorAll("[data-vc-date-week-number]");if(!i||!s[0])return;const n=Number(i.innerText),o=Number(i.dataset.vcWeekYear),l=Array.from(s).filter(e=>Number(e.dataset.vcDateWeekNumber)===n);e.onClickWeekNumber(e,n,o,l,t)})(e,t),((e,t)=>{var i;const s=t.target,n=s.closest("[data-vc-date-btn]");if(!e.selectionDatesMode||!["single","multiple","multiple-ranged"].includes(e.selectionDatesMode)||!n)return;const o=n.closest("[data-vc-date]");({single:()=>we(e,o,!1),multiple:()=>we(e,o,!0),"multiple-ranged":()=>Me(e,o)})[e.selectionDatesMode](),null==(i=e.context.selectedDates)||i.sort((e,t)=>+new Date(e)-+new Date(t)),e.onClickDate&&e.onClickDate(e,t),e.inputMode&&e.context.inputElement&&e.context.mainElement&&e.onChangeToInput&&e.onChangeToInput(e,t);const l=s.closest('[data-vc-date-month="prev"]'),r=s.closest('[data-vc-date-month="next"]');({prev:()=>e.enableMonthChangeOnDayClick?fe(e,"prev"):Oe(e),next:()=>e.enableMonthChangeOnDayClick?fe(e,"next"):Oe(e),current:()=>Oe(e)})[l?"prev":r?"next":"current"]()})(e,t),Ne(e,t)};return e.context.mainElement.addEventListener("click",t),()=>e.context.mainElement.removeEventListener("click",t)},Be=(e,t)=>"today"===e?(()=>{const e=new Date;return new Date(e.getTime()-6e4*e.getTimezoneOffset()).toISOString().substring(0,10)})():e instanceof Date||"number"==typeof e||"string"==typeof e?A([e])[0]:t,qe=(e,t,i)=>{g(e,"selectedMonth",t),g(e,"selectedYear",i),g(e,"displayYear",i)},Fe=e=>{var t;if(e.enableJumpToSelectedDate&&(null==(t=e.selectedDates)?void 0:t[0])&&void 0===e.selectedMonth&&void 0===e.selectedYear){const t=k(A(e.selectedDates)[0]);return void qe(e,t.getMonth(),t.getFullYear())}if((e=>{const t=t=>{const i=new Date(t);qe(e,i.getMonth(),i.getFullYear())};if(e.displayDateMin&&"today"!==e.displayDateMin&&(i=e.displayDateMin,s=new Date,new Date(i).getTime()>s.getTime())){const i=e.selectedDates.length&&e.selectedDates[0]?A(e.selectedDates)[0]:e.displayDateMin;return t(k(Be(i,e.displayDateMin))),!0}var i,s;if(e.displayDateMax&&"today"!==e.displayDateMax&&((e,t)=>new Date(e).getTime()<t.getTime())(e.displayDateMax,new Date)){const i=e.selectedDates.length&&e.selectedDates[0]?A(e.selectedDates)[0]:e.displayDateMax;return t(k(Be(i,e.displayDateMax))),!0}return!1})(e))return;const i=void 0!==e.selectedMonth&&Number(e.selectedMonth)>=0&&Number(e.selectedMonth)<12,s=void 0!==e.selectedYear&&Number(e.selectedYear)>=0&&Number(e.selectedYear)<=9999;qe(e,i?Number(e.selectedMonth):k(e.context.dateToday).getMonth(),s?Number(e.selectedYear):k(e.context.dateToday).getFullYear())},_e=e=>{g(e,"currentType",e.type),(e=>{if("multiple"===e.type&&(e.displayMonthsCount<=1||e.displayMonthsCount>12))throw new Error(m);if("multiple"!==e.type&&e.displayMonthsCount>1)throw new Error(m);g(e,"displayMonthsCount",e.displayMonthsCount?e.displayMonthsCount:"multiple"===e.type?2:1)})(e),(e=>{var t,i,s;const n=Be(e.dateMin,e.dateMin),o=Be(e.dateMax,e.dateMax),l=Be(e.displayDateMin,n),r=Be(e.displayDateMax,o);g(e,"dateToday",Be(e.dateToday,e.dateToday)),g(e,"displayDateMin",l?k(n)>=k(l)?n:l:n),g(e,"displayDateMax",r?k(o)<=k(r)?o:r:o);const a=e.disableDatesPast&&!e.disableAllDates&&k(l)<k(e.context.dateToday);g(e,"displayDateMin",a||e.disableAllDates?e.context.dateToday:l),g(e,"displayDateMax",e.disableAllDates?e.context.dateToday:r),g(e,"disableDates",e.disableDates[0]&&!e.disableAllDates?A(e.disableDates):e.disableAllDates?[e.context.displayDateMin]:[]),e.context.disableDates.length>1&&e.context.disableDates.sort((e,t)=>+new Date(e)-+new Date(t)),g(e,"enableDates",e.enableDates[0]?A(e.enableDates):[]),(null==(t=e.context.enableDates)?void 0:t[0])&&(null==(i=e.context.disableDates)?void 0:i[0])&&g(e,"disableDates",e.context.disableDates.filter(t=>!e.context.enableDates.includes(t))),e.context.enableDates.length>1&&e.context.enableDates.sort((e,t)=>+new Date(e)-+new Date(t)),(null==(s=e.context.enableDates)?void 0:s[0])&&e.disableAllDates&&(g(e,"displayDateMin",e.context.enableDates[0]),g(e,"displayDateMax",e.context.enableDates[e.context.enableDates.length-1])),g(e,"dateMin",e.displayDisabledDates?n:e.context.displayDateMin),g(e,"dateMax",e.displayDisabledDates?o:e.context.displayDateMax)})(e),Fe(e),(e=>{var t;g(e,"selectedDates",(null==(t=e.selectedDates)?void 0:t[0])?A(e.selectedDates):[])})(e),(e=>{var t,i,s;if(!e.selectionTimeMode)return;if(![12,24].includes(e.selectionTimeMode))throw new Error(p);const n=12===e.selectionTimeMode,o=n?/^(0[1-9]|1[0-2]):([0-5][0-9]) ?(AM|PM)?$/i:/^([0-1]?[0-9]|2[0-3]):([0-5][0-9])$/;let[l,r,a]=null!=(s=null==(i=null==(t=e.selectedTime)?void 0:t.match(o))?void 0:i.slice(1))?s:[];l?n&&!a&&(a="AM"):(l=n?X(String(e.timeMinHour)):String(e.timeMinHour),r=String(e.timeMinMinute),a=n?Number(X(String(e.timeMinHour)))>=12?"PM":"AM":null),g(e,"selectedHours",l.padStart(2,"0")),g(e,"selectedMinutes",r.padStart(2,"0")),g(e,"selectedKeeping",a),g(e,"selectedTime",`${e.context.selectedHours}:${e.context.selectedMinutes}${a?` ${a}`:""}`)})(e)},Re=(e,{year:t,month:i,dates:s,time:n,locale:o},l=!0)=>{var r;const a={year:e.selectedYear,month:e.selectedMonth,dates:e.selectedDates,time:e.selectedTime};e.selectedYear=t?a.year:e.context.selectedYear,e.selectedMonth=i?a.month:e.context.selectedMonth,e.selectedTime=n?a.time:e.context.selectedTime,e.selectedDates="only-first"===s&&(null==(r=e.context.selectedDates)?void 0:r[0])?[e.context.selectedDates[0]]:!0===s?a.dates:e.context.selectedDates,o&&g(e,"locale",{months:{short:[],long:[]},weekdays:{short:[],long:[]}}),_e(e),l&&ge(e),e.selectedYear=a.year,e.selectedMonth=a.month,e.selectedDates=a.dates,e.selectedTime=a.time,"multiple-ranged"===e.selectionDatesMode&&s&&Me(e,null)},Ve=e=>{g(e,"inputElement",e.context.mainElement);const t=()=>{e.context.inputModeInit?setTimeout(()=>Ue(e)):(e=>{const t=document.createElement("div");t.className=e.styles.calendar,t.dataset.vc="calendar",t.dataset.vcInput="",t.dataset.vcCalendarHidden="",g(e,"inputModeInit",!0),g(e,"isShowInInputMode",!1),g(e,"mainElement",t),document.body.appendChild(e.context.mainElement),Re(e,{year:!0,month:!0,dates:!0,time:!0,locale:!0}),setTimeout(()=>Ue(e)),e.onInit&&e.onInit(e),ve(e),He(e)})(e)};e.context.inputElement.addEventListener("click",t);const i="function"==typeof e.openOnFocus||!0===e.openOnFocus,s=()=>{(e=>v.has(e))(e)?(e=>{v.delete(e)})(e):(e=>ye(e,e.openOnFocus))(e)&&t()};i&&e.context.inputElement.addEventListener("focus",s);const n=t=>{const i="Tab"===t.key&&!t.shiftKey,s=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key);(i||s)&&(t=>{var i;if(!e.context.isShowInInputMode)return!1;if(document.activeElement!==e.context.inputElement)return!1;const s=e=>e.tabIndex>=0&&!e.hasAttribute("disabled")&&"true"!==e.getAttribute("aria-disabled"),n=null!=(i=document.createTreeWalker(e.context.mainElement,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>s(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}).nextNode())?i:s(e.context.mainElement)?e.context.mainElement:null;!n||n.tabIndex<0||(t.preventDefault(),n.focus())})(t)};return e.context.inputElement.addEventListener("keydown",n),()=>{e.context.inputElement.removeEventListener("click",t),i&&e.context.inputElement.removeEventListener("focus",s),e.context.inputElement.removeEventListener("keydown",n)}},je=(e,t)=>{if(!e.context.isInit)throw new Error(h);Re(e,a(a({},{year:!0,month:!0,dates:!0,time:!0,locale:!0}),t),!(e.inputMode&&!e.context.inputModeInit)),e.onUpdate&&e.onUpdate(e)},ze=(e,t)=>{const i=Object.keys(t);for(let s=0;s<i.length;s++){const n=i[s];"object"!=typeof e[n]||"object"!=typeof t[n]||t[n]instanceof Date||Array.isArray(t[n])?void 0!==t[n]&&(e[n]=t[n]):ze(e[n],t[n])}},We=(e,t,i)=>{if(!e)return;const s="auto"===i?function(e,t){const i="left";if(!t||!e)return i;const{canShow:s,parentPositions:n}=L(e,t),o=s.left&&s.right;return(o&&s.bottom?"center":o&&s.top?["top","center"]:Array.isArray(n)?["bottom"===n[0]?"top":"bottom",...n.slice(1)]:n)||i}(e,t):i,n={top:-t.offsetHeight,bottom:e.offsetHeight,left:0,center:e.offsetWidth/2-t.offsetWidth/2,right:e.offsetWidth-t.offsetWidth},o=Array.isArray(s)?s[0]:"bottom",l=Array.isArray(s)?s[1]:s;t.dataset.vcPosition=o;const{top:r,left:a}=S(e),c=r+n[o];let d=a+n[l];const{vw:h}=x();if(d+t.clientWidth>h){const e=window.innerWidth-document.body.clientWidth;d=h-t.clientWidth-e}else d<0&&(d=0);Object.assign(t.style,{left:`${d}px`,top:`${c}px`})},Ue=e=>{if(e.context.isShowInInputMode)return;if(!e.context.currentType)return void e.context.mainElement.click();var t;g(e,"cleanupHandlers",[]),g(e,"isShowInInputMode",!0),e.inputMode&&(t=e.context.mainElement,w(t),t.querySelectorAll(`[${f}]`).forEach(w)),We(e.context.inputElement,e.context.mainElement,e.positionToInput),e.context.mainElement.removeAttribute("data-vc-calendar-hidden");const i=()=>{We(e.context.inputElement,e.context.mainElement,e.positionToInput)};window.addEventListener("resize",i),e.context.cleanupHandlers.push(()=>window.removeEventListener("resize",i));const s=t=>{"Escape"===t.key&&C(e)};document.addEventListener("keydown",s),e.context.cleanupHandlers.push(()=>document.removeEventListener("keydown",s));const n=t=>{t.target===e.context.inputElement||e.context.mainElement.contains(t.target)||C(e)};document.addEventListener("click",n,{capture:!0}),e.context.cleanupHandlers.push(()=>document.removeEventListener("click",n,{capture:!0})),e.onShow&&e.onShow(e)},Ye={application:"Calendar",navigation:"Calendar Navigation",arrowNext:{month:"Next month",year:"Next list of years"},arrowPrev:{month:"Previous month",year:"Previous list of years"},month:"Select month, current selected month:",months:"List of months",year:"Select year, current selected year:",years:"List of years",week:"Days of the week",weekNumber:"Numbers of weeks in a year",dates:"Dates in the current month",selectingTime:"Selecting a time ",inputHour:"Hours",inputMinute:"Minutes",rangeHour:"Slider for selecting hours",rangeMinute:"Slider for selecting minutes",btnKeeping:"Switch AM/PM, current position:"},Ke={calendar:"vc",controls:"vc-controls",grid:"vc-grid",column:"vc-column",header:"vc-header",headerContent:"vc-header__content",month:"vc-month",year:"vc-year",arrowPrev:"vc-arrow vc-arrow_prev",arrowNext:"vc-arrow vc-arrow_next",wrapper:"vc-wrapper",content:"vc-content",months:"vc-months",monthsMonth:"vc-months__month",years:"vc-years",yearsYear:"vc-years__year",week:"vc-week",weekDay:"vc-week__day",weekNumbers:"vc-week-numbers",weekNumbersTitle:"vc-week-numbers__title",weekNumbersContent:"vc-week-numbers__content",weekNumber:"vc-week-number",dates:"vc-dates",datesRow:"vc-dates__row",date:"vc-date",dateBtn:"vc-date__btn",datePopup:"vc-date__popup",dateRangeTooltip:"vc-date-range-tooltip",time:"vc-time",timeContent:"vc-time__content",timeHour:"vc-time__hour",timeMinute:"vc-time__minute",timeKeeping:"vc-time__keeping",timeRanges:"vc-time__ranges",timeRange:"vc-time__range"};class Qe{constructor(){c(this,"type","default"),c(this,"inputMode",!1),c(this,"openOnFocus",!0),c(this,"positionToInput","left"),c(this,"firstWeekday",1),c(this,"monthsToSwitch",1),c(this,"themeAttrDetect","html[data-theme]"),c(this,"locale","en"),c(this,"dateToday","today"),c(this,"dateMin","1970-01-01"),c(this,"dateMax","2470-12-31"),c(this,"displayDateMin"),c(this,"displayDateMax"),c(this,"displayDatesOutside",!0),c(this,"displayDisabledDates",!1),c(this,"displayMonthsCount"),c(this,"disableDates",[]),c(this,"disableAllDates",!1),c(this,"disableDatesPast",!1),c(this,"disableDatesGaps",!1),c(this,"disableWeekdays",[]),c(this,"disableToday",!1),c(this,"enableDates",[]),c(this,"enableEdgeDatesOnly",!0),c(this,"enableDateToggle",!0),c(this,"enableWeekNumbers",!1),c(this,"enableMonthChangeOnDayClick",!0),c(this,"enableJumpToSelectedDate",!1),c(this,"selectionDatesMode","single"),c(this,"selectionMonthsMode",!0),c(this,"selectionYearsMode",!0),c(this,"selectionTimeMode",!1),c(this,"selectedDates",[]),c(this,"selectedMonth"),c(this,"selectedYear"),c(this,"selectedHolidays",[]),c(this,"selectedWeekends",[0,6]),c(this,"selectedTime"),c(this,"selectedTheme","system"),c(this,"timeMinHour",0),c(this,"timeMaxHour",23),c(this,"timeMinMinute",0),c(this,"timeMaxMinute",59),c(this,"timeControls","all"),c(this,"timeStepHour",1),c(this,"timeStepMinute",1),c(this,"sanitizerHTML",e=>e),c(this,"onClickDate"),c(this,"onClickWeekDay"),c(this,"onClickWeekNumber"),c(this,"onClickTitle"),c(this,"onClickMonth"),c(this,"onClickYear"),c(this,"onClickArrow"),c(this,"onChangeTime"),c(this,"onChangeToInput"),c(this,"onCreateDateRangeTooltip"),c(this,"onCreateDateEls"),c(this,"onCreateMonthEls"),c(this,"onCreateYearEls"),c(this,"onInit"),c(this,"onUpdate"),c(this,"onDestroy"),c(this,"onShow"),c(this,"onHide"),c(this,"popups",{}),c(this,"labels",a({},Ye)),c(this,"layouts",{default:"",multiple:"",month:"",year:""}),c(this,"styles",a({},Ke))}}const Je=class e extends Qe{constructor(t,n){var o,l;super(),c(this,"init",()=>{return g(e=this,"originalElement",e.context.mainElement.cloneNode(!0)),g(e,"isInit",!0),e.inputMode?Ve(e):(_e(e),ge(e),e.onInit&&e.onInit(e),ve(e),He(e));var e}),c(this,"update",e=>je(this,e)),c(this,"destroy",()=>(e=>{var t,i,s,n,o;if(!e.context.isInit)throw new Error(h);e.inputMode?(null==(t=e.context.mainElement.parentElement)||t.removeChild(e.context.mainElement),null==(s=null==(i=e.context.inputElement)?void 0:i.replaceWith)||s.call(i,e.context.originalElement),g(e,"inputElement",void 0)):null==(o=(n=e.context.mainElement).replaceWith)||o.call(n,e.context.originalElement),g(e,"mainElement",e.context.originalElement),e.onDestroy&&e.onDestroy(e)})(this)),c(this,"show",()=>Ue(this)),c(this,"hide",()=>C(this)),c(this,"set",(e,t)=>((e,t,i)=>{ze(e,t),e.context.isInit&&je(e,i)})(this,e,t)),c(this,"context"),this.context=(l=a({},this.context),i(l,s({locale:{months:{short:[],long:[]},weekdays:{short:[],long:[]}}}))),g(this,"mainElement","string"==typeof t?null!=(o=e.memoizedElements.get(t))?o:this.queryAndMemoize(t):t),n&&ze(this,n)}queryAndMemoize(t){const i=document.querySelector(t);if(!i)throw new Error(d(t));return e.memoizedElements.set(t,i),i}};c(Je,"memoizedElements",new Map);let Ze=Je;e.Calendar=Ze,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}(t)}},t={};function i(s){var n=t[s];if(void 0!==n)return n.exports;var o=t[s]={exports:{}};return e[s].call(o.exports,o,o.exports,i),o.exports}return 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),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(3158)})());
|
|
210
|
+
*/Object.defineProperty(t,"__esModule",{value:!0}),t.stringToBoolean=t.menuSearchHistory=t.isScrollable=t.isParentOrElementHidden=t.isJson=t.isIpadOS=t.isIOS=t.isFormElement=t.isFocused=t.isEnoughSpace=t.isDirectChild=t.htmlToElement=t.getZIndex=t.getHighestZIndex=t.getClassPropertyAlt=t.getClassProperty=t.dispatch=t.debounce=t.classToClassList=t.afterTransition=void 0;t.stringToBoolean=e=>"true"===e;t.getClassProperty=(e,t,i="")=>(window.getComputedStyle(e).getPropertyValue(t)||i).replace(" ","");t.getClassPropertyAlt=(e,t,i="")=>{let n="";return e.classList.forEach(e=>{e.includes(t)&&(n=e)}),n.match(/:(.*)]/)?n.match(/:(.*)]/)[1]:i};const i=e=>window.getComputedStyle(e).getPropertyValue("z-index");t.getZIndex=i;t.getHighestZIndex=e=>{let t=Number.NEGATIVE_INFINITY;return e.forEach(e=>{let n=i(e);"auto"!==n&&(n=parseInt(n,10),n>t&&(t=n))}),t};t.isDirectChild=(e,t)=>{const i=e.children;for(let e=0;e<i.length;e++)if(i[e]===t)return!0;return!1};t.isEnoughSpace=(e,t,i="auto",n=10,s=null)=>{const o=t.getBoundingClientRect(),l=s?s.getBoundingClientRect():null,r=window.innerHeight,a=l?o.top-l.top:o.top,d=(s?l.bottom:r)-o.bottom,c=e.clientHeight+n;return"bottom"===i?d>=c:"top"===i?a>=c:a>=c||d>=c};t.isFocused=e=>document.activeElement===e;t.isFormElement=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement;t.isIOS=()=>!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);t.isIpadOS=()=>navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);t.isJson=e=>{if("string"!=typeof e)return!1;const t=e.trim()[0],i=e.trim().slice(-1);if("{"===t&&"}"===i||"["===t&&"]"===i)try{return JSON.parse(e),!0}catch(e){return!1}return!1};const n=e=>{if(!e)return!1;return"none"===window.getComputedStyle(e).display||n(e.parentElement)};t.isParentOrElementHidden=n;t.isScrollable=e=>{const t=window.getComputedStyle(e),i=t.overflowY,n=t.overflowX,s=("scroll"===i||"auto"===i)&&e.scrollHeight>e.clientHeight,o=("scroll"===n||"auto"===n)&&e.scrollWidth>e.clientWidth;return s||o};t.debounce=(e,t=200)=>{let i;return(...n)=>{clearTimeout(i),i=setTimeout(()=>{e.apply(this,n)},t)}};t.dispatch=(e,t,i=null)=>{const n=new CustomEvent(e,{detail:{payload:i},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(n)};t.afterTransition=(e,t)=>{const i=()=>{t(),e.removeEventListener("transitionend",i,!0)},n=window.getComputedStyle(e),s=n.getPropertyValue("transition-duration");"none"!==n.getPropertyValue("transition-property")&&parseFloat(s)>0?e.addEventListener("transitionend",i,!0):t()};t.htmlToElement=e=>{const t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild};t.classToClassList=(e,t,i=" ",n="add")=>{e.split(i).forEach(e=>{e.trim()&&("add"===n?t.classList.add(e):t.classList.remove(e))})};const s={historyIndex:-1,addHistory(e){this.historyIndex=e},existsInHistory(e){return e>this.historyIndex},clearHistory(){this.historyIndex=-1}};t.menuSearchHistory=s},9359(e,t){
|
|
211
|
+
/*! name: vanilla-calendar-pro v3.4.0 | url: https://github.com/uvarov-frontend/vanilla-calendar-pro */
|
|
212
|
+
!function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var t=e=>new Date(`${e}T00:00:00`),i=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,n=(e,n)=>e.reduce((e,s)=>{if(s instanceof Date||"number"==typeof s){let t=s instanceof Date?s:new Date(s);e.push(i(t))}else s.match(/^(\d{4}-\d{2}-\d{2})$/g)?e.push(s):s.replace(/(\d{4}-\d{2}-\d{2}).*?(\d{4}-\d{2}-\d{2})/g,(s,o,l)=>{var r;let a=`${o}:${l}`,d=n?n.start.getTime():-1/0,c=null==n||null==(r=n.cursors)?void 0:r.get(a),h=void 0!==c&&c<=d?new Date(c):t(o),u=t(l).setHours(23,59,59,999);if(n){if(u<d)return s;u=Math.min(u,new Date(n.end).setHours(23,59,59,999))}let p=!1;for(let t=h.getTime();t<=u;t=h.setDate(h.getDate()+1))(!n||t>=d)&&(null!=n&&n.cursors&&!p&&(n.cursors.set(a,t),p=!0),e.push(i(h)));return s});return e},[]),s=(e,t)=>{if(t&&t.values.length===e.length){let i=0;for(;i<e.length&&t.values[i]===e[i];)i++;if(i===e.length)return t}return{values:e.slice(),set:new Set(e)}},o=new WeakMap,l=e=>{var t;let i=null!=(t=e.selectedHolidays)&&t[0]?e.selectedHolidays:[],l=JSON.stringify(i.map(e=>e instanceof Date?e.getTime():e)),r=o.get(e);o.set(e,{holidayKey:l,holidays:(null==r?void 0:r.holidayKey)===l?r.holidays:new Set(n(i)),selected:s(e.context.selectedDates,null==r?void 0:r.selected),disabled:s(e.context.disableDates,null==r?void 0:r.disabled),enabled:s(e.context.enableDates,null==r?void 0:r.enabled),min:Date.parse(`${e.context.displayDateMin}T00:00:00`),max:Date.parse(`${e.context.displayDateMax}T00:00:00`),first:Date.parse(`${e.context.selectedDates[0]}T00:00:00`),last:Date.parse(`${e.context.selectedDates[e.context.selectedDates.length-1]}T00:00:00`)})},r=e=>o.get(e),a=["motion","time","annotations","weeks","months"],d=new WeakMap,c={},h=Object.freeze([]),u=e=>{var t;return null==(t=d.get(e))?c:t},p=(e,t=e)=>{if(t.extensions&&t.extensions!==e.extensions&&(new Set(t.extensions).size!==e.extensions.length||t.extensions.some(t=>!e.extensions.includes(t))))throw Error("Calendar extensions are fixed at construction. Create a new Calendar to change them.");let i=u(e),n=(e,t,n)=>{if(e&&!i[t])throw Error(`The "${n}" option requires ${t}. Import { ${t} } from 'vanilla-calendar-pro' and add it to extensions: [${t}].`)};n(t.animation||t.enableSwipe,"motion",t.animation?"animation":"enableSwipe"),n(t.selectionTimeMode,"time","selectionTimeMode"),n(t.popups&&Object.keys(t.popups).length||t.onCreateDateRangeTooltip,"annotations",t.onCreateDateRangeTooltip?"onCreateDateRangeTooltip":"popups"),n("multiple"===t.type,"months","type"),n("week"===t.type||t.enableCollapse||t.enableWeekNumbers||t.onClickWeekDay,"weeks","week"===t.type?"type":t.enableCollapse?"enableCollapse":t.enableWeekNumbers?"enableWeekNumbers":"onClickWeekDay")},m=(e,t,i)=>{var n;return null==(n=u(e).annotations)?void 0:n.tooltip(e,t,i)},g=new WeakMap,v=e=>{let t=g.get(e);return t||(t={lastDateEl:null,isHovering:!1,rangeMin:void 0,rangeMax:void 0,tooltipEl:null,timeoutId:null,frameId:null},g.set(e,t)),t},f=e=>{e.context.mainElement.querySelectorAll("[data-vc-date-hover]").forEach(e=>e.removeAttribute("data-vc-date-hover"))},y=(e,t,i)=>{e.context[t]=i},b=(e,t)=>void 0===t||("function"==typeof t?t(e):t),w=e=>b(e,e.enableDateToggle),C=e=>{if(e.length<3||e.includes(void 0))return e.sort((e,t)=>+new Date(e)-new Date(t));let t=e.map(e=>({date:e,time:+new Date(e)}));return t.sort((e,t)=>e.time-t.time),t.forEach((t,i)=>e[i]=t.date),e},x=e=>{var t;let i=g.get(e);i&&(null==(t=i.cleanup)||t.call(i),i.cleanup=void 0,null!==i.timeoutId&&clearTimeout(i.timeoutId),null!==i.frameId&&cancelAnimationFrame(i.frameId),i.lastDateEl=null,i.tooltipEl=null,i.timeoutId=null,i.frameId=null,g.delete(e))},S=(e,s,o=!0)=>{let l=v(e);if(l.lastDateEl=s,f(e),!l.cleanup){let n=e.context.mainElement,s=(e=>n=>{if(!e.context.selectedDates[0]||1!==e.context.selectedDates.length&&!e.onCreateDateRangeTooltip)return;let s=v(e);if(s.isHovering)return;let o=n.target;s.isHovering=!0,s.frameId=requestAnimationFrame(()=>{var n;s.frameId=null,s.isHovering=!1,!e.context.isDestroyed&&e.context.mainElement.contains(o)&&(1===e.context.selectedDates.length?((e,n)=>{var s;let o=v(e);if(e.context.mainElement.hasAttribute("data-vc-dragging")||!n||null==e||null==(s=e.context)||!s.selectedDates[0])return;if(!n.closest('[data-vc="dates"]'))return o.lastDateEl=null,m(e,o.tooltipEl,null),void f(e);let l=n.closest("[data-vc-date]");if(!l||o.lastDateEl===l)return;o.lastDateEl=l,m(e,o.tooltipEl,l),f(e);let r=l.dataset.vcDate,a=t(e.context.selectedDates[0]),d=t(r),[c,h]=a<d?[a,d]:[d,a],[u,p]=a<d?[e.context.selectedDates[0],r]:[r,e.context.selectedDates[0]],g=new Set(e.context.disableDates),y=new Date(c);for(;y<=h&&g.has(i(y));)y.setDate(y.getDate()+1);y<=h&&e.context.mainElement.querySelectorAll("[data-vc-date]").forEach(e=>{let i=e.dataset.vcDate;if(i===u||i===p)e.dataset.vcDateHover=u===p?"first-and-last":i===u?"first":"last";else{let n=t(i);n>=c&&n<=h&&!g.has(i)&&(e.dataset.vcDateHover="")}})})(e,o):e.context.selectedDates[0]&&e.onCreateDateRangeTooltip&&(null==(n=u(e).annotations)||n.hover(e,o)))})})(e),o=()=>(e=>{let t=v(e);null!==t.timeoutId&&clearTimeout(t.timeoutId),t.timeoutId=setTimeout(()=>{t.timeoutId=null,!e.context.isDestroyed&&(t.lastDateEl=null,m(e,t.tooltipEl,null),f(e))},50)})(e),r=t=>((e,t)=>{if("Escape"!==t.key||1!==e.context.selectedDates.length)return;let i=v(e);i.lastDateEl=null,y(e,"selectedDates",[]),m(e,i.tooltipEl,null),f(e)})(e,t);n.addEventListener("mousemove",s),n.addEventListener("mouseleave",o),n.addEventListener("keydown",r),l.cleanup=()=>{n.removeEventListener("mousemove",s),n.removeEventListener("mouseleave",o),n.removeEventListener("keydown",r)}}e.disableDatesGaps&&(null!=l.rangeMin||(l.rangeMin=e.context.displayDateMin),null!=l.rangeMax||(l.rangeMax=e.context.displayDateMax)),l.tooltipEl=e.onCreateDateRangeTooltip?e.context.mainElement.querySelector("[data-vc-date-range-tooltip]"):null;let r=null==s?void 0:s.dataset.vcDate;if(r){let t=1===e.context.selectedDates.length&&e.context.selectedDates[0].includes(r);y(e,"selectedDates",t&&!w(e)?[r,r]:t&&w(e)?[]:e.context.selectedDates.length>1?[r]:[...e.context.selectedDates,r]),e.context.selectedDates.length>1&&C(e.context.selectedDates)}({set:()=>{e.disableDatesGaps&&(e=>{var n,s;if(null==e||null==(n=e.context)||null==(n=n.selectedDates)||!n[0]||null==(s=e.context.disableDates)||!s[0])return;let o=t(e.context.selectedDates[0]),[l,r]=e.context.disableDates.map(e=>t(e)).reduce(([e,t],i)=>[o>=i?i:e,o<i&&null===t?i:t],[null,null]);l&&y(e,"displayDateMin",i(new Date(l.setDate(l.getDate()+1)))),r&&y(e,"displayDateMax",i(new Date(r.setDate(r.getDate()-1)))),e.disableDatesPast&&!e.disableAllDates&&t(e.context.displayDateMin)<t(e.context.dateToday)&&y(e,"displayDateMin",e.context.dateToday)})(e),m(e,l.tooltipEl,s)},reset:()=>{if(!o)return;let[t,i]=[e.context.selectedDates[0],e.context.selectedDates[e.context.selectedDates.length-1]];y(e,"selectedDates",e.context.selectedDates[0]===e.context.selectedDates[e.context.selectedDates.length-1]?[e.context.selectedDates[0],e.context.selectedDates[0]]:e.enableEdgeDatesOnly?[t,i]:(()=>{let s=new Set(e.context.disableDates);return n([`${t}:${i}`]).filter(e=>!s.has(e))})()),e.disableDatesGaps&&(y(e,"displayDateMin",l.rangeMin),y(e,"displayDateMax",l.rangeMax)),e.onCreateDateRangeTooltip&&m(e,l.tooltipEl,e.context.selectedDates[0]?s:null)}})[1===e.context.selectedDates.length?"set":"reset"]()},T=e=>e.getRootNode?e.getRootNode():document,k=new WeakSet,E="data-vc-prev-tabindex",L=e=>e.tabIndex>=0&&!e.hasAttribute("disabled")&&"true"!==e.getAttribute("aria-disabled"),I=e=>{if(e.hasAttribute(E))return;let t=e.getAttribute("tabindex");e.setAttribute(E,null==t?"":t)},A=e=>{if(!e.hasAttribute(E))return;let t=e.getAttribute(E);""===t||null===t?e.removeAttribute("tabindex"):e.setAttribute("tabindex",t),e.removeAttribute(E)},M=e=>{e.setAttribute("inert",""),e.ariaHidden="true",(e=>{L(e)&&(I(e),e.tabIndex=-1);let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>L(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;t.nextNode();){let e=t.currentNode;I(e),e.tabIndex=-1}})(e)},O=e=>{var t;if(B(e),!e.context.isShowInInputMode||!e.context.currentType)return;let i=e.context.mainElement.contains(T(e.context.mainElement).activeElement);e.context.mainElement.dataset.vcCalendarHidden="",y(e,"isShowInInputMode",!1),e.inputMode&&M(e.context.mainElement),null!=(t=e.context.inputElement)&&t.hasAttribute("aria-expanded")&&e.context.inputElement.setAttribute("aria-expanded","false"),e.context.cleanupHandlers[0]&&(e.context.cleanupHandlers.forEach(e=>e()),y(e,"cleanupHandlers",[])),e.inputMode&&e.context.inputElement&&i&&(("function"==typeof e.openOnFocus||!0===e.openOnFocus)&&(e=>{k.add(e)})(e),e.context.inputElement.focus()),e.onHide&&e.onHide(e)};function D(e){if(null==e||!e.getBoundingClientRect)return{top:0,bottom:0,left:0,right:0};let t=e.getBoundingClientRect(),i=document.documentElement;return{bottom:t.bottom,right:t.right,top:t.top+window.scrollY-i.clientTop,left:t.left+window.scrollX-i.clientLeft}}function P(){return{vw:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),vh:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}function $(e,t,i=5){let n={top:!0,bottom:!0,left:!0,right:!0},s=[];if(!t||!e)return{canShow:n,parentPositions:s};let{bottom:o,top:l}=function(e){let{top:t,left:i}={left:window.scrollX||document.documentElement.scrollLeft||0,top:window.scrollY||document.documentElement.scrollTop||0},{top:n,left:s}=D(e),{vh:o,vw:l}=P(),r=n-t,a=s-i;return{top:r,bottom:o-(r+e.clientHeight),left:a,right:l-(a+e.clientWidth)}}(e),{top:r,left:a}=D(e),{height:d,width:c}=t.getBoundingClientRect(),{vh:h,vw:u}=P(),p=u/2,m=h/2;return[{condition:r<m,position:"top"},{condition:r>m,position:"bottom"},{condition:a<p,position:"left"},{condition:a>p,position:"right"}].forEach(({condition:e,position:t})=>{e&&s.push(t)}),Object.assign(n,{top:d<=l-i,bottom:d<=o-i,left:c<=a,right:c<=u-a}),{canShow:n,parentPositions:s}}var N=(e,t,i)=>{if(!e)return;let n="auto"===i?function(e,t){let i="left";if(!t||!e)return i;let{canShow:n,parentPositions:s}=$(e,t),o=n.left&&n.right;return(o&&n.bottom?"center":o&&n.top?["top","center"]:Array.isArray(s)?["bottom"===s[0]?"top":"bottom",...s.slice(1)]:s)||i}(e,t):i,s={top:-t.offsetHeight,bottom:e.offsetHeight,left:0,center:e.offsetWidth/2-t.offsetWidth/2,right:e.offsetWidth-t.offsetWidth},o=Array.isArray(n)?n[0]:"bottom",l=Array.isArray(n)?n[1]:n;t.dataset.vcPosition=o;let{top:r,left:a}=D(e),d=r+s[o],c=a+s[l],{vw:h}=P();if(c+t.clientWidth>h){let e=window.innerWidth-document.body.clientWidth;c=h-t.clientWidth-e}else c<0&&(c=0);Object.assign(t.style,{left:`${c}px`,top:`${d}px`})},H=new WeakMap,B=e=>{clearTimeout(H.get(e)),H.delete(e)},q=e=>{B(e),H.set(e,setTimeout(()=>{H.delete(e),e.context.isDestroyed||F(e)}))},F=e=>{var t,i;if(B(e),e.context.isShowInInputMode||e.context.isDestroyed)return;if(!e.context.currentType)return void e.context.mainElement.click();y(e,"cleanupHandlers",[]),y(e,"isShowInInputMode",!0),e.inputMode&&((i=e.context.mainElement).removeAttribute("inert"),i.removeAttribute("aria-hidden"),(e=>{A(e),e.querySelectorAll(`[${E}]`).forEach(A)})(i)),N(e.context.inputElement,e.context.mainElement,e.positionToInput),e.context.mainElement.removeAttribute("data-vc-calendar-hidden"),null!=(t=e.context.inputElement)&&t.hasAttribute("aria-expanded")&&e.context.inputElement.setAttribute("aria-expanded","true");let n=()=>{N(e.context.inputElement,e.context.mainElement,e.positionToInput)};window.addEventListener("resize",n),e.context.cleanupHandlers.push(()=>window.removeEventListener("resize",n));let s=t=>{"Escape"===t.key&&O(e)};document.addEventListener("keydown",s),e.context.cleanupHandlers.push(()=>document.removeEventListener("keydown",s));let o=t=>{var i;let n=null==(i=t.composedPath()[0])?t.target:i;n===e.context.inputElement||e.context.mainElement.contains(n)||O(e)};document.addEventListener("click",o,{capture:!0}),e.context.cleanupHandlers.push(()=>document.removeEventListener("click",o,{capture:!0})),e.onShow&&e.onShow(e)},_='The calendar has not been initialized, please initialize it using the "init()" method first.',R="You specified an incorrect language label or did not specify the required number of values for «locale.weekdays» or «locale.months».",j=e=>String(e).replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e])),V=(e,t)=>`\n <div class="${j(e.styles.header)}" data-vc="header" role="group" aria-label="${j(e.labels.navigation)}">\n${t?` <#ArrowPrev [${t}] />\n`:""} <div class="${j(e.styles.headerContent)}" data-vc-header="content" aria-live="polite" aria-atomic="true">\n <#Month />\n <#Year />\n </div>\n${t?` <#ArrowNext [${t}] />\n`:""} </div>\n`,z=(e,t="month")=>`${V(e,t)} <div class="${j(e.styles.wrapper)}" data-vc="wrapper">\n <#WeekNumbers />\n <div class="${j(e.styles.content)}" data-vc="content" role="grid">\n <#Week />\n <#Dates />\n <#DateRangeTooltip />\n </div>\n </div>\n <#Collapse />\n <#ControlTime />\n`,W=e=>e,Y=new WeakMap,U=e=>{var t;null==(t=Y.get(e))||t.observer.disconnect(),Y.delete(e)},K=U,Q=e=>{var t;return!(e.animation||e.enableCollapse||e.onCreateDateEls||e.onCreateDateRangeTooltip||e.disableDatesGaps||e.popups&&Object.keys(e.popups).length||e.sanitizerHTML!==W||"default"!==e.context.currentType&&"multiple"!==e.context.currentType||e.layouts[e.context.currentType]!==("multiple"===e.context.currentType?null==(t=u(e).months)?void 0:t.layout(e):z(e)))},J=e=>JSON.stringify(Object.entries(e).filter(([e])=>"context"!==e&&"selectedDates"!==e),(e,t)=>"function"==typeof t||t),G=({context:e})=>JSON.stringify([e.currentType,e.locale,e.dateToday,e.dateMin,e.dateMax,e.displayDateMin,e.displayDateMax,e.selectedYear,e.selectedMonth,e.displayMonthsCount,e.selectedHours,e.selectedMinutes,e.selectedKeeping,e.selectedTime]),Z=e=>JSON.stringify([G(e),e.context.displayYear,e.context.displayWeekDate,e.context.selectedDates,e.context.disableDates,e.context.enableDates]),X=(e,t=!1)=>{let i=Y.get(e);if(!i||!t&&!i.fullLayout||i.dirty||i.observer.takeRecords().length||!Q(e))return;let n=T(e.context.mainElement).activeElement;if(!n||n===e.context.mainElement||!e.context.mainElement.contains(n)||t&&!n.closest('[data-vc="column"], [data-vc="dates"], [data-vc-week="numbers"]'))try{if(i.options===J(e)&&i.context===Z(e)&&i.timezone===(new Intl.DateTimeFormat).resolvedOptions().timeZone)return i}catch(e){}},ee=(e,t=!1)=>{if(U(e),Q(e)&&!e.context.isDestroyed)try{let i=J(e),n=Z(e);if(i.length+n.length>262144)return;let s=Array.from(e.context.mainElement.querySelectorAll('[data-vc="dates"]'));if(s.length!==e.context.displayMonthsCount)return;let o={observer:new MutationObserver(()=>o.dirty=!0),dirty:!1,fullLayout:t,options:i,context:n,structure:G(e),timezone:(new Intl.DateTimeFormat).resolvedOptions().timeZone,month:12*e.context.selectedYear+e.context.selectedMonth,count:s.length};o.observer.observe(e.context.mainElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),Y.set(e,o)}catch(t){U(e)}},te=(e,t,i,n="")=>{t?e.getAttribute(i)!==n&&e.setAttribute(i,n):e.getAttribute(i)===n&&e.removeAttribute(i)},ie=(e,i,n,s,o,l,a)=>{var d;let c=(p=l,Date.parse(`${p}T00:00:00`)),h=r(e),u=h.min>c||h.max<c||h.disabled.set.has(l)||!e.selectionMonthsMode&&"current"!==a||!e.selectionYearsMode&&t(l).getFullYear()!==i;var p;te(n,u,"data-vc-date-disabled"),s&&te(s,u,"aria-disabled","true"),s&&u&&te(s,!0,"tabindex","-1"),s&&s.disabled!==!!u&&(s.disabled=!!u),te(n,!e.disableToday&&e.context.dateToday===l,"data-vc-date-today"),te(n,!e.disableToday&&e.context.dateToday===l,"aria-current","date"),te(n,null==(d=e.selectedWeekends)?void 0:d.includes(o),"data-vc-date-weekend"),te(n,h.holidays.has(l),"data-vc-date-holiday");let m=h.selected.set.has(l),g=m?"":void 0;m?(te(n,!0,"aria-selected","true"),e.context.selectedDates.length>1&&"multiple-ranged"===e.selectionDatesMode&&(e.context.selectedDates[0]===l&&e.context.selectedDates[e.context.selectedDates.length-1]===l?g="first-and-last":e.context.selectedDates[0]===l?g="first":e.context.selectedDates[e.context.selectedDates.length-1]===l&&(g="last"),e.context.selectedDates[0]!==l&&e.context.selectedDates[e.context.selectedDates.length-1]!==l&&(g="middle"))):n.hasAttribute("data-vc-date-selected")&&n.removeAttribute("aria-selected"),!h.disabled.set.has(l)&&e.enableEdgeDatesOnly&&e.context.selectedDates.length>1&&"multiple-ranged"===e.selectionDatesMode&&(c>h.first&&c<h.last?g="middle":"middle"===g&&(g=void 0)),void 0===g?n.hasAttribute("data-vc-date-selected")&&n.removeAttribute("data-vc-date-selected"):te(n,!0,"data-vc-date-selected",g)},ne=new Map,se=new Map,oe=(e,t,i)=>{var n,s;let o=null==(n=e.disableWeekdays)?void 0:n.includes(i),l=e.disableAllDates&&!(null==(s=e.context.enableDates)||!s[0]),a=r(e);if((o||l)&&!a.enabled.set.has(t)&&!a.disabled.set.has(t)){let i=e.context.disableDates;if(a.disabled.set.add(t),e.onCreateDateEls)i.push(t),C(i),a.disabled.values=i.slice();else{let e=+new Date(t),n=0,s=i.length;for(;n<s;){let t=n+s>>>1;+new Date(i[t])<=e?n=t+1:s=t}i.splice(n,0,t),a.disabled.values.splice(n,0,t)}}},le=(e,i,n,s,o,r)=>{var a;let d,c=t(o).getDay(),h="string"==typeof e.locale&&e.locale.length?e.locale:"en",p=document.createElement("div");p.className=e.styles.date,p.dataset.vcDate=o,p.dataset.vcDateMonth=r,p.dataset.vcDateWeekDay=String(c),p.role="gridcell",("current"===r||e.displayDatesOutside)&&(d=document.createElement("button"),d.className=e.styles.dateBtn,d.type="button",d.dataset.vcDateBtn="",d.ariaLabel=((e,t)=>{let i=`${t}:${e}`,n=se.get(i);if(void 0!==n)return n;let s=ne.get(t);s||(s=new Intl.DateTimeFormat(t,{dateStyle:"long",timeZone:"UTC"}),ne.size>=8&&ne.delete(ne.keys().next().value),ne.set(t,s));let o=s.format(new Date(`${e}T00:00:00.000Z`));return se.size>=512&&se.delete(se.keys().next().value),se.set(i,o),o})(o,h),d.innerText=String(s),p.appendChild(d)),e.enableWeekNumbers&&(null==(a=u(e).weeks)||a.date(e,p,o)),oe(e,o,c),ie(e,i,p,d,c,o,r),n.addDate(p),e.onCreateDateEls&&(e.onCreateDateEls(e,p),l(e))},re=[{container:'[data-vc="dates"]',item:"[data-vc-date-btn]",active:["[data-vc-date-selected] [data-vc-date-btn]","[data-vc-date-today] [data-vc-date-btn]"]},{container:'[data-vc="months"]',item:"[data-vc-months-month]",active:["[data-vc-months-month-selected]"]},{container:'[data-vc="years"]',item:"[data-vc-years-year]",active:["[data-vc-years-year-selected]"]}],ae=e=>!e.hasAttribute("disabled")&&"true"!==e.getAttribute("aria-disabled"),de=(e,t,i)=>{if(i&&ae(i))return e.querySelectorAll(`${t.item}:not([tabindex="-1"])`).forEach(e=>{e!==i&&(e.tabIndex=-1)}),void("0"!==i.getAttribute("tabindex")&&(i.tabIndex=0));let n=Array.from(e.querySelectorAll(t.item));if(!n[0])return;let s=((e,t,i)=>{var n;let s=t.active.map(t=>e.querySelector(t)).find(e=>!!e&&ae(e));return null==(n=null==s?i.find(ae):s)?i[0]:n})(e,t,n);n.forEach(e=>{let t=e===s?0:-1;e.getAttribute("tabindex")!==String(t)&&(e.tabIndex=t)})},ce=e=>{let t=e.target,i=re.find(e=>{var i;return null==(i=t.matches)?void 0:i.call(t,e.item)}),n=i?t.closest(i.container):null;i&&n&&de(n,i,t)},he=e=>{re.forEach(t=>{e.context.mainElement.querySelectorAll(t.container).forEach(e=>{e.closest("[data-vc-ghost]")||de(e,t,null)})})},ue=(e,t,n=!0)=>{var s;K(e);let o=new Date(e.context.selectedYear,e.context.selectedMonth,1),r=e.context.mainElement.querySelectorAll('[data-vc="dates"]'),a=u(e).weeks,d=e.enableWeekNumbers?e.context.mainElement.querySelectorAll('[data-vc-week="numbers"]'):[],c=null==(s=u(e).annotations)?void 0:s.prepare(e,r.length);r.forEach((n,s)=>{e.selectionDatesMode||(n.dataset.vcDatesDisabled="");let r=t?12*e.context.selectedYear+e.context.selectedMonth+s-t.month:-1;if(t&&r>=0&&r<t.count)return;if(n.textContent="",l(e),"week"===e.context.currentType)return null==a||a.dates(e,n),null==c||c(n),void(null==a||a.numbers(e,0,7,d[s],n));let h=new Date(o);h.setMonth(h.getMonth()+s);let u=h.getMonth(),p=h.getFullYear(),m=(new Date(p,u,1).getDay()-e.firstWeekday+7)%7,g=new Date(p,u+1,0).getDate(),v=m+g,f=Math.ceil(v/7),y=7*f-v,b=[];for(let t=0;t<f;t++){let t=document.createElement("div");t.className=e.styles.datesRow,t.setAttribute("data-vc-dates","row"),t.setAttribute("role","row"),b.push(t)}let w=0,C=0,x={addDate:e=>{b[w].appendChild(e),C++,C>=7&&(w++,C=0)}};((e,t,i,n,s)=>{let o=new Date(i,n,0).getDate()-(s-1),l=0===n?i-1:i,r=0===n?12:n<10?`0${n}`:n;for(let n=s;n>0;n--,o++)le(e,i,t,o,`${l}-${r}-${o}`,"prev")})(e,x,p,u,m),((e,t,n,s,o)=>{for(let l=1;l<=n;l++){let n=new Date(s,o,l);le(e,s,t,l,i(n),"current")}})(e,x,g,p,u),((e,t,i,n,s)=>{let o=s+1===12?n+1:n,l=s+1===12?"01":s+2<10?`0${s+2}`:s+2;for(let s=1;s<=i;s++){let i=`${o}-${l}-${s<10?`0${s}`:String(s)}`;le(e,n,t,s,i,"next")}})(e,x,y,p,u);for(let e of b)n.appendChild(e);null==c||c(n),null==a||a.numbers(e,m,g,d[s],n)}),he(e),n&&ee(e,null==t?void 0:t.fullLayout)},pe=(e,t)=>`${V(e,"Years"===t?"year":void 0)} <div class="${j(e.styles.wrapper)}" data-vc="wrapper">\n <div class="${j(e.styles.content)}" data-vc="content">\n <#${t} />\n </div>\n </div>\n`,me=e=>pe(e,"Months"),ge=e=>pe(e,"Years"),ve=e=>{let t="week"!==e.context.currentType;return{expanded:t,label:t?e.labels.collapse:e.labels.expand}},fe=(e,t,i)=>e.labels["arrow"+("prev"===t?"Prev":"Next")][i],ye={ArrowNext:(e,t)=>`<button type="button" class="${j(e.styles.arrowNext)}" data-vc-arrow="next" aria-label="${j(fe(e,"next",t))}"></button>`,ArrowPrev:(e,t)=>`<button type="button" class="${j(e.styles.arrowPrev)}" data-vc-arrow="prev" aria-label="${j(fe(e,"prev",t))}"></button>`,Dates:e=>`<div class="${j(e.styles.dates)}" data-vc="dates" role="rowgroup" aria-label="${j(e.labels.dates)}"></div>`,Month:e=>`<button type="button" class="${j(e.styles.month)}" data-vc="month"></button>`,Months:e=>`<div class="${j(e.styles.months)}" data-vc="months" role="grid" aria-label="${j(e.labels.months)}"></div>`,Week:e=>`<div class="${j(e.styles.week)}" data-vc="week" role="row" aria-label="${j(e.labels.week)}"></div>`,Year:e=>`<button type="button" class="${j(e.styles.year)}" data-vc="year"></button>`,Years:e=>`<div class="${j(e.styles.years)}" data-vc="years" role="grid" aria-label="${j(e.labels.years)}"></div>`},be=(e,t)=>t.replace(/[\n\t]/g,"").replace(/<#(?!\/?Multiple)(.*?)>/g,(t,i)=>{let n=(i.match(/\[(.*?)\]/)||[])[1],s=((e,t)=>{var i,n,s,o;return"Collapse"===t?null==(i=u(e).weeks)?void 0:i.component:"WeekNumbers"===t?null==(n=u(e).weeks)?void 0:n.numbersComponent:"DateRangeTooltip"===t?null==(s=u(e).annotations)?void 0:s.component:"ControlTime"===t?null==(o=u(e).time)?void 0:o.component:Object.prototype.hasOwnProperty.call(ye,t)?ye[t]:void 0})(e,i.replace(/[/\s\n\t]|\[(.*?)\]/g,"")),o=s?s(e,null==n?null:n):"";return e.sanitizerHTML(o)}).replace(/[\n\t]/g,""),we=(e,t)=>{var i,n,s;let o=u(e),l={default:z,month:me,year:ge,multiple:null==(i=o.months)?void 0:i.layout,week:null==(n=o.weeks)?void 0:n.layout};var r;Object.keys(l).forEach(t=>{var i,n;let s=t;e.layouts[s].length||(e.layouts[s]=null==(i=null==(n=l[s])?void 0:n.call(l,e))?"":i)}),e.context.mainElement.className=e.styles.calendar,e.context.mainElement.dataset.vc="calendar",e.context.mainElement.dataset.vcType=e.context.currentType,e.context.mainElement.toggleAttribute("data-vc-swipe",e.enableSwipe),e.context.mainElement.role=e.inputMode?"dialog":"group",e.context.mainElement.tabIndex=-1,e.context.mainElement.ariaLabel=e.labels.application,null!=(s=o.months)&&s.render(e,t)||(null==(r=o.time)||r.destroy(e),e.context.mainElement.innerHTML=e.sanitizerHTML(be(e,e.layouts[e.context.currentType]))),(e=>{let t=["multiple","multiple-ranged"].includes(String(e.selectionDatesMode));e.context.mainElement.querySelectorAll('[data-vc="content"][role="grid"]').forEach(e=>{t?e.setAttribute("aria-multiselectable","true"):e.removeAttribute("aria-multiselectable")})})(e)},Ce=(e,t,i,n)=>{e.style.visibility=i?"hidden":"",t.style.visibility=n?"hidden":""},xe=e=>{if("month"===e.context.currentType)return;let n=e.context.mainElement.querySelector('[data-vc-arrow="prev"]'),s=e.context.mainElement.querySelector('[data-vc-arrow="next"]');n&&s&&{default:()=>((e,n,s)=>{let o=t(i(new Date(e.context.selectedYear,e.context.selectedMonth,1))),l=new Date(o.getTime()),r=new Date(o.getTime());l.setMonth(l.getMonth()-e.monthsToSwitch),r.setMonth(r.getMonth()+e.monthsToSwitch);let a=t(e.context.dateMin),d=t(e.context.dateMax);e.selectionYearsMode||(a.setFullYear(o.getFullYear()),d.setFullYear(o.getFullYear())),Ce(n,s,!e.selectionMonthsMode||l.getFullYear()<a.getFullYear()||l.getFullYear()===a.getFullYear()&&l.getMonth()<a.getMonth(),!e.selectionMonthsMode||r.getFullYear()>d.getFullYear()||r.getFullYear()===d.getFullYear()&&r.getMonth()>d.getMonth()-(e.context.displayMonthsCount-1))})(e,n,s),year:()=>((e,i,n)=>{let s=t(e.context.dateMin),o=t(e.context.dateMax);Ce(i,n,!!(s.getFullYear()&&e.context.displayYear-7<=s.getFullYear()),!!(o.getFullYear()&&e.context.displayYear+7>=o.getFullYear()))})(e,n,s),week:()=>{var t;return null==(t=u(e).weeks)?void 0:t.arrows(e,n,s)}}["multiple"===e.context.currentType?"default":e.context.currentType]()},Se=(e,t)=>{let i=e.context.mainElement.querySelectorAll('[data-vc="month"]'),n=e.context.mainElement.querySelectorAll('[data-vc="year"]'),s=new Date(e.context.selectedYear,e.context.selectedMonth,1);[i,n].forEach(i=>null==i?void 0:i.forEach((i,n)=>{(!t||t.includes(n))&&((e,t,i,n,s)=>{let o=new Date(n.setFullYear(e.context.selectedYear,e.context.selectedMonth+i)).getFullYear(),l=new Date(n.setMonth(e.context.selectedMonth+i)).getMonth(),r=e.context.locale.months.long[l],a=t.closest('[data-vc="column"]');a&&(a.ariaLabel=`${r} ${o}`);let d={month:{id:l,label:r},year:{id:o,label:o}};t.innerText=String(d[s].label),t.dataset[`vc${s.charAt(0).toUpperCase()+s.slice(1)}`]=String(d[s].id),t.ariaLabel=`${e.labels[s]} ${d[s].label}`;let c={month:e.selectionMonthsMode,year:e.selectionYearsMode},h=!1===c[s]||"only-arrows"===c[s];h&&(t.tabIndex=-1),t.disabled=h})(e,i,n,s,i.dataset.vc)}))},Te=(e,t,i,n,s)=>{let o={month:{selected:"data-vc-months-month-selected",aria:"aria-selected",value:"vcMonthsMonth",selectedProperty:"selectedMonth"},year:{selected:"data-vc-years-year-selected",aria:"aria-selected",value:"vcYearsYear",selectedProperty:"selectedYear"}};var l,r;s&&(null==(l=e.context.mainElement.querySelectorAll({month:"[data-vc-months-month]",year:"[data-vc-years-year]"}[i]))||l.forEach(e=>{var t;e.removeAttribute(o[i].selected),null==(t=e.parentElement)||t.removeAttribute(o[i].aria)}),y(e,o[i].selectedProperty,Number(t.dataset[o[i].value])),Se(e),"year"===i&&xe(e)),n&&(t.setAttribute(o[i].selected,""),null==(r=t.parentElement)||r.setAttribute(o[i].aria,"true"))},ke=(e,t,i,n,s,o,l,r)=>{let a="month"===t?"months":"years",d=document.createElement("div");d.className=e.styles[`${a}Cell`],d.setAttribute(`data-vc-${a}`,"cell"),d.role="gridcell";let c=i.cloneNode(!1);return c.className=e.styles["month"===t?"monthsMonth":"yearsYear"],c.innerText=l,c.ariaLabel=r,c.setAttribute(`data-vc-${a}-${t}`,String(o)),s&&(c.ariaDisabled="true"),s&&(c.tabIndex=-1),c.disabled=s,d.appendChild(c),Te(e,c,t,n===o,!1),d},Ee=(e,t)=>{var i,n;return null==(i=null==(n=u(e).months)?void 0:n.column(e,t))?{currentValue:null,columnID:0}:i},Le=(e,i)=>{var n;let s=null==i||null==(n=i.closest('[data-vc="header"]'))?void 0:n.querySelector('[data-vc="year"]'),o=s?Number(s.dataset.vcYear):e.context.selectedYear,l=null!=i&&i.dataset.vcMonth?Number(i.dataset.vcMonth):e.context.selectedMonth;y(e,"currentType","month"),we(e,i),Se(e);let r=e.context.mainElement.querySelector('[data-vc="months"]');if(!e.selectionMonthsMode||!r)return;let a=e.monthsToSwitch>1?e.context.locale.months.long.map((t,i)=>l-e.monthsToSwitch*i).concat(e.context.locale.months.long.map((t,i)=>l+e.monthsToSwitch*i)).filter(e=>e>=0&&e<=12):Array.from(Array(12).keys()),d=document.createElement("button");d.type="button";let c,h=()=>({min:t(e.context.dateMin),max:t(e.context.dateMax),monthCount:e.context.displayMonthsCount-1,columnID:Ee(e,"month").columnID}),u=e.onCreateMonthEls?void 0:h();for(let t=0;t<12;t++){t%4==0&&(c=document.createElement("div"),c.className=e.styles.monthsRow,c.dataset.vcMonths="row",c.role="row",r.appendChild(c));let{min:i,max:n,monthCount:s,columnID:p}=null==u?h():u,m=ke(e,"month",d,l,o<=i.getFullYear()&&t<i.getMonth()+p||o>=n.getFullYear()&&t>n.getMonth()-s+p||o>n.getFullYear()||t!==l&&!a.includes(t),t,e.context.locale.months.short[t],e.context.locale.months.long[t]);null==c||c.appendChild(m),e.onCreateMonthEls&&e.onCreateMonthEls(e,m)}he(e)},Ie=e=>{var t;let i=e.selectedWeekends?[...e.selectedWeekends]:[],n=[...e.context.locale.weekdays.long].map((t,n)=>({id:n,titleShort:e.context.locale.weekdays.short[n],titleLong:t,isWeekend:i.includes(n)})),s=[...n.slice(e.firstWeekday),...n.slice(0,e.firstWeekday)],o=null==(t=u(e).weeks)?void 0:t.weekday(e),l=document.createElement(o?"div":"b");e.context.mainElement.querySelectorAll('[data-vc="week"]').forEach(t=>{s.forEach(i=>{let n=l.cloneNode(!1);n.className=e.styles.weekDay,n.role="columnheader",n.ariaLabel=i.titleLong,n.dataset.vcWeekDay=String(i.id),i.isWeekend&&(n.dataset.vcWeekDayOff=""),o?o(n,i.titleShort,i.titleLong):n.innerText=i.titleShort,t.appendChild(n)})})},Ae=(e,i)=>{let n=null!=i&&i.dataset.vcYear?Number(i.dataset.vcYear):e.context.selectedYear;y(e,"currentType","year"),we(e,i),Se(e),xe(e);let s=e.context.mainElement.querySelector('[data-vc="years"]');if(!e.selectionYearsMode||!s)return;let o="multiple"===e.type?e.context.selectedYear===n?0:1:0,l=document.createElement("button");l.type="button";let r,a=()=>[t(e.context.dateMin).getFullYear(),t(e.context.dateMax).getFullYear()],d=e.onCreateYearEls?void 0:a();for(let t=e.context.displayYear-7;t<e.context.displayYear+8;t++){(t-(e.context.displayYear-7))%5==0&&(r=document.createElement("div"),r.className=e.styles.yearsRow,r.dataset.vcYears="row",r.role="row",s.appendChild(r));let[i,c]=null==d?a():d,h=ke(e,"year",l,n,t<i+o||t>c,t,String(t),String(t));null==r||r.appendChild(h),e.onCreateYearEls&&e.onCreateYearEls(e,h)}he(e)},Me=new WeakMap,Oe=e=>{var t,i;let n="not all"!==window.matchMedia("(prefers-color-scheme)").media;var s,o;if(!n||"system"!==e.selectedTheme)return null==(s=(o=e.context).cleanupSystemTheme)||s.call(o),void(e.context.mainElement.dataset.vcTheme=n?e.selectedTheme:"light");let l=e.themeAttrDetect.length?document.querySelector(e.themeAttrDetect):null,r=e.themeAttrDetect.replace(/^.*\[(.+)\]/g,(e,t)=>t),a=Me.get(e);if((null==a?void 0:a.element)===l&&a.attr===r)return void a.update();null==(t=(i=e.context).cleanupSystemTheme)||t.call(i);let d,c=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>{let t=null==l?void 0:l.getAttribute(r),i=!t||"system"===t;e.context.mainElement.dataset.vcTheme=i?c.matches?"dark":"light":t,i&&!d?c.addEventListener?(c.addEventListener("change",h),d=()=>c.removeEventListener("change",h)):(c.addListener(h),d=()=>c.removeListener(h)):!i&&d&&(d(),d=void 0)},u=l?((e,t,i)=>{let n=new MutationObserver(e=>{for(let n=0;n<e.length;n++)if(e[n].attributeName===t){i();break}});return n.observe(e,{attributes:!0,attributeFilter:[t]}),()=>n.disconnect()})(l,r,h):void 0;Me.set(e,{element:l,attr:r,update:h}),y(e,"cleanupSystemTheme",()=>{null==u||u(),null==d||d(),Me.delete(e),y(e,"cleanupSystemTheme",void 0)}),h()};function De(e){return De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},De(e)}function Pe(e,t,i){return(t=function(e){var t=function(e){if("object"!=De(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=De(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==De(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function $e(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function Ne(e){for(var t=1;t<arguments.length;t++){var i=null==arguments[t]?{}:arguments[t];t%2?$e(Object(i),!0).forEach(function(t){Pe(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):$e(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}var He=new Map,Be=(e,t,i)=>{let n=new Intl.DateTimeFormat(e,{[t]:i,timeZone:"UTC"});return Array.from({length:"weekday"===t?7:12},(e,i)=>{return(s=n.format(new Date(Date.UTC(1978,"month"===t?i:0,"weekday"===t?i+1:1)))).charAt(0).toUpperCase()+s.slice(1).replace(/\./,"");var s})},qe=e=>{if(e.context.locale.weekdays.short[6]&&e.context.locale.weekdays.long[6]&&e.context.locale.months.short[11]&&e.context.locale.months.long[11])return;if("string"!=typeof e.locale){var t,i,n,s;if(!(null!=(t=e.locale)&&null!=(t=t.weekdays)&&t.short[6]&&null!=(i=e.locale)&&null!=(i=i.weekdays)&&i.long[6]&&null!=(n=e.locale)&&null!=(n=n.months)&&n.short[11]&&null!=(s=e.locale)&&null!=(s=s.months)&&s.long[11]))throw Error(R);return void y(e,"locale",Ne({},e.locale))}if("string"==typeof e.locale&&!e.locale.length)throw Error(R);let o=He.get(e.locale);o||(o={weekdays:{short:Be(e.locale,"weekday","short"),long:Be(e.locale,"weekday","long")},months:{short:Be(e.locale,"month","short"),long:Be(e.locale,"month","long")}},He.size>=8&&He.delete(He.keys().next().value),He.set(e.locale,o));for(let t of["weekdays","months"])for(let i of["short","long"])e.context.locale[t][i].push(...o[t][i])},Fe=(e,t=!0)=>{var i;K(e),Oe(e),qe(e),we(e),Se(e),xe(e),null==(i=u(e).time)||i.render(e),{default:()=>{Ie(e),ue(e,void 0,!1)},multiple:()=>{Ie(e),ue(e,void 0,!1)},week:()=>{var t;null==(t=u(e).weeks)||t.init(e),Ie(e),ue(e,void 0,!1)},month:()=>Le(e),year:()=>Ae(e)}[e.context.currentType](),t&&ee(e,!0)},_e=(e,i=!1)=>{l(e),e.context.mainElement.querySelectorAll("[data-vc-date]").forEach(n=>{let s=n.querySelector("[data-vc-date-btn]"),o=n.dataset.vcDate,l=t(o),r=l.getDay();i&&oe(e,o,r);let a=i?n.dataset.vcDateMonth:"current";"prev"===a&&l.setMonth(l.getMonth()+1,1),"next"===a&&l.setMonth(l.getMonth()-1,1),ie(e,i?l.getFullYear():e.context.selectedYear,n,s,r,o,a)}),he(e)},Re=e=>{let t=[{container:'[data-vc="dates"]',row:'[data-vc-dates="row"]',item:"[data-vc-date-btn]"},{container:'[data-vc="months"]',row:'[data-vc-months="row"]',item:"[data-vc-months-month]"},{container:'[data-vc="years"]',row:'[data-vc-years="row"]',item:"[data-vc-years-year]"}],i=e=>!e.disabled&&"true"!==e.getAttribute("aria-disabled"),n=e=>{let n=e.target.closest("button");if(!n||!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key))return;let s,o=t.find(e=>n.matches(e.item)),l=o?n.closest(o.container):null;if(o&&l&&!l.closest("[data-vc-ghost]")&&i(n)){if("ArrowUp"===e.key||"ArrowDown"===e.key)s=((e,t,n,s)=>{var o;let l=n.closest(t.row);if(!l)return n;let r=Array.from(e.querySelectorAll(t.row)),a=r.indexOf(l),d=Array.from(l.children).indexOf(n.parentElement),c=r[a+s],h=null==c||null==(o=c.children[d])?void 0:o.querySelector(t.item);return h&&i(h)?h:n})(l,o,n,"ArrowUp"===e.key?-1:1);else{let t=Array.from(l.querySelectorAll(o.item)).filter(i),r=t.indexOf(n);if(-1===r)return;s="ArrowLeft"===e.key?t[Math.max(0,r-1)]:t[Math.min(t.length-1,r+1)]}e.preventDefault(),null==s||s.focus()}};return e.context.mainElement.addEventListener("keydown",n),e.context.mainElement.addEventListener("focusin",ce),()=>{e.context.mainElement.removeEventListener("keydown",n),e.context.mainElement.removeEventListener("focusin",ce)}},je='[data-vc="dates"]',Ve=(e,t)=>"next"===e?t:-t,ze=e=>{let n={selector:je,shift:n=>((e,n)=>{let s=t(i(new Date(e.context.selectedYear,e.context.selectedMonth,1)));s.setMonth(s.getMonth()+Ve(n,e.monthsToSwitch)),y(e,"selectedMonth",s.getMonth()),y(e,"selectedYear",s.getFullYear())})(e,n),render:(t,i)=>ue(e,i)};return{default:n,multiple:n,week:{selector:je,shift:t=>{var i;return null==(i=u(e).weeks)?void 0:i.shift(e,t)},render:()=>ue(e)},year:{selector:'[data-vc="years"]',shift:t=>y(e,"displayYear",e.context.displayYear+Ve(t,15)),render:t=>Ae(e,t)},month:null}[e.context.currentType]},We=(e,t,i)=>{var n;let s=ze(e);if(!s)return;let{mainElement:o}=e.context,l=o.contains(T(o).activeElement),r="multiple"===e.context.currentType?X(e,!0):void 0;K(e),s.shift(t);let a=r?null==(n=u(e).months)?void 0:n.rotate(e,r):void 0;a||(r=void 0),Se(e,a),xe(e);let d=u(e).motion;d&&e.animation?d.navigate(e,s.selector,t,()=>s.render(i,r)):s.render(i,r),((e,t,i)=>{var n;let{mainElement:s}=e.context;if(!i||s.contains(T(s).activeElement))return;let o=s.querySelector(`[data-vc-arrow="${t}"]`);if(o&&"hidden"!==o.style.visibility)return o.focus();null==(n=Array.from(s.querySelectorAll('[tabindex="0"]')).find(e=>!e.closest("[data-vc-ghost]")))||n.focus()})(e,t,l)},Ye=(e,t,i)=>{let n=t.dataset.vcDate,s=t.closest("[data-vc-date][data-vc-date-selected]"),o=w(e);(!s||o)&&y(e,"selectedDates",s?e.context.selectedDates.filter(e=>e!==n):i?[...e.context.selectedDates,n]:[n])},Ue=["month","year"],Ke='[data-vc="column"]',Qe=(e,t,i)=>{let n=u(e).motion;n&&e.animation?n.changeView(e,t,i):i()},Je=(e,t)=>{var i;let{columnID:n}=Ee(e,e.context.currentType);y(e,"currentType",e.type),Qe(e,n,()=>Fe(e)),null==(i=e.context.mainElement.querySelector(`[data-vc="${t}"]`))||i.focus()},Ge=e=>{let t=t=>{var i,n;((e,t)=>{let i=t.target,n=i.closest("[data-vc-arrow]");n&&(We(e,n.dataset.vcArrow,i),e.onClickArrow&&e.onClickArrow(e,t))})(e,t),null==(i=u(e).weeks)||i.click(e,t),((e,t)=>{let i=t.target,n=i.closest("[data-vc-date-btn]");if(!e.selectionDatesMode||!["single","multiple","multiple-ranged"].includes(e.selectionDatesMode)||!n)return;let s=n.closest("[data-vc-date]");({single:()=>Ye(e,s,!1),multiple:()=>Ye(e,s,!0),"multiple-ranged":()=>S(e,s)})[e.selectionDatesMode](),e.context.selectedDates&&C(e.context.selectedDates),e.onClickDate&&e.onClickDate(e,t),e.inputMode&&e.context.inputElement&&e.context.mainElement&&e.onChangeToInput&&e.onChangeToInput(e,t);let o=i.closest('[data-vc-date-month="prev"]'),l=i.closest('[data-vc-date-month="next"]');({prev:()=>e.enableMonthChangeOnDayClick?We(e,"prev"):_e(e),next:()=>e.enableMonthChangeOnDayClick?We(e,"next"):_e(e),current:()=>_e(e)})[o?"prev":l?"next":"current"]()})(e,t),((e,t)=>{let i={month:e.selectionMonthsMode,year:e.selectionYearsMode};Ue.forEach(n=>{i[n]&&t.target&&((e,t,i)=>{let n=t.target,s=n.closest(`[data-vc="${i}"]`),o=((e,t)=>{let i=t.closest(Ke);return i?Array.from(e.context.mainElement.querySelectorAll(Ke)).indexOf(i):0})(e,n),l={year:()=>Qe(e,o,()=>Ae(e,n)),month:()=>Qe(e,o,()=>Le(e,n))};if(s&&e.onClickTitle&&e.onClickTitle(e,t),s&&e.context.currentType!==i){let t=n.closest(Ke);return l[i](),((e,t,i)=>{var n;return null==(n=(null==i?e.context.mainElement:i).querySelector(`[data-vc-${t}s-${t}][tabindex="0"]`))?void 0:n.focus()})(e,i,t)}let r=n.closest(`[data-vc-${i}s-${i}]`);if(r)return((e,t,i,n)=>{({year:()=>{var t;if("multiple"===e.type)return null==(t=u(e).months)?void 0:t.select(e,"year",n);y(e,"selectedYear",Number(n.dataset.vcYearsYear))},month:()=>{var t;if("multiple"===e.type)return null==(t=u(e).months)?void 0:t.select(e,"month",n);y(e,"selectedMonth",Number(n.dataset.vcMonthsMonth))}})[i](),{year:()=>{var i;return null==(i=e.onClickYear)?void 0:i.call(e,e,t)},month:()=>{var i;return null==(i=e.onClickMonth)?void 0:i.call(e,e,t)}}[i](),e.context.currentType===e.type?Te(e,n,i,!0,!0):Je(e,i)})(e,t,i,r);let a=n.closest('[data-vc="grid"]'),d=n.closest('[data-vc="column"]');(e.context.currentType===i&&s||"multiple"===e.type&&e.context.currentType===i&&a&&!d)&&Je(e,i)})(e,t,n)})})(e,t),null==(n=u(e).weeks)||n.collapseClick(e,t)};return e.context.mainElement.addEventListener("click",t),()=>e.context.mainElement.removeEventListener("click",t)},Ze=new WeakMap,Xe=(e,t)=>{let i=e[t].map(e=>e instanceof Date?e.getTime():e),s=Ze.get(e),o=null==s?void 0:s[t];if(o&&i.length===o.values.length){let e=0;for(;e<i.length&&i[e]===o.values[e];)e++;if(e===i.length&&o.timezone===(new Intl.DateTimeFormat).resolvedOptions().timeZone)return o.dates.slice()}let l=n(e[t]);if(l.length>1&&C(l),l.length>128&&l.length<=1e4&&i.length<=1e4){let n=null==s?{}:s;n[t]={values:i,dates:l.slice(),timezone:(new Intl.DateTimeFormat).resolvedOptions().timeZone},Ze.set(e,n)}else s&&delete s[t];return l},et=(e,t)=>"today"===e?(()=>{let e=new Date;return new Date(e.getTime()-6e4*e.getTimezoneOffset()).toISOString().substring(0,10)})():e instanceof Date||"number"==typeof e||"string"==typeof e?n([e])[0]:t,tt=(e,t,i)=>{y(e,"selectedMonth",t),y(e,"selectedYear",i),y(e,"displayYear",i)},it=e=>{var i,s;if(e.enableCollapse&&!["default","week"].includes(e.type))throw Error("The «enableCollapse» parameter is only supported by the «default» and «week» calendar types.");y(e,"currentType",e.type),(e=>{if("multiple"===e.type&&(e.displayMonthsCount<=1||e.displayMonthsCount>12)||"multiple"!==e.type&&e.displayMonthsCount>1)throw Error("For the «multiple» calendar type, the «displayMonthsCount» parameter can have a value from 2 to 12, and for all others it cannot be greater than 1.");y(e,"displayMonthsCount",e.displayMonthsCount?e.displayMonthsCount:"multiple"===e.type?2:1)})(e),(e=>{var i,n,s;let o=et(e.dateMin,e.dateMin),l=et(e.dateMax,e.dateMax),r=et(e.displayDateMin,o),a=et(e.displayDateMax,l);if(y(e,"dateToday",et(e.dateToday,e.dateToday)),y(e,"displayDateMin",r?t(o)>=t(r)?o:r:o),y(e,"displayDateMax",a?t(l)<=t(a)?l:a:l),y(e,"displayDateMin",e.disableDatesPast&&!e.disableAllDates&&t(r)<t(e.context.dateToday)||e.disableAllDates?e.context.dateToday:r),y(e,"displayDateMax",e.disableAllDates?e.context.dateToday:a),y(e,"disableDates",e.disableDates[0]&&!e.disableAllDates?Xe(e,"disableDates"):e.disableAllDates?[e.context.displayDateMin]:[]),y(e,"enableDates",e.enableDates[0]?Xe(e,"enableDates"):[]),null!=(i=e.context.enableDates)&&i[0]&&null!=(n=e.context.disableDates)&&n[0]){let t=new Set(e.context.enableDates);y(e,"disableDates",e.context.disableDates.filter(e=>!t.has(e)))}null!=(s=e.context.enableDates)&&s[0]&&e.disableAllDates&&(y(e,"displayDateMin",e.context.enableDates[0]),y(e,"displayDateMax",e.context.enableDates[e.context.enableDates.length-1])),y(e,"dateMin",e.displayDisabledDates?o:e.context.displayDateMin),y(e,"dateMax",e.displayDisabledDates?l:e.context.displayDateMax)})(e),(e=>{var i;if(e.enableJumpToSelectedDate&&null!=(i=e.selectedDates)&&i[0]&&void 0===e.selectedMonth&&void 0===e.selectedYear){let i=t(n(e.selectedDates)[0]);return void tt(e,i.getMonth(),i.getFullYear())}if((e=>{let i=t=>{let i=new Date(t);tt(e,i.getMonth(),i.getFullYear())};return e.displayDateMin&&"today"!==e.displayDateMin&&(s=e.displayDateMin,o=new Date,new Date(s).getTime()>o.getTime())?(i(t(et(e.selectedDates.length&&e.selectedDates[0]?n(e.selectedDates)[0]:e.displayDateMin,e.displayDateMin))),!0):!(!e.displayDateMax||"today"===e.displayDateMax||!((e,t)=>new Date(e).getTime()<t.getTime())(e.displayDateMax,new Date)||(i(t(et(e.selectedDates.length&&e.selectedDates[0]?n(e.selectedDates)[0]:e.displayDateMax,e.displayDateMax))),0));var s,o})(e))return;let s=void 0!==e.selectedMonth&&Number(e.selectedMonth)>=0&&Number(e.selectedMonth)<12,o=void 0!==e.selectedYear&&Number(e.selectedYear)>=0&&Number(e.selectedYear)<=9999;tt(e,s?Number(e.selectedMonth):t(e.context.dateToday).getMonth(),o?Number(e.selectedYear):t(e.context.dateToday).getFullYear())})(e),(e=>{var t;y(e,"selectedDates",null!=(t=e.selectedDates)&&t[0]?n(e.selectedDates):[])})(e),null==(i=u(e).weeks)||i.init(e),null==(s=u(e).time)||s.init(e)},nt=(e,{year:t,month:i,dates:n,time:s,locale:o},l=!0,r)=>{var a,d,c,h;K(e);let p=u(e);null==(a=p.motion)||a.reset(e),null==(d=p.time)||d.destroy(e),null==(c=p.annotations)||c.destroy(e),x(e);let m={year:e.selectedYear,month:e.selectedMonth,dates:e.selectedDates,time:e.selectedTime};var g;e.selectedYear=t?m.year:e.context.selectedYear,e.selectedMonth=i?m.month:e.context.selectedMonth,e.selectedTime=s?m.time:e.context.selectedTime,e.selectedDates="only-first"===n&&null!=(h=e.context.selectedDates)&&h[0]?[e.context.selectedDates[0]]:!0===n?m.dates:e.context.selectedDates,o&&y(e,"locale",{months:{short:[],long:[]},weekdays:{short:[],long:[]}}),it(e),l&&(r&&qe(e),r&&r.structure===G(e)?(Oe(e),null==(g=p.time)||g.render(e),_e(e,!0)):Fe(e,!1)),e.selectedYear=m.year,e.selectedMonth=m.month,e.selectedDates=m.dates,e.selectedTime=m.time,"multiple-ranged"===e.selectionDatesMode&&S(e,null,!!n),l&&ee(e,!0)},st=(e,t,i)=>{if(!e.context.isInit)throw Error(_);p(e),nt(e,Ne(Ne({},{year:!0,month:!0,dates:!0,time:!0,locale:!0}),t),!(e.inputMode&&!e.context.inputModeInit),i),e.onUpdate&&e.onUpdate(e)},ot=["extensions","context","init","update","destroy","show","hide","set","queryAndMemoize"],lt=(e,t,i=!0)=>{let n=Object.keys(t);for(let s=0;s<n.length;s++){let o=n[s];"__proto__"!==o&&"constructor"!==o&&"prototype"!==o&&(i&&ot.includes(String(o))||("object"!=typeof e[o]||null===e[o]||"object"!=typeof t[o]||null===t[o]||t[o]instanceof Date||Array.isArray(t[o])?void 0!==t[o]&&(e[o]=t[o]):lt(e[o],t[o],!1)))}},rt={application:"Calendar",navigation:"Calendar Navigation",arrowNext:{month:"Next month",year:"Next list of years",week:"Next week"},arrowPrev:{month:"Previous month",year:"Previous list of years",week:"Previous week"},month:"Select month, current selected month:",months:"List of months",year:"Select year, current selected year:",years:"List of years",week:"Days of the week",weekNumber:"Numbers of weeks in a year",collapse:"Collapse to a single week",expand:"Expand to the whole month",dates:"Dates in the current month",selectingTime:"Selecting a time ",inputHour:"Hours",inputMinute:"Minutes",rangeHour:"Slider for selecting hours",rangeMinute:"Slider for selecting minutes",btnKeeping:"Switch AM/PM, current position:"},at={calendar:"vc",controls:"vc-controls",grid:"vc-grid",column:"vc-column",header:"vc-header",headerContent:"vc-header__content",month:"vc-month",year:"vc-year",arrowPrev:"vc-arrow vc-arrow_prev",arrowNext:"vc-arrow vc-arrow_next",wrapper:"vc-wrapper",content:"vc-content",months:"vc-months",monthsRow:"vc-months__row",monthsCell:"vc-months__cell",monthsMonth:"vc-months__month",years:"vc-years",yearsRow:"vc-years__row",yearsCell:"vc-years__cell",yearsYear:"vc-years__year",week:"vc-week",weekDay:"vc-week__day",weekDayBtn:"vc-week__day-btn",weekNumbers:"vc-week-numbers",weekNumbersTitle:"vc-week-numbers__title",weekNumbersContent:"vc-week-numbers__content",weekNumber:"vc-week-number",collapse:"vc-collapse",dates:"vc-dates",datesRow:"vc-dates__row",date:"vc-date",dateBtn:"vc-date__btn",datePopup:"vc-date__popup",dateRangeTooltip:"vc-date-range-tooltip",time:"vc-time",timeContent:"vc-time__content",timeHour:"vc-time__hour",timeMinute:"vc-time__minute",timeKeeping:"vc-time__keeping",timeRanges:"vc-time__ranges",timeRange:"vc-time__range"},dt=class{constructor(){Pe(this,"type","default"),Pe(this,"inputMode",!1),Pe(this,"openOnFocus",!0),Pe(this,"positionToInput","left"),Pe(this,"animation",!1),Pe(this,"firstWeekday",1),Pe(this,"monthsToSwitch",1),Pe(this,"themeAttrDetect","html[data-theme]"),Pe(this,"locale","en"),Pe(this,"dateToday","today"),Pe(this,"dateMin","1970-01-01"),Pe(this,"dateMax","2470-12-31"),Pe(this,"displayDateMin",void 0),Pe(this,"displayDateMax",void 0),Pe(this,"displayDatesOutside",!0),Pe(this,"displayDisabledDates",!1),Pe(this,"displayMonthsCount",void 0),Pe(this,"disableDates",[]),Pe(this,"disableAllDates",!1),Pe(this,"disableDatesPast",!1),Pe(this,"disableDatesGaps",!1),Pe(this,"disableWeekdays",[]),Pe(this,"disableToday",!1),Pe(this,"enableDates",[]),Pe(this,"enableEdgeDatesOnly",!0),Pe(this,"enableDateToggle",!0),Pe(this,"enableWeekNumbers",!1),Pe(this,"enableMonthChangeOnDayClick",!0),Pe(this,"enableJumpToSelectedDate",!1),Pe(this,"enableCollapse",!1),Pe(this,"enableSwipe",!1),Pe(this,"selectionDatesMode","single"),Pe(this,"selectionMonthsMode",!0),Pe(this,"selectionYearsMode",!0),Pe(this,"selectionTimeMode",!1),Pe(this,"selectedDates",[]),Pe(this,"selectedMonth",void 0),Pe(this,"selectedYear",void 0),Pe(this,"selectedHolidays",[]),Pe(this,"selectedWeekends",[0,6]),Pe(this,"selectedTime",void 0),Pe(this,"selectedTheme","system"),Pe(this,"timeMinHour",0),Pe(this,"timeMaxHour",23),Pe(this,"timeMinMinute",0),Pe(this,"timeMaxMinute",59),Pe(this,"timeControls","all"),Pe(this,"timeStepHour",1),Pe(this,"timeStepMinute",1),Pe(this,"sanitizerHTML",W),Pe(this,"onClickDate",void 0),Pe(this,"onClickWeekDay",void 0),Pe(this,"onClickWeekNumber",void 0),Pe(this,"onClickTitle",void 0),Pe(this,"onClickMonth",void 0),Pe(this,"onClickYear",void 0),Pe(this,"onClickArrow",void 0),Pe(this,"onChangeTime",void 0),Pe(this,"onChangeToInput",void 0),Pe(this,"onCreateDateRangeTooltip",void 0),Pe(this,"onCreateDateEls",void 0),Pe(this,"onCreateMonthEls",void 0),Pe(this,"onCreateYearEls",void 0),Pe(this,"onInit",void 0),Pe(this,"onUpdate",void 0),Pe(this,"onDestroy",void 0),Pe(this,"onShow",void 0),Pe(this,"onHide",void 0),Pe(this,"popups",{}),Pe(this,"labels",Ne(Ne({},rt),{},{arrowNext:Ne({},rt.arrowNext),arrowPrev:Ne({},rt.arrowPrev)})),Pe(this,"layouts",{default:"",multiple:"",month:"",year:"",week:""}),Pe(this,"styles",Ne({},at))}},ct=new WeakMap,ht=e=>{let t=ct.get(e);t&&cancelAnimationFrame(t.frame),ct.delete(e)},ut=(e,t,i)=>{if(!t)return;if(!i)return t.dataset.vcDateRangeTooltip="hidden",void(t.textContent="");let n=e.context.mainElement.getBoundingClientRect(),s=i.getBoundingClientRect();t.style.left=s.left-n.left+s.width/2+"px",t.style.top=s.bottom-n.top-s.height+"px",t.dataset.vcDateRangeTooltip="visible",t.innerHTML=e.sanitizerHTML(e.onCreateDateRangeTooltip(e,i,t,s,n))},pt=Object.freeze({name:"annotations",component:e=>e.onCreateDateRangeTooltip?`<div class="${j(e.styles.dateRangeTooltip)}" data-vc-date-range-tooltip="hidden"></div>`:"",tooltip:ut,hover:(e,t)=>{let i=v(e);if(e.context.mainElement.hasAttribute("data-vc-dragging"))return;let n=null==t?void 0:t.closest("[data-vc-date-selected]");if(!n&&i.lastDateEl)return i.lastDateEl=null,void ut(e,i.tooltipEl,null);n&&i.lastDateEl!==n&&(i.lastDateEl=n,ut(e,i.tooltipEl,n))},prepare(e,i){if(ht(e),!e.popups||!Object.keys(e.popups).length)return;let s=i>1?new Map:void 0;return i=>((e,i,s)=>{let o=e.popups&&Object.entries(e.popups);if(null==o||!o.length)return;let l=new Map;i.querySelectorAll("[data-vc-date]").forEach(e=>{let t=e.dataset.vcDate;l.has(t)||l.set(t,e)});let r=Array.from(l.keys(),e=>+t(e)).filter(Number.isFinite);if(!r.length)return;let a={start:new Date(Math.min(...r)),end:new Date(Math.max(...r)),cursors:s};o.forEach(([t,i])=>{n([t],a).forEach(t=>((e,t,i)=>{var n;let s=null==t?void 0:t.querySelector("[data-vc-date-btn]");if(!t||!s||(null!=i&&i.modifier&&s.classList.add(...i.modifier.trim().split(" ")),null==i||!i.html))return;let o=document.createElement("div");o.className=e.styles.datePopup,o.dataset.vcDatePopup="",o.innerHTML=e.sanitizerHTML(i.html),s.ariaLabel=`${s.ariaLabel}, ${null==(n=o.textContent)?void 0:n.replace(/^\s+|\s+(?=\s)|\s+$/g,"").replace(/ /g," ")}`,t.appendChild(o),((e,t,i)=>{let n=ct.get(e);if(!n){n={frame:0,elements:[]},ct.set(e,n);let t=n.elements;n.frame=requestAnimationFrame(()=>{ct.delete(e),t.filter(({dateEl:t,popup:i})=>!e.context.isDestroyed&&i.isConnected&&e.context.mainElement.contains(t)).map(({dateEl:e,popup:t})=>{let{canShow:i}=$(e,t);return{popup:t,top:i.bottom?e.offsetHeight:-t.offsetHeight,left:i.left&&!i.right?e.offsetWidth-t.offsetWidth/2:!i.left&&i.right?t.offsetWidth/2:0}}).forEach(({popup:e,left:t,top:i})=>Object.assign(e.style,{left:`${t}px`,top:`${i}px`}))})}n.elements.push({dateEl:t,popup:i})})(e,t,o)})(e,l.get(t),i))})})(e,i,s)},destroy:ht}),mt=(e,t)=>{var i;if("multiple"!==e.type)return{currentValue:null,columnID:0};let n=e.context.mainElement.querySelectorAll('[data-vc="column"]'),s=Array.from(n).findIndex(e=>e.closest(`[data-vc-column="${t}"]`));return{currentValue:s>=0?Number(null==(i=n[s].querySelector(`[data-vc="${t}"]`))?void 0:i.getAttribute(`data-vc-${t}`)):null,columnID:Math.max(s,0)}},gt=(e,t,i)=>{let{currentValue:n,columnID:s}=mt(e,t);return"month"===e.context.currentType&&s>=0?i-s:"year"===e.context.currentType&&e.context.selectedYear!==n?i-1:i},vt=Object.freeze({name:"months",layout:e=>`\n <div class="${j(e.styles.controls)}" data-vc="controls" role="group" aria-label="${j(e.labels.navigation)}">\n <#ArrowPrev [month] />\n <#ArrowNext [month] />\n </div>\n <div class="${j(e.styles.grid)}" data-vc="grid">\n <#Multiple>\n <div class="${j(e.styles.column)}" data-vc="column" role="group">\n <div class="${j(e.styles.header)}" data-vc="header">\n <div class="${j(e.styles.headerContent)}" data-vc-header="content" aria-live="polite" aria-atomic="true">\n <#Month />\n <#Year />\n </div>\n </div>\n <div class="${j(e.styles.wrapper)}" data-vc="wrapper">\n <#WeekNumbers />\n <div class="${j(e.styles.content)}" data-vc="content" role="grid">\n <#Week />\n <#Dates />\n </div>\n </div>\n </div>\n <#/Multiple>\n <#DateRangeTooltip />\n </div>\n <#ControlTime />\n`,render:(e,t)=>{var i;if("multiple"===e.context.currentType)return null==(i=u(e).time)||i.destroy(e),e.context.mainElement.innerHTML=e.sanitizerHTML(((e,t)=>t.replace(RegExp("<#Multiple>(.*?)<#\\/Multiple>","gs"),(t,i)=>{let n=Array(e.context.displayMonthsCount).fill(i).join("");return e.sanitizerHTML(n)}).replace(/[\n\t]/g,""))(e,be(e,e.layouts.multiple))),!0;if("multiple"!==e.type||!t)return!1;let n=e.context.mainElement.querySelector('[data-vc="controls"]'),s=e.context.mainElement.querySelector('[data-vc="grid"]'),o=t.closest('[data-vc="column"]');return n&&n.remove(),s&&(s.dataset.vcGrid="hidden"),o&&(o.dataset.vcColumn=e.context.currentType),o&&(o.innerHTML=e.sanitizerHTML(be(e,e.layouts[e.context.currentType]))),!0},column:mt,select:(e,i,n)=>"month"===i?((e,i)=>{let n=i.closest('[data-vc-column="month"]').querySelector('[data-vc="year"]'),s=gt(e,"month",Number(i.dataset.vcMonthsMonth)),o=Number(n.dataset.vcYear),l=t(e.context.dateMin),r=t(e.context.dateMax),a=s<l.getMonth()&&o<=l.getFullYear(),d=s>r.getMonth()&&o>=r.getFullYear();y(e,"selectedYear",o),y(e,"selectedMonth",a?l.getMonth():d?r.getMonth():s)})(e,n):((e,i)=>{let n=gt(e,"year",Number(i.dataset.vcYearsYear)),s=t(e.context.dateMin),o=t(e.context.dateMax),l=e.context.displayMonthsCount-1,{columnID:r}=mt(e,"year"),a=e.context.selectedMonth<s.getMonth()&&n<=s.getFullYear(),d=e.context.selectedMonth>o.getMonth()-l+r&&n>=o.getFullYear(),c=n<s.getFullYear(),h=n>o.getFullYear(),u=a||c?s.getFullYear():d||h?o.getFullYear():n,p=a||c?s.getMonth():d||h?o.getMonth()-l+r:e.context.selectedMonth;y(e,"selectedYear",u),y(e,"selectedMonth",p)})(e,n),rotate:(e,t)=>{var i;let n=12*e.context.selectedYear+e.context.selectedMonth-t.month;if(!n||Math.abs(n)>=t.count)return;let s=Array.from(e.context.mainElement.querySelectorAll('[data-vc="column"]')),o=null==(i=s[0])?void 0:i.parentElement;if(!o||s.length!==t.count||s.some(e=>e.parentElement!==o)||Array.from(o.childNodes).some(e=>{var t;return 1===e.nodeType?!s.includes(e):3!==e.nodeType||!(null==(t=e.textContent)||!t.trim())}))return;let l=[];if(n>0){let e=s[s.length-1].nextSibling;for(let i=0;i<n;i++){let r=s[i].nextSibling;3===(null==r?void 0:r.nodeType)&&r!==e&&o.insertBefore(r,e),o.insertBefore(s[i],e),l.push(t.count-n+i)}}else for(let e=t.count+n;e<t.count;e++){let i=s[e].previousSibling;o.insertBefore(s[e],s[0]),3===(null==i?void 0:i.nodeType)&&o.insertBefore(i,s[0]),l.push(e-t.count-n)}return l}}),ft="cubic-bezier(0.4, 0, 0.2, 1)",yt={group:"slide",duration:250,easing:ft},bt={prev:Object.assign({enter:"translateX(-100%)",leave:"translateX(100%)"},yt),next:Object.assign({enter:"translateX(100%)",leave:"translateX(-100%)"},yt),fade:{group:"fade",duration:150,easing:ft}},wt={group:"collapse",duration:300,easing:ft},Ct=e=>!!e.animation&&"function"==typeof Element.prototype.animate&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches,xt=(e,t)=>{var i,n,s,o,l;let r="object"==typeof e.animation?e.animation:{},a=null==(i=r[t.group])?{}:i;return{duration:null==(n=null==(s=a.duration)?r.duration:s)?t.duration:n,easing:null==(o=null==(l=a.easing)?r.easing:l)?t.easing:o}},St=["display","flexDirection","gridTemplateColumns","gridTemplateRows","rowGap","columnGap","alignItems","alignContent","justifyItems","justifyContent","padding"],Tt=e=>{let t=document.createElement("div"),i=getComputedStyle(e);t.dataset.vcGhost="",t.ariaHidden="true",t.setAttribute("inert",""),St.forEach(e=>{t.style[e]=i[e]}),t.style.top=`${e.offsetTop}px`,t.style.left=`${e.offsetLeft}px`,t.style.width=`${e.offsetWidth}px`,t.style.height=`${e.offsetHeight}px`;let n=Array.from(e.querySelectorAll('[data-vc="dates"], [data-vc="months"], [data-vc="years"]'),e=>({grid:e,height:e.offsetHeight}));return()=>(n.forEach(({grid:e,height:t})=>{e.style.height=`${t}px`,e.style.flex="none"}),t.append(...e.children),t)},kt=e=>(e.forEach(e=>{var t;return null==(t=e.parentElement)?void 0:t.setAttribute("data-vc-clip","")}),e.map(Tt).map(e=>e())),Et=e=>{var t;e.removeAttribute("data-vc-animating"),e.removeAttribute("data-vc-collapsing"),null==(t=e.parentElement)||t.removeAttribute("data-vc-clip")},Lt=e=>{e.querySelectorAll("[data-vc-ghost]").forEach(e=>{e.getAnimations().forEach(e=>e.cancel()),e.remove()}),e.querySelectorAll("[data-vc-animating], [data-vc-collapsing]").forEach(e=>{e.getAnimations().forEach(e=>e.cancel()),Et(e)})},It=e=>e.filter(({ghost:e})=>e.isConnected).forEach(({el:e,ghost:t})=>{t.remove(),Et(e)}),At=(e,t,i,n,s)=>{if(!Ct(e))return n();let{layers:o}=((e,t,i,n,s)=>{let{mainElement:o}=e.context;Lt(o);let l=bt[i],r=xt(e,l),a=Ne(Ne({},r),{},{fill:"forwards"}),d=kt(Array.from(o.querySelectorAll(t)).filter((e,t)=>void 0===s||s===t));n();let c=[];return o.querySelectorAll(t).forEach((e,t)=>{var i,n;let o=d[void 0===s?t:s===t?0:-1];if(!o)return;if(!e.children.length)return e.append(...o.children),void Et(e);e.dataset.vcAnimating="",null==(i=e.parentElement)||i.setAttribute("data-vc-clip",""),null==(n=e.parentElement)||n.appendChild(o);let[h,u]=l.enter?[[{transform:"none"},{transform:l.leave}],[{transform:l.enter},{transform:"none"}]]:[[{opacity:1},{opacity:0}],[{opacity:0},{opacity:1}]];c.push({el:e,ghost:o,animations:[o.animate(h,a),e.animate(u,r)]})}),{layers:c,duration:r.duration}})(e,t,i,n,s);o.forEach(e=>{e.animations[1].onfinish=()=>It([e])})},Mt=e=>Math.min(Math.max(e,0),1),Ot=new Set(["offset","computedOffset","easing","composite"]),Dt=(e,t,i,n)=>{var s,o;t.forEach(e=>e.pause());let l=null==(s=null==(o=t[0])||null==(o=o.effect)?void 0:o.getTiming().easing)?"linear":s,r=!1,a=!1,d=e=>{a||(a=!0,n(e))};return{track:()=>{r=!0,t.forEach(e=>{var t;return null==(t=e.effect)?void 0:t.updateTiming({easing:"linear"})})},seek:e=>{let n=Mt(e)*i;t.forEach(e=>{e.currentTime=n})},settle:n=>{if(!a){if(!t.length||!Ct(e)||t[0].currentTime===(n?i:0))return d(n);if(r){let e=Mt(Number(t[0].currentTime)/i),s=Math.abs(Number(n)-e),o=i*Math.max(s,.8),r=t.map(e=>((e,t)=>{let i=e.effect,n=null==i?void 0:i.target;if(!(i&&n instanceof Element))return null;let s=i.getKeyframes(),o=s[t?s.length-1:0];if(!o)return null;let l=getComputedStyle(n),r={},a={};return Object.entries(o).forEach(([e,t])=>{Ot.has(e)||(r[e]=l.getPropertyValue((e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`))(e)),a[e]=t)}),{effect:i,keyframes:[r,a]}})(e,n));if(r.every(e=>null!==e))return r.forEach((e,i)=>{var n;if(!e)return;let s=t[i];e.effect.setKeyframes(e.keyframes),null==(n=s.effect)||n.updateTiming({duration:o,easing:l}),s.currentTime=0,s.playbackRate=1,s.play()}),void(t[0].onfinish=()=>d(n))}t.forEach(e=>{e.playbackRate=n?1:-1,e.play()}),t[0].onfinish=()=>d(n)}}}},Pt=e=>{var t;let i=null==(t=u(e).weeks)?void 0:t.prepareCollapse(e);if(!i)return null;let{datesEl:n,rows:s,targetRow:o,wasCollapsed:l}=i,r=n.offsetHeight,a=o.offsetHeight,d=o.offsetTop-s[0].offsetTop,c=Ne(Ne({},xt(e,wt)),{},{fill:"both"}),h=c.duration,p="function"==typeof n.animate;p&&(n.dataset.vcCollapsing="");let m=p?[n.animate([{height:`${r}px`},{height:`${a}px`}],c),...s.map(e=>e.animate([{transform:"none",opacity:1},{transform:`translateY(${-d}px)`,opacity:+(e===o)}],c))]:[],{track:g,seek:v,settle:f}=Dt(e,m,h,e=>{m.forEach(e=>e.cancel()),i.finish(e)}),y=+!!l;return v(y),{distance:r-a,from:y,track:g,seek:v,settle:f}},$t=e=>({x:e.clientX,y:e.clientY,time:e.timeStamp}),Nt=e=>{let t=$t(e),i=t,n=t;return{origin:t,move:e=>{n=$t(e),n.time-i.time>170&&(i=n)},velocity:(e,t)=>{let s=n.time-i.time;return!s||e.timeStamp-n.time>170?0:(t?n.y-i.y:n.x-i.x)/s}}},Ht={mouse:4,pen:6,touch:10},Bt=e=>{var t;return null==(t=Ht[e.pointerType])?Ht.touch:t},qt=new WeakMap,Ft=e=>{var t;return null==(t=qt.get(e))?void 0:t.cleanup()},_t=e=>{let{mainElement:t}=e.context;if(Ft(t),e.inputMode&&!e.context.inputModeInit||!e.enableSwipe&&!e.enableCollapse)return;let i=null,n=0,s=!1,o=()=>{let e=null==i?void 0:i.pointerId;i=null,t.removeAttribute("data-vc-dragging"),p(),void 0!==e&&l(e)},l=e=>{try{t.releasePointerCapture(e)}catch(e){}},r=(e,t)=>Mt(t.transition.from+t.sign*((e,t)=>t.vertical?e.clientY-t.tracker.origin.y:e.clientX-t.tracker.origin.x)(e,t)/t.distance),a=l=>{if(n=0,!l.isPrimary||0!==l.button)return;i&&o();let r=l.target,a=!(!e.enableCollapse||!r.closest('[data-vc="collapse"]')),d=!(!e.enableSwipe||!r.closest('[data-vc="content"]')||r.closest("[data-vc-ghost]"));(a||d)&&(i={pointerId:l.pointerId,tracker:Nt(l),slop:Bt(l),vertical:a,transition:null,sign:-1,distance:1},s||(s=!0,u.forEach(([e,t])=>window.addEventListener(e,t)),t.addEventListener("lostpointercapture",c)))},d=(e,t)=>{let s=i;if(!s||e.pointerId!==s.pointerId)return;let{transition:l}=s;if(l){let i=t?0:s.tracker.velocity(e,s.vertical),o=r(e,s)+s.sign*i*200/s.distance,a=0===l.from?o>.25:o>=.75;l.settle(t?1===l.from:a),n=Date.now()}o()},c=e=>{e.target===t&&d(e,!0)},h=e=>{!n||Date.now()-n>500||(n=0,e.stopPropagation(),e.preventDefault())},u=[["pointermove",s=>{let l=i;if(!l||s.pointerId!==l.pointerId)return;l.tracker.move(s);let a=s.clientX-l.tracker.origin.x,d=s.clientY-l.tracker.origin.y;if(!l.transition){if(Math.abs(a)<l.slop&&Math.abs(d)<l.slop)return;if(l.vertical!==Math.abs(d)>Math.abs(a))return o();if(((i,n,s)=>{if(!(e=>{try{return t.setPointerCapture(e),!0}catch(e){return!1}})(i.pointerId))return o();try{let l=n.vertical?Pt(e):((e,t,i)=>{let n=ze(e);if(!n)return null;let s=e.context.mainElement.querySelector(`[data-vc-arrow="${t}"]`);if(!s||"hidden"===s.style.visibility)return null;let{mainElement:o}=e.context,l=()=>Array.from(o.querySelectorAll(n.selector)),r="next"===t?"prev":"next",a=l();if(!a.length)return null;if("function"!=typeof a[0].animate){let{track:s,seek:o,settle:l}=Dt(e,[],0,s=>{s&&(n.shift(t),n.render(i),Se(e),xe(e))});return{distance:a[0].offsetWidth,from:0,track:s,seek:o,settle:l}}Lt(o),n.shift(t),n.render(i);let d=kt(l());n.shift(r),n.render(i);let c="next"===t?100:-100,h=Ne(Ne({},xt(e,yt)),{},{fill:"both"}),u=l().map((e,t)=>{var i,n;let s=d[t];return e.dataset.vcAnimating="",null==(i=e.parentElement)||i.setAttribute("data-vc-clip",""),null==(n=e.parentElement)||n.appendChild(s),{el:e,ghost:s,animations:[e.animate([{transform:"none"},{transform:`translateX(${-c}%)`}],h),s.animate([{transform:`translateX(${c}%)`},{transform:"none"}],h)]}});if(!u.length)return null;let p=u.flatMap(e=>e.animations),m=()=>{p.forEach(e=>e.cancel()),It(u)},{track:g,seek:v,settle:f}=Dt(e,p,h.duration,s=>s?void(u[0].ghost.isConnected&&(n.shift(t),n.render(i),m(),Se(e),xe(e))):m());return v(0),{distance:u[0].el.offsetWidth,from:0,track:g,seek:v,settle:f}})(e,s<0?"next":"prev",i.target);if(null==l||!l.distance)return o();l.track(),n.transition=l,n.sign=n.vertical||s<0?-1:1,n.distance=l.distance,t.dataset.vcDragging=""}catch(e){throw o(),e}})(s,l,a),!i)return}n=Date.now(),l.transition.seek(r(s,l))}],["pointerup",e=>d(e,!1)],["pointercancel",e=>d(e,!0)]];function p(){s&&(s=!1,u.forEach(([e,t])=>window.removeEventListener(e,t)),t.removeEventListener("lostpointercapture",c))}t.addEventListener("pointerdown",a),t.addEventListener("click",h,{capture:!0});let m=()=>{o(),p(),t.removeEventListener("pointerdown",a),t.removeEventListener("click",h,{capture:!0}),qt.delete(t)};return qt.set(t,{cleanup:m,cancel:()=>{o(),n=0}}),m},Rt=Object.freeze({name:"motion",bind:_t,reset(e){(e=>{var t;let{mainElement:i}=e.context;null==(t=qt.get(i))||t.cancel(),e.enableSwipe||e.enableCollapse?qt.has(i)||_t(e):Ft(i)})(e),Lt(e.context.mainElement)},destroy(e){Ft(e.context.mainElement),Lt(e.context.mainElement)},collapse:Pt,navigate:At,changeView(e,t,i){let n='[data-vc="column"]',s=((e,t)=>Ct(e)?Array.from(e.context.mainElement.querySelectorAll(t)).map(e=>getComputedStyle(e).opacity):[])(e,n);At(e,'[data-vc="wrapper"]',"fade",i,t),((e,t,i)=>{if(!i.length)return;let n=xt(e,bt.fade);e.context.mainElement.querySelectorAll(t).forEach((e,t)=>{let s=i[t],o=getComputedStyle(e).opacity;void 0!==s&&s!==o&&e.animate([{opacity:s},{opacity:o}],n)})})(e,n,s)}}),jt=(e,t,i,n)=>{({hour:()=>y(e,"selectedHours",i),minute:()=>y(e,"selectedMinutes",i)})[n](),y(e,"selectedTime",`${e.context.selectedHours}:${e.context.selectedMinutes}${e.context.selectedKeeping?` ${e.context.selectedKeeping}`:""}`),e.onChangeTime&&e.onChangeTime(e,t,!1),e.inputMode&&e.context.inputElement&&e.context.mainElement&&e.onChangeToInput&&e.onChangeToInput(e,t)},Vt=(e,t)=>{var i;return(null==(i={0:{AM:"00",PM:"12"},1:{AM:"01",PM:"13"},2:{AM:"02",PM:"14"},3:{AM:"03",PM:"15"},4:{AM:"04",PM:"16"},5:{AM:"05",PM:"17"},6:{AM:"06",PM:"18"},7:{AM:"07",PM:"19"},8:{AM:"08",PM:"20"},9:{AM:"09",PM:"21"},10:{AM:"10",PM:"22"},11:{AM:"11",PM:"23"},12:{AM:"00",PM:"12"}}[Number(e)])?void 0:i[t])||String(e)},zt=e=>({0:"12",13:"01",14:"02",15:"03",16:"04",17:"05",18:"06",19:"07",20:"08",21:"09",22:"10",23:"11"}[Number(e)]||String(e)),Wt=(e,t,i,n)=>{e.value=i,t.value=n},Yt=(e,t,i,n,s,o,l)=>{let r={hour:(r,a,d)=>{e.selectionTimeMode&&{12:()=>{if(!e.context.selectedKeeping)return;let c=Number(Vt(a,e.context.selectedKeeping));if(!(c<=o&&c>=l))return Wt(i,t,e.context.selectedHours,e.context.selectedHours),void(e.onChangeTime&&e.onChangeTime(e,d,!0));Wt(i,t,zt(a),Vt(a,e.context.selectedKeeping)),r>12&&((e,t,i)=>{t&&i&&(y(e,"selectedKeeping",i),t.innerText=i)})(e,n,"PM"),jt(e,d,zt(a),s)},24:()=>{if(!(r<=o&&r>=l))return Wt(i,t,e.context.selectedHours,e.context.selectedHours),void(e.onChangeTime&&e.onChangeTime(e,d,!0));Wt(i,t,a,a),jt(e,d,a,s)}}[e.selectionTimeMode]()},minute:(n,r,a)=>{if(!(n<=o&&n>=l))return i.value=e.context.selectedMinutes,void(e.onChangeTime&&e.onChangeTime(e,a,!0));i.value=r,t.value=r,jt(e,a,r,s)}},a=e=>{let t=Number(i.value),n=i.value.padStart(2,"0");r[s]&&r[s](t,n,e)};return i.addEventListener("change",a),()=>{i.removeEventListener("change",a)}},Ut=(e,t,i,n,s)=>{let o=o=>{let l=Number(t.value),r=t.value.padStart(2,"0"),a="hour"===s,d=24===e.selectionTimeMode,c=l>0&&l<12;a&&!d&&((e,t,i)=>{t&&(y(e,"selectedKeeping",i),t.innerText=i)})(e,n,0===l||c?"AM":"PM"),((e,t,i,n,s)=>{t.value=s,jt(e,i,s,n)})(e,i,o,s,!a||d||c?r:zt(t.value))};return t.addEventListener("input",o),()=>{t.removeEventListener("input",o)}},Kt=e=>e.setAttribute("data-vc-input-focus",""),Qt=e=>e.removeAttribute("data-vc-input-focus"),Jt=(e,t,i,n,s)=>`\n <div class="${j(t)}" data-vc-time-input="${e}">\n <input type="text" name="${e}" maxlength="2" aria-label="${j(i[`input${e.charAt(0).toUpperCase()+e.slice(1)}`])}" value="${j(n)}" ${s?"disabled":""}>\n </div>\n`,Gt=(e,t,i,n,s,o,l)=>`\n <div class="${j(t)}" data-vc-time-range="${e}">\n <input type="range" min="${j(n)}" max="${j(s)}" step="${j(o)}" aria-label="${j(i[`range${e.charAt(0).toUpperCase()+e.slice(1)}`])}" value="${j(l)}">\n </div>\n`,Zt=new WeakMap,Xt=e=>{var t;null==(t=Zt.get(e))||t(),Zt.delete(e)},ei=Object.freeze({name:"time",component:e=>e.selectionTimeMode?`<div class="${j(e.styles.time)}" data-vc="time" role="group" aria-label="${j(e.labels.selectingTime)}"></div>`:"",init:e=>{var t,i;if(!e.selectionTimeMode)return;if(![12,24].includes(e.selectionTimeMode))throw Error("The value of the time property can be: false, 12 or 24.");let n=12===e.selectionTimeMode,s=n?/^(0[1-9]|1[0-2]):([0-5][0-9]) ?(AM|PM)?$/i:/^([0-1]?[0-9]|2[0-3]):([0-5][0-9])$/,[o,l,r]=null==(t=null==(i=e.selectedTime)||null==(i=i.match(s))?void 0:i.slice(1))?[]:t;o?n&&!r&&(r="AM"):(o=n?zt(String(e.timeMinHour)):String(e.timeMinHour),l=String(e.timeMinMinute),r=n?e.timeMinHour>=12?"PM":"AM":null),y(e,"selectedHours",o.padStart(2,"0")),y(e,"selectedMinutes",l.padStart(2,"0")),y(e,"selectedKeeping",r),y(e,"selectedTime",`${e.context.selectedHours}:${e.context.selectedMinutes}${r?` ${r}`:""}`)},render:e=>{Xt(e);let t=e.context.mainElement.querySelector('[data-vc="time"]');if(!e.selectionTimeMode||!t)return;let[i,n]=[e.timeMinHour,e.timeMaxHour],[s,o]=[e.timeMinMinute,e.timeMaxMinute],l=e.context.selectedKeeping?Vt(e.context.selectedHours,e.context.selectedKeeping):e.context.selectedHours,r="range"===e.timeControls;var a;t.innerHTML=e.sanitizerHTML(`\n <div class="${j(e.styles.timeContent)}" data-vc-time="content">\n ${Jt("hour",e.styles.timeHour,e.labels,e.context.selectedHours,r)}\n ${Jt("minute",e.styles.timeMinute,e.labels,e.context.selectedMinutes,r)}\n ${12===e.selectionTimeMode?(a=e.context.selectedKeeping,`<button type="button" class="${j(e.styles.timeKeeping)}" aria-label="${j(e.labels.btnKeeping)} ${j(a)}" data-vc-time="keeping" ${r?"disabled":""}>${j(a)}</button>`):""}\n </div>\n <div class="${j(e.styles.timeRanges)}" data-vc-time="ranges">\n ${Gt("hour",e.styles.timeRange,e.labels,i,n,e.timeStepHour,l)}\n ${Gt("minute",e.styles.timeRange,e.labels,s,o,e.timeStepMinute,e.context.selectedMinutes)}\n </div>\n `);let d=((e,t)=>{let i=t.querySelector('[data-vc-time-range="hour"] input'),n=t.querySelector('[data-vc-time-range="minute"] input'),s=t.querySelector('[data-vc-time-input="hour"] input[name="hour"]'),o=t.querySelector('[data-vc-time-input="minute"] input[name="minute"]'),l=t.querySelector('[data-vc-time="keeping"]');if(!(i&&n&&s&&o))return;let r=e=>{e.target===i&&Kt(s),e.target===n&&Kt(o)},a=e=>{e.target===i&&Qt(s),e.target===n&&Qt(o)};t.addEventListener("mouseover",r),t.addEventListener("mouseout",a);let d=[Yt(e,i,s,l,"hour",e.timeMaxHour,e.timeMinHour),Yt(e,n,o,l,"minute",e.timeMaxMinute,e.timeMinMinute),Ut(e,i,s,l,"hour"),Ut(e,n,o,l,"minute")];return l&&d.push(((e,t,i,n,s)=>{let o=o=>{let l="AM"===e.context.selectedKeeping?"PM":"AM",r=Vt(e.context.selectedHours,l);Number(r)<=n&&Number(r)>=s?(y(e,"selectedKeeping",l),i.value=r,jt(e,o,e.context.selectedHours,"hour"),t.ariaLabel=`${e.labels.btnKeeping} ${e.context.selectedKeeping}`,t.innerText=e.context.selectedKeeping):e.onChangeTime&&e.onChangeTime(e,o,!0)};return t.addEventListener("click",o),()=>{t.removeEventListener("click",o)}})(e,l,i,e.timeMaxHour,e.timeMinHour)),()=>{d.forEach(e=>e()),t.removeEventListener("mouseover",r),t.removeEventListener("mouseout",a)}})(e,t);d&&Zt.set(e,d)},destroy:Xt}),ti=(e,i)=>{let n=t(e),s=(n.getDay()-i+7)%7;n.setDate(n.getDate()+3-s);let o=new Date(n.getFullYear(),0,1),l=Math.ceil(((+n-o)/864e5+1)/7);return{year:n.getFullYear(),week:l}},ii=(e,t)=>{let i=new Date(e);return i.setDate(e.getDate()-(e.getDay()-t+7)%7),i},ni=(e,n=!1)=>{let{displayWeekDate:s,selectedMonth:o,selectedYear:l,selectedDates:r,dateToday:a}=e.context,d=e=>e.getMonth()===o&&e.getFullYear()===l;if(s&&!n){let n=t(s),o=new Date(n);if(o.setDate(n.getDate()+6),d(n)||d(o)){if(n.getDay()===e.firstWeekday)return;let t=new Date(n);return t.setDate(n.getDate()+3),void y(e,"displayWeekDate",i(ii(t,e.firstWeekday)))}}let c=[null==r?void 0:r[0],a].filter(Boolean).map(t).find(d);y(e,"displayWeekDate",i(ii(null==c?new Date(l,o,1):c,e.firstWeekday)))},si=(e,t)=>{e.type=t,y(e,"currentType",t),Fe(e)},oi=Object.freeze({name:"weeks",weekday:e=>{if(!e.onClickWeekDay)return;let t=document.createElement("button");return t.type="button",t.className=e.styles.weekDayBtn,t.dataset.vcWeekDayBtn="",(e,i,n)=>{let s=t.cloneNode(!1);s.innerText=i,s.ariaLabel=n,e.appendChild(s)}},component:e=>{if(!e.enableCollapse)return"";let{expanded:t,label:i}=ve(e);return`<button type="button" class="${j(e.styles.collapse)}" data-vc="collapse" aria-expanded="${t}" aria-label="${j(i)}"></button>`},numbersComponent:e=>e.enableWeekNumbers?`<div class="${j(e.styles.weekNumbers)}" data-vc-week="numbers" role="group" aria-label="${j(e.labels.weekNumber)}"></div>`:"",layout:e=>z(e,"week"),init:ni,dates:(e,n)=>{let s=t(e.context.displayWeekDate),o=document.createElement("div");o.className=e.styles.datesRow,o.dataset.vcDates="row",o.role="row";let l={addDate:e=>o.appendChild(e)};for(let t=0;t<7;t++){let n=new Date(s);n.setDate(s.getDate()+t),le(e,n.getFullYear(),l,n.getDate(),i(n),"current")}n.appendChild(o)},numbers:(e,t,i,n,s)=>{if(!e.enableWeekNumbers)return;n.textContent="";let o=document.createElement("b");o.className=e.styles.weekNumbersTitle,o.innerText="#",o.dataset.vcWeekNumbers="title",n.appendChild(o);let l=document.createElement("div");l.className=e.styles.weekNumbersContent,l.dataset.vcWeekNumbers="content",n.appendChild(l);let r=!!e.onClickWeekNumber,a=document.createElement(r?"button":"b");r&&(a.type="button"),a.className=e.styles.weekNumber;let d=s.querySelectorAll("[data-vc-date]"),c=Math.ceil((t+i)/7);for(let t=0;t<c;t++){let i=d[0===t?6:7*t].dataset.vcDate,n=ti(i,e.firstWeekday);if(!n)return;let s=a.cloneNode(!1);s.innerText=String(n.week),s.dataset.vcWeekNumber=String(n.week),s.dataset.vcWeekYear=String(n.year),l.appendChild(s)}},date:(e,t,i)=>{let n=ti(i,e.firstWeekday);n&&(t.dataset.vcDateWeekNumber=String(n.week))},shift:(e,n)=>{let s=t(e.context.displayWeekDate);s.setDate(s.getDate()+("next"===n?7:-7)),((e,t)=>{let n=new Date(t);n.setDate(t.getDate()+3),y(e,"displayWeekDate",i(t)),y(e,"selectedMonth",n.getMonth()),y(e,"selectedYear",n.getFullYear())})(e,s)},arrows:(e,i,n)=>{let s=t(e.context.displayWeekDate),o=new Date(s);o.setDate(s.getDate()-7);let l=new Date(s);l.setDate(s.getDate()-1);let r=new Date(s);r.setDate(s.getDate()+7);let a=e=>{let t=new Date(e);return t.setDate(e.getDate()+3),t.getFullYear()},d=!e.selectionYearsMode&&a(o)!==e.context.selectedYear,c=!e.selectionYearsMode&&a(r)!==e.context.selectedYear;Ce(i,n,!e.selectionMonthsMode||d||l<t(e.context.dateMin),!e.selectionMonthsMode||c||r>t(e.context.dateMax))},click(e,t){((e,t)=>{if(!e.onClickWeekDay)return;let i=t.target.closest("[data-vc-week-day]"),n=t.target.closest('[data-vc="column"]'),s=n?n.querySelectorAll("[data-vc-date-week-day]"):e.context.mainElement.querySelectorAll("[data-vc-date-week-day]");if(!i||!s[0])return;let o=Number(i.dataset.vcWeekDay),l=Array.from(s).filter(e=>Number(e.dataset.vcDateWeekDay)===o);e.onClickWeekDay(e,o,l,t)})(e,t),((e,t)=>{if(!e.enableWeekNumbers||!e.onClickWeekNumber)return;let i=t.target.closest("[data-vc-week-number]"),n=e.context.mainElement.querySelectorAll("[data-vc-date-week-number]");if(!i||!n[0])return;let s=Number(i.innerText),o=Number(i.dataset.vcWeekYear),l=Array.from(n).filter(e=>Number(e.dataset.vcDateWeekNumber)===s);e.onClickWeekNumber(e,s,o,l,t)})(e,t)},collapseClick:(e,t)=>{if(!e.enableCollapse||!["default","week"].includes(e.context.currentType)||!t.target.closest('[data-vc="collapse"]'))return;let i=u(e).motion;if(i){let t=i.collapse(e);return void(null==t||t.settle(0===t.from))}if(!e.context.mainElement.querySelector('[data-vc="dates"] [data-vc-dates="row"]'))return;let n="week"!==e.context.currentType;n&&ni(e,!0),si(e,n?"week":"default")},prepareCollapse:e=>{var t;let{mainElement:i}=e.context;if(!["default","week"].includes(e.context.currentType)||i.querySelector("[data-vc-collapsing]"))return null;let n=i.querySelector('[data-vc="dates"]');if(!n)return null;let s="week"===e.context.currentType;s?(e.type="default",y(e,"currentType","default"),ue(e),xe(e),(e=>{let t=e.context.mainElement.querySelector('[data-vc="collapse"]');if(t){let{expanded:i,label:n}=ve(e);t.ariaExpanded=String(i),t.ariaLabel=n}["prev","next"].forEach(t=>{let i=e.context.mainElement.querySelector(`[data-vc-arrow="${t}"]`);i&&(i.ariaLabel=fe(e,t,"month"))})})(e)):ni(e,!0);let o=Array.from(n.querySelectorAll('[data-vc-dates="row"]'));return o.length?{datesEl:n,rows:o,targetRow:null==(t=o.find(t=>t.querySelector(`[data-vc-date="${e.context.displayWeekDate}"]`)))?o[0]:t,wasCollapsed:s,finish(t){if(!e.context.isDestroyed&&e.context.mainElement===i&&n.isConnected){if(t)return si(e,"week");if(s)return si(e,"default");n.removeAttribute("data-vc-collapsing")}}}:(s&&si(e,"week"),null)}}),li=class e extends dt{constructor(t,i){var n;super(),Pe(this,"extensions",void 0),Pe(this,"init",()=>(e=>{var t;if(e.context.isInit)throw Error("The calendar has already been initialized, calling init() again is not allowed. Create a new Calendar instance instead.");if(p(e),y(e,"originalElement",e.context.mainElement.cloneNode(!0)),y(e,"isInit",!0),e.inputMode){let t=(e=>{y(e,"inputElement",e.context.mainElement);let t=e.context.inputElement;["input","button","textarea"].includes(t.localName)&&(t.setAttribute("aria-haspopup","dialog"),("button"===t.localName||"combobox"===t.getAttribute("role"))&&t.setAttribute("aria-expanded","false"));let i=()=>{e.context.inputModeInit?q(e):(e=>{var t;let i=document.createElement("div");i.className=e.styles.calendar,i.dataset.vc="calendar",i.dataset.vcInput="",i.dataset.vcCalendarHidden="",Object.assign(i.style,{left:"0",top:"0"}),M(i);let n=T(e.context.mainElement),s=n===document?document.body:n;y(e,"inputModeInit",!0),y(e,"isShowInInputMode",!1),y(e,"mainElement",i),s.appendChild(e.context.mainElement),nt(e,{year:!0,month:!0,dates:!0,time:!0,locale:!0}),q(e),e.onInit&&e.onInit(e),e.context.isDestroyed||(Re(e),null==(t=u(e).motion)||t.bind(e),Ge(e))})(e)};e.context.inputElement.addEventListener("click",i);let n="function"==typeof e.openOnFocus||!0===e.openOnFocus,s=()=>{(e=>k.has(e))(e)?(e=>{k.delete(e)})(e):(e=>b(e,e.openOnFocus))(e)&&i()};n&&e.context.inputElement.addEventListener("focus",s);let o=t=>{let i="Tab"===t.key&&!t.shiftKey,n=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key);(i||n)&&(t=>{var i;if(!e.context.isShowInInputMode||T(e.context.mainElement).activeElement!==e.context.inputElement)return!1;let n=e=>e.tabIndex>=0&&!e.hasAttribute("disabled")&&"true"!==e.getAttribute("aria-disabled"),s=null==(i=document.createTreeWalker(e.context.mainElement,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>n(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}).nextNode())?n(e.context.mainElement)?e.context.mainElement:null:i;!s||s.tabIndex<0||(t.preventDefault(),s.focus())})(t)};return e.context.inputElement.addEventListener("keydown",o),()=>{t.removeEventListener("click",i),n&&t.removeEventListener("focus",s),t.removeEventListener("keydown",o)}})(e);return y(e,"cleanupInput",t),t}if(it(e),Fe(e),"multiple-ranged"===e.selectionDatesMode&&1===e.context.selectedDates.length&&(S(e,null),_e(e)),e.onInit&&e.onInit(e),!e.context.isDestroyed)return Re(e),null==(t=u(e).motion)||t.bind(e),Ge(e)})(this)),Pe(this,"update",e=>st(this,e)),Pe(this,"destroy",()=>{let t=this.inputMode?this.context.inputElement:this.context.mainElement;if((e=>{var t,i,n,s,l,r,a,d;if(!e.context.isInit)throw Error(_);if(e.context.isDestroyed)throw Error("The calendar has already been destroyed, calling destroy() again is not allowed.");U(e);let c=u(e);var h,p,m,g,v;null==(t=c.motion)||t.destroy(e),null==(i=c.time)||i.destroy(e),null==(n=c.annotations)||n.destroy(e),x(e),(e=>{o.delete(e)})(e),B(e),null==(s=(l=e.context).cleanupInput)||s.call(l),y(e,"cleanupInput",void 0),null==(r=e.context.cleanupHandlers)||r.forEach(e=>e()),y(e,"cleanupHandlers",[]),y(e,"isShowInInputMode",!1),null==(a=(d=e.context).cleanupSystemTheme)||a.call(d),e.inputMode?(e.context.mainElement!==e.context.inputElement&&(null==(m=e.context.mainElement.parentElement)||m.removeChild(e.context.mainElement)),null==(h=e.context.inputElement)||null==(p=h.replaceWith)||p.call(h,e.context.originalElement),y(e,"inputElement",void 0)):null==(g=(v=e.context.mainElement).replaceWith)||g.call(v,e.context.originalElement),y(e,"mainElement",e.context.originalElement),y(e,"isDestroyed",!0),e.onDestroy&&e.onDestroy(e)})(this),t)for(let[i,n]of e.memoizedElements)n===t&&e.memoizedElements.delete(i)}),Pe(this,"show",()=>F(this)),Pe(this,"hide",()=>O(this)),Pe(this,"set",(e,t)=>((e,t,i)=>{p(e,t);let n=Object.keys(t);t.extensions&&n.splice(n.indexOf("extensions"),1);let s=1===n.length&&"selectedDates"===n[0]?X(e):void 0;lt(e,t),e.context.isInit&&st(e,i,s)})(this,e,t)),Pe(this,"context",void 0),this.context=Ne(Ne({},this.context),{},{locale:{months:{short:[],long:[]},weekdays:{short:[],long:[]}}}),y(this,"mainElement","string"==typeof t?null==(n=e.memoizedElements.get(t))?this.queryAndMemoize(t):n:t);let s=null==i?void 0:i.extensions;this.extensions=null!=s&&s.length?Object.freeze(Array.from(new Set(s))):h,(e=>{if(!e.extensions.length)return;let t={};for(let i of e.extensions){let e=i,n=e.name;if(!a.includes(n))throw Error("Unknown calendar extension.");if(t[n]&&t[n]!==e)throw Error(`Conflicting calendar extension: ${n}.`);Object.assign(t,{[n]:e})}d.set(e,t)})(this),i&<(this,i)}queryAndMemoize(t){let i=document.querySelector(t);if(!i)throw Error((e=>`${e} is not found, check the first argument passed to new Calendar. If the element lives inside a Shadow DOM, a string selector can't reach it - resolve the element yourself (e.g. shadowRoot.querySelector(...)) and pass it directly instead.`)(t));return e.memoizedElements.set(t,i),i}};Pe(li,"memoizedElements",new Map);var ri=[Rt,ei,pt,oi,vt];e.Calendar=class extends li{constructor(e,t){super(e,Ne({extensions:ri},t))}},e.annotations=pt,e.months=vt,e.motion=Rt,e.time=ei,e.weeks=oi}(t)},3465(e,t){
|
|
213
|
+
/*! name: vanilla-calendar-pro v3.4.0 | url: https://github.com/uvarov-frontend/vanilla-calendar-pro */
|
|
214
|
+
!function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var t=e=>new Date(`${e}T00:00:00`),i=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`;e.getDate=e=>t(e),e.getDateString=e=>i(e),e.getWeekNumber=(e,i)=>((e,i)=>{let n=t(e),s=(n.getDay()-i+7)%7;n.setDate(n.getDate()+3-s);let o=new Date(n.getFullYear(),0,1),l=Math.ceil(((+n-o)/864e5+1)/7);return{year:n.getFullYear(),week:l}})(e,i),e.parseDates=e=>(e=>e.reduce((e,n)=>{if(n instanceof Date||"number"==typeof n){let t=n instanceof Date?n:new Date(n);e.push(i(t))}else n.match(/^(\d{4}-\d{2}-\d{2})$/g)?e.push(n):n.replace(/(\d{4}-\d{2}-\d{2}).*?(\d{4}-\d{2}-\d{2})/g,(n,s,o)=>{let l=t(s),r=t(o).setHours(23,59,59,999);for(let t=l.getTime();t<=r;t=l.setDate(l.getDate()+1))e.push(i(l));return n});return e},[]))(e)}(t)}},t={};function i(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,i),o.exports}return i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(3158)})());
|