1var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:true,configurable:true,writable:true,value:value}):obj[key]=value;var __publicField=(obj,key,value)=>{__defNormalProp(obj,typeof key!=="symbol"?key+"":key,value);return value};var t$1=/^(?:\{[\w\W]*\}|\[[{"][\w\W]*[}"]])$/;function e(e2){return"true"===e2||"false"!==e2&&("null"===e2?null:e2===+e2+""?+e2:t$1.test(e2)?JSON.parse(e2):e2)}function n(t2){return t2.charAt(1).toUpperCase()}function r(t2){if(t2.dataset)return s2=t2.dataset,c2={},Object.keys(s2).forEach(function(t3){c2[t3]=e(s2[t3])}),c2;for(var r2={},o2=t2.attributes,a2=0;a2<o2.length;a2++){var i2=o2[a2];if(i2&&i2.name&&/^data-\w[\w-]*$/.test(i2.name)){var u2=i2.value;r2[i2.name.substr(5).replace(/-./g,n)]=e(u2)}}return r2;var s2,c2}var o=function(t2){var e2=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t3){setTimeout(t3,1e3/60)};return(e2=e2.bind(window))(t2)},a=function(t2){return new Promise(function(e2){o(function(){e2(t2())})})},i$1=new WeakMap,u={},s=0;function c(t2,e2){var n2;if(u[e2]){var o2=t2.getAttribute("data-ref")||"widget-"+s;t2.setAttribute("data-ref",o2),n2={instance:new u[e2](t2,r(t2),o2),ref:o2},i$1.set(t2,n2),s++}return n2&&n2.instance}function f(t2,e2){return a(c.bind(window,t2,e2))}function d(t2){for(var e2 in t2)t2.hasOwnProperty(e2)&&(u[e2]=t2[e2])}function l(t2,e2){for(var n2=[],r2=t2.querySelectorAll("[data-ref]"),o2=0;o2<r2.length;o2++){var a2=i$1.get(r2[o2]);(!e2||a2&&a2.instance instanceof("function"==typeof e2?e2:u[e2]))&&a2&&n2.push(a2.instance)}return n2}function v(t2){var e2=i$1.get(w(t2));return e2&&e2.instance}function w(t2){return"string"==typeof t2?document.querySelector("[data-ref="+t2+"]"):t2}function y(t2,e2){void 0===e2&&(e2=true);var n2=w(t2),r2=i$1.get(n2);r2&&("function"==typeof r2.instance.beforeRemove&&r2.instance.beforeRemove(),i$1.delete(n2),e2&&g(n2))}function g(t2,e2){l(t2,e2).forEach(function(t3){y(t3.el)})}var p={registry:i$1,lib:u,get currentIndex(){return s},addInstanceSync:c,addInstance:f,add:d,descendants:l,get:v,destroy:y,destroyDescendants:g},m=function(t2){return t2.getAttribute("data-widget")};function h(t2,e2,n2){t2=t2||document,n2="function"==typeof n2?n2:m;for(var r2=[],a2=t2.querySelectorAll(e2=e2||"[data-widget]"),i2=Array.from(a2).sort(function(t3,n3){var r3=t3.querySelectorAll(e2).length,o2=n3.querySelectorAll(e2).length;return r3>o2?1:r3<o2?-1:0}),u2=0;u2<i2.length;u2++){var s2=b(i2[u2],n2);r2.push(s2)}return Promise.all(r2).then(function(t3){return t3.forEach(function(t4){t4&&"function"==typeof t4.onWidgetsReady&&o(t4.onWidgetsReady.bind(t4))}),t3})}function b(t2,e2){return f(t2,e2(t2))}var A={parse:h};var q=function(t2,e2,n2){this.el=t2,this.ref=n2;var o2=n2?{}:r(this.el);this.options=function(){for(var t3=arguments,e3={},n3=0;n3<arguments.length;n3++){var r2=t3[n3];null!=r2&&Object.keys(r2).forEach(function(t4){e3[t4]=r2[t4]})}return e3}(this.getOptions(),e2,o2)};q.prototype.getOptions=function(){return{}},q.prototype.onWidgetsReady=function(){return false},q.prototype.beforeRemove=function(){return false};class Accordion extends q{constructor(el){super(el);this.el=el;this.parent=null;this.grandparent=null;this.greatGrandParent=null;this.content=null;this.collapsing=null;this.siblings=null;if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){this.el.dataset.initialized="true";this.parent=this.el.parentElement;this.grandparent=this.parent.parentElement;this.greatGrandParent=this.grandparent.parentElement.parentElement;this.content=this.parent.querySelector("[data-content]");this.collapsing=this.el.hasAttribute("collapsing");this.siblings=this.grandparent.querySelectorAll("[accordion]");this.closeAccordion=this.closeAccordion.bind(this);this.openAccordion=this.openAccordion.bind(this);this.collapseSiblings=this.collapseSiblings.bind(this);this.handleKeyPress=this.handleKeyPress.bind(this);this.updateLinkTabIndex=this.updateLinkTabIndex.bind(this);this.hasChildAccordion=this.hasChildAccordion.bind(this);this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.el.addEventListener("click",this.collapseSiblings);this.el.addEventListener("keydown",this.handleKeyPress);this.checkIfOpen()}isClickOnIcon(event){const target=event.target;const hasIconOnly=target.hasAttribute("data-only-icon")||Array.from(target.children).some(child=>child.hasAttribute("data-only-icon"));if(!hasIconOnly)return false;if(target.tagName.toLowerCase()==="span"||target.tagName.toLowerCase()==="button"){const rect=target.getBoundingClientRect();const offsetX=event.clientX-rect.left;const clickableArea=rect.width*.25;return offsetX<clickableArea}return false}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized="false";this.beforeRemove();this.init()}}checkIfOpen(){if(this.parent.classList.contains("open")){this.el.classList.add("arrow-up");this.content.style.maxHeight=`${this.content.scrollHeight}px`;this.el.setAttribute("aria-expanded","true");this.updateLinkTabIndex("0")}
1else{this.el.setAttribute("aria-expanded","false");this.updateLinkTabIndex("-1")}}collapseSiblings(){if(this.collapsing){this.siblings.forEach(sibling=>{if(sibling.querySelector("button")!==this.el){sibling.classList.remove("open");sibling.querySelector("button").classList.remove("arrow-up");const siblingContent=sibling.querySelector("[data-content]");siblingContent.style.maxHeight="";this.updateLinkTabIndex("-1",sibling)}})}this.toggleAccordion()}toggleAccordion(){const classes=this.parent.classList;if(classes.contains("open")){this.closeAccordion()}else{this.openAccordion()}this.hasChildAccordion()}openAccordion(){this.content.style.maxHeight=`${this.content.scrollHeight}px`;this.parent.classList.add("open");this.el.classList.add("arrow-up");this.el.setAttribute("aria-expanded","true");this.updateLinkTabIndex("0");if(this.parent.hasAttribute("accordion")){const parentContent=this.parent.querySelector("[data-content]");const parentCurrentMaxHeight=parseFloat(parentContent.style.maxHeight)||0;parentContent.style.maxHeight=`${parentCurrentMaxHeight+this.content.scrollHeight}px`}}closeAccordion(){this.content.style.maxHeight="0";this.content.classList.remove("p-5");this.parent.classList.remove("open");this.el.classList.remove("arrow-up");this.el.setAttribute("aria-expanded","false");this.updateLinkTabIndex("-1");if(this.parent.hasAttribute("accordion")){const parentContent=this.parent.querySelector("[data-content]");const parentCurrentMaxHeight=parseFloat(parentContent.style.maxHeight)||0;parentContent.style.maxHeight=`${parentCurrentMaxHeight-this.content.scrollHeight}px`}}updateLinkTabIndex(tabIndex){var _a;const elems=(_a=this==null?void 0:this.content)==null?void 0:_a.querySelectorAll("a, button");elems==null?void 0:elems.forEach(elem=>{elem.setAttribute("tabindex",tabIndex)})}handleKeyPress(e2){if(e2.key==="Enter"||e2.key===" "){e2.preventDefault();this.collapseSiblings()}if(e2.key==="Tab"&&!e2.shiftKey){if(this.parent.classList.contains("open")){e2.preventDefault();this.content.setAttribute("tabindex","0");this.content.focus()}else{this.content.removeAttribute("tabindex");this.closeAccordion()}}}hasChildAccordion(){if(this.greatGrandParent&&this.greatGrandParent.style.maxHeight!=="100vh"&&this.greatGrandParent.getAttribute("data-content")){const parentHeight=parseFloat(this.greatGrandParent.style.maxHeight);const childHeight=parseFloat(this.content.style.maxHeight);this.greatGrandParent.style.maxHeight=`${parentHeight+childHeight}px`}}beforeRemove(){this.el.removeEventListener("click",this.collapseSiblings);this.el.removeEventListener("keydown",this.handleKeyPress)}}var t=function(){return t=Object.assign||function(t2){for(var i2,n2=1,s2=arguments.length;n2<s2;n2++)for(var a2 in i2=arguments[n2])Object.prototype.hasOwnProperty.call(i2,a2)&&(t2[a2]=i2[a2]);return t2},t.apply(this,arguments)},i=function(){function i2(i3,n2,s2){var a2=this;this.endVal=n2,this.options=s2,this.version="2.8.0",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:true,useGrouping:true,useIndianSeparators:false,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:"",enableScrollSpy:false,scrollSpyDelay:200,scrollSpyOnce:false},this.finalEndVal=null,this.useEasing=true,this.countDown=false,this.error="",this.startVal=0,this.paused=true,this.once=false,this.count=function(t2){a2.startTime||(a2.startTime=t2);var i4=t2-a2.startTime;a2.remaining=a2.duration-i4,a2.useEasing?a2.countDown?a2.frameVal=a2.startVal-a2.easingFn(i4,0,a2.startVal-a2.endVal,a2.duration):a2.frameVal=a2.easingFn(i4,a2.startVal,a2.endVal-a2.startVal,a2.duration):a2.frameVal=a2.startVal+(a2.endVal-a2.startVal)*(i4/a2.duration);var n3=a2.countDown?a2.frameVal<a2.endVal:a2.frameVal>a2.endVal;a2.frameVal=n3?a2.endVal:a2.frameVal,a2.frameVal=Number(a2.frameVal.toFixed(a2.options.decimalPlaces)),a2.printValue(a2.frameVal),i4<a2.duration?a2.rAF=requestAnimationFrame(a2.count):null!==a2.finalEndVal?a2.update(a2.finalEndVal):a2.options.onCompleteCallback&&a2.options.onCompleteCallback()},this.formatNumber=function(t2){var i4,n3,s3,e2,o2=t2<0?"-":"";i4=Math.abs(t2).toFixed(a2.options.decimalPlaces);var r2=(i4+="").split(".");if(n3=r2[0],s3=r2.length>1?a2.options.decimal+r2[1]:"",a2.options.useGrouping){e2="";for(var l2=3,h2=0,u2=0,p2=n3.length;u2<p2;++u2)a2.options.useIndianSeparators&&4===u2&&(l2=2,h2=1),0!==u2&&h2%l2==0&&(e2=a2.options.separator+e2),h2++,e2=n3[p2-u2-1]+e2;n3=e2}return a2.options.numerals&&a2.options.numerals.length&&(n3=n3.replace(/[0-9]/g,function(t3){return a2.options.numerals[+t3]}),s3=s3.replace(/[0-9]/g,function(t3){return a2.options.numerals[+t3]})),o2+a2.options.prefix+n3+s3+a2.options.suffix},this.easeOutExpo=function(t2,i4,n3,s3){return n3*(1-Math.pow(2,-10*t2/s3))*1024/1023+i4},this.options=t(t({},this.defaults),s2),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(n2),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,""===this.options.separator&&(this.options.useGrouping=false),this.el="string"==typeof i3?document.getElementById(i3):i3,this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined","undefined"!=typeof window&&this.options.enableScrollSpy&&(this.error?console.error(this.error,i3):(window.onScrollFns=window.onScrollFns||[],window.onScrollFns.push(function(){return a2.handleScroll(a2)}),window.onscroll=function(){window.onScrollFns.forEach(function(t2){return t2()})},this.handleScroll(this)))}return i2.prototype.handleScroll=function(t2){if(t2&&window&&!t2.once){var i3=window.innerHeight+window.scrollY,n2=t2.el.getBoundingClientRect(),s2=n2.top+window.pageYOffset,a2=n2.top+n2.height+window.pageYOffset;a2<i3&&a2>window.scrollY&&t2.paused?(t2.paused=false,setTimeout(function(){return t2.start()},t2.options.scrollSpyDelay),t2.options.scrollSpyOnce&&(t2.once=true)):(window.scrollY>a2||s2>i3)&&!t2.paused&&t2.reset()}},i2.prototype.determineDirectionAndSmartEasing=function(){var t2=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>t2;var i3=t2-this.startVal;if(Math.abs(i3)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=t2;var n2=this.countDown?1:-1;
1this.endVal=t2+n2*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=t2,this.finalEndVal=null;null!==this.finalEndVal?this.useEasing=false:this.useEasing=this.options.useEasing},i2.prototype.start=function(t2){this.error||(this.options.onStartCallback&&this.options.onStartCallback(),t2&&(this.options.onCompleteCallback=t2),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=false,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},i2.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},i2.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=true,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},i2.prototype.update=function(t2){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(t2),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,null==this.finalEndVal&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},i2.prototype.printValue=function(t2){var i3;if(this.el){var n2=this.formattingFn(t2);if(null===(i3=this.options.plugin)||void 0===i3?void 0:i3.render)this.options.plugin.render(this.el,n2);else if("INPUT"===this.el.tagName)this.el.value=n2;else"text"===this.el.tagName||"tspan"===this.el.tagName?this.el.textContent=n2:this.el.innerHTML=n2}},i2.prototype.ensureNumber=function(t2){return"number"==typeof t2&&!isNaN(t2)},i2.prototype.validateValue=function(t2){var i3=Number(t2);return this.ensureNumber(i3)?i3:(this.error="[CountUp] invalid start or end value: ".concat(t2),null)},i2.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},i2}();class AnimateCount extends q{constructor(el){super(el);this.el=el;this.countup=null;this.observer=null;const dataValueElement=this.el.parentElement.querySelector("[data-value]");if(dataValueElement){this.endValue=dataValueElement.getAttribute("data-value")}else{return}if(!el.dataset.initialized){this.initializeCountUp();this.addIntersectionObserver();el.dataset.initialized=true}this.el.widgetInstance=this}initializeCountUp(){this.countup=new i(this.el,this.endValue,{enableScrollSpy:true,useEasing:true,useGrouping:true,separator:","});this.resetAndReinitialize=this.resetAndReinitialize.bind(this)}addIntersectionObserver(){const options={root:null,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{if(entry.isIntersecting){this.startCountUpAnimation();this.observer.unobserve(entry.target)}})},options);this.observer.observe(this.el)}startCountUpAnimation(){if(!this.countup.error){this.countup.start()}else{console.error(this.countup.error)}}beforeRemove(){this.observer.disconnect()}resetAndReinitialize(){if(this.el.widgetInstance){this.dataset.initialized=false;this.beforeRemove();this.initializeCountUp()}}}class CustomScroll extends q{constructor(el){super(el);this.el=el;this.container=null;this.scrollBar=null;this.scrollBarIndicator=null;this.scrollThumb=null;this.inputSlider=null;this.scrollThumbWidth=null;this.maxScroll=null;this.scroll=null;this.handleDrag=null;this.setScrollBarBackground=null;this.setScrollThumbPosition=null;this.scrollLeft=null;this.scrollRight=null;this.leftArrow=null;this.rightArrow=null;this.images=null;this.isScrolling=false;this.handleMouseDown=null;this.handleMouseMove=null;this.handleMouseUp=null;this.imageWidth=null;this.currentIndex=0;this.isDragging=false;if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){this.el.dataset.initialized="true";this.container=this.el.querySelector("[data-scroll-container]");this.scrollBar=this.el.querySelector("[data-scroll-bar]");this.scrollBarIndicator=this.el.parentElement.querySelector("[data-scroll-bar-indicator]");this.scrollThumb=this.el.parentElement.querySelector("[data-scroll-thumb]");this.inputSlider=this.el.parentElement.querySelector("[data-input-slider]");this.scrollThumbWidth=this.scrollThumb.clientWidth;this.maxScroll=this.container.scrollWidth-this.container.clientWidth;this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.scroll=this.scroll.bind(this);this.handleDrag=this.handleDrag.bind(this);
1this.setScrollBarBackground=this.setScrollBarBackground.bind(this);this.setScrollThumbPosition=this.setScrollThumbPosition.bind(this);this.container.addEventListener("scroll",this.scroll);this.inputSlider.addEventListener("input",this.handleDrag);this.scrollLeft=this.scrollLeft.bind(this);this.scrollRight=this.scrollRight.bind(this);this.leftArrow=this.el.parentElement.querySelector("[data-scroll-left]");this.rightArrow=this.el.parentElement.querySelector("[data-scroll-right]");this.images=Array.from(this.container.querySelectorAll("[data-image]"));this.isScrolling=false;this.handleMouseDown=this.handleMouseDown.bind(this);this.handleMouseMove=this.handleMouseMove.bind(this);this.handleMouseUp=this.handleMouseUp.bind(this);this.container.addEventListener("mousedown",this.handleMouseDown);this.imageWidth=this.images[0].clientWidth;this.currentIndex=0;if(this.leftArrow&&this.rightArrow){this.leftArrow.addEventListener("click",this.scrollLeft);this.rightArrow.addEventListener("click",this.scrollRight)}this.isDragging=false;this.el.addEventListener("mousedown",()=>{this.isDragging=true});document.addEventListener("mouseup",this.handleDragEnd);document.addEventListener("touchend",this.handleDragEnd)}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}smoothUpdateSlider(value,duration=200){const start=Date.now();const from=this.inputSlider.value;const to=value;if(from===to)return;const update=()=>{const currentTime=Date.now();const time=Math.min(1,(currentTime-start)/duration);this.inputSlider.value=(to-from)*time+Number(from);const scrollPercent=this.inputSlider.value/100;this.setScrollThumbPosition(scrollPercent);this.setScrollBarBackground(scrollPercent*100);if(time<1)requestAnimationFrame(update)};requestAnimationFrame(update)}scrollLeft(){if(this.isScrolling)return;let newScrollPos=this.container.scrollLeft-this.container.clientWidth/3;if(newScrollPos<0)newScrollPos=0;newScrollPos=newScrollPos/this.maxScroll;this.scrollToPosition(newScrollPos);this.smoothUpdateSlider(newScrollPos*100)}scrollRight(){if(this.isScrolling)return;let newScrollPos=this.container.scrollLeft+this.container.clientWidth/3;if(newScrollPos>this.maxScroll)newScrollPos=this.maxScroll;newScrollPos=newScrollPos/this.maxScroll;this.scrollToPosition(newScrollPos);this.smoothUpdateSlider(newScrollPos*100)}scrollToPosition(percent){this.isScrolling=true;const scrollPosition=this.maxScroll*percent;this.container.scrollTo({left:scrollPosition,behavior:"smooth"});setTimeout(()=>{this.isScrolling=false},500)}handleMouseDown(e2){this.startX=e2.pageX;this.startScroll=this.container.scrollLeft;this.container.addEventListener("mousemove",this.handleMouseMove);document.addEventListener("mouseup",this.handleMouseUp)}handleMouseMove(e2){if(!this.isDragging)return;const totalScrollableWidth=this.container.scrollWidth-this.container.clientWidth;const dx=e2.movementX;this.container.scrollLeft-=dx;const scrollPercent=this.container.scrollLeft/totalScrollableWidth;this.inputSlider.value=scrollPercent*100;this.setScrollThumbPosition(scrollPercent);this.setScrollBarBackground(scrollPercent*100)}handleMouseUp(){this.container.removeEventListener("mousemove",this.handleMouseMove);document.removeEventListener("mouseup",this.handleMouseUp)}handleDrag(){const scrollPercent=this.inputSlider.value/100;this.container.scrollLeft=this.maxScroll*scrollPercent;this.setScrollThumbPosition(scrollPercent);this.setScrollBarBackground(scrollPercent*100)}handleDragEnd(){var _a,_b,_c,_d,_e;if(!this.isDragging){return}this.isDragging=false;const currentScrollPos=((_a=this.container)==null?void 0:_a.scrollLeft)+((_b=this.container)==null?void 0:_b.clientWidth)/2;this.currentIndex=Math.round(currentScrollPos/this.imageWidth);if(this.currentIndex<0)this.currentIndex=0;else if(this.currentIndex>=((_c=this.images)==null?void 0:_c.length))this.currentIndex=((_d=this.images)==null?void 0:_d.length)-1;this.scrollToPosition(this.currentIndex);this.inputSlider.value=this.currentIndex/((_e=this.images)==null?void 0:_e.length)*100}scroll(){if(!this.isScrolling){const scrollPercent=this.container.scrollLeft/this.maxScroll;this.inputSlider.value=scrollPercent*100;this.setScrollThumbPosition(scrollPercent);
1this.setScrollBarBackground(scrollPercent*100);const currentScrollPos=this.container.scrollLeft+this.container.clientWidth/2;this.currentIndex=Math.round(currentScrollPos/this.imageWidth);if(this.currentIndex<0)this.currentIndex=0;else if(this.currentIndex>=this.images.length)this.currentIndex=this.images.length-1}}setScrollThumbPosition(percent){this.scrollThumb.style.left=`calc(${percent*100}% - ${this.scrollThumbWidth/2}px)`}setScrollBarBackground(percent){this.scrollBarIndicator.style.width=`${percent}%`}beforeRemove(){this.container.removeEventListener("scroll",this.scroll);this.inputSlider.removeEventListener("input",this.handleDrag);if(this.leftArrow&&this.rightArrow){this.leftArrow.removeEventListener("click",this.scrollLeft);this.rightArrow.removeEventListener("click",this.scrollRight)}this.container.removeEventListener("mousedown",this.handleMouseDown);this.container.removeEventListener("mousemove",this.handleMouseMove);document.removeEventListener("mouseup",this.handleDragEnd);document.removeEventListener("touchend",this.handleDragEnd);document.removeEventListener("mouseup",this.handleMouseUp)}}function waitForGoogleMaps(callback,retries=10,interval=500){if(window.google&&window.google.maps&&typeof window.google.maps.Map==="function"){console.info("Google Maps API loaded successfully.");callback()}else if(retries>0){setTimeout(()=>{console.info("Waiting for Google Maps API to load...");waitForGoogleMaps(callback,retries-1,interval)},interval)}else{console.error("Google Maps API failed to load.")}}class DestinationAfricaMap extends q{constructor(el){super(el);this.el=el;this.el.widgetInstance=this;if(!el.dataset.initialized){this.init()}}init(){this.el.dataset.initialized="true";this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.mapContainer=this.el.querySelector("[data-map-container]");this.sidebar=this.el.querySelector("[data-sidebar]");this.sidebarImgs=this.sidebar.querySelector("[data-img-container]");this.sidebarTitle=this.sidebar.querySelector("[data-title]");this.sidebarReasonsTitle=this.sidebar.querySelector("[data-reasons-title]");this.sidebarReasons=this.sidebar.querySelector("[data-reasons]");this.sidebarDescription=this.sidebar.querySelector("[data-description]");this.sidebarToursLink=this.sidebar.querySelector("[data-tours-link]");this.sidebarAccomLink=this.sidebar.querySelector("[data-accom-link]");this.sidebarReadMoreLink=this.sidebar.querySelector("[data-read-more]");this.list=this.el.querySelector("[data-list]");this.mapData=null;this.mapOptions=null;this.paths={};this.mapMarkers=null;this.googleMapMarkers=[];this.center={lat:-17.78,lng:20.5085};this.zoomlevel=4;this.markerIcon="https://www.go2africa.com/wp-content/themes/g2a/assets/icons/marker-pin.svg";this.markerIconSelected="https://www.go2africa.com/wp-content/themes/g2a/assets/icons/marker-pin-active.svg";this.sidebarIsOpen=false;this.loadData().then(()=>{waitForGoogleMaps(()=>this.setup())}).catch(error=>console.error("Failed to load map data ",error))}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}async loadData(){try{const origin=window.location.origin;const response=await fetch(`${origin}/wp-content/themes/g2a/assets/js/map-options.json`);if(!response.ok){throw new Error(`HTTP error! Status: ${response.status}`)}const options=await response.json();this.mapData=window.mapData||[];this.mapOptions=options}catch(error){console.error("Error fetching map options:",error);this.mapData=[];this.mapOptions={}}}setup(){this.initMap();this.mapMarkers=this.processedMarkers();this.populateList();this.drawMarkers();const accordionButtons=document.querySelectorAll('div.accordion button[data-widget="Accordion"]');accordionButtons==null?void 0:accordionButtons.forEach(button=>{button.addEventListener("click",e2=>{var _a,_b;const listItemText=button.querySelector("[data-list-item]").textContent;const isCurrentlyActive=((_a=this.currentDestination)==null?void 0:_a.title)===listItemText;(_b=this.mapData)==null?void 0:_b.forEach(async data=>{if(data.title===listItemText){this.setCurrentDestination(data);if(!isCurrentlyActive){this.toggleActiveDestination(data.title,data.title);this.openSideDrawer()}else{await this.closeSideDrawer();this.setCurrentDestination(null)}}});this.updateSidebar()})})}drawMarkers(){this.filteredMapMarkers();this.googleMapMarkers=[];
1this.mapMarkers.forEach(marker=>{const position=new google.maps.LatLng(marker.latitude,marker.longitude);const mapMarker=new google.maps.Marker({position:position,clickable:true,icon:this.setMapMarkerIcon(marker.id),zIndex:this.setMapMarkerZIndex(marker.id),map:this.map});this.googleMapMarkers.push(mapMarker);this.addListEventListener(marker,mapMarker);google.maps.event.addListener(mapMarker,"click",()=>this.markerClick(marker,mapMarker));google.maps.event.addListener(mapMarker,"mouseover",()=>this.markerMouseOver(marker,mapMarker));google.maps.event.addListener(mapMarker,"mouseout",()=>this.markerMouseOut(mapMarker))})}processedMarkers(){var _a;this.mapMarkers=[];if(!this.mapData){console.error("Map data is empty")}(_a=this.mapData)==null?void 0:_a.forEach(destination=>this.mapMarkers.push(...destination.markers));return this.mapMarkers}setMapMarkerIcon(id){return this.activeDestination===id?this.markerIconSelected:this.markerIcon}setMapMarkerZIndex(id){return this.activeDestination===id?100:1}markerClick(marker,mapMarker){if(this.lastClickedMarker)this.lastClickedMarker.setIcon(this.markerIcon);this.toggleActiveDestination(marker.id,marker.parent);if(this.currentDestination&&this.currentDestination.id===marker.id){this.toggleSideDrawer()}else{this.openSideDrawer()}this.setCurrentDestination(marker);mapMarker.setIcon(this.setMapMarkerIcon(marker.id));this.lastClickedMarker=mapMarker;this.updateSidebar();this.toggleAccordion()}markerMouseOver(marker,mapMarker){if(this.lastHoveredMarker)this.lastHoveredMarker.setIcon(this.markerIcon);mapMarker.setIcon(this.markerIconSelected);this.toggleActiveDestination(marker.id,marker.parent);this.lastHoveredMarker=mapMarker}markerMouseOut(mapMarker){if(this.sidebarIsOpen)return;mapMarker.setIcon(this.markerIcon)}setCurrentDestination(marker){this.currentDestination=marker?{id:marker.id,title:marker.title,country:marker.country,images:marker.images,description:marker.description,reasons:marker.reasons,whyLink:`/destinations/${marker.slug}/why-go`,toursLink:`/destinations/${marker.slug}/tours-safaris`,accomLink:`/destinations/${marker.slug}/accommodation`,hasTours:marker.hasTours,hasAccomms:marker.hasAccomms}:{}}toggleActiveDestination(destination,country){var _a;this.activeDestination=destination;this.activeCountry=country;if(destination&&this.list){(_a=this.list.querySelectorAll(".active"))==null?void 0:_a.forEach(item=>item.classList.remove("active"));const activeDestination=this.list.querySelector(`[data-list-item="${destination}"]`);const activeCountry=this.list.querySelector(`[data-list-item="${country}"]`);activeDestination==null?void 0:activeDestination.classList.add("active");activeCountry==null?void 0:activeCountry.classList.add("active")}}openSideDrawer(){this.sidebar.classList.add("open");this.sidebarIsOpen=true}closeSideDrawer(){this.sidebar.classList.remove("open");this.sidebarIsOpen=false}toggleSideDrawer(){this.sidebar.classList.toggle("open");this.sidebarIsOpen=!this.sidebarIsOpen}filteredMapMarkers(){return this.mapMarkers.filter(marker=>marker.latitude&&marker.longitude)}initMap(){if(this.mapContainer.children.length===0){this.map=new google.maps.Map(this.mapContainer,{center:this.center,zoom:this.zoomlevel,...this.mapOptions});google.maps.event.addListener(this.map,"click",()=>this.closeSidebar())}}closeSidebar(){if(window.innerWidth<768&&this.sidebarIsOpen){this.closeSideDrawer()}}populateList(){var _a;if(!this.list){console.warn("DestinationAfricaMap: list element not found");return}this.list.innerHTML="";this.listItems=[];if(!Array.isArray(this.mapData)){console.warn("DestinationAfricaMap: mapData is not an array");return}(_a=this.mapData)==null?void 0:_a.forEach(item=>{if(!item)return;this.listItems.push(this.createListItem(item))});this.list.innerHTML=this.listItems.join("");if((p==null?void 0:p.destroyDescendants)&&typeof p.destroyDescendants==="function"){p.destroyDescendants(this.list)}if((A==null?void 0:A.parse)&&typeof A.parse==="function"){try{A.parse(this.list)}catch(e2){console.error("Parser failed in populateList:",e2)}}}createListItem(item){if(item.title===item.markers[0].title){return` 2 <button class="destination-map__list__item" data-list-item=${item.id} id="related-parent-${item.id}"> 3 ${item.title} 4 </button> 5 `}else{const markerButtons=item.markers.map(marker=>` 6 <li> 7 <button class="font--large" data-list-item=${marker.id} id="related-marker-${marker.id}">${marker.title}</button> 8 </li> 9 `).join("");return`<div class="accordion" accordion> 10 <button 11 data-widget="Accordion" 12 collapsing="true" 13 aria-controls="${item.title}-destination-accordion-content" 14 aria-expanded="false" 15 >
16 <span data-only-icon data-list-item=${item.title} id="related-parent-${item.id}">${item.title}</span> 17 </button> 18 <div class="accordion__content px-4" data-content id="${item.title}-destination-accordion-content"> 19 <ul class="list--unstyled"> 20 ${markerButtons} 21 </ul> 22 </div> 23 </div>`}}addListEventListener(marker,mapMarker){const item=this.list.querySelector(`[data-list-item="${marker.id}"]`);item.addEventListener("click",()=>this.markerClick(marker,mapMarker))}updateSidebar(){var _a,_b,_c;if(this.currentDestination){const splideInner=this.sidebarImgs.querySelector(".splide__list");const oldSlides=Array.from(splideInner.children);(_a=this.currentDestination.images)==null?void 0:_a.forEach((url,index)=>{const liElem=document.createElement("li");liElem.id=`splide-slide-${index}`;liElem.classList.add("splide__slide");const imgElem=document.createElement("img");imgElem.classList.add("destination-map__preview__img");imgElem.src=url;imgElem.alt="ALT DESC HERE";liElem.appendChild(imgElem);splideInner.appendChild(liElem)});this.sidebarTitle.innerText=this.currentDestination.title;if(((_c=(_b=this.currentDestination)==null?void 0:_b.reasons)==null?void 0:_c.length)>0){this.sidebarReasonsTitle.style.display="block";this.sidebarReasons.innerHTML=this.currentDestination.reasons.join(", ")}else{this.sidebarReasonsTitle.style.display="none";this.sidebarReasons.innerHTML=""}this.sidebarDescription.innerHTML=this.currentDestination.description;this.sidebarToursLink.href=this.currentDestination.toursLink;this.sidebarAccomLink.href=this.currentDestination.accomLink;this.sidebarReadMoreLink.href=this.currentDestination.whyLink;setTimeout(()=>
23{oldSlides.forEach(slide=>slide.remove());this.sidebar.querySelector('[data-widget="SplideWidget"]').widgetInstance.resetAndReinitialize()},20)}}toggleAccordion(){var _a;if(((_a=this.list.querySelector("span.active"))==null?void 0:_a.parentElement)&&this.content){const oldActiveItem=this.list.querySelector(".open");if(oldActiveItem){oldActiveItem.classList.remove("open");oldActiveItem.querySelector("[data-content]").style.maxHeight=""}const activeItem=this.list.querySelector("span.active");activeItem.parentElement.parentElement.classList.add("open");activeItem.parentElement.widgetInstance.openAccordion()}}beforeRemove(){this.list.querySelectorAll("[data-list-item]").forEach(item=>{item.removeEventListener("click",this.markerClick)})}}class DestinationsMap extends q{constructor(el){super(el);this.el=el;this.locations=null;this.canvas=null;this.ctx=null;this.map=new Image;this.map.src="";this.pin=new Image;this.pin.src="";this.mapWidth=0;this.mapHeight=0;this.pinWidth=0;this.pinHeight=0;if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){this.el.dataset.initialized="true";this.locations=this.el.querySelectorAll("[data-location]");this.canvas=this.el.querySelector("[data-map-canvas]");this.ctx=this.canvas.getContext("2d");this.map=new Image;this.map.src="https://www.go2africa.com/wp-content/themes/g2a/assets/images/africa-map-v2.svg";this.pin=new Image;this.pin.src="https://www.go2africa.com/wp-content/themes/g2a/assets/icons/marker-pin-solid.svg";this.mapWidth=484;this.mapHeight=444;this.pinWidth=28;this.pinHeight=38;this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.handleHover=this.handleHover.bind(this);this.drawMap=this.drawMap.bind(this);this.drawPin=this.drawPin.bind(this);this.locations.forEach(location=>{location.addEventListener("mouseover",this.handleHover);location.addEventListener("mouseout",this.drawMap);location.addEventListener("focus",this.handleHover);location.addEventListener("blur",this.drawMap)});Promise.all([this.loadImage(this.map),this.loadImage(this.pin)]).then(()=>this.drawMap()).catch(error=>console.error("Image loading error:",error))}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}loadImage(image){return new Promise((resolve,reject)=>{image.onload=()=>resolve();image.onerror=error=>reject(error)})}handleHover(e2){const mapX=e2.target.getAttribute("data-map-x");const mapY=e2.target.getAttribute("data-map-y");if(mapX&&mapY){this.drawPin(mapX,mapY)}}drawMap(){this.ctx.clearRect(0,0,this.mapWidth,this.mapHeight);this.ctx.drawImage(this.map,0,0,this.mapWidth,this.mapHeight)}drawPin(x,y2){this.ctx.drawImage(this.pin,x-this.pinWidth/2,y2-this.pinHeight,this.pinWidth,this.pinHeight)}beforeRemove(){this.locations.forEach(location=>{location.removeEventListener("mouseover",this.handleHover);location.removeEventListener("mouseout",this.drawMap);location.removeEventListener("focus",this.handleHover);location.removeEventListener("blur",this.drawMap)})}}class Dropdown extends q{constructor(el){super(el);this.el=el;this.btn=null;this.content=null;if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){this.el.dataset.initialized="true";this.btn=this.el.querySelector("[data-btn]");this.content=this.el.querySelector("[data-content]");this.open=this.open.bind(this);this.close=this.close.bind(this);this.toggle=this.toggle.bind(this);this.updateLinkTabIndex=this.updateLinkTabIndex.bind(this);this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.el.addEventListener("mouseenter",this.handleMouseEnter.bind(this));this.el.addEventListener("mouseleave",this.handleMouseLeave.bind(this));this.btn.addEventListener("click",this.toggle)}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}setup(){this.updateLinkTabIndex("-1")}handleMouseEnter(){clearTimeout(this.hoverIntent);this.hoverIntent=setTimeout(()=>{this.open()},300)}handleMouseLeave(){clearTimeout(this.hoverIntent);this.hoverIntent=setTimeout(()=>{this.close()},300)}open(){this.el.classList.add("open");if(this.content){this.content.style.maxHeight=`${this.content.scrollHeight}px`}this.el.setAttribute("aria-expanded","true");this.updateLinkTabIndex("0")}close(){var _a;this.el.classList.remove("open");if(this.content){this.content.style.maxHeight=""}(_a=this==null?void 0:this.el)==null?void 0:_a.setAttribute("aria-expanded","fal
23se");this.updateLinkTabIndex("-1")}toggle(){this.el.classList.contains("open")?this.close():this.open()}updateLinkTabIndex(tabIndex){var _a;const elems=(_a=this==null?void 0:this.content)==null?void 0:_a.querySelectorAll("a, button");elems==null?void 0:elems.forEach(elem=>{elem.setAttribute("tabindex",tabIndex)})}beforeRemove(){this.btn.removeEventListener("mouseenter",this.toggle);this.btn.removeEventListener("mouseleave",this.toggle);this.btn.removeEventListener("click",this.toggle)}}class DropdownButton extends q{constructor(el){super(el);this.el=el;this.parent=null;this.content=null;this.menu=null;this.body=null;this.viewportHeight=null;this.transitionDuration=null;if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){this.el.dataset.initialized="true";this.parent=this.el.parentElement;this.content=this.parent.querySelector("[data-content]");this.menu=this.parent.getAttribute("data-menu");this.body=document.querySelector("body");this.viewportHeight=window.innerHeight;this.transitionDuration=null;this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.updatePaginationCurrency=this.updatePaginationCurrency.bind(this);this.open=this.open.bind(this);this.close=this.close.bind(this);this.toggle=this.toggle.bind(this);this.updateLinkTabIndex=this.updateLinkTabIndex.bind(this);this.scrollbarWidth=this.scrollbarWidth.bind(this);this.changeActive=this.changeActive.bind(this);this.setTransitionDuration=this.setTransitionDuration.bind(this);this.changeCurrency.bind(this);this.handleScroll=this.handleScroll.bind(this);this.el.addEventListener("click",this.toggle);this.updateActiveLink=this.updateActiveLink.bind(this);window.addEventListener("scroll",this.handleScroll);this.setup();if(this.parent.getAttribute("data-open")){setTimeout(this.open,100)}}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}setup(){this.updateLinkTabIndex("-1");this.setTransitionDuration();const displayedCurrencyElement=this.el.querySelector('[data-currency-value="true"]');if(displayedCurrencyElement){const listItems=this.content.querySelectorAll("li");listItems.forEach((li,index)=>{li.addEventListener("click",e2=>{this.changeCurrency(e2)})})}else{const listItems=this.content.querySelectorAll("li");listItems.forEach((li,index)=>{li.addEventListener("click",e2=>{this.changeActive(e2)})})}}handleScroll(){var _a;const links=Array.from(((_a=this==null?void 0:this.content)==null?void 0:_a.querySelectorAll("a"))??[]);let activeLink=null;links.filter(link=>link.getAttribute("href")&&link.getAttribute("href").includes("#")).forEach(link=>{const sectionId=link.getAttribute("href").slice(1);const section=document.getElementById(sectionId);if(section){const rect=section.getBoundingClientRect();if(rect.top<=window.innerHeight/2&&rect.bottom>=0){activeLink=link}}});if(activeLink){this.updateActiveLink(activeLink)}}updateActiveLink(activeLink){var _a,_b;const element=(_b=(_a=this.el.parentElement)==null?void 0:_a.parentElement)==null?void 0:_b.querySelector("[data-first-item]");if(element){element.innerHTML=activeLink.innerHTML}}changeActive(e2){var _a,_b;const element=(_b=(_a=e2.currentTarget.parentElement)==null?void 0:_a.parentElement)==null?void 0:_b.querySelector("[data-first-item]");if(element){element.innerHTML=e2.currentTarget.innerHTML}}changeCurrency(e2){var _a,_b;const currencyElement=e2.currentTarget.querySelector("p.ms-auto");const clickedFlagStyle=(_b=(_a=e2.currentTarget.querySelector(".navigation__phone-icon"))==null?void 0:_a.style)==null?void 0:_b.backgroundImage;if(currencyElement){const displayedCurrencyElement=this.el.querySelector('[data-currency-value="true"]');const displayedCurrencyFlagElement=this.el.querySelector('[data-currency-flag="true"]');if(displayedCurrencyElement){displayedCurrencyElement.innerText=currencyElement.innerText;if(displayedCurrencyFlagElement){displayedCurrencyFlagElement.style.backgroundImage=clickedFlagStyle}this.updatePaginationCurrency(currencyElement.innerText.trim());const event=new CustomEvent("currencyChange",{detail:{currency:currencyElement.innerText.trim()}});this.el.parentElement.parentElement.dispatchEvent(event)}this.close()}this.close()}updatePaginationCurrency(currency){const paginationWidget=document.querySelector('[data-widget="Pagination"]');if(!paginationWidget){console.error("Pagination widget not found");return}Array.from(paginationWidget.querySelectorAll(".card--holiday .card__sm-text.text--primary-lion, .card--nearby-accommodation .card__sm-text.text--primary-lion")).forEac
23h(priceListItem=>{const priceInSelectedCurrency=priceListItem.getAttribute(`data-${currency.toLowerCase()}`);if(priceInSelectedCurrency){priceListItem.textContent=priceInSelectedCurrency;this.close()}else{console.warn(`Currency ${currency} not found for element`,priceListItem)}})}open(){const topDistance=this.content.getBoundingClientRect().top;this.parent.classList.add("open");if(this.menu){this.content.style.maxHeight="100vh"}else if(this.content.scrollHeight>this.viewportHeight-topDistance){this.content.style.maxHeight=`${this.viewportHeight-topDistance}px`}else{this.content.style.maxHeight=`${this.content.scrollHeight}px`}if(!this.menu){this.content.style.width=`calc(100vw - ${this.scrollbarWidth()}px)`}this.parent.setAttribute("aria-expanded","true");this.updateLinkTabIndex("0");this.content.style.overflowY="hidden";setTimeout(()=>{this.content.style.overflowY=""},this.transitionDuration)}close(){if(this.menu){if(this.parent){this.parent.classList.remove("open");this.parent.setAttribute("aria-expanded","false")}if(this.content){this.content.style.maxHeight=""}this.updateLinkTabIndex("-1")}}toggle(e2){if(e2.target.tagName!=="A"){this.parent.classList.contains("open")||this.parent.ariaExpanded==="true"?this.close():this.open()}}toggleDocument(e2){const target=e2.target;const isDropdownButton=target.closest('button[data-widget="DropdownButton"]');const isMapLink=target.closest('a[href="#Map"]');if(!isDropdownButton&&!isMapLink){this.close()}}updateLinkTabIndex(tabIndex){const elems=this.content.querySelectorAll("a, button");elems.forEach(elem=>{elem.setAttribute("tabindex",tabIndex)})}setTransitionDuration(){this.transitionDuration=parseFloat(window.getComputedStyle(this.content).getPropertyValue("transition-duration"))*1e3}scrollbarWidth(){return window.innerWidth-document.documentElement.clientWidth}beforeRemove(){this.el.removeEventListener("click",this.toggle);document.removeEventListener("click",this.toggleDocument);window.removeEventListener("scroll",this.handleScroll)}}class FormValidator extends q{constructor(el){super(el);this.el=el;this.inputs=null;this.language=null;this.errorMessages=null;if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){this.el.dataset.initialized="true";this.inputs=this.el.querySelectorAll("input");this.language=this.el.getAttribute("data-language")||"en";this.errorMessages=null;this.loadLanguageFile=this.loadLanguageFile.bind(this);this.setupEventListeners=this.setupEventListeners.bind(this);this.validate=this.validate.bind(this);this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.loadLanguageFile().then(()=>{this.setupEventListeners()}).catch(error=>{console.error("Error loading language file:",error)})}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}async loadLanguageFile(){const response=await fetch(`/wp-content/themes/g2a/assets/js/form-error-messages/${this.language}.json`);const data=await response.json();this.errorMessages=data}setupEventListeners(){this.inputs.forEach(input=>{input.addEventListener("blur",this.validate)})}validate(e2){const input=e2.target;const errorMsg=input.nextElementSibling;let errorMsgContent;switch(input.type){case"email":errorMsgContent=this.errorMessages.email||this.errorMessages.default;break;case"password":errorMsgContent=this.errorMessages.password||this.errorMessages.default;break;case"number":errorMsgContent=this.errorMessages.number||this.errorMessages.default;break;case"date":errorMsgContent=this.errorMessages.date||this.errorMessages.default;break;case"checkbox":errorMsgContent=this.errorMessages.checkbox||this.errorMessages.default;break;case"radio":errorMsgContent=this.errorMessages.radio||this.errorMessages.default;break;case"file":errorMsgContent=this.errorMessages.file||this.errorMessages.default;break;default:errorMsgContent=this.errorMessages.default}if(errorMsg&&errorMsg.id.startsWith("error-")){if(input.validity.valid){errorMsg.style.display="none"}else{errorMsg.textContent=errorMsgContent;errorMsg.style.display="block"}}}
23beforeRemove(){this.inputs.forEach(input=>{input.removeEventListener("blur",this.validate)})}}class ImageSlider extends q{constructor(el){super(el);this.el=el;this.imageContainer=null;this.images=null;this.dots=null;this.prevBtn=null;this.nextBtn=null;this.isDragging=false;this.slideChanged=false;this.startX=0;if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){var _a;this.el.dataset.initialized="true";this.imageContainer=this.el.querySelector("[data-images]");this.images=this.el.querySelectorAll("[data-image]");this.dots=this.el.querySelector("[data-dots]");this.prevBtn=this.el.querySelector("[data-prev-btn]");this.nextBtn=this.el.querySelector("[data-next-btn]");this.isDragging=false;this.slideChanged=false;this.startX=0;this.throttle=this.throttle.bind(this);this.setup=this.setup.bind(this);this.changeSlide=this.changeSlide.bind(this);this.clickSlide=this.clickSlide.bind(this);this.handleDragStart=this.handleDragStart.bind(this);this.handleDragEnd=this.handleDragEnd.bind(this);this.handleDrag=this.handleDrag.bind(this);this.handleDrag=this.throttle(this.handleDrag.bind(this),50);this.previousSlide=this.previousSlide.bind(this);this.nextSlide=this.nextSlide.bind(this);this.resetAndReinitialize=this.resetAndReinitialize.bind(this);(_a=this==null?void 0:this.dots)==null?void 0:_a.addEventListener("click",this.clickSlide);this.el.addEventListener("mousedown",this.handleDragStart);this.el.addEventListener("touchstart",this.handleDragStart);this.el.addEventListener("mouseup",this.handleDragEnd);this.el.addEventListener("touchend",this.handleDragEnd);this.el.addEventListener("mousemove",this.handleDrag);this.el.addEventListener("touchmove",this.handleDrag);if(this.prevBtn&&this.nextBtn){this.prevBtn.addEventListener("click",this.previousSlide);this.nextBtn.addEventListener("click",this.nextSlide)}this.setup()}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}throttle(func,limit){let inThrottle;return function(){const args=arguments;const context=this;if(!inThrottle){func.apply(context,args);inThrottle=true;setTimeout(()=>inThrottle=false,limit)}}}setup(){var _a;const dots=[];for(let i2=0;i2<this.images.length;i2++){if(i2===0)dots.push(`<span class="active" data-dot="${i2}"></span>`);else dots.push(`<span data-dot="${i2}"></span>`)}if(this.dots!==null)this.dots.innerHTML=dots.join("");(_a=this.images[0])==null?void 0:_a.classList.add("active")}clickSlide(e2){if(e2.target.hasAttribute("data-dot")){const clickedDot=parseInt(e2.target.getAttribute("data-dot"),10);this.changeSlide(clickedDot)}}changeSlide(slide){var _a,_b;this.dots.querySelector(".active").classList.remove("active");this.dots.querySelector(`[data-dot="${slide}"]`).classList.add("active");this.imageContainer.style.transform=`translateX(${slide*-100}%)`;(_b=(_a=this.imageContainer.querySelector(".active"))==null?void 0:_a.classList)==null?void 0:_b.remove("active");this.images[slide].classList.add("active")}handleDragStart(e2){if(!e2.target.getAttribute("data-dot")){e2.preventDefault();this.isDragging=true;this.startX=e2.clientX||e2.touches[0].clientX;this.slideChanged=false}}handleDragEnd(e2){this.isDragging=false}handleDrag(e2){var _a,_b;if(this.isDragging&&!this.slideChanged){const currentX=e2.clientX||e2.touches[0].clientX;const diffX=currentX-this.startX;const activeImage=parseInt((_b=(_a=this.dots)==null?void 0:_a.querySelector(".active"))==null?void 0:_b.getAttribute("data-dot"),10);if(diffX>0&&activeImage>0){this.changeSlide(activeImage-1)}else if(diffX<0&&activeImage<this.images.length-1){this.changeSlide(activeImage+1)}this.slideChanged=true}}previousSlide(){const activeImage=parseInt(this.dots.querySelector(".active").getAttribute("data-dot"),10);if(activeImage>0)this.changeSlide(activeImage-1)}nextSlide(){const activeImage=parseInt(this.dots.querySelector(".active").getAttribute("data-dot"),10);if(activeImage<this.images.length-1)this.changeSlide(activeImage+1)}beforeRemove(){this.dots.removeEventListener("click",this.clickSlide);this.el.removeEventListener("mousedown",this.handleDragStart);this.el.removeEventListener("touchstart",this.handleDragStart);this.el.removeEventListener("mouseup",this.handleDragEnd);this.el.removeEventListener("touchend",this.handleDragEnd);this.el.removeEventListener("mousemove",this.handleDrag);this.el.removeEventListener("touchmove",this.handleDrag);if(this.prevBtn&&this.nextBtn){this.prevBtn.removeEventListener("click",this.previousSlide);this.nextBtn.removeEventListener("click",this.nextSlide)}}}class Modal extends q{constructor(el){super(el);this.el=el;this.modalContent=null;this.triggerButton=null;this.closeButton=null;this.isOpen=false;if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){this.el.dataset.initialized="true";this.modalContent=this.el.querySelector("[data-content]");this.triggerButton=this.el.querySelector("[data-btn]");this.closeButton=this.el.querySelector("[data-btn-close]");this.isOpen=false;this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.openModal=this.openModal.bind(this);this.closeModal=this.closeModal.bind(this);this.toggleModal=this.toggleModal.bind(this);this.triggerButton.addEventListener("click",()=>this.toggleModal());this.closeButton.addEventListener("click",()=>this.closeModal())}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}openModal(){this.modalContent.classList.add("modal--unstyled--open");this.isOpen=true}closeModal(){this.modalContent.classList.remove("modal--unstyled--open");this.isOpen=false}toggleModal(){this.isOpen?this.closeModal():this.openModal()}beforeRemove(){this.triggerButton.removeEventListener("click",this.toggleModal);this.closeButton.removeEventListener("click",this.closeModal)}}class Navigation extends q{constructor(el){super(el);this.el=el;this.mainNav=null;this.searchInput=null;this.prevScroll=null;if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){this.el.dataset.initialized="true";this.mainNav=this.el.querySelector('[data-main-nav="home"]');this.searchInput=this.el.querySelector("[data-search-input]");this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.prevScroll=window.scrollY;this.toggleVisibility=this.toggleVisibility.bind(this);window.addEventListener("scroll",this.toggleVisibility)}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}toggleVisibility(){var _a,_b,_c,_d;const currentScroll=window.scrollY;if(currentScroll<this.prevScroll)this.el.classList.remove("hide");else if(window.scrollY>100)this.el.classList.add("hide");if(window.scrollY>0)(_b=(_a=this.searchInput)==null?void 0:_a.classList)==null?void 0:_b.add("hide");else(_d=(_c=this.searchInput)==null?void 0:_c.classList)==null?void 0:_d.remove("hide");this.prevScroll=currentScroll}beforeRemove(){window.removeEventListener("scroll",this.toggleVisibility)}}class Pagination extends q{constructor(el){super(el);this.el=el;this.prevBtn=null;this.nextBtn=null;this.list=null;this.listItems=null;this.content=null;this.pages=null;this.currentPage=0;this.totalPages=0;this.step=0;this.maxDisplayedPages=0;this.pageRange=0;this.ellipsisStart=0;this.ellipsisEnd=0;if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){var _a,_b,_c,_d;this.el.dataset.initialized="true";this.prevBtn=this.el.querySelector('.pagination__inner [aria-label="prev"]');this.nextBtn=this.el.querySelector('.pagination__inner [aria-label="next"]');this.list=this.el.querySelector("ul");this.listItems=(_a=this==null?void 0:this.list)==null?void 0:_a.querySelectorAll("li");this.content=this.el.querySelector("[data-pages]");this.pages=this.content.querySelectorAll("[data-pagination-page]");this.currentPage=1;this.totalPages=Number(this.content.getAttribute("data-page-count"));this.step=3;this.maxDisplayedPages=9;this.pageRange=2;this.ellipsisStart=6;this.ellipsisEnd=7;this.setup=this.setup.bind(this);this.prev=this.prev.bind(this);this.next=this.next.bind(this);this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.setActive=this.setActive.bind(this);this.generateList=this.generateList.bind(this);this.itemTemplate=this.itemTemplate.bind(this);this.disableButtons=this.disableButtons.bind(this);this.beforeRemove=this.beforeRemove.bind(this);this.setMaxDisplayedPages=this.setMaxDisplayedPages.bind(this);this.selectPage=this.selectPage.bind(this);this.resizeEvent=this.resizeEvent.bind(this);this.resetAndReinitialize=this.resetAndReinitialize.bind(this);(_b=this.prevBtn)==null?void 0:_b.addEventListener("click",this.prev);(_c=this.nextBtn)==null?void 0:_c.addEventListener("click",this.next);(_d=this.list)==null?void 0:_d.addEventListener("click",this.setActive);window.addEventListener("resize",this.resizeEvent);this.el.widgetInstance=this;this.setup()}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}setup(){var _a,_b,_c,_d;this.currentPage=1;this.setMaxDisplayedPages();(_b=(_a=this.listItems)==null?void 0:_a[this.currentPage-1])==null?void 0:_b.classList.add("active");(_d=(_c=this.pages)==null?void 0:_c[0])==null?void 0:_d.classList.add("selected");
23this.generateList();this.disableButtons()}prev(){if(this.currentPage>1){this.currentPage--;document.dispatchEvent(new CustomEvent("Paginate",{detail:{page:this.currentPage}}));this.generateList()}}setMaxDisplayedPages(){if(window.innerWidth<=768){this.maxDisplayedPages=5;this.pageRange=1;this.ellipsisStart=4;this.ellipsisEnd=5}else{this.maxDisplayedPages=9;this.pageRange=2;this.ellipsisStart=6;this.ellipsisEnd=7}}next(){if(this.currentPage<this.totalPages){this.currentPage++;document.dispatchEvent(new CustomEvent("Paginate",{detail:{page:this.currentPage}}));this.generateList()}}setEllipsis(elem){const newElem=document.createElement(elem.tagName);newElem.innerHTML="...";newElem.classList.add("ellipsis");elem.replaceWith(newElem)}setActive(elem){this.currentPage=Number(elem.target.innerText);if(elem.target.tagName==="LI"&&!elem.target.classList.contains("active")){const{target}=elem;this.listItems.forEach(li=>{if(li.classList.contains("active")){li.classList.remove("active")}});target.classList.add("active");document.dispatchEvent(new CustomEvent("Paginate",{detail:{page:this.currentPage}}));this.generateList()}}itemTemplate(page,active=false){if(active)return`<li class="active"><button>${page}</button></li>`;return`<li><button>${page}</button></li>`}generateList(){this.pages=this.content.querySelectorAll("[data-pagination-page]");this.totalPages=Number(this.content.getAttribute("data-page-count"));const pages=[];pages.push(this.itemTemplate(1,this.currentPage===1));let startPage=Math.max(2,this.currentPage-this.pageRange);let endPage=Math.min(this.totalPages-1,this.currentPage+this.pageRange);if(this.currentPage<this.ellipsisStart){startPage=2;endPage=Math.min(this.totalPages-1,this.ellipsisEnd)}else{pages.push("<li class='ellipsis'>...</li>")}if(this.totalPages-this.currentPage<=4){startPage=Math.max(2,this.totalPages-this.ellipsisStart);endPage=this.totalPages-1}if(this.totalPages-this.currentPage>4){for(let i2=startPage;i2<=endPage;i2++){pages.push(this.itemTemplate(i2,i2===this.currentPage))}pages.push("<li class='ellipsis'>...</li>")}else{for(let i2=startPage;i2<=endPage;i2++){pages.push(this.itemTemplate(i2,i2===this.currentPage))}}if(this.totalPages>1){pages.push(this.itemTemplate(this.totalPages,this.currentPage===this.totalPages))}if(this.list){this.list.innerHTML=pages.join("");this.listItems=this.list.querySelectorAll("li")}this.disableButtons();this.selectPage()}disableButtons(){var _a,_b,_c,_d;if(this.currentPage===1){(_a=this.prevBtn)==null?void 0:_a.classList.add("btn--disabled")}else{(_b=this.prevBtn)==null?void 0:_b.classList.remove("btn--disabled")}if(this.currentPage===this.totalPages){(_c=this.nextBtn)==null?void 0:_c.classList.add("btn--disabled")}else{(_d=this.nextBtn)==null?void 0:_d.classList.remove("btn--disabled")}}selectPage(){var _a,_b,_c,_d,_e;(_b=(_a=this.content.querySelector(".selected"))==null?void 0:_a.classList)==null?void 0:_b.remove("selected");(_e=(_d=(_c=this.pages)==null?void 0:_c[this.currentPage-1])==null?void 0:_d.classList)==null?void 0:_e.add("selected");document.dispatchEvent(new CustomEvent("Paginate",{detail:{page:this.currentPage}}))}resizeEvent(){this.totalPages=this.pages.length;this.setMaxDisplayedPages();this.generateList();this.currentPage=1;this.selectPage()}beforeRemove(){var _a,_b,_c;(_a=this==null?void 0:this.prevBtn)==null?void 0:_a.removeEventListener("click",this.prev);(_b=this==null?void 0:this.nextBtn)==null?void 0:_b.removeEventListener("click",this.next);(_c=this==null?void 0:this.list)==null?void 0:_c.removeEventListener("click",this.setActive);window.removeEventListener("resize",this.resizeEvent)}}class RangeSliderDouble extends q{constructor(el){super(el);this.el=el;this.id=null;this.fromSlider=null;this.toSlider=null;this.fromInput=null;this.toInput=null;this.grey80="#7d7b7a";this.lightGrey="#D9D9D9";if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){this.el.dataset.initialized="true";this.id=this.el.getAttribute(`data-slider-id`);this.fromSlider=this.el.querySelector(`[data-slider-min]`);
23this.toSlider=this.el.querySelector(`[data-slider-max]`);this.fromInput=this.el.querySelector(`[data-from-input]`);this.toInput=this.el.querySelector(`[data-to-input]`);this.fillSlider=this.fillSlider.bind(this);this.setToggleAccessible=this.setToggleAccessible.bind(this);this.controlToSlider=this.controlToSlider.bind(this);this.controlFromSlider=this.controlFromSlider.bind(this);this.controlToInput=this.controlToInput.bind(this);this.controlFromInput=this.controlFromInput.bind(this);this.getParsed=this.getParsed.bind(this);this.handleSliderChange=this.handleSliderChange.bind(this);this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.grey80="#7d7b7a";this.lightGrey="#D9D9D9";this.fillSlider(this.fromSlider,this.toSlider,this.lightGrey,this.grey80,this.toSlider);this.setToggleAccessible(this.toSlider);this.fromSlider.oninput=()=>this.controlFromSlider(this.fromSlider,this.toSlider,this.fromInput);this.toSlider.oninput=()=>this.controlToSlider(this.fromSlider,this.toSlider,this.toInput);this.fromInput.oninput=()=>this.controlFromInput(this.fromSlider,this.fromInput,this.toInput,this.toSlider);this.toInput.oninput=()=>this.controlToInput(this.toSlider,this.fromInput,this.toInput,this.toSlider)}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}handleSliderChange(values){const event=new CustomEvent("filterChange",{detail:{filterType:"rangeSlider",values:values}});this.el.dispatchEvent(event)}controlFromInput(fromSlider,fromInput,toInput,controlSlider){const[from,to]=this.getParsed(fromInput,toInput);this.fillSlider(fromInput,toInput,this.lightGrey,this.grey80,controlSlider);if(from<=to){fromSlider.value=to;fromInput.innerText=to}else{fromSlider.value=from}}controlToInput(toSlider,fromInput,toInput,controlSlider){const[from,to]=this.getParsed(fromInput,toInput);this.fillSlider(fromInput,toInput,this.lightGrey,this.grey80,controlSlider);this.setToggleAccessible(toInput);if(from<=to){toSlider.value=to;toInput.innerText=to}else{toInput.innerText=from}}controlFromSlider(fromSlider,toSlider,fromInput){var _a,_b;let[from,to]=this.getParsed(fromSlider,toSlider);this.fillSlider(fromSlider,toSlider,this.lightGrey,this.grey80,toSlider);const priceSteps=priceRangeSliderSteps??null;if(from>to){fromSlider.value=to;if(pageState&&pageState.selectedCurrency&&priceSteps&&((_a=fromSlider==null?void 0:fromSlider.name)==null?void 0:_a.includes("price"))){to=priceSteps[to][pageState.selectedCurrency]}fromInput.innerText=Number(to).toLocaleString()}else{if(pageState&&pageState.selectedCurrency&&priceSteps&&((_b=fromSlider==null?void 0:fromSlider.name)==null?void 0:_b.includes("price"))){from=priceSteps[from][pageState.selectedCurrency]}fromInput.innerText=Number(from).toLocaleString()}}controlToSlider(fromSlider,toSlider,toInput){var _a,_b;let[from,to]=this.getParsed(fromSlider,toSlider);this.fillSlider(fromSlider,toSlider,this.lightGrey,this.grey80,toSlider);this.setToggleAccessible(toSlider);const priceSteps=priceRangeSliderSteps??null;if(from<=to){toSlider.value=to;if(pageState&&pageState.selectedCurrency&&priceSteps&&((_a=toSlider==null?void 0:toSlider.name)==null?void 0:_a.includes("price"))){to=priceSteps[to][pageState.selectedCurrency]}toInput.innerText=Number(to).toLocaleString()}else{if(pageState&&pageState.selectedCurrency&&priceSteps&&((_b=toSlider==null?void 0:toSlider.name)==null?void 0:_b.includes("price"))){from=priceSteps[from][pageState.selectedCurrency]}toInput.innerText=Number(from).toLocaleString();toSlider.value=from}}getParsed(currentFrom,currentTo){const from=parseInt(currentFrom.value,10);const to=parseInt(currentTo.value,10);return[from,to]}fillSlider(from,to,sliderColor,rangeColor,controlSlider){to.max-to.min;from.value-to.min;to.value-to.min;controlSlider.style.borderRadius="15px";controlSlider.style.height="4px";controlSlider.style.background=sliderColor}setToggleAccessible(currentTarget){if(Number(currentTarget.value)<=0){this.toSlider.style.zIndex=2}else{this.toSlider.style.zIndex=0}}beforeRemove(){}}class ScrollContent extends q{constructor(el){super(el);this.el=el;this.imageContainer=null;this.textContainer=null;this.scrollIndicator=null;this.heading=null;if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){this.el.dataset.initialized="true";this.imageContainer=this.el.querySelector("[data-image-content]");this.textContainer=this.el.querySelector("[data-scroll-content]");this.scrollIndicator=this.el.querySelector("[data-scroll-indicator]");this.heading=this.el.querySelector("[data-heading-content]");this.adjustHeight=this.adjustHeight.bind(this);this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.toggleScrollIndicator=this.toggleScrollIndicator.bind(this);this.updateScrollAppearance=this.updateScrollAppearance.bind(this);window.addEventListener("resize",this.updateScrollAppearance);setTimeout(()=>{this.updateScrollAppearance()},0)}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}adjustHeight(){this.textContainer.style.height=`${this.imageContainer.clientHeight-this.heading.offsetHeight-this.scrollIndicator.offsetHeight}px`}toggleScrollIndicator(){if(this.textContainer.firstChild.offsetHeight>this.textContainer.offsetHeight){this.scrollIndicator.style.display="block"}else{this.scrollIndicator.style.display="none"}}updateScrollAppearance(){if(this.imageContainer&&this.textContainer&&this.heading){this.adjustHeight();this.toggleScrollIndicator()}}beforeRemove(){window.removeEventListener("resize",this.updateScrollAppearance)}}class SearchModal extends q{constructor(el){super(el);this.el=el;this.inputSearch=null;this.modal=null;this.closeBtn=null;this.keyPressCount=0;
23if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){this.el.dataset.initialized="true";this.inputSearch=this.el.querySelector("[data-input]");this.modal=this.el.querySelector("[data-modal]");this.closeBtn=this.el.querySelector("[data-close-btn]");this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.showModal=this.showModal.bind(this);this.hideModal=this.hideModal.bind(this);this.updateLinkTabIndex=this.updateLinkTabIndex.bind(this);this.inputValidate=this.inputValidate.bind(this);this.keyPressCount=0;this.inputSearch.addEventListener("keydown",this.inputValidate);window.addEventListener("click",this.hideModal)}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}showModal(){if(this.scrollTimeout){clearTimeout(this.scrollTimeout)}this.scrollTimeout=setTimeout(()=>{const searchValue=this.inputSearch.value;if(searchValue.length>=3){this.modal.style.maxHeight=`${this.modal.scrollHeight}px`;this.modal.setAttribute("aria-expanded","true");this.updateLinkTabIndex("0")}},900)}hideModal(e2){if(!this.modal.contains(e2.target)||this.closeBtn.contains(e2.target)){this.modal.style.maxHeight="";this.modal.setAttribute("aria-expanded","false");this.updateLinkTabIndex("-1")}}updateLinkTabIndex(tabIndex){const elems=this.modal.querySelectorAll("a, button");elems.forEach(elem=>{elem.setAttribute("tabindex",tabIndex)})}inputValidate(e2){const regex=/^[a-zA-Z0-9]+$/;const keyPressed=e2.key;const keyPressMin=Number(this.inputSearch.getAttribute("data-min-key"))||3;regex.test(keyPressed)?this.keyPressCount++:null;if(e2.key==="Enter"||this.keyPressCount>=keyPressMin){this.keyPressCount=0;this.showModal()}}beforeRemove(){this.inputSearch.removeEventListener("keydown",this.showModal);window.removeEventListener("click",this.hideModal)}}class SplideWidget extends q{constructor(el){super(el);this.el=el;this.parent=null;this.scrollbar=null;this.inputSlider=null;this.scrollThumb=null;this.prevBtn=null;this.nextBtn=null;this.scrollIndicator=null;this.splide=null;this.percent=null;this.totalSlides=null;this.lastIndex=null;this.newIndex=null;this.fadeSlider={slides:null,totalSlidesText:null,currentSlideText:null,activeSlide:null,title:null,secondaryTitle:null,subtitle:null,content:null,buttonText:null,titleElement:null,secondaryTitleElement:null,subtitleElement:null,contentElement:null,buttonElement:null,transitionDuration:null};if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){this.el.dataset.initialized="true";this.parent=this.el.parentElement;this.scrollbar=this.parent.querySelector("[data-scroll-bar]");this.inputSlider=this.parent.querySelector("[data-input-slider]");this.scrollThumb=this.parent.querySelector("[data-scroll-thumb]");this.prevBtn=this.parent.querySelector(".splide__arrow--prev");this.nextBtn=this.parent.querySelector(".splide__arrow--next");this.scrollIndicator=this.parent.querySelector("[data-scroll-indicator]");this.options=JSON.parse(this.el.getAttribute("data-options"));this.hasScrollbar=JSON.parse(this.el.getAttribute("data-has-scrollbar"));this.isFadeSlider=JSON.parse(this.el.getAttribute("data-fade-slider"));this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.setup=this.setup.bind(this);this.moved=this.moved.bind(this);this.fadeSliderSetup=this.fadeSliderSetup.bind(this);this.updateBtnState=this.updateBtnState.bind(this);this.handleInput=this.handleInput.bind(this);this.updateSlider=this.updateSlider.bind(this);if(this.hasScrollbar){this.inputSlider.addEventListener("input",this.handleInput)}this.setup()}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}setup(){this.splide=new Splide(this.el,{...this.options}).mount();this.totalSlides=this.splide.Components.Elements.slides.length;this.lastIndex=this.totalSlides-1;this.splide.on("moved",this.moved);if(this.isFadeSlider)this.fadeSliderSetup()}moved(newIndex){var _a;if(this.hasScrollbar){this.inputSlider.value=newIndex/this.lastIndex*100;this.updateSlider(this.inputSlider.value)}if(this.isFadeSlider){this.fadeSlider.currentSlideText.innerText=newIndex+1;this.fadeSlider.activeSlide=this.fadeSlider.slides[newIndex];this.fadeSlider.title=this.fadeSlider.activeSlide.querySelector(".hidden-title").innerText;this.fadeSlider.secondaryTitle=this.fadeSlider.activeSlide.querySelector(".hidden-title-secondary").innerText;this.fadeSlider.subtitle=this.fadeSlider.activeSlide.querySelector(".hidden-subtitle").innerText;this.fadeSlider.content=this.fadeSlider.activeSlide.querySelector(".hidden-content").innerText;this.fadeSlider.buttonLink=this.fadeSlider.activeSlide.querySelector(".hidden-button a").href;this.fadeSlider.currentSlideText.innerText=newIndex+1;[this.fadeSlider.titleElement,this.fadeSlider.secondaryTitleElement,this.fadeSlider.subtitleElement,this.fadeSlider.contentElement,this.fadeSlider.buttonElement].forEach(element=>{element.style.opacity="0"});setTimeout(()=>{this.fadeSlider.titleElement.innerText=this.fadeSlider.title;this.fadeSlider.secondaryTitleElement.innerText=this.fadeSlider.secondaryTitle;this.fadeSlider.subtitleElement.innerText=this.fadeSlider.subtitle;this.fadeSlider.contentElement.innerText=this.fadeSlider.content;this.fadeSlider.buttonElement.href=this.fadeSlider.buttonLink;[this.fadeSlider.titleElement,this.fadeSlider.secondaryTitleElement,this.fadeSlider.subtitleElement,this.fadeSlider.contentElement,this.fadeSlider.buttonElement].forEach(element=>{element.style.opacity="1"})},((_a=this.fadeSlider)==null?void 0:_a.transitionDuration)||200)}}fadeSliderSetup(){this.fadeSlider.slides=this.parent.querySelectorAll(".splide__slide");this.fadeSlider.totalSlidesText=this.parent.querySelector("[data-sli
23de-num-total]");this.fadeSlider.currentSlideText=this.parent.querySelector("[data-slide-num-current]");this.fadeSlider.titleElement=this.parent.querySelector("[data-large-card-title]");this.fadeSlider.secondaryTitleElement=this.parent.querySelector("[data-large-card-title-secondary]");this.fadeSlider.subtitleElement=this.parent.querySelector("[data-large-card-subtitle]");this.fadeSlider.contentElement=this.parent.querySelector("[data-large-card-content]");this.fadeSlider.buttonElement=this.parent.querySelector("[data-large-card-button]");this.fadeSlider.totalSlidesText.innerText=this.fadeSlider.slides.length;this.fadeSlider.transitionDuration=parseFloat(window.getComputedStyle(this.fadeSlider.titleElement).getPropertyValue("transition-duration"))*1e3}updateBtnState(newIndex,lastIndex){if(newIndex===0)this.prevBtn.disabled=true;else this.prevBtn.disabled=false;if(newIndex>=lastIndex)this.nextBtn.disabled=true;else this.nextBtn.disabled=false}handleInput(e2){this.percent=e2.target.value;this.updateSlider(this.percent);this.updateBtnState(this.newIndex,this.lastIndex);this.splide.Components.Controller.go(this.newIndex)}updateSlider(percent){this.scrollThumb.style.left=`${percent}%`;this.scrollIndicator.style.width=`${percent}%`;this.newIndex=Math.round(percent/100*this.lastIndex)}beforeRemove(){var _a;(_a=this.splide)==null?void 0:_a.off("moved",this.moved);if(this.inputSlider){this.inputSlider.removeEventListener("input",this.handleInput)}}}class TableHelper extends q{constructor(el){super(el);this.el=el;this.tableContainer=null;this.scrollMoreText=null;if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){this.el.dataset.initialized="true";this.tableContainer=this.el.querySelector("[data-table-container]");this.scrollMoreText=this.el.querySelector("[data-scroll-more]");this.doesOverflow=this.doesOverflow.bind(this);this.toggleScrollText=this.toggleScrollText.bind(this);this.resetAndReinitialize=this.resetAndReinitialize.bind(this);window.addEventListener("resize",this.toggleScrollText);this.toggleScrollText()}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}doesOverflow(){var _a,_b;return((_a=this.tableContainer)==null?void 0:_a.scrollWidth)>((_b=this.tableContainer)==null?void 0:_b.clientWidth)}toggleScrollText(){var _a,_b,_c,_d;this.doesOverflow()?(_b=(_a=this==null?void 0:this.scrollMoreText)==null?void 0:_a.classList)==null?void 0:_b.remove("d-none"):(_d=(_c=this==null?void 0:this.scrollMoreText)==null?void 0:_c.classList)==null?void 0:_d.add("d-none")}beforeRemove(){window.removeEventListener("resize",this.toggleScrollText)}}class TableOfContents extends q{}class Tooltip extends q{constructor(el){super(el);this.el=el;this.triggerText=null;this.tooltipText=null;this.container=null;if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){this.el.dataset.initialized="true";this.triggerText=this.el.querySelector("[data-trigger-text]");this.tooltipText=this.el.querySelector("[data-tooltip-text]");this.showTooltip=this.showTooltip.bind(this);this.hideTooltip=this.hideTooltip.bind(this);this.toggleTooltip=this.toggleTooltip.bind(this);this.adjustTooltipPosition=this.adjustTooltipPosition.bind(this);this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.container=this.el.closest(".position-relative");this.el.addEventListener("mouseover",this.showTooltip);this.el.addEventListener("mouseout",this.hideTooltip);this.el.addEventListener("touchstart",this.showTooltip);this.el.addEventListener("touchend",this.hideTooltip);this.hideTooltip()}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}showTooltip(){this.adjustTooltipPosition();this.adjustTooltipArrow();this.tooltipText.style.visibility="visible";this.tooltipText.style.opacity="1"}hideTooltip(){this.tooltipText.style.visibility="hidden";this.tooltipText.style.opacity="0";this.tooltipText.style.left="unset";this.tooltipText.style.right="unset";this.el.classList.remove("right","left")}toggleTooltip(){if(this.tooltipText.style.visibility==="visible"){this.hideTooltip()}else{this.showTooltip()}}adjustTooltipPosition(){var _a,_b,_c;const triggerRect=(_a=this==null?void 0:this.triggerText)==null?void 0:_a.getBoundingClientRect();const tooltipRect=(_b=this==null?void 0:this.tooltipText)==null?void 0:_b.getBoundingClientRect();const containerRect=(_c=this==null?void 0:this.container)==null?void 0:_c.getBoundingClientRect();let triggerContainerDifference=null;if(triggerRect&&containerRect){triggerContainerDifference=triggerRect.left-containerRect.left}let potentialRightOverflow=triggerRect.right+(tooltipRect.width-containerRect.right)+10;const centeredLeft=triggerRect.left+triggerRect.width/2-tooltipRect.width/2-10;let potentialLeftOverflow=containerRect.left-centeredLeft;if(potentialRightOverflow>180&&triggerContainerDifference){this.tooltipText.style.left=`${-triggerContainerDifference/4}px`}else if(potentialLeftOverflow>20){this.tooltipText.style.left=`${potentialLeftOverflow}px`}else{this.tooltipText.style.left="50%"}let potentialBottomOverflow=triggerRect.bottom+tooltipRect.height-containerRect.bottom;let potentialTopOverflow=triggerRect.top-tooltipRect.height-containerRect.top;if(potentialBottomOverflow>100){if(potentialTopOverflow>0){this.tooltipText.style.top=`${-tooltipRect.height-5}px`}else{this.tooltipText.style.top=`${triggerRect.top-tooltipRect.height}px`}}}adjustTooltipArrow(){const triggerRect=this==null?void 0:this.triggerText.getBoundingClientRect();const tooltipRect=this==null?void 0:this.tooltipText.getBoundingClientRect();const arrowPosition=triggerRect.left+triggerRect.width/2-tooltipRect.left;this.tooltipText.style.setProperty("--arrow-position",`${arrowPosition}px`);if(parseInt(this.tooltipText.style.top,10)<triggerRect.top){const arrowPosition2=triggerRect.left+triggerRect.width/2-tooltipRect.left-12;this.tooltipText.style.setProperty("--arrow-position",`${arrowPosition2}px`);this.tooltipText.classList.add("top")}else{this.tooltipText.classList.remove("top")}}beforeRemove(){this.el.removeEventListener("mouseover",this.showTooltip);this.el.removeEventListener("mouseout",this.hideTooltip);this.el.removeEventListener("touchstart",this.showTooltip);this.el.removeEventListener("touchend",this.hideTooltip)}}class StickyNav extends q{constructor(el){super(el);this.el=el;this.parent=null;this.position=null;this.height=null;this.offset=null;this.prevScroll=0;
23this.navHeight=0;if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){this.el.dataset.initialized="true";this.parent=this.el.parentElement;this.position=this.el.getAttribute("data-position");this.height=this.el.getBoundingClientRect().height;this.offset=this.height/2;this.prevScroll=0;this.navHeight=148;this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.toggleVisibility=this.toggleVisibility.bind(this);this.reset=this.reset.bind(this);window.addEventListener("resize",this.reset);window.addEventListener("scroll",this.toggleVisibility)}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}toggleVisibility(){const top=this.el.getBoundingClientRect().top;let parentPosition;if(this.position==="bottom"){parentPosition=this.parent.getBoundingClientRect().bottom-this.height}else if(this.position==="top"){parentPosition=this.parent.getBoundingClientRect().top}const currentScroll=window.scrollY;if(top<=0){this.el.classList.add("stick")}if(parentPosition>=0){this.el.classList.remove("stick")}if(currentScroll<this.prevScroll){this.el.classList.add("with-top-nav")}else{this.el.classList.remove("with-top-nav")}this.prevScroll=currentScroll}reset(){if(this.el.classList.contains("stick")){this.el.classList.remove("stick")}if(this.el.classList.contains("with-top-nav")){this.el.classList.remove("with-top-nav")}}beforeRemove(){window.removeEventListener("resize",this.reset);window.removeEventListener("scroll",this.toggleVisibility)}}class CalendarWidget extends q{constructor(el){super(el);this.el=el;this.startDate=null;this.endDate=null;this.selectedMonth=null;this.tripDuration=null;this.month=null;this.year=null;if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){this.el.dataset.initialized="true";this.setup=this.setup.bind(this);this.handleParentClick=this.handleParentClick.bind(this);this.beforeRemove=this.beforeRemove.bind(this);this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.startDate=this.el.parentElement.querySelector("[data-start-date]");this.endDate=this.el.parentElement.querySelector("[data-end-date]");this.selectedMonth=this.el.parentElement.querySelector("[data-calendar-selected-month]");this.tripDuration=this.el.parentElement.querySelector("[data-trip-duration]");this.el.parentElement.addEventListener("click",this.handleParentClick);this.options={type:"multiple",actions:{clickDay:(e2,dates)=>{if(dates&&dates.length>0){const sortedDates=[...dates].sort((a2,b2)=>new Date(a2)-new Date(b2));this.startDate.innerText=this.formatDateToWords(sortedDates[0])||"Select Date Below";this.endDate.innerText=this.formatDateToWords(sortedDates[sortedDates.length-1])||"Select Date Below"}else{this.startDate.innerText="Select Date Below";this.endDate.innerText="Select Date Below"}this.tripDuration.innerText=(dates==null?void 0:dates.length)||"0"}},settings:{range:{disablePast:true},settings:{},selection:{day:"multiple-ranged"},visibility:{theme:"light",monthShort:false,disabled:false},CSSClasses:{}}};this.setup()}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}setup(){const calendar=new VanillaCalendar(this.el,this.options);calendar.init()}launchMonthSelector(month,year){const monthSelectorEl=document.createElement("div");monthSelectorEl.classList.add("month-selector-overlay");this.el.appendChild(monthSelectorEl);const monthOptions={...this.options,type:"month",settings:{...this.options.settings,selected:{month:month&&month,year:year&&year}},actions:{clickMonth:(e2,selectedMonth)=>{monthSelectorEl==null?void 0:monthSelectorEl.remove();this.month=selectedMonth;this.updateOriginalCalendar()}}};const monthCalendar=new VanillaCalendar(monthSelectorEl,monthOptions);monthCalendar.init()}launchYearSelector(month,year){const yearSelectorEl=document.createElement("div");yearSelectorEl.classList.add("month-selector-overlay");this.el.appendChild(yearSelectorEl);const yearOptions={...this.options,type:"year",settings:{...this.options.settings,selected:{month:month&&month,year:year&&year}},actions:{clickYear:(e2,selectedYear)=>{yearSelectorEl==null?void 0:yearSelectorEl.remove();this.year=selectedYear;
23this.updateOriginalCalendar()}}};const yearCalendar=new VanillaCalendar(yearSelectorEl,yearOptions);yearCalendar.init()}handleParentClick(e2){if(e2.target&&e2.target.matches("[data-calendar-selected-month]")){this.launchMonthSelector(this.month,this.year)}if(e2.target&&e2.target.matches("[data-calendar-selected-year]")){this.launchYearSelector(this.month,this.year)}}updateOriginalCalendar(){const options={...this.options,settings:{...this.options.settings,selected:{month:this.month,year:this.year}}};const calendar=new VanillaCalendar(this.el,options);calendar.init()}formatDateToWords(dateString){const months=["January","February","March","April","May","June","July","August","September","October","November","December"];const date=new Date(dateString);const day=date.getDate();const month=months[date.getMonth()];const year=date.getFullYear();return`${day} ${month} ${year}`}beforeRemove(){this.el.parentElement.removeEventListener("click",this.handleParentClick)}}class TelephoneInput extends q{constructor(el){super(el);__publicField(this,"updateDropdownWidth",()=>{const dropdown=document.querySelector(".iti__country-list");if(dropdown){const inputWidth=this.el.offsetWidth;dropdown.style.width=`${inputWidth}px`}});this.el=el;if(!el.dataset.initialized){this.init()}this.el.widgetInstance=this}init(){this.el.dataset.initialized="true";this.setup();this.resetAndReinitialize=this.resetAndReinitialize.bind(this);window.addEventListener("resize",this.updateDropdownWidth);this.el.addEventListener("open:countrydropdown",this.updateDropdownWidth)}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}setup(){this.iti=window.intlTelInput(this.el,{utilsScript:"../telephone-input/utils.js",separateDialCode:true,initialCountry:"auto",geoIpLookup:callback=>{fetch("https://ipapi.co/json").then(res=>res.json()).then(data=>callback(data.country_code)).catch(()=>callback("us"))},dropdownContainer:this.el.sibling})}beforeRemove(){window.removeEventListener("resize",this.updateDropdownWidth);this.el.removeEventListener("open:countrydropdown",this.updateDropdownWidth)}}class Measurement extends q{constructor(el){super(el);this.el=el;this.imperialButton=null;this.metricButton=null;this.init=this.init.bind(this);if(!el.dataset.initialized){el.dataset.initialized=true;this.init()}this.el.widgetInstance=this}init(){this.toggleMeasurement=this.toggleMeasurement.bind(this);this.updateTableData=this.updateTableData.bind(this);this.convertCelsiusToFahrenheit=this.convertCelsiusToFahrenheit.bind(this);this.convertFahrenheitToCelsius=this.convertFahrenheitToCelsius.bind(this);this.convertInchesToMillimeters=this.convertInchesToMillimeters.bind(this);this.convertMillimetersToInches=this.convertMillimetersToInches.bind(this);this.resetAndReinitialize=this.resetAndReinitialize.bind(this);this.imperialButton=this.el.querySelector('[data-imperial="true"]');this.metricButton=this.el.querySelector('[data-metric="true"]');this.imperialButton.addEventListener("click",()=>this.toggleMeasurement("imperial"));this.metricButton.addEventListener("click",()=>this.toggleMeasurement("metric"))}toggleMeasurement(measurementType){if(measurementType==="imperial"){this.imperialButton.classList.add("active");this.metricButton.classList.remove("active")}else{this.metricButton.classList.add("active");this.imperialButton.classList.remove("active")}this.updateTableData(measurementType)}updateTableData(measurementType){const table=document.querySelector(`[data-measurement]`);table.setAttribute("data-measurement",measurementType);Array.from(table.querySelectorAll("td")).forEach(cell=>{let lengthMatch=cell.textContent.match(/(\d+(?:\.\d+)?)\s*(mm|â³)/);if(lengthMatch&&lengthMatch[1]){let value=parseFloat(lengthMatch[1]);if(measurementType==="imperial"){cell.textContent=cell.textContent.replace(value+"mm",this.convertMillimetersToInches(value).toFixed(0)+"â³")}else{cell.textContent=cell.textContent.replace(value+"â³",this.convertInchesToMillimeters(value).toFixed(0)+"mm")}}let tempMatch=cell.textContent.match(/(\d+(?:\.\d+)?)\s*°[CF]/);if(tempMatch&&tempMatch[1]){let value=parseFloat(tempMatch[1]);if(measurementType==="imperial"){cell.textContent=cell.textContent.replace(value+"°C",this.convertCelsiusToFahrenheit(value).toFixed(0)+"°F")}else{cell.textContent=cell.textContent.replace(value+"°F",this.convertFahrenheitToCelsius(value).toFixed(0)+"°C")}}})}convertFahrenheitToCelsius(fahrenheit){return(fahrenheit-32)*(5/9)}convertCelsiusToFahrenheit(celsius){return celsius*(9/5)+32}convertInchesToMillimeters(inches){return inches*25.4}convertMillimetersToInches(mm){return mm/25.4}beforeRemove(){this.imperialButton.removeEventListener("click",()=>this.toggleMeasurement("imperial"));this.metricButton.removeEventListener("click",()=>this.toggleMeasurement("metric"))}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}}class RatesSwitcher extends q{constructor(el){var _a;super(el);this.el=el;this.dropdownButton=this.el.querySelector('[data-widget="DropdownButton"]');this.dropdownContent=this.el.querySelector("#button-dropdown-price__content");this.table=(_a=this.el.nextElementSibling)==null?void 0:_a.querySelector("table");this.init=this.init.bind(this);if(!el.dataset.initialized){el.dataset.initialized=true;this.init()}this.el.widgetInstance=this}init(){this.switchCurrency=this.switchCurrency.bind(this);this.updateTableCurrency=this.updateTableCurrency.bind(this);this.resetAndReinitialize=this.resetAndReinitialize.bind(this);
23Array.from(this.dropdownContent.querySelectorAll("li")).forEach(li=>{li.addEventListener("click",this.switchCurrency)})}switchCurrency(event){const countryElement=event.currentTarget.querySelector(".navigation__phone-text");const currencyElement=event.currentTarget.querySelectorAll(".navigation__phone-text")[1];this.dropdownButton.querySelector(".navigation__phone-text").textContent=countryElement.textContent;this.dropdownButton.querySelector('[data-currency-value="true"]').textContent=currencyElement.textContent.trim();this.dropdownButton.widgetInstance.changeCurrency(event);this.updateTableCurrency(currencyElement.textContent.trim())}updateTableCurrency(currency){var _a;(_a=Array.from(document.querySelectorAll(".currency-price")))==null?void 0:_a.forEach(el=>{const currencyKey=currency.toLowerCase();if(el.dataset&&el.dataset[currencyKey]){el.textContent=el.dataset[currencyKey]}})}beforeRemove(){Array.from(this.dropdownContent.querySelectorAll("li")).forEach(li=>{li.removeEventListener("click",this.switchCurrency)})}resetAndReinitialize(){if(this.el.widgetInstance){this.el.dataset.initialized=false;this.beforeRemove();this.init()}}}class BlockQuote extends q{constructor(el){super(el);this.el=el;this.el.widgetInstance=this;if(!el.dataset.initialized){el.dataset.initialized=true;this.init()}}init(){const blockQuotes=this.getAllBlockQuotes();if(blockQuotes){this.addQuotes(blockQuotes)}}getAllBlockQuotes(){return this.el.querySelectorAll("blockquote")}addQuotes(blockQuotes){blockQuotes==null?void 0:blockQuotes.forEac
23h(blockQuote=>{const firstElement=this.firstElementWithoutImg(blockQuote);if(firstElement){this.addQuoteClass(firstElement,true);this.addQuoteClass(this.lastElement(blockQuote))}})}getAllParagraphs(blockQuote){return blockQuote.querySelectorAll("p")}firstElementWithoutImg(blockQuote){const paragraphs=this.getAllParagraphs(blockQuote);let firstNoImage=null;for(const p2 of paragraphs){if(p2.querySelector("img")===null){firstNoImage=p2;break}}return firstNoImage}lastElement(blockQuote){const paragraphs=this.getAllParagraphs(blockQuote);return paragraphs[paragraphs.length-1]}addQuoteClass(element,open){element.classList.add(open?"quote-open":"quote-close")}}const widgets=Object.freeze(Object.defineProperty({__proto__:null,Accordion:Accordion,AnimateCount:AnimateCount,BlockQuote:BlockQuote,CalendarWidget:CalendarWidget,CustomScroll:CustomScroll,DestinationAfricaMap:DestinationAfricaMap,DestinationsMap:DestinationsMap,Dropdown:Dropdown,DropdownButton:DropdownButton,FormValidator:FormValidator,ImageSlider:ImageSlider,Measurement:Measurement,Modal:Modal,Navigation:Navigation,Pagination:Pagination,RangeSliderDouble:RangeSliderDouble,RatesSwitcher:RatesSwitcher,ScrollContent:ScrollContent,SearchModal:SearchModal,SplideWidget:SplideWidget,StickyNav:StickyNav,TableHelper:TableHelper,TableOfContents:TableOfContents,TelephoneInput:TelephoneInput,Tooltip:Tooltip},Symbol.toStringTag,{value:"Module"}));let initialized=false;function init(){if(initialized)return;initialized=true;p.add({...widgets});A.parse()}const cb=mutationList=>{for(let i2=0;i2<mutationList.length;i2++){if(mutationList[i2].type==="childList"){init();break}}};const observer=new MutationObserver(cb);const config={childList:true,subtree:false};let targetNode=document.getElementById("storybook-root");const script=document.createElement("script");script.setAttribute("type","text/javascript");script.setAttribute("async","async");script.setAttribute("src","https://api.feefo.com/api/javascript/go2africa");document.addEventListener("DOMContentLoaded",()=>{if(!targetNode)targetNode=document.querySelector("body");observer.observe(targetNode,config)});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.