!function(){"use strict";!function(){const t={NODE_ENV:"production"};try{if(process)return process.env=Object.assign({},process.env),void Object.assign(process.env,t)}catch(t){}globalThis.process={env:t}}();var t,e,n,i,r,o,s,u,c,l,a,d,h,f,m,v,b,p,g,y,I,S,O,x,L,w,E,B,T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function j(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function C(){if(e)return t;return e=1,t=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}}function M(){if(o)return r;o=1;var t=function(){if(i)return n;i=1;var t="object"==typeof T&&T&&T.Object===Object&&T;return n=t}(),e="object"==typeof self&&self&&self.Object===Object&&self,s=t||e||Function("return this")();return r=s}function z(){if(d)return a;d=1;var t=function(){if(l)return c;l=1;var t=/\s/;return c=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}}(),e=/^\s+/;return a=function(n){return n?n.slice(0,t(n)+1).replace(e,""):n}}function A(){if(f)return h;f=1;var t=M().Symbol;return h=t}function N(){if(y)return g;y=1;var t=A(),e=function(){if(v)return m;v=1;var t=A(),e=Object.prototype,n=e.hasOwnProperty,i=e.toString,r=t?t.toStringTag:void 0;return m=function(t){var e=n.call(t,r),o=t[r];try{t[r]=void 0;var s=!0}catch(t){}var u=i.call(t);return s&&(e?t[r]=o:delete t[r]),u}}(),n=function(){if(p)return b;p=1;var t=Object.prototype.toString;return b=function(e){return t.call(e)}}(),i=t?t.toStringTag:void 0;return g=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":i&&i in Object(t)?e(t):n(t)}}function D(){if(x)return O;x=1;var t=N(),e=S?I:(S=1,I=function(t){return null!=t&&"object"==typeof t});return O=function(n){return"symbol"==typeof n||e(n)&&"[object Symbol]"==t(n)}}var W=function(){if(B)return E;B=1;var t=C(),e=function(){if(u)return s;u=1;var t=M();return s=function(){return t.Date.now()}}(),n=function(){if(w)return L;w=1;var t=z(),e=C(),n=D(),i=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;return L=function(u){if("number"==typeof u)return u;if(n(u))return NaN;if(e(u)){var c="function"==typeof u.valueOf?u.valueOf():u;u=e(c)?c+"":c}if("string"!=typeof u)return 0===u?u:+u;u=t(u);var l=r.test(u);return l||o.test(u)?s(u.slice(2),l?2:8):i.test(u)?NaN:+u}}(),i=Math.max,r=Math.min;return E=function(o,s,u){var c,l,a,d,h,f,m=0,v=!1,b=!1,p=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function g(t){var e=c,n=l;return c=l=void 0,m=t,d=o.apply(n,e)}function y(t){var e=t-f;return void 0===f||e>=s||e<0||b&&t-m>=a}function I(){var t=e();if(y(t))return S(t);h=setTimeout(I,function(t){var e=s-(t-f);return b?r(e,a-(t-m)):e}(t))}function S(t){return h=void 0,p&&c?g(t):(c=l=void 0,d)}function O(){var t=e(),n=y(t);if(c=arguments,l=this,f=t,n){if(void 0===h)return function(t){return m=t,h=setTimeout(I,s),v?g(t):d}(f);if(b)return clearTimeout(h),h=setTimeout(I,s),g(f)}return void 0===h&&(h=setTimeout(I,s)),d}return s=n(s)||0,t(u)&&(v=!!u.leading,a=(b="maxWait"in u)?i(n(u.maxWait)||0,s):a,p="trailing"in u?!!u.trailing:p),O.cancel=function(){void 0!==h&&clearTimeout(h),m=0,c=f=l=h=void 0},O.flush=function(){return void 0===h?d:S(e())},O},E}(),q=j(W);function $(t){t&&new _(t)}const R="stretchItems";class k{constructor(t,e,n){this.scroller=t,this.itemElement=e,this.index=n}}class _{constructor(t){var e;this.scrollerContainer=t,this.itemsContainer=t.querySelector(".horizontal-scroller-items"),this.items=Array.from(this.itemsContainer.querySelectorAll(":scope > section")).map((t,e)=>new k(this,t,e)),this.activeItem=this.items[0],this.leftButton=t.querySelector(":scope > .horizontal-scroller-controls > button.horizontal-scroller-left"),this.rightButton=t.querySelector(":scope > .horizontal-scroller-controls > button.horizontal-scroller-right"),this.numberButtonsContainer=t.querySelector(":scope > .horizontal-scroller-number-buttons"),
this.itemsOnScreen=null!==(e=parseInt(t.dataset.itemsOnScreen))&&void 0!==e?e:1,this.shouldStretchItems="true"===t.dataset[R],this.items.length<2?this.activateOneItemMode():(this.initNumberButtons(),this.toggleStretchingItems(),this.leftButton.addEventListener("click",()=>{this.scrollLeft()}),this.rightButton.addEventListener("click",()=>{this.scrollRight()}),window.addEventListener("resize",q(()=>{this.handleWindowResizeEvent()},300)),this.scrollToIndex(0))}initNumberButtons(){if(this.numberButtonsContainer){this.numberButtonsContainer.innerHTML="",this.numberButtons=[];const t=this.items.length-this.itemsOnScreen;for(let e=0;e<this.items.length;e++){const n=this.createNumberButton(e,t);this.numberButtons.push(n),this.numberButtonsContainer.appendChild(n)}}}createNumberButton(t,e){const n=document.createElement("button");return n.classList.add("horizontal-scroller-number-button"),n.setAttribute("aria-controls",this.scrollerContainer.id),n.setAttribute("data-item-index",t.toString()),t>e&&n.classList.add("mobile-number-button"),n.innerHTML=`\n      <span class="sr-only">Scroll to item ${t+1}</span>\n      <span aria-hidden="true">${t+1}</span>`.trim(),n.addEventListener("click",()=>{this.activeItem=this.items[t],this.scrollToIndex(t)}),n}toggleStretchingItems(){this.items.forEach(t=>{this.shouldStretchItems&&1==t.itemElement.children.length?t.itemElement.classList.add(R):t.itemElement.classList.remove(R)})}updateAriaStuff(){this.items.forEach((t,e)=>{t.index>=this.activeItem.index&&t.index<this.activeItem.index+this.getItemsOnScreen()?t.itemElement.removeAttribute("aria-hidden"):t.itemElement.setAttribute("aria-hidden","true")})}indexAfter(t){return t+1<=this.items.length-this.getItemsOnScreen()?t+1:0}indexBefore(t){return 0===t?this.items.length-this.getItemsOnScreen():t-1}scrollLeft(){this.activeItem=this.items[this.indexBefore(this.activeItem.index)],this.scrollToIndex(this.activeItem.index)}scrollRight(){this.activeItem=this.items[this.indexAfter(this.activeItem.index)],this.scrollToIndex(this.activeItem.index)}scrollToIndex(t){this.itemsContainer.style.left=`-${100/this.getItemsOnScreen()*t}%`,this.numberButtons.forEach(t=>{t.classList.remove("active")});const e=this.numberButtons[t];e&&e.classList.add("active"),this.updateAriaStuff()}getItemsOnScreen(){return this.isMobileDevice()?1:this.itemsOnScreen}isMobileDevice(){return window.innerWidth<=767}activateOneItemMode(){var t,e,n,i,r,o,s,u;null===(e=null===(t=this.numberButtonsContainer)||void 0===t?void 0:t.classList)||void 0===e||e.add("hidden"),null===(i=null===(n=this.leftButton)||void 0===n?void 0:n.classList)||void 0===i||i.add("one-item-mode"),null===(o=null===(r=this.rightButton)||void 0===r?void 0:r.classList)||void 0===o||o.add("one-item-mode"),this.itemsContainer.classList.add("one-item-mode"),null===(u=null===(s=this.itemsContainer.closest(".horizontal-scroller-items-wrapper"))||void 0===s?void 0:s.classList)||void 0===u||u.add("one-item-mode")}handleWindowResizeEvent(){this.isLastWindowMobile!=this.isMobileDevice()&&(this.activeItem=this.items[0],this.scrollToIndex(0)),this.isLastWindowMobile=this.isMobileDevice()}}function H(){document.querySelectorAll(".horizontal-scroller").forEach($)}"complete"===document.readyState||"interactive"===document.readyState?H():window.addEventListener("DOMContentLoaded",H)}();//# sourceMappingURL=horizontal-scroller.js.map
