1/* 2 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). 3 * This devtool is neither made for production nor for readable output files. 4 * It uses "eval()" calls to create a separate source file in the browser devtools. 5 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) 6 * or disable the default devtool with "devtool: false". 7 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). 8 */ 9/******/ (() => { // webpackBootstrap 10/******/ var __webpack_modules__ = ({ 11 12/***/ "./node_modules/glightbox/dist/js/glightbox.min.js" 13/*!*********************************************************!*\ 14 !*** ./node_modules/glightbox/dist/js/glightbox.min.js ***! 15 \*********************************************************/ 16(module) { 17 18eval("{!function(e,t){ true?module.exports=t():0}(this,(function(){\"use strict\";function e(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}function t(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,\"value\"in s&&(s.writable=!0),Object.defineProperty(e,n(s.key),s)}}function i(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}function n(e){var t=function(e,t){if(\"object\"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||\"default\");if(\"object\"!=typeof n)return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===t?String:Number)(e)}(e,\"string\");return\"symbol\"==typeof t?t:t+\"\"}function s(e){return(s=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}var l=Date.now();function o(){var e={},t=!0,i=0,n=arguments.length;\"[object Boolean]\"===Object.prototype.toString.call(arguments[0])&&(t=arguments[0],i++);for(var s=function(i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t&&\"[object Object]\"===Object.prototype.toString.call(i[n])?e[n]=o(!0,e[n],i[n]):e[n]=i[n])};i<n;i++){var l=arguments[i];s(l)}return e}function r(e,t){if((E(e)||e===window||e===document)&&(e=[e]),L(e)||I(e)||(e=[e]),0!=M(e))if(L(e)&&!I(e))for(var i=e.length,n=0;n<i&&!1!==t.call(e[n],e[n],n,e);n++);else if(I(e))for(var s in e)if(P(e,s)&&!1===t.call(e[s],e[s],s,e))break}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=e[l]=e[l]||[],s={all:n,evt:null,found:null};return t&&i&&M(n)>0&&r(n,(function(e,n){if(e.eventName==t&&e.fn.toString()==i.toString())return s.found=!0,s.evt=n,!1})),s}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.onElement,n=t.withCallback,s=t.avoidDuplicate,l=void 0===s||s,o=t.once,h=void 0!==o&&o,d=t.useCapture,c=void 0!==d&&d,u=arguments.length>2?arguments[2]:void 0,g=i||[];function v(e){C(n)&&n.call(u,e,this),h&&v.destroy()}return k(g)&&(g=document.querySelectorAll(g)),v.destroy=function(){r(g,(function(t){var i=a(t,e,v);i.found&&i.all.splice(i.evt,1),t.removeEventListener&&t.removeEventListener(e,v,c)}))},r(g,(function(t){var i=a(t,e,v);(t.addEventListener&&l&&!i.found||!l)&&(t.addEventListener(e,v,c),i.all.push({eventName:e,fn:v}))})),v}function d(e,t){r(t.split(\" \"),(function(t){return e.classList.add(t)}))}function c(e,t){r(t.split(\" \"),(function(t){return e.classList.remove(t)}))}function u(e,t){return e.classList.contains(t)}function g(e,t){for(;e!==document.body;){if(!(e=e.parentElement))return!1;if(\"function\"==typeof e.matches?e.matches(t):e.msMatchesSelector(t))return e}}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e||\"\"===t)return!1;if(\"none\"===t)return C(i)&&i(),!1;var n=b(),s=t.split(\" \");r(s,(function(t){d(e,\"g\"+t)})),h(n,{onElement:e,avoidDuplicate:!1,once:!0,withCallback:function(e,t){r(s,(function(e){c(t,\"g\"+e)})),C(i)&&i()}})}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\";if(\"\"===t)return e.style.webkitTransform=\"\",e.style.MozTransform=\"\",e.style.msTransform=\"\",e.style.OTransform=\"\",e.style.transform=\"\",!1;e.style.webkitTransform=t,e.style.MozTransform=t,e.style.msTransform=t,e.style.OTransform=t,e.style.transform=t}function p(e){e.style.display=\"block\"}function m(e){e.style.display=\"none\"}function y(e){var t=document.createDocumentFragment(),i=document.createElement(\"div\");for(i.innerHTML=e;i.firstChild;)t.appendChild(i.firstChild);return t}function x(){return{width:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,height:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}}function b(){var e,t=document.createElement(\"fakeelement\"),i={animation:\"animationend\",OAnimation:\"oAnimationEnd\",MozAnimation:\"animationend\",WebkitAnimation:\"webkitAnimationEnd\"};for(e in i)if(void 0!==t.style[e])return i[e]}function S(e,t,i,n){if(e())t();else{var s;i||(i=100);var l=setInterval((function(){e()&&(clearInterval(l),s&&clearTimeout(s),t())}),i);n&&(s=setTimeout((function(){clearInterval(l)}),n))}}function w(e,t,i){if(O(e))console.error(\"Inject assets error\");else if(C(t)&&(i=t,t=!1),k(t)&&t in window)C(i)&&i();else{var n;if(-1!==e.indexOf(\".css\")){if((n=document.querySelectorAll('link[href=\"'+e+'\"]'))&&n.length>0)return void(C(i)&&i());var s=document.getElementsByTagName(\"head\")[0],l=s.querySelectorAll('link[rel=\"stylesheet\"]'),o=document.createElement(\"link\");return o.rel=\"stylesheet\",o.type=\"text/css\",o.href=e,o.media=\"all\",l?s.insertBefore(o,l[0]):s.appendChild(o),void(C(i)&&i())}if((n=document.querySelectorAll('script[src=\"'+e+'\"]'))&&n.length>0){if(C(i)){if(k(t))return S((function(){return void 0!==window[t]}),(function(){i()})),!1;i()}}else{var r=document.createElement(\"script\");r.type=\"text/javascript\",r.src=e,r.onload=function(){if(C(i)){if(k(t))return S((function(){return void 0!==window[t]}),(function(){i()})),!1;i()}},document.body.appendChild(r)}}}function T(){return\"navigator\"in window&&window.navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i)}function C(e){return\"function\"==typeof e}
18function k(e){return\"string\"==typeof e}function E(e){return!(!e||!e.nodeType||1!=e.nodeType)}function A(e){return Array.isArray(e)}function L(e){return e&&e.length&&isFinite(e.length)}function I(e){return\"object\"===s(e)&&null!=e&&!C(e)&&!A(e)}function O(e){return null==e}function P(e,t){return null!==e&&hasOwnProperty.call(e,t)}function M(e){if(I(e)){if(e.keys)return e.keys().length;var t=0;for(var i in e)P(e,i)&&t++;return t}return e.length}function z(e){return!isNaN(parseFloat(e))&&isFinite(e)}function X(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=document.querySelectorAll(\".gbtn[data-taborder]:not(.disabled)\");if(!t.length)return!1;if(1==t.length)return t[0];\"string\"==typeof e&&(e=parseInt(e));var i=[];r(t,(function(e){i.push(e.getAttribute(\"data-taborder\"))}));var n=Math.max.apply(Math,i.map((function(e){return parseInt(e)}))),s=e<0?1:e+1;s>n&&(s=\"1\");var l=i.filter((function(e){return e>=parseInt(s)})),o=l.sort()[0];return document.querySelector('.gbtn[data-taborder=\"'.concat(o,'\"]'))}function Y(e){if(e.events.hasOwnProperty(\"keyboard\"))return!1;e.events.keyboard=h(\"keydown\",{onElement:window,withCallback:function(t,i){var n=(t=t||window.event).keyCode;if(9==n){var s=document.querySelector(\".gbtn.focused\");if(!s){var l=!(!document.activeElement||!document.activeElement.nodeName)&&document.activeElement.nodeName.toLocaleLowerCase();if(\"input\"==l||\"textarea\"==l||\"button\"==l)return}t.preventDefault();var o=document.querySelectorAll(\".gbtn[data-taborder]\");if(!o||o.length<=0)return;if(!s){var r=X();return void(r&&(r.focus(),d(r,\"focused\")))}var a=X(s.getAttribute(\"data-taborder\"));c(s,\"focused\"),a&&(a.focus(),d(a,\"focused\"))}39==n&&e.nextSlide(),37==n&&e.prevSlide(),27==n&&e.close()}})}var q=i((function t(i,n){var s=this,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(e(this,t),this.img=i,this.slide=n,this.onclose=l,this.img.setZoomEvents)return!1;this.active=!1,this.zoomedIn=!1,this.dragging=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.img.addEventListener(\"mousedown\",(function(e){return s.dragStart(e)}),!1),this.img.addEventListener(\"mouseup\",(function(e){return s.dragEnd(e)}),!1),this.img.addEventListener(\"mousemove\",(function(e){return s.drag(e)}),!1),this.img.addEventListener(\"click\",(function(e){return s.slide.classList.contains(\"dragging-nav\")?(s.zoomOut(),!1):s.zoomedIn?void(s.zoomedIn&&!s.dragging&&s.zoomOut()):s.zoomIn()}),!1),this.img.setZoomEvents=!0}),[{key:\"zoomIn\",value:function(){var e=this.widowWidth();if(!(this.zoomedIn||e<=768)){var t=this.img;if(t.setAttribute(\"data-style\",t.getAttribute(\"style\")),t.style.maxWidth=t.naturalWidth+\"px\",t.style.maxHeight=t.naturalHeight+\"px\",t.naturalWidth>e){var i=e/2-t.naturalWidth/2;this.setTranslate(this.img.parentNode,i,0)}this.slide.classList.add(\"zoomed\"),this.zoomedIn=!0}}},{key:\"zoomOut\",value:function(){this.img.parentNode.setAttribute(\"style\",\"\"),this.img.setAttribute(\"style\",this.img.getAttribute(\"data-style\")),this.slide.classList.remove(\"zoomed\"),this.zoomedIn=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.onclose&&\"function\"==typeof this.onclose&&this.onclose()}},{key:\"dragStart\",value:function(e){e.preventDefault(),this.zoomedIn?(\"touchstart\"===e.type?(this.initialX=e.touches[0].clientX-this.xOffset,this.initialY=e.touches[0].clientY-this.yOffset):(this.initialX=e.clientX-this.xOffset,this.initialY=e.clientY-this.yOffset),e.target===this.img&&(this.active=!0,this.img.classList.add(\"dragging\"))):this.active=!1}},{key:\"dragEnd\",value:function(e){var t=this;e.preventDefault(),this.initialX=this.currentX,this.initialY=this.currentY,this.active=!1,setTimeout((function(){t.dragging=!1,t.img.isDragging=!1,t.img.classList.remove(\"dragging\")}),100)}},{key:\"drag\",value:function(e){this.active&&(e.preventDefault(),\"touchmove\"===e.type?(this.currentX=e.touches[0].clientX-this.initialX,this.currentY=e.touches[0].clientY-this.initialY):(this.currentX=e.clientX-this.initialX,this.currentY=e.clientY-this.initialY),this.xOffset=this.currentX,this.yOffset=this.currentY,this.img.isDragging=!0,this.dragging=!0,this.setTranslate(this.img,this.currentX,this.currentY))}},{key:\"onMove\",value:function(e){if(this.zoomedIn){var t=e.clientX-this.img.naturalWi
18dth/2,i=e.clientY-this.img.naturalHeight/2;this.setTranslate(this.img,t,i)}}},{key:\"setTranslate\",value:function(e,t,i){e.style.transform=\"translate3d(\"+t+\"px, \"+i+\"px, 0)\"}},{key:\"widowWidth\",value:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}}]),N=i((function t(){var i=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e(this,t);var s=n.dragEl,l=n.toleranceX,o=void 0===l?40:l,r=n.toleranceY,a=void 0===r?65:r,h=n.slide,d=void 0===h?null:h,c=n.instance,u=void 0===c?null:c;this.el=s,this.active=!1,this.dragging=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.direction=null,this.lastDirection=null,this.toleranceX=o,this.toleranceY=a,this.toleranceReached=!1,this.dragContainer=this.el,this.slide=d,this.instance=u,this.el.addEventListener(\"mousedown\",(function(e){return i.dragStart(e)}),!1),this.el.addEventListener(\"mouseup\",(function(e){return i.dragEnd(e)}),!1),this.el.addEventListener(\"mousemove\",(function(e){return i.drag(e)}),!1)}),[{key:\"dragStart\",value:function(e){if(this.slide.classList.contains(\"zoomed\"))this.active=!1;else{\"touchstart\"===e.type?(this.initialX=e.touches[0].clientX-this.xOffset,this.initialY=e.touches[0].clientY-this.yOffset):(this.initialX=e.clientX-this.xOffset,this.initialY=e.clientY-this.yOffset);var t=e.target.nodeName.toLowerCase();e.target.classList.contains(\"nodrag\")||g(e.target,\".nodrag\")||-1!==[\"input\",\"select\",\"textarea\",\"button\",\"a\"].indexOf(t)?this.active=!1:(e.preventDefault(),(e.target===this.el||\"img\"!==t&&g(e.target,\".gslide-inline\"))&&(this.active=!0,this.el.classList.add(\"dragging\"),this.dragContainer=g(e.target,\".ginner-container\")))}}},{key:\"dragEnd\",value:function(e){var t=this;e&&e.preventDefault(),this.initialX=0,this.initialY=0,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.active=!1,this.doSlideChange&&(this.instance.preventOutsideClick=!0,\"right\"==this.doSlideChange&&this.instance.prevSlide(),\"left\"==this.doSlideChange&&this.instance.nextSlide()),this.doSlideClose&&this.instance.close(),this.toleranceReached||this.setTranslate(this.dragContainer,0,0,!0),setTimeout((function(){t.instance.preventOutsideClick=!1,t.toleranceReached=!1,t.lastDirection=null,t.dragging=!1,t.el.isDragging=!1,t.el.classList.remove(\"dragging\"),t.slide.classList.remove(\"dragging-nav\"),t.dragContainer.style.transform=\"\",t.dragContainer.style.transition=\"\"}),100)}},{key:\"drag\",value:function(e){if(this.active){e.preventDefault(),this.slide.classList.add(\"dragging-nav\"),\"touchmove\"===e.type?(this.currentX=e.touches[0].clientX-this.initialX,this.currentY=e.touches[0].clientY-this.initialY):(this.currentX=e.clientX-this.initialX,this.currentY=e.clientY-this.initialY),this.xOffset=this.currentX,this.yOffset=this.currentY,this.el.isDragging=!0,this.dragging=!0,this.doSlideChange=!1,this.doSlideClose=!1;var t=Math.abs(this.currentX),i=Math.abs(this.currentY);if(t>0&&t>=Math.abs(this.currentY)&&(!this.lastDirection||\"x\"==this.lastDirection)){this.yOffset=0,this.lastDirection=\"x\",this.setTranslate(this.dragContainer,this.currentX,0);var n=this.shouldChange();if(!this.instance.settings.dragAutoSnap&&n&&(this.doSlideChange=n),this.instance.settings.dragAutoSnap&&n)return this.instance.preventOutsideClick=!0,this.toleranceReached=!0,this.active=!1,this.instance.preventOutsideClick=!0,this.dragEnd(null),\"right\"==n&&this.instance.prevSlide(),void(\"left\"==n&&this.instance.nextSlide())}if(this.toleranceY>0&&i>0&&i>=t&&(!this.lastDirection||\"y\"==this.lastDirection)){this.xOffset=0,this.lastDirection=\"y\",this.setTranslate(this.dragContainer,0,this.currentY);var s=this.shouldClose();return!this.instance.settings.dragAutoSnap&&s&&(this.doSlideClose=!0),void(this.instance.settings.dragAutoSnap&&s&&this.instance.close())}}}},{key:\"shouldChange\",value:function(){var e=!1;if(Math.abs(this.currentX)>=this.toleranceX){var t=this.currentX>0?\"right\":\"left\";(\"left\"==t&&this.slide!==this.slide.parentNode.lastChild||\"right\"==t&&this.slide!==this.slide.parentNode.firstChild)&&(e=t)}return e}},{key:\"shouldClose\",value:function(){var e=!1;return Math.abs(this.currentY)>=this.toleranceY&&(e=!0),e}},{key:\"setTranslate\",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.style.transition=n?\"all .2s ease\":\"\",e.style.transform=\"translate3d(\".concat(t,\"px, \").concat(i,\"px, 0)\")}}]);function D(e,t,i,n){var s=e.querySelector(\".gslide-media\"),l=new Image,o=\"gSlideTitle_\"+i,r=\"gSlideDesc_\"+i;l.addEventListener(\"load\",(function(){C(n)&&n()}),!1),l.src=t.href,\"\"!=t.sizes&&\"\"!=t.srcset&&(l.sizes=t.sizes,l.srcset=t.srcset),l.alt=\"\",O(t.alt)||\"\"===t.alt||(l.alt=t.alt),\"\"!==t.title&&l.setAttribute(\"aria-labelledby\",o),\"\"!==t.description&&l.setAttribute(\"aria-describedby\",r),t.hasOwnProperty(\"_hasCustomWidth\")&&t._hasCustomWidth&&(l.style.width=t.width),t.hasOwnProperty(\"_hasCustomHeight\")&&t._hasCustomHeight&&(l.style.height=t.height),s.insertBefore(l,s.firstChild)}function _(e,t,i,n){var s=this,l=e.querySelector(\".ginner-container\"),o=\"gvideo\"+i,r=e.querySelector(\".gslide-media\"),a=this.getAllPlayers();d(l,\"gvideo-container\"),r.insertBefore(y('<div class=\"gvideo-wrapper\"></div>'),r.firstChild);var h=e.querySelector(\".gvideo-wrapper\");w(this.settings.plyr.css,\"Plyr\");var c=t.href,u=null==t?void 0:t.videoProvider,g=!1;r.style.maxWidth=t.width,w(this.settings.plyr.js,\"Plyr\",(function(){if(!u&&c.match(/vimeo\\.com\\/([0-9]*)/)&&(u=\"vimeo\"),!u&&(c.match(/(youtube\\.com|youtube-nocookie\\.com)\\/watch\\?v=([a-zA-Z0-9\\-_]+)/)||c.match(/youtu\\.be\\/([a-zA-Z0-9\\-_]+)/)||c.match(/(youtube\\.com|youtube-nocookie\\.com)\\/embed\\/([a-zA-Z0-9\\-_]+)/)||c.match(/(youtube\\.com|youtube-nocookie\\.com)\\/shorts\\/([a-zA-Z0-9\\-_]+)/))&&
18(u=\"youtube\"),\"local\"===u||!u){u=\"local\";var l='<video id=\"'+o+'\" ';l+='style=\"background:#000; max-width: '.concat(t.width,';\" '),l+='preload=\"metadata\" ',l+='x-webkit-airplay=\"allow\" ',l+=\"playsinline \",l+=\"controls \",l+='class=\"gvideo-local\">',l+='<source src=\"'.concat(c,'\">'),g=y(l+=\"</video>\")}var r=g||y('<div id=\"'.concat(o,'\" data-plyr-provider=\"').concat(u,'\" data-plyr-embed-id=\"').concat(c,'\"></div>'));d(h,\"\".concat(u,\"-video gvideo\")),h.appendChild(r),h.setAttribute(\"data-id\",o),h.setAttribute(\"data-index\",i);var v=P(s.settings.plyr,\"config\")?s.settings.plyr.config:{},f=new Plyr(\"#\"+o,v);f.on(\"ready\",(function(e){a[o]=e.detail.plyr,C(n)&&n()})),S((function(){return e.querySelector(\"iframe\")&&\"true\"==e.querySelector(\"iframe\").dataset.ready}),(function(){s.resize(e)})),f.on(\"enterfullscreen\",W),f.on(\"exitfullscreen\",W)}))}function W(e){var t=g(e.target,\".gslide-media\");\"enterfullscreen\"===e.type&&d(t,\"fullscreen\"),\"exitfullscreen\"===e.type&&c(t,\"fullscreen\")}function B(e,t,i,n){var s,l=this,o=e.querySelector(\".gslide-media\"),r=!(!P(t,\"href\")||!t.href)&&t.href.split(\"#\").pop().trim(),a=!(!P(t,\"content\")||!t.content)&&t.content;if(a&&(k(a)&&(s=y('<div class=\"ginlined-content\">'.concat(a,\"</div>\"))),E(a))){\"none\"==a.style.display&&(a.style.display=\"block\");var c=document.createElement(\"div\");c.className=\"ginlined-content\",c.appendChild(a),s=c}if(r){var u=document.getElementById(r);if(!u)return!1;var g=u.cloneNode(!0);g.style.height=t.height,g.style.maxWidth=t.width,d(g,\"ginlined-content\"),s=g}if(!s)return console.error(\"Unable to append inline slide content\",t),!1;o.style.height=t.height,o.style.width=t.width,o.appendChild(s),this.events[\"inlineclose\"+r]=h(\"click\",{onElement:o.querySelectorAll(\".gtrigger-close\"),withCallback:function(e){e.preventDefault(),l.close()}}),C(n)&&n()}function H(e,t,i,n){var s=e.querySelector(\".gslide-media\"),l=function(e){var t=e.url,i=e.allow,n=e.callback,s=e.appendTo,l=document.createElement(\"iframe\");return l.className=\"vimeo-video gvideo\",l.src=t,l.style.width=\"100%\",l.style.height=\"100%\",i&&l.setAttribute(\"allow\",i),l.onload=function(){l.onload=null,d(l,\"node-ready\"),C(n)&&n()},s&&s.appendChild(l),l}({url:t.href,callback:n});s.parentNode.style.maxWidth=t.width,s.parentNode.style.height=t.height,s.appendChild(l)}var j=i((function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e(this,t),this.defaults={href:\"\",sizes:\"\",srcset:\"\",title:\"\",type:\"\",videoProvider:\"\",description:\"\",alt:\"\",descPosition:\"bottom\",effect:\"\",width:\"\",height:\"\",content:!1,zoomable:!0,draggable:!0},I(i)&&(this.defaults=o(this.defaults,i))}),[{key:\"sourceType\",value:function(e){var t=e;return null!==(e=e.toLowerCase()).match(/\\.(jpeg|jpg|jpe|gif|png|apn|webp|avif|svg)/)?\"image\":e.match(/(youtube\\.com|youtube-nocookie\\.com)\\/watch\\?v=([a-zA-Z0-9\\-_]+)/)||e.match(/youtu\\.be\\/([a-zA-Z0-9\\-_]+)/)||e.match(/(youtube\\.com|youtube-nocookie\\.com)\\/embed\\/([a-zA-Z0-9\\-_]+)/)||e.match(/(youtube\\.com|youtube-nocookie\\.com)\\/shorts\\/([a-zA-Z0-9\\-_]+)/)||e.match(/vimeo\\.com\\/([0-9]*)/)||null!==e.match(/\\.(mp4|ogg|webm|mov)/)?\"video\":null!==e.match(/\\.(mp3|wav|wma|aac|ogg)/)?\"audio\":e.indexOf(\"#\")>-1&&\"\"!==t.split(\"#\").pop().trim()?\"inline\":e.indexOf(\"goajax=true\")>-1?\"ajax\":\"external\"}},{key:\"parseConfig\",value:function(e,t){var i=this,n=o({descPosition:t.descPosition},this.defaults);if(I(e)&&!E(e)){P(e,\"type\")||(P(e,\"content\")&&e.content?e.type=\"inline\":P(e,\"href\")&&(e.type=this.sourceType(e.href)));var s=o(n,e);return this.setSize(s,t),s}var l=\"\",a=e.getAttribute(\"data-glightbox\"),h=e.nodeName.toLowerCase();if(\"a\"===h&&(l=e.href),\"img\"===h&&(l=e.src,n.alt=e.alt),n.href=l,r(n,(function(s,l){P(t,l)&&\"width\"!==l&&(n[l]=t[l]);var o=e.dataset[l];O(o)||(n[l]=i.sanitizeValue(o))})),n.content&&(n.type=\"inline\"),!n.type&&l&&(n.type=this.sourceType(l)),O(a)){if(!n.title&&\"a\"==h){var d=e.title;O(d)||\"\"===d||(n.title=d)}if(!n.title&&\"img\"==h){var c=e.alt;O(c)||\"\"===c||(n.title=c)}}else{var u=[];r(n,(function(e,t){u.push(\";\\\\s?\"+t)})),u=u.join(\"\\\\s?:|\"),\"\"!==a.trim()&&r(n,(function(e,t){var s=a,l=new RegExp(\"s?\"+t+\"s?:s?(.*?)(\"+u+\"s?:|$)\"),o=s.match(l);if(o&&o.length&&o[1]){var r=o[1].trim().replace(/;\\s*$/,\"\");
18n[t]=i.sanitizeValue(r)}}))}if(n.description&&\".\"===n.description.substring(0,1)){var g;try{g=document.querySelector(n.description).innerHTML}catch(e){if(!(e instanceof DOMException))throw e}g&&(n.description=g)}if(!n.description){var v=e.querySelector(\".glightbox-desc\");v&&(n.description=v.innerHTML)}return this.setSize(n,t,e),this.slideConfig=n,n}},{key:\"setSize\",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=\"video\"==e.type?this.checkSize(t.videosWidth):this.checkSize(t.width),s=this.checkSize(t.height);return e.width=P(e,\"width\")&&\"\"!==e.width?this.checkSize(e.width):n,e.height=P(e,\"height\")&&\"\"!==e.height?this.checkSize(e.height):s,i&&\"image\"==e.type&&(e._hasCustomWidth=!!i.dataset.width,e._hasCustomHeight=!!i.dataset.height),e}},{key:\"checkSize\",value:function(e){return z(e)?\"\".concat(e,\"px\"):e}},{key:\"sanitizeValue\",value:function(e){return\"true\"!==e&&\"false\"!==e?e:\"true\"===e}}]),V=i((function t(i,n,s){e(this,t),this.element=i,this.instance=n,this.index=s}),[{key:\"setContent\",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(u(t,\"loaded\"))return!1;var n=this.instance.settings,s=this.slideConfig,l=T();C(n.beforeSlideLoad)&&n.beforeSlideLoad({index:this.index,slide:t,player:!1});var o=s.type,r=s.descPosition,a=t.querySelector(\".gslide-media\"),h=t.querySelector(\".gslide-title\"),c=t.querySelector(\".gslide-desc\"),g=t.querySelector(\".gdesc-inner\"),v=i,f=\"gSlideTitle_\"+this.index,p=\"gSlideDesc_\"+this.index;if(C(n.afterSlideLoad)&&(v=function(){C(i)&&i(),n.afterSlideLoad({index:e.index,slide:t,player:e.instance.getSlidePlayerInstance(e.index)})}),\"\"==s.title&&\"\"==s.description?g&&g.parentNode.parentNode.removeChild(g.parentNode):(h&&\"\"!==s.title?(h.id=f,h.innerHTML=s.title):h.parentNode.removeChild(h),c&&\"\"!==s.description?(c.id=p,l&&n.moreLength>
180?(s.smallDescription=this.slideShortDesc(s.description,n.moreLength,n.moreText),c.innerHTML=s.smallDescription,this.descriptionEvents(c,s)):c.innerHTML=s.description):c.parentNode.removeChild(c),d(a.parentNode,\"desc-\".concat(r)),d(g.parentNode,\"description-\".concat(r))),d(a,\"gslide-\".concat(o)),d(t,\"loaded\"),\"video\"!==o){if(\"external\"!==o)return\"inline\"===o?(B.apply(this.instance,[t,s,this.index,v]),void(s.draggable&&new N({dragEl:t.querySelector(\".gslide-inline\"),toleranceX:n.dragToleranceX,toleranceY:n.dragToleranceY,slide:t,instance:this.instance}))):void(\"image\"!==o?C(v)&&v():D(t,s,this.index,(function(){var i=t.querySelector(\"img\");s.draggable&&new N({dragEl:i,toleranceX:n.dragToleranceX,toleranceY:n.dragToleranceY,slide:t,instance:e.instance}),s.zoomable&&i.naturalWidth>i.offsetWidth&&(d(i,\"zoomable\"),new q(i,t,(function(){e.instance.resize()}))),C(v)&&v()})));H.apply(this,[t,s,this.index,v])}else _.apply(this.instance,[t,s,this.index,v])}},{key:\"slideShortDesc\",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=document.createElement(\"div\");n.innerHTML=e;var s=n.innerText,l=i;if((e=s.trim()).length<=t)return e;var o=e.substr(0,t-1);return l?(n=null,o+'... <a href=\"#\" class=\"desc-more\">'+i+\"</a>\"):o}},{key:\"descriptionEvents\",value:function(e,t){var i=this,n=e.querySelector(\".desc-more\");if(!n)return!1;h(\"click\",{onElement:n,withCallback:function(e,n){e.preventDefault();var s=document.body,l=g(n,\".gslide-desc\");if(!l)return!1;l.innerHTML=t.description,d(s,\"gdesc-open\");var o=h(\"click\",{onElement:[s,g(l,\".gslide-description\")],withCallback:function(e,n){\"a\"!==e.target.nodeName.toLowerCase()&&(c(s,\"gdesc-open\"),d(s,\"gdesc-closed\"),l.innerHTML=t.smallDescription,i.descriptionEvents(l,t),setTimeout((function(){c(s,\"gdesc-closed\")}),400),o.destroy())}})}})}},{key:\"create\",value:function(){return y(this.instance.settings.slideHTML)}},{key:\"getConfig\",value:function(){E(this.element)||this.element.hasOwnProperty(\"draggable\")||(this.element.draggable=this.instance.settings.draggable);var e=new j(this.instance.settings.slideExtraAttributes);return this.slideConfig=e.parseConfig(this.element,this.instance.settings),this.slideConfig}}]);function F(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function R(e,t){var i=function(e,t){var i=F(e)*F(t);if(0===i)return 0;var n=function(e,t){return e.x*t.x+e.y*t.y}(e,t)/i;return n>1&&(n=1),Math.acos(n)}(e,t);return function(e,t){return e.x*t.y-t.x*e.y}(e,t)>0&&(i*=-1),180*i/Math.PI}var G=i((function t(i){e(this,t),this.handlers=[],this.el=i}),[{key:\"add\",value:function(e){this.handlers.push(e)}},{key:\"del\",value:function(e){e||(this.handlers=[]);for(var t=this.handlers.length;t>=0;t--)this.handlers[t]===e&&this.handlers.splice(t,1)}},{key:\"dispatch\",value:function(){for(var e=0,t=this.handlers.length;e<t;e++){var i=this.handlers[e];\"function\"==typeof i&&i.apply(this.el,arguments)}}}]);function Z(e,t){var i=new G(e);return i.add(t),i}var U=i((function t(i,n){e(this,t),this.element=\"string\"==typeof i?document.querySelector(i):i,this.start=this.start.bind(this),this.move=this.move.bind(this),this.end=this.end.bind(this),this.cancel=this.cancel.bind(this),this.element.addEventListener(\"touchstart\",this.start,!1),this.element.addEventListener(\"touchmove\",this.move,!1),this.element.addEventListener(\"touchend\",this.end,!1),this.element.addEventListener(\"touchcancel\",this.cancel,!1),this.preV={x:null,y:null},this.pinchStartLen=null,this.zoom=1,this.isDoubleTap=!1;var s=function(){};this.rotate=Z(this.element,n.rotate||s),this.touchStart=Z(this.element,n.touchStart||s),this.multipointStart=Z(this.element,n.multipointStart||s),this.multipointEnd=Z(this.element,n.multipointEnd||s),this.pinch=Z(this.element,n.pinch||s),this.swipe=Z(this.element,n.swipe||s),this.tap=Z(this.element,n.tap||s),this.doubleTap=Z(this.element,n.doubleTap||s),this.longTap=Z(this.element,n.longTap||s),this.singleTap=Z(this.element,n.singleTap||s),this.pressMove=Z(this.element,n.pressMove||s),this.twoFingerPressMove=Z(this.element,n.twoFingerPressMove||s),this.touchMove=Z(this.element,n.touchMove||s),this.touchEnd=Z(this.element,n.touchEnd||s),this.touchCancel=Z(this.element,n.touchCancel||s),this.translateContainer=this.element,this._cancelAllHandler=this.cancelAll.bind(this),window.addEventListener(\"scroll\",this._cancelAllHandler),this.delta=null,this.last=null,this.now=null,this.tapTimeout=null,this.singleTapTimeout=null,this.longTapTimeout=null,this.swipeTimeout=null,this.x1=this.x2=this.y1=this.y2=null,this.preTapPosition={x:null,y:null}}),[{key:\"start\",value:function(e){if(e.touches)if(e.target&&e.target.nodeName&&[\"a\",\"button\",\"input\"].indexOf(e.target.nodeName.toLowerCase())>=0)console.log(\"ignore drag for this touched element\",e.target.nodeName.toLowerCase());else{this.now=Date.now(),this.x1=e.touches[0].pageX,this.y1=e.touches[0].pageY,this.delta=this.now-(this.last||this.now),this.touchStart.dispatch(e,this.element),null!==this.preTapPosition.x&&(this.isDoubleTap=this.delta>0&&this.delta<=250&&Math.abs(this.preTapPosition.x-this.x1)<30&&Math.abs(this.preTapPosition.y-this.y1)<30,this.isDoubleTap&&clearTimeout(this.singleTapTimeout)),this.preTapPosition.x=this.x1,this.preTapPosition.y=this.y1,this.last=this.now;var t=this.preV;if(e.touches.length>1){this._cancelLongTap(),this._cancelSingleTap();var i={x:e.touches[1].pageX-this.x1,y:e.touches[1].pageY-this.y1};t.x=i.x,t.y=i.y,this.pinchStartLen=F(t),this.multipointStart.dispatch(e,this.element)}this._preventTap=!1,this.longTapTimeout=setTimeout(function(){this.longTap.dispatch(e,this.element),this._preventTap=!0}.bind(this),750)}}},{key:\"move\",value:function(e){if(e.touches){var t=this.preV,i=e.touches.length,n=e.touches[0].pageX,s=e.touches[0].pageY;if(this.isDoubleTap=!1,i>1){var l=e.touches[1].pageX,o=e.touches[1].pageY,r={x:e.touches[1].pageX-n,y:e.touches[1].pageY-s};null!==t.x&&(this.pinchStartLen>0&&(e.zoom=F(r)/this.pinchStartLen,this.pinch.dispatch(e,this.element)),e.angle=R(r,t),this.rotate.dispatch(e,this.element)),t.x=r.x,t.y=r.y,null!==this.x2&&null!==this.sx2?(e.deltaX=(n-this.x2+l-this.sx2)/2,e.deltaY=(s-this.y2+o-this.sy2)/2):(e.deltaX=0,e.deltaY=0),this.twoFingerPressMove.dispatch(e,this.element),this.sx2=l,this.sy2=o}else{if(null!==this.x2){e.deltaX=n-this.x2,e.deltaY=s-this.y2;var a=Math.abs(this.x1-this.x2),h=Math.abs(this.y1-this.y2);(a>10||h>10)&&(this._preventTap=!0)}else e.deltaX=0,e.deltaY=0;this.pressMove.dispatch(e,this.element)}this.touchMove.dispatch(e,this.element),this._cancelLongTap(),this.x2=n,this.y2=s,i>1&&e.preventDefault()}}},{key:\"end\",value:function(e){if(e.changedTouches){this._cancelLongTap();var t=this;e.touches.length<2&&(this.multipointEnd.dispatch(e,this.element),this.sx2=this.sy2=null),this.x2&&Math.abs(this.x1-this.x2)>30||this.y2&&Math.abs(this.y1-this.y2)>30?(e.direction=this._swipeDirection(this.x1,this.x2,this.y1,this.y2),this.swipeTimeout=setTimeout((function(){t.swipe.dispatch(e,t.element)}),0)):(this.tapTimeout=setTimeout((function(){t._preventTap||t.tap.dispatch(e,t.element),t.isDoubleTap&&(t.doubleTap.dispatch(e,t.element),t.isDoubleTap=!1)}),0),t.isDoubleTap||(t.singleTapTimeout=setTimeout((function(){t.singleTap.dispatch(e,t.element)}),250))),this.touchEnd.dispatch(e,this.element),this.preV.x=0,this.preV.y=0,this.zoom=1,this.pinchStartLen=null,this.x1=this.x2=this.y1=this.y2=null}}},{key:\"cancelAll\",value:function(){this._preventTap=!0,clearTimeout(this.singleTapTimeout),clearTimeout(this.tapTimeout),clearTimeout(this.longTapTimeout),clearTimeout(this.swipeTimeout)}},{key:\"cancel\",value:function(e){this.cancelAll(),this.touchCancel.dispatch(e,this.element)}},{key:\"_cancelLongTap\",value:function(){clearTimeout(this.longTapTimeout)}},{key:\"_cancelSingleTap\",value:function(){clearTimeout(this.singleTapTimeout)}},{key:\"_swipeDirection\",value:function(e,t,i,n){return Math.abs(e-t)>=Math.abs(i-n)?e-t>0?\"Left\":\"Right\":i-n>0?\"Up\":\"Down\"}},{key:\"on\",value:function(e,t){this[e]&&this[e].add(t)}},{key:\"off\",value:function(e,t){this[e]&&this[e].del(t)}},{key:\"destroy\",value:function(){return this.singleTapTimeout&&clearTimeout(this.singleTapTimeout),this.tapTimeout&&clearTimeout(this.tapTimeout),this.longTapTimeout&&clearTimeout(this.longTapTimeout),this.swipeTimeout&&clearTimeout(this.swipeTimeout),this.element.removeEventListener(\"touchstart\",this.start),this.element.removeEventListener(\"touchmove\",this.move),this.element.removeEventListener(\"touchend\",this.end),this.element.removeEventListener(\"touchcancel\",this.cancel),this.rotate.del(),this.touchStart.del(),this.multipointStart.del(),this.multipointEnd.del(),this.pinch.del(),this.swipe.del(),this.tap.del(),this.doubleTap.del(),this.longTap.del(),this.singleTap.del(),this.pressMove.del(),this.twoFingerPressMove.del(),this.touchMove.del(),this.touchEnd.del(),this.touchCancel.del(),this.preV=this.pinchStartLen=this.zoom=this.isDoubleTap=this.delta=this.last=this.now=this.tapTimeout=this.singleTapTimeout=this.longTapTimeout=this.swipeTimeout=this.x1=this.x2=this.y1=this.y2=this.preTapPosition=this.rotate=this.touchStart=this.multipointStart=this.multipointEnd=this.pinch=this.swipe=this.tap=this.doubleTap=this.longTap=this.singleTap=this.pressMove=this.touchMove=this.touchEnd=this.touchCancel=this.twoFingerPressMove=null,window.removeEventListener(\"scroll\",this._cancelAllHandler),null}}]);function $(e){var t=function(){var e,t=document.createElement(\"fakeelement\"),i={transition:\"transitionend\",OTransition:\"oTransitionEnd\",MozTransition:\"transitionend\",WebkitTransition:\"webkitTransitionEnd\"};for(e in i)if(void 0!==t.style[e])return i[e]}(),i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=u(e,\"gslide-media\")?e:e.querySelector(\".gslide-media\"),s=g(n,\".ginner-container\"),l=e.querySelector(\".gslide-description\");i>769&&(n=s),d(n,\"greset\"),f(n,\"translate3d(0, 0, 0)\"),h(t,{onElement:n,once:!0,withCallback:function(e,t){c(n,\"greset\")}}),n.style.opacity=\"\",l&&(l.style.opacity=\"\")}function J(e){if(e.events.hasOwnProperty(\"touch\"))return!1;var t,i,n,s=x(),l=s.width,o=s.height,r=!1,a=null,h=null,v=null,p=!1,m=1,y=1,b=!1,S=!1,w=null,T=null,C=null,k=null,E=0,A=0,L=!1,I=!1,O={},P={},M=0,z=0,X=document.getElementById(\"glightbox-slider\"),Y=document.querySelector(\".goverlay\"),q=new U(X,{touchStart:function(t){if(r=!0,(u(t.targetTouches[0].target,\"ginner-container\")||g(t.targetTouches[0].target,\".gslide-desc\")||\"a\"==t.targetTouches[0].target.nodeName.toLowerCase())&&(r=!1),g(t.targetTouches[0].target,\".gslide-inline\")&&!u(t.targetTouches[0].target.parentNode,\"gslide-inline\")&&(r=!1),r){if(P=t.targetTouches[0],O.pageX=t.targetTouches[0].pageX,O.pageY=t.targetTouches[0].pageY,M=t.targetTouches[0].clientX,z=t.targetTouches[0].clientY,a=e.activeSlide,h=a.querySelector(\".gslide-media\"),n=a.querySelector(\".gslide-inline\"),v=null,u(h,\"gslide-image\")&&(v=h.querySelector(\"img\")),(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>769&&(h=a.querySelector(\".ginner-container\")),c(Y,\"greset\"),t.pageX>20&&t.pageX<window.innerWidth-20)return;t.preventDefault()}},touchMove:function(s){if(r&&(P=s.targetTouches[0],!b&&!S)){if(n&&n.offsetHeight>o){var a=O.pageX-P.pageX;if(Math.abs(a)<=13)return!1}p=!0;var d,c=s.targetTouches[0].clientX,u=s.targetTouches[0].clientY,g=M-c,m=z-u;if(Math.abs(g)>Math.abs(m)?(L=!1,I=!0):(I=!1,L=!0),t=P.pageX-O.pageX,E=100*t/l,i=P.pageY-O.pageY,A=100*i/o,L&&v&&(d=1-Math.abs(i)/o,Y.style.opacity=d,e.settings.touchFollowAxis&&(E=0)),I&&(d=1-Math.abs(t)/l,h.style.opacity=d,e.settings.touchFollowAxis&&(A=0)),!v)return f(h,\"translate3d(\".concat(E,\"%, 0, 0)\"));f(h,\"translate3d(\".concat(E,\"%, \").concat(A,\"%, 0)\"))}},touchEnd:function(){if(r){if(p=!1,S||b)return C=w,void(k=T);var t=Math.abs(parseInt(A)),i=Math.abs(parseInt(E));if(!(t>29&&v))return t<29&&i<25?(d(Y,\"greset\"),Y.style.opacity=1,$(h)):void 0;e.close()}},multipointEnd:function(){setTimeout((function(){b=!1}),50)},multipointStart:function(){b=!0,m=y||1},pinch:function(e){if(!v||p)return!1;b=!0,v.scaleX=v.scaleY=m*e.zoom;var t=m*e.zoom;if(S=!0,t<=1)return S=!1,t=1,k=null,C=null,w=null,T=null,void v.setAttribute(\"style\",\"\");t>4.5&&(t=4.5),v.style.transform=\"scale3d(\".concat(t,\", \").concat(t,\", 1)\"),y=t},pressMove:function(e){if(S&&!b){var t=P.pageX-O.pageX,i=P.pageY-O.pageY;C&&(t+=C),k&&(i+=k),w=t,T=i;var n=\"translate3d(\".concat(t,\"px, \").concat(i,\"px, 0)\");y&&(n+=\" scale3d(\".concat(y,\", \").concat(y,\", 1)\")),f(v,n)}},swipe:function(t){if(!S)if(b)b=!1;else{if(\"Left\"==t.direction){if(e.index==e.elements.length-1)return $(h);e.nextSlide()}if(\"Right\"==t.direction){if(0==e.index)return $(h);e.prevSlide()}}}});e.events.touch=q}var K=T(),Q=null!==T()||void 0!==document.createTouch||\"ontouchstart\"in window||\"onmsgesturechange\"in window||navigator.msMaxTouchPoints,ee=document.getElementsByTagName(\"html\")[0],te={selector:\".glightbox\",elements:null,skin:\"clean\",theme:\"clean\",closeButton:!0,startAt:null,autoplayVideos:!0,autofocusVideos:!0,descPosition:\"bottom\",width:\"900px\",height:\"506px\",videosWidth:\"960px\",beforeSlideChange:null,afterSlideChange:null,beforeSlideLoad:null,afterSlideLoad:null,
18slideInserted:null,slideRemoved:null,slideExtraAttributes:null,onOpen:null,onClose:null,loop:!1,zoomable:!0,draggable:!0,dragAutoSnap:!1,dragToleranceX:40,dragToleranceY:65,preload:!0,oneSlidePerOpen:!1,touchNavigation:!0,touchFollowAxis:!0,keyboardNavigation:!0,closeOnOutsideClick:!0,plugins:!1,plyr:{css:\"https://cdn.plyr.io/3.6.12/plyr.css\",js:\"https://cdn.plyr.io/3.6.12/plyr.js\",config:{ratio:\"16:9\",fullscreen:{enabled:!0,iosNative:!0},youtube:{noCookie:!0,rel:0,showinfo:0,iv_load_policy:3},vimeo:{byline:!1,portrait:!1,title:!1,transparent:!1}}},openEffect:\"zoom\",closeEffect:\"zoom\",slideEffect:\"slide\",moreText:\"See more\",moreLength:60,cssEfects:{fade:{in:\"fadeIn\",out:\"fadeOut\"},zoom:{in:\"zoomIn\",out:\"zoomOut\"},slide:{in:\"slideInRight\",out:\"slideOutLeft\"},slideBack:{in:\"slideInLeft\",out:\"slideOutRight\"},none:{in:\"none\",out:\"none\"}},svg:{close:'<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 512 512\" xml:space=\"preserve\"><g><g><path d=\"M505.943,6.058c-8.077-8.077-21.172-8.077-29.249,0L6.058,476.693c-8.077,8.077-8.077,21.172,0,29.249C10.096,509.982,15.39,512,20.683,512c5.293,0,10.586-2.019,14.625-6.059L505.943,35.306C514.019,27.23,514.019,14.135,505.943,6.058z\"/></g></g><g><g><path d=\"M505.942,476.694L35.306,6.059c-8.076-8.077-21.172-8.077-29.248,0c-8.077,8.076-8.077,21.171,0,29.248l470.636,470.636c4.038,4.039,9.332,6.058,14.625,6.058c5.293,0,10.587-2.019,14.624-6.057C514.018,497.866,514.018,484.771,505.942,476.694z\"/></g></g></svg>',next:'<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 477.175 477.175\" xml:space=\"preserve\"> <g><path d=\"M360.731,229.075l-225.1-225.1c-5.3-5.3-13.8-5.3-19.1,0s-5.3,13.8,0,19.1l215.5,215.5l-215.5,215.5c-5.3,5.3-5.3,13.8,0,19.1c2.6,2.6,6.1,4,9.5,4c3.4,0,6.9-1.3,9.5-4l225.1-225.1C365.931,242.875,365.931,234.275,360.731,229.075z\"/></g></svg>',prev:'<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 477.175 477.175\" xml:space=\"preserve\"><g><path d=\"M145.188,238.575l215.5-215.5c5.3-5.3,5.3-13.8,0-19.1s-13.8-5.3-19.1,0l-225.1,225.1c-5.3,5.3-5.3,13.8,0,19.1l225.1,225c2.6,2.6,6.1,4,9.5,4s6.9-1.3,9.5-4c5.3-5.3,5.3-13.8,0-19.1L145.188,238.575z\"/></g></svg>'},slideHTML:'<div class=\"gslide\">\\n <div class=\"gslide-inner-content\">\\n <div class=\"ginner-container\">\\n <div class=\"gslide-media\">\\n </div>\\n <div class=\"gslide-description\">\\n <div class=\"gdesc-inner\">\\n <h4 class=\"gslide-title\"></h4>\\n <div class=\"gslide-desc\"></div>\\n </div>\\n </div>\\n </div>\\n </div>\\n</div>',lightboxHTML:'<div id=\"glightbox-body\" class=\"glightbox-container\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"false\">\\n <div class=\"gloader visible\"></div>\\n <div class=\"goverlay\"></div>\\n <div class=\"gcontainer\">\\n <div id=\"glightbox-slider\" class=\"gslider\"></div>\\n <button class=\"gclose gbtn\" aria-label=\"Close\" data-taborder=\"3\">{closeSVG}</button>\\n <button class=\"gprev gbtn\" aria-label=\"Previous\" data-taborder=\"2\">{prevSVG}</button>\\n <button class=\"gnext gbtn\" aria-label=\"Next\" data-taborder=\"1\">{nextSVG}</button>\\n</div>\\n</div>'},ie=i((function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e(this,t),this.customOptions=i,this.settings=o(te,i),this.effectsClasses=this.getAnimationClasses(),this.videoPlayers={},this.apiEvents=[],this.fullElementsList=!1}),[{key:\"init\",value:function(){var e=this,t=this.getSelector();t&&(this.baseEvents=h(\"click\",{onElement:t,withCallback:function(t,i){t.preventDefault(),e.open(i)}})),this.elements=this.getElements()}},{key:\"open\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(0===this.elements.length)return!1;this.activeSlide=null,this.prevActiveSlideIndex=null,this.prevActiveSlide=null;var i=z(t)?t:this.settings.startAt;if(E(e)){var n=e.getAttribute(\"data-gallery\");n&&(this.fullElementsList=this.elements,this.elements=this.getGalleryElements(this.elements,n)),O(i)&&(i=this.getElementIndex(e))<0&&(i=0)}z(i)||(i=0),this.build(),v(this.overlay,\"none\"===this.settings.openEffect?\"none\":this.settings.cssEfects.fade.in);var s=document.body,l=window.innerWidth-document.documentElement.clientWidth;if(l>0){var o=document.createElement(\"style\");
18o.type=\"text/css\",o.className=\"gcss-styles\",o.innerText=\".gscrollbar-fixer {margin-right: \".concat(l,\"px}\"),document.head.appendChild(o),d(s,\"gscrollbar-fixer\")}d(s,\"glightbox-open\"),d(ee,\"glightbox-open\"),K&&(d(document.body,\"glightbox-mobile\"),this.settings.slideEffect=\"slide\"),this.showSlide(i,!0),1===this.elements.length?(d(this.prevButton,\"glightbox-button-hidden\"),d(this.nextButton,\"glightbox-button-hidden\")):(c(this.prevButton,\"glightbox-button-hidden\"),c(this.nextButton,\"glightbox-button-hidden\")),this.lightboxOpen=!0,this.trigger(\"open\"),C(this.settings.onOpen)&&this.settings.onOpen(),Q&&this.settings.touchNavigation&&J(this),this.settings.keyboardNavigation&&Y(this)}},{key:\"openAt\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.open(null,e)}},{key:\"showSlide\",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];p(this.loader),this.index=parseInt(t);var n=this.slidesContainer.querySelector(\".current\");n&&c(n,\"current\"),this.slideAnimateOut();var s=this.slidesContainer.querySelectorAll(\".gslide\")[t];if(u(s,\"loaded\"))this.slideAnimateIn(s,i),m(this.loader);else{p(this.loader);var l=this.elements[t],o={index:this.index,slide:s,slideNode:s,slideConfig:l.slideConfig,slideIndex:this.index,trigger:l.node,player:null};this.trigger(\"slide_before_load\",o),l.instance.setContent(s,(function(){m(e.loader),e.resize(),e.slideAnimateIn(s,i),e.trigger(\"slide_after_load\",o)}))}this.slideDescription=s.querySelector(\".gslide-description\"),this.slideDescriptionContained=this.slideDescription&&u(this.slideDescription.parentNode,\"gslide-media\"),this.settings.preload&&(this.preloadSlide(t+1),this.preloadSlide(t-1)),this.updateNavigationClasses(),this.activeSlide=s}},{key:\"preloadSlide\",value:function(e){var t=this;if(e<0||e>this.elements.length-1)return!1;if(O(this.elements[e]))return!1;var i=this.slidesContainer.querySelectorAll(\".gslide\")[e];if(u(i,\"loaded\"))return!1;var n=this.elements[e],s=n.type,l={index:e,slide:i,slideNode:i,slideConfig:n.slideConfig,slideIndex:e,trigger:n.node,player:null};this.trigger(\"slide_before_load\",l),\"video\"===s||\"external\"===s?setTimeout((function(){n.instance.setContent(i,(function(){t.trigger(\"slide_after_load\",l)}))}),200):n.instance.setContent(i,(function(){t.trigger(\"slide_after_load\",l)}))}},{key:\"prevSlide\",value:function(){this.goToSlide(this.index-1)}},{key:\"nextSlide\",value:function(){this.goToSlide(this.index+1)}},{key:\"goToSlide\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.prevActiveSlide=this.activeSlide,this.prevActiveSlideIndex=this.index,!this.loop()&&(e<0||e>this.elements.length-1))return!1;e<0?e=this.elements.length-1:e>=this.elements.length&&(e=0),this.showSlide(e)}},{key:\"insertSlide\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;t<0&&(t=this.elements.length);var i=new V(e,this,t),n=i.getConfig(),s=o({},n),l=i.create(),r=this.elements.length-1;s.index=t,s.node=!1,s.instance=i,s.slideConfig=n,this.elements.splice(t,0,s);var a=null,h=null;if(this.slidesContainer){if(t>r)this.slidesContainer.appendChild(l);else{var d=this.slidesContainer.querySelectorAll(\".gslide\")[t];this.slidesContainer.insertBefore(l,d)}(this.settings.preload&&0==this.index&&0==t||this.index-1==t||this.index+1==t)&&this.preloadSlide(t),0===this.index&&0===t&&(this.index=1),this.updateNavigationClasses(),a=this.slidesContainer.querySelectorAll(\".gslide\")[t],h=this.getSlidePlayerInstance(t),s.slideNode=a}this.trigger(\"slide_inserted\",{index:t,slide:a,slideNode:a,slideConfig:n,slideIndex:t,trigger:null,player:h}),C(this.settings.slideInserted)&&this.settings.slideInserted({index:t,slide:a,player:h})}},{key:\"removeSlide\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(e<0||e>this.elements.length-1)return!1;var t=this.slidesContainer&&this.slidesContainer.querySelectorAll(\".gslide\")[e];t&&(this.getActiveSlideIndex()==e&&(e==this.elements.length-1?this.prevSlide():this.nextSlide()),t.parentNode.removeChild(t)),this.elements.splice(e,1),this.trigger(\"slide_removed\",e),C(this.settings.slideRemoved)&&this.settings.slideRemoved(e)}},{key:\"slideAnimateIn\",value:function(e,t){var i=this,n=e.querySelector(\".gslide-media\"),s=e.querySelector(\".gslide-description\"),l={index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlide,slideConfig:O(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:O(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},o={index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideConfig:this.elements[this.index].slideConfig,slideIndex:this.index,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)};if(n.offsetWidth>0&&s&&(m(s),s.style.display=\"\"),c(e,this.effectsClasses),t)v(e,this.settings.cssEfects[this.settings.openEffect].in,(function(){i.settings.autoplayVideos&&i.slidePlayerPlay(e),i.trigger(\"slide_changed\",{prev:l,current:o}),C(i.settings.afterSlideChange)&&i.settings.afterSlideChange.apply(i,[l,o])}));else{var r=this.settings.slideEffect,a=\"none\"!==r?this.settings.cssEfects[r].in:r;this.prevActiveSlideIndex>this.index&&\"slide\"==this.settings.slideEffect&&(a=this.settings.cssEfects.slideBack.in),v(e,a,(function(){i.settings.autoplayVideos&&i.slidePlayerPlay(e),i.trigger(\"slide_changed\",{prev:l,current:o}),C(i.settings.afterSlideChange)&&i.settings.afterSlideChange.apply(i,[l,o])}))}setTimeout((function(){i.resize(e)}
18),100),d(e,\"current\")}},{key:\"slideAnimateOut\",value:function(){if(!this.prevActiveSlide)return!1;var e=this.prevActiveSlide;c(e,this.effectsClasses),d(e,\"prev\");var t=this.settings.slideEffect,i=\"none\"!==t?this.settings.cssEfects[t].out:t;this.slidePlayerPause(e),this.trigger(\"slide_before_change\",{prev:{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlideIndex,slideConfig:O(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:O(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},current:{index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideIndex:this.index,slideConfig:this.elements[this.index].slideConfig,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)}}),C(this.settings.beforeSlideChange)&&this.settings.beforeSlideChange.apply(this,[{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},{index:this.index,slide:this.activeSlide,player:this.getSlidePlayerInstance(this.index)}]),this.prevActiveSlideIndex>this.index&&\"slide\"==this.settings.slideEffect&&(i=this.settings.cssEfects.slideBack.out),v(e,i,(function(){var t=e.querySelector(\".ginner-container\"),i=e.querySelector(\".gslide-media\"),n=e.querySelector(\".gslide-description\");t.style.transform=\"\",i.style.transform=\"\",c(i,\"greset\"),i.style.opacity=\"\",n&&(n.style.opacity=\"\"),c(e,\"prev\")}))}},{key:\"getAllPlayers\",value:function(){return this.videoPlayers}},{key:\"getSlidePlayerInstance\",value:function(e){var t=\"gvideo\"+e,i=this.getAllPlayers();return!(!P(i,t)||!i[t])&&i[t]}},{key:\"stopSlideVideo\",value:function(e){if(E(e)){var t=e.querySelector(\".gvideo-wrapper\");t&&(e=t.getAttribute(\"data-index\"))}console.log(\"stopSlideVideo is deprecated, use slidePlayerPause\");var i=this.getSlidePlayerInstance(e);i&&i.playing&&i.pause()}},{key:\"slidePlayerPause\",value:function(e){if(E(e)){var t=e.querySelector(\".gvideo-wrapper\");t&&(e=t.getAttribute(\"data-index\"))}var i=this.getSlidePlayerInstance(e);i&&i.playing&&i.pause()}},{key:\"playSlideVideo\",value:function(e){if(E(e)){var t=e.querySelector(\".gvideo-wrapper\");t&&(e=t.getAttribute(\"data-index\"))}console.log(\"playSlideVideo is deprecated, use slidePlayerPlay\");var i=this.getSlidePlayerInstance(e);i&&!i.playing&&i.play()}},{key:\"slidePlayerPlay\",value:function(e){var t;if(!K||null!==(t=this.settings.plyr.config)&&void 0!==t&&t.muted){if(E(e)){var i=e.querySelector(\".gvideo-wrapper\");i&&(e=i.getAttribute(\"data-index\"))}var n=this.getSlidePlayerInstance(e);n&&!n.playing&&(n.play(),this.settings.autofocusVideos&&n.elements.container.focus())}}},{key:\"setElements\",value:function(e){var t=this;this.settings.elements=!1;var i=[];e&&e.length&&r(e,(function(e,n){var s=new V(e,t,n),l=s.getConfig(),r=o({},l);r.slideConfig=l,r.instance=s,r.index=n,i.push(r)})),this.elements=i,this.lightboxOpen&&(this.slidesContainer.innerHTML=\"\",this.elements.length&&(r(this.elements,(function(){var e=y(t.settings.slideHTML);t.slidesContainer.appendChild(e)})),this.showSlide(0,!0)))}},{key:\"getElementIndex\",value:function(e){var t=!1;return r(this.elements,(function(i,n){if(P(i,\"node\")&&i.node==e)return t=n,!0})),t}},{key:\"getElements\",value:function(){var e=this,t=[];this.elements=this.elements?this.elements:[],!O(this.settings.elements)&&A(this.settings.elements)&&this.settings.elements.length&&r(this.settings.elements,(function(i,n){var s=new V(i,e,n),l=s.getConfig(),r=o({},l);r.node=!1,r.index=n,r.instance=s,r.slideConfig=l,t.push(r)}));var i=!1;return this.getSelector()&&(i=document.querySelectorAll(this.getSelector())),i?(r(i,(function(i,n){var s=new V(i,e,n),l=s.getConfig(),r=o({},l);r.node=i,r.index=n,r.instance=s,r.slideConfig=l,r.gallery=i.getAttribute(\"data-gallery\"),t.push(r)})),t):t}},{key:\"getGalleryElements\",value:function(e,t){return e.filter((function(e){return e.gallery==t}))}},{key:\"getSelector\",value:function(){return!this.settings.elements&&(this.settings.selector&&\"data-\"==this.settings.selector.substring(0,5)?\"*[\".concat(this.settings.selector,\"]\"):this.settings.selector)}},{key:\"getActiveSlide\",value:function(){return this.slidesContainer.querySelectorAll(\".gslide\")[this.index]}},{key:\"getActiveSlideIndex\",value:function(){return this.index}},{key:\"getAnimationClasses\",value:function(){var e=[];for(var t in this.settings.cssEfects)if(this.settings.cssEfects.hasOwnProperty(t)){var i=this.settings.cssEfects[t];e.push(\"g\".concat(i.in)),e.push(\"g\".concat(i.out))}return e.join(\" \")}},{key:\"build\",value:function(){var e=this;if(this.built)return!1;var t=document.body.childNodes,i=[];
18r(t,(function(e){e.parentNode==document.body&&\"#\"!==e.nodeName.charAt(0)&&e.hasAttribute&&!e.hasAttribute(\"aria-hidden\")&&(i.push(e),e.setAttribute(\"aria-hidden\",\"true\"))}));var n=P(this.settings.svg,\"next\")?this.settings.svg.next:\"\",s=P(this.settings.svg,\"prev\")?this.settings.svg.prev:\"\",l=P(this.settings.svg,\"close\")?this.settings.svg.close:\"\",o=this.settings.lightboxHTML;o=y(o=(o=(o=o.replace(/{nextSVG}/g,n)).replace(/{prevSVG}/g,s)).replace(/{closeSVG}/g,l)),document.body.appendChild(o);var a=document.getElementById(\"glightbox-body\");this.modal=a;var c=a.querySelector(\".gclose\");this.prevButton=a.querySelector(\".gprev\"),this.nextButton=a.querySelector(\".gnext\"),this.overlay=a.querySelector(\".goverlay\"),this.loader=a.querySelector(\".gloader\"),this.slidesContainer=document.getElementById(\"glightbox-slider\"),this.bodyHiddenChildElms=i,this.events={},d(this.modal,\"glightbox-\"+this.settings.skin),this.settings.closeButton&&c&&(this.events.close=h(\"click\",{onElement:c,withCallback:function(t,i){t.preventDefault(),e.close()}})),c&&!this.settings.closeButton&&c.parentNode.removeChild(c),this.nextButton&&(this.events.next=h(\"click\",{onElement:this.nextButton,withCallback:function(t,i){t.preventDefault(),e.nextSlide()}})),this.prevButton&&(this.events.prev=h(\"click\",{onElement:this.prevButton,withCallback:function(t,i){t.preventDefault(),e.prevSlide()}})),this.settings.closeOnOutsideClick&&(this.events.outClose=h(\"click\",{onElement:a,withCallback:function(t,i){e.preventOutsideClick||u(document.body,\"glightbox-mobile\")||g(t.target,\".ginner-container\")||g(t.target,\".gbtn\")||u(t.target,\"gnext\")||u(t.target,\"gprev\")||e.close()}})),r(this.elements,(function(t,i){e.slidesContainer.appendChild(t.instance.create()),t.slideNode=e.slidesContainer.querySelectorAll(\".gslide\")[i]})),Q&&d(document.body,\"glightbox-touch\"),this.events.resize=h(\"resize\",{onElement:window,withCallback:function(){e.resize()}}),this.built=!0}},{key:\"resize\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if((e=e||this.activeSlide)&&!u(e,\"zoomed\")){var t=x(),i=e.querySelector(\".gvideo-wrapper\"),n=e.querySelector(\".gslide-image\"),s=this.slideDescription,l=t.width,o=t.height;if(l<=768?d(document.body,\"glightbox-mobile\"):c(document.body,\"glightbox-mobile\"),i||n){var r=!1;if(s&&(u(s,\"description-bottom\")||u(s,\"description-top\"))&&!u(s,\"gabsolute\")&&(r=!0),n)if(l<=768)n.querySelector(\"img\");else if(r){var a,h,g=s.offsetHeight,v=n.querySelector(\"img\"),f=null===(a=this.elements[this.index])||void 0===a?void 0:a.node,p=\"100vh\";f&&(p=null!==(h=f.getAttribute(\"data-height\"))&&void 0!==h?h:p),v.setAttribute(\"style\",\"max-height: calc(\".concat(p,\" - \").concat(g,\"px)\")),s.setAttribute(\"style\",\"max-width: \".concat(v.offsetWidth,\"px;\"))}if(i){var m=P(this.settings.plyr.config,\"ratio\")?this.settings.plyr.config.ratio:\"\";if(!m){var y=i.clientWidth,b=i.clientHeight,S=y/b;m=\"\".concat(y/S,\":\").concat(b/S)}var w=m.split(\":\"),T=this.settings.videosWidth,C=this.settings.videosWidth,k=(C=z(T)||-1!==T.indexOf(\"px\")?parseInt(T):-1!==T.indexOf(\"vw\")?l*parseInt(T)/100:-1!==T.indexOf(\"vh\")?o*parseInt(T)/100:-1!==T.indexOf(\"%\")?l*parseInt(T)/100:parseInt(i.clientWidth))/(parseInt(w[0])/parseInt(w[1]));if(k=Math.floor(k),r&&(o-=s.offsetHeight),C>l||k>o||o<k&&l>C){var E=i.offsetWidth,A=i.offsetHeight,L=o/A,I={width:E*L,height:A*L};i.parentNode.setAttribute(\"style\",\"max-width: \".concat(I.width,\"px\")),r&&s.setAttribute(\"style\",\"max-width: \".concat(I.width,\"px;\"))}else i.parentNode.style.maxWidth=\"\".concat(T),r&&s.setAttribute(\"style\",\"max-width: \".concat(T,\";\"))}}}}},{key:\"reload\",value:function(){this.init()}},{key:\"updateNavigationClasses\",value:function(){var e=this.loop();c(this.nextButton,\"disabled\"),c(this.prevButton,\"disabled\"),0==this.index&&this.elements.length-1==0?(d(this.prevButton,\"disabled\"),d(this.nextButton,\"disabled\")):0!==this.index||e?this.index!==this.elements.length-1||e||d(this.nextButton,\"disabled\"):d(this.prevButton,\"disabled\")}},{key:\"loop\",value:function(){var e=P(this.settings,\"loopAtEnd\")?this.settings.loopAtEnd:null;return e=P(this.settings,\"loop\")?this.settings.loop:e,e}},{key:\"close\",value:function(){var e=this;if(!this.lightboxOpen){if(this.events){for(var t in this.events)this.events.hasOwnProperty(t)&&this.events[t].destroy();this.events=null}return!1}if(this.closing)return!1;this.closing=!0,this.slidePlayerPause(this.activeSlide),this.fullElementsList&&(this.elements=this.fullElementsList),this.bodyHiddenChildElms.length&&r(this.bodyHiddenChildElms,(function(e){e.removeAttribute(\"aria-hidden\")})),d(this.modal,\"glightbox-closing\"),v(this.overlay,\"none\"==this.settings.openEffect?\"none\":this.settings.cssEfects.fade.out),v(this.activeSlide,this.settings.cssEfects[this.settings.closeEffect].out,(function(){if(e.activeSlide=null,e.prevActiveSlideIndex=null,e.prevActiveSlide=null,e.built=!1,e.events){for(var t in e.events)e.events.hasOwnProperty(t)&&e.events[t].destroy();e.events=null}var i=document.body;c(ee,\"glightbox-open\"),c(i,\"glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer\"),e.modal.parentNode.removeChild(e.modal),e.trigger(\"close\"),C(e.settings.onClose)&&e.settings.onClose();var n=document.querySelector(\".gcss-styles\");n&&n.parentNode.removeChild(n),e.lightboxOpen=!1,e.closing=null}))}},{key:\"destroy\",value:function(){this.close(),this.clearAllEvents(),this.baseEvents&&this.baseEvents.destroy()}},{key:\"on\",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e||!C(t))throw new TypeError(\"Event name and callback must be defined\");this.apiEvents.push({evt:e,once:i,callback:t})}},{key:\"once\",value:function(e,t){this.on(e,t,!0)}},{key:\"trigger\",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=[];r(this.apiEvents,(function(t,s){var l=t.evt,o=t.once,r=t.callback;l==e&&(r(i),o&&n.push(s))})),n.length&&r(n,(function(e){return t.apiEvents.splice(e,1)}))}},{key:\"clearAllEvents\",value:function(){this.apiEvents.splice(0,this.apiEvents.length)}},{key:\"version\",value:function(){return\"3.3.1\"}}]);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new ie(e);return t.init(),t}}
18));\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/glightbox/dist/js/glightbox.min.js?\n}"); 19 20/***/ }, 21 22/***/ "./src/resources/assets/js/frontend/accordion.js" 23/*!*******************************************************!*\ 24 !*** ./src/resources/assets/js/frontend/accordion.js ***! 25 \*******************************************************/ 26(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 27 28"use strict"; 29eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Accordion: () => (/* binding */ Accordion)\n/* harmony export */ });\n/**\n * Accordion\n *\n * @param {string} selector Selector or array of selectors on which this script will be initialized.\n * @param {object} userOptions Optional user options.\n */\n\nconst Accordion = function (selector, userOptions) {\n\t'use strict';\n\n\tconst _self = this;\n\tlet uniqueId = 0;\n\tlet eventsAttached = false;\n\n\t// Break up array with selectors\n\tif (Array.isArray(selector)) {\n\t\tif (selector.length) {\n\t\t\treturn selector.map((single) => new Accordion(single, userOptions));\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tconst core = {\n\t\t/**\n\t\t * Init accordion\n\t\t */\n\t\tinit() {\n\t\t\tconst defaultOptions = {\n\t\t\t\titemsHolderClass: 'c-accordion', // The items holder class {string}.\n\t\t\t\titemClass: 'c-accordion__item', // The item class {string}.\n\t\t\t\ttriggerClass: 'c-accordion__trigger', // The trigger class {string}.\n\t\t\t\tbodyClass: 'c-accordion__body', // The body class {string}.\n\t\t\t\tinnerBodyClass: 'c-accordion__body__inner', // The inner body class {string}.\n\t\t\t\topenClass: 'is-open', // The open class {string}.\n\t\t\t\tclosedClass: 'is-closed', // The closed class {string}.\n\t\t\t\tduration: 600, // Animation duration in ms {number}.\n\t\t\t\tenableAria: true, // Add ARIA attributes to HTML {boolean}.\n\t\t\t\tenableCollapse: true, // Allow items to be collapsible {boolean}.\n\t\t\t\tenableMultiple: false, // Allow multiple items to be open at the same time {boolean}.\n\t\t\t\tonlyChildNodes: true, // Disabling this option will query all items in the container (will break nested functionality) {boolean}.\n\t\t\t\topenOnInit: [], // Have items open at initialization {array}.\n\t\t\t\tbeforeOpen: () => {}, // Callback before item is opened {function}.\n\t\t\t\tonOpen: () => {}, // Callback when item is opened {function}.\n\t\t\t\tbeforeClose: () => {}, // Callback before item is closed {function}.\n\t\t\t\tonClose: () => {}, // Callback when item is closed {function}.\n\t\t\t};\n\n\t\t\t// Extend default options\n\t\t\tthis.options = Object.assign(defaultOptions, userOptions);\n\n\t\t\tconst isString = typeof selector === 'string';\n\n\t\t\tthis.container = isString ? document.querySelector(selector) : selector;\n\t\t\tthis.createDefinitions();\n\n\t\t\t_self.attachEvents();\n\t\t},\n\n\t\t/**\n\t\t * Create element definitions\n\t\t */\n\t\tcreateDefinitions() {\n\t\t\tconst { itemClass, openOnInit, onlyChildNodes } = this.options;\n\n\t\t\tconst allElements = onlyChildNodes ? this.container.childNodes : this.container.querySelectorAll(cn(itemClass));\n\n\t\t\tthis.elements = Array.from(allElements).filter(\n\t\t\t\t(el) => el.classList && el.classList.contains(itemClass)\n\t\t\t);\n\n\t\t\tthis.firstElement = this.elements[0];\n\t\t\tthis.lastElement = this.elements[this.elements.length - 1];\n\n\t\t\tthis.elements.forEach((element) => {\n\t\t\t\tthis.addIDs(element);\n\t\t\t\tthis.addARIA(element);\n\t\t\t\tthis.setTransition(element);\n\n\t\t\t\tconst index = this.elements.indexOf(element);\n\n\t\t\t\tuniqueId++;\n\t\t\t\topenOnInit.includes(index) ? this.openItem(element, false) : this.closeItem(element, false);\n\t\t\t});\n\t\t},\n\n\t\t/**\n\t\t * Set transition\n\t\t *\n\t\t * @param {HTMLElement} element Accordion item.\n\t\t * @param {boolean} clear Clear transition duration.\n\t\t */\n\t\tsetTransition(element, clear = false) {\n\t\t\tconst { duration, bodyClass } = this.options;\n\t\t\tconst body = element.querySelector(cn(bodyClass));\n\t\t\tconst transition = isWebkit('transitionDuration');\n\n\t\t\tbody.style[transition] = clear ? null : `${duration}ms`;\n\t\t},\n\n\t\t/**\n\t\t * Add unique IDs for each element\n\t\t *\n\t\t * @param {HTMLElement} element Accordion item.\n\t\t */\n\t\taddIDs(element) {\n\t\t\tconst { triggerClass, bodyClass } = this.options;\n\t\t\tconst trigger = element.querySelector(cn(triggerClass));\n\t\t\tconst body = element.querySelector(cn(bodyClass));\n\n\t\t\t// Use the container dataset (or potential id) for uniqueness across a page\n\t\t\tconst container = this.container;\n\t\t\tconst containerId = (container?.dataset?.accordionId || container?.id || 'accordion')\n\t\t\t\t.replace(/[^A-Za-z0-9\\-_:.]/g, '-'); // sanitize to be ID-safe\n\n\t\t\t// Get item's index within the accordion group to use for uniqueness\n\t\t\tconst index = this.elements.indexOf(element);\n\n\t\t\tconst base = `${containerId}-${index}`;\n\n\t\t\t// Assign the unique IDs if missing (keep existing IDs if present)\n\t\t\tif (element && !element.i
29d) element.id = `ac-${base}`;\n\t\t\tif (trigger && !trigger.id) trigger.id = `ac-trigger-${base}`;\n\t\t\tif (body && !body.id) body.id = `ac-body-${base}`;\n\t\t},\n\n\t\t/**\n\t\t * Remove IDs\n\t\t *\n\t\t * @param {HTMLElement} element Accordion item.\n\t\t */\n\t\tremoveIDs(element) {\n\t\t\tconst { triggerClass, bodyClass } = this.options;\n\t\t\tconst trigger = element.querySelector(cn(triggerClass));\n\t\t\tconst body = element.querySelector(cn(bodyClass));\n\n\t\t\tif (element.id.startsWith('ac-')) element.removeAttribute('id');\n\t\t\tif (trigger.id.startsWith('ac-')) trigger.removeAttribute('id');\n\t\t\tif (body.id.startsWith('ac-')) body.removeAttribute('id');\n\t\t},\n\n\t\t/**\n\t\t * Add ARIA\n\t\t *\n\t\t * @param {HTMLElement} element Accordion item.\n\t\t */\n\t\taddARIA(element) {\n\t\t\tconst { enableAria, enableCollapse, triggerClass, bodyClass } = this.options;\n\t\t\tif (!enableAria) return;\n\n\t\t\tconst trigger = element.querySelector(cn(triggerClass));\n\t\t\tconst body = element.querySelector(cn(bodyClass));\n\n\t\t\tif (trigger) {\n\t\t\t\ttrigger.setAttribute('aria-controls', body.id);\n\t\t\t\ttrigger.setAttribute('aria-expanded', false);\n\t\t\t\tif (trigger.tagName !== 'BUTTON') {\n\t\t\t\t\ttrigger.setAttribute('role', 'button');\n\t\t\t\t}\n\t\t\t\tif (!enableCollapse) {\n\t\t\t\t\ttrigger.setAttribute('aria-disabled', false);\n\t\t\t\t}\n\n\t\t\t\tbody.setAttribute('aria-labelledby', trigger.id);\n\t\t\t\tbody.setAttribute('aria-hidden', true);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Update ARIA\n\t\t *\n\t\t * @param {HTMLElement} element Accordion item.\n\t\t * @param {object} options\n\t\t * @param {boolean} options.ariaExpanded Value of the attribute.\n\t\t * @param {boolean} options.ariaDisabled Value of the attribute.\n\t\t * @param {boolean} options.ariaHidden Value of the attribute.\n\t\t */\n\t\tupdateARIA(element, { ariaExpanded, ariaDisabled, ariaHidden }) {\n\t\t\tconst { enableAria, enableCollapse, triggerClass, bodyClass } = this.options;\n\t\t\tif (!enableAria) return;\n\n\t\t\tconst trigger = element.querySelector(cn(triggerClass));\n\t\t\tconst body = element.querySelector(cn(bodyClass));\n\n\t\t\tif (trigger) {\n\t\t\t\ttrigger.setAttribute('aria-expanded', ariaExpanded);\n\t\t\t\tif (!enableCollapse) {\n\t\t\t\t\ttrigger.setAttribute('aria-disabled', ariaDisabled);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (body) body.setAttribute('aria-hidden', ariaHidden);\n\t\t},\n\n\t\t/**\n\t\t * Remove ARIA\n\t\t *\n\t\t * @param {HTMLElement} element Accordion item.\n\t\t */\n\t\tremoveARIA(element) {\n\t\t\tconst { enableAria, enableCollapse, triggerClass, bodyClass } = this.options;\n\t\t\tif (!enableAria) return;\n\n\t\t\tconst trigger = element.querySelector(cn(triggerClass));\n\t\t\tconst body = element.querySelector(cn(bodyClass));\n\n\t\t\tif (trigger) {\n\t\t\t\ttrigger.removeAttribute('aria-controls');\n\t\t\t\ttrigger.removeAttribute('aria-expanded');\n\t\t\t\tif (trigger.tagName !== 'BUTTON') {\n\t\t\t\t\ttrigger.removeAttribute('role');\n\t\t\t\t}\n\t\t\t\tif (!enableCollapse) {\n\t\t\t\t\ttrigger.removeAttribute('aria-disabled');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (body) {\n\t\t\t\tbody.removeAttribute('aria-labelledby');\n\t\t\t\tbody.removeAttribute('aria-hidden');\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Focus item\n\t\t *\n\t\t * @param {Event} e Event.\n\t\t * @param {HTMLElement} element Accordion item.\n\t\t */\n\t\tfocus(e, element) {\n\t\t\te.preventDefault();\n\n\t\t\tconst { triggerClass } = this.options;\n\t\t\tconst trigger = element.querySelector(cn(triggerClass));\n\t\t\tif (trigger) trigger.focus();\n\t\t},\n\n\t\t/**\n\t\t * Focus first item\n\t\t *\n\t\t * @param {Event} e Event.\n\t\t */\n\t\tfocusFirstItem(e) {\n\t\t\tthis.focus(e, this.firstElement);\n\t\t\tthis.currFocusedIdx = 0;\n\t\t},\n\n\t\t/**\n\t\t * Focus last item\n\t\t *\n\t\t * @param {Event} e Event.\n\t\t */\n\t\tfocusLastItem(e) {\n\t\t\tthis.focus(e, this.lastElement);\n\t\t\tthis.currFocusedIdx = this.elements.length - 1;\n\t\t},\n\n\t\t/**\n\t\t * Focus next item\n\t\t *\n\t\t * @param {Event} e Event.\n\t\t */\n\t\tfocusNextItem(e) {\n\t\t\tconst nextElIdx = this.currFocusedIdx + 1;\n\t\t\tif (nextElIdx > this.elements.length - 1) return this.focusFirstItem(e);\n\n\t\t\tthis.focus(e, this.elements[nextElIdx]);\n\t\t\tthis.currFocusedIdx = nextElIdx;\n\t\t},\n\n\t\t/**\n\t\t * Focus previous item\n\t\t *\n\t\t * @param {Event} e Event.\n\t\t */\n\t\tfocusPrevItem(e) {\n\t\t\tconst prevElIdx = this.currFocusedIdx - 1;\n\t\t\tif (prevElIdx < 0) return this.focusLastItem(e);\n\n\t\t\tthis.focus(e, this.elements[prevElIdx]);\n\t\t\tthis.currFocusedIdx = prevElIdx;\n\t\t},\n\n\t\t/**\n\t\t * Open item\n\t\t *\n\t\t * @param {HTMLElement} element Accordion item.\n\t\t * @param {boolean}
29 calcHeight Calculate height of the body.\n\t\t */\n\t\topenItem(element, calcHeight = true) {\n\t\t\tconst {\n\t\t\t\ttriggerClass,\n\t\t\t\tbodyClass,\n\t\t\t\tinnerBodyClass,\n\t\t\t\topenClass,\n\t\t\t\tclosedClass,\n\t\t\t\tenableCollapse,\n\t\t\t\tbeforeOpen,\n\t\t\t} = this.options;\n\n\t\t\tconst innerBody = element.querySelector(cn(innerBodyClass));\n\t\t\tif (innerBody) {\n\t\t\t\tinnerBody.style.removeProperty('display');\n\t\t\t}\n\n\t\t\tif (calcHeight) beforeOpen(element);\n\n\t\t\tconst trigger = element.querySelector(cn(triggerClass));\n\t\t\tconst body = element.querySelector(cn(bodyClass));\n\t\t\tconst height = body.scrollHeight;\n\n\t\t\tif (trigger) {\n\t\t\t\telement.classList.add(openClass);\n\t\t\t\telement.classList.remove(closedClass);\n\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t\tbody.style.height = calcHeight ? `${height}px` : 'auto';\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\tthis.updateARIA(element, {\n\t\t\t\t\tariaExpanded: true,\n\t\t\t\t\tariaDisabled: enableCollapse ? false : true,\n\t\t\t\t\tariaHidden: false,\n\t\t\t\t});\n\n\t\t\t\tthis.logFaqView(element);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close item\n\t\t *\n\t\t * @param {HTMLElement} element Accordion item.\n\t\t * @param {boolean} calcHeight Calculate height of the body.\n\t\t */\n\t\tcloseItem(element, calcHeight = true) {\n\t\t\tconst {\n\t\t\t\ttriggerClass,\n\t\t\t\tbodyClass,\n\t\t\t\tinnerBodyClass,\n\t\t\t\topenClass,\n\t\t\t\tclosedClass,\n\t\t\t\tbeforeClose,\n\t\t\t} = this.options;\n\t\t\tconst textBlock = element.querySelector(cn(innerBodyClass));\n\t\t\tconst trigger = element.querySelector(cn(triggerClass));\n\t\t\tconst body = element.querySelector(cn(bodyClass));\n\t\t\tconst innerBody = element.querySelector(cn(innerBodyClass));\n\t\t\tconst height = body.scrollHeight;\n\n\t\t\tif (trigger) {\n\t\t\t\telement.classList.add(closedClass);\n\t\t\t\telement.classList.remove(openClass);\n\n\t\t\t\tif (calcHeight) {\n\t\t\t\t\tbeforeClose(element);\n\n\t\t\t\t\t// Animation [X]px => 0\n\t\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t\tbody.style.height = `${height}px`;\n\n\t\t\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t\t\tbody.style.height = 0;\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// Hide element without animation 'auto' => 0\n\t\t\t\t\tbody.style.height = 0;\n\t\t\t\t}\n\n\t\t\t\tthis.updateARIA(element, {\n\t\t\t\t\tariaExpanded: false,\n\t\t\t\t\tariaDisabled: false,\n\t\t\t\t\tariaHidden: true,\n\t\t\t\t});\n\n\t\t\t\tif (innerBody) {\n\t\t\t\t\tinnerBody.style.display = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Toggle item\n\t\t *\n\t\t * @param {HTMLElement} element Accordion item.\n\t\t */\n\t\ttoggleItem(element) {\n\t\t\tconst { openClass, enableCollapse } = this.options;\n\t\t\tconst isOpen = element.classList.contains(openClass);\n\n\t\t\tif (isOpen && !enableCollapse) return;\n\t\t\treturn isOpen ? this.closeItem(element) : this.openItem(element);\n\t\t},\n\n\t\t/**\n\t\t * Close all items except the current one\n\t\t */\n\t\tcloseItems() {\n\t\t\tconst { openClass, enableMultiple } = this.options;\n\t\t\tif (enableMultiple) return;\n\n\t\t\tthis.elements.forEach((element, idx) => {\n\t\t\t\tconst isOpen = element.classList.contains(openClass);\n\n\t\t\t\tif (isOpen && idx !== this.currFocusedIdx) {\n\t\t\t\t\tthis.closeItem(element);\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\t/**\n\t\t * Log the FAQ view\n\t\t * @param {*} e\n\t\t */\n\t\tlogFaqView(e) {\n\t\t\tconst {\n\t\t\t\titemsHolderClass,\n\t\t\t} = this.options,\n\t\t\tpostId = e.dataset.ajaxId,\n\t\t\titemsHolder = e.closest(`.${itemsHolderClass}`);\n\n\t\t\tif(itemsHolder) {\n\t\t\t\tconst adminAjaxUrl = itemsHolder.dataset.ajaxUrl,\n\t\t\t\tadminAjaxLogViewAction = itemsHolder.dataset.ajaxAction,\n\t\t\t\tadminAjaxLogViewNonce = itemsHolder.dataset.ajaxNonce;\n\n\t\t\t\tif(postId && adminAjaxUrl && adminAjaxLogViewAction && adminAjaxLogViewNonce) {\n\t\t\t\t\tconst data = new URLSearchParams();\n\t\t\t\t\tdata.append('action', adminAjaxLogViewAction);\n\t\t\t\t\tdata.append('nonce', adminAjaxLogViewNonce);\n\t\t\t\t\tdata.append('id', postId);\n\n\t\t\t\t\tfetch(adminAjaxUrl, {\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\tcredentials: 'same-origin',\n\t\t\t\t\t\tbody: data\n\t\t\t\t\t})\n\t\t\t\t\t.catch(error => {\n\t\t\t\t\t\tconsole.error('Error:', error);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Handle click\n\t\t *\n\t\t * @param {PointerEvent} e Event.\n\t\t */\n\t\thandleClick(e) {\n\t\t\tconst target = e.currentTarget;
29\n\n\t\t\tthis.elements.forEach((element, idx) => {\n\t\t\t\tif (element.contains(target) && e.target.nodeName !== 'A') {\n\t\t\t\t\tthis.currFocusedIdx = idx;\n\n\t\t\t\t\tthis.closeItems();\n\t\t\t\t\tthis.focus(e, element);\n\t\t\t\t\tthis.toggleItem(element);\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\t/**\n\t\t * Handle keydown\n\t\t *\n\t\t * @param {KeyboardEvent} e Event.\n\t\t */\n\t\thandleKeydown(e) {\n\t\t\tswitch (e.key) {\n\t\t\tcase 'ArrowUp':\n\t\t\t\treturn this.focusPrevItem(e);\n\t\t\tcase 'ArrowDown':\n\t\t\t\treturn this.focusNextItem(e);\n\t\t\tcase 'Home':\n\t\t\t\treturn this.focusFirstItem(e);\n\t\t\tcase 'End':\n\t\t\t\treturn this.focusLastItem(e);\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Handle trigger focus\n\t\t *\n\t\t * @param {KeyboardEvent} e Event.\n\t\t */\n\t\thandleFocus(e) {\n\t\t\tconst target = e.currentTarget;\n\n\t\t\tconst currElement = this.elements.find((element) => element.contains(target));\n\t\t\tthis.currFocusedIdx = this.elements.indexOf(currElement);\n\t\t},\n\n\t\t/**\n\t\t * Handle transitionend\n\t\t *\n\t\t * @param {TransitionEvent} e Event.\n\t\t */\n\t\thandleTransitionEnd(e) {\n\t\t\te.stopPropagation();\n\n\t\t\tif (e.propertyName !== 'height') return;\n\n\t\t\tconst { onOpen, onClose } = this.options;\n\t\t\tconst body = e.currentTarget;\n\t\t\tconst height = parseInt(body.style.height);\n\t\t\tconst element = this.elements.find((element) => element.contains(body));\n\n\t\t\tif (height > 0) {\n\t\t\t\tbody.style.height = 'auto';\n\t\t\t\tonOpen(element);\n\t\t\t} else {\n\t\t\t\tonClose(element);\n\t\t\t}\n\t\t},\n\t};\n\n\t/**\n\t * Attach events\n\t */\n\tthis.attachEvents = () => {\n\t\tif (eventsAttached) return;\n\t\tconst { triggerClass, bodyClass } = core.options;\n\n\t\tcore.handleClick = core.handleClick.bind(core);\n\t\tcore.handleKeydown = core.handleKeydown.bind(core);\n\t\tcore.handleFocus = core.handleFocus.bind(core);\n\t\tcore.handleTransitionEnd = core.handleTransitionEnd.bind(core);\n\n\t\tcore.elements.forEach((element) => {\n\t\t\tconst trigger = element.querySelector(cn(triggerClass));\n\t\t\tconst body = element.querySelector(cn(bodyClass));\n\n\t\t\tif (trigger) {\n\t\t\t\ttrigger.addEventListener('click', core.handleClick);\n\t\t\t\ttrigger.addEventListener('keydown', core.handleKeydown);\n\t\t\t\ttrigger.addEventListener('focus', core.handleFocus);\n\t\t\t}\n\n\t\t\tif (body) {\n\t\t\t\tbody.addEventListener('webkitTransitionEnd', core.handleTransitionEnd);\n\t\t\t\tbody.addEventListener('transitionend', core.handleTransitionEnd);\n\t\t\t}\n\t\t});\n\n\t\teventsAttached = true;\n\t};\n\n\t/**\n\t * Detach events\n\t */\n\tthis.detachEvents = () => {\n\t\tif (!eventsAttached) return;\n\t\tconst { triggerClass, bodyClass } = core.options;\n\n\t\tcore.elements.forEach((element) => {\n\t\t\tconst trigger = element.querySelector(cn(triggerClass));\n\t\t\tconst body = element.querySelector(cn(bodyClass));\n\n\t\t\tif (trigger) {\n\t\t\t\ttrigger.removeEventListener('click', core.handleClick);\n\t\t\t\ttrigger.removeEventListener('keydown', core.handleKeydown);\n\t\t\t\ttrigger.removeEventListener('focus', core.handleFocus);\n\t\t\t}\n\n\t\t\tif (body) {\n\t\t\t\tbody.removeEventListener('webkitTransitionEnd', core.handleTransitionEnd);\n\t\t\t\tbody.removeEventListener('transitionend', core.handleTransitionEnd);\n\t\t\t}\n\t\t});\n\n\t\teventsAttached = false;\n\t};\n\n\t/**\n\t * Open accordion item\n\t *\n\t * @param {number} elIdx Element index.\n\t */\n\tthis.open = (elIdx) => {\n\t\tconst el = core.elements[elIdx];\n\t\tif (el) core.openItem(el);\n\t};\n\n\t/**\n\t * Open all hidden accordion items\n\t */\n\tthis.openAll = () => {\n\t\tconst { openClass, onOpen } = core.options;\n\n\t\tcore.elements.forEach((element) => {\n\t\t\tconst isOpen = element.classList.contains(openClass);\n\n\t\t\tif (!isOpen) {\n\t\t\t\tcore.openItem(element, false);\n\t\t\t\tonOpen(element);\n\t\t\t}\n\t\t});\n\t};\n\n\t/**\n\t * Close accordion item\n\t *\n\t * @param {number} elIdx Element index.\n\t */\n\tthis.close = (elIdx) => {\n\t\tconst el = core.elements[elIdx];\n\t\tif (el) core.closeItem(el);\n\t};\n\n\t/**\n\t * Close all active accordion items\n\t */\n\tthis.closeAll = () => {\n\t\tconst { openClass, onClose } = core.options;
29\n\n\t\tcore.elements.forEach((element) => {\n\t\t\tconst isOpen = element.classList.contains(openClass);\n\n\t\t\tif (isOpen) {\n\t\t\t\tcore.closeItem(element, false);\n\t\t\t\tonClose(element);\n\t\t\t}\n\t\t});\n\t};\n\n\t/**\n\t * Toggle accordion item\n\t *\n\t * @param {number} elIdx Element index.\n\t */\n\tthis.toggle = (elIdx) => {\n\t\tconst el = core.elements[elIdx];\n\t\tif (el) core.toggleItem(el);\n\t};\n\n\t/**\n\t * Destroy accordion instance\n\t */\n\tthis.destroy = () => {\n\t\tthis.detachEvents();\n\t\tthis.openAll();\n\n\t\tcore.elements.forEach((element) => {\n\t\t\tcore.removeIDs(element);\n\t\t\tcore.removeARIA(element);\n\t\t\tcore.setTransition(element, true);\n\t\t});\n\n\t\teventsAttached = true;\n\t};\n\n\t/**\n\t * Update accordion items\n\t */\n\tthis.update = () => {\n\t\tcore.createDefinitions();\n\n\t\tthis.detachEvents();\n\t\tthis.attachEvents();\n\t};\n\n\t/**\n\t * Get supported property and add webkit prefix if needed\n\t *\n\t * @param {string} property Property name.\n\t * @return {string} property Property with optional webkit prefix.\n\t */\n\tconst isWebkit = (property) => {\n\t\tif (typeof document.documentElement.style[property] === 'string') {\n\t\t\treturn property;\n\t\t}\n\n\t\tproperty = capitalizeFirstLetter(property);\n\t\tproperty = `webkit${property}`;\n\n\t\treturn property;\n\t};\n\n\t/**\n\t * Capitalize the first letter in the string\n\t *\n\t * @param {string} string Original string.\n\t * @return {string} string Changed string.\n\t */\n\tconst capitalizeFirstLetter = (string) => string.charAt(0).toUpperCase() + string.slice(1);\n\n\t/**\n * Build class name\n\t *\n * @param {string} className Element class name.\n * @return {string} className Element class name with CSS.escape.\n */\n const cn = (className) => `.${CSS.escape(className)}`;\n\n\t/**\n\t * Init core\n\t */\n\treturn core.init();\n};\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/accordion.js?\n}"); 30 31/***/ }, 32 33/***/ "./src/resources/assets/js/frontend/autocomplete.js" 34/*!**********************************************************!*\ 35 !*** ./src/resources/assets/js/frontend/autocomplete.js ***! 36 \**********************************************************/ 37(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 38 39"use strict"; 40eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Autocomplete: () => (/* binding */ Autocomplete)\n/* harmony export */ });\n/* harmony import */ var _extendProps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extendProps */ \"./src/resources/assets/js/frontend/extendProps.js\");\n\n\n/**\n * Autocomplete\n *\n * Handles autocomplete functionality with keyboard navigation, search, and result selection.\n */\nclass Autocomplete {\n /**\n * Default settings for the Autocomplete component.\n */\n static defaults = {\n // Search configuration\n debounce: 200,\n characters: 2,\n populate: true,\n showType: false, // whether to show post type in results\n showExcerpt: false, // whether to show excerpt in results\n\n // Callback functions\n searchData: false, // function used to return results\n onClick: false, // function executed when selecting an item in the list\n\n // CSS class names\n searchingClass: \"c-autocomplete--searching\",\n dropdownActiveClass: \"c-autocomplete--dropdown-visible\",\n\n // Data attribute names\n dataAttributes: {\n searchingClass: \"data-autocomplete-searching-class\",\n dropdownVisibleClass: \"data-autocomplete-dropdown-visible-class\",\n dropdownActiveClass: \"data-dropdown-active-class\",\n dropdownTruncate: \"data-autocomplete-dropdown-truncate\",\n template: \"data-autocomplete-template\",\n label: \"data-autocomplete-label\",\n url: \"data-autocomplete-url\",\n src: \"data-autocomplete-src\",\n html: \"data-autocomplete-html\",\n type: \"data-autocomplete-type\",\n excerpt: \"data-autocomplete-excerpt\",\n },\n\n // DOM element selectors\n selectors: {\n input: \".js-autocomplete__input\",\n results: \".js-autocomplete__results\",\n resultsList: \".js-autocomplete__list\",\n ariaResults: \".js-autocomplete__aria-results\",\n item: \".js-autocomplete__item\",\n result: \".js-autocomplete__result\",\n },\n\n // Keyboard codes\n keyCodes: {\n escape: 27,\n enter: 13,\n arrowUp: 38,\n arrowDown: 40,\n },\n\n // Spacing and layout\n viewportPadding: 10,\n };\n\n constructor(settings) {\n // Check for CSS custom properties support\n if (!(\"CSS\" in window) || !CSS.supports(\"color\", \"var(--color-var)\")) {\n return;\n }\n\n this.settings = (0,_extendProps__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Autocomplete.defaults, settings);\n\n // Cache DOM elements\n this.cacheElements();\n\n // Component state\n this.initializeState();\n\n // Bind methods that need 'this' context\n this.bindMethods();\n\n // Initialize component\n this.init();\n }\n\n /**\n * Cache frequently accessed DOM elements\n */\n cacheElements() {\n this.element = this.settings.element;\n this.input = this.element.querySelector(this.settings.selectors.input);\n this.results = this.element.querySelector(this.settings.selectors.results);\n this.resultsList = this.element.querySelector(\n this.settings.selectors.resultsList\n );\n this.ariaResults = this.element.querySelectorAll(\n this.settings.selectors.ariaResults\n );\n\n // Determine result class name\n this.resultClassName = this.element.querySelector(\n this.settings.selectors.item\n )\n ? this.settings.selectors.item.replace(\".\", \"\")\n : this.settings.selectors.result.replace(\".\", \"\");\n }\n\n /**\n * Initialize component state\n */\n initializeState() {\n // Search state\n this.inputVal = \"\";\n this.typeId = false;\n this.searching = false;\n this.autocompleteClosed = false;\n\n // Get configuration from data attributes\n this.searchingClass =\n this.element.getAttribute(this.settings.dataAttributes.searchingClass) ||\n this.settings.searchingClass;\n\n this.dropdownActiveClass =\n this.element.getAttribute(\n this.settings.dataAttributes.dropdownVisibleClass\n ) ||\n this.element.getAttribute(\n this.settings.dataAttributes.dropdownActiveClass\n ) ||\n this.settings.dropdownActiveClass;\n\n this.truncateDropdown =\n this.element.getAttribute(\n this.settings.dataAttributes.dropdownTruncate\n ) === \"on\";\n\n // Template state\n this.templates = [];\n this.templateItems = [];\n this.resultsItems = [];\n }\n\n /**\n * Binds class methods to preserve 'this' context\n */\n bindMethods() {\
40n this.handleInputTyped = this.handleInputTyped.bind(this);\n this.handleInputSearch = this.handleInputSearch.bind(this);\n this.handleInputClick = this.handleInputClick.bind(this);\n this.handleInputFocus = this.handleInputFocus.bind(this);\n this.handleInputBlur = this.handleInputBlur.bind(this);\n this.handleListKeydown = this.handleListKeydown.bind(this);\n this.handleListFocusOut = this.handleListFocusOut.bind(this);\n this.handleWindowKeyup = this.handleWindowKeyup.bind(this);\n this.handleListClick = this.handleListClick.bind(this);\n }\n\n /**\n * Initialize the autocomplete component\n */\n init() {\n this.setupAria();\n this.setupTemplates();\n this.bindEvents();\n }\n\n /**\n * Set up ARIA attributes for accessibility\n */\n setupAria() {\n // Set aria attributes for input element\n this.input.setAttribute(\"role\", \"combobox\");\n this.input.setAttribute(\"aria-autocomplete\", \"list\");\n\n const listId = this.resultsList.getAttribute(\"id\");\n if (listId) {\n this.input.setAttribute(\"aria-owns\", listId);\n }\n\n // Set aria attributes for autocomplete list\n this.resultsList.setAttribute(\"role\", \"list\");\n }\n\n /**\n * Set up template items and their configurations\n */\n setupTemplates() {\n this.templateItems = Array.from(\n this.resultsList.querySelectorAll(\n `.${this.resultClassName}[${this.settings.dataAttributes.template}]`\n )\n );\n\n if (this.templateItems.length < 1) {\n this.templateItems = Array.from(\n this.resultsList.querySelectorAll(`.${this.resultClassName}`)\n );\n }\n\n this.templates = this.templateItems.map((item) =>\n item.getAttribute(this.settings.dataAttributes.template)\n );\n }\n\n /**\n * Set up all event listeners\n */\n bindEvents() {\n // Input events\n this.input.addEventListener(\"keyup\", this.handleInputTyped);\n this.input.addEventListener(\"search\", this.handleInputSearch);\n this.input.addEventListener(\"click\", this.handleInputClick);\n this.input.addEventListener(\"focus\", this.handleInputFocus);\n this.input.addEventListener(\"blur\", this.handleInputBlur);\n\n // Results list events\n this.resultsList.addEventListener(\"keydown\", this.handleListKeydown);\n this.resultsList.addEventListener(\"focusout\", this.handleListFocusOut);\n this.resultsList.addEventListener(\"click\", this.handleListClick);\n\n // Window events\n window.addEventListener(\"keyup\", this.handleWindowKeyup);\n }\n\n /**\n * Handle input typing events\n * @param {KeyboardEvent} event - The keyboard event\n */\n handleInputTyped(event) {\n const isArrowDown =\n event.key?.toLowerCase() === \"arrowdown\" ||\n event.keyCode === this.settings.keyCodes.arrowDown;\n\n if (isArrowDown) {\n this.moveFocusToList();\n } else {\n this.updateSearch();\n }\n }\n\n /**\n * Handle input search events (for input type=\"search\")\n * @param {Event} event - The search event\n */\n handleInputSearch(event) {\n this.updateSearch();\n }\n\n /**\n * Handle input click events\n * @param {MouseEvent} event - The click event\n */\n handleInputClick(event) {\n this.updateSearch(true);\n }\n\n /**\n * Handle input focus events\n * @param {FocusEvent} event - The focus event\n */\n handleInputFocus(event) {\n if (this.autocompleteClosed) {\n this.autocompleteClosed = false;\n return;\n }\n this.updateSearch(true);\n }\n\n /**\n * Handle input blur events\n * @param {FocusEvent} event - The blur event\n */\n handleInputBlur(event) {\n this.checkFocusLost(event);\n }\n\n /**\n * Handle results list keydown events\n * @param {KeyboardEvent} event - The keyboard event\n */\n handleListKeydown(event) {\n this.navigateList(event);\n }\n\n /**\n * Handle results list focus out events\n * @param {FocusEvent} event - The focus event\n */\n handleListFocusOut(event) {\n this.checkFocusLost(event);\n }\n\n /**\n * Handle window keyup events\n * @param {KeyboardEvent} event - The keyboard event\n */\n handleWindowKeyup(event) {\n const isEscape =\n event.keyCode === this.settings.keyCodes.escape ||\n event.key?.toLowerCase() === \"escape\";\n\n const isEnter =\n event.keyCode === this.settings.keyCodes.enter ||\n event.key?.toLowerCase() === \"enter\";\n\n if (isEscape) {\n this.toggleOptionsList(false);\n } else if (isEnter) {\n const activeElement = document.activeElement;\n const result = activeElement.closest(`.${this.resultClassName}`);\n if (result) {\n this.selectResult(result, event);\n }\n }\n }\n\n /**\n * Handle results list click events\n * @param {MouseEvent} event - The click event\n */\n handleListClick(event) {\n const result = event.target.closest(`.${this.resultClassName}`);\n if (result) {\n this.selectResult(result, event);\n }\n }\n\n /**\n * Check if focus has moved outside the component\n * @param {FocusEvent} event - The focus event\n */\n checkFocusLost(event) {\n if (this.element.contains(event.relatedTarget)) {\n return;\n }\n this.toggleOptionsList(false);\n }\n\n /**\n * Move focus to the results list\n */\n moveFocusToList() {\n if (!this.element.classList.contains(this.dropdownActiveClass)) {\n return;\n }\n\n this.resetSearch();\n\n // Find first focusable element\n let index = 0;\n if (!this.isElementFocusable(this.resultsItems[index])) {\n index = this.getElementFocusableIndex(index, true);\n }\n\n const focusableElement = this.getListFocusableElement(\n this.resultsItems[index]\n );\n if (focusableElement) {\n focusableElement.focus();\n }\n }\n\n /**\n * Update search based on input value\n * @param {boolean} immediate - Whether to search immediately without debounce\n */\n updateSearch(immediate = false) {\n const inputValue = this.input.value;\n\n if (inputValue === this.inputVal && !immediate) {\n return;\n }\n\n this.inputVal = inputValue;
40\n\n if (this.typeId) {\n clearTimeout(this.typeId);\n }\n\n if (this.inputVal.length < this.settings.characters) {\n this.toggleOptionsList(false);\n return;\n }\n\n if (immediate) {\n this.updateResultsList(\"focus\");\n return;\n }\n\n this.typeId = setTimeout(() => {\n this.updateResultsList(\"type\");\n }, this.settings.debounce);\n }\n\n /**\n * Toggle the visibility of the options list\n * @param {boolean} show - Whether to show the list\n */\n toggleOptionsList(show) {\n if (show) {\n if (this.element.classList.contains(this.dropdownActiveClass)) {\n return;\n }\n\n this.element.classList.add(this.dropdownActiveClass);\n this.input.setAttribute(\"aria-expanded\", \"true\");\n this.truncateAutocompleteList();\n } else {\n if (!this.element.classList.contains(this.dropdownActiveClass)) {\n return;\n }\n\n if (this.resultsList.contains(document.activeElement)) {\n this.autocompleteClosed = true;\n this.input.focus();\n }\n\n this.element.classList.remove(this.dropdownActiveClass);\n this.input.removeAttribute(\"aria-expanded\");\n this.resetSearch();\n }\n }\n\n /**\n * Truncate autocomplete list to fit viewport\n */\n truncateAutocompleteList() {\n if (!this.truncateDropdown) {\n return;\n }\n\n // Reset max height\n this.resultsList.style.maxHeight = \"\";\n\n // Check available space\n const spaceBelow =\n window.innerHeight -\n this.input.getBoundingClientRect().bottom -\n this.settings.viewportPadding;\n\n const maxHeight = parseInt(\n getComputedStyle(this.resultsList).maxHeight,\n 10\n );\n\n if (maxHeight > spaceBelow) {\n this.resultsList.style.maxHeight = `${spaceBelow}px`;\n } else {\n this.resultsList.style.maxHeight = \"\";\n }\n }\n\n /**\n * Update the results list with new data\n * @param {string} eventType - The type of event that triggered the update\n */\n updateResultsList(eventType) {\n if (this.searching) {\n return;\n }\n\n this.searching = true;\n this.element.classList.add(this.searchingClass);\n\n // Check if we have a modern REST API search function or fall back to legacy\n if (this.settings.searchData) {\n this.settings.searchData(\n this.inputVal,\n (data, callback) => {\n this.populateResults(data, callback);\n this.element.classList.remove(this.searchingClass);\n this.toggleOptionsList(true);\n this.updateAriaRegion();\n this.searching = false;\n },\n eventType\n );\n } else {\n // Use default REST API search if no custom searchData function provided\n this.performRestApiSearch(this.inputVal);\n }\n }\n\n /**\n * Perform search using the REST API endpoint\n * @param {string} query - The search query\n */\n performRestApiSearch(query) {\n const restUrl = `${window.location.origin}/wp-json/ams/v1/search`;\n const params = new URLSearchParams({\n q: query,\n limit: 10,\n });\n\n fetch(`${restUrl}?${params}`)\n .then((response) => {\n if (!response.ok) {\n throw new Error(`HTTP ${response.status}: ${response.statusText}`);\n }\n return response.json();\n })\n .then((data) => {\n const results =\n data.results?.map((item) => ({\n label: item.title,\n url: item.url,\n type: this.settings.showType ? item.type_label || item.type : \"\",\n class: `autocomplete-${item.type}`,\n excerpt: this.settings.showExcerpt ? item.excerpt : \"\",\n })) || [];\n\n this.populateResults(results);\n this.element.classList.remove(this.searchingClass);\n this.toggleOptionsList(true);\n this.updateAriaRegion();\n this.searching = false;\n })\n .catch((error) => {\n console.warn(\n \"REST API search failed, falling back to legacy search:\",\n error\n );\n this.fallbackToLegacySearch(query);\n });\n }\n\n /**\n * Fallback to legacy AJAX search if REST API fails\n * @param {string} query - The search query\n */\n fallbackToLegacySearch(query) {\n const searchUrl = `${window.location.origin}/wp-admin/admin-ajax.php`;\n const formData = new FormData();\n formData.append(\"action\", \"my_search\");\n formData.append(\"term\", query);\n\n fetch(searchUrl, {\n method: \"POST\",\n body: formData,\n })\n .then((response) => response.json())\n .then((data) =>
40 {\n const results = data.map((item) => ({\n label: item.label,\n url: \"#\", // Legacy search doesn't provide URLs\n type: \"search-result\",\n class: \"autocomplete-search-result\",\n }));\n\n this.populateResults(results);\n this.element.classList.remove(this.searchingClass);\n this.toggleOptionsList(true);\n this.updateAriaRegion();\n this.searching = false;\n })\n .catch((error) => {\n console.error(\"All search methods failed:\", error);\n this.populateResults([]);\n this.element.classList.remove(this.searchingClass);\n this.searching = false;\n });\n }\n\n /**\n * Update ARIA region with current results count\n */\n updateAriaRegion() {\n this.resultsItems = Array.from(\n this.resultsList.querySelectorAll(\n `.${this.resultClassName}[tabindex=\"-1\"]`\n )\n );\n\n if (this.ariaResults.length === 0) {\n return;\n }\n\n this.ariaResults[0].textContent = this.resultsItems.length.toString();\n }\n\n /**\n * Reset search timeout\n */\n resetSearch() {\n if (this.typeId) {\n clearTimeout(this.typeId);\n }\n this.typeId = false;\n }\n\n /**\n * Navigate through the results list with keyboard\n * @param {KeyboardEvent} event - The keyboard event\n */\n navigateList(event) {\n const isDownArrow =\n event.key?.toLowerCase() === \"arrowdown\" ||\n event.keyCode === this.settings.keyCodes.arrowDown;\n\n const isUpArrow =\n event.key?.toLowerCase() === \"arrowup\" ||\n event.keyCode === this.settings.keyCodes.arrowUp;\n\n if (!isDownArrow && !isUpArrow) {\n return;\n }\n\n event.preventDefault();\n\n const selectedElement =\n document.activeElement.closest(`.${this.resultClassName}`) ||\n document.activeElement;\n\n const index = Array.prototype.indexOf.call(\n this.resultsItems,\n selectedElement\n );\n\n const newIndex = this.getElementFocusableIndex(index, isDownArrow);\n const focusableElement = this.getListFocusableElement(\n this.resultsItems[newIndex]\n );\n\n if (focusableElement) {\n focusableElement.focus();\n }\n }\n\n /**\n * Get the index of the next focusable element\n * @param {number} index - Current index\n * @param {boolean} nextItem - Whether to get next or previous item\n * @return {number} New index\n */\n getElementFocusableIndex(index, nextItem) {\n let newIndex = nextItem ? index + 1 : index - 1;\n\n if (newIndex < 0) {\n newIndex = this.resultsItems.length - 1;\n }\n if (newIndex >= this.resultsItems.length) {\n newIndex = 0;\n }\n\n // Check if element can be focused\n if (!this.isElementFocusable(this.resultsItems[newIndex])) {\n return this.getElementFocusableIndex(newIndex, nextItem);\n }\n\n return newIndex;\n }\n\n /**\n * Check if an element is focusable\n * @param {HTMLElement} item - The element to check\n * @return {boolean} Whether the element is focusable\n */\n isElementFocusable(item) {\n if (!item) {\n return false;\n }\n\n const role = item.getAttribute(\"role\");\n if (role && role === \"presentation\") {\n return false;\n }\n\n return true;\n }\n\n /**\n * Get the focusable element within a list item\n * @param {HTMLElement} item - The list item\n * @return {HTMLElement} The focusable element\n */\n getListFocusableElement(item) {\n if (!item) {\n return null;\n }\n\n const focusableElements = item.querySelectorAll(\n \"button:not([disabled]), [href]\"\n );\n\n return focusableElements.length > 0 ? focusableElements[0] : item;\n }\n\n /**\n * Select a result from the list\n * @param {HTMLElement} result - The selected result element\n * @param {Event} event - The triggering event\n */\n selectResult(result, event) {\n if (!result) {\n return;\n }\n\n if (this.settings.onClick) {\n this.settings.onClick(result, this, event, () => {\n this.toggleOptionsList(false);\n });\n } else {\n this.input.value = this.getResultContent(result);\n this.toggleOptionsList(false);\n }\n\n this.inputVal = this.input.value;\n }\n\n /**\n * Get text content of selected result\n * @param {HTMLElement} result - The result element\n * @return {string} The text content\n */\n getResultContent(result) {\n const labelElement = result.querySelector(\n `[${this.settings.dataAttributes.label}]`\n );\n return labelElement ? labelElement.textContent : result.textContent;\n }\n\n /**\n * Populate results list with data\n * @param {Array} data - The data array\n * @param {Function} callback - Optional callback function\n */\n populateResults(data, callback) {\n let innerHtml = \"\";\n\n for (let i = 0; i < data.length;
40 i++) {\n innerHtml += this.getItemHtml(data[i]);\n }\n\n if (this.settings.populate) {\n this.resultsList.innerHTML = innerHtml;\n } else if (callback) {\n callback(innerHtml);\n }\n\n // Add/remove no-results class based on whether we have data\n if (data.length === 0) {\n this.element.classList.add(\"c-autocomplete--no-results\");\n } else {\n this.element.classList.remove(\"c-autocomplete--no-results\");\n }\n }\n\n /**\n * Generate HTML for a single item\n * @param {Object} data - The item data\n * @return {string} The HTML string\n */\n getItemHtml(data) {\n const clone = this.getClone(data);\n clone.classList.remove(\"u-hide\");\n clone.setAttribute(\"tabindex\", \"-1\");\n\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n switch (key) {\n case \"label\":\n this.setLabel(clone, data[key]);\n break;\n case \"class\":\n this.setClass(clone, data[key]);\n break;\n case \"url\":\n this.setUrl(clone, data[key]);\n break;\n case \"src\":\n this.setSrc(clone, data[key]);\n break;\n case \"type\":\n this.setType(clone, data[key]);\n break;\n case \"excerpt\":\n this.setExcerpt(clone, data[key]);\n break;\n default:\n this.setKey(clone, key, data[key]);\n break;\n }\n }\n }\n\n return clone.outerHTML;\n }\n\n /**\n * Get a clone of the appropriate template\n * @param {Object} data - The item data\n * @return {HTMLElement} The cloned element\n */\n getClone(data) {\n let item = false;\n\n if (this.templateItems.length === 1 || !data.template) {\n item = this.templateItems[0];\n } else {\n for (let i = 0; i < this.templateItems.length; i++) {\n if (data.template === this.templates[i]) {\n item = this.templateItems[i];\n break;\n }\n }\n if (!item) {\n item = this.templateItems[0];\n }\n }\n\n return item.cloneNode(true);\n }\n\n /**\n * Set the label content of a cloned element\n * @param {HTMLElement} clone - The cloned element\n * @param {string} label - The label text\n */\n setLabel(clone, label) {\n const labelElement = clone.querySelector(\n `[${this.settings.dataAttributes.label}]`\n );\n\n if (labelElement) {\n labelElement.textContent = label;\n } else {\n clone.textContent = label;\n }\n }\n\n /**\n * Set CSS classes on a cloned element\n * @param {HTMLElement} clone - The cloned element\n * @param {string} classList - Space-separated class names\n */\n setClass(clone, classList) {\n const classesArray = classList.split(\" \");\n clone.classList.add(classesArray[0]);\n\n if (classesArray.length > 1) {\n this.setClass(clone, classesArray.slice(1).join(\" \"));\n }\n }\n\n /**\n * Set URL on a cloned element\n * @param {HTMLElement} clone - The cloned element\n * @param {string} url - The URL\n */\n setUrl(clone, url) {\n const linkElement = clone.querySelector(\n `[${this.settings.dataAttributes.url}]`\n );\n if (linkElement) {\n linkElement.setAttribute(\"href\", url);\n }\n }\n\n /**\n * Set image source on a cloned element\n * @param {HTMLElement} clone - The cloned element\n * @param {string} src - The image source\n */\n setSrc(clone, src) {\n const imgElement = clone.querySelector(\n `[${this.settings.dataAttributes.src}]`\n );\n if (imgElement) {\n imgElement.setAttribute(\"src\", src);\n }\n }\n\n /**\n * Set post type on a cloned element\n * @param {HTMLElement} clone - The cloned element\n * @param {string} type - The post type\n */\n setType(clone, type) {\n const typeElement = clone.querySelector(\n `[${this.settings.dataAttributes.type}]`\n );\n if (typeElement) {\n typeElement.textContent = type;\n }\n }\n\n /**\n * Set excerpt on a cloned element\n * @param {HTMLElement} clone - The cloned element\n * @param {string} excerpt - The excerpt text\n */\n setExcerpt(clone, excerpt) {\n const excerptElement = clone.querySelector(\n `[${this.settings.dataAttributes.excerpt}]`\n );\n if (excerptElement) {\n excerptElement.textContent = excerpt;\n }\n }\n\n /**\n * Set custom data attribute content on a cloned element\n * @param {HTMLElement} clone - The cloned element\n * @param {string} key - The data key\n * @param {string} value - The value\n */\n setKey(clone, key, value) {\n const subElement = clone.querySelector(`[data-autocomplete-${key}]`);\n if (subElement) {\n if (subElement.hasAttribute(this.settings.dataAttributes.html)) {\n subElement.innerHTML = value;\n } else {\n subElement.textContent = value;\n }\n }\n }\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/autocomplete.js?\n}"); 41 42/***/ }, 43 44/***/ "./src/resources/assets/js/frontend/background.js" 45/*!********************************************************!*\ 46 !*** ./src/resources/assets/js/frontend/background.js ***! 47 \********************************************************/ 48(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 49 50"use strict"; 51eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Backgroun
51d: () => (/* binding */ Background)\n/* harmony export */ });\n/**\n * Background\n *\n * Change background data attribute settings between\n * mobile/desktop depending on the breakpoint.\n *\n * @param {object} settings Settings object.\n */\nconst Background = function ( settings ) {\n\t'use strict';\n\n\tconst _self = this;\n\tconst _settings = {};\n\tconst mQ = window.matchMedia( '(min-width: 768px)' );\n\n\tObject.assign( _settings, settings );\n\n\tfunction cacheDom() {\n\t\t_settings.$imgContainer = document.querySelectorAll(\n\t\t\t_settings.imgContainer\n\t\t);\n\t\t_settings.$videoContainer = document.querySelectorAll(\n\t\t\t_settings.videoContainer\n\t\t);\n\t}\n\n\tfunction bindEvents() {\n\t\tmQ.addEventListener( 'change', handleSettings );\n\t}\n\n\tfunction handleSettings( e ) {\n\t\tif ( e.matches ) {\n\t\t\t_settings.$imgContainer.forEach( ( el ) => {\n\t\t\t\tif ( el.getAttribute(_settings.imgSettings) ) {\n\t\t\t\t\tconst parsedData = JSON.parse(el.getAttribute(_settings.imgSettings));\n\t\t\t\t\tel.setAttribute('data-position', parsedData.desktop_settings.position);\n\t\t\t\t\tel.setAttribute('data-size', parsedData.desktop_settings.size);\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\t_settings.$imgContainer.forEach( ( el ) => {\n\t\t\t\tif ( el.getAttribute(_settings.imgSettings) ) {\n\t\t\t\t\tconst parsedData = JSON.parse(el.getAttribute(_settings.imgSettings));\n\t\t\t\t\tel.setAttribute('data-position', parsedData.mobile_settings.position);\n\t\t\t\t\tel.setAttribute('data-size', parsedData.mobile_settings.size);\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\tfunction manageVideoState() {\n\t\t// Iterate through each video container\n\t\t_settings.$videoContainer.forEach(container => {\n\t\t\t// Find video element and play/pause button from the container\n\t\t\tconst video = container.querySelector('video');\n\t\t\tconst button = container.querySelector('.c-bg--video-btn');\n\n\t\t\tbutton.addEventListener('click', () => {\n\t\t\t\t// Check if video is playing or paused, and toggle current state\n\t\t\t\tvideo.paused ? video.play() : video.pause();\n\t\t\t\t// Update icon class and aria label depending on current video state\n\t\t\t\tconst icon = button.querySelector('i');\n\t\t\t\tconst newIconClass = video.paused ? 'fa-play' : 'fa-pause';\n\t\t\t\tconst newAriaLabel = video.paused ? 'Spela upp bakgrundsvideon' : 'Pausa bakgrundsvideon';\n\n\t\t\t\ticon.classList.replace(video.paused ? 'fa-pause' : 'fa-play', newIconClass);\n\t\t\t\tbutton.setAttribute('aria-label', newAriaLabel);\n\t\t\t});\n\t\t});\n\t}\n\n\tfunction init() {\n\t\tcacheDom();\n\t\tbindEvents();\n\t\thandleSettings( mQ );\n\t\tmanageVideoState();\n\n\t\treturn _self;\n\t}\n\n\treturn init();\n};\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/background.js?\n}"); 52 53/***/ }, 54 55/***/ "./src/resources/assets/js/frontend/breadcrumb.js" 56/*!********************************************************!*\ 57 !*** ./src/resources/assets/js/frontend/breadcrumb.js ***! 58 \********************************************************/ 59(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 60 61"use strict"; 62eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Breadcrumb: () => (/* binding */ Breadcrumb)\n/* harmony export */ });\n/* harmony import */ var _extendProps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extendProps */ \"./src/resources/assets/js/frontend/extendProps.js\");\n\n\n/**\n * Breadcrumb\n *\n * Handles breadcrumb positioning, visibility, and scroll behavior.\n */\nclass Breadcrumb {\n /**\n * Default settings for the Breadcrumb component.\n */\n static defaults = {\n // DOM element selectors\n selectors: {\n breadcrumb: \".c-breadcrumb\",\n header: \".ams-header\",\n hero: \".ams-hero\",\n mainContent: \"main#content, .s-content\",\n },\n\n // State class names\n classTransparent: \"is-transparent\",\n classBackground: \"has-background\",\n classHidden: \"u-hide\",\n\n // Data attribute names\n dataAttributes: {\n position: \"data-position\",\n },\n\n // Event names\n events: {\n backgroundChange: \"header:backgroundChange\",\n visibilityChange: \"header:visibilityChange\",\n },\n\n // Animation timing\n animationTiming: 300,\n };\n\n constructor(settings) {\n this.settings = (0,_extendProps__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Breadcrumb.defaults, settings);\n\n // Cache DOM elements\n this.cacheElements();\n\n // Component state\n this.initializeState();\n\n // Bind methods that need 'this' context\n this.bindMethods();\n\n // Initialize component\n this.init();\n }\n\n /**\n * Cache frequently accessed DOM elements\n */\n cacheElements() {\n this.element =\n this.settings.element ||\
62n document.querySelector(this.settings.selectors.breadcrumb);\n this.header = document.querySelector(this.settings.selectors.header);\n this.hero = document.querySelector(this.settings.selectors.hero);\n this.mainContent = document.querySelector(\n this.settings.selectors.mainContent\n );\n }\n\n /**\n * Initialize component state\n */\n initializeState() {\n this.isHidden = false;\n this.originalParent = null;\n this.originalNextSibling = null;\n this.headerOffset = this.getHeaderOffsetFromCSS();\n\n if (this.element) {\n this.originalParent = this.element.parentNode;\n this.originalNextSibling = this.element.nextSibling;\n }\n }\n\n /**\n * Bind methods that need 'this' context\n */\n bindMethods() {\n this.handleHeaderBackgroundChange =\n this.handleHeaderBackgroundChange.bind(this);\n this.handleHeaderVisibilityChange =\n this.handleHeaderVisibilityChange.bind(this);\n this.updateHeaderOffsetFromCSS = this.updateHeaderOffsetFromCSS.bind(this);\n }\n\n /**\n * Initialize the breadcrumb component\n */\n init() {\n if (!this.element || !this.header) {\n return;\n }\n\n // Set up initial positioning based on header state\n this.setupInitialPosition();\n\n // Listen for header events\n this.bindHeaderEvents();\n\n // Watch for changes to root style (e.g. --header-offset updates)\n this._rootStyleObserver = new MutationObserver(() => {\n this.updateHeaderOffsetFromCSS();\n });\n this._rootStyleObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"style\"],\n });\n }\n\n /**\n * Set up event listeners for header changes\n */\n bindHeaderEvents() {\n document.addEventListener(\n this.settings.events.backgroundChange,\n this.handleHeaderBackgroundChange\n );\n document.addEventListener(\n this.settings.events.visibilityChange,\n this.handleHeaderVisibilityChange\n );\n }\n\n /**\n * Set up initial breadcrumb positioning based on header configuration\n */\n setupInitialPosition() {\n const headerPosition = this.getHeaderPosition();
62\n const isTransparent = this.isHeaderTransparent();\n\n if (isTransparent) {\n this.handleTransparentHeader(headerPosition);\n } else {\n this.handleNormalHeader(headerPosition);\n }\n }\n\n /**\n * Handle breadcrumb behavior for transparent headers\n * @param {string} position - Header position (default, fixed, scroll)\n */\n handleTransparentHeader(position) {\n const handlers = {\n default: () => this.handleTransparentDefault(),\n fixed: () => this.handleTransparentFixed(),\n scroll: () => this.handleTransparentScroll(),\n };\n\n const handler = handlers[position];\n if (handler) {\n handler();\n }\n }\n\n /**\n * Handle breadcrumb behavior for normal (non-transparent) headers\n * @param {string} position - Header position (default, fixed, scroll)\n */\n handleNormalHeader(position) {\n this.restoreOriginalPosition();\n\n // Non-transparent headers always show breadcrumb initially\n this.show();\n }\n\n /**\n * Handle transparent header with default position\n */\n handleTransparentDefault() {\n if (this.isHeroFirstSection()) {\n this.moveAfterHero();\n this.show();\n } else {\n this.hide();\n }\n }\n\n /**\n * Handle transparent header with fixed position\n */\n handleTransparentFixed() {\n this.restoreOriginalPosition();\n this.toggleVisibility(this.hasHeaderBackground());\n }\n\n /**\n * Handle transparent header with scroll position\n */\n handleTransparentScroll() {\n this.restoreOriginalPosition();\n this.hide();\n }\n\n /**\n * Check if hero is the first section in main content\n * @return {boolean}\n */\n isHeroFirstSection() {\n if (!this.hero || !this.mainContent) {\n return false;\n }\n\n const firstChild = this.mainContent.querySelector(\":first-child\");\n return firstChild && firstChild.contains(this.hero);\n }\n\n /**\n * Move breadcrumb after the hero section\n */\n moveAfterHero() {\n if (!this.hero) {\n return;\n }\n\n const insertionPoint = this.hero.nextSibling || null;\n this.hero.parentNode.insertBefore(this.element, insertionPoint);\n }\n\n /**\n * Restore breadcrumb to its original position\n */\n restoreOriginalPosition() {\n if (!this.originalParent) {\n return;\n }\n\n // Reset positioning styles\n this.resetStyles();\n\n // Move back to original position\n this.originalParent.insertBefore(this.element, this.originalNextSibling);\n }\n\n /**\n * Reset inline styles applied to the element\n */\n resetStyles() {\n this.element.style.marginTop = \"\";\n this.element.style.transform = \"\";\n }\n\n /**\n * Toggle breadcrumb visibility\n * @param {boolean} shouldShow - Whether to show the breadcrumb\n */\n toggleVisibility(shouldShow) {\n if (shouldShow) {\n this.show();\n } else {\n this.hide();\n }\n }\n\n /**\n * Hide the breadcrumb\n */\n hide() {\n this.element.classList.add(this.settings.classHidden
62);\n this.isHidden = true;\n }\n\n /**\n * Show the breadcrumb\n */\n show() {\n this.element.classList.remove(this.settings.classHidden);\n this.isHidden = false;\n }\n\n /**\n * Hide breadcrumb with scroll animation\n */\n hideWithScroll() {\n if (!this.element || !this.header) {\n return;\n }\n\n const totalOffset =\n this.header.offsetHeight +\n (this.headerOffset || 0) +\n this.element.offsetHeight;\n this.setTranslate(`-${totalOffset}px`);\n }\n\n /**\n * Show breadcrumb with scroll animation\n */\n showWithScroll() {\n this.setTranslate(\"0\");\n }\n\n /**\n * Set transform translate value with animation frame\n * @param {string} value - The transform value\n */\n setTranslate(value) {\n requestAnimationFrame(() => {\n this.element.style.transform = `translateY(${value})`;\n });\n }\n\n /**\n * Handle header background change events\n * @param {CustomEvent} event\n */\n handleHeaderBackgroundChange(event) {\n const hasBackground = event.detail.hasBackground;\n const headerPosition = this.getHeaderPosition();
62\n const isTransparent = this.isHeaderTransparent();\n\n if (!isTransparent) {\n return;\n }\n\n if (headerPosition === \"fixed\") {\n this.toggleVisibility(hasBackground);\n } else if (headerPosition === \"scroll\") {\n this.handleScrollBackgroundChange(hasBackground);\n }\n }\n\n /**\n * Handle background changes for scroll layout\n * @param {boolean} hasBackground - Whether header has background\n */\n handleScrollBackgroundChange(hasBackground) {\n if (hasBackground && this.isHeaderVisible()) {\n this.show();\n this.showWithScroll();\n } else if (!hasBackground) {\n this.hide();\n }\n }\n\n /**\n * Handle header visibility change events\n * @param {CustomEvent} event\n */\n handleHeaderVisibilityChange(event) {\n const isVisible = event.detail.isVisible;\n const headerPosition = this.getHeaderPosition();\n\n if (headerPosition !== \"scroll\") {\n return;\n }\n\n if (isVisible) {\n this.handleScrollShow();\n } else {\n this.hideWithScroll();\n }\n }\n\n /**\n * Handle showing breadcrumb for scroll layout\n */\n handleScrollShow() {\
62n const isTransparent = this.isHeaderTransparent();\n const shouldShow = !isTransparent || this.hasHeaderBackground();\n\n if (shouldShow) {\n this.show();\n this.showWithScroll();\n }\n }\n\n /**\n * Get header position from data attribute\n * @return {string}\n */\n getHeaderPosition() {\n if (!this.header) {\n return \"default\";\n }\n return (\n this.header.getAttribute(this.settings.dataAttributes.position) ||\n \"default\"\n );\n }\n\n /**\n * Check if header is transparent\n * @return {boolean}\n */\n isHeaderTransparent() {\n return this.hasHeaderClass(this.settings.classTransparent);\n }\n\n /**\n * Check if header has background\n * @return {boolean}\n */\n hasHeaderBackground() {\n return this.hasHeaderClass(this.settings.classBackground);\n }\n\n /**\n * Check if header has a specific class\n * @param {string} className - Class name to check\n * @return {boolean}\n */\n hasHeaderClass(className) {\n return this.header && this.header.classList.contains(className);\n }\n\n /**\n * Check if header is currently visible (not translated up)\n * @return {boolean}\n */\n isHeaderVisible() {\n if (!this.header) {\n return true;\n }\n const transform = this.header.style.transform;\n return !transform || !transform.includes(\"-100%\");\n }\n\n /**\n * Cleanup method\n */\n destroy() {\n // Remove event listeners\n document.removeEventListener(\n this.settings.events.backgroundChange,\n this.handleHeaderBackgroundChange\n );\n document.removeEventListener(\n this.settings.events.visibilityChange,\n this.handleHeaderVisibilityChange\n );\n\n // Disconnect observer\n this._rootStyleObserver?.disconnect();\n\n // Restore original position\n this.restoreOriginalPosition();\n }\n}\n\n/**\n * Reads and applies header offset from CSS custom property --header-offset\n * Repositions breadcrumb and adjusts transform for scroll layout\n * @private\n */\nBreadcrumb.prototype.updateHeaderOffsetFromCSS = function () {\n const newOffset = this.getHeaderOffsetFromCSS();\n if (newOffset === this.headerOffset) {\n return;\n }\n this.headerOffset = newOffset;\n\n const headerPosition = this.getHeaderPosition();\n\n // Adjust transform if using scroll behavior\n if (headerPosition === \"scroll\") {\n if (this.isHeaderVisible()) {\n this.showWithScroll();\n } else {\n this.hideWithScroll();\n }\n }\n};\n\n/**\n * Gets header offset from CSS variable --header-offset\n * @return {number} Parsed pixels (0 if not set/invalid)\n * @private\n */\nBreadcrumb.prototype.getHeaderOffsetFromCSS = function () {\n const rootStyles = getComputedStyle(document.documentElement);\n const value = rootStyles.getPropertyValue(\"--header-offset\");\n if (!value) {\n return 0;\n }\n const parsed = parseFloat(value);\n return Number.isNaN(parsed) ? 0 : parsed;\n};\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/breadcrumb.js?\n}"); 63 64/***/ }, 65 66/***/ "./src/resources/assets/js/frontend/breakpoints.js" 67/*!*********************************************************!*\ 68 !*** ./src/resources/assets/js/frontend/breakpoints.js ***! 69 \*********************************************************/ 70(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 71 72"use strict"; 73eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BREAKPOINTS: () => (/* binding */ BREAKPOINTS)\n/* harmony export */ });\nconst BREAKPOINTS = { MOBILE: 768, TABLET: 1024 };\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/breakpoints.js?\n}"); 74 75/***/ }, 76 77/***/ "./src/resources/assets/js/frontend/checkDevice.js" 78/*!*********************************************************!*\ 79 !*** ./src/resources/assets/js/frontend/checkDevice.js ***! 80 \*********************************************************/ 81(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 82 83"use strict"; 84eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CheckDevice: () => (/* binding */ CheckDevice)\n/* harmony export */ });\n/* harmony import */ var _breakpoints__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./breakpoints */ \"./src/resources/assets/js/frontend/breakpoints.js\");\n/* harmony import */ var _debounce__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./debounce */ \"./src/resources/assets/js/frontend/debounce.js\");\n/**\n * Check Device\n */\n\n\n\n\nconst CheckDevice = (function () {\n\t\"use strict\";\n\n\tfunction getCurrentDeviceType() {\n\t\tif (window.matchMedia(`(max-width: ${_breakpoints__WEBPACK_IMPORTED_MODULE_0__.BREAKPOINTS.MOBILE}px)`).matches) {\n\t\t\treturn \"mobile\";\n\t\t} else if (window.matchMedia(`(max-width: ${_breakpoints__WEBPACK_IMPORTED_MODULE_0__.BREAKPOINTS.TABLET}px)`).matches) {\n\t\t\treturn \"tablet\";\n\t\t}\n\t\treturn \"desktop\";\n\t}\n\n\tfunction setDeviceType() {\n\t\tconst newDeviceType = getCurrentDeviceType();\n\t\tconst existingDeviceType = document.body.dataset.deviceType;\n\n\t\tif (newDeviceType !== existingDeviceType) {\n\t\t\tdocument.body.dataset.deviceType = newDeviceType;\n\t\t\tdocument.cookie = `device_type=${newDeviceType}; path=/; max-age=86400; Secure; SameSite=Lax`;\n\t\t}\n\t}\n\n\tfunction checkResize() {\n\t\twindow.addEventListener(\"resize\", (0,_debounce__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(setDeviceType, 200));\n\t}
84\n\n\tfunction init() {\n\t\tsetDeviceType();\n\t\tcheckResize();\n\t}\n\n\treturn {\n\t\tinit,\n\t};\n})();\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/checkDevice.js?\n}"); 85 86/***/ }, 87 88/***/ "./src/resources/assets/js/frontend/clickarea.js" 89/*!*******************************************************!*\ 90 !*** ./src/resources/assets/js/frontend/clickarea.js ***! 91 \*******************************************************/ 92(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 93 94"use strict"; 95eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ClickArea: () => (/* binding */ ClickArea)\n/* harmony export */ });\n/**\n * ClickArea\n *\n * Makes an entire area clickable based on a single child anchor.\n * Note: we are using Date() to make sure you could select text\n * without visiting the link.\n *\n * @param {string} el Element on which this script will be initialized.\n */\nconst ClickArea = function (el) {\n\t\"use strict\";\n\n\tfunction handleClick() {\n\t\tlet down, up, link = el.getElementsByTagName(\"a\")[0];\n\n\t\tif (link) {\n\t\t\tel.style.cursor = \"pointer\";\n\t\t\tel.onmousedown = () => (down = +new Date());\n\t\t\tel.onmouseup = () => {\n\t\t\t\tup = +new Date();\n\t\t\t\tif (up - down < 200) {\n\t\t\t\t\tlink.click();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n\n\tfunction init() {\n\t\thandleClick();\n\t}\n\n\treturn init();\n};\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/clickarea.js?\n}"); 96 97/***/ }, 98 99/***/ "./src/resources/assets/js/frontend/debounce.js" 100/*!******************************************************!*\ 101 !*** ./src/resources/assets/js/frontend/debounce.js ***! 102 \******************************************************/ 103(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 104 105"use strict"; 106eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ debounce)\n/* harmony export */ });\nfunction debounce( fn, wait, immediate ) {\n\tlet timeout;\n\treturn function () {\n\t\tconst context = this,\n\t\t\targs = arguments;\n\t\tconst later = function () {\n\t\t\ttimeout = null;\n\t\t\tif ( ! immediate ) fn.apply( context, args );\n\t\t};\n\t\tconst callNow = immediate && ! timeout;\n\t\tclearTimeout( timeout );\n\t\ttimeout = setTimeout( later, wait );\n\t\tif ( callNow ) fn.apply( context, args );\n\t};\n}\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/debounce.js?\n}"); 107 108/***/ }, 109 110/***/ "./src/resources/assets/js/frontend/extendProps.js" 111/*!*********************************************************!*\ 112 !*** ./src/resources/assets/js/frontend/extendProps.js ***! 113 \*********************************************************/ 114(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 115 116"use strict"; 117eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ extendProps)\n/* harmony export */ });\nfunction extendProps(...args) {\n\tconst extended = {};\n\tlet deep = false;\n\n\tif (typeof args[0] === 'boolean') {\n\t\t[deep, ...args] = args;\n\t}\n\n\tconst merge = (obj) => {\n\t\tObject.keys(obj).forEach((prop) => {\n\t\t\tif (Object.prototype.hasOwnProperty.call(obj, prop)) {\n\t\t\t\tif (\n\t\t\t\t\tdeep &&\n\t\t\t\t\ttypeof obj[prop] === 'object' &&\n\t\t\t\t\tobj[prop] !== null\n\t\t\t\t) {\n\t\t\t\t\textended[prop] = this.extendProps(\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t\textended[prop],\n\t\t\t\t\t\tobj[prop]\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\textended[prop] = obj[prop];\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\targs.forEach((obj) => merge(obj));\n\n\treturn extended;\n}\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/extendProps.js?\n}"); 118 119/***/ }, 120 121/***/ "./src/resources/assets/js/frontend/filter-tags.js" 122/*!*********************************************************!*\ 123 !*** ./src/resources/assets/js/frontend/filter-tags.js ***! 124 \*********************************************************/ 125(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 126 127"use strict"; 128eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FilterTags: () => (/* binding */ FilterTags)\n/* harmony export */ });\n/* harmony import */ var _extendProps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extendProps */ \"./src/resources/assets/js/frontend/extendProps.js\");\n\n\n/**\n * FilterTags\n * ------------\n * A lightweight companion class that watches one or more `<select>` elements\n * and dynamically generates tag-like elements for every selected option.\n */\nclass FilterTags {\n\t/**\n\t * Default settings for the FilterTags component.\n\t * @type {Object}\n\t * @property {string} tagsContainerClass - The class added to the tags container <div>.\n\t * @property {string} tagClass - The class applied to each individual tag <span>.\n\t * @property {string} tagModifierClass - The class applied to each individual tag <span>.\n\t * @property {string} clearAllClass - Class applied to the âClear Allâ button.\n\t */\n\tstatic defaults = {\n\t\ttagsContainerClass: 'c-filter__tags',\n\t\ttagClass: 'c-tag',\n\t\ttagModifierClass: 'c-tag--close',\n\t\tclearAllClass: 'c-tag--clear-all',\n\t};\n\n\t/**\n\t * @constructor\n\t * @param {Object} settings - Configuration options for the filter tags.\n\t * @param {HTMLElement} settings.element - The container element with class .js-filter-tags.\n\t */\n\tconstructor(settings) {\n\t\tthis.settings = (0,_extendProps__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(FilterTags.defaults, settings);\n\t\tthis.element = this.settings.element;\n\n\t\t/**\n\t\t * All <select> elements within the .js-filter-tags container.\n\t\t * @type {HTMLSelectElement[]}\n\t\t */\n\t\tthis.selects = [...this.element.querySelectorAll('select')];\n\n\t\t/**\n\t\t * The container <div> that holds all generated tag elements.\n\t\t * We only create it if at least one <option> is selected.\n\t\t * @type {HTMLDivElement|null}\n\t\t */\n\t\tthis.tagsContainer = null;\n\n\t\t// Listen for changes on each select\n\t\tthis.selects.forEac
128h((select) => {\n\t\t\tselect.addEventListener('change', () => this.updateTags());\n\t\t});\n\n\t\t// Initial generation of tags\n\t\tthis.updateTags();\n\t}\n\n\t/**\n\t * Rebuilds the tags based on currently selected options across all <select> elements.\n\t * - If no options are selected, remove the container if it exists.\n\t * - Otherwise, create (or clear) the container, then create a tag <span> for each selected option.\n\t * - Add a âClear Allâ button to remove all selected options across all <select> elements.\n\t */\n\tupdateTags() {\n\t\t// Count total selected across all selects in this container\n\t\tlet totalSelected = 0;\n\t\tthis.selects.forEach((select) => {\n\t\t\ttotalSelected += select.selectedOptions.length;\n\t\t});\n\n\t\t// If no selections, remove the container if present\n\t\tif (totalSelected === 0) {\n\t\t\tif (this.tagsContainer) {\n\t\t\t\tthis.tagsContainer.remove();\n\t\t\t\tthis.tagsContainer = null;\n\t\t\t}\n\t\t\treturn; // No tags to show\n\t\t}\n\n\t\t// If there's at least one selected option, ensure container exists\n\t\tif (!this.tagsContainer) {\n\t\t\tthis.tagsContainer = document.createElement('div');\n\t\t\tthis.tagsContainer.classList.add(this.settings.tagsContainerClass);\n\t\t\t// Insert after the .js-filter-tags element\n\t\t\tthis.element.insertAdjacentElement('afterend', this.tagsContainer);\n\t\t} else {\n\t\t\t// Clear existing tags\n\t\t\tthis.tagsContainer.innerHTML = '';\n\t\t}\n\n\t\t// Rebuild all tags\n\t\tthis.selects.forEach((select) => {\n\t\t\tconst selectedOptions = [...select.selectedOptions];\n\n\t\t\tselectedOptions.forEach((option) => {\n\t\t\t\t// Generate tag markup\n\t\t\t\tconst tagHtml = this.buildTag(option);\n\t\t\t\tthis.tagsContainer.insertAdjacentHTML('beforeend', tagHtml);\n\n\t\t\t\t// Retrieve the newly inserted tag element (the last child)\n\t\t\t\tconst tagEl = this.tagsContainer.lastElementChild;\n\n\t\t\t\t// Clicking the entire tag deselects the option\n\t\t\t\ttagEl.addEventListener('click', () => {\n\t\t\t\t\toption.selected = false;\n\t\t\t\t\tselect.dispatchEvent(new Event('change', { bubbles: true }));\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\t// Only add âClear Allâ if totalSelected > 2\n\t\tif (totalSelected > 2) {\n\t\t\tconst clearAllHtml = this.buildClearAll();\n\t\t\tthis.tagsContainer.insertAdjacentHTML('beforeend', clearAllHtml);\n\n\t\t\tconst clearAllEl = this.tagsContainer.querySelector(`.${this.settings.clearAllClass}`);\n\t\t\tclearAllEl.addEventListener('click', () => this.clearAllSelections());\n\t\t}\n\t}\n\n\t/**\n\t * Builds the HTML markup for a single tag based on a selected <option>.\n\t * @private\n\t * @param {HTMLOptionElement} option - A currently selected option.\n\t * @returns {string} The HTML string for one filter tag.\n\t */\n\tbuildTag(option) {\n\t\treturn `\n\t\t\t<span class=\"${this.settings.tagClass} ${this.settings.tagModifierClass}\" data-value=\"${option.value}\">\n\t\t\t\t${option.text}\n\t\t\t\t<span class=\"${this.settings.tagClass}__close\"></span>\n\t\t\t</span>\n\t\t`;\n\t}\n\n\t/**\n\t * Builds the HTML markup for the âClear Allâ button.\n\t * @private\n\t * @returns {string} The HTML string for the clear-all element.\n\t */\n\tbuildClearAll() {\n\t\treturn `\n\t\t\t<span class=\"${this.settings.tagClass} ${this.settings.tagModifierClass} ${this.settings.clearAllClass}\" data-variant=\"outline\">\n\t\t\t\tRensa filter\n\t\t\t\t<span class=\"${this.settings.tagClass}__close\"></span>\n\t\t\t</span>\n\t\t`;\n\t}\n\n\t/**\n\t * Clears all selected options in all tracked <select> elements, then triggers\n\t * a change event so MultiSelect can update.\n\t * @private\n\t */\n\tclearAllSelections() {\n\t\tthis.selects.forEach((select) => {\n\t\t\t[...select.options].forEach((opt) => {\n\t\t\t\topt.selected = false;\n\t\t\t});\n\t\t\tselect.dispatchEvent(new Event('change', { bubbles: true }));\n\t\t});\n\t}\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/filter-tags.js?\n}"); 129 130/***/ }, 131 132/***/ "./src/resources/assets/js/frontend/filter.js" 133/*!****************************************************!*\ 134 !*** ./src/resources/assets/js/frontend/filter.js ***! 135 \****************************************************/ 136(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 137 138"use strict"; 139eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Filter: () => (/* binding */ Filter)\n/* harmony export */ });\n/* harmony import */ var _extendProps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extendProps */ \"./src/resources/assets/js/frontend/extendProps.js\");\n\n\n/**\n * Filter\n */\nclass Filter {\n\tstatic defaults = {\n\t\telement: false,\n\t\tduration: 400,\n\t};\n\n\tconstructor(settings) {\n\t\tthis.settings = (0,_extendProps__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Filter.defaults, settings);\n\t\tthis.element = this.settings.element;\n\t\tthis.elementId = this.element.getAttribute('id');\n\t\tthis.items = Array.from(\n\t\t\tthis.element.querySelectorAll('.js-filter__item')\n\t\t);\n\t\tthis.controllers = document.querySelectorAll(\n\t\t\t`[aria-controls=\"${this.elementId}\"]`\n\t\t);\n\t\tthis.fallbackMessage = document.querySelector(\n\t\t\t`[data-filter-fallback-id=\"${this.elementId}\"]`\n\t\t);\n\t\tthis.filterString = [];\n\t\tthis.sortString = '';\n\t\tthis.filterList = new Array(this.items.length).fill(true);\n\t\tthis.sortList = this.items.map((item, index) => [item, index]);\n\t\tthis.itemsGrid = [];\n\t\tthis.itemsInitPosition = [];\n\t\tthis.itemsIterPosition = [];\n\t\tthis.itemsFinalPosition = [];\n\t\tthis.animationOff =\n\t\t\tthis.element.getAttribute('data-filter-animation') === 'off';\n\t\tthis.resizingId = false;\n\t\tthis.accelerateStyle =\n\t\t\t'will-change: transform, opacity; transform: translateZ(0); backface-visibility: hidden;';\n\t\tthis.animating = false;\n\t\tthis.reanimate = false;\n\n\t\tthis.initFilter();\n\t}\n\n\tinitFilter() {\n\t\tthis.resetFilterSortArray(true, true);\n\t\tthis.createGridInfo();\n\t\tthis.initItemsOrder();
139\n\n\t\tthis.controllers.forEach((controller, index) => {\n\t\t\tthis.filterString[index] = '';\n\n\t\t\tconst handleFilterChange = (event) => {\n\t\t\t\tif (event.target.tagName.toLowerCase() === 'select') {\n\t\t\t\t\tif (!event.target.getAttribute('data-filter')) {\n\t\t\t\t\t\tthis.setSortString(\n\t\t\t\t\t\t\tevent.target.value,\n\t\t\t\t\t\t\tevent.target.options[event.target.selectedIndex]\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.setFilterString(index, 'select');\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\tevent.target.tagName.toLowerCase() === 'input' &&\n\t\t\t\t\t(event.target.getAttribute('type') === 'radio' ||\n\t\t\t\t\t\tevent.target.getAttribute('type') === 'checkbox')\n\t\t\t\t) {\n\t\t\t\t\tif (!event.target.getAttribute('data-filter')) {\n\t\t\t\t\t\tthis.setSortString(\n\t\t\t\t\t\t\tevent.target.getAttribute('data-sort'),\n\t\t\t\t\t\t\tevent.target\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.setFilterString(index, 'input');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (!controller.getAttribute('data-filter')) {\n\t\t\t\t\t\tthis.setSortString(\n\t\t\t\t\t\t\tcontroller.getAttribute('data-sort'),\n\t\t\t\t\t\t\tcontroller\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.setFilterString(index, 'custom');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.updateFilterArray();\n\t\t\t};\n\n\t\t\tconst handleClick = (event) => {\n\t\t\t\tconst filterEl = event.target.closest('[data-filter]');\n\t\t\t\tconst sortEl = event.target.closest('[data-sort]');\n\n\t\t\t\tif (!filterEl && !sortEl) return;\n\n\t\t\t\tif (\n\t\t\t\t\tfilterEl &&\n\t\t\t\t\t(filterEl.tagName.toLowerCase() === 'input' ||\n\t\t\t\t\t\tfilterEl.tagName.toLowerCase() === 'select')\n\t\t\t\t)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (\n\t\t\t\t\tsortEl &&\n\t\t\t\t\t(sortEl.tagName.toLowerCase() === 'input' ||\n\t\t\t\t\t\tsortEl.tagName.toLowerCase() === 'select')\n\t\t\t\t)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (\n\t\t\t\t\tsortEl &&\n\t\t\t\t\tsortEl.classList.contains('js-filter__custom-control')\n\t\t\t\t)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (\n\t\t\t\t\tfilterEl &&\n\t\t\t\t\tfilterEl.classList.contains('js-filter__custom-control')\n\t\t\t\t)\n\t\t\t\t\treturn;\n\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.resetControllersList(index, filterEl, sortEl);\n\n\t\t\t\tif (sortEl) {\n\t\t\t\t\tthis.setSortString(\n\t\t\t\t\t\tsortEl.getAttribute('data-sort'),\n\t\t\t\t\t\tsortEl\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthis.setFilterString(index, 'button');\n\t\t\t\t}\n\n\t\t\t\tthis.updateFilterArray();\n\t\t\t};\n\n\t\t\tconst handleInput = (event) => {\n\t\t\t\tif (\n\t\t\t\t\tevent.target.tagName.toLowerCase() === 'input' &&\n\t\t\t\t\t(event.target.getAttribute('type') === 'search' ||\n\t\t\t\t\t\tevent.target.getAttribute('type') === 'text')\n\t\t\t\t) {\n\t\t\t\t\tthis.setFilterString(index, 'custom');\n\t\t\t\t\tthis.updateFilterArray();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tcontroller.addEventListener('change', handleFilterChange);\n\t\t\tcontroller.addEventListener('click', handleClick);\n\t\t\tcontroller.addEventListener('input', handleInput);\n\t\t});\n\n\t\t// Handle resize - Update grid coordinates\n\t\twindow.addEventListener('resize', () => {\n\t\t\tclearTimeout(this.resizingId);\n\t\t\tthis.resizingId = setTimeout(() => {\n\t\t\t\tthis.createGridInfo();\n\t\t\t}, 300);\n\t\t});\n\n\t\t// Check if filter/sort values are already set\n\t\tthis.checkInitialFiltering();\n\n\t\t// Reset filter results if filter selection was changed by an external control e.g. form reset\n\t\tthis.element.addEventListener('update-filter-results', () => {\n\t\t\tthis.controllers.forEach((controller, index) => {\n\t\t\t\tthis.filterString[index] = '';\n\t\t\t});\n\n\t\t\tthis.sortString = '';\n\t\t\tthis.checkInitialFiltering();\n\t\t});\n\t}\n\n\tcheckInitialFiltering() {\n\t\t// Check if there is a selected option\n\t\tthis.controllers.forEach((controller, i) => {\n\t\t\t// Button elements\n\t\t\tconst selectedButton = Array.from(\n\t\t\t\tcontroller.getElementsByClassName('js-filter-selected')\n\t\t\t);\n\n\t\t\tif (selectedButton.length > 0) {\n\t\t\t\tconst sort = selectedButton[0].getAttribute('data-sort');\n\n\t\t\t\tif (sort) {\n\t\t\t\t\tthis.setSortString(sort, selectedButton[0]);\n\t\t\t\t} else {\n\t\t\t\t\tthis.setFilterString(i, 'button');\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Input elements\n\t\t\tconst selectedInput = Array.from(\n\t\t\t\tcontroller.querySelectorAll('input:checked')\n\t\t\t);\n\n\t\t\tif (selectedInput.length > 0) {\n\t\t\t\tconst sort = selectedInput[0].getAttribute('data-sort');\n\n\t\t\t\tif (sort) {\n\t\t\t\t\tthis.setSortString(sort, selectedInput[0]);\n\t\t\t\t} else {\n\t\t\t\t\tthis.setFilterString(i, 'input');\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Select elements\n\t\t\tif (controller.tagName.toLowerCase() === 'select') {\n\t\t\t\tconst sort = controller.getAttribute('data-sort');\n\n\t\t\t\tif (sort) {\n\t\t\t\t\tthis.setSortString(\n\t\t\t\t\t\tcontroller.value,\n\t\t\t\t\t\tcontroller.options[controller.selectedIndex]\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthis.setFilterString(i, 'select');\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst radioInput = controller.querySelector('input[type=\"radio\"]');\n\t\t\tconst checkboxInput = controller.querySelector(\n\t\t\t\t'input[type=\"checkbox\"]'\n\t\t\t);\n\n\t\t\t// Check if there is a generic custom input\n\t\t\tif (!radioInput && !checkboxInput) {\n\t\t\t\tconst sort = controller.getAttribute('data-sort');\n\t\t\t\tconst filterString = controller.getAttribute('data-filter');\n\n\t\t\t\tif (sort) {\n\t\t\t\t\tthis.setSortString(sort, controller);\n\t\t\t\t} else if (filterString) {\n\t\t\t\t\tthis.setFilterString(i, 'custom');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tthis.updateFilterArray();\n\t}\n\n\tsetSortString(value, item) {\n\t\tconst order = item.getAttribute('data-sort-order') ? 'desc' : 'asc';\n\t\tconst type = item.getAttribute('data-sort-number')\n\t\t\t? 'number'\n\t\t\t: 'string';\n\n\t\tthis.sortString = `${value}:${order}:${type}`;\n\t}\n\n\tsetFilterString(index, type) {\n\t\tif (type === 'input') {\n\t\t\tconst checkedInputs = Array.from(\n\t\t\t\tthis.controllers[index].querySelectorAll('input:checked')\n\t\t\t);\n\n\t\t\tthis.filterString[index] = '';
139\n\n\t\t\tcheckedInputs.forEach((input) => {\n\t\t\t\tthis.filterString[index] += `${input.getAttribute(\n\t\t\t\t\t'data-filter'\n\t\t\t\t)}:`;\n\t\t\t});\n\t\t} else if (type === 'select') {\n\t\t\tthis.filterString[index] = this.controllers[index].multiple\n\t\t\t\t? this.getMultipleSelectValues(this.controllers[index])\n\t\t\t\t: this.controllers[index].value;\n\t\t} else if (type === 'button') {\n\t\t\tconst selectedButtons = Array.from(\n\t\t\t\tthis.controllers[index].querySelectorAll('.js-filter-selected')\n\t\t\t);\n\n\t\t\tthis.filterString[index] = '';\n\n\t\t\tselectedButtons.forEach((button) => {\n\t\t\t\tthis.filterString[index] += `${button.getAttribute(\n\t\t\t\t\t'data-filter'\n\t\t\t\t)}:`;\n\t\t\t});\n\t\t} else if (type === 'custom') {\n\t\t\tthis.filterString[index] =\n\t\t\t\tthis.controllers[index].getAttribute('data-filter');\n\t\t}\n\t}\n\n\tresetControllersList(index, target1, target2) {\n\t\tconst multi = this.controllers[index].getAttribute(\n\t\t\t'data-filter-checkbox'\n\t\t);\n\t\tlet customClass = this.controllers[index].getAttribute(\n\t\t\t'data-selected-class'\n\t\t);\n\t\tconst toggleClassOnTarget = (target) => {\n\t\t\tthis.toggleClass(\n\t\t\t\ttarget,\n\t\t\t\tcustomClass,\n\t\t\t\t!target.classList.contains('js-filter-selected')\n\t\t\t);\n\t\t};\n\t\tconst addClassToTarget = (target) => {\n\t\t\tthis.addClass(target, customClass);\n\t\t};\n\n\t\tcustomClass = customClass\n\t\t\t? `js-filter-selected ${customClass}`\n\t\t\t: 'js-filter-selected';\n\n\t\tif (multi === 'true') {\n\t\t\tif (target1) {\n\t\t\t\ttoggleClassOnTarget(target1);\n\t\t\t} else {\n\t\t\t\ttoggleClassOnTarget(target2);\n\t\t\t}\n\t\t} else {\n\t\t\tconst selectedOption = this.controllers[index].querySelector(\n\t\t\t\t'.js-filter-selected'\n\t\t\t);\n\n\t\t\tif (selectedOption) {\n\t\t\t\tthis.removeClass(selectedOption, customClass);\n\t\t\t}\n\n\t\t\tif (target1) {\n\t\t\t\taddClassToTarget(target1);\n\t\t\t} else {\n\t\t\t\taddClassToTarget(target2);\n\t\t\t}\n\t\t}\n\t}\n\n\tupdateFilterArray() {\n\t\t// Filter/Sort string has been updated, update the grid\n\t\tif (this.animating) {\n\t\t\tthis.reanimate = true;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.animating = true;\n\t\tthis.reanimate = false;\n\n\t\tthis.createGridInfo(); // Get new grid coordinates\n\t\tthis.filterGrid(); // Update filter list\n\t\tthis.sortGrid(); // Update sorting list\n\t\tthis.resetFallbackMessage(true); // Toggle fallback message\n\n\t\tconst reduceMotion = window.matchMedia(\n\t\t\t'(prefers-reduced-motion: reduce)'\n\t\t).matches;\n\n\t\tconst updateItems = () => {\n\t\t\tif (reduceMotion || this.animationOff) {\n\t\t\t\tthis.resetItems();\n\t\t\t} else {\n\t\t\t\tthis.updateItemsAttributes();\n\t\t\t}\n\t\t};\n\n\t\tupdateItems();\n\n\t\tconst event = new CustomEvent('filter-selection-updated', {\n\t\t\tbubbles: true,\n\t\t});\n\n\t\tthis.element.dispatchEvent(event);\n\t}\n\n\tfilterGrid() {\n\t\tthis.resetFilterSortArray(true, false);\n\n\t\tArray.from(this.filterString).forEach((char) => {\n\t\t\tif (char !== '' && char !== '*' && char !== ' ') {\n\t\t\t\tthis.singleFilterGrid(char.split(':'));\n\t\t\t}\n\t\t});\n\t}\n\n\tsortGrid() {\n\t\tconst sortOptions = this.sortString.split(':');\n\n\t\tif (sortOptions[0] === '' || sortOptions[0] === '*') {\n\t\t\tthis.restoreSortOrder();\n\t\t} else {\n\t\t\tif (this.settings[sortOptions[0]]) {\n\t\t\t\tthis.sortList = this.settings[sortOptions[0]](this.sortList);\n\t\t\t} else {\n\t\t\t\tthis.sortList.sort((left, right) => {\n\t\t\t\t\tlet leftVal = left[0].getAttribute(\n\t\t\t\t\t\t`data-sort-${sortOptions[0]}`\n\t\t\t\t\t);\n\t\t\t\t\tlet rightVal = right[0].getAttribute(\n\t\t\t\t\t\t`data-sort-${sortOptions[0]}`\n\t\t\t\t\t);\n\n\t\t\t\t\tif (sortOptions[2] === 'number') {\n\t\t\t\t\t\tleftVal = parseFloat(leftVal);\n\t\t\t\t\t\trightVal = parseFloat(rightVal);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (sortOptions[1] === 'desc') {\n\t\t\t\t\t\treturn leftVal <= rightVal ? 1 : -1;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn leftVal >= rightVal ? 1 : -1;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tsingleFilterGrid(subfilter) {\n\t\tif (!subfilter || subfilter === '' || subfilter === '*') return;\n\n\t\tconst customFilterArray = {};\n\n\t\tsubfilter.forEach((filter) =>
139 {\n\t\t\tif (this.settings[filter]) {\n\t\t\t\tcustomFilterArray[filter] = this.settings[filter](this.items);\n\t\t\t}\n\t\t});\n\n\t\tthis.items.forEach((item, i) => {\n\t\t\tconst filterValues = item.getAttribute('data-filter').split(' ');\n\t\t\tlet present = false;\n\n\t\t\tsubfilter.forEach((filter) => {\n\t\t\t\tif (this.settings[filter] && customFilterArray[filter][i]) {\n\t\t\t\t\tpresent = true;\n\t\t\t\t} else if (\n\t\t\t\t\tfilter === '*' ||\n\t\t\t\t\tfilterValues.indexOf(filter) > -1\n\t\t\t\t) {\n\t\t\t\t\tpresent = true;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.filterList[i] = !present ? false : this.filterList[i];\n\t\t});\n\t}\n\n\t// Update items before triggering the animation\n\tupdateItemsAttributes() {\n\t\t// Get offset of all elements before animation\n\t\tthis.storeOffset(this.itemsInitPosition);\n\n\t\t// Set width/height on container\n\t\tthis.element.style.cssText = `\n\t\t\theight: ${parseFloat(this.element.offsetHeight)}px;\n\t\t\twidth: ${parseFloat(this.element.offsetWidth)}px;\n\t\t`;\n\n\t\t// Remove hide class from visible items and scale to zero\n\t\tthis.items.forEach((item, i) => {\n\t\t\tif (item.classList.contains('u-hide') && this.filterList[i]) {\n\t\t\t\titem.setAttribute('data-scale', 'on');\n\t\t\t\titem.style.cssText = `\n\t\t\t\t\t${this.accelerateStyle}\n\t\t\t\t\ttransform: scale(0.5);\n\t\t\t\t\topacity: 0;\n\t\t\t\t`;\n\t\t\t\tthis.removeClass(item, 'u-hide');\n\t\t\t}\n\t\t});\n\n\t\t// Get new elements offset\n\t\tthis.storeOffset(this.itemsIterPosition);\n\n\t\t// Translate items so they are in the right initial position\n\t\tthis.items.forEach((item, i) => {\n\t\t\tif (item.getAttribute('data-scale') !== 'on') {\n\t\t\t\titem.style.cssText = `\n\t\t\t\t\t${this.accelerateStyle}\n\t\t\t\t\ttransform:\n\t\t\t\t\ttranslateX(${parseInt(\n\t\t\t\t\t\tthis.itemsInitPosition[i][0] -\n\t\t\t\t\t\t\tthis.itemsIterPosition[i][0]\n\t\t\t\t\t)}px)\n\t\t\t\t\ttranslateY(${parseInt(\n\t\t\t\t\t\tthis.itemsInitPosition[i][1] -\n\t\t\t\t\t\t\tthis.itemsIterPosition[i][1]\n\t\t\t\t\t)}px);\n\t\t\t\t`;\n\t\t\t}\n\t\t});\n\n\t\tthis.animateItems();\n\t}\n\n\tanimateItems() {\n\t\tconst transitionValue = `transform ${this.settings.duration}ms cubic-bezier(0.455, 0.03, 0.515, 0.955), opacity ${this.settings.duration}ms`;\n\t\tlet j = 0;\n\n\t\tthis.sortList.forEach((sortItem) => {\n\t\t\tconst item = this.items[sortItem[1]];\n\n\t\t\tif (\n\t\t\t\titem.classList.contains('u-hide') ||\n\t\t\t\t!this.filterList[sortItem[1]]\n\t\t\t) {\n\t\t\t\tthis.itemsFinalPosition[sortItem[1]] =\n\t\t\t\t\tthis.itemsIterPosition[sortItem[1]];\n\t\t\t\tif (item.getAttribute('data-scale') === 'on') j++;\n\t\t\t} else {\n\t\t\t\tthis.itemsFinalPosition[sortItem[1]] = [\n\t\t\t\t\tthis.itemsGrid[j][0],\n\t\t\t\t\tthis.itemsGrid[j][1],\n\t\t\t\t];\n\t\t\t\tj++;\n\t\t\t}\n\t\t});\n\n\t\tsetTimeout(() => {\n\t\t\tthis.items.forEach((item, i) => {\n\t\t\t\tconst translateX = parseInt(\n\t\t\t\t\tthis.itemsFinalPosition[i][0] - this.itemsIterPosition[i][0]\n\t\t\t\t);\n\t\t\t\tconst translateY = parseInt(\n\t\t\t\t\tthis.itemsFinalPosition[i][1] - this.itemsIterPosition[i][1]\n\t\t\t\t);\n\n\t\t\t\tif (\n\t\t\t\t\tthis.filterList[i] &&\n\t\t\t\t\titem.getAttribute('data-scale') === 'on'\n\t\t\t\t) {\n\t\t\t\t\t// Scale up item\n\t\t\t\t\titem.style.cssText = `\n\t\t\t\t\t\t${this.accelerateStyle}\n\t\t\t\t\t\ttransition: ${transitionValue};\n\t\t\t\t\t\ttransform: translateX(${translateX}px) translateY(${translateY}px) scale(1);\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t`;\n\t\t\t\t} else if (this.filterList[i]) {\n\t\t\t\t\t// Translate item\n\t\t\t\t\titem.style.cssText = `\n\t\t\t\t\t\t${this.accelerateStyle}\n\t\t\t\t\t\ttransition: ${transitionValue};\n\t\t\t\t\t\ttransform: translateX(${translateX}px) translateY(${translateY}px);\n\t\t\t\t\t`;\n\t\t\t\t} else {\n\t\t\t\t\t// Scale down item\n\t\t\t\t\titem.style.cssText = `\n\t\t\t\t\t\t${this.accelerateStyle}\n\t\t\t\t\t\ttransition: ${transitionValue};\n\t\t\t\t\t\ttransform: scale(0.5);\n\t\t\t\t\t\topacity: 0;\n\t\t\t\t\t`;\n\t\t\t\t}\n\t\t\t});\n\t\t}, 50);\n\n\t\t// Wait for the end of the transition of visible elements before resetting items\n\t\tsetTimeout(() =>
139 {\n\t\t\tthis.resetItems();\n\t\t}, this.settings.duration + 100);\n\t}\n\n\tresetItems() {\n\t\t// Animation is off or animation is over, reset attributes\n\t\tthis.items.forEach((item, i) => {\n\t\t\titem.removeAttribute('style');\n\t\t\tthis.toggleClass(item, 'u-hide', !this.filterList[i]);\n\t\t\titem.removeAttribute('data-scale');\n\t\t});\n\n\t\t// Reorder\n\t\tthis.sortList.forEach((sortItem) => {\n\t\t\tthis.element.appendChild(this.items[sortItem[1]]);\n\t\t});\n\n\t\tthis.items = Array.from(\n\t\t\tthis.element.querySelectorAll('.js-filter__item')\n\t\t);\n\t\tthis.resetFilterSortArray(false, true);\n\t\tthis.element.removeAttribute('style');\n\t\tthis.animating = false;\n\n\t\tif (this.reanimate) {\n\t\t\tthis.updateFilterArray();\n\t\t}\n\n\t\t// Toggle fallback message\n\t\tthis.resetFallbackMessage(false);\n\n\t\t// Emit custom event, end of filtering\n\t\tthis.element.dispatchEvent(new CustomEvent('filter-selection-updated'));\n\t}\n\n\tresetFilterSortArray(filtering, sorting) {\n\t\tthis.items.forEach((item, index) => {\n\t\t\tif (filtering) this.filterList[index] = true;\n\t\t\tif (sorting) this.sortList[index] = [item, index];\n\t\t});\n\t}\n\n\tcreateGridInfo() {\n\t\tconst containerWidth = parseFloat(\n\t\t\twindow.getComputedStyle(this.element).getPropertyValue('width')\n\t\t);\n\n\t\tlet colNumber;\n\t\tlet margins = [0, 0];\n\t\tlet itemWidth, marginX, marginY;\n\n\t\tArray.from(this.items)\n\t\t\t.filter((item) => !item.classList.contains('u-hide'))\n\t\t\t.some((item) => {\n\t\t\t\tconst itemStyle = window.getComputedStyle(item);\n\t\t\t\titemWidth = parseFloat(itemStyle.getPropertyValue('width'));\n\t\t\t\tmarginX =\n\t\t\t\t\tparseFloat(itemStyle.getPropertyValue('margin-left')) +\n\t\t\t\t\tparseFloat(itemStyle.getPropertyValue('margin-right'));\n\t\t\t\tmarginY =\n\t\t\t\t\tparseFloat(itemStyle.getPropertyValue('margin-bottom')) +\n\t\t\t\t\tparseFloat(itemStyle.getPropertyValue('margin-top'));\n\n\t\t\t\tif (marginX === 0 && marginY === 0) {\n\t\t\t\t\t// Grid is using the gap property and not margins\n\t\t\t\t\tmargins = this.resetMarginValues();\n\t\t\t\t\tmarginX = margins[0];\n\t\t\t\t\tmarginY = margins[1];\n\t\t\t\t}\n\n\t\t\t\tcolNumber = parseInt(\n\t\t\t\t\t(containerWidth + marginX) / (itemWidth + marginX)\n\t\t\t\t);\n\n\t\t\t\tthis.itemsGrid[0] = [item.offsetLeft, item.offsetTop];\n\n\t\t\t\treturn true; // Stop iteration after finding the first visible item\n\t\t\t});\n\n\t\tArray.from(this.items).forEach((item, i) => {\n\t\t\tif (!item.classList.contains('u-hide')) {\n\t\t\t\tconst x = i < colNumber ? i : i % colNumber;\n\t\t\t\tconst y = i < colNumber ? 0 : Math.floor(i / colNumber);\n\n\t\t\t\tthis.itemsGrid[i] = [\n\t\t\t\t\tthis.itemsGrid[0][0] + x * (item.offsetWidth + margins[0]),\n\t\t\t\t\tthis.itemsGrid[0][1] + y * (item.offsetHeight + margins[1]),\n\t\t\t\t];\n\t\t\t}\n\t\t});\n\t}\n\n\tstoreOffset(array) {\n\t\tthis.items.forEach((item, i) => {\n\t\t\tarray[i] = [item.offsetLeft, item.offsetTop];\n\t\t});\n\t}\n\n\tinitItemsOrder() {\n\t\tthis.items.forEach((item, i) => {\n\t\t\titem.setAttribute('data-init-sort-order', i);\n\t\t});\n\t}\n\n\trestoreSortOrder() {\n\t\tthis.items.forEach((item) => {\n\t\t\tconst sortOrder = parseInt(\n\t\t\t\titem.getAttribute('data-init-sort-order')\n\t\t\t);\n\t\t\tthis.sortList[sortOrder] = [item, sortOrder];\n\t\t});\n\t}\n\n\tresetFallbackMessage(bool) {\n\t\tif (!this.fallbackMessage) return;\n\n\t\tconst show = this.filterList.every((filter) => !filter);
139\n\n\t\tif (bool) {\n\t\t\tif (!show) this.addClass(this.fallbackMessage, 'u-hide');\n\t\t\treturn;\n\t\t}\n\n\t\tthis.toggleClass(this.fallbackMessage, 'u-hide', !show);\n\t}\n\n\tgetMultipleSelectValues(multipleSelect) {\n\t\tconst options = Array.from(multipleSelect.options);\n\t\tlet value = '';\n\n\t\toptions.forEach((option) => {\n\t\t\tif (option.selected) {\n\t\t\t\tif (value !== '') value += ':';\n\t\t\t\tvalue += option.value;\n\t\t\t}\n\t\t});\n\n\t\treturn value;\n\t}\n\n\tresetMarginValues() {\n\t\tconst gapX = getComputedStyle(this.element).getPropertyValue('--gap-x');\n\t\tconst gapY = getComputedStyle(this.element).getPropertyValue('--gap-y');\n\t\tconst gap = getComputedStyle(this.element).getPropertyValue('--gap');\n\t\tlet gridGap = [0, 0];\n\n\t\tconst createNewDiv = (width, height) => {\n\t\t\tconst newDiv = document.createElement('div');\n\t\t\tnewDiv.style.cssText = `position: absolute; opacity: 0; width: ${width}; height: ${height}`;\n\t\t\tthis.element.appendChild(newDiv);\n\t\t\tconst boundingRect = newDiv.getBoundingClientRect();\n\t\t\tthis.element.removeChild(newDiv);\n\t\t\treturn [boundingRect.width, boundingRect.height];\n\t\t};\n\n\t\tif (gapX && gapY) {\n\t\t\tgridGap = createNewDiv(gapX, gapY);\n\t\t} else if (gap) {\n\t\t\tgridGap = createNewDiv(gap, gap);\n\t\t} else if (gapX) {\n\t\t\tgridGap = createNewDiv(gapX, '0px');\n\t\t} else if (gapY) {\n\t\t\tgridGap = createNewDiv('0px', gapY);\n\t\t} else {\n\t\t\tconst calculatedGapX = this.getGridGap(\n\t\t\t\t'columns',\n\t\t\t\tthis.element.offsetWidth\n\t\t\t);\n\t\t\tconst calculatedGapY = this.getGridGap(\n\t\t\t\t'rows',\n\t\t\t\tthis.element.offsetHeight\n\t\t\t);\n\t\t\tconst finalGapY = isNaN(calculatedGapY)\n\t\t\t\t? calculatedGapX\n\t\t\t\t: calculatedGapY;\n\n\t\t\tgridGap = createNewDiv(calculatedGapX, finalGapY);\n\t\t}\n\n\t\treturn gridGap;\n\t}\n\n\tgetGridGap(direction, containerSize) {\n\t\tconst computedStyle = getComputedStyle(this.element);\n\t\tconst template = computedStyle.getPropertyValue(\n\t\t\t`grid-template-${direction}`\n\t\t);\n\t\tconst arrayEl = template.split(' ');\n\t\tconst gap =\n\t\t\t(containerSize - parseFloat(arrayEl[0]) * arrayEl.length) /\n\t\t\t(arrayEl.length - 1);\n\n\t\treturn `${gap}px`;\n\t}\n\n\ttoggleClass(el, className, bool) {\n\t\tbool ? this.addClass(el, className) : this.removeClass(el, className);\n\t}\n\n\taddClass(el, className) {\n\t\tconst classList = className.split(' ');\n\t\tArray.from(classList).forEach((cls) => el.classList.add(cls));\n\t}\n\n\tremoveClass(el, className) {\n\t\tconst classList = className.split(' ');\n\t\tArray.from(classList).forEach((cls) => el.classList.remove(cls));\n\t}\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/filter.js?\n}"); 140 141/***/ }, 142 143/***/ "./src/resources/assets/js/frontend/filterNav.js" 144/*!*******************************************************!*\ 145 !*** ./src/resources/assets/js/frontend/filterNav.js ***! 146 \*******************************************************/ 147(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 148 149"use strict"; 150eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FilterNav: () => (/* binding */ FilterNav)\n/* harmony export */ });\n/* harmony import */ var _debounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./debounce */ \"./src/resources/assets/js/frontend/debounce.js\");\n/* harmony import */ var _extendProps__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./extendProps */ \"./src/resources/assets/js/frontend/extendProps.js\");\n\n\n\n/**\n * Filter Navigation\n */\nclass FilterNav {\n\tstatic defaults = {\n\t\texpandedClass: 'c-filter-nav--expanded',\n\t\tcollapsedClass: 'c-filter-nav--collapsed',\n\t\titemClass: 'c-filter-nav__item',\n\t};\n\n\tconstructor(settings) {\n\t\tthis.settings = (0,_extendProps__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(FilterNav.defaults, settings);\n\t\tthis.element = this.settings.element;\n\t\tthis.button = this.element.querySelector('.js-filter-nav__button');\n\t\tthis.label = this.element.querySelector('.js-filter-nav__label');\n\t\tthis.dropdown = this.element.querySelector('.js-filter-nav__dropdown');\n\t\tthis.layout = 'expanded';\n\t\tthis.activeItem = this.dropdown.querySelector(\n\t\t\t`.${this.settings.itemClass}[aria-current=\"true\"]`\n\t\t);\n\n\t\tthis.checkLayout();\n\t\tthis.bindEvents();\n\t}\n\n\tbindEvents() {\n\t\tthis.element.addEventListener('layout', () =>
150 this.checkLayout());\n\t\tthis.button.addEventListener('click', () =>\n\t\t\tthis.toggleDropdown(!this.isDropdownOpen())\n\t\t);\n\t\tthis.dropdown.addEventListener('click', (event) =>\n\t\t\tthis.handleItemClick(event)\n\t\t);\n\t\twindow.addEventListener(\n\t\t\t'resize',\n\t\t\t(0,_debounce__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(() => this.doneResizing(), 100)\n\t\t);\n\n\t\tif (document.fonts) {\n\t\t\tdocument.fonts.onloadingdone = this.doneResizing.bind(this);\n\t\t}\n\n\t\twindow.addEventListener('keyup', (event) => {\n\t\t\t// Close dropdown on ESC\n\t\t\tif (\n\t\t\t\tevent.key &&\n\t\t\t\tevent.key.toLowerCase() === 'escape' &&\n\t\t\t\tthis.isDropdownOpen()\n\t\t\t) {\n\t\t\t\tthis.toggleDropdown(false);\n\t\t\t}\n\n\t\t\t// Close dropdown when tabing beond last item\n\t\t\tif (\n\t\t\t\tevent.key &&\n\t\t\t\tevent.key.toLowerCase() === 'tab' &&\n\t\t\t\tthis.isDropdownOpen() &&\n\t\t\t\t!this.isActiveElementWithinDropdown()\n\t\t\t) {\n\t\t\t\tthis.toggleDropdown(false);\n\t\t\t}\n\t\t});\n\n\t\t// Close dropdown when clicking outside it\n\t\twindow.addEventListener('click', (event) => {\n\t\t\tif (!this.button.contains(event.target) && this.isDropdownOpen()) {\n\t\t\t\tthis.toggleDropdown(false);\n\t\t\t}\n\t\t});\n\t}\n\n\tcheckLayout() {\n\t\tconst shouldCollapse =\n\t\t\tthis.layout === 'expanded' && this.switchToCollapsed();\n\t\tconst shouldExpand =\n\t\t\tthis.layout === 'collapsed' && this.switchToExpanded();\n\n\t\tif (shouldCollapse) {\n\t\t\tthis.layout = 'collapsed';\n\t\t\tthis.toggleLayoutClasses(\n\t\t\t\tthis.settings.expandedClass,\n\t\t\t\tthis.settings.collapsedClass\n\t\t\t);\n\t\t\tthis.button.classList.remove('u-hide');\n\t\t} else if (shouldExpand) {\n\t\t\tthis.layout = 'expanded';\n\t\t\tthis.toggleLayoutClasses(\n\t\t\t\tthis.settings.collapsedClass,\n\t\t\t\tthis.settings.expandedClass\n\t\t\t);\n\t\t\tthis.button.classList.add('u-hide');\n\t\t}\n\n\t\tif (this.layout === 'expanded') {\n\t\t\tthis.placeMarker();\n\t\t}\n\t}\n\n\ttoggleLayoutClasses(classToRemove, classToAdd) {\n\t\tthis.element.classList.remove(classToRemove);\n\t\tthis.element.classList.add(classToAdd);\n\t}\n\n\thandleItemClick(event) {\n\t\tconst item = event.target.closest('.js-filter-nav__item');\n\n\t\tif (item) {\n\t\t\tthis.updateCurrentItem(item);\n\t\t}\n\t}\n\n\tupdateCurrentItem(item) {\n\t\tif (item === this.activeItem) {\n\t\t\tthis.toggleDropdown(false);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.activeItem) {\n\t\t\tthis.activeItem.removeAttribute('aria-current');\n\t\t}\n\n\t\tthis.activeItem = item;\n\t\tthis.activeItem.setAttribute('aria-current', 'true');\n\t\tthis.label.textContent = item.textContent;\n\t\tthis.toggleDropdown(false);\n\n\t\tif (this.layout === 'expanded') {\n\t\t\tthis.placeMarker();\n\t\t}\n\t}\n\n\ttoggleDropdown(bool) {\n\t\tthis.button.setAttribute('aria-expanded', bool);\n\t\tthis.dropdown.classList.toggle('is-visible', bool);\n\n\t\tif (\n\t\t\t!bool &&\n\t\t\tthis.isDropdownOpen() &&\n\t\t\t!this.isActiveElementWithinDropdown()\n\t\t) {\n\t\t\tthis.toggleDropdown(false);\n\t\t} else if (bool) {\n\t\t\tconst focusableElement = this.dropdown.querySelector(\n\t\t\t\t'[href], button:not([disabled])'\n\t\t\t);\n\t\t\tif (focusableElement) focusableElement.focus();\n\t\t} else {\n\t\t\tthis.button.focus();\n\t\t}\n\t}\n\n\tisDropdownOpen() {\n\t\treturn (\n\t\t\tthis.button.getAttribute('aria-expanded') === 'true' &&\n\t\t\tthis.isVisible(this.button)\n\t\t);\n\t}\n\n\tisVisible(element) {\n\t\treturn !!(\n\t\t\telement.offsetWidth ||\n\t\t\telement.offsetHeight ||\n\t\t\telement.getClientRects().length\n\t\t);\n\t}\n\n\tisActiveElementWithinDropdown() {\n\t\tconst activeElement = this.element.ownerDocument.activeElement;\n\t\treturn (\n\t\t\tactiveElement &&\n\t\t\tactiveElement.closest('.js-filter-nav__dropdown') === this.dropdown\n\t\t);\n\t}\n\n\tplaceMarker() {\n\t\tif (this.activeItem) {\n\t\t\tthis.element.style.setProperty(\n\t\t\t\t'--marker-width',\n\t\t\t\t`${this.activeItem.offsetWidth}px`\n\t\t\t);\n\t\t\tthis.element.style.setProperty(\n\t\t\t\t'--marker-offset',\n\t\t\t\t`${this.activeItem.offsetLeft}px`\n\t\t\t);\n\t\t}\n\t}\n\n\tswitchToCollapsed() {\n\t\treturn this.dropdown.scrollWidth > this.dropdown.offsetWidth;\n\t}\n\n\tswitchToExpanded() {\n\t\tthis.element.style.visibility = 'hidden';
150\n\t\tthis.toggleLayoutClasses(\n\t\t\tthis.settings.collapsedClass,\n\t\t\tthis.settings.expandedClass\n\t\t);\n\n\t\tconst switchLayout =\n\t\t\tthis.dropdown.scrollWidth <= this.dropdown.offsetWidth;\n\n\t\tthis.toggleLayoutClasses(\n\t\t\tthis.settings.expandedClass,\n\t\t\tthis.settings.collapsedClass\n\t\t);\n\t\tthis.element.style.visibility = 'visible';\n\n\t\treturn switchLayout;\n\t}\n\n\tdoneResizing() {\n\t\tthis.element.dispatchEvent(new CustomEvent('layout'));\n\t}\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/filterNav.js?\n}"); 151 152/***/ }, 153 154/***/ "./src/resources/assets/js/frontend/frontend.js" 155/*!******************************************************!*\ 156 !*** ./src/resources/assets/js/frontend/frontend.js ***! 157 \******************************************************/ 158(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 159 160"use strict"; 161eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var a11y_dialog__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! a11y-dialog */ \"./node_modules/a11y-dialog/dist/a11y-dialog.esm.js\");\n/* harmony import */ var glightbox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! glightbox */ \"./node_modules/glightbox/dist/js/glightbox.min.js\");\n/* harmony import */ var glightbox__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(glightbox__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _hero__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./hero */ \"./src/resources/assets/js/frontend/hero.js\");\n/* harmony import */ var _lists__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lists */ \"./src/resources/assets/js/frontend/lists.js\");\n/* harmony import */ var _accordion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./accordion */ \"./src/resources/assets/js/frontend/accordion.js\");\n/* harmony import */ var _clickarea__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./clickarea */ \"./src/resources/assets/js/frontend/clickarea.js\");\n/* harmony import */ var _background__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./background */ \"./src/resources/assets/js/frontend/background.js\");\n/* harmony import */ var _headingBackground__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./headingBackground */ \"./src/resources/assets/js/frontend/headingBackground.js\");\n/* harmony import */ var _imageGalleryMosaic__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./imageGalleryMosaic */ \"./src/resources/assets/js/frontend/imageGalleryMosaic.js\");\n/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./map */ \"./src/resources/assets/js/frontend/map.js\");\n/* harmony import */ var _targetBlank__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./targetBlank */ \"./src/resources/assets/js/frontend/targetBlank.js\");\n/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./filter */ \"./src/resources/assets/js/frontend/filter.js\");\n/* harmony import */ var _filterNav__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./filterNav */ \"./src/resources/assets/js/frontend/filterNav.js\");\n/* harmony import */ var _scrollWatcher__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./scrollWatcher */ \"./src/resources/assets/js/frontend/scrollWatcher.js\");\n/* harmony import */ var _select__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./select */ \"./src/resources/assets/js/frontend/select.js\");\n/* harmony import */ var _multi_select__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./multi-select */ \"./src/resources/assets/js/frontend/multi-select.js\");\n/* harmony import */ var _filter_tags__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./filter-tags */ \"./src/resources/assets/js/frontend/filter-tags.js\");\n/* harmony import */ var _loadMoreModule__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./loadMoreModule */ \"./src/resources/assets/js/frontend/loadMoreModule.js\");\n/* harmony import */ var _tabs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./tabs */ \"./src/resources/assets/js/frontend/tabs.js\");\n/* harmony import */ var _checkDevice__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./checkDevice */ \"./src/resources/assets/js/frontend/checkDevice.js\");\n/* harmony import */ var _header__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./header */ \"./src/resources/assets/js/frontend/header.js\");\n/* harmony import */ var _breadcrumb__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./breadcrumb */ \"./src/resources/assets/js/frontend/breadcrumb.js\");\n/* harmony import */ var _autocomplete__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./autocomplete */ \"./src/resources/assets/js/frontend/autocomplete.js\");\n/* harmony import */ var _headerOffset__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./headerOffset */ \"./src/resources/assets/js/frontend/headerOffset.js\");\n/* harmony import */ var _quotesSlider__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./quotesSlider */ \"./src/resources/assets/js/frontend/quotesSlider.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n(function () {\n _checkDevice__WEBPACK_IMPORTED_MODULE_19__.CheckDevice.init();\n\n /**\n * Header Offset\n */\n new _headerOffset__WEBPACK_IMPORTED_MODULE_23__.HeaderOffset();\n\n /**\n * Header\n */\n const mainHeader = document.querySelector(\".ams-header\");\n if (mainHeader) {\n new _header__WEBPACK_IMPORTED_MODULE_20__.Header({ element: mainHeader });\n }\n\n /**\n * Breadcrumb\n */\n const breadcrumb = document.querySelector(\".c-breadcrumb\");\n if (breadcrumb) {\n new _breadcrumb__WEBPACK_IMPORTED_MODULE_21__.Breadcrumb({ element: breadcrumb });\n }\n\n /**\n * Lightbox\n */\n const gallerySelector = \"[data-lightbox]\";\n\n const galleries = {};\n\n let lastFocusedElement;\n\n // Group elements by gallery\n document.querySelectorAll(gallerySelector).forEach((element) => {\n const galleryId = element.getAttribute(\"data-gallery\") || \"default\";\n if (!galleries[galleryId]) {\n galleries[galleryId] = [];\n }\n galleries[galleryId].push(element);\n });\n\n // Loop through each gallery\n Object.keys(galleries).forEac
161h((galleryId) => {\n const galleryElements = galleries[galleryId];\n\n // Create a nav counter for this gallery\n const nav = document.createElement(\"div\");\n nav.classList.add(\"gcounter\");\n nav.dataset.indicator = \"/\";\n\n // Loop through gallery items and set aria-labels\n galleryElements.forEach((element, index) => {\n const totalSlides = galleryElements.length;\n const slideNumber = index + 1;\n element.setAttribute(\n \"aria-label\",\n `Slide ${slideNumber} of ${totalSlides}`,\n );\n });\n\n // Determine the selector for GLightbox initialization\n const selector =\n galleryId === \"default\"\n ? \"[data-lightbox]:not([data-gallery])\"\n : `[data-lightbox][data-gallery=\"${galleryId}\"]`;\n\n const slides = glightbox__WEBPACK_IMPORTED_MODULE_1___default()({\n selector,\n slideEffect: \"fade\",\n moreText: \"Se mer\",\n autoplayVideos: false,\n\n // Use regular functions for callbacks\n onOpen() {\n // Append the nav counter to the modal\n slides.modal.appendChild(nav);\n nav.dataset.indicator = `1 / ${slides.elements.length}`;\n\n // Store the last focused element if not already stored\n if (!lastFocusedElement) {\n lastFocusedElement = document.activeElement;\n }\n },\n onClose() {\n // Restore focus to the last focused element\n if (\n lastFocusedElement &&\n typeof lastFocusedElement.focus === \"function\"\n ) {\n lastFocusedElement.focus();\n lastFocusedElement = null; // Reset for the next time\n }\n },\n afterSlideChange(prev, next) {\n nav.dataset.indicator = `${next.index + 1} / ${slides.elements.length}`;\n nav.classList.add(\"gcounter-added\");\n\n // Update the next button's aria-label after each slide change\n const nextButton = slides.modal.querySelector(\".gnext\");\n if (nextButton) {\n if (nextButton.classList.contains(\"disabled\")) {\n nextButton.setAttribute(\"aria-label\", \"Du är på den sista bilden\");\n nextButton.setAttribute(\"data-taborder\", \"2\");\n } else {\n nextButton.setAttribute(\"aria-label\", \"Nästa bild\");\n nextButton.setAttribute(\"data-taborder\", \"2\");\n }\n }\n // Update the prev button's aria-label after each slide change\n const prevButton = slides.modal.querySelector(\".gprev\");\n if (prevButton) {\n if (prevButton.classList.contains(\"disabled\")) {\n prevButton.setAttribute(\"aria-label\", \"Du är på den första bilden\");\n prevButton.setAttribute(\"data-taborder\", \"1\");\n } else {\n prevButton.setAttribute(\n \"aria-label\",\n \"Tillbaka till föregående bild\",\n );\n prevButton.setAttribute(\"data-taborder\", \"1\");\n }\n }\n },\n });\n });\n\n /**\n * Buttons Lightbox\n */\n if (document.querySelector(\".c-btn--popup\")) {\n let lastFocusedButton;\n\n document.querySelectorAll(\".c-btn--popup\").forEach((button) => {\n button.addEventListener(\"click\", (event) => {\n lastFocusedButton = event.currentTarget;\n });\n });\n\n new (glightbox__WEBPACK_IMPORTED_MODULE_1___default())({\n selector: \".c-btn--popup\",\n slideEffect: \"fade\",\n touchNavigation: false,\n keyboardNavigation: true,\n autoplayVideos: false,\n autofocusVideos: true,\n skin: \"ams-buttons\",\n plyr: {\n config: {\n youtube: {\n cc_load_policy: 1,\n cc_lang_pref: \"sv\",\n },\n },\n },\n onOpen: () => {\n setTimeout(() => {\n const controls = document.querySelector(\n \".gslide.current .plyr__controls\",\n );\n if (controls.firstChild) {\n controls.firstChild.focus();\n }\n }, 1200);\n },\n onClose: () => {\n setTimeout(() =>
161 {\n if (lastFocusedButton) {\n lastFocusedButton.focus();\n }\n }, 100);\n },\n });\n }\n\n /**\n * Heading Background\n */\n if (document.querySelector(\".ams-text-background\")) {\n document.querySelectorAll(\".c-heading\").forEach((el) => {\n new _headingBackground__WEBPACK_IMPORTED_MODULE_7__.HeadingBackground({\n $el: el,\n wordClass: \"word\",\n subWordClass: \".sub-word\",\n subWordWrapClass: \".sub-words\",\n });\n });\n }\n\n /**\n * Point Plan Accordion\n */\n if (document.querySelector(\".ams-point-plan\")) {\n const pointPlanAccordions = Array.from(\n document.querySelectorAll(\".ams-point-plan__ac\"),\n );\n\n if (pointPlanAccordions) {\n let count = 0;\n let id = null;\n\n pointPlanAccordions.forEach((item) => {\n id = \"pont-plan-ac-\" + count;\n item.id = id;\n\n new _accordion__WEBPACK_IMPORTED_MODULE_4__.Accordion(\"#\" + id, {\n enableMultiple: true,\n });\n\n count++;\n });\n }\n }\n\n /**\n * Accordion block\n */\n if (document.querySelector(\".ams-accordion_module\")) {\n const accordionBlocks = Array.from(\n document.querySelectorAll(\".ams-accordion_module\"),\n );\n\n if (accordionBlocks) {\n accordionBlocks.forEach((item, index) => {\n let uniqueId = item.id || \"ams-accordion-\" + index;\n item.setAttribute(\"data-accordion-id\", uniqueId);\n new _accordion__WEBPACK_IMPORTED_MODULE_4__.Accordion(`[data-accordion-id=\"${uniqueId}\"]`, {\n onlyChildNodes: false,\n });\n });\n }\n }\n\n /**\n * Click Area\n */\n if (document.querySelector(\"[data-click-area]\")) {\n document.querySelectorAll(\"[data-click-area]\").forEach((el) => {\n new _clickarea__WEBPACK_IMPORTED_MODULE_5__.ClickArea(el);\n });\n }\n\n /**\n * Hero block\n */\n if (document.querySelector(\".ams-hero\")) {\n new _hero__WEBPACK_IMPORTED_MODULE_2__.Hero({\n hero: \".ams-hero\",\n heroContent: \".ams-hero__content\",\n header: \".header_wrapper\",\n adminBar: \"#wpadminbar\",\n transparentHeader: \"body.has-transparent-header--desktop\",\n });\n }\n\n /**\n * Background\n */\n if (document.querySelector(\".c-bg\")) {\n new _background__WEBPACK_IMPORTED_MODULE_6__.Background({\n imgContainer: \".c-bg--img\",\n imgSettings: \"data-settings\",\n videoContainer: \".c-bg--video\",\n });\n }\n\n /**\n * Lists Block\n */\n if (document.querySelector(\".ams-lists\")) {\n new _lists__WEBPACK_IMPORTED_MODULE_3__.Lists({\n accordionBreakpoint: 767,\n });\n }\n\n /**\n * Card Accordion\n */\n if (document.querySelector(\".c-card-ac\")) {\n const CardAccordions = Array.from(document.querySelectorAll(\".c-card-ac\"));\n\n if (CardAccordions) {\n CardAccordions.forEach((item, index) => {\n let uniqueId = item.id || \"card-ac-\" + index;\n item.setAttribute(\"data-accordion-id\", uniqueId);\n\n new _accordion__WEBPACK_IMPORTED_MODULE_4__.Accordion(`[data-accordion-id=\"${uniqueId}\"]`, {\n itemClass: \"c-card-ac__item\",\n triggerClass: \"c-card-ac__trigger\",\n bodyClass: \"c-card-ac__body\",\n enableMultiple: true,\n });\n });\n }\n }\n\n // Mosaic Image Gallery\n if (document.querySelector(\".c-gallery[data-variant=mosaic]\")) {\n document\n .querySelectorAll(\".c-gallery[data-variant=mosaic]\")\n .forEach((el) => {\n new _imageGalleryMosaic__WEBPACK_IMPORTED_MODULE_8__.ImageGalleryMosaic({\n $el: el,\n item: \"c-gallery__item\",\n pagination: \".c-gallery__num\",\n prev: \".c-gallery__nav .prev\",\n next: \".c-gallery__nav .next\",\n });\n });\n }\n\n /**\n * Map\n */\n if (document.querySelector(\".ams-map\")) {\n new _map__WEBPACK_IMPORTED_MODULE_9__.Map({\n accordionBreakpoint: 767,\n });\n }\n\n /**\n * WCAG - Screen reader for new tab links\n */\n if (document.querySelector('main#content a[target=\"_blank\"]')) {\n document\n .querySelectorAll('main#content a[target=\"_blank\"]')\n .forEach((link) =>
161 {\n (0,_targetBlank__WEBPACK_IMPORTED_MODULE_10__.TargetBlank)(link);\n });\n }\n\n // Filter Navigation\n if (document.querySelector(\".js-filter-nav\")) {\n document.querySelectorAll(\".js-filter-nav\").forEach((element) => {\n new _filterNav__WEBPACK_IMPORTED_MODULE_12__.FilterNav({\n element,\n });\n });\n }\n\n // Filter\n const filterGrid = document.getElementsByClassName(\"js-filter\");\n if (filterGrid.length > 0) {\n Array.from(filterGrid).forEach((element) => {\n let duration = element.getAttribute(\"data-filter-duration\");\n if (!duration) duration = _filter__WEBPACK_IMPORTED_MODULE_11__.Filter.defaults.duration;\n\n new _filter__WEBPACK_IMPORTED_MODULE_11__.Filter({\n element,\n duration,\n });\n });\n }\n\n /**\n * Scroll watcher\n */\n if (document.getElementById(\"wrapper-navbar\")) {\n new _scrollWatcher__WEBPACK_IMPORTED_MODULE_13__.ScrollWatcher({\n wrapperNavId: \"wrapper-navbar\",\n headerWrapper: \".header_wrapper\",\n });\n }\n\n // Custom Select\n if (document.querySelector(\".js-select\")) {\n document.querySelectorAll(\".js-select\").forEach((element) => {\n new _select__WEBPACK_IMPORTED_MODULE_14__.Select({\n element,\n });\n });\n }\n\n // Custom Multi Select\n if (document.querySelector(\".js-multi-select\")) {\n document.querySelectorAll(\".js-multi-select\").forEach((element) => {\n new _multi_select__WEBPACK_IMPORTED_MODULE_15__.MultiSelect({\n element,\n });\n });\n }\n\n // Filter Tags\n if (document.querySelector(\".js-filter-tags\")) {\n document.querySelectorAll(\".js-filter-tags\").forEach((element) => {\n new _filter_tags__WEBPACK_IMPORTED_MODULE_16__.FilterTags({ element });\n });\n }\n\n // Load More Functionality for all found modules\n if (document.querySelector(\".js-load-more\")) {\n document.querySelectorAll(\".js-load-more\").forEach((moduleElement) => {\n new _loadMoreModule__WEBPACK_IMPORTED_MODULE_17__.LoadMoreModule({\n moduleElement: moduleElement,\n });\n });\n }\n\n // Tabs\n if (document.querySelector(\".js-tabs\")) {\n document.querySelectorAll(\".js-tabs\").forEach((element) => {\n new _tabs__WEBPACK_IMPORTED_MODULE_18__.Tabs({\n element,\n });\n });\n }\n\n if (document.querySelector(\".card-accordion\")) {\n document.querySelectorAll(\".card-accordion\").forEach((element) => {\n new _accordion__WEBPACK_IMPORTED_MODULE_4__.Accordion(element, {\n itemClass: \"card-accordion__item\",\n triggerClass: \"card-accordion__trigger\",\n bodyClass: \"card-accordion__body\",\n enableMultiple: false,\n onlyChildNodes: false,\n });\n });\n }\n\n // Autocomplete - WordPress Search\n const searchAutocomplete = document.querySelector(\n \".search-form .js-autocomplete\",\n );\n if (searchAutocomplete) {\n new _autocomplete__WEBPACK_IMPORTED_MODULE_22__.Autocomplete({\n element: searchAutocomplete,\n debounce: 300,\n characters: 2,\n onClick: function (option, obj, event, cb) {\n // Check if the result has a URL for direct navigation\n const linkElement = option.querySelector(\"[data-autocomplete-url]\");\n const url = linkElement ? linkElement.getAttribute(\"href\") : null;\n\n if (url && url !== \"#\") {\n // Navigate directly to the result\n window.location.href = url;\n cb();\n return;\n }\n\n // Fallback: Set the input value and submit the form\n const labelElement = option.querySelector(\"[data-autocomplete-label]\");\n const selectedText = labelElement\n ? labelElement.textContent\n : option.textContent;\n\n obj.input.value = selectedText;\n obj.input.closest(\"form\").submit();\n cb();\n },\n });\n }\n})();\n\n// Quotes Block: Slider\nif (document.querySelector(\".ams-quote__slider\")) {\n document.querySelectorAll(\".ams-quote__slider\").forEach((el) => {\n new _quotesSlider__WEBPACK_IMPORTED_MODULE_24__.QuotesSlider({\n $el: el,\n item: \"swiper-slide\",\n pagination: el.querySelector(\".ams-quote__pagination\"),\n prev: el.querySelector(\".ams-quote__nav.prev\"),\n next: el.querySelector(\".ams-quote__nav.next\"),\n slidesPerView: el.dataset.slidesPerView,\
161n });\n });\n}\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/frontend.js?\n}"); 162 163/***/ }, 164 165/***/ "./src/resources/assets/js/frontend/header.js" 166/*!****************************************************!*\ 167 !*** ./src/resources/assets/js/frontend/header.js ***! 168 \****************************************************/ 169(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 170 171"use strict"; 172eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Header: () => (/* binding */ Header)\n/* harmony export */ });\n/* harmony import */ var _extendProps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extendProps */ \"./src/resources/assets/js/frontend/extendProps.js\");\n/* harmony import */ var _debounce__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./debounce */ \"./src/resources/assets/js/frontend/debounce.js\");\n/* harmony import */ var _iconSwitch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./iconSwitch */ \"./src/resources/assets/js/frontend/iconSwitch.js\");\n\n\n\n\n/**\n * Header\n *\n * Handles navigation, search, scroll behavior and keyboard navigation.\n */\nclass Header {\n /**\n * Default settings for the Header component.\n */\n static defaults = {\n // Event configuration\n layoutChangeEventName: \"header:layoutChange\",\n\n // Layout and viewport configuration\n mobileBreakpoint: 1024,\n defaultSubLayout: \"flyout\",\n viewportPadding: 20,\n\n // Scroll behavior configuration\n hideHeaderThreshold: 150,\n hideBackgroundThreshold: 50,\n\n // Animation configuration\n animationTiming: null, // Populated from CSS var --header-animation-timing\n fallbackAnimationTiming: 500,\n\n // Timing configuration\n debounceDelay: 250,\n initializationDelay: 100,\n activeNavDelay: 50,\n searchFocusDelay: 50,\n keyboardNavDelay: 0,\n\n // Navigation tolerances and thresholds\n positionTolerance: 5,\n columnHorizontalTolerance: 50,\n sameRowTolerance: 50,\n horizontalDistanceWeight: 0.1,\n\n // State class names\n classOpen: \"is-open\",\n classHasChildren: \"has-children\",\n classActive: \"is-active\",\n classBackground: \"has-background\",\n classTransparent: \"is-transparent\",\n classOverflowHidden: \"u-overflow-y-hidden\",\n\n // Overlay class names\n overlayClasses: [\n \"c-overlay--dark\",\n \"c-overlay--fixed\",\n \"c-overlay--animated\",\n ],\n\n // Wrapper class names\n megaWrapClass: \"mega-wrap\",\n containerClass: \"h-container l-container\",\n\n // DOM element selectors\n selectors: {\n navContainer: \".js-header-nav\",\n nav: \".c-nav\",\n navItem: \".c-nav__item\",\n subNav: \".c-sub-nav\",\n subNavItem: \".c-sub-nav__item\",\n subNavLeftClass: \"c-sub-nav--left\",\n primaryNav: \".ams-header__nav__primary\",\n secondaryNav: \".ams-header__nav__secondary\",\n actionNav: \".ams-header__nav__action\",\n searchContainer: \".js-header-search\",\n searchForm: \".js-header-search-form\",\n searchInput: \".c-search__input\",\n searchQuickLinksLabel: \".search-quick-links__label\",\n searchQuickLinks: \".search-quick-links__list\",\n searchContactLabel: \".search-contact__label\",\n searchContactInfo: \".search-contact__info\",\n mobileNavToggle: \".js-header-mobile-nav-toggle\",\n mobileSearchToggle: \".js-header-mobile-search-toggle\",\n desktopSearchToggle: \".js-header-desktop-search-toggle\",\n ctaButton: \".js-header-cta\",\n bodyOverlay: \".js-body-overlay\",\n },\n\n // Data attribute names\n dataAttributes: {\n singleSub: \"data-single-sub\",\n activeOpen: \"data-active-open\",\n position: \"data-position\",\n subLayout: \"data-sub-layout\",\n },\n\n // CSS custom properties\n cssVars: {\n headerHeight: \"--header-height\",\n headerAnimationTiming: \"--header-animation-timing\",\n },\n };\n\n constructor(settings) {\n this.settings = (0,_extendProps__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Header.defaults, settings);\n\n // Cache DOM elements\n this.cacheElements();\n\n // Component state\n this.initializeState();\n\n // Bind methods that need 'this' context\n this.bindMethods();\n\n // Get animation timing and initialize component\n this.settings.animationTiming = this.getAnimationTiming();\n this.init();\n }\n\n /**\n * Cache frequently accessed DOM elements\n */\n cacheElements() {\n this.element = this.settings.element;\n this.navContainer = this.element.querySelector(\n this.settings.selectors.navContainer,\n );\n this.nav = this.element.querySelector(this.settings.selectors.nav);\n this.searchContainer = this.element.querySelector(\n this.settings.selectors.searchContainer,\n );\n this.searchInput = this.element.querySelector(\n this.settings.selectors.searchInput,\n );\n this.navToggleBtn = this.element.querySelector(\n this.settings.selectors.mobileNavToggle,\n );\n this.searchToggleBtn = this.element.querySelector(\n this.settings.selectors.mobileSearchToggle,\n );\n this.desktopSearchToggleBtn = this.element.querySelector(\n this.settings.selectors.desktopSearchToggle,\n );\n this.ctaButton = this.element.querySelector(\n this.settings.selectors.ctaButton,\n );\n this.hasChildrenItems = this.element.querySelectorAll(\n `.${this.settings.classHasChildren}`,\n );\n this.topLevelNavItems = this.nav?.querySelectorAll(\n `:scope > ${this.settings.selectors.nav} > .${this.settings.classHasChildren}`,\n );\n this.searchOverlay = document.querySelector(\n this.settings.selectors.bodyOverlay,\n );\n }\n\n /**\n * Initialize component state\n */\n initializeState() {\n this.isMobileView = false;\n this.isTransitioning = false;\n this.singleSubNav =\n this.element.getAttribute(this.settings.dataAttributes.singleSub) ===\n \"on\";\n this.activeOpen =\n this.element.getAttribute(this.settings.dataAttributes.activeOpen) ===\n \"on\";\n\n // Header state for scroll behavior\n this.headerHeight = 0;\n this.headerTop = this.getHeaderOffsetFromCSS();\n this.isHidden = false;\n this.previousTop = window.scrollY;\n this.currentTop = window.scrollY;\n this.isInitialized = false;\n this.scrollRAF = null;\n }\n\n /**\n * Binds class methods to preserve 'this' context\n */\n bindMethods() {\
172n this.setLayout = this.setLayout.bind(this);\n this.debouncedSetLayout = (0,_debounce__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(\n this.setLayout,\n this.settings.debounceDelay,\n );\n this.updateHeaderOffsetFromCSS = this.updateHeaderOffsetFromCSS.bind(this);\n this.handleDocumentClick = this.handleDocumentClick.bind(this);\n this.checkMobileView = this.checkMobileView.bind(this);\n this.openActiveSubNavs = this.openActiveSubNavs.bind(this);\n this.handleKeyPress = this.handleKeyPress.bind(this);\n this.handleNavKeyPress = this.handleNavKeyPress.bind(this);\n this.checkSubNavAlignment = this.checkSubNavAlignment.bind(this);\n this.handleScroll = this.handleScroll.bind(this);\n this.handleFocusOut = this.handleFocusOut.bind(this);\n }\n\n /**\n * Initialize the header component\n */\n init() {\n this.initializeIconSwitches();\n this.setupSubNavs();\n this.setupSubNavClickHandlers();\n this.bindEvents();\n this.checkMobileView();\n this.setLayout();\n this.setupAnimationDelays();\n\n // Open active sub navs on init if conditions are met\n if (\n this.isMobileView &&\n this.navContainer.classList.contains(this.settings.classOpen) &&\n this.activeOpen\n ) {\n this.openActiveSubNavs();\n }\n }\n\n /**\n * Initialize icon switches for toggle buttons\n */\n initializeIconSwitches() {\n const iconSwitchConfigs = [\n {\n button: this.navToggleBtn,\n property: \"navIconSwitch\",\n container: this.navContainer,\n },\n {\n button: this.searchToggleBtn,\n property: \"searchIconSwitch\",\n container: this.searchContainer,\n },\n {\n button: this.desktopSearchToggleBtn,\n property: \"desktopSearchIconSwitch\",\n container: this.searchContainer,\n },\n ];\n\n iconSwitchConfigs.forEach(({ button, property, container }) => {\n if (button) {\n this[property] = new _iconSwitch__WEBPACK_IMPORTED_MODULE_2__.IconSwitch({ element: button });\n const isOpen = container.classList.contains(this.settings.classOpen);\n if (isOpen) {\n this[property].toggle(true);\n }\n }\n });\n }\n\n /**\n * Set up all event listeners\n */\n bindEvents() {\n // Use delegated click handler for header interactions\n this.element.addEventListener(\"click\", (e) => {\n const navToggle = e.target.closest(\n this.settings.selectors.mobileNavToggle,\n );\n const searchToggle = e.target.closest(\n this.settings.selectors.mobileSearchToggle,\n );\n const desktopSearchToggle = e.target.closest(\n this.settings.selectors.desktopSearchToggle,\n );\n\n if (navToggle) {\n const isOpen = !this.navContainer.classList.contains(\n this.settings.classOpen,\n );\n this.toggleNav(isOpen);\n } else if (searchToggle || desktopSearchToggle) {\n const isOpen = !this.searchContainer.classList.contains(\n this.settings.classOpen,\n );\n this.toggleSearch(isOpen);\n }\n });\n\n // Layout changes\n window.addEventListener(\"resize\", () => {\n this.checkMobileView();\n this.debouncedSetLayout();\n });\n\n // Document click for closing sub navs\n document.addEventListener(\"click\", this.handleDocumentClick);\n\n // Keyboard navigation\n document.addEventListener(\"keydown\", this.handleKeyPress);\n if (this.navContainer) {\n this.navContainer.addEventListener(\"keydown\", this.handleNavKeyPress);\n }\n\n // Scroll handling\n const position = this.element.getAttribute(\n this.settings.dataAttributes.position,\n );\n if (position === \"scroll\" || position === \"fixed\") {\n setTimeout(() => {\n this.isInitialized = true;\n this.previousTop = window.scrollY;\n this.currentTop = window.scrollY;\n window.addEventListener(\"scroll\", this.handleScroll, {\n passive: true,\n });\n }, this.settings.initializationDelay);\n }\n\n // Focus management\n document.addEventListener(\"focusin\", this.handleFocusOut);\n\n // Observe changes to root style (e.g., --header-offset updates)\n this.rootStyleObserver = new MutationObserver(() =>
172 {\n this.updateHeaderOffsetFromCSS();\n });\n this.rootStyleObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"style\"],\n });\n\n // Recalculate layout when header content resizes (e.g. logo loads)\n if (window.ResizeObserver) {\n this._headerResizeObserver = new ResizeObserver(() => {\n this.debouncedSetLayout();\n });\n this._headerResizeObserver.observe(this.element);\n }\n }\n\n /**\n * Check if current view is mobile and handle view changes\n */\n checkMobileView() {\n const wasMobile = this.isMobileView;\n this.isMobileView = window.innerWidth < this.settings.mobileBreakpoint;\n\n // Handle view changes\n if (wasMobile !== this.isMobileView) {\n this.closeAllSubNavs();\n\n if (!this.isMobileView) {\n this.closeNav();\n }\n\n this.setupSubNavs();\n this.setupAnimationDelays();\n }\n }\n\n /**\n * Update header layout and dispatch layout change event\n */\n setLayout() {\n const height = `${this.element.offsetHeight}px`;\n this.headerHeight = this.element.offsetHeight;\n\n // Refresh header offset from CSS variable in case it changed with layout\n this.headerTop = this.getHeaderOffsetFromCSS();\n\n document.documentElement.style.setProperty(\n this.settings.cssVars.headerHeight,\n height,\n );\n\n const event = new CustomEvent(this.settings.layoutChangeEventName, {\n detail: {\n height,\n element: this.element,\n },\n bubbles: true,\n });\n this.element.dispatchEvent(event);\n\n // Show header if it's hidden during resize\n if (\n this.element.getAttribute(this.settings.dataAttributes.position) ===\n \"scroll\" &&\n this.isHidden\n ) {\n this.showHeader();\n }\n }\n\n /**\n * Restore buttons back to links in sub-navigation\n */\n restoreSubNavLinks() {\n this.unwrapMegaSubNavs();\n\n const items = this.element.querySelectorAll(\n `.${this.settings.classHasChildren}`,\n );\n items.forEach((item) => {\n const button = item.querySelector(\":scope > button\");\n if (!button) {\n return;\n }\n\n const link = document.createElement(\"a\");\n link.href = \"#\";\n link.className = button.className;\n link.textContent =\n button.querySelector(\"span\")?.textContent || button.textContent;\n\n // Preserve ARIA semantics when restoring link\n link.setAttribute(\"aria-haspopup\", \"menu\");\n\n button.parentNode.replaceChild(link, button);\n });\n }\n\n /**\n * Unwrap all mega subnavs by removing the mega-wrap structure\n */\n unwrapMegaSubNavs() {\n const megaWraps = this.element.querySelectorAll(\n `.${this.settings.megaWrapClass}`,\n );\n megaWraps.forEach((megaWrap) => {\n const subNav = megaWrap.querySelector(this.settings.selectors.subNav);\n if (subNav) {\n megaWrap.parentNode.insertBefore(subNav, megaWrap);\n megaWrap.remove();\n }\n });\n }\n\n /**\n * Set up sub-navigation functionality\n */\n setupSubNavs() {\n this.restoreSubNavLinks();\n\n const items = this.element.querySelectorAll(\n `.${this.settings.classHasChildren}`,\n );\n items.forEach((item) => {\n const link = item.querySelector(\":scope > a\");\n if (!link) {\n return;\n }\n\n const isMainNavItem =\n item.closest(this.settings.selectors.nav) &&\n item.parentElement.matches(this.settings.selectors.nav);\n\n const subNav = item.querySelector(\n `:scope > ${this.settings.selectors.subNav}`,\n );\n let layout = this.settings.defaultSubLayout;\n\n if (subNav) {\n const itemLayout = item.getAttribute(\n this.settings.dataAttributes.subLayout,\n );\n const ancestorLayout = item\n .closest(`[${this.settings.dataAttributes.subLayout}]`)\n ?.getAttribute(this.settings.dataAttributes.subLayout);\n layout = itemLayout || ancestorLayout || this.settings.defaultSubLayout;\n\n // Handle mega layout wrapping for main nav items\n if (layout === \"mega\" && isMainNavItem) {\n this.wrapMegaSubNav(subNav);\n }\n }\n\n // Convert to button if conditions are met\n const shouldConvertToButton =\n isMainNavItem || layout === \"flyout\" || this.isMobileView;\n\n if (shouldConvertToButton) {\n this.convertLinkToButton(link);\n }\n });\n }\n\n /**\n * Convert a link to a button with proper ARIA attributes\n * @param {HTMLElement} link - The link element to convert\n */\n convertLinkToButton(link) {\n const btn = document.createElement(\"button\");\n btn.type = \"button\";\n btn.className = link.className;
172\n btn.setAttribute(\"aria-expanded\", \"false\");\n btn.setAttribute(\"aria-haspopup\", \"menu\");\n\n btn.innerHTML = `\n\t\t\t<span>${link.textContent}</span>\n\t\t\t<svg class=\"c-icon c-icon--arrow\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\" focusable=\"false\">\n\t\t\t\t<g class=\"c-icon__group\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n\t\t\t\t\t<path d=\"M2 2l12 12\"></path>\n\t\t\t\t\t<path d=\"M14 2L2 14\"></path>\n\t\t\t\t</g>\n\t\t\t</svg>\n\t\t`;\n\n link.parentNode.replaceChild(btn, link);\n }\n\n /**\n * Wrap subnav in mega layout structure for desktop view\n * @param {HTMLElement} subNav - The subnav element to wrap\n */\n wrapMegaSubNav(subNav) {\n if (\n this.isMobileView ||\n subNav.closest(`.${this.settings.megaWrapClass}`)\n ) {\n return;\n }\n\n const megaWrap = document.createElement(\"div\");\n megaWrap.className = this.settings.megaWrapClass;\n\n const megaContainer = document.createElement(\"div\");\n megaContainer.className = this.settings.containerClass;\n\n subNav.parentNode.insertBefore(megaWrap, subNav);\n megaWrap.appendChild(megaContainer);\n megaContainer.appendChild(subNav);\n }\n\n /**\n * Set up click handlers for sub-navigation buttons\n */\n setupSubNavClickHandlers() {\n if (this.nav) {\n this.nav.addEventListener(\"click\", (e) => {\n const btn = e.target.closest(\n `.${this.settings.classHasChildren} > button`,\n );\n if (!btn) {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n\n const item = btn.parentElement;\n const subNav = item.querySelector(\n `:scope > ${this.settings.selectors.subNav}`,\n );\n\n // Close search if open\n if (this.searchContainer.classList.contains(this.settings.classOpen)) {\n this.closeSearch();\n }\n\n this.toggleSubNav(item, btn);\n\n // Check alignment for desktop flyout\n if (!this.isMobileView && subNav) {\n this.checkSubNavAlignment(subNav);\n }\n });\n }\n }\n\n /**\n * Get animation sequences configuration for mobile elements\n */\n getAnimationSequences() {\n return [\n {\n name: \"navigation\",\n startDelay: 4, // 0.4s\n elements: [\n {\n selector: `${this.settings.selectors.primaryNav} ${this.settings.selectors.navItem}`,\n multiple: true,\n },\n {\n selector: `${this.settings.selectors.secondaryNav} ${this.settings.selectors.navItem}`,\n multiple: true,\n },\n { selector: this.settings.selectors.actionNav, multiple: false },\n ],\n },\n {\n name: \"search\",\n startDelay: 4, // 0.4s\n elements: [\n { selector: this.settings.selectors.searchForm, multiple: false },\n {\n selector: this.settings.selectors.searchQuickLinksLabel,\n multiple: false,\n },\n {\n selector: `${this.settings.selectors.searchQuickLinks} ${this.settings.selectors.navItem}`,\n multiple: true,\n },\n {\n selector: this.settings.selectors.searchContactLabel,\n multiple: false,\n },\n {\n selector: this.settings.selectors.searchContactInfo,\n multiple: false,\n },\n ],\n },\n ];\n }\n\n /**\n * Set up staggered animation delays for mobile view\n */\n setupAnimationDelays() {\n if (!this.isMobileView) {\n return;\n }\n\n this.clearAnimationDelays();\n\n this.getAnimationSequences().forEach((sequence) => {\n this.applyAnimationSequence(sequence);\n });\n }\n\n /**\n * Apply animation delays to a sequence of elements\n * @param {Object} sequence - The animation sequence configuration\n */\n applyAnimationSequence(sequence) {\n const animationElements = [];\n let delayIndex = sequence.startDelay;\n const delayIncrement = 1; // 0.1s increments\n\n // Collect all elements in the sequence\n sequence.elements.forEac
172h((elementConfig) => {\n const elements = elementConfig.multiple\n ? this.element.querySelectorAll(elementConfig.selector)\n : [this.element.querySelector(elementConfig.selector)].filter(Boolean);\n\n elements.forEach((element) => {\n if (element) {\n animationElements.push({ element, delay: delayIndex / 10 });\n delayIndex += delayIncrement;\n }\n });\n });\n\n // Apply delays to all elements\n animationElements.forEach(({ element, delay }) => {\n element.style.setProperty(\"--nav-animation-delay\", `${delay}s`);\n });\n }\n\n /**\n * Clear animation delay properties from all elements\n */\n clearAnimationDelays() {\n const selectors = new Set();\n\n this.getAnimationSequences().forEach((sequence) => {\n sequence.elements.forEach((elementConfig) => {\n selectors.add(elementConfig.selector);\n });\n });\n\n const allElements = this.element.querySelectorAll(\n Array.from(selectors).join(\", \"),\n );\n allElements.forEach((element) => {\n element.style.removeProperty(\"--nav-animation-delay\");\n });\n }\n\n /**\n * Toggle component state with proper sequencing\n * @param {boolean} isOpen - Whether to open the component\n * @param {Function} openMethod - Method to open the component\n * @param {Function} closeMethod - Method to close the component\n * @param {HTMLElement} otherComponent - Other component to check\n * @param {Function} otherCloseMethod - Method to close other component\n */\n toggleComponent(\n isOpen,\n openMethod,\n closeMethod,\n otherComponent,\n otherCloseMethod,\n ) {\n if (isOpen && otherComponent.classList.contains(this.settings.classOpen)) {\n otherCloseMethod.call(this);\n setTimeout(() => openMethod.call(this), this.settings.animationTiming);\n return;\n }\n\n if (isOpen) {\n openMethod.call(this);\n } else {\n closeMethod.call(this);\n }\n }\n\n /**\n * Toggle navigation menu state\n * @param {boolean} isOpen - Whether to open the navigation\n */\n toggleNav(isOpen) {\n this.toggleComponent(\n isOpen,\n this.openNav,\n this.closeNav,\n this.searchContainer,\n this.closeSearch,\n );\n }\n\n /**\n * Toggle search component state\n * @param {boolean} isOpen - Whether to open the search\n */\n toggleSearch(isOpen) {\n this.toggleComponent(\n isOpen,\n this.openSearch,\n this.closeSearch,\n this.navContainer,\n this.closeNav,\n );\n }\n\n /**\n * Open component with common setup\n * @param {HTMLElement} container - The container element\n * @param {HTMLElement} toggleButton - The toggle button element\n * @param {Object} iconSwitch - The icon switch instance\n * @param {Function} setupCallback - Setup callback function\n */\n openComponent(container, toggleButton, iconSwitch, setupCallback) {\n this.isTransitioning = true;\n this.element.classList.add(this.settings.classOpen);\n container.classList.add(this.settings.classOpen);\n toggleButton?.setAttribute(\"aria-expanded\", \"true\");\n iconSwitch?.toggle(true);\n document.documentElement.classList.add(this.settings.classOverflowHidden);\n // Reflect header open state on body for cross-component styling needs\n document.body.classList.add(\"header-is-open\");\n\n if (setupCallback) {\n setupCallback();\n }\n\n const focusableElements = this.getFocusableElements(container);\n if (focusableElements.length === 0) {\n container.setAttribute(\"tabindex\", \"-1\");\n }\n\n setTimeout(() => {\n this.setLayout();\n this.isTransitioning = false;\n }, this.settings.animationTiming);\n }\n\n /**\n * Open navigation menu\n */\n openNav() {\n this.openComponent(\n this.navContainer,\n this.navToggleBtn,\n this.navIconSwitch,\n () => {\n if (this.isMobileView) {\n this.setupAnimationDelays();\n if (this.activeOpen) {\n setTimeout(this.openActiveSubNavs, this.settings.activeNavDelay);\n }\n }\n },\n );\n }\n\n /**\n * Open search component\n */\n openSearch() {\n this.openComponent(\n this.searchContainer,\n this.searchToggleBtn,\n this.searchIconSwitch,\n () => {\n if (!this.isMobileView) {\n this.setSearchHeight();\n } else {\n this.setupAnimationDelays();\n }\n\n // Handle desktop search toggle\n this.desktopSearchToggleBtn?.setAttribute(\"aria-expanded\", \"true\");\n this.desktopSearchIconSwitch?.toggle(true);\n\n // Handle overlay\n if (this.searchOverlay) {\n this.settings.overlayClasse
172s.forEach((className) => {\n this.searchOverlay.classList.add(className);\n });\n }\n\n setTimeout(\n () => this.searchInput?.focus(),\n this.settings.searchFocusDelay,\n );\n },\n );\n }\n\n /**\n * Close component with common cleanup\n * @param {HTMLElement} container - The container element\n * @param {HTMLElement} toggleButton - The toggle button element\n * @param {Object} iconSwitch - The icon switch instance\n * @param {Function} cleanupCallback - Cleanup callback function\n */\n closeComponent(container, toggleButton, iconSwitch, cleanupCallback) {\n if (this.isTransitioning) {\n return;\n }\n\n this.isTransitioning = true;\n this.element.classList.remove(this.settings.classOpen);\n container.classList.remove(this.settings.classOpen);\n toggleButton?.setAttribute(\"aria-expanded\", \"false\");\n iconSwitch?.reset();\n\n if (cleanupCallback) {\n cleanupCallback();\n }\n\n // Remove overflow hidden if no other components are open\n if (!this.hasOtherComponentsOpen(container)) {\n document.documentElement.classList.remove(\n this.settings.classOverflowHidden,\n );\n // Remove body state if nothing else is open\n document.body.classList.remove(\"header-is-open\");\n }\n\n setTimeout(() => {\n this.setLayout();\n this.isTransitioning = false;\n }, this.settings.animationTiming);\n\n container.removeAttribute(\"tabindex\");\n }\n\n /**\n * Close navigation menu\n */\n closeNav() {\n this.closeComponent(\n this.navContainer,\n this.navToggleBtn,\n this.navIconSwitch,\n () => {\n if (this.isMobileView) {\n this.navContainer.style.height = \"0\";\n setTimeout(() => {\n if (\n !this.navContainer.classList.contains(this.settings.classOpen)\n ) {\n this.navContainer.style.height = \"\";\n }\n }, this.settings.animationTiming);\n }\n },\n );\n }\n\n /**\n * Close search component\n */\n closeSearch() {\n this.closeComponent(\n this.searchContainer,\n this.searchToggleBtn,\n this.searchIconSwitch,\n () => {\n // Handle desktop search toggle\n this.desktopSearchToggleBtn?.setAttribute(\"aria-expanded\", \"false\");\n this.desktopSearchIconSwitch?.reset();\n\n // Handle overlay\n if (this.searchOverlay) {\n this.settings.overlayClasses.forEach((className) => {\n this.searchOverlay.classList.remove(className);\n });\n }\n\n this.searchContainer.style.height = \"0\";\n setTimeout(() => {\n if (\n !this.searchContainer.classList.contains(this.settings.classOpen)\n ) {\n this.searchContainer.style.height = \"\";\n }\n }, this.settings.animationTiming);\n },\n );\n }\n\n /**\n * Check if other components are open\n * @param {HTMLElement} excludeContainer - Container to exclude from check\n */\n hasOtherComponentsOpen(excludeContainer) {\n const containers = [this.navContainer, this.searchContainer].filter(\n (c) => c !== excludeContainer,\n );\n return containers.some((container) =>\n container.classList.contains(this.settings.classOpen),\n );\n }\n\n /**\n * Closes sub-navigation menus based on provided options\n * @param {Object} options - Options for closing sub-navs\n * @param {HTMLElement} [options.excludeItem] - Item to exclude from closing\n * @param {boolean} [options.parentOnly] - Only close parent level items\n * @param {boolean} [options.siblingOnly] - Only close sibling items\n * @private\n */\n closeSubNavs(options = {}) {\n const {\n excludeItem = null,\n parentOnly = false,\n siblingOnly = false,\n } = options;\n\n let itemsToClose;\n\n if (siblingOnly && excludeItem) {\n const parent = excludeItem.parentElement;\n itemsToClose = Array.from(\n parent.querySelectorAll(`:scope > .${this.settings.classHasChildren}`),\n ).filter((item) => item !== excludeItem);\n } else if (parentOnly) {\n itemsToClose = Array.from(this.topLevelNavItems || []).filter(\n (item) => item !== excludeItem,\n );\n } else {\n itemsToClose = Array.from(this.hasChildrenItems).filter(\n (item) =>\n item.classList.contains(this.settings.classOpen) &&\n (!excludeItem || item !== excludeItem),\n );\n }\n\n // Batch DOM updates\n itemsToClose.forEach((item) => {\n item.classList.remove(this.settings.classOpen);\n const button = item.querySelector(\"button\");\n if (button) {\n button.setAttribute(\"aria-expanded\", \"false\");\n }\n\n // Handle mega layout closing\n this.handleMegaLayoutClosing(item);\n });\n\n this.afterAnimation(() =>
172 {\n this.setLayout();\n });\n }\n\n /**\n * Closes all open sub-navigation menus\n * @private\n */\n closeAllSubNavs() {\n this.closeSubNavs();\n }\n\n /**\n * Closes sibling sub-navigation menus at the same level\n * @param {HTMLElement} currentItem - The current item whose siblings should be closed\n * @private\n */\n closeSiblingSubNavs(currentItem) {\n this.closeSubNavs({ excludeItem: currentItem, siblingOnly: true });\n }\n\n /**\n * Closes all other top-level sub-navigation menus\n * @param {HTMLElement} currentItem - The current item to exclude from closing\n * @private\n */\n closeOtherSubNavs(currentItem) {\n this.closeSubNavs({ excludeItem: currentItem, parentOnly: true });\n }\n\n /**\n * Toggles a sub-navigation menu\n * @param {HTMLElement} item - The navigation item containing the sub-nav\n * @param {HTMLElement} btn - The button that toggles the sub-nav\n * @private\n */\n toggleSubNav(item, btn) {\n // First batch: Read state\n const isOpen = item.classList.contains(this.settings.classOpen);\n const parentSubNav = item.closest(this.settings.selectors.subNav);\n const megaWrap = item.querySelector(`.${this.settings.megaWrapClass}`);\n\n // Second batch: Write updates\n if (!this.isMobileView) {\n // In desktop view\n if (!parentSubNav) {\n // If it's a top-level item, close all other top-level items first\n this.closeAllSubNavs();\n } else {\n // If it's in a sub-nav, only close siblings at the same level\n this.closeSiblingSubNavs(item);\n }\n } else if (this.singleSubNav) {\n // In mobile view, handle single sub-nav option\n const parentNavItem = item.closest(this.settings.selectors.navItem);\n if (parentNavItem) {\n this.closeSiblingSubNavs(item);\n } else {\n this.closeOtherSubNavs(item);\n }\n }\n\n // Handle mega layout height animation (desktop only)\n if (!this.isMobileView && megaWrap) {\n if (!isOpen) {\n this.setMegaHeight(megaWrap);\n } else {\n megaWrap.style.height = \"0\";\n }\n }\n\n // Toggle the clicked item\n item.classList.toggle(this.settings.classOpen, !isOpen);\n btn.setAttribute(\"aria-expanded\", !isOpen);\n\n // Toggle mega wrap open class\n if (megaWrap) {\n megaWrap.classList.toggle(this.settings.classOpen, !isOpen);\n }\n\n this.afterAnimation(() => {\n this.setLayout();\n });\n }\n\n /**\n * Handles clicks outside the navigation menu\n * Closes all sub-navs in desktop view when clicking outside the navigation\n * @param {MouseEvent} event - The click event\n * @private\n */\n handleDocumentClick(event) {\n if (!this.isMobileView && this.nav && !this.nav.contains(event.target)) {\n this.closeAllSubNavs();\n }\n }\n\n /**\n * Opens sub-navigation menus for active items or items with active children\n * Only applies in mobile view\n * @private\n */\n openActiveSubNavs() {\n if (!this.isMobileView) {\n return;\n }\n\n // First batch: Read all DOM states\n const itemsToUpdate = Array.from(this.hasChildrenItems)\n .filter((item) => item.matches(this.settings.selectors.navItem))\n .map((item) => {\n // Read operations\n const isItemActive = item.classList.contains(this.settings.classActive);\n const hasActiveChild =\n item.querySelector(`.${this.settings.classActive}`) !== null;\n const button = item.querySelector(\"button\");\n\n return { item, button, shouldOpen: isItemActive || hasActiveChild };\n })\n .filter(({ shouldOpen, button }) => shouldOpen && button);\n\n // Second batch: Write all DOM updates\n itemsToUpdate.forEach(({ item, button }) => {\n item.classList.add(this.settings.classOpen);\n button.setAttribute(\"aria-expanded\", \"true\");\n });\n\n // Final layout update\n this.setLayout();\n }\n\n /**\n * Handles keyboard events for the entire header\n * @param {KeyboardEvent} event - The keyboard event\n * @private\n */\n handleKeyPress(event) {\n if (event.key === \"Tab\") {\n // Handle search container\n if (this.searchContainer.classList.contains(this.settings.classOpen)) {\n const focusableElements = this.getFocusableElements(\n this.searchContainer,\n );\n const firstFocusable = focusableElements[0];\n const lastFocusable = focusableElements[focusableElements.length - 1];\n\n // Handle forward tab from last element\n if (document.activeElement === lastFocusable && !event.shiftKey) {\n event.preventDefault();\n this.closeSearch();\n if (this.isMobileView) {\n this.searchToggleBtn?.focu
172s();\n } else {\n this.desktopSearchToggleBtn?.focus();\n }\n }\n // Handle backward tab from first element\n else if (document.activeElement === firstFocusable && event.shiftKey) {\n event.preventDefault();\n this.closeSearch();\n if (this.isMobileView) {\n this.searchToggleBtn?.focus();\n } else {\n this.desktopSearchToggleBtn?.focus();\n }\n }\n // Handle tab from toggle button into search container\n else if (\n (document.activeElement === this.desktopSearchToggleBtn ||\n document.activeElement === this.searchToggleBtn) &&\n !event.shiftKey &&\n firstFocusable\n ) {\n event.preventDefault();\n firstFocusable.focus();\n }\n }\n\n // Handle nav container\n if (this.navContainer.classList.contains(this.settings.classOpen)) {\n const focusableElements = this.getFocusableElements(this.navContainer);\n const firstFocusable = focusableElements[0];\n const lastFocusable = focusableElements[focusableElements.length - 1];\n\n // Handle forward tab from last element\n if (document.activeElement === lastFocusable && !event.shiftKey) {\n event.preventDefault();\n this.closeNav();\n this.navToggleBtn?.focus();\n }\n // Handle backward tab from first element\n else if (document.activeElement === firstFocusable && event.shiftKey) {\n event.preventDefault();\n this.closeNav();\n this.navToggleBtn?.focus();\n }\n }\n }\n\n if (event.key === \"Escape\") {\n if (this.searchContainer.classList.contains(this.settings.classOpen)) {\n this.closeSearch();\n // Return focus to the button that opened the search\n if (this.isMobileView) {\n this.searchToggleBtn?.focus();\n } else {\n this.desktopSearchToggleBtn?.focus();\n }\n }\n if (this.navContainer.classList.contains(this.settings.classOpen)) {\n this.closeNav();\n this.navToggleBtn?.focus();\n }\n // Close any open subnavs in desktop view\n if (!this.isMobileView) {\n // Check if we're in a subnav\n const activeElement = document.activeElement;\n const subNavItem = activeElement?.closest(\n this.settings.selectors.subNavItem,\n );\n if (subNavItem) {\n const parentNavItem = subNavItem.closest(\n this.settings.selectors.navItem,\n );\n const parentButton = parentNavItem?.querySelector(\"button\");\n this.closeAllSubNavs();\n if (parentButton) {\n parentButton.focus();\n }\n } else {\n this.closeAllSubNavs();\n }\n }\n }\n }\n\n /**\n * Handles keyboard navigation within the nav menu\n * Manages arrow keys for navigation between menu items in primary nav, secondary nav, and action buttons\n * Implements ARIA keyboard interaction patterns\n * @param {KeyboardEvent} event - The keyboard event\n * @private\n */\n handleNavKeyPress(event) {\n const { key } = event;\n\n // Only handle navigation in desktop view\n if (this.isMobileView) {\n return;\n }\n\n // Find the currently focused element\n const focusedElement = document.activeElement;\n const isInSubNav = focusedElement.closest(this.settings.selectors.subNav);\n\n if (isInSubNav) {\n // Handle subnav navigation\n const currentSubNav = focusedElement.closest(\n this.settings.selectors.subNav,\n );\n const parentNavItem = currentSubNav.closest(\n this.settings.selectors.navItem,\n );\n const layout =\n parentNavItem?.getAttribute(this.settings.dataAttributes.subLayout) ||\n this.settings.defaultSubLayout;\n\n // Get navigation behavior based on layout\n if (layout === \"flyout\") {\n this.handleFlyoutNavigation(event, focusedElement, currentSubN
172av);\n } else if (layout === \"columns-2\" || layout === \"columns-3\") {\n this.handleColumnsNavigation(event, focusedElement, currentSubNav);\n } else if (layout === \"mega\") {\n this.handleGridNavigation(event, focusedElement, currentSubNav);\n }\n } else {\n // Get all top-level focusable elements in the navigation\n const primaryNavButtons = Array.from(\n this.element.querySelectorAll(\n `${this.settings.selectors.primaryNav} ${this.settings.selectors.navItem} > a, ${this.settings.selectors.primaryNav} ${this.settings.selectors.navItem} > button`,\n ),\n );\n const secondaryNavButtons = Array.from(\n this.element.querySelectorAll(\n `${this.settings.selectors.secondaryNav} ${this.settings.selectors.navItem} > a, ${this.settings.selectors.secondaryNav} ${this.settings.selectors.navItem} > button`,\n ),\n );\n const actionButtons = [\n this.desktopSearchToggleBtn,\n this.ctaButton,\n ].filter(Boolean);\n const allFocusableItems = [\n ...primaryNavButtons,\n ...secondaryNavButtons,\n ...actionButtons,\n ];\n const currentIndex = allFocusableItems.indexOf(focusedElement);\n\n if (currentIndex !== -1 || actionButtons.includes(focusedElement)) {\n switch (key) {\n case \"ArrowLeft\":\n event.preventDefault();\n const prevIndex =\n (currentIndex - 1 + allFocusableItems.length) %\n allFocusableItems.length;\n allFocusableItems[prevIndex].focus();\n break;\n\n case \"ArrowRight\":\n event.preventDefault();\n const nextIndex = (currentIndex + 1) % allFocusableItems.length;\n allFocusableItems[nextIndex].focus();\n break;\n\n case \"ArrowDown\":\n const currentNavItem = focusedElement.closest(\n this.settings.selectors.navItem,\n );\n\n if (\n currentNavItem?.classList.contains(this.settings.classHasChildren)\n ) {\n event.preventDefault();\n\n const btn = currentNavItem.querySelector(\"button\");\n if (\n btn &&\n !currentNavItem.classList.contains(this.settings.classOpen)\n ) {\n this.toggleSubNav(currentNavItem, btn);\n }\n\n const firstSubItem = currentNavItem.querySelector(\n `${this.settings.selectors.subNavItem} a, ${this.settings.selectors.subNavItem} button`,\n );\n if (firstSubItem) {\n // Check if this is a mega layout that needs animation time\n const megaWrap = currentNavItem.querySelector(\n `.${this.settings.megaWrapClass}`,\n );\n if (megaWrap && !this.isMobileView) {\n // Delay focus until after animation completes\n setTimeout(() => {\n firstSubItem.focus();\n }, this.settings.animationTiming);\n } else {\n firstSubItem.focus();\n }\n }\n }\n break;\n }\n }\n }\n }\n\n /**\n * Handles keyboard navigation for flyout layouts\n * @param {KeyboardEvent} event - The keyboard event\n * @param {HTMLElement} focusedElement - Currently focused element\n * @param {HTMLElement} currentSubNav - Current sub-navigation container\n * @private\n */\n handleFlyoutNavigation(event, focusedElement, currentSubNav) {\n const { key } = event;\n const subNavItems = Array.from(\n currentSubNav.querySelectorAll(\n `${this.settings.selectors.subNavItem} a, ${this.settings.selectors.subNavItem} button`,\n ),\n );\n const currentIndex = subNavItems.indexOf(focusedElement);\n\n switch (key) {\n case \"ArrowUp\":\n event.preventDefault();\n let prevIndex = currentIndex - 1;\n\n while (prevIndex >= 0) {\n const prevItem = subNavItems[prevIndex];\n\n if (\n prevItem.closest(this.settings.selectors.subNav) === currentSubN
172av\n ) {\n prevItem.focus();\n break;\n }\n\n prevIndex--;\n }\n\n if (prevIndex < 0) {\n const parentNavItem = currentSubNav.closest(\n this.settings.selectors.navItem,\n );\n const parentButton = parentNavItem?.querySelector(\"button\");\n\n if (parentButton) {\n this.closeSubNav(parentNavItem);\n parentButton.focus();\n }\n }\n break;\n\n case \"ArrowDown\":\n event.preventDefault();\n let nextIndex = currentIndex + 1;\n\n while (nextIndex < subNavItems.length) {\n const nextItem = subNavItems[nextIndex];\n\n if (\n nextItem.closest(this.settings.selectors.subNav) === currentSubNav\n ) {\n nextItem.focus();\n break;\n }\n\n nextIndex++;\n }\n break;\n\n case \"ArrowRight\":\n event.preventDefault();\n const currentItem = focusedElement.closest(\n this.settings.selectors.subNavItem,\n );\n\n if (currentItem?.classList.contains(this.settings.classHasChildren)) {\n const btn = currentItem.querySelector(\"button\");\n\n if (btn) {\n const isOpen = currentItem.classList.contains(\n this.settings.classOpen,\n );\n\n // Only open if it's not already open; don't toggle closed on ArrowRight\n if (!isOpen) {\n this.toggleSubNav(currentItem, btn);\n }\n\n const subNav = currentItem.querySelector(\n this.settings.selectors.subNav,\n );\n\n if (subNav) {\n const firstSubItem = subNav.querySelector(\n `${this.settings.selectors.subNavItem} a, ${this.settings.selectors.subNavItem} button`,\n );\n\n if (firstSubItem) {\n setTimeout(() => {\n firstSubItem.focus();\n }, this.settings.keyboardNavDelay);\n }\n }\n }\n }\n break;\n\n case \"ArrowLeft\":\n event.preventDefault();\n const parentSubNav = currentSubNav.closest(\n this.settings.selectors.subNav,\n );\n const focusedItem = focusedElement.closest(\n this.settings.selectors.subNavItem,\n );\n\n if (\n parentSubNav ||\n (focusedItem &&\n focusedItem.classList.contains(this.settings.classOpen))\n ) {\n const itemToClose = parentSubNav\n ? currentSubNav.closest(this.settings.selectors.subNavItem)\n : focusedItem;\n const btnToFocus = itemToClose?.querySelector(\"button\");\n\n if (btnToFocus) {\n this.closeSubNav(itemToClose);\n btnToFocus.focus();\n }\n }\n break;\n }\n }\n\n /**\n * Handles keyboard navigation for columns layouts\n * Uses DOM order navigation that respects CSS column flow\n * @param {KeyboardEvent} event - The keyboard event\n * @param {HTMLElement} focusedElement - Currently focused element\n * @param {HTMLElement} currentSubNav - Current sub-navigation container\n * @private\n */\n handleColumnsNavigation(event, focusedElement, currentSubNav) {\n const { key } = event;\n\n const navData = this.getSubNavItemsForKeyboardNav(currentSubNav);\n if (!navData) {\n return;\n }\n\n const { mainNavItem, subNavItems } = navData;\n const currentIndex = subNavItems.indexOf(focusedElement);\n\n if (currentIndex === -1) {\n return;\n }\n\n switch (key) {\n case \"ArrowUp\":\n event.preventDefault();\n const upTarget = this.findColumnsNavTarget(\n subNavItems,\n currentIndex,\n \"up\",\n );\n if (upTarget) {\n upTarget.focus();\n } else {\n this.navigateToParentAndClose(mainNavItem);\n }\n break;\n\n case \"ArrowDown\":\n event.preventDefault();\n const downTarget = this.findColumnsNavTarget(\n subNavItems,\n currentIndex,\n \"down\",\n );
172\n if (downTarget) {\n downTarget.focus();\n }\n break;\n\n case \"ArrowLeft\":\n event.preventDefault();\n const leftTarget = this.findColumnsNavTarget(\n subNavItems,\n currentIndex,\n \"left\",\n );\n if (leftTarget) {\n leftTarget.focus();\n } else {\n this.navigateToParentAndClose(mainNavItem);\n }\n break;\n\n case \"ArrowRight\":\n event.preventDefault();\n const rightTarget = this.findColumnsNavTarget(\n subNavItems,\n currentIndex,\n \"right\",\n );\n if (rightTarget) {\n rightTarget.focus();\n }\n break;\n }\n }\n\n /**\n * Handles keyboard navigation for grid layouts (mega)\n * @param {KeyboardEvent} event - The keyboard event\n * @param {HTMLElement} focusedElement - Currently focused element\n * @param {HTMLElement} currentSubNav - Current sub-navigation container\n * @private\n */\n handleGridNavigation(event, focusedElement, currentSubNav) {\n const { key } = event;\n\n const navData = this.getSubNavItemsForKeyboardNav(currentSubNav);\n if (!navData) {\n return;\n }\n\n const { mainNavItem, subNavItems } = navData;\n const currentIndex = subNavItems.indexOf(focusedElement);\n\n switch (key) {\n case \"ArrowUp\":\n event.preventDefault();\n const upTarget = this.findVerticalNavTarget(\n subNavItems,\n currentIndex,\n \"up\",\n );\n if (upTarget) {\n upTarget.focus();\n } else {\n this.navigateToParentAndClose(mainNavItem);\n }\n break;\n\n case \"ArrowDown\":\n event.preventDefault();\n const downTarget = this.findVerticalNavTarget(\n subNavItems,\n currentIndex,\n \"down\",\n );\n if (downTarget) {\n downTarget.focus();\n }\n break;\n\n case \"ArrowLeft\":\n event.preventDefault();\n const leftTarget = this.findHorizontalNavTarget(\n subNavItems,\n currentIndex,\n \"left\",\n );\n if (leftTarget) {\n leftTarget.focus();\n } else {\n this.navigateToParentAndClose(mainNavItem);\n }\n break;\n\n case \"ArrowRight\":\n event.preventDefault();\n const rightTarget = this.findHorizontalNavTarget(\n subNavItems,\n currentIndex,\n \"right\",\n );\n if (rightTarget) {\n rightTarget.focus();\n }\n break;\n }\n }\n\n /**\n * Finds the target element for vertical navigation (up/down) in grid layouts\n * @param {Array<HTMLElement>} subNavItems - Array of focusable sub-nav items\n * @param {number} currentIndex - Current item index\n * @param {string} direction - 'up' or 'down'\n * @return {HTMLElement|null} Target element or null if none found\n * @private\n */\n findVerticalNavTarget(subNavItems, currentIndex, direction) {\n const currentItem = subNavItems[currentIndex];\n const currentRect = currentItem.getBoundingClientRect();\n const currentCenterX = currentRect.left + currentRect.width / 2;\n\n let bestTarget = null;\n let bestDistance = Infinity;\n\n for (let i = 0; i < subNavItems.length; i++) {\n if (i === currentIndex) {\n continue;\n }\n\n const item = subNavItems[i];\n const itemRect = item.getBoundingClientRect();\n const itemCenterX = itemRect.left + itemRect.width / 2;\n\n // Check if item is in the correct vertical direction\n const isCorrectDirection =\n direction === \"up\"\n ? itemRect.top < currentRect.top - this.settings.positionTolerance\n : itemRect.top > currentRect.top + this.settings.positionTolerance;\n\n if (!isCorrectDirection) {\n continue;\n }\n\n // Calculate distance (prioritize vertical distance, then horizontal)\n const verticalDistance = Math.abs(itemRect.top - currentRect.top);\n const horizontalDistance = Math.abs(itemCenterX - currentCenterX);\n const totalDistance =\n verticalDistance +\n horizontalDistance * this.settings.horizontalDistanceWeight;\n\n if (totalDistance < bestDistance) {\n bestDistance = totalDistance;\n bestTarget = item;\n }\n }\n\n return bestTarget;\n }\n\n /**\n * Finds the target element for horizontal navigation (left/right) in grid layouts\n * @param {Array<HTMLElement>} subNavItems - Array of focusable sub-nav items\n * @param {number} currentIndex - Current item index\n * @param {string} direction - 'left' or 'right'\n * @return {HTMLElement|null} Target element or null if none found\n * @private\n */\n findHorizontalNavTarget(subNavItems, currentIndex, direction) {\n const currentItem = subNavItems[currentIndex];\n const currentRect = currentItem.getBoundingClientRect();\n const currentCenterY = currentRect.top + currentRect.height / 2;\n\n let bestTarget = null;\n let bestDistance = Infinity;\n\n for (let i = 0; i < subNavItems.length;
172 i++) {\n if (i === currentIndex) {\n continue;\n }\n\n const item = subNavItems[i];\n const itemRect = item.getBoundingClientRect();\n const itemCenterY = itemRect.top + itemRect.height / 2;\n\n // Check if item is in the correct horizontal direction\n const isCorrectDirection =\n direction === \"left\"\n ? itemRect.left < currentRect.left - this.settings.positionTolerance\n : itemRect.left > currentRect.left + this.settings.positionTolerance;\n\n if (!isCorrectDirection) {\n continue;\n }\n\n // Check if item is roughly on the same row (within reasonable tolerance)\n const verticalDistance = Math.abs(itemCenterY - currentCenterY);\n if (verticalDistance > this.settings.sameRowTolerance) {\n continue;\n }\n\n // Calculate horizontal distance\n const horizontalDistance = Math.abs(itemRect.left - currentRect.left);\n\n if (horizontalDistance < bestDistance) {\n bestDistance = horizontalDistance;\n bestTarget = item;\n }\n }\n\n return bestTarget;\n }\n\n /**\n * Finds the target element for columns navigation\n * Uses a combination of DOM order and visual position for CSS column layouts\n * @param {Array<HTMLElement>} subNavItems - Array of focusable sub-nav items\n * @param {number} currentIndex - Current item index\n * @param {string} direction - 'up', 'down', 'left', or 'right'\n * @return {HTMLElement|null} Target element or null if none found\n * @private\n */\n findColumnsNavTarget(subNavItems, currentIndex, direction) {\n const currentItem = subNavItems[currentIndex];\n const currentRect = currentItem.getBoundingClientRect();\n\n // For columns layouts, we need to understand the column structure\n // Items flow vertically first, then horizontally to the next column\n switch (direction) {\n case \"up\":\n // Look for an item above in the same column (similar X position)\n for (let i = currentIndex - 1; i >= 0; i--) {\n const item = subNavItems[i];\n const itemRect = item.getBoundingClientRect();\n\n // Check if item is above and in similar horizontal position (same column)\n if (\n itemRect.top < currentRect.top - this.settings.positionTolerance &&\n Math.abs(itemRect.left - currentRect.left) <\n this.settings.columnHorizontalTolerance\n ) {\n return item;\n }\n }\n return null;\n\n case \"down\":\n // Look for an item below in the same column (similar X position)\n for (let i = currentIndex + 1; i < subNavItems.length; i++) {\n const item = subNavItems[i];\n const itemRect = item.getBoundingClientRect();\n\n // Check if item is below and in similar horizontal position (same column)\n if (\n itemRect.top > currentRect.top + this.settings.positionTolerance &&\n Math.abs(itemRect.left - currentRect.left) <\n this.settings.columnHorizontalTolerance\n ) {\n return item;\n }\n }\n return null;\n\n case \"left\":\n // Look for an item to the left (different column, similar Y position)\n for (let i = 0; i < subNavItems.length; i++) {\n if (i === currentIndex) {\n continue;\n }\n\n const item = subNavItems[i];\n const itemRect = item.getBoundingClientRect();\n\n // Check if item is to the left and at similar vertical position\n if (\n itemRect.left <\n currentRect.left - this.settings.columnHorizontalTolerance &&\n Math.abs(itemRect.top - currentRect.top) <\n this.settings.columnHorizontalTolerance\n ) {\n return item;\n }\n }\n return null;\n\n case \"right\":\n // Look for an item to the right (different column, similar Y position)\n for (let i = 0; i < subNavItems.length;
172 i++) {\n if (i === currentIndex) {\n continue;\n }\n\n const item = subNavItems[i];\n const itemRect = item.getBoundingClientRect();\n\n // Check if item is to the right and at similar vertical position\n if (\n itemRect.left >\n currentRect.left + this.settings.columnHorizontalTolerance &&\n Math.abs(itemRect.top - currentRect.top) <\n this.settings.columnHorizontalTolerance\n ) {\n return item;\n }\n }\n return null;\n\n default:\n return null;\n }\n }\n\n /**\n * Closes a specific sub-navigation menu\n * @param {HTMLElement} item - The navigation item to close\n * @private\n */\n closeSubNav(item) {\n item.classList.remove(this.settings.classOpen);\n const btn = item.querySelector(\"button\");\n if (btn) {\n btn.setAttribute(\"aria-expanded\", \"false\");\n }\n\n // Handle mega layout closing\n this.handleMegaLayoutClosing(item);\n\n this.afterAnimation(() => {\n this.setLayout();\n });\n }\n\n /**\n * Handles mega layout closing animation\n * @param {HTMLElement} item - The navigation item\n * @private\n */\n handleMegaLayoutClosing(item) {\n const megaWrap = item.querySelector(`.${this.settings.megaWrapClass}`);\n if (megaWrap) {\n megaWrap.classList.remove(this.settings.classOpen);\n if (!this.isMobileView) {\n megaWrap.style.height = \"0\";\n setTimeout(() => {\n if (!megaWrap.classList.contains(this.settings.classOpen)) {\n megaWrap.style.height = \"\";\n }\n }, this.settings.animationTiming);\n }\n }\n }\n\n /**\n * Checks and adjusts sub-navigation alignment\n * Ensures sub-navs don't overflow viewport in desktop view\n * @param {HTMLElement} subNav - The sub-navigation element to check\n * @private\n */\n checkSubNavAlignment(subNav) {\n if (!subNav || this.isMobileView) {\n return;\n }\n\n // Only check alignment for flyout layout\n const parentNavItem = subNav.closest(this.settings.selectors.navItem);\n const layout =\n parentNavItem?.getAttribute(this.settings.dataAttributes.subLayout) ||\n this.settings.defaultSubLayout;\n if (layout !== \"flyout\") {\n return;\n }\n\n // Reset alignment class\n subNav.classList.remove(this.settings.selectors.subNavLeftClass);\n\n // Get sub-nav dimensions and position\n const rect = subNav.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n\n // Check if sub-nav would overflow the right viewport edge\n if (rect.right > viewportWidth - this.settings.viewportPadding) {\n subNav.classList.add(this.settings.selectors.subNavLeftClass);\n }\n }\n\n /**\n * Handles scroll events with performance optimization\n * Uses requestAnimationFrame for smooth scrolling behavior\n * @private\n */\n handleScroll() {\n if (!this.isInitialized) {\n return;\n }\n\n // Use requestAnimationFrame more efficiently\n if (!this.scrollRAF) {\n this.scrollRAF = requestAnimationFrame(() => {\n this.currentTop = window.scrollY;\n const headerOffset =\n this.settings.hideHeaderThreshold +\n (this.headerTop > 0 ? this.headerTop : 0);\n\n this.handleHeaderVisibility(headerOffset);\n this.handleHeaderBackground();\n\n this.previousTop = this.currentTop;\n this.scrollRAF = null;\n });\n }\n }\n\n /**\n * Handles the header visibility based on scroll direction and offset.\n * Implements show/hide behavior based on scroll thresholds.\n * @param {number} headerOffset - The offset to consider for visibility\n * @private\n */\n handleHeaderVisibility(headerOffset) {\n const position = this.element.getAttribute(\n this.settings.dataAttributes.position,\n );\n\n if (position !== \"scroll\") {\n return;\n }\n\n if (this.shouldHideHeader(headerOffset)) {\n this.hideHeader();\n } else if (this.shouldShowHeader(headerOffset)) {\n this.showHeader();\n }\n }\n\n /**\n * Handles the header background transparency based on scroll position.\n * Manages transparent/solid background states.\n * @private\n */\n handleHeaderBackgroun
172d() {\n if (!this.element.classList.contains(this.settings.classTransparent)) {\n return;\n }\n\n if (this.currentTop >= this.settings.hideBackgroundThreshold) {\n this.showHeaderBackground();\n } else {\n this.hideHeaderBackground();\n }\n }\n\n /**\n * Determines if the header should be hidden based on scroll position.\n * Takes into account header offset and open components.\n * @param {number} headerOffset - The offset to consider\n * @return {boolean} Whether the header should be hidden\n * @private\n */\n shouldHideHeader(headerOffset) {\n return (\n this.currentTop > this.previousTop &&\n this.currentTop > headerOffset &&\n !this.hasOpenComponents()\n );\n }\n\n /**\n * Determines if the header should be shown based on scroll position.\n * Considers scroll direction and header offset.\n * @param {number} headerOffset - The offset to consider\n * @return {boolean} Whether the header should be shown\n * @private\n */\n shouldShowHeader(headerOffset) {\n return (\n this.currentTop < this.previousTop || this.currentTop <= headerOffset\n );\n }\n\n /**\n * Checks if any header components are currently open.\n * Includes nav, search, and sub-nav states.\n * @return {boolean} Whether any components are open\n * @private\n */\n hasOpenComponents() {\n const isNavOpen =\n this.navToggleBtn?.getAttribute(\"aria-expanded\") === \"true\";\n const isSearchOpen = this.searchContainer?.classList.contains(\n this.settings.classOpen,\n );\n const hasOpenSubNav = this.element.querySelector(\n `.${this.settings.classHasChildren}.${this.settings.classOpen}`,\n );\n\n return isNavOpen || isSearchOpen || hasOpenSubNav;\n }\n\n /**\n * Shows the header background.\n * Adds background class if not already present.\n * @private\n */\n showHeaderBackground() {\n if (!this.element.classList.contains(this.settings.classBackground)) {\n this.element.classList.add(this.settings.classBackground);\n this.dispatchBackgroundChangeEvent(true);\n }\n }\n\n /**\n * Hides the header background if no components are open.\n * Removes background class if conditions are met.\n * @private\n */\n hideHeaderBackground() {\n if (\n this.element.classList.contains(this.settings.classBackground) &&\n !this.element.classList.contains(this.settings.classOpen)\n ) {\n this.element.classList.remove(this.settings.classBackground);\n this.dispatchBackgroundChangeEvent(false);\n }\n }\n\n /**\n * Hides the header by translating it up\n * @private\n */\n hideHeader() {\n if (this.hasOpenComponents()) {\n return;\n }\n\n const translateValue =\n this.headerTop > 0 ? `calc(-100% - ${this.headerTop}px)` : \"-100%\";\n this.setTranslate(this.element, translateValue);\n this.isHidden = true;\n this.dispatchVisibilityChangeEvent(false);\n }\n\n /**\n * Shows the header by translating it down\n * @private\n */\n showHeader() {\n this.setTranslate(this.element, \"0%\");\n this.isHidden = false;\n this.dispatchVisibilityChangeEvent(true);\n }\n\n /**\n * Sets the transform translate value with requestAnimationFrame\n * @param {HTMLElement} element - The element to transform\n * @param {string} value - The transform value\n * @private\n */\n setTranslate(element, value) {\n requestAnimationFrame(() => {\n element.style.transform = `translateY(${value})`;\n });\n }\n\n /**\n * Gets all focusable elements within a container\n * @param {HTMLElement} container - The container to search within\n * @return {Array<HTMLElement>} Array of focusable elements\n * @private\n */\n getFocusableElements(container) {\n return Array.from(\n container.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n ),\n ).filter((el) => !el.hasAttribute(\"disabled\") && el.offsetParent !== null);\n }\n\n /**\n * Handles focus moving outside the open components\n * @param {FocusEvent} event - The focus event\n * @private\n */\n handleFocusOut(event) {\n if (this.isTransitioning) {\n return;\n }\n\n const focusedElement = event.target;\n\n // Use setTimeout to allow focus to settle before checking\n // This prevents premature closing when tabbing between elements\n setTimeout(() =>
172 {\n // Re-check the actual focused element after the timeout\n const actualFocusedElement = document.activeElement;\n\n // Handle search container focus\n if (this.searchContainer.classList.contains(this.settings.classOpen)) {\n if (\n actualFocusedElement === this.searchToggleBtn ||\n actualFocusedElement === this.desktopSearchToggleBtn ||\n actualFocusedElement === this.navToggleBtn\n ) {\n return;\n }\n\n if (!this.searchContainer.contains(actualFocusedElement)) {\n this.closeSearch();\n if (this.isMobileView) {\n this.searchToggleBtn?.focus();\n } else {\n this.desktopSearchToggleBtn?.focus();\n }\n }\n }\n\n // Handle nav container focus\n if (this.navContainer.classList.contains(this.settings.classOpen)) {\n if (\n actualFocusedElement === this.navToggleBtn ||\n actualFocusedElement === this.searchToggleBtn ||\n actualFocusedElement === this.desktopSearchToggleBtn\n ) {\n return;\n }\n\n if (!this.navContainer.contains(actualFocusedElement)) {\n this.closeNav();\n this.navToggleBtn?.focus();\n }\n }\n }, 0);\n }\n\n /**\n * Gets the animation timing from CSS variable or falls back to default\n * Handles both millisecond and second values from CSS\n * @return {number} Animation duration in milliseconds\n * @private\n */\n getAnimationTiming() {\n // Cache the computed styles to avoid reflow\n if (!this._computedStyle) {\n this._computedStyle = getComputedStyle(this.element);\n }\n\n const cssValue = this._computedStyle.getPropertyValue(\n this.settings.cssVars.headerAnimationTiming,\n );\n\n if (!cssValue) {\n return this.settings.fallbackAnimationTiming;\n }\n\n const value = cssValue.trim();\n // Handle milliseconds\n if (value.endsWith(\"ms\")) {\n return parseInt(value, 10) || this.settings.fallbackAnimationTiming;\n }\n // Handle seconds\n if (value.endsWith(\"s\")) {\n return parseFloat(value) * 1000 || this.settings.fallbackAnimationTiming;\n }\n // Handle raw numbers (assume milliseconds)\n if (!isNaN(value)) {\n return parseInt(value, 10) || this.settings.fallbackAnimationTiming;\n }\n\n return this.settings.fallbackAnimationTiming;\n }\n\n /**\n * Reads the header offset in pixels from CSS custom property --header-offset\n * @return {number} The parsed offset in pixels (0 if not set/invalid)\n * @private\n */\n getHeaderOffsetFromCSS() {\n const rootStyles = getComputedStyle(document.documentElement);\n const value = rootStyles.getPropertyValue(\"--header-offset\");\n if (!value) {\n return 0;\n }\n const parsed = parseFloat(value);\n return Number.isNaN(parsed) ? 0 : parsed;\n }\n\n /**\n * Schedules a callback to run after animation completes\n * @param {Function} callback - The callback to run\n * @private\n */\n afterAnimation(callback) {\n if (!callback) {\n return;\n }\n\n clearTimeout(this._animationTimer);\n this._animationTimer = setTimeout(callback, this.settings.animationTiming);\n }\n\n /**\n * Sets the height of a container for animation\n * @param {HTMLElement} container - The container element\n * @private\n */\n setContainerHeight(container) {\n container.style.visibility = \"hidden\";\n container.style.height = \"auto\";\n const height = container.offsetHeight;\n container.style.height = \"0\";\n container.style.visibility = \"\";\n void container.offsetHeight; // Force reflow\n container.style.height = `${height}px`;\n }\n\n /**\n * Sets the height of the search container for animation\n * @private\n */\n setSearchHeight() {\n this.setContainerHeight(this.searchContainer);\n }\n\n /**\n * Sets the height of the mega container for animation\n * @param {HTMLElement} megaWrap - The mega wrapper element\n * @private\n */\n setMegaHeight(megaWrap) {\n this.setContainerHeight(megaWrap);\n }\n\n /**\n * Gets all focusable sub-nav items for keyboard navigation\n * @param {HTMLElement}
172 currentSubNav - Current sub-navigation container\n * @return {Object} Object containing mainNavItem, mainSubNav, and subNavItems\n * @private\n */\n getSubNavItemsForKeyboardNav(currentSubNav) {\n const mainNavItem = currentSubNav.closest(this.settings.selectors.navItem);\n if (!mainNavItem) {\n return null;\n }\n\n // Get the main sub-nav container (first level)\n let mainSubNav = mainNavItem.querySelector(\n `:scope > ${this.settings.selectors.subNav}`,\n );\n\n // For mega layouts, the sub-nav might be wrapped in .mega-wrap\n if (!mainSubNav) {\n const megaWrap = mainNavItem.querySelector(\n `:scope > .${this.settings.megaWrapClass}`,\n );\n if (megaWrap) {\n mainSubNav = megaWrap.querySelector(this.settings.selectors.subNav);\n }\n }\n\n if (!mainSubNav) {\n return null;\n }\n\n // Get all focusable items in the entire structure (including nested sub-navs)\n const subNavItems = Array.from(\n mainSubNav.querySelectorAll(\n `${this.settings.selectors.subNavItem} a, ${this.settings.selectors.subNavItem} button`,\n ),\n );\n\n return { mainNavItem, mainSubNav, subNavItems };\n }\n\n /**\n * Handles navigation to parent button and closes sub-nav\n * @param {HTMLElement} mainNavItem - The main navigation item\n * @private\n */\n navigateToParentAndClose(mainNavItem) {\n const parentButton = mainNavItem?.querySelector(\"button\");\n if (parentButton) {\n this.closeSubNav(mainNavItem);\n parentButton.focus();\n }\n }\n\n /**\n * Dispatch header background change event\n * @param {boolean} hasBackground - Whether header has background\n * @private\n */\n dispatchBackgroundChangeEvent(hasBackground) {\n const event = new CustomEvent(\"header:backgroundChange\", {\n detail: { hasBackground },\n bubbles: true,\n });\n document.dispatchEvent(event);\n }\n\n /**\n * Dispatch header visibility change event\n * @param {boolean} isVisible - Whether header is visible\n * @private\n */\n dispatchVisibilityChangeEvent(isVisible) {\n const event = new CustomEvent(\"header:visibilityChange\", {\n detail: { isVisible },\n bubbles: true,\n });\n document.dispatchEvent(event);\n }\n}\n\n/**\n * Updates header offset from CSS variable and adjusts transform if hidden\n * @private\n */\nHeader.prototype.updateHeaderOffsetFromCSS = function () {\n const newOffset = this.getHeaderOffsetFromCSS();\n if (newOffset === this.headerTop) {\n return;\n }\n this.headerTop = newOffset;\n if (this.isHidden) {\n const translateValue =\n this.headerTop > 0 ? `calc(-100% - ${this.headerTop}px)` : \"-100%\";\n this.setTranslate(this.element, translateValue);\n }\n};\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/header.js?\n}"); 173 174/***/ }, 175 176/***/ "./src/resources/assets/js/frontend/headerOffset.js" 177/*!**********************************************************!*\ 178 !*** ./src/resources/assets/js/frontend/headerOffset.js ***! 179 \**********************************************************/ 180(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 181 182"use strict"; 183eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ HeaderOffset: () => (/* binding */ HeaderOffset)\n/* harmony export */ });\n/* harmony import */ var _debounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./debounce */ \"./src/resources/assets/js/frontend/debounce.js\");\n\n\n/**\n * Header Offset\n *\n * @param {object} settings Settings object.\n */\nconst HeaderOffset = function (settings) {\n \"use strict\";\n\n const _self = this;\n const _settings = {};\n\n Object.assign(_settings, settings);\n\n function cacheDom() {\n // Check if new header is active by looking for body class\n _settings.$hasNewHeader = document.querySelector(\"body.has-new-header\");\n\n // Cache DOM elements based on header type\n if (_settings.$hasNewHeader) {\n // New header selectors\n _settings.$header = document.querySelector(\".ams-header\");\n } else {\n // Old header selectors\n _settings.$header = document.querySelector(\".header_wrapper\");\n }\n\n // Common elements\n _settings.$site = document.querySelector(\".site\");\n _settings.$breakpoint = window.matchMedia(\"(min-width: 768px)\");\n\n _settings.$transparencyEnabled = {\n mobile: document.querySelector(\"body.has-transparent-header--mobile\"),\n desktop: document.querySelector(\"body.has-transparent-header--desktop\"),\n };\n }\n\n function bindEvents() {\n document.addEventListener(\"DOMContentLoaded\", setPageMargin);\n window.addEventListener(\"resize\", setPageMargin);\n\n // Watch for changes to root style (e.g. --header-offset updates)\n _settings._rootStyleObserver = new MutationObserver(() =>
183 {\n setPageMargin();\n });\n _settings._rootStyleObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"style\"],\n });\n }\n\n const setPageMargin = (0,_debounce__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(function () {\n // Early return if no header found\n if (!_settings.$header || !_settings.$site) {\n return;\n }\n\n // Read CSS variable for header offset\n const rootStyle = getComputedStyle(document.documentElement);\n const offsetRaw = rootStyle.getPropertyValue(\"--header-offset\");\n const parsedOffset = parseFloat(offsetRaw);\n const headerOffset = Number.isNaN(parsedOffset) ? 0 : parsedOffset;\n\n // For new header, check if position is default - if so, don't add margin\n if (_settings.$hasNewHeader) {\n const headerPosition = _settings.$header.getAttribute(\"data-position\");\n if (headerPosition === \"default\") {\n // Default to CSS --header-offset when available\n _settings.$site.style.marginTop = headerOffset + \"px\";\n return;\n }\n }\n\n if (\n (_settings.$transparencyEnabled.mobile &&\n !_settings.$breakpoint.matches) ||\n (_settings.$transparencyEnabled.desktop && _settings.$breakpoint.matches)\n ) {\n // Transparency: use only the CSS --header-offset value\n _settings.$site.style.marginTop = headerOffset + \"px\";\n } else {\n _settings.$site.style.marginTop =\n _settings.$header.offsetHeight + headerOffset + \"px\";\n }\n }, 10);\n\n function init() {\n cacheDom();\n bindEvents();\n setPageMargin();\n\n return _self;\n }\n\n return init();\n};\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/headerOffset.js?\n}"); 184 185/***/ }, 186 187/***/ "./src/resources/assets/js/frontend/headingBackground.js" 188/*!***************************************************************!*\ 189 !*** ./src/resources/assets/js/frontend/headingBackground.js ***! 190 \***************************************************************/ 191(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 192 193"use strict"; 194eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ HeadingBackground: () => (/* binding */ HeadingBackground)\n/* harmony export */ });\n/* harmony import */ var _debounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./debounce */ \"./src/resources/assets/js/frontend/debounce.js\");\n\n\nconst HeadingBackground = function (settings) {\n\t\"use strict\";\n\n\tconst _self = this;\n\tconst _settings = {};\n\n\tObject.assign(_settings, settings);\n\n\tfunction cacheDom() {\n\t\t_settings.$subWordClass = _settings.$el.querySelectorAll(_settings.subWordClass);\n\t\t_settings.$subWordWrapClass = _settings.$el.querySelectorAll(_settings.subWordWrapClass);\n\t}\n\n\tfunction bindEvents() {\n\t\twindow.addEventListener(\"resize\", handleHeadingWords);\n\t}\n\n\t/**\n\t * Toggle classes for words separated by '­' (manual hyphen) based on their offsets.\n\t * Top offset will be different if browser triggered hyphen-thingy.\n\t */\n\tconst handleHeadingWords = (0,_debounce__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(function () {\n\t\tlet differenceExists = false,\n\t\t\toffsetPrevious = 0,\n\t\t\toffsetCurrent = 0;\n\n\t\t/**\n\t\t * PHP will split '­' into '.sub-word' and wrap those into '.sub-words'.\n\t\t * Loop through these and, if offset difference is detected:\n\t\t *\n\t\t * 1. Remove '.word' from '.sub-words'\n\t\t * 2. Add '.word' to '.sub-word'\n\t\t */\n\t\t_settings.$subWordWrapClass.forEach( ( word ) => {\n\t\t\t_settings.$subWordClass.forEach( ( subWord ) => {\n\t\t\t\toffsetCurrent = subWord.offsetTop;\n\n\t\t\t\tif (offsetPrevious === 0) {\n\t\t\t\t\toffsetPrevious = offsetCurrent;\n\t\t\t\t} else if (offsetCurrent !== offsetPrevious) {\n\t\t\t\t\tdifferenceExists = true;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tif (differenceExists) {\n\t\t\t\tword.classList.remove(_settings.wordClass);\n\n\t\t\t\t_settings.$subWordClass.forEach( ( subWord ) => {\n\t\t\t\t\tsubWord.classList.add(_settings.wordClass);\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tword.classList.add(_settings.wordClass);\n\n\t\t\t\t_settings.$subWordClass.forEach( ( subWord ) => {\n\t\t\t\t\tsubWord.classList.remove(_settings.wordClass);\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}, 10);
194\n\n\tfunction init() {\n\t\tcacheDom();\n\t\tbindEvents();\n\t\thandleHeadingWords();\n\n\t\treturn _self;\n\t}\n\n\treturn init();\n};\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/headingBackground.js?\n}"); 195 196/***/ }, 197 198/***/ "./src/resources/assets/js/frontend/hero.js" 199/*!**************************************************!*\ 200 !*** ./src/resources/assets/js/frontend/hero.js ***! 201 \**************************************************/ 202(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 203 204"use strict"; 205eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Hero: () => (/* binding */ Hero)\n/* harmony export */ });\n/* harmony import */ var _debounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./debounce */ \"./src/resources/assets/js/frontend/debounce.js\");\n\n\n/**\n * Hero\n *\n * @param {object} settings Settings object.\n */\nconst Hero = function (settings) {\n \"use strict\";\n\n const _self = this;\n const _settings = {};\n\n Object.assign(_settings, settings);\n\n function cacheDom() {\n _settings.$hero = document.querySelector(_settings.hero);\n _settings.$heroContent = document.querySelector(_settings.heroContent);\n\n // Check if new header is active by looking for body class\n _settings.$hasNewHeader = document.querySelector(\"body.has-new-header\");\n\n // Cache header based on which one is active\n if (_settings.$hasNewHeader) {\n // New header selectors\n _settings.$header = document.querySelector(\".ams-header\");\n } else {\n // Old header selectors - use the passed setting or fallback to old selector\n _settings.$header = document.querySelector(\n _settings.header || \".header_wrapper\"\n );\n }\n\n _settings.$hasAdminBar = document.querySelector(_settings.adminBar);\n _settings.$hasTransparentHeader = document.querySelector(\n _settings.transparentHeader\n );\n }\n\n function bindEvents() {\n window.addEventListener(\"resize\", setOffset);\n window.addEventListener(\"resize\", setContentHeight);\n }\n\n const setOffset = (0,_debounce__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(function () {\n // Early return if no header found\n if (!_settings.$header) {\n return;\n }\n\n if (_settings.$hasTransparentHeader) {\n if (_settings.$hasAdminBar) {\n _settings.$hero.style.setProperty(\n \"--hero-offset\",\n _settings.$hasAdminBar.offsetHeight + \"px\"\n );\n } else {\n _settings.$hero.style.setProperty(\"--hero-offset\", \"0px\");\n }\n } else {\n if (_settings.$hasAdminBar) {\n _settings.$hero.style.setProperty(\n \"--hero-offset\",\n _settings.$hasAdminBar.offsetHeight +\n _settings.$header.offsetHeight +\n \"px\"\n );\n } else {\n _settings.$hero.style.setProperty(\n \"--hero-offset\",\n _settings.$header.offsetHeight + \"px\"\n );\n }\n }\n }, 10);\n\n const setContentHeight = (0,_debounce__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(function () {\n if (_settings.$heroContent) {\n _settings.$heroContent.style.setProperty(\n \"--hero-content-height\",\n _settings.$heroContent.offsetHeight + \"px\"\n );\n }\n }, 10);\n\n function init() {\n cacheDom();\n bindEvents();\n setOffset();\n setContentHeight();\n\n return _self;\n }\n\n return init();\n};\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/hero.js?\n}"); 206 207/***/ }, 208 209/***/ "./src/resources/assets/js/frontend/iconSwitch.js" 210/*!********************************************************!*\ 211 !*** ./src/resources/assets/js/frontend/iconSwitch.js ***! 212 \********************************************************/ 213(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 214 215"use strict"; 216eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IconSwitch: () => (/* binding */ IconSwitch)\n/* harmony export */ });\n/* harmony import */ var _extendProps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extendProps */ \"./src/resources/assets/js/frontend/extendProps.js\");
216\n\n\n/**\n * Icon Switch\n */\nclass IconSwitch {\n static defaults = {\n hoverClass: \"c-icon-switch--hover\",\n stateClass: \"c-icon-switch--state-b\",\n };\n\n constructor(settings) {\n this.settings = (0,_extendProps__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(IconSwitch.defaults, settings);\n this.element = this.settings.element;\n\n // Only initialize if the element doesn't have the hover class\n if (!this.element.classList.contains(this.settings.hoverClass)) {\n this.init();\n }\n }\n\n init() {\n this.element.addEventListener(\"click\", (event) => {\n event.preventDefault();\n this.toggle();\n });\n }\n\n /**\n * Toggle the icon state\n * @param {boolean} [force] - Optional state to force\n */\n toggle(force) {\n const status =\n force !== undefined\n ? force\n : !this.element.classList.contains(this.settings.stateClass);\n this.element.classList.toggle(this.settings.stateClass, status);\n\n // Emit a custom event with the updated status\n const customEvent = new CustomEvent(\"icon-switch-clicked\", {\n detail: status,\n });\n this.element.dispatchEvent(customEvent);\n }\n\n /**\n * Set the icon state to off\n */\n reset() {\n this.toggle(false);\n }\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/iconSwitch.js?\n}"); 217 218/***/ }, 219 220/***/ "./src/resources/assets/js/frontend/imageGalleryMosaic.js" 221/*!****************************************************************!*\ 222 !*** ./src/resources/assets/js/frontend/imageGalleryMosaic.js ***! 223 \****************************************************************/ 224(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 225 226"use strict"; 227eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ImageGalleryMosaic: () => (/* binding */ ImageGalleryMosaic)\n/* harmony export */ });\n/* harmony import */ var swiper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! swiper */ \"./node_modules/swiper/swiper.mjs\");\n/* harmony import */ var swiper_modules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! swiper/modules */ \"./node_modules/swiper/modules/index.mjs\");\n\n // eslint-disable-line import/no-unresolved\n\n/**\n * Mosaic Image Gallery\n *\n * @param {Object} settings Settings object.\n */\nconst ImageGalleryMosaic = function (settings) {\n\t'use strict';\n\n\tconst _self = this;\n\tconst _settings = {};\n\tconst mQ = window.matchMedia('(min-width: 48em)');\n\n\tObject.assign(_settings, settings);\n\n\tfunction cacheDom() {\n\t\t_settings.$items = _settings.$el.querySelectorAll(`.${_settings.item}`);\n\t}\n\n\tfunction bindEvents() {\n\t\tmQ.addEventListener('change', checkBreakpoint);\n\t}\n\n\tfunction checkBreakpoint(e) {\n\t\tif (e.matches === true) {\n\t\t\tif (_settings.slider !== undefined)\n\t\t\t\t_settings.slider.destroy(true, true);\n\t\t\treturn addAttributes();\n\t\t} else if (e.matches === false) {\n\t\t\treturn initSlider();\n\t\t}\n\t}\n\n\tfunction addAttributes() {\n\t\tif (_settings.$items.length >= 6) {\n\t\t\t_settings.$el.classList.add('has-more');\n\t\t\t_settings.$items.item(\n\t\t\t\t4\n\t\t\t).firstElementChild.dataset.galleryHiddenCount =\n\t\t\t\t'+' + (_settings.$items.length - 5);\n\t\t} else {\n\t\t\t_settings.$el.classList.add('has-' + _settings.$items.length);\n\t\t}\n\t}\n\n\tfunction initSlider() {\n\t\t_settings.slider = new swiper__WEBPACK_IMPORTED_MODULE_0__[\"default\"](_settings.$el, {\n\t\t\tmodules: [swiper_modules__WEBPACK_IMPORTED_MODULE_1__.Navigation, swiper_modules__WEBPACK_IMPORTED_MODULE_1__.Pagination],\n\t\t\tspeed: 200,\n\t\t\tspaceBetween: 24,\n\t\t\tpagination: {\n\t\t\t\tel: _settings.pagination,\n\t\t\t\ttype: 'fraction',\n\t\t\t},\n\t\t\tnavigation: {\n\t\t\t\tprevEl: _settings.prev,\n\t\t\t\tnextEl: _settings.next,\n\t\t\t},\n\t\t\tbreakpoints: {\n\t\t\t\t0: {\n\t\t\t\t\tslidesPerView: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t}\n\n\tfunction init() {\n\t\tcacheDom();\n\t\tbindEvents();\n\t\tcheckBreakpoint(mQ);\n\n\t\treturn _self;\n\t}\n\n\treturn init();\n};\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/imageGalleryMosaic.js?\n}"); 228 229/***/ }, 230 231/***/ "./src/resources/assets/js/frontend/lists.js" 232/*!***************************************************!*\ 233 !*** ./src/resources/assets/js/frontend/lists.js ***! 234 \***************************************************/ 235(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 236 237"use strict"; 238eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Lists: () => (/* binding */ Lists)\n/* harmony export */ });\n/* harmony import */ var _accordion__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./accordion */ \"./src/resources/assets/js/frontend/accordion.js\");\n\n\n/**\n * Lists\n *\n * @param {object} settings Settings object.\n */\nconst Lists = function (settings) {\n\t'use strict';\n\n\tconst _self = this;\n\tconst _settings = {};\n\tlet accordionSuffixId = '';\n\n\tObject.assign(_settings, settings);\n\n\tfunction cacheDom() {\n\t\tif(_settings.listElement){\n\t\t\t_settings.listBlocks = Array.from(document.querySelectorAll(_settings.listElement));\n\t\t\taccordionSuffixId = \"map-\"\n\t\t} else {\n\t\t\t_settings.listBlocks = Array.from(document.querySelectorAll(\".ams-lists__content\"));\n\t\t\taccordionSuffixId = \"\"\n\t\t}\n\t}\n\n\tfunction setupMobileAccordion(item) {\n\n\t\tlet lists = [];\n\t\tlet subItemCount = -1;\n\t\tlet isHeading = false;\n\t\tlet incrementedWithoutHeading = false;
238\n\n\n\t\titem.querySelector('.c-list').childNodes.forEach(function (subItem) {\n\n\t\t\tif (subItem.classList) {\n\n\t\t\t\tif (Array.from(subItem.classList).includes('c-list__heading')) {\n\t\t\t\t\tsubItemCount++;\n\t\t\t\t\tlists[subItemCount] = [];\n\t\t\t\t\tlists[subItemCount].push(subItem);\n\t\t\t\t\tisHeading = true;\n\t\t\t\t\tincrementedWithoutHeading = false; // Reset flag when a new heading is found\n\t\t\t\t}\n\t\t\t\telse if (Array.from(subItem.classList).includes('c-list__item')) {\n\t\t\t\t\tif (isHeading) {\n\t\t\t\t\t\tlists[subItemCount].push(subItem);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Only increment subItemCount once for a series of list items without a heading\n\t\t\t\t\t\tif (!incrementedWithoutHeading) {\n\t\t\t\t\t\t\tsubItemCount++;\n\t\t\t\t\t\t\tlists[subItemCount] = [];\n\t\t\t\t\t\t\tincrementedWithoutHeading = true; // Set flag to true after incrementing\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlists[subItemCount].push(subItem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// Render as HTML\n\t\titem.querySelector('.c-list').remove();\n\t\tlists.forEach(function (subLists) {\n\n\t\t\tlet newElement = document.createElement('div');\n\t\t\tlet subListElement = document.createElement('div');\n\n\t\t\tnewElement.classList.add('c-list');\n\t\t\tsubListElement.classList.add('c-list__items');\n\n\t\t\tsubLists.forEach(function (subList, key) {\n\n\t\t\t\tif (!key) {\n\n\t\t\t\t\tnewElement.appendChild(subList);\n\t\t\t\t\tnewElement.appendChild(subListElement);\n\t\t\t\t} else {\n\n\t\t\t\t\tnewElement.querySelector('.c-list__items').appendChild(subList);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\titem.appendChild(newElement);\n\t\t});\n\n\t\treturn new _accordion__WEBPACK_IMPORTED_MODULE_0__.Accordion(\"#\" + item.id, {\n\t\t\titemClass: 'c-list',\n\t\t\ttriggerClass: 'c-list__trigger',\n\t\t\tbodyClass: 'c-list__items',\n\t\t\tenableMultiple: true,\n\t\t\tonlyChildNodes: false,\n\t\t});\n\t}\n\n\tfunction initAccordion() {\n\t\tif (_settings.listBlocks) {\n\t\t\tlet count = 0;\n\t\t\tlet id = null;\n\n\t\t\t_settings.listBlocks.forEach((item) => {\n\t\t\t\tid = \"list-ac-\" + accordionSuffixId + count;\n\t\t\t\titem.id = id;\n\n\t\t\t\tlet accordion;\n\t\t\t\tlet originalHtml = item.innerHTML;\n\n\t\t\t\tif (window.innerWidth < _settings.accordionBreakpoint) {\n\t\t\t\t\tsetupMobileAccordion(item);\n\t\t\t\t}\n\n\t\t\t\twindow.matchMedia(`(max-width: ${_settings.accordionBreakpoint}px)`).addEventListener(\"change\", (e) => {\n\t\t\t\t\tif (e.matches) {\n\n\t\t\t\t\t\taccordion = setupMobileAccordion(item);\n\n\t\t\t\t\t\taccordion.attachEvents();\n\t\t\t\t\t\taccordion.closeAll();\n\t\t\t\t\t} else {\n\t\t\t\t\t\titem.innerHTML = originalHtml;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tcount++;\n\t\t\t});\n\t\t}\n\t}\n\n\tfunction init() {\n\t\tcacheDom();\n\t\tinitAccordion();\n\n\t\treturn _self;\n\t}\n\n\treturn init();\n};\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/lists.js?\n}"); 239 240/***/ }, 241 242/***/ "./src/resources/assets/js/frontend/loadMoreModule.js" 243/*!************************************************************!*\ 244 !*** ./src/resources/assets/js/frontend/loadMoreModule.js ***! 245 \************************************************************/ 246(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 247 248"use strict"; 249eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LoadMoreModule: () => (/* binding */ LoadMoreModule)\n/* harmony export */ });\nconst LoadMoreModule = function (settings) {\n 'use strict';\n\n\tconst _self = this;\n const moduleElement = settings.moduleElement;
249\n const loadMoreBtn = moduleElement.querySelector('.js-load-more-btn');\n const listItems = Array.from(moduleElement.querySelectorAll('.js-results > li'));\n let filteredItems = listItems;\n\n function checkDevice() {\n const viewportWidth = window.innerWidth;\n return viewportWidth <= 767 ? 'mobile' : 'desktop';\n }\n\n function getBatchSize() {\n const mobileCount = moduleElement.dataset.countMobile ? parseInt(moduleElement.dataset.countMobile, 10) : listItems.length;\n const desktopCount = moduleElement.dataset.count ? parseInt(moduleElement.dataset.count, 10) : listItems.length;\n\n const deviceType = checkDevice();\n return deviceType === 'mobile' ? mobileCount : desktopCount;\n }\n\n function applyVisibility(itemsToShow) {\n const batchSize = getBatchSize();\n\n itemsToShow.forEach(item => item.classList.add('u-hide-more'));\n itemsToShow.slice(0, batchSize).forEach(item => {\n item.classList.remove('u-hide-more');\n });\n adjustButtonVisibility(itemsToShow);\n }\n\n function loadMoreItems(itemsToShow) {\n const batchSize = getBatchSize();\n const hiddenItems = itemsToShow.filter(item => item.classList.contains('u-hide-more'));\n\n for (let i = 0; i < batchSize && i < hiddenItems.length; i++) {\n hiddenItems[i].classList.remove('u-hide-more');\n }\n\n adjustButtonVisibility(itemsToShow);\n }\n\n function adjustButtonVisibility(itemsToShow) {\n const visibleItems = itemsToShow.filter(item => !item.classList.contains('u-hide-more'));\n const hiddenItems = itemsToShow.filter(item => item.classList.contains('u-hide-more'));\n\n\t\tif(loadMoreBtn){\n \tif (visibleItems.length === 0 || hiddenItems.length === 0) {\n \tloadMoreBtn.style.display = 'none';\n \t\t} else {\n \tloadMoreBtn.style.display = 'block';\n \t}\n\t\t}\n\n }\n\n function handleFilterUpdate() {\n filteredItems = listItems.filter(item => {\n return !item.classList.contains('u-hide');\n });\n applyVisibility(filteredItems);\n }\n\n function loadMoreHandler(e) {\n e.preventDefault();\n loadMoreItems(filteredItems);\n }\n\n function initialize() {\n applyVisibility(listItems);\n\n if (loadMoreBtn) {\n\t\t\tconst childButton = loadMoreBtn.querySelector('.c-btn');\n\t\t\tif (childButton) {\n\t\t\t\tchildButton.addEventListener('click', loadMoreHandler);\n\t\t\t}\n\t\t}\n\n moduleElement.addEventListener('filter-selection-updated', function () {\n\t\t\tsetTimeout(() => {\n\t\t\t\thandleFilterUpdate();\n\t\t\t}, 500);\n });\n\n\t\treturn _self;\n }\n\n return initialize();\n};\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/loadMoreModule.js?\n}"); 250 251/***/ }, 252 253/***/ "./src/resources/assets/js/frontend/map.js" 254/*!*************************************************!*\ 255 !*** ./src/resources/assets/js/frontend/map.js ***! 256 \*************************************************/ 257(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 258 259"use strict"; 260eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Map: () => (/* binding */ Map)\n/* harmony export */ });\n/* harmony import */ var _lists__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lists */ \"./src/resources/assets/js/frontend/lists.js\");\n\n\n/**\n * Map\n *\n * @param {Object} settings Settings object.\n */\n\nconst Map = function(settings) {\n 'use strict';\n\n const _self = this;\n const _settings = {};\n\n Object.assign(_settings, settings);\n\n function loadLists() {\n _settings.listElement = \".ams-map__list\";\n return new _lists__WEBPACK_IMPORTED_MODULE_0__.Lists(_settings);\n }\n\n function loadGoogleMapsAPI() {\n const scriptApi = document.createElement('script');\n scriptApi.async = true;\n scriptApi.defer = true;
260\n scriptApi.src = 'https://maps.googleapis.com/maps/api/js?v=beta&key=AIzaSyDKoeTNHC8cQM3rGw4hCdiz8smaLfqkL7Y';\n\n document.body.appendChild(scriptApi);\n }\n\n function waitForGoogleMapsAPI(callback) {\n const checkGoogleMaps = () => {\n if (window.google && window.google.maps) {\n callback();\n } else {\n setTimeout(checkGoogleMaps, 1000);\n }\n };\n\n checkGoogleMaps();\n }\n\n\tconst mapStyles = [\n\t\t{\n\t\t\telementType: 'geometry',\n\t\t\tstylers: [{\n\t\t\t\tcolor: '#f5f5f5',\n\t\t\t}, ],\n\t\t},\n\t\t{\n\t\t\telementType: 'labels.icon',\n\t\t\tstylers: [{\n\t\t\t\tvisibility: 'off',\n\t\t\t}, ],\n\t\t},\n\t\t{\n\t\t\telementType: 'labels.text.fill',\n\t\t\tstylers: [{\n\t\t\t\tcolor: '#616161',\n\t\t\t}, ],\n\t\t},\n\t\t{\n\t\t\telementType: 'labels.text.stroke',\n\t\t\tstylers: [{\n\t\t\t\tcolor: '#f5f5f5',\n\t\t\t}, ],\n\t\t},\n\t\t{\n\t\t\tfeatureType: 'administrative.land_parcel',\n\t\t\telementType: 'labels.text.fill',\n\t\t\tstylers: [{\n\t\t\t\tcolor: '#bdbdbd',\n\t\t\t}, ],\n\t\t},\n\t\t{\n\t\t\tfeatureType: 'poi',\n\t\t\telementType: 'geometry',\n\t\t\tstylers: [{\n\t\t\t\tcolor: '#eeeeee',\n\t\t\t}, ],\n\t\t},\n\t\t{\n\t\t\tfeatureType: 'poi',\n\t\t\telementType: 'labels.text.fill',\n\t\t\tstylers: [{\n\t\t\t\tcolor: '#757575',\n\t\t\t}, ],\n\t\t},\n\t\t{\n\t\t\tfeatureType: 'poi.park',\n\t\t\telementType: 'geometry',\n\t\t\tstylers: [{\n\t\t\t\tcolor: '#e5e5e5',\n\t\t\t}, ],\n\t\t},\n\t\t{\n\t\t\tfeatureType: 'poi.park',\n\t\t\telementType: 'labels.text.fill',\n\t\t\tstylers: [{\n\t\t\t\tcolor: '#9e9e9e',\n\t\t\t}, ],\n\t\t},\n\t\t{\n\t\t\tfeatureType: 'road',\n\t\t\telementType: 'geometry',\n\t\t\tstylers: [{\n\t\t\t\tcolor: '#ffffff',\n\t\t\t}, ],\n\t\t},\n\t\t{\n\t\t\tfeatureType: 'road.arterial',\n\t\t\telementType: 'labels.text.fill',\n\t\t\tstylers: [{\n\t\t\t\tcolor: '#757575',\n\t\t\t}, ],\n\t\t},\n\t\t{\n\t\t\tfeatureType: 'road.highway',\n\t\t\telementType: 'geometry',\n\t\t\tstylers: [{\n\t\t\t\tcolor: '#dadada',\n\t\t\t}, ],\n\t\t},\n\t\t{\n\t\t\tfeatureType: 'road.highway',\n\t\t\telementType: 'labels.text.fill',\n\t\t\tstylers: [{\n\t\t\t\tcolor: '#616161',\n\t\t\t}, ],\n\t\t},\n\t\t{\n\t\t\tfeatureType: 'road.local',\n\t\t\telementType: 'labels.text.fill',\n\t\t\tstylers: [{\n\t\t\t\tcolor: '#9e9e9e',\n\t\t\t}, ],\n\t\t},\n\t\t{\n\t\t\tfeatureType: 'transit.line',\n\t\t\telementType: 'geometry',\n\t\t\tstylers: [{\n\t\t\t\tcolor: '#e5e5e5',\n\t\t\t}, ],\n\t\t},\n\t\t{\n\t\t\tfeatureType: 'transit.station',\n\t\t\telementType: 'geometry',\n\t\t\tstylers: [{\n\t\t\t\tcolor: '#eeeeee',\n\t\t\t}, ],\n\t\t},\n\t\t{\n\t\t\tfeatureType: 'water',\n\t\t\telementType: 'geometry',\n\t\t\tstylers: [{\n\t\t\t\tcolor: '#c9c9c9',\n\t\t\t}, ],\n\t\t},\n\t\t{\n\t\t\tfeatureType: 'water',\n\t\t\telementType: 'labels.text.fill',\n\t\t\tstylers: [{\n\t\t\t\tcolor: '#9e9e9e',\n\t\t\t}, ],\n\t\t},\n\t];\n\n\tfunction getCssCustomPropertyValue(element, variable) {\n\t\treturn getComputedStyle(element).getPropertyValue(variable).trim();\n\t}\n\n\tfunction initFilters(\n\t\tlocations,\n\t\tmap,\n\t\tmarkers,\n\t\tbounds,\n\t\tdefaultPinColor,\n\t\tclickedPinColor,\n\t\tinfoWindow,\n\t\tactiveMarkerRef,\n\t\tmapElement,\n\t\tfilterClosestButton,\n\t\tlistSection,\n\t\tcurrentMap\n\t) {\n\t\tconst filterWrapper = currentMap.querySelector('.js-filter-map');\n\t\tconst selects = filterWrapper ? filterWrapper.querySelectorAll('select') : null;\n\n\t\tif (!filterWrapper || !selects) {\n\t\t\tconsole.warn('No filters found for this map.');\n\t\t\treturn;\n\t\t}\n\n\t\tselects.forEach((select) => {\n\t\t\tselect.addEventListener('change', () => {\n\t\t\t\thandleFilterChange(\n\t\t\t\t\tlocations,\n\t\t\t\t\tselects,\n\t\t\t\t\tmap,\n\t\t\t\t\tmarkers,\n\t\t\t\t\tbounds,\n\t\t\t\t\tdefaultPinColor,\n\t\t\t\t\tclickedPinColor,\n\t\t\t\t\tinfoWindow,\n\t\t\t\t\tactiveMarkerRef,\n\t\t\t\t\tmapElement,\n\t\t\t\t\tlistSection,\n\t\t\t\t\tcurrentMap\n\t\t\t\t);\n\t\t\t});\n\t\t});\n\t}\n\n\tfunction generateGroupedLocationLists(listSection, locations) {\n\t\tif (!listSection) {\n\t\t\tconsole.error(\"list section is not defined or null.\");\n\t\t\treturn;\n\t\t}\n\n\t\tlistSection.innerHTML = '';\n\n\t\tif (!locations || locations.length === 0) {\n\t\t\tconst noResultsMessage = document.createElement('p');
260\n\t\t\tnoResultsMessage.textContent = \"No locations found.\";\n\t\t\tnoResultsMessage.classList.add('no-results');\n\t\t\tlistSection.appendChild(noResultsMessage);\n\t\t\treturn;\n\t\t}\n\n\t\tconst groupedLocations = locations.reduce((groups, location) => {\n\t\t\tconst firstLetter = location.school.trim().charAt(0).toUpperCase();\n\t\t\tif (!groups[firstLetter]) groups[firstLetter] = [];\n\t\t\tgroups[firstLetter].push(location);\n\t\t\treturn groups;\n\t\t}, {});\n\n\t\tObject.keys(groupedLocations)\n\t\t\t.sort()\n\t\t\t.forEach(letter => {\n\t\t\t\tconst letterContainer = document.createElement('div');\n\t\t\t\tletterContainer.classList.add('letter-group');\n\n\t\t\t\tconst letterHeader = document.createElement('h4');\n\t\t\t\tletterHeader.textContent = letter;\n\t\t\t\tletterContainer.appendChild(letterHeader);\n\n\t\t\t\tconst schoolList = document.createElement('ul');\n\t\t\t\tschoolList.classList.add('school-list');\n\n\t\t\t\tgroupedLocations[letter].forEach(location => {\n\t\t\t\t\tconst listItem = document.createElement('li');\n\n\t\t\t\t\tconst svgIcon = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n\t\t\t\t\tsvgIcon.setAttribute(\"xmlns\", \"http://www.w3.org/2000/svg\");\n\t\t\t\t\tsvgIcon.setAttribute(\"width\", \"24\");\n\t\t\t\t\tsvgIcon.setAttribute(\"height\", \"24\");\n\t\t\t\t\tsvgIcon.setAttribute(\"viewBox\", \"0 0 24 24\");\n\t\t\t\t\tsvgIcon.setAttribute(\"fill\", \"none\");\n\t\t\t\t\tsvgIcon.innerHTML = `\n\t\t\t\t\t\t<path d=\"M8.25 8.25C8.25 9.24456 8.64509 10.1984 9.34835 10.9017C10.0516 11.6049 11.0054 12 12 12C12.9946 12 13.9484 11.6049 14.6517 10.9017C15.3549 10.1984 15.75 9.24456 15.75 8.25C15.75 7.25544 15.3549 6.30161 14.6517 5.59835C13.9484 4.89509 12.9946 4.5 12 4.5C11.0054 4.5 10.0516 4.89509 9.34835 5.59835C8.64509 6.30161 8.25 7.25544 8.25 8.25Z\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n\t\t\t\t\t\t<path d=\"M12 0.75C13.9891 0.75 15.8968 1.54018 17.3033 2.9467C18.7098 4.35322 19.5 6.26088 19.5 8.25C19.5 11.657 14.426 20.2 12.625 22.915C12.5566 23.0181 12.4637 23.1027 12.3547 23.1613C12.2456 23.2198 12.1238 23.2504 12 23.2504C11.8762 23.2504 11.7544 23.2198 11.6453 23.1613C11.5363 23.1027 11.4434 23.0181 11.375 22.915C9.574 20.2 4.5 11.657 4.5 8.25C4.5 6.26088 5.29018 4.35322 6.6967 2.9467C8.10322 1.54018 10.0109 0.75 12 0.75V0.75Z\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n\t\t\t\t\t`;\n\n\t\t\t\t\tconst schoolLink = document.createElement('a');\n\t\t\t\t\tschoolLink.href = location.link.url;\n\t\t\t\t\tschoolLink.textContent = location.school;\n\t\t\t\t\tschoolLink.target = '_blank';\n\t\t\t\t\tschoolLink.classList.add('u-text-link');\n\n\t\t\t\t\tlistItem.appendChild(svgIcon);\n\t\t\t\t\tlistItem.appendChild(schoolLink);\n\n\t\t\t\t\tschoolList.appendChild(listItem);\n\t\t\t\t});\n\n\t\t\t\tletterContainer.appendChild(schoolList);\n\t\t\t\tlistSection.appendChild(letterContainer);\n\t\t\t});\n\t}\n\n\tfunction checkIfListMap(currentMap, markers, mapElement) {\n\t\tif (currentMap.classList.contains('ams-map--list')) {\n\t\t\tloadLists();\n\n\t\t\tcurrentMap.querySelectorAll('.c-list__item').forEach((item, index) => {\n\t\t\t\titem.addEventListener('click', function(e) {\n\t\t\t\t\tconst marker = markers[index];\n\n\t\t\t\t\tif (mapElement) {\n\t\t\t\t\t\tmapElement.scrollIntoView({\n\t\t\t\t\t\t\tbehavior: 'smooth'\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (marker) {\n\t\t\t\t\t\tgoogle.maps.event.trigger(marker, 'click');\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\n\tfunction getContentString(location) {\n\t\tconst contentString = `\n\t\t<div class=\"marker-info u-font-body\">\n\t\t\t<button class=\"marker-info__close\">\n\t\t\t\t<span class=\"lable\">Stäng</span>\n\t\t\t\t<svg class=\"ams-icon ams-icon--close\" width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t\t<path d=\"m28.2565 25.0555-9.4281-9.4281 9.4281-9.42807c.2605-.26045.2605-.68236 0-.94281l-1.8856-1.88562c-.2605-.26045-.6824-.26045-.9428 0l-9.4281 9.4281-9.42809-9.4281c-.26045-.26045-.68236-.26045-.94281 0l-1.88562 1.88562c-.26045.26045-.26045.68236 0 .94281l9.42812 9.42807-9.42812 9.4281c-.26045.2605-.26045.6824 0 .9428l1.88562 1.8856c.26045.2605.68236.2605.94281 0l9.42809-9.4281 9.4281 9.4281c.2604.2605.6823.2605.9428 0l1.8856-1.8856c.2605-.2604.2605-.6823 0-.9428z\" />\n\t\t\t\t</svg>\n\t\t\t</button>\n\t\t\t<div class=\"marker-info__content\">\n\t\t\t\t<strong class=\"heading u-font-title-3\">${location.title}</strong>\n\t\t\t\t${location.address_map ? `<p class=\"address\">${location.address_map}</p>` : ''}\n\t\t\t\t${location.phone ? `<p class=\"phone\"><a class=\"u-text-link\" href=\"tel:${location.phone}\">${location.phone_formatted}</a></p>` : ''}\n\t\t\t\t${location.email ? `<p class=\"email\"><a class=\"u-text-link\" href=\"mailto:${location.email}\">${location.email}</a></p>` : ''}\n\t\t\t\t${location.link && location.link.url ? `<p class=\"link\"><a class=\"u-text-link\" href=\"${location.link.url}\">${location.link.text}</a></p>` : ''}\n\t\t\t</div>\n\t\t</div>\n\t`;\n\n\t\treturn contentString;\n\t}\n\n\tfunction handleFilterChange(\n\t\tlocations,\n\t\tselects,\n\t\tmap,\n\t\tmarkers,\n\t\tbounds,\n\t\tdefaultPinColor,\n\t\tclickedPinColor,\n\t\tinfoWindow,\n\t\tactiveMarkerRef,\n\t\tmapElement,\n\t\tlistSection,\n\t\tcurrentMap\n\t) {\n\n\t\tconst filteredLocations = getFilteredLocations(locations, selects);\n\n\t\tconst filterClosestButton = currentMap.querySelector('.filter-closest');\n\t\tif (filterClosestButton) {\n\t\t\tfilterClosestButton.disabled = filteredLocations.length === 0;\n\t\t}
260\n\n\t\tmarkers.forEach(marker => marker.setMap(null));\n\t\tmarkers.length = 0;\n\n\t\tbounds = new google.maps.LatLngBounds();\n\n\t\tfilteredLocations.forEach(location => {\n\t\t\tconst position = new google.maps.LatLng(location.lat, location.lng);\n\t\t\tconst marker = new google.maps.Marker({\n\t\t\t\tposition: position,\n\t\t\t\tmap,\n\t\t\t\ttitle: location.title,\n\t\t\t\ticon: getSvgUrl(defaultPinColor),\n\t\t\t});\n\n\t\t\tmarkers.push(marker);\n\n\t\t\tbounds.extend(position);\n\n\t\t\tmarker.addListener('click', () => {\n\t\t\t\tif (activeMarkerRef.current) {\n\t\t\t\t\tactiveMarkerRef.current.setIcon(getSvgUrl(defaultPinColor));\n\t\t\t\t}\n\t\t\t\tmarker.setIcon(getSvgUrl(clickedPinColor));\n\t\t\t\tactiveMarkerRef.current = marker;\n\n\t\t\t\tinfoWindow.setContent(getContentString(location));\n\t\t\t\tinfoWindow.open(map, marker);\n\t\t\t\tattachInfoWindowCloseListener(infoWindow);\n\n\t\t\t\tmap.panTo(marker.getPosition());\n\n\t\t\t\tscrollToMap(mapElement);\n\n\t\t\t\tif (mapElement) {\n\t\t\t\t\tmapElement.scrollIntoView({\n\t\t\t\t\t\tbehavior: 'smooth'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tmap.fitBounds(bounds);\n\n\t\tif (listSection) {\n\t\t\tgenerateGroupedLocationLists(listSection, filteredLocations);\n\t\t}\n\n\t}\n\n\tfunction getSvgUrl(color) {\n\t\tconst svgString = `\n\t\t\t\t<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"${color}\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t\t<path d=\"M14.7667 31.3544C5.68562 18.1894 4 16.8383 4 12C4 5.37256 9.37256 0 16 0C22.6274 0 28 5.37256 28 12C28 16.8383 26.3144 18.1894 17.2332 31.3544C16.6373 32.2152 15.3626 32.2152 14.7667 31.3544ZM16 17C18.7614 17 21 14.7614 21 12C21 9.23856 18.7614 7 16 7C13.2386 7 11 9.23856 11 12C11 14.7614 13.2386 17 16 17Z\"/>\n\t\t\t\t</svg>`;\n\t\treturn `data:image/svg+xml;utf8,${encodeURIComponent(svgString)}`;\n\t}
260\n\n\tfunction attachInfoWindowCloseListener(infoWindow) {\n\t\tgoogle.maps.event.addListener(infoWindow, 'domready', function() {\n\t\t\tconst closeButton = document.querySelector('.marker-info__close');\n\t\t\tif (closeButton) {\n\t\t\t\tcloseButton.addEventListener('click', function() {\n\t\t\t\t\tinfoWindow.close();\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction scrollToMap(mapElement) {\n\t\tconst desktopBreakpoint = 768;\n\n\t\tif (window.innerWidth > desktopBreakpoint && mapElement) {\n\t\t\tconst header = document.querySelector('.header_wrapper');\n\t\t\tconst headerHeight = header ? header.offsetHeight : 0;\n\n\t\t\tconst elementPosition = mapElement.getBoundingClientRect().top + window.scrollY;\n\t\t\tconst offsetPosition = elementPosition - headerHeight;\n\n\t\t\twindow.scrollTo({\n\t\t\t\ttop: offsetPosition,\n\t\t\t\tbehavior: 'smooth',\n\t\t\t});\n\t\t} else {\n\t\t\tmapElement.scrollIntoView({\n\t\t\t\tbehavior: 'smooth'\n\t\t\t});\n\t\t}\n\t}\n\n\tfunction initializePins(\n\t\tmap,\n\t\tlocations,\n\t\tmarkers,\n\t\tbounds,\n\t\tgetSvgUrl,\n\t\tdefaultPinColor,\n\t\tclickedPinColor,\n\t\tinfoWindow,\n\t\tactiveMarkerRef,\n\t\tmapElement\n\t) {\n\t\tlocations.forEach(function(location, index) {\n\t\t\tlocation.lat = parseFloat(location.lat);\n\t\t\tlocation.lng = parseFloat(location.lng);\n\t\t\tconst position = new google.maps.LatLng(location.lat, location.lng);\n\t\t\tconst marker = new google.maps.Marker({\n\t\t\t\tposition: {\n\t\t\t\t\tlat: location.lat,\n\t\t\t\t\tlng: location.lng\n\t\t\t\t},\n\t\t\t\tmap,\n\t\t\t\ttitle: location.title,\n\t\t\t\ticon: getSvgUrl(defaultPinColor),\n\t\t\t});\n\n\t\t\tmarkers[index] = marker;\n\t\t\tbounds.extend(position);\n\n\t\t\tmarker.addListener('click', function() {\n\n\t\t\t\tif (activeMarkerRef.current) {\n\t\t\t\t\tactiveMarkerRef.current.setIcon(getSvgUrl(defaultPinColor));\n\t\t\t\t}\n\n\t\t\t\tmarker.setIcon(getSvgUrl(clickedPinColor));\n\t\t\t\tactiveMarkerRef.current = marker;\n\n\t\t\t\tmap.panTo(marker.getPosition());\n\n\t\t\t\tif (mapElement) {\n\t\t\t\t\tmapElement.scrollIntoView({\n\t\t\t\t\t\tbehavior: 'smooth'\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tscrollToMap(mapElement);\n\n\t\t\t\tinfoWindow.setContent(getContentString(location));\n\t\t\t\tinfoWindow.open(map, marker);\n\t\t\t\tattachInfoWindowCloseListener(infoWindow);\n\t\t\t});\n\t\t});\n\t}\n\n\tfunction calculateDistance(lat1, lng1, lat2, lng2) {\n\t\tconst toRad = (value) => (value * Math.PI) / 180;\n\n\t\tconst R = 6371;\n\t\tconst dLat = toRad(lat2 - lat1);\n\t\tconst dLng = toRad(lng2 - lng1);\n\t\tconst a =\n\t\t\tMath.sin(dLat / 2) * Math.sin(dLat / 2) +\n\t\t\tMath.cos(toRad(lat1)) * Math.cos(toRad(lat2)) *\n\t\t\tMath.sin(dLng / 2) * Math.sin(dLng / 2);\n\t\tconst c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\t\treturn R * c;\n\t}\n\n\tfunction setupFilterClosestButton(\n\t\tcurrentMap,\n\t\tlocations,\n\t\tmarkers,\n\t\tmap,\n\t\tselects,\n\t\tinfoWindow,\n\t\tactiveMarkerRef,\n\t\tdefaultPinColor,\n\t\tlistSection\n\t) {\n\t\tconst filterClosestButton = currentMap.querySelector('.filter-closest');\n\n\t\tif (!filterClosestButton) {\n\t\t\tconsole.error('Filter closest button not found.');\n\t\t\treturn;\n\t\t}\n\n\t\tlet isClosestLocationShown = false;\n\t\tfilterClosestButton.disabled = false;\n\n\t\tfilterClosestButton.addEventListener('click', function () {\n\t\t\tif (filterClosestButton.disabled) return;\n\n\t\t\tfilterClosestButton.disabled = true;\n\n\t\t\tif (isClosestLocationShown) {\n\t\t\t\tconst filteredLocations = getFilteredLocations(locations, selects);\n\t\t\t\tconst locationsToShow = filteredLocations.length > 0 ? filteredLocations : locations;\n\n\t\t\t\tinfoWindow.close();\n\n\t\t\t\tif (activeMarkerRef.current) {\n\t\t\t\t\tactiveMarkerRef.current.setIcon(getSvgUrl(defaultPinColor));\n\t\t\t\t\tactiveMarkerRef.current = null;\n\t\t\t\t}\n\n\t\t\t\tconst bounds = new google.maps.LatLngBounds();\n\t\t\t\tmarkers.forEach((marker, index) => {\n\t\t\t\t\tconst location = locationsToShow.find((loc) =>\n\t\t\t\t\t\tloc.lat === marker.getPosition().lat() &&\n\t\t\t\t\t\tloc.lng === marker.getPosition().lng()\n\t\t\t\t\t);
260\n\t\t\t\t\tif (location) {\n\t\t\t\t\t\tmarker.setMap(map);\n\t\t\t\t\t\tbounds.extend(marker.getPosition());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmarker.setMap(null);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tmap.fitBounds(bounds);\n\n\t\t\t\tif (listSection){\n\t\t\t\t\tgenerateGroupedLocationLists(listSection, locationsToShow);\n\t\t\t\t}\n\n\t\t\t\tisClosestLocationShown = false;\n\t\t\t\tfilterClosestButton.disabled = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst filteredLocations = getFilteredLocations(locations, selects);\n\n\t\t\tif (filteredLocations.length === 0) {\n\t\t\t\talert(\"No locations match your filters.\");\n\t\t\t\tfilterClosestButton.disabled = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnavigator.geolocation.getCurrentPosition(\n\t\t\t\tfunction (position) {\n\t\t\t\t\tconst userLat = position.coords.latitude;\n\t\t\t\t\tconst userLng = position.coords.longitude;\n\n\t\t\t\t\tlet closestLocation = null;\n\t\t\t\t\tlet closestDistance = Infinity;\n\n\t\t\t\t\tfilteredLocations.forEach((location) => {\n\t\t\t\t\t\tconst distance = calculateDistance(\n\t\t\t\t\t\t\tuserLat,\n\t\t\t\t\t\t\tuserLng,\n\t\t\t\t\t\t\tlocation.lat,\n\t\t\t\t\t\t\tlocation.lng\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (distance < closestDistance) {\n\t\t\t\t\t\t\tclosestDistance = distance;\n\t\t\t\t\t\t\tclosestLocation = location;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tif (closestLocation) {\n\t\t\t\t\t\tconst closestMarker = markers.find(\n\t\t\t\t\t\t\t(marker) =>\n\t\t\t\t\t\t\t\tmarker.getPosition().lat() === closestLocation.lat &&\n\t\t\t\t\t\t\t\tmarker.getPosition().lng() === closestLocation.lng\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif (closestMarker) {\n\t\t\t\t\t\t\tgoogle.maps.event.trigger(closestMarker, 'click');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmap.panTo(new google.maps.LatLng(closestLocation.lat, closestLocation.lng));\n\t\t\t\t\t\tmap.setZoom(12);\n\n\t\t\t\t\t\tif(listSection){\n\t\t\t\t\t\t\tgenerateGroupedLocationLists(listSection, [closestLocation]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tisClosestLocationShown = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\talert(\"No locations match your filters.\");\n\t\t\t\t\t}\n\n\t\t\t\t\tfilterClosestButton.disabled = false;\n\t\t\t\t},\n\t\t\t\tfunction (error) {\n\t\t\t\t\tconsole.error(\"Error retrieving geolocation:\", error);\n\t\t\t\t\talert(\"Unable to retrieve your location. Please ensure location services are enabled.\");\n\t\t\t\t\tfilterClosestButton.disabled = false;\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t}\n\n\tfunction getFilteredLocations(locations, selects) {\n\t\tconst selectedFilters = Array.from(selects).reduce((acc, select) => {\n\t\t\tconst key = select.name.replace('filter-by-', '');\n\t\t\tacc[key] = Array.from(select.selectedOptions).map(option => option.value);\n\t\t\treturn acc;\n\t\t}, {});\n\n\t\treturn locations.filter(location => {\n\t\t\treturn Object.keys(selectedFilters).every(key => {\n\t\t\t\tconst values = selectedFilters[key];\n\t\t\t\treturn values.length === 0 || values.includes(location[key]);\n\t\t\t});\n\t\t});\n\t}\n\n\tfunction initMap() {\n\t\tconst allMaps = document.querySelectorAll('.ams-map');\n\n\t\tallMaps.forEach((currentMap, index) => {\n\t\t\t// console.log(`Initializing map ${index + 1}`);\n\n\t\t\tconst mapElement = currentMap.querySelector('.ams-map__media');\n\t\t\tif (!mapElement) {\n\t\t\t\tconsole.error(`Map element not found for map ${index + 1}`);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst filterClosestButton = currentMap.querySelector('.filter-closest');\n\t\t\tconst locations = JSON.parse(currentMap.getAttribute('data-locations') || '[]');\n\t\t\tif (!locations.length) {\n\t\t\t\tconsole.error(`No locations found for map ${index + 1}`);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst markers = [];\n\t\t\tconst bounds = new google.maps.LatLngBounds();\n\t\t\tconst activeMarkerRef = { current: null };\n\t\t\tconst infoWindow = new google.maps.InfoWindow();\n\t\t\tconst defaultPinColor = getCssCustomPropertyValue(currentMap, '--ams-color-card-icon') || '#008566';\n\t\t\tconst clickedPinColor = getCssCustomPropertyValue(currentMap, '--ams-color-card-icon-active') || '#313942';\n\n\t\t\tconst map = new google.maps.Map(mapElement, {\n\t\t\t\tzoom: 4,\n\t\t\t\tmaxZoom: 15,\n\t\t\t\tcenter: { lat: 0, lng: 0 },\n\t\t\t\tstyles: mapStyles,\n\t\t\t});\n\n\t\t\tconst listSection = currentMap.querySelector('.ams-map__panel-list');\n\t\t\tconst filterWrapper = currentMap.querySelector('.ams-map__filters');\n\t\t\tconst selects = filterWrapper ? filterWrapper.querySelectorAll('select') : null;\n\n\t\t\tinitializePins(\n\t\t\t\tmap,\n\t\t\t\tlocations,\n\t\t\t\tmarkers,\n\t\t\t\tboun
260ds,\n\t\t\t\tgetSvgUrl,\n\t\t\t\tdefaultPinColor,\n\t\t\t\tclickedPinColor,\n\t\t\t\tinfoWindow,\n\t\t\t\tactiveMarkerRef,\n\t\t\t\tmapElement\n\t\t\t);\n\n\t\t\tmap.fitBounds(bounds);\n\n\t\t\tif (filterWrapper && selects) {\n\t\t\t\tinitFilters(\n\t\t\t\t\tlocations,\n\t\t\t\t\tmap,\n\t\t\t\t\tmarkers,\n\t\t\t\t\tbounds,\n\t\t\t\t\tdefaultPinColor,\n\t\t\t\t\tclickedPinColor,\n\t\t\t\t\tinfoWindow,\n\t\t\t\t\tactiveMarkerRef,\n\t\t\t\t\tmapElement,\n\t\t\t\t\tfilterClosestButton,\n\t\t\t\t\tlistSection,\n\t\t\t\t\tcurrentMap\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (filterClosestButton) {\n\t\t\t\tsetupFilterClosestButton(\n\t\t\t\t\tcurrentMap,\n\t\t\t\t\tlocations,\n\t\t\t\t\tmarkers,\n\t\t\t\t\tmap,\n\t\t\t\t\tselects,\n\t\t\t\t\tinfoWindow,\n\t\t\t\t\tactiveMarkerRef,\n\t\t\t\t\tdefaultPinColor,\n\t\t\t\t\tlistSection\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (listSection) {\n\t\t\t\tgenerateGroupedLocationLists(listSection, locations);\n\t\t\t}\n\n\t\t\tmap.addListener('click', () => {\n\t\t\t\tif (activeMarkerRef.current) {\n\t\t\t\t\tactiveMarkerRef.current.setIcon(getSvgUrl(defaultPinColor));\n\t\t\t\t\tactiveMarkerRef.current = null;\n\t\t\t\t}\n\t\t\t\tinfoWindow.close();\n\t\t\t});\n\n\t\t\tcheckIfListMap(currentMap, markers, mapElement);\n\t\t});\n\t}\n\n function init() {\n loadGoogleMapsAPI();\n waitForGoogleMapsAPI(initMap);\n\n return _self;\n }\n\n return init();\n};\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/map.js?\n}"); 261 262/***/ }, 263 264/***/ "./src/resources/assets/js/frontend/multi-select.js" 265/*!**********************************************************!*\ 266 !*** ./src/resources/assets/js/frontend/multi-select.js ***! 267 \**********************************************************/ 268(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 269 270"use strict"; 271eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MultiSelect: () => (/* binding */ MultiSelect)\n/* harmony export */ });\n/**\n * Custom Multi Select\n */\nclass MultiSelect {\n /**\n * Default settings for the MultiSelect component.\n *\n * @type {Object}\n * @property {string} wrapperClass - The class of the main wrapper.\n * @property {string} buttonClass - The base class for the button element.\n * @property {string} buttonLabelClass - The class for the label text inside the button.\n * @property {string} buttonStyle - Default style attribute for the button.\n * @property {string} buttonVariant - Default variant (outline, etc.) for the button.\n * @property {string} dropdownClass - The base class for the dropdown element.\n * @property {string} dropdownTopClass - Class added if the dropdown is placed above the button.\n * @property {string} listClass - The base class for the `<ul>` list of options.\n * @property {string} itemClass - The base class for each `<li>` item.\n * @property {string} optgroupClass - Class applied to optgroup labels.\n * @property {string} optionClass - Class applied to normal option items.\n * @property {string} searchClass - Wrapper class for the search feature (if enabled).\n * @property {string} searchInputClass - Class for the text input used to search.\n * @property {string} searchButtonClass - Class for the search button element.\n * @property {string} noResultsClass - Class for the \"No Results\" item.\n * @property {number} minDropdownHeight - Minimum dropdown height in pixels.\n * @property {number} maxDropdownHeight - Maximum dropdown height in pixels.\n * @property {number} bufferSpace - Space to keep from viewport edges in pixels.\n * @property {number} searchDebounceDelay - Debounce delay for search input in milliseconds.\n */\n static defaults = {\n wrapperClass: \"c-select__wrapper\",\n buttonClass: \"c-select__button\",\n buttonLabelClass: \"c-select__button__label\",\n buttonStyle: \"square\",\n buttonVariant: \"outline\",\n dropdownClass: \"c-select__dropdown\",\n dropdownTopClass: \"c-select__dropdown--top\",\n listClass: \"c-select__list\",\n itemClass: \"c-select__item\",\n optgroupClass: \"c-select__item--optgroup\",\n optionClass: \"c-select__item--option\",\n searchClass: \"c-select__search\",\n searchInputClass: \"c-select__search__input\",\n searchButtonClass: \"c-select__search__btn\",\n noResultsClass: \"c-select__item--no-results\",\n minDropdownHeight: 200,\n maxDropdownHeight: 300,\n bufferSpace: 20,\n searchDebounceDelay: 200,\n };\n\n /**\n * Constructor for the MultiSelect component.\n *\n * @param {Object} settings - Configuration overrides for the MultiSelect.\n * @param {HTMLElement} settings.element - The container element that wraps the native <select>.\n */\n constructor(settings) {\n this.settings = { ...MultiSelect.defaults, ...settings };\n this.element = this.settings.element;\n this.select = this.element.querySelector(\"select\");\n\n // Validate required elements\n if (!this.select) {\n throw new Error(\"MultiSelect: <select> element not found\");\n }\n\n this.selectId = this.select.getAttribute(\"id\");\n this.optGroups = this.select.querySelectorAll(\"optgroup\");\n this.options = [...this.select.querySelectorAll(\"option\")];\n this.button = null;\n this.buttonLabel = null;\n this.dropdown = null;\n this.wrapper = null;\n this.customOptions = [];\n\n /**\n * Holds references to each `.js-select__item` â `.js-select__checkbox` for quick lookup.\n * @type {Map<HTMLElement, HTMLInputElement>}\n */\n this.checkboxes = new Map();\n\n this.arrowIcon = this.element.querySelectorAll(\"svg\");\n this.label = document.querySelector(`[for=\"${this.selectId}\"]`);\n this.labelContent = \"\";\n this.selectedOptCounter = 0;\n this.optionIndex = 0;\n this.lastMatchingIndex = 0;\n this.lastTypedChar = \"\";\n this.isMouseDown = false;\n\n // Store bound event handlers for cleanup\n this.boundWindowClickHandler = null;\n this.boundFocusOutHandler = null;\n this.boundLabelClickHandler = null;\n this.boundButtonClickHandler = null;\n this.boundButtonKeydownHandler = null;\n this.boundDropdownMousedownHandler = null;\n this.boundDropdownMouseupHandler = null;\n this.boundDropdownClickHandler = null;\n this.boundDropdownKeydownHandler = null;\n this.boundSelectChangeHandler = null;\n this.boundSearchInputHandler = null;\n this.searchDebounceTimeout = null;\n this.transitionEndCallback = null;\n this.focusTimeoutId = null;\n\n if (this.label) {\n this.labelContent = this.label.textContent;\n }\n\n // Button label options\n this.noSelectedLabel =\n this.element.getAttribute(\"data-no-selected-label\") || \"Select options\";\n this.multiSelectedLabel =\n this.element.getAttribute(\"data-multi-selected-label\") ||\n \"{n} items selected\";\n this.multiSelectedNumber =\n this.element.getAttribute(\"data-multi-selected-n\") || 1;\n this.noUpdateLabel =\n this.element.getAttribute(\"data-update-label\") === \"off\";\n this.insetLabel = this.element.getAttribute(\"data-inset-label\") === \"on\";\n this.search = this.element.getAttribute(\"data-search\") === \"on\";\n this.searchLabel =\n this.element.getAttribute(\"data-search-label\") || \"Search...\";\n this.noResultsLabel =\n this.element.getAttribute(\"data-no-results-label\") ||\n \"No results found...\";
271\n\n // Escape HTML in user-provided labels for security\n this.noSelectedLabel = this.escapeHtmlInConstructor(this.noSelectedLabel);\n this.multiSelectedLabel = this.escapeHtmlInConstructor(\n this.multiSelectedLabel\n );\n this.searchLabel = this.escapeHtmlInConstructor(this.searchLabel);\n this.noResultsLabel = this.escapeHtmlInConstructor(this.noResultsLabel);\n\n this.initSelect();\n this.initSelectEvents();\n }\n\n /**\n * Escapes HTML special characters to prevent XSS attacks.\n * Used during construction before DOM is available.\n * @private\n * @param {string} text - The text to escape.\n * @return {string} HTML-escaped text.\n */\n escapeHtmlInConstructor(text) {\n return text\n .replace(/&/g, \"&\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\");\n }\n\n /**\n * Injects the custom markup for the MultiSelect UI and stores relevant elements.\n * - Builds the button and dropdown HTML.\n * - Hides the native <select> and arrow icon.\n * - Initializes necessary references (like this.customOptions).\n * @private\n */\n initSelect() {\n // Create HTML for custom select\n const selectHtml = `\n\t\t\t<div class=\"${this.settings.wrapperClass}\">\n\t\t\t\t${this.selectButton()}\n\t\t\t\t${this.selectDropdown()}\n\t\t\t</div>`;\n this.element.insertAdjacentHTML(\"beforeend\", selectHtml);\n\n // Save custom elements\n this.wrapper = this.element.querySelector(`.${this.settings.wrapperClass}`);\n this.button = this.element.querySelector(\".js-select__button\");\n this.buttonLabel = this.button.querySelector(\".js-select__label\");\n this.dropdown = this.element.querySelector(\".js-select__dropdown\");\n this.customOptions = [\n ...this.dropdown.querySelectorAll(\".js-select__item\"),\n ];\n this.customOptions.forEach((option) => {\n const checkbox = option.querySelector(\".js-select__checkbox\");\n if (checkbox) {\n this.checkboxes.set(option, checkbox);\n }\n });\n this.searchInput = this.dropdown.querySelector(\n `.${this.settings.searchInputClass}`\n );\n this.searchButton = this.dropdown.querySelector(\n `.${this.settings.searchButtonClass}`\n );\n this.noResults = this.dropdown.querySelector(\n `.${this.settings.noResultsClass}`\n );\n\n // Hide default select and arrow\n this.select.classList.add(\"u-hide\");\n if (this.arrowIcon.length > 0) {\n this.arrowIcon[0].classList.add(\"u-hide\");\n }\n\n // Store dropdown min width\n this.minWidth = parseInt(\n getComputedStyle(this.dropdown).getPropertyValue(\"min-width\")\n );\n\n // Place dropdown\n this.placeDropdown();\n }\n\n /**\n * Attaches all event listeners needed to operate the MultiSelect:\n * - Click/keydown on the button to toggle or open the dropdown.\n * - Click on dropdown items/checkboxes to select/deselect.\n * - Keydown within the dropdown for navigation.\n * - External 'change' on the <select> to sync UI.\n * - Search input changes.\n * - Window click to close dropdown when clicking outside.\n * @private\n */\n initSelectEvents() {\n // Focus on button when label is clicked\n if (this.label) {\n this.boundLabelClickHandler = () => {\n this.moveFocus(this.button);\n };\n this.label.addEventListener(\"click\", this.boundLabelClickHandler);\n }\n\n // Toggle open on click\n this.boundButtonClickHandler = () => {\n this.toggleDropdown();\n };\n this.button.addEventListener(\"click\", this.boundButtonClickHandler);\n\n // Toggle on specific keys\n this.boundButtonKeydownHandler = (event) => {\n this.handleOpenKeyPress(event);\n };\n this.button.addEventListener(\"keydown\", this.boundButtonKeydownHandler);\n\n // Track mouse down state\n this.boundDropdownMousedownHandler = () => {\n this.isMouseDown = true;\n };\n this.dropdown.addEventListener(\n \"mousedown\",\n this.boundDropdownMousedownHandler\n );\n\n this.boundDropdownMouseupHandler = () => {\n this.isMouseDown = false;\n };\n this.dropdown.addEventListener(\"mouseup\", this.boundDropdownMouseupHandler);\n\n // Handle clicks on the dropdown\n this.boundDropdownClickHandler = (event) => {\n const option = event.target.closest(\".js-select__item\");\n if (option) {\n // Prevent default behavior for checkboxes and labels\n event.preventDefault();\n this.selectOption(option);\n }\n };\n this.dropdown.addEventListener(\"click\", this.boundDropdownClickHandler);\n\n // Keyboard nav in dropdown\n this.boundDropdownKeydownHandler = (event) => {\n this.handleDropdownKeyPress(event);\n };\n this.dropdown.addEventListener(\"keydown\", this.boundDropdownKeydownHandler);
271\n\n // Listen for external changes to the <select>\n this.boundSelectChangeHandler = () => {\n this.syncUIWithNativeSelect();\n };\n this.select.addEventListener(\"change\", this.boundSelectChangeHandler);\n\n // Search with inline debounce\n if (this.searchInput) {\n this.boundSearchInputHandler = () => {\n clearTimeout(this.searchDebounceTimeout);\n this.searchDebounceTimeout = setTimeout(\n () => this.filterOptions(),\n this.settings.searchDebounceDelay\n );\n };\n this.searchInput.addEventListener(\"input\", this.boundSearchInputHandler);\n }\n\n // Close if clicking outside\n this.boundWindowClickHandler = (event) => {\n if (!this.wrapper.contains(event.target)) {\n this.toggleDropdown(false);\n }\n };\n window.addEventListener(\"click\", this.boundWindowClickHandler);\n\n // Close when focus leaves the component\n this.boundFocusOutHandler = () => {\n // Don't close if we're in the middle of a mouse interaction\n if (this.isMouseDown) {\n return;\n }\n\n // Clear any existing timeout\n if (this.focusTimeoutId) {\n clearTimeout(this.focusTimeoutId);\n }\n\n // Use timeout to ensure focus has settled after tab navigation\n this.focusTimeoutId = setTimeout(() => {\n // Only close if focus is truly outside and dropdown is still open\n const focusedElement = this.wrapper.ownerDocument.activeElement;\n const isOutside = !this.wrapper.contains(focusedElement);\n\n if (isOutside && this.isDropdownOpen() && !this.isMouseDown) {\n this.toggleDropdown(false);\n }\n this.focusTimeoutId = null;\n }, 50);\n };\n this.wrapper.addEventListener(\"focusout\", this.boundFocusOutHandler);\n }\n\n /**\n * Creates the HTML string for the main button element:\n * - Responsible for toggling the dropdown\n * - Displays currently selected items in the label\n * @private\n * @return {string} HTML markup for the button.\n */\n selectButton() {\n // Determine button class based on whether data-button-class attribute exist\n const buttonClass = this.element.getAttribute(\"data-button-class\")\n ? `${this.settings.buttonClass} ${this.element.getAttribute(\n \"data-button-class\"\n )}`\n : this.settings.buttonClass;\n\n // Determine button style based on whether data-button-style attribute exist\n const buttonStyle = this.element.getAttribute(\"data-button-style\")\n ? this.element.getAttribute(\"data-button-style\")\n : this.settings.buttonStyle;\n\n // Determine button variant based on whether data-button-variant attribute exist\n const buttonVariant = this.element.getAttribute(\"data-button-variant\")\n ? this.element.getAttribute(\"data-button-variant\")\n : this.settings.buttonVariant;\n\n // Add aria label if a label is associated with this select\n const ariaLabel = this.labelContent\n ? `aria-label=\"${this.labelContent}\"`\n : \"\";\n\n // Get the HTML string of the first arrow icon element (if available)\n const arrowIconHTML =\n this.arrowIcon.length > 0 ? this.arrowIcon[0].outerHTML : \"\";\n\n return `\n\t\t\t<button\n\t\t\t\tclass=\"${buttonClass} js-select__button\"\n\t\t\t\tdata-style=\"${buttonStyle}\"\n\t\t\t\tdata-variant=\"${buttonVariant}\"\n\t\t\t\ttype=\"button\"\n\t\t\t\trole=\"combobox\"\n\t\t\t\t${ariaLabel}\n\t\t\t\taria-controls=\"${this.selectId}-dropdown\"\n\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\taria-expanded=\"false\"\n\t\t\t\ttabindex=\"0\">\n\t\t\t\t\t<span class=\"${this.settings.buttonLabelClass} js-select__label\">\n\t\t\t\t\t\t${this.getSelectedOptionText()}\n\t\t\t\t\t</span>\n\t\t\t\t\t${arrowIconHTML}\n\t\t\t</button>`;\n }\n\n /**\n * Creates the dropdown HTML string containing the search bar (if enabled) and the list of options.\n * @private\n * @return {string} The full dropdown markup, including <ul>.\n */\n selectDropdown() {\n const dropdownID = `${this.selectId}-dropdown`;\n const dropdownClass = `${this.settings.dropdownClass} js-select__dropdown`;\n\n // Build the search markup if enabled\n let searchMarkup = \"\";\n if (this.search) {\n searchMarkup = `\n <div class=\"${this.settings.searchClass}\">\n <input\n type=\"search\"\n class=\"${this.settings.searchInputClass} f-control\"\n placeholder=\"${this.searchLabel}\"\n aria-label=\"${this.searchLabel}\">\n <button class=\"${this.settings.searchButtonClass}
271\" aria-label=\"Search\">\n <svg class=\"\" viewBox=\"0 0 20 20\">\n <title>Search</title>\n <g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\n <circle cx=\"8\" cy=\"8\" r=\"6\"/>\n <line x1=\"12.242\" y1=\"12.242\" x2=\"18\" y2=\"18\"/>\n </g>\n </svg>\n </button>\n </div>\n `;\n }\n\n // Build list items, possibly grouped by <optgroup>\n let listItems = \"\";\n if (this.optGroups.length > 0) {\n this.optGroups.forEach((optGroup) => {\n const optGroupLabel = optGroup.label;\n const optGroupOptions = [...optGroup.querySelectorAll(\"option\")];\n\n listItems += `\n <li>\n <span class=\"${this.settings.itemClass} ${this.settings.optgroupClass}\">\n ${optGroupLabel}\n </span>\n </li>\n `;\n listItems += this.buildOptionsList(optGroupOptions);\n });\n } else {\n listItems += this.buildOptionsList(this.options);\n }\n\n // Add a no-results item if searching is enabled or if there are no options\n if (this.search || this.options.length === 0) {\n listItems += `\n <li\n class=\"${this.settings.itemClass} ${this.settings.optionClass} ${\n this.settings.noResultsClass\n }\"\n aria-hidden=\"${this.options.length > 0}\">\n <span>${this.noResultsLabel}</span>\n </li>\n `;\n }\n\n return `\n <div id=\"${dropdownID}\" class=\"${dropdownClass}\">\n ${searchMarkup}\n <ul\n class=\"${this.settings.listClass}\"\n role=\"listbox\"\n aria-multiselectable=\"true\">\n ${listItems}\n </ul>\n </div>`;\n }\n\n /**\n * Builds the `<li>` list markup for a given set of <option> elements.\n * Each item includes a visually hidden checkbox and a label for text.\n *\n * @private\n * @param {HTMLOptionElement[]} options - An array of <option> elements to transform into <li> items.\n * @return {string} The HTML markup for the generated list items.\n */\n buildOptionsList(options) {\n let list = \"\";\n\n // If no options, return empty string - the message will be handled in selectDropdown\n if (!options || options.length === 0) {\n return \"\";\n }\n\n // Iterate over each option and construct the HTML for it\n options.forEach((option) => {\n const selected = option.selected\n ? 'aria-selected=\"true\"'\n : 'aria-selected=\"false\"';\n const disabled = option.disabled ? \"disabled\" : \"\";\n const checked = option.selected ? \"checked\" : \"\";\n\n list += `\n\t\t\t\t<li\n\t\t\t\t\tclass=\"js-select__item\"\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\tdata-value=\"${option.value}\"\n\t\t\t\t\tdata-index=\"${this.optionIndex}\"\n\t\t\t\t\tdata-label=\"${option.text}\"\n\t\t\t\t\t${selected}\n\t\t\t\t\t>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\tid=\"${this.selectId}-option-${this.optionIndex}\"\n\t\t\t\t\t\t\tclass=\"f-checkbox js-select__checkbox\"\n\t\t\t\t\t\t\t${checked}\n\t\t\t\t\t\t\t${disabled}\n\t\t\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t<label\n\t\t\t\t\t\t\tclass=\"${this.settings.itemClass} ${this.settings.optionClass}\"\n\t\t\t\t\t\t\tfor=\"${this.selectId}-option-${this.optionIndex}\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span>${option.text}</span>\n\t\t\t\t\t\t</label>\n\t\t\t\t</li>\n\t\t\t`;\n\n this.optionIndex++;\n });\n\n return list;\n }\n\n /**\n * Filters (shows/hides) the list items in the dropdown based on user input.\n * If no items match, the .noResults item is shown.\n * @private\n */\n filterOptions() {\n if (!this.searchInput) {\n return;\n }\n\n const query = this.searchInput.value.trim().toLowerCase();\n if (!query) {\n // If no query, show all items, hide 'no results'\n this.customOptions.forEach((item) => {\n item.classList.remove(\"u-hide\");\n item.removeAttribute(\"aria-hidden\");\n });\n this.toggleNoResultsMessage(true);\n return;\n }\n\n let hasVisibleOptions = false;\n this.customOptions.forEach((item) => {\n const text = item.textContent.toLowerCase();\n const matches = text.includes(query);\n\n item.classList.toggle(\"u-hide\", !matches);\n item.setAttribute(\"aria-hidden\", !matches);\n\n if (matches) {\n hasVisibleOptions = true;\n }\n });\n\n this.toggleNoResultsMessage(hasVisibleOptions);\n }\n\n /**\n * Toggles the visibility of the 'no results' message based on the search outcome.\n * @private\n * @param {boolean} hasVisibleOptions - Whether there is at least one matching item.\n */\n toggleNoResultsMessage(hasVisibleOptions) {\n if (this.noResults) {\n this.noResults.classList.toggle(\"u-hide\", hasVisibleOptions);\n this.noResults.setAttribute(\"aria-hidden\", hasVisibleOptions);\n }\n }\n\n /**\n * Opens or closes the dropdown based on the provided boolean or current state.\n * - Also handles focusing the selected item, placing the dropdown, etc.\n * @private\n * @param {boolean} bool - If true/false, forces the dropdown open/closed;
271 otherwise toggles.\n */\n toggleDropdown(bool) {\n let ariaExpanded;\n if (typeof bool === \"boolean\") {\n ariaExpanded = bool;\n } else {\n ariaExpanded = this.button.getAttribute(\"aria-expanded\") !== \"true\";\n }\n this.button.setAttribute(\"aria-expanded\", ariaExpanded.toString());\n\n // If the dropdown is opening\n if (ariaExpanded) {\n // Determine what element to focus\n const elementToFocus =\n this.searchInput ||\n this.getSelectedOption() ||\n this.dropdown.querySelector(\".js-select__checkbox\");\n\n // Focus immediately\n if (elementToFocus) {\n this.moveFocus(elementToFocus);\n }\n\n // Remove previous transition callback if it exists\n if (this.transitionEndCallback) {\n this.dropdown.removeEventListener(\n \"transitionend\",\n this.transitionEndCallback\n );\n }\n\n // Ensure focus is maintained after transitions\n this.transitionEndCallback = () => {\n if (elementToFocus) {\n this.moveFocus(elementToFocus);\n }\n this.dropdown.removeEventListener(\n \"transitionend\",\n this.transitionEndCallback\n );\n this.transitionEndCallback = null;\n };\n this.dropdown.addEventListener(\n \"transitionend\",\n this.transitionEndCallback\n );\n\n // Position the dropdown (up or down) based on available space\n this.placeDropdown();\n } else if (this.transitionEndCallback) {\n // Clean up transition callback when closing\n this.dropdown.removeEventListener(\n \"transitionend\",\n this.transitionEndCallback\n );\n this.transitionEndCallback = null;\n }\n }\n\n /**\n * Positions the dropdown below if possible, else above if possible.\n * If neither side has enough space, use whichever side has more space.\n * The dropdown's max-height is capped at maxDropdownHeight, but may be less if space is limited.\n * @private\n */\n placeDropdown() {\n const buttonRect = this.button.getBoundingClientRect();\n\n // Calculate available space below and above\n const spaceBelow =\n window.innerHeight - buttonRect.bottom - this.settings.bufferSpace;\n const spaceAbove = buttonRect.top - this.settings.bufferSpace;\n\n let moveUp = false;\n let dropdownMaxHeight = this.settings.minDropdownHeight;\n\n // If we have enough space below, use that\n if (spaceBelow >= this.settings.minDropdownHeight) {\n moveUp = false;\n dropdownMaxHeight = Math.min(spaceBelow, this.settings.maxDropdownHeight);\n }\n // If not enough space below but enough above, use above\n else if (spaceAbove >= this.settings.minDropdownHeight) {\n moveUp = true;\n dropdownMaxHeight = Math.min(spaceAbove, this.settings.maxDropdownHeight);\n }\n // If neither side has enough space, use whichever has more space\n else if (spaceBelow >= spaceAbove) {\n moveUp = false;\n dropdownMaxHeight = Math.max(0, spaceBelow);\n } else {\n moveUp = true;\n dropdownMaxHeight = Math.max(0, spaceAbove);\n }\n\n // Toggle the \"move-up\" class if needed\n this.dropdown.classList.toggle(this.settings.dropdownTopClass, moveUp);\n\n // Build style string\n let dropdownStyle = `max-height: ${dropdownMaxHeight}px;`;\n if (this.minWidth < this.button.offsetWidth) {\n dropdownStyle += ` min-width: ${this.button.offsetWidth}px;`;\n }\n\n // Apply styles\n this.dropdown.setAttribute(\"style\", dropdownStyle);\n }\n\n /**\n * Handles key presses on the main button to open the dropdown using certain keys.\n * @private\n * @param {KeyboardEvent} event\n */\n handleOpenKeyPress(event) {\n const { key } = event;\n const openKeys = [\"ArrowDown\", \"ArrowUp\", \"Enter\", \" \"];\n\n if (!this.isDropdownOpen() && openKeys.includes(key)) {\n event.preventDefault();\n this.toggleDropdown(true);\n }\n }\n\n /**\n * Handles keydown events within the dropdown for navigation, closing on escape, etc.\n * @private\n * @param {KeyboardEvent} event\n */\n handleDropdownKeyPress(event) {\n const { key } = event;\n switch (key) {\n case \"Escape\":\n this.toggleDropdown(false);\n this.moveFocus(this.button);\n break;\n case \"Tab\":\n this.handleTabKeyPress(event);\n break;\n case \"ArrowUp\":\n this.handleDirectionKeyPress(\"prev\", event);\n break;\n case \"ArrowDown\":\n this.handleDirectionKeyPress(\"next\", event);\n break;\n case \" \":\n this.handleSpaceKeyPress(event);\n break;\n case \"Enter\":\n this.handleSpaceKeyPress(event);\n break;\n default:\n if (\n this.searchInput &&\n this.searchInput.ownerDocument.activeElement === this.searchInput\n ) {\n // Let search input handle typed characters\n break;\n }\n this.handleAlphanumericKeyPress(key);\n break;\n }\n }\n\n /**\n * Handles Tab key press to navigate between search input, search button, and options.\n * @private\n * @param {KeyboardEvent} event\n */\n handleTabKeyPress(event) {\n const activeElement = this.dropdown.ownerDocument.activeElement;\n\n // If search exists (input + button)\n if (this.searchInput && this.searchButton) {\n if (activeElement === this.searchInput) {\n event.preventDefault();\n // Tab from search input â search button\n this.moveFocus(this.searchButton);\n } else if (activeElement === this.searchButton) {\n if (event.shiftKey) {\n event.preventDefault();\n // Shift+Tab from search button â search input\n this.moveFocus(this.searchInput);\n } else {\n event.preventDefault();\n // Tab from search button â first option\n const firstOption = this.dropdown.querySelector(\n \".js-select__checkbox\"\n );\n if (firstOption) {\n this.moveFocus(firstOption);\n }\n }\n } else {\n // We're on an option\n const currentItem = activeElement.closest(\".js-select__item\");\n const currentIndex = Array.prototype.indexOf.call(\n this.customOptions,\n currentItem\n );\n\n if (event.shiftKey) {\n event.preventDefault();\n // Shift+Tab from first option â search button, otherwise previous option\n if (currentIndex === 0) {\n this.moveFocus(this.searchButton);\n } else {\n this.handleDirectionKeyPress(\"prev\", event);\n }\n } else if (currentIndex === this.customOptions.length - 1) {\n // Tab from last option â close dropdown and let focus move naturally\n this.toggleDropdown(false);\n this.moveFocus(this.button);\n // Don't prevent default - let Tab move to next element\n } else {\n event.preventDefault();\n this.handleDirectionKeyPress(\"next\", event);\n }\n }\n } else if (event.shiftKey) {\n // No search input, just navigate between options\n this.handleDirectionKeyPress(\"prev\", event);\n } else {\n this.handleDirectionKeyPress(\"next\", event);\n }\n }\n\n /**\n * Moves focus up/down to the next/previous item in the dropdown.\n * @private\n * @param {\"prev\"|\"next\"} direction - The direction to move focus.\n * @param {KeyboardEvent} event - The keydown event object.\n */\n handleDirectionKeyPress(direction, event) {\n event.preventDefault();\n\n let index = Array.prototype.indexOf.call(\n this.customOptions,\n this.dropdown.ownerDocument.activeElement.closest(\".js-select__item\")\n );\n index = direction === \"next\" ? index + 1 : index - 1;\n\n if (index < 0) {\n index = this.customOptions.length - 1;\n }\n if (index >= this.customOptions.length) {\n index = 0;\n }\n\n this.moveFocus(\n this.customOptions[index].querySelector(\".js-select__checkbox\")\n );\n }\n\n /**\n * Toggles selection on the currently focused item when space or Enter is pressed.\n * @private\n * @param {KeyboardEvent} event\n */\n handleSpaceKeyPress(event) {\n event.preventDefault();\n const focusedItem =\n this.dropdown.ownerDocument.activeElement.closest(\".js-select__item\");\n if (focusedItem) {\n this.selectOption(focusedItem);\n }\n }\n\n /**\n * Jumps to the first option whose label starts with the typed character, cycling if multiple match.\n * @private\n * @param {string} key - The typed character.\n */\n handleAlphanumericKeyPress(key) {\n const typedChar = key.toLowerCase();\n if (this.lastTypedChar !== typedChar) {\n this.lastMatchingIndex = 0;\n }\n\n const matchingOptions = Array.from(this.customOptions).filter((option) =>
271 {\n const text =\n option.querySelector(\"span\")?.textContent.toLowerCase() || \"\";\n return text.startsWith(typedChar);\n });\n\n if (matchingOptions.length) {\n if (this.lastMatchingIndex >= matchingOptions.length) {\n this.lastMatchingIndex = 0;\n }\n const target = matchingOptions[this.lastMatchingIndex++];\n this.moveFocus(target.querySelector(\".js-select__checkbox\"));\n }\n\n this.lastTypedChar = typedChar;\n }\n\n /**\n * Selects or deselects a given option item in the dropdown,\n * updates the native <select>, and dispatches the necessary events.\n * @private\n * @param {HTMLElement} option - The `.js-select__item` element to toggle.\n */\n selectOption(option) {\n const isSelected = option.getAttribute(\"aria-selected\") === \"true\";\n const checkbox = option.querySelector(\".js-select__checkbox\");\n\n if (isSelected) {\n // Deselect option\n option.setAttribute(\"aria-selected\", \"false\");\n if (checkbox) {\n checkbox.checked = false;\n }\n this.updateNativeSelect(option.getAttribute(\"data-index\"), false);\n } else {\n // Select option\n option.setAttribute(\"aria-selected\", \"true\");\n if (checkbox) {\n checkbox.checked = true;\n }\n this.updateNativeSelect(option.getAttribute(\"data-index\"), true);\n }\n\n // Update label text\n if (this.buttonLabel) {\n const selectLabel = this.getSelectedOptionText();\n this.buttonLabel.innerHTML = selectLabel;\n\n // Toggle active class if there's at least 1 selection\n this.button.classList.toggle(\n \"select__label--active\",\n this.selectedOptCounter > 0\n );\n }\n\n // Dispatch events for external scripts\n option.dispatchEvent(\n new CustomEvent(\"change\", {\n bubbles: true,\n detail: {\n selected: !isSelected,\n value: option.getAttribute(\"data-value\"),\n },\n })\n );\n this.select.dispatchEvent(new Event(\"change\", { bubbles: true }));\n this.select.dispatchEvent(new Event(\"input\", { bubbles: true }));\n }\n\n /**\n * Syncs the custom dropdown UI with the current state of <select>.\n * Called whenever an external change happens on the <select> (e.g., via code or tags).\n * @private\n */\n syncUIWithNativeSelect() {\n this.options.forEach((option, index) => {\n const item = this.dropdown.querySelector(\n `.js-select__item[data-index=\"${index}\"]`\n );\n if (!item) {\n return;\n }\n\n const isSelected = item.getAttribute(\"aria-selected\") === \"true\";\n if (option.selected && !isSelected) {\n // If <select> says it's selected, but the item is not\n item.setAttribute(\"aria-selected\", \"true\");\n const checkbox = this.checkboxes.get(item);\n if (checkbox) {\n checkbox.checked = true;\n }\n } else if (!option.selected && isSelected) {\n // If <select> says it's not selected, but the item is\n item.setAttribute(\"aria-selected\", \"false\");\n const checkbox = this.checkboxes.get(item);\n if (checkbox) {\n checkbox.checked = false;\n }\n }\n });\n\n // Update the dropdown button label\n if (this.buttonLabel) {\n const labelText = this.getSelectedOptionText();\n this.buttonLabel.innerHTML = labelText;\n }\n }\n\n /**\n * Updates the selected property of the correct native <option> object(s).\n * Does not dispatch events (those happen in selectOption()) to avoid duplication.\n *\n * @private\n * @param {number|string} index - The index of the <option> to update (or null/undefined to update all).\n * @param {boolean} bool - Whether the option(s) should be selected (true) or deselected (false).\n */\n updateNativeSelect(index, bool) {\n if (index === null || index === undefined) {\n this.options.forEach((opt) => (opt.selected = bool));\n } else {\n this.options[index].selected = bool;\n }\n }\n\n /**\n * Gets the first selected `.js-select__item`'s checkbox or the first checkbox if none are selected.\n * @private\n * @return {HTMLElement|null} The checkbox of a selected item or the first item if none are selected.\n */\n getSelectedOption() {\
271n const selectedOption = this.dropdown.querySelector(\n '[aria-selected=\"true\"]'\n );\n if (selectedOption) {\n return selectedOption.querySelector(\".js-select__checkbox\");\n }\n return this.dropdown.querySelector(\".js-select__checkbox\");\n }\n\n /**\n * Builds the text label to display in the button based on the currently selected options.\n * Note: Labels are already HTML-escaped in the constructor for security.\n * @private\n * @return {string} HTML string representing the selected options in a user-friendly way.\n */\n getSelectedOptionText() {\n const noSelectionText = `<span class=\"term\">${this.noSelectedLabel}</span>`;\n if (this.noUpdateLabel) {\n return noSelectionText;\n }\n\n this.selectedOptCounter = 0;\n let text = \"\";\n this.options.forEach((option) => {\n if (option.selected) {\n if (this.selectedOptCounter > 0) {\n text += \", \";\n }\n // option.text comes from native select, already safe\n text += option.text;\n this.selectedOptCounter++;\n }\n });\n\n if (this.selectedOptCounter > this.multiSelectedNumber) {\n const labelWithCount = this.multiSelectedLabel.replace(\n \"{n}\",\n this.selectedOptCounter\n );\n text = `<span class=\"details\">${labelWithCount}</span>`;\n } else if (this.selectedOptCounter > 0) {\n // Escape the concatenated option text for safety\n const div = document.createElement(\"div\");\n div.textContent = text;\n text = `<span class=\"details\">${div.innerHTML}</span>`;\n } else {\n text = this.noSelectedLabel;\n }\n\n if (this.insetLabel && this.selectedOptCounter > 0) {\n text = noSelectionText + text;\n }\n\n return text;\n }\n\n /**\n * Checks if the dropdown is currently open (aria-expanded=\"true\" and element is visible).\n * @private\n * @return {boolean} True if the dropdown is open, false otherwise.\n */\n isDropdownOpen() {\n return (\n this.button.getAttribute(\"aria-expanded\") === \"true\" &&\n this.isVisible(this.button)\n );\n }\n\n /**\n * Determines if a DOM element is visible in the layout.\n * @private\n * @param {HTMLElement} element - The element to check.\n * @return {boolean} True if element has layout (offset width/height), otherwise false.\n */\n isVisible(element) {\n return !!(\n element.offsetWidth ||\n element.offsetHeight ||\n element.getClientRects().length\n );\n }\n\n /**\n * Moves focus to a specified element (checkbox or button),\n * ensuring it has a valid tabindex and is actually focused.\n * @private\n * @param {HTMLElement} element - The element to focus.\n */\n moveFocus(element) {\n // Guard if no element found\n if (!element) {\n return;\n }\n\n // Try to focus the element\n element.focus();\n\n // If the element did not receive focus, set tabindex and try again\n if (element.ownerDocument.activeElement !== element) {\n element.setAttribute(\"tabindex\", \"-1\"); // Temporarily make focusable\n element.focus();\n }\n }\n\n /**\n * Cleans up the multi-select component by removing event listeners and restoring the native select.\n * Call this method when removing the component from the DOM to prevent memory leaks.\n */\n destroy() {\n // Clear any pending timeouts\n if (this.focusTimeoutId) {\n clearTimeout(this.focusTimeoutId);\n }\n if (this.searchDebounceTimeout) {\n clearTimeout(this.searchDebounceTimeout);\n }\n\n // Remove event listeners\n if (this.boundWindowClickHandler) {\n window.removeEventListener(\"click\", this.boundWindowClickHandler);\n }\n if (this.boundFocusOutHandler && this.wrapper) {\n this.wrapper.removeEventListener(\"focusout\", this.boundFocusOutHandler);\n }\n if (this.boundLabelClickHandler && this.label) {\n this.label.removeEventListener(\"click\", this.boundLabelClickHandler);\n }\n if (this.boundButtonClickHandler && this.button) {\n this.button.removeEventListener(\"click\", this.boundButtonClickHandler);\n }\n if (this.boundButtonKeydownHandler && this.button) {\n this.button.removeEventListener(\n \"keydown\",\n this.boundButtonKeydownHandler\n );\n }\n if (this.boundDropdownMousedownHandler && this.dropdown) {\n this.dropdown.removeEventListener(\n \"mousedown\",\n this.boundDropdownMousedownHandler\n );\n }\n if (this.boundDropdownMouseupHandler && this.dropdown) {\n this.dropdown.removeEventListener(\n \"mouseup\",\n this.boundDropdownMouseupHandler\n );\n }\n if (this.boundDropdownClickHandler && this.dropdown) {\n this.dropdown.removeEventListener(\n \"click\",\n this.boundDropdownClickHandler\n );\n }\n if (this.boundDropdownKeydownHandler && this.dropdown) {\n this.dropdown.removeEventListener(\n \"keydown\",\n this.boundDropdownKeydownHandler\n );\n }\n if (this.boundSelectChangeHandler && this.select) {\n this.select.removeEventListener(\"change\", this.boundSelectChangeHandler);\n }\n if (this.boundSearchInputHandler && this.searchInput) {\n this.searchInput.removeEventListener(\n \"input\",\n this.boundSearchInputHandler\n );\n }\n if (this.transitionEndCallback && this.dropdown) {\n this.dropdown.removeEventListener(\n \"transitionend\",\n this.transitionEndCallback\n );\n }\n\n // Remove custom elements\n if (this.wrapper) {\n this.wrapper.remove();\n }\n\n // Show native select and arrow\n this.select.classList.remove(\"u-hide\");\n if (this.arrowIcon.length > 0) {\n this.arrowIcon[0].classList.remove(\"u-hide\");\n }\n\n // Clear references\n this.button = null;\n this.buttonLabel = null;\n this.dropdown = null;\n this.wrapper = null;\n this.customOptions = [];\n this.checkboxes.clear();\n this.searchInput = null;\n this.searchButton = null;\n this.noResults = null;\n this.boundWindowClickHandler = null;\n this.boundFocusOutHandler = null;\n this.boundLabelClickHandler = null;\n this.boundButtonClickHandler = null;\n this.boundButtonKeydownHandler = null;\n this.boundDropdownMousedownHandler = null;\n this.boundDropdownMouseupHandler = null;\n this.boundDropdownClickHandler = null;\n this.boundDropdownKeydownHandler = null;\n this.boundSelectChangeHandler = null;\n this.boundSearchInputHandler = null;\n this.transitionEndCallback = null;\n this.focusTimeoutId = null;\n }\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/multi-select.js?\n}"); 272 273/***/ }, 274 275/***/ "./src/resources/assets/js/frontend/quotesSlider.js" 276/*!**********************************************************!*\ 277 !*** ./src/resources/assets/js/frontend/quotesSlider.js ***! 278 \**********************************************************/ 279(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 280 281"use strict"; 282eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ QuotesSlider: () => (/* binding */ QuotesSlider)\n/* harmony export */ });\n/* harmony import */ var swiper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! swiper */ \"./node_modules/swiper/swiper.mjs\");\n/* harmony import */ var swiper_modules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! swiper/modules */ \"./node_modules/swiper/modules/index.mjs\");\n\n // eslint-disable-line import/no-unresolved\n\n/**\n * Quote Slider\n *\n * @param {Object} settings\n * @param {HTMLElement} settings.$el - Swiper container element\n * @param {string} settings.item - CSS class name for slide items\n * @param {string} settings.pagination - CSS selector for pagination element\n * @param {HTMLElement} settings.prev - Previous button element\n * @param {HTMLElement} settings.next - Next button element\n * @param {string} settings.slidesPerView - Number of slides visible at desktop\n */\nconst QuotesSlider = function (settings) {\n \"use strict\";\n\n const _settings = { ...settings };\n\n function cacheDom() {\n _settings.$items = _settings.$el.querySelectorAll(`.${_settings.item}`);\n }\n\n function initSlider() {\n const spv = parseInt(_settings.slidesPerView) || 2;\n const slideCount = _settings.$items.length;\n const canLoop = slideCount >= spv * 2;\n\n _settings.slider = new swiper__WEBPACK_IMPORTED_MODULE_0__[\"default\"](_settings.$el, {\n modules: [swiper_modules__WEBPACK_IMPORTED_MODULE_1__.Navigation, swiper_modules__WEBPACK_IMPORTED_MODULE_1__.Pagination, swiper_modules__WEBPACK_IMPORTED_MODULE_1__.A11y, swiper_modules__WEBPACK_IMPORTED_MODULE_1__.Keyboard],\n slidesPerView: 1,\n slidesPerGroup: 1,\n spaceBetween: 24,\n loop: canLoop,\n rewind: !canLoop,\n loopAdditionalSlides: canLoop ? spv : 0,\n grabCursor: true,\n a11y: {\n enabled: true,\n },\n keyboard: {\n enabled: true,\n onlyInViewport: true,\n },\n breakpoints: {\n 992: {\n slidesPerView: spv,\n slidesPerGroup: spv,\n spaceBetween: 64,\n },\n },\n pagination: {\n el: _settings.pagination,\n type: \"bullets\",\n },\n navigation: {\n prevEl: _settings.prev,\n nextEl: _settings.next,\n },\n });\n }
282\n\n function init() {\n cacheDom();\n initSlider();\n }\n\n return init();\n};\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/quotesSlider.js?\n}"); 283 284/***/ }, 285 286/***/ "./src/resources/assets/js/frontend/scrollClasses.js" 287/*!***********************************************************!*\ 288 !*** ./src/resources/assets/js/frontend/scrollClasses.js ***! 289 \***********************************************************/ 290(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 291 292"use strict"; 293eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ScrollClasses: () => (/* binding */ ScrollClasses)\n/* harmony export */ });\n/**\n * ScrollClasses\n *\n * Updates classes on the body based on scroll behavior.\n */\nconst ScrollClasses = function() {\n 'use strict';\n\n function updateScrollClasses(previousVerticalScrollPosition, headerHeight) {\n\t\t// Get current scroll position\n const verticalScrollPosition = window.pageYOffset || document.documentElement.scrollTop;\n const threshold = 5; // Threshold for scroll difference\n\n\t\t// Calculate scroll difference\n const scrollDifference = Math.abs(previousVerticalScrollPosition - verticalScrollPosition);\n\n\t\t// Check if scroll difference is within threshold\n if (scrollDifference <= threshold) return;\n\n\t\t// Check the direction of the scroll and update scroll classes based on direction and position\n if (verticalScrollPosition > previousVerticalScrollPosition && verticalScrollPosition > headerHeight) { // Scroll down, if\n document.body.classList.remove('scrolled-up');\n document.body.classList.add('scrolled-down');\n } else { // Scroll up\n document.body.classList.remove('scrolled-down');\n document.body.classList.add('scrolled-up');\n }\n\t\tverticalScrollPosition <= (headerHeight / 2) && document.body.classList.remove('scrolled-up');\n }\n\n return {\n updateScrollClasses\n };\n};\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/scrollClasses.js?\n}"); 294 295/***/ }, 296 297/***/ "./src/resources/assets/js/frontend/scrollWatcher.js" 298/*!***********************************************************!*\ 299 !*** ./src/resources/assets/js/frontend/scrollWatcher.js ***! 300 \***********************************************************/ 301(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 302 303"use strict"; 304eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ScrollWatcher: () => (/* binding */ ScrollWatcher)\n/* harmony export */ });\n/* harmony import */ var _scrollClasses_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scrollClasses.js */ \"./src/resources/assets/js/frontend/scrollClasses.js\");\n\n/**\n * ScrollWatcher\n *\n * Watches for scroll events and triggers appropriate actions.\n *\n * @param {object} settings Settings object.\n */\nconst ScrollWatcher = function(settings) {\n 'use strict';\n\n const _self = this;\n const _settings = {};\n let didScroll;\n let previousVerticalScrollPosition = 0;\n\n Object.assign(_settings, settings);\n\n const scrollClasses = new _scrollClasses_js__WEBPACK_IMPORTED_MODULE_0__.ScrollClasses();\n\n function cacheDom() {\n _settings.$headerWrapper = document.querySelector(_settings.headerWrapper);\n }\n\n function bindEvents() {\n window.addEventListener('scroll', handleScroll);\n }\n\n function handleScroll() {\n didScroll = true;\n requestAnimationFrame(hasScrolled);\n }\n\n function hasScrolled() {\n\t\t// Delegate update of body classes to ScrollClasses\n scrollClasses.updateScrollClasses(previousVerticalScrollPosition, _settings.$headerWrapper.offsetHeight);\n\t\t// Update previous scroll position\n previousVerticalScrollPosition = window.pageYOffset || document.documentElement.scrollTop;\n }
304\n\n function init() {\n cacheDom();\n bindEvents();\n\n return _self;\n }\n\n return init();\n};\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/scrollWatcher.js?\n}"); 305 306/***/ }, 307 308/***/ "./src/resources/assets/js/frontend/select.js" 309/*!****************************************************!*\ 310 !*** ./src/resources/assets/js/frontend/select.js ***! 311 \****************************************************/ 312(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 313 314"use strict"; 315eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Select: () => (/* binding */ Select)\n/* harmony export */ });\n/**\n * Custom Select\n */\nclass Select {\n /**\n * Default settings for the Select component.\n * @type {Object}\n * @property {string} wrapperClass - The class of the main wrapper.\n * @property {string} buttonClass - The base class for the button element.\n * @property {string} buttonLabelClass - The class for the label text inside the button.\n * @property {string} dropdownClass - The base class for the dropdown element.\n * @property {string} dropdownTopClass - Class added if the dropdown is placed above the button.\n * @property {string} listClass - The base class for the `<ul>` list of options.\n * @property {string} itemClass - The base class for each `<li>` item.\n * @property {string} optgroupClass - Class applied to optgroup labels.\n * @property {string} optionClass - Class applied to normal option items.\n * @property {number} minDropdownHeight - Minimum dropdown height in pixels.\n * @property {number} maxDropdownHeight - Maximum dropdown height in pixels.\n * @property {number} bufferSpace - Space to keep from viewport edges in pixels.\n */\n static defaults = {\n wrapperClass: \"c-select__wrapper\",\n buttonClass: \"c-select__button\",\n buttonLabelClass: \"c-select__button__label\",\n dropdownClass: \"c-select__dropdown\",\n dropdownTopClass: \"c-select__dropdown--top\",\n listClass: \"c-select__list\",\n itemClass: \"c-select__item\",\n optgroupClass: \"c-select__item--optgroup\",\n optionClass: \"c-select__item--option\",\n minDropdownHeight: 200,\n maxDropdownHeight: 300,\n bufferSpace: 20,\n };\n\n /**\n * @class\n * @param {Object} settings - Configuration overrides for the Select.\n * @param {HTMLElement} settings.element - The container element that wraps the native <select>.\n */\n constructor(settings) {\n this.settings = { ...Select.defaults, ...settings };\n this.element = this.settings.element;\n this.select = this.element.querySelector(\"select\");\n\n // Validate required elements\n if (!this.select) {\n throw new Error(\"Select: <select> element not found\");\n }\n\n this.selectId = this.select.getAttribute(\"id\");\n this.optGroups = this.select.querySelectorAll(\"optgroup\");\n this.options = [...this.select.querySelectorAll(\"option\")];\n this.button = null;\n this.buttonLabel = null;\n this.dropdown = null;\n this.wrapper = null;\n this.customOptions = [];\n this.arrowIcon = this.element.querySelectorAll(\"svg\");\n this.label = document.querySelector(`[for=\"${this.selectId}\"]`);\n this.labelContent = \"\";\n this.optionIndex = 0;\n this.lastMatchingIndex = 0;\n this.lastTypedChar = \"\";\n\n // Store bound event handlers for cleanup\n this.boundWindowClickHandler = null;\n this.boundFocusOutHandler = null;\n this.boundLabelClickHandler = null;\n this.boundButtonClickHandler = null;\n this.boundButtonKeydownHandler = null;\n this.boundDropdownClickHandler = null;\n this.boundDropdownKeydownHandler = null;\n this.boundSelectUpdatedHandler = null;\n this.transitionEndCallback = null;\n\n if (this.label) {\n this.labelContent = this.label.textContent;\n }\n\n this.noSelectedLabel =\n this.element.getAttribute(\"data-no-selected-label\") || \"Select option\";\n\n this.initSelect();\n this.initSelectEvents();\n }\n\n /**\n * Updates the select button label with the selected option text.\n * If data-show-group-label is enabled, prepends the optgroup label to the option text.\n * @private\n * @param {HTMLElement} selectedOption - The selected option element.\n */\n updateSelectLabel(selectedOption) {\n if (!selectedOption || !this.buttonLabel) {\n return;\n }\n\n // Find the corresponding optgroup (date) in the same ul as the selected option\n const parentUl = selectedOption.closest(\"ul\");\n const optGroupElement = parentUl\n ? parentUl.querySelector(\".c-select__item--optgroup\")\n : null;\n const optGroupLabel = parentUl\n ? parentUl.closest(\".js-select[data-show-group-label]\")\n : null;
315\n\n if (\n optGroupElement &&\n optGroupLabel &&\n optGroupLabel.getAttribute(\"data-show-group-label\") === \"true\"\n ) {\n // If the optgroup element exists, get its text (which contains the date)\n const selectedDate = optGroupElement.textContent.trim();\n\n // Prepend the date to the selected option's text\n this.buttonLabel.textContent = `${selectedDate} - ${selectedOption.textContent}`;\n } else {\n this.buttonLabel.textContent = selectedOption.textContent;\n }\n }\n\n /**\n * Injects the custom markup for the Select UI and stores relevant elements.\n * - Builds the button and dropdown HTML.\n * - Hides the native <select> and arrow icon.\n * - Initializes necessary references (like this.customOptions).\n * @private\n */\n initSelect() {\n // Set the selected index to -1 if the first option is selected by default\n if (this.select.selectedIndex === 0) {\n this.select.selectedIndex = -1;\n }\n\n // Create HTML for custom select\n const selectHtml = `\n\t\t\t<div class=\"${this.settings.wrapperClass}\">\n\t\t\t\t${this.selectButton()}\n\t\t\t\t${this.selectDropdown()}\n\t\t\t</div>`;\n this.element.insertAdjacentHTML(\"beforeend\", selectHtml);\n\n // Save custom elements\n this.wrapper = this.element.querySelector(`.${this.settings.wrapperClass}`);\n this.button = this.element.querySelector(\".js-select__button\");\n this.buttonLabel = this.button.querySelector(\".js-select__label\");\n this.dropdown = this.element.querySelector(\".js-select__dropdown\");\n this.customOptions = [\n ...this.dropdown.querySelectorAll(\".js-select__item\"),\n ];\n\n // Hide default select and arrow\n this.select.classList.add(\"u-hide\");\n if (this.arrowIcon.length > 0) {\n this.arrowIcon[0].classList.add(\"u-hide\");\n }\n\n // Store dropdown min width\n this.minWidth = parseInt(\n getComputedStyle(this.dropdown).getPropertyValue(\"min-width\")\n );\n\n // Place dropdown\n this.placeDropdown();\n\n // Set the selected option and date on page load\n this.setInitialSelectedOption();\n }\n\n /**\n * Sets the initial selected option on page load.\n * Updates the button label with the selected option text.\n * @private\n */\n setInitialSelectedOption() {\n // Get the currently selected option in the native select element\n const selectedIndex = this.select.selectedIndex;\n const selectedOption = this.dropdown.querySelector(\n `.js-select__item[data-index=\"${selectedIndex}\"]`\n );\n\n // If a selected option exists, update the label with the date and option text\n if (selectedOption) {\n this.updateSelectLabel(selectedOption);\n }\n }\n\n /**\n * Attaches all event listeners needed to operate the Select:\n * - Click/keydown on the button to toggle or open the dropdown.\n * - Click on dropdown items to select.\n * - Keydown within the dropdown for navigation.\n * - External 'select-updated' event to sync UI.\n * - Window click to close dropdown when clicking outside.\n * @private\n */\n initSelectEvents() {\n // Move focus to button when clicking on select label\n if (this.label) {\n this.boundLabelClickHandler = () => {\n this.moveFocus(this.button);\n };\n this.label.addEventListener(\"click\", this.boundLabelClickHandler);\n }\n\n // Toggle select on click\n this.boundButtonClickHandler = () => {\n this.toggleDropdown();\n };\n this.button.addEventListener(\"click\", this.boundButtonClickHandler);\n\n // Open select on different keys\n this.boundButtonKeydownHandler = (event) => {\n this.handleOpenKeyPress(event);\n };\n this.button.addEventListener(\"keydown\", this.boundButtonKeydownHandler);\n\n // Select option\n this.boundDropdownClickHandler = (event) => {\n const option = event.target.closest(\".js-select__item\");\n\n if (option) {\n this.selectOption(option);\n }\n };\n this.dropdown.addEventListener(\"click\", this.boundDropdownClickHandler);\n\n // Keyboard navigation for dropdown\n this.boundDropdownKeydownHandler = (event) => {\n this.handleDropdownKeyPress(event);\n };\n this.dropdown.addEventListener(\"keydown\", this.boundDropdownKeydownHandler);\n\n // Native select element has been updated, update custom select as well\n this.boundSelectUpdatedHandler = () => {\n this.resetSelect();\n };\n this.element.addEventListener(\n \"select-updated\",\n this.boundSelectUpdatedHandler\n );\n\n // Close select when clicking outside it\n this.boundWindowClickHandler = (event) => {\n if (!this.wrapper.contains(event.target)) {\n this.toggleDropdown(false);\n }\n };\n window.addEventListener(\"click\", this.boundWindowClickHandler);
315\n\n // Close select when focus leaves the component\n this.boundFocusOutHandler = (event) => {\n // Check if the new focus target is outside the wrapper\n if (!this.wrapper.contains(event.relatedTarget)) {\n this.toggleDropdown(false);\n }\n };\n this.wrapper.addEventListener(\"focusout\", this.boundFocusOutHandler);\n }\n\n /**\n * Creates the HTML string for the main button element:\n * - Responsible for toggling the dropdown\n * - Displays currently selected item in the label\n * @private\n * @return {string} HTML markup for the button.\n */\n selectButton() {\n // Determine the button class based on whether data-button-class attribute exist\n const buttonClass = this.element.getAttribute(\"data-button-class\")\n ? `${this.settings.buttonClass} ${this.element.getAttribute(\n \"data-button-class\"\n )}`\n : this.settings.buttonClass;\n\n // Add aria label if there is a label for the select\n const ariaLabel = this.labelContent\n ? `aria-label=\"${this.labelContent}\"`\n : \"\";\n\n // Get the HTML string of the first arrow icon element (if available)\n const arrowIconHTML =\n this.arrowIcon.length > 0 ? this.arrowIcon[0].outerHTML : \"\";\n\n // Construct the button element with proper attributes and content\n const button = `\n\t\t\t<button\n\t\t\t\tclass=\"${buttonClass} js-select__button\"\n\t\t\t\ttype=\"button\"\n\t\t\t\trole=\"combobox\"\n\t\t\t\t${ariaLabel}\n\t\t\t\taria-controls=\"${this.selectId}-dropdown\"\n\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\taria-expanded=\"false\"\n\t\t\t\ttabindex=\"0\">\n\t\t\t\t\t<span class=\"${this.settings.buttonLabelClass} js-select__label\">\n\t\t\t\t\t\t${this.getSelectedOptionText()}\n\t\t\t\t\t</span>\n\t\t\t\t\t${arrowIconHTML}\n\t\t\t</button>`;\n\n return button;\n }\n\n /**\n * Creates the dropdown HTML string containing the list of options.\n * @private\n * @return {string} The full dropdown markup, including <ul>.\n */\n selectDropdown() {\n const dropdownID = `${this.selectId}-dropdown`;\n const dropdownClass = `${this.settings.dropdownClass} js-select__dropdown`;\n\n // Build list items, possibly grouped by <optgroup>\n let listItems = \"\";\n if (this.optGroups.length > 0) {\n this.optGroups.forEach((optGroup) => {\n const optGroupLabel = optGroup.label;\n const optGroupOptions = Array.from(optGroup.querySelectorAll(\"option\"));\n\n listItems += `\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<span class=\"${this.settings.itemClass} ${this.settings.optgroupClass}\">\n\t\t\t\t\t\t\t${optGroupLabel}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t`;\n listItems += this.buildOptionsList(optGroupOptions);\n });\n } else {\n listItems += this.buildOptionsList(this.options);\n }\n\n return `\n\t\t\t<div id=\"${dropdownID}\" class=\"${dropdownClass}\">\n\t\t\t\t<ul class=\"${this.settings.listClass}\" role=\"listbox\">\n\t\t\t\t\t${listItems}\n\t\t\t\t</ul>\n\t\t\t</div>`;\n }\n\n /**\n * Opens or closes the dropdown based on the provided boolean or current state.\n * - Also handles focusing the selected item, placing the dropdown, etc.\n * @private\n * @param {boolean} bool - If true/false, forces the dropdown open/closed; otherwise toggles.\n */\n toggleDropdown(bool) {\n // Determine the aria-expanded value\n let ariaExpanded;\n\n if (typeof bool === \"boolean\") {\n ariaExpanded = bool;\n } else {\n ariaExpanded = this.button.getAttribute(\"aria-expanded\") !== \"true\";\n }\n\n // Set the aria-expanded attribute\n this.button.setAttribute(\"aria-expanded\", ariaExpanded.toString());\n\n // If the dropdown is opening (expanded is 'true'), perform additional actions\n if (ariaExpanded) {\n const selectedOption = this.getSelectedOption();\n // Focus on the selected option, or the first option if none is selected\n const optionToFocus = selectedOption || this.customOptions[0];\n\n // Focus on the option if it exists\n if (optionToFocus) {\n this.moveFocus(optionToFocus);\n }\n\n // Remove previous transition callback if it exists\n if (this.transitionEndCallback) {\n this.dropdown.removeEventListener(\n \"transitionend\",\n this.transitionEndCallback\n );\n }\n\n // Set up a callback to ensure focus is maintained after any transitions\n this.transitionEndCallback = () => {\n if (optionToFocus) {\n this.moveFocus(optionToFocus);\n }\n this.dropdown.removeEventListener(\n \"transitionend\",\n this.transitionEndCallback\n );\n this.transitionEndCallback = null;\n };\n\n // Add event listener for transition end to re-focus after animation\n this.dropdown.addEventListener(\n \"transitionend\",\n this.transitionEndCallback\n );\n\n // Position the dropdown based on available space\n this.placeDropdown();\n } else if (this.transitionEndCallback) {\n // Clean up transition callback when closing\n this.dropdown.removeEventListener(\n \"transitionend\",\n this.transitionEndCallback\n );\n this.transitionEndCallback = null;\n }\n }\n\n /**\n * Positions the dropdown below if possible, else above if possible.\n * If neither side has enough space, use whichever side has more space.\n * The dropdown's max-height is capped at maxDropdownHeight, but may be less if space is limited.\n * @private\n */\n placeDropdown() {\n const buttonRect = this.button.getBoundingClientRect();\n\n // Calculate available space below and above\n const spaceBelow =\n window.innerHeight - buttonRect.bottom - this.settings.bufferSpace;\n const spaceAbove = buttonRect.top - this.settings.bufferSpace;\n\n let moveUp = false;\n let dropdownMaxHeight = this.settings.minDropdownHeight;\n\n // If we have enough space below, use that\n if (spaceBelow >= this.settings.minDropdownHeight) {\n moveUp = false;\n dropdownMaxHeight = Math.min(spaceBelow, this.settings.maxDropdownHeight);\n }\n // If not enough space below but enough above, use above\n else if (sp
315aceAbove >= this.settings.minDropdownHeight) {\n moveUp = true;\n dropdownMaxHeight = Math.min(spaceAbove, this.settings.maxDropdownHeight);\n }\n // If neither side has enough space, use whichever has more space\n else if (spaceBelow >= spaceAbove) {\n moveUp = false;\n dropdownMaxHeight = Math.max(0, spaceBelow);\n } else {\n moveUp = true;\n dropdownMaxHeight = Math.max(0, spaceAbove);\n }\n\n // Toggle the \"move-up\" class if needed\n this.dropdown.classList.toggle(this.settings.dropdownTopClass, moveUp);\n\n // Build style string\n let dropdownStyle = `max-height: ${dropdownMaxHeight}px;`;\n if (this.minWidth < this.button.offsetWidth) {\n dropdownStyle += ` min-width: ${this.button.offsetWidth}px;`;\n }\n\n // Apply styles\n this.dropdown.setAttribute(\"style\", dropdownStyle);\n }\n\n /**\n * Handles key presses on the main button to open the dropdown using certain keys.\n * @private\n * @param {KeyboardEvent} event\n */\n handleOpenKeyPress(event) {\n const { key } = event;\n const openKeys = [\"ArrowDown\", \"ArrowUp\", \"Enter\", \" \"];\n\n if (!this.isDropdownOpen() && openKeys.includes(key)) {\n event.preventDefault();\n this.toggleDropdown(true);\n }\n }\n\n /**\n * Handles keydown events within the dropdown for navigation, closing on escape, etc.\n * @private\n * @param {KeyboardEvent} event\n */\n handleDropdownKeyPress(event) {\n const { key } = event;\n\n switch (key) {\n case \"Escape\":\n this.toggleDropdown(false);\n this.moveFocus(this.button);\n break;\n case \"ArrowUp\":\n this.handleDirectionKeyPress(\"prev\", event);\n break;\n case \"ArrowDown\":\n this.handleDirectionKeyPress(\"next\", event);\n break;\n case \"Enter\":\n case \" \":\n this.handleSpaceKeyPress(event);\n break;\n default:\n this.handleAlphanumericKeyPress(key);\n break;\n }\n }\n\n /**\n * Toggles selection on the currently focused item when space or Enter is pressed.\n * @private\n * @param {KeyboardEvent} event\n */\n handleSpaceKeyPress(event) {\n event.preventDefault();\n const focusedItem =\n this.dropdown.ownerDocument.activeElement.closest(\".js-select__item\");\n if (focusedItem) {\n this.selectOption(focusedItem);\n }\n }\n\n /**\n * Moves focus up/down to the next/previous item in the dropdown.\n * @private\n * @param {\"prev\"|\"next\"} direction - The direction to move focus.\n * @param {KeyboardEvent} event - The keydown event object.\n */\n handleDirectionKeyPress(direction, event) {\n event.preventDefault();\n\n let index = Array.prototype.indexOf.call(\n this.customOptions,\n this.dropdown.ownerDocument.activeElement\n );\n\n // If no option is currently focused (e.g., button has focus), start from selected or first option\n if (index === -1) {\n const selectedOption = this.getSelectedOption();\n if (selectedOption) {\n index = Array.prototype.indexOf.call(\n this.customOptions,\n selectedOption\n );\n } else {\n index = direction === \"next\" ? -1 : 0;\n }\n }\n\n index = direction === \"next\" ? index + 1 : index - 1;\n if (index < 0) {\n index = this.customOptions.length - 1;\n }\n if (index >= this.customOptions.length) {\n index = 0;\n }\n this.moveFocus(this.customOptions[index]);\n }\n\n /**\n * Jumps to the first option whose label starts with the typed character, cycling if multiple match.\n * @private\n * @param {string} key - The typed character.\n */\n handleAlphanumericKeyPress(key) {\n const typedChar = key.toLowerCase();\n\n if (this.lastTypedChar !== typedChar) {\n this.lastMatchingIndex = 0;\n }\n\n const matchingOptions = Array.from(this.customOptions).filter((option) =>\n option.textContent.toLowerCase().startsWith(typedChar)\n );\n\n if (matchingOptions.length) {\n if (this.lastMatchingIndex >= matchingOptions.length) {\n this.lastMatchingIndex = 0;\n }\n\n const value = matchingOptions[this.lastMatchingIndex];\n const index = Array.from(this.customOptions).indexOf(value);\n\n this.optionIndex = index;\n this.moveFocus(this.customOptions[this.optionIndex]);\n this.lastMatchingIndex += 1;\n }\n\n this.lastTypedChar = typedChar;\n }\n\n /**\n * Selects a given option item in the dropdown,\n * updates the native <select>, and dispatches the necessary events.\n * @private\n * @param {HTMLElement} option - The `.js-select__item` element to select.\n */\n selectOption(option) {\n const isSelected = option.getAttribute(\"aria-selected\") === \"true\";\n\n if (isSelected) {\n // Option is already selected, hide dropdown\n this.button.setAttribute(\"aria-expanded\", \"false\");\n } else {\n // Deselect currently selected option\n const selectedOption = this.dropdown.querySelector(\n '[aria-selected=\"true\"]'\n );\n\n if (selectedOption) {\n selectedOption.setAttribute(\"aria-selected\", \"false\");\n }\n\n // Select the new option\n option.setAttribute(\"aria-selected\", \"true\");\n\n // Update button label with selected option text\n if (this.buttonLabel) {\n this.buttonLabel.textContent = option.textContent;\n\n // Update the label by calling the reusable function\n this.updateSelectLabel(option);\n }\n\n // Hide dropdown after selection\n this.button.setAttribute(\"aria-expanded\", \"false\");\n\n // Update native select element\n const newIndex = parseInt(option.getAttribute(\"data-index\"), 10);\n this.updateNativeSelect(newIndex);\n }\n\n // Move focus back to button after selection\n this.button.focus();\n }\n\n /**\n * Updates the selected property of the native <select> element.\n * Dispatches change and input events to notify external scripts.\n * @private\n * @param {number} index - The index of the <option> to select.\n */\n updateNativeSelect(index) {\n // Update selected index of the native select element\n this.select.selectedIndex = index;\n\n // Dispatch change and input events to simulate user interaction\n this.select.dispatchEvent(new CustomEvent(\"change\", { bubbles: true }));\n this.select.dispatchEvent(new CustomEvent(\"input\", { bubbles: true }));\n }\n\n /**\n * Resets the select component to match the current state of the native <select>.\n * Called when a 'select-updated' event is dispatched.\n * @private\n */\n resetSelect() {\n // Deselect currently selected option\n const selectedOption = this.dropdown.querySelector(\n '[aria-selected=\"true\"]'\n );\n\n if (selectedOption) {\n selectedOption.setAttribute(\"aria-selected\", \"false\");\n }\n\n // Get the native select's selectedIndex, but do not auto-select if no option is chosen\n const selectedIndex = this.select.selectedIndex;\n\n if (selectedIndex > -1) {\n const option = this.dropdown.querySelector(\n `.js-select__item[data-index=\"${selectedIndex}\"]`\n );\n\n if (option && this.buttonLabel) {\n option.setAttribute(\"aria-selected\", \"true\");\n\n // Update button label with the text of the newly selected option\n this.buttonLabel.textContent = option.textContent;\n } else if (this.buttonLabel) {\n // Set button label to `noSelectedLabel` if no option is selected\n this.buttonLabel.textContent = this.noSelectedLabel;\n }\n }\n\n // Hide dropdown after resetting\n this.button.setAttribute(\"aria-expanded\", \"false\");\n }\n\n /**\n * Builds the `<li>` list markup for a given set of <option> elements.\n * Each item is a button element with proper ARIA attributes.\n * @private\n * @param {HTMLOptionElement[]} options - An array of <option> elements to transform into <li> items.\n * @return {string} The HTML markup for the generated list items.\n */\n buildOptionsList(options) {\n let list = \"\";\n\n // Iterate over each option and construct the HTML for it\n options.forEach((option) =>
315 {\n const selected = option.selected\n ? 'aria-selected=\"true\"'\n : 'aria-selected=\"false\"';\n const disabled = option.disabled ? \"disabled\" : \"\";\n list += `<li><button type=\"button\" class=\"${this.settings.itemClass} ${this.settings.optionClass} js-select__item\" role=\"option\" data-value=\"${option.value}\" data-index=\"${this.optionIndex}\" ${selected} ${disabled}>${option.textContent}</button></li>`;\n this.optionIndex++;\n });\n\n return list;\n }\n\n /**\n * Gets the currently selected `.js-select__item` element.\n * @private\n * @return {HTMLElement|null} The selected item or null if none are selected.\n */\n getSelectedOption() {\n // Ensure dropdown is defined before querying\n if (!this.dropdown) {\n return null;\n }\n\n // Find the currently selected option\n const option = this.dropdown.querySelector('[aria-selected=\"true\"]');\n\n // Return selected option or null if none is selected\n return option || null;\n }\n\n /**\n * Builds the text label to display in the button based on the currently selected option.\n * @private\n * @return {string} The text of the selected option or the default \"no selection\" label.\n */\n getSelectedOptionText() {\n const selectedIndex = this.select.selectedIndex;\n\n // Return the text of the selected option if it exists, otherwise return `this.noSelectedLabel`\n return selectedIndex > -1\n ? this.options[selectedIndex].textContent\n : this.noSelectedLabel;\n }\n\n /**\n * Checks if the dropdown is currently open (aria-expanded=\"true\" and element is visible).\n * @private\n * @return {boolean} True if the dropdown is open, false otherwise.\n */\n isDropdownOpen() {\n return (\n this.button.getAttribute(\"aria-expanded\") === \"true\" &&\n this.isVisible(this.button)\n );\n }\n\n /**\n * Determines if a DOM element is visible in the layout.\n * @private\n * @param {HTMLElement} element - The element to check.\n * @return {boolean} True if element has layout (offset width/height), otherwise false.\n */\n isVisible(element) {\n return !!(\n element.offsetWidth ||\n element.offsetHeight ||\n element.getClientRects().length\n );\n }\n\n /**\n * Moves focus to a specified element (option or button),\n * ensuring it has a valid tabindex and is actually focused.\n * @private\n * @param {HTMLElement} element - The element to focus.\n */\n moveFocus(element) {\n // Guard if no element found\n if (!element) {\n return;\n }\n\n // Try to focus the element\n element.focus();\n\n // If the element did not receive focus, set tabindex and try again\n if (element.ownerDocument.activeElement !== element) {\n element.setAttribute(\"tabindex\", \"-1\"); // Temporarily make focusable\n element.focus();\n }\n }\n\n /**\n * Cleans up the select component by removing event listeners and restoring the native select.\n * Call this method when removing the component from the DOM to prevent memory leaks.\n */\n destroy() {\n // Remove event listeners\n if (this.boundWindowClickHandler) {\n window.removeEventListener(\"click\", this.boundWindowClickHandler);\n }\n if (this.boundFocusOutHandler && this.wrapper) {\n this.wrapper.removeEventListener(\"focusout\", this.boundFocusOutHandler);\n }\n if (this.boundLabelClickHandler && this.label) {\n this.label.removeEventListener(\"click\", this.boundLabelClickHandler);\n }\n if (this.boundButtonClickHandler && this.button) {\n this.button.removeEventListener(\"click\", this.boundButtonClickHandler);\n }\n if (this.boundButtonKeydownHandler && this.button) {\n this.button.removeEventListener(\n \"keydown\",\n this.boundButtonKeydownHandler\n );\n }\n if (this.boundDropdownClickHandler && this.dropdown) {\n this.dropdown.removeEventListener(\n \"click\",\n this.boundDropdownClickHandler\n );\n }\n if (this.boundDropdownKeydownHandler && this.dropdown) {\n this.dropdown.removeEventListener(\n \"keydown\",\n this.boundDropdownKeydownHandler\n );\n }\n if (this.boundSelectUpdatedHandler && this.element) {\n this.element.removeEventListener(\n \"select-updated\",\n this.boundSelectUpdatedHandler\n );\n }\n if (this.transitionEndCallback && this.dropdown) {\n this.dropdown.removeEventListener(\n \"transitionend\",\n this.transitionEndCallback\n );\n }\n\n // Remove custom elements\n if (this.wrapper) {\n this.wrapper.remove();\n }\n\n // Show native select and arrow\n this.select.classList.remove(\"u-hide\");\n if (this.arrowIcon.length > 0) {\n this.arrowIcon[0].classList.remove(\"u-hide\");\n }\n\n // Clear references\n this.button = null;\n this.buttonLabel = null;\n this.dropdown = null;\n this.wrapper = null;\n this.customOptions = [];\n this.boundWindowClickHandler = null;\n this.boundFocusOutHandler = null;\n this.boundLabelClickHandler = null;\n this.boundButtonClickHandler = null;\n this.boundButtonKeydownHandler = null;\n this.boundDropdownClickHandler = null;\n this.boundDropdownKeydownHandler = null;\n this.boundSelectUpdatedHandler = null;\n this.transitionEndCallback = null;\n }\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/select.js?\n}"); 316 317/***/ }, 318 319/***/ "./src/resources/assets/js/frontend/tabs.js" 320/*!**************************************************!*\ 321 !*** ./src/resources/assets/js/frontend/tabs.js ***! 322 \**************************************************/ 323(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 324 325"use strict"; 326eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Tabs: () => (/* binding */ Tabs)\n/* harmony export */ });\n/* harmony import */ var _extendProps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extendProps */ \"./src/resources/assets/js/frontend/extendProps.js\");\n\n\n/**\n * Tabs\n */\nclass Tabs {\n\t// Default settings\n\tstatic defaults = {\n\t\tnavClass: '.c-nav',\n\t\tnavItemClass: 'c-nav__item',\n\t\tnavLinkClass: 'c-nav__link',\n\t\tpanelsClass: '.js-tabs__panels',\n\t\tpanelClass: 'js-tabs__panel',\n\t\tnoInteractionClass: 'c-tabs--no-interaction',\n\t\thideClass: 'u-hide',\n\t\tdeepLinkOn: false,\n\t};\n\n\tconstructor(settings) {\n\t\t// Extend default settings with user-prov
326ided settings\n\t\tthis.settings = (0,_extendProps__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Tabs.defaults, settings);\n\n\t\t// Initialize instance properties\n\t\tthis.element = this.settings.element;\n\t\tthis.nav = this.element.querySelector(this.settings.navClass);\n\t\tthis.navItems = Array.from(\n\t\t\tthis.nav.getElementsByClassName(this.settings.navItemClass)\n\t\t);\n\t\tthis.navLinks = Array.from(\n\t\t\tthis.nav.getElementsByClassName(this.settings.navLinkClass)\n\t\t);\n\t\tthis.panelsList = this.element.querySelector(this.settings.panelsClass);\n\t\tthis.panels = Array.from(\n\t\t\tthis.panelsList.getElementsByClassName(this.settings.panelClass)\n\t\t);\n\t\tthis.hideClass =\n\t\t\tthis.element.getAttribute('data-panel-hide-class') ||\n\t\t\tthis.settings.hideClass;\n\t\tthis.showClass =\n\t\t\tthis.element.getAttribute('data-panel-show-class') || false;\n\t\tthis.layout =\n\t\t\tthis.element.getAttribute('data-tabs-layout') || 'horizontal';\n\t\tthis.deepLinkOn =\n\t\t\tthis.settings.deepLinkOn ||\n\t\t\tthis.element.getAttribute('data-deep-link') === 'on';\n\n\t\t// Initialize tabs\n\t\tthis.initTabs();\n\t}\n\n\tinitTabs() {\n\t\t// Add tablist role for accessibility\n\t\tthis.nav.setAttribute('role', 'tablist');\n\n\t\t// Add no-interaction class to indicate initial state before user interaction.\n\t\t// This will be removed after user interaction and can be used for animations etc.\n\t\tthis.element.classList.add(this.settings.noInteractionClass);\n\n\t\t// Initialize each tab and its corresponding panel\n\t\tthis.navLinks.forEach((link, i) => {\n\t\t\tconst isActive = i === 0; // First tab is active by default\n\t\t\tconst panelId = this.panels[i].id;\n\n\t\t\tthis.navItems[i].setAttribute('role', 'presentation');\n\t\t\tlink.setAttribute('role', 'tab');\n\t\t\tlink.setAttribute('aria-selected', isActive);\n\t\t\tlink.setAttribute('aria-controls', panelId);\n\t\t\tlink.id = `tab-${panelId}`;\n\t\t\tlink.classList.add('js-nav__link');\n\t\t\tthis.panels[i].setAttribute('role', 'tabpanel');\n\t\t\tthis.panels[i].setAttribute('aria-labelledby', `tab-${panelId}`);\n\t\t\tthis.toggleClass(this.panels[i], this.hideClass, !isActive);\n\n\t\t\tif (isActive && this.showClass)\n\t\t\t\tthis.panels[i].classList.add(this.showClass);\n\n\t\t\t// Make inactive tabs unfocusable\n\t\t\tif (!isActive) link.setAttribute('tabindex', '-1');\n\t\t});\n\n\t\t// Update marker width and position\n\t\tthis.placeMarker();\n\n\t\t// Initialize event listeners for tab interactions\n\t\tthis.initTabEvents();\n\t\tthis.initDeepLink();\n\t}\n\n\tinitTabEvents() {\n\t\t// Add click event listener for tab navigation\n\t\tthis.nav.addEventListener('click', (event) => {\n\t\t\tconst trigger = event.target.closest('.js-nav__link');\n\t\t\tif (trigger) this.triggerTab(trigger, event);\n\t\t});\n\n\t\t// Add keyboard navigation support for tabs\n\t\tthis.nav.addEventListener('keydown', (event) => {\n\t\t\tconst trigger = event.target.closest('.js-nav__link');\n\t\t\tif (!trigger) return;\n\n\t\t\t// Navigate to next tab on right/down arrow key press\n\t\t\tif (this.tabNavigateNext(event)) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.selectNewTab('next');\n\t\t\t}\n\t\t\t// Navigate to previous tab on left/up arrow key press\n\t\t\telse if (this.tabNavigatePrev(event)) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.selectNewTab('prev');\n\t\t\t}\n\t\t});\n\t}\n\n\t// Select a new tab based on the direction (next/prev)\n\tselectNewTab(direction) {\n\t\t// Find the currently active tab\n\t\tconst activeTab = this.nav.querySelector('[aria-selected=\"true\"]');\n\t\tlet index = this.navLinks.indexOf(activeTab);\n\n\t\t// Calculate the new tab index based on the direction\n\t\tindex =\n\t\t\tdirection === 'next'\n\t\t\t\t? (index + 1) % this.navItems.length\n\t\t\t\t: (index - 1 + this.navItems.length) % this.navItems.length;\n\n\t\t// Trigger the new tab and set focus\n\t\tthis.triggerTab(this.navLinks[index]);\n\t\tthis.navLinks[index].focus();\n\t}\n\n\t// Activate the clicked/selected tab and deactivate others\n\ttriggerTab(tabTrigger, event) {\n\t\tif (event) event.preventDefault();\n\n\t\tconst index = this.navLinks.indexOf(tabTrigger);\n\n\t\t// Exit if the selected tab is already active\n\t\tif (this.navLinks[index].getAttribute('aria-selected') === 'true')\n\t\t\treturn;\n\n\t\t// Remove the no-interaction class on first user interaction\n\t\tthis.element.classList.remove(this.settings.noInteractionClass);\n\n\t\t// Update the state of each tab and panel\n\t\tthis.navLinks.forEach((link, i) => {\n\t\t\tconst isActive = i === index;\n\n\t\t\tthis.toggleClass(this.panels[i], this.hideClass, !isActive);\n\n\t\t\tif (this.showClass)\n\t\t\t\tthis.toggleClass(this.panels[i], this.showClass, isActive);\n\n\t\t\tlink.setAttribute('aria-selected', isActive);\n\t\t\tlink.setAttribute('tabindex', isActive ? '0' : '-1');\n\t\t});\n\n\t\t// Update the URL hash for deep linking if enabled\n\t\tif (this.deepLinkOn) {\n\t\t\thistory.replaceState(\n\t\t\t\tnull,\n\t\t\t\t'',\n\t\t\t\t`#${tabTrigger.getAttribute('aria-controls')}`\n\t\t\t);\n\t\t}\n\n\t\t// Update marker width and position\n\t\tthis.placeMarker();\n\t}\n\n\t// Initialize deep linking, if enabled\n\tinitDeepLink() {\
326n\t\tif (!this.deepLinkOn) return;\n\n\t\tconst hash = window.location.hash.substring(1);\n\t\tif (!hash) return;\n\n\t\t// Activate the panel corresponding to the hash\n\t\tthis.panels.forEach((panel, i) => {\n\t\t\tif (panel.id === hash) {\n\t\t\t\tthis.triggerTab(this.navLinks[i], false);\n\t\t\t\tsetTimeout(() => panel.scrollIntoView(true)); // Scroll to the panel\n\t\t\t}\n\t\t});\n\t}\n\n\t// Place marker in the correct position\n\tplaceMarker() {\n\t\tconst activeTab = this.nav.querySelector('[aria-selected=\"true\"]');\n\t\tconst markerWidth = `${activeTab.offsetWidth}px`;\n\t\tconst markerOffset = `${activeTab.offsetLeft}px`;\n\n\t\t// Update CSS variables for marker width and offset\n\t\tthis.nav.style.setProperty('--marker-width', markerWidth);\n\t\tthis.nav.style.setProperty('--marker-offset', markerOffset);\n\t}\n\n\t// Toggle a class on an element based on a boolean value\n\ttoggleClass(el, className, bool) {\n\t\tel.classList.toggle(className, bool);\n\t}\n\n\t// Check if the next tab should be navigated to based on the event\n\ttabNavigateNext(event) {\n\t\treturn (\n\t\t\t(this.layout === 'horizontal' && event.key === 'ArrowRight') ||\n\t\t\t(this.layout === 'vertical' && event.key === 'ArrowDown')\n\t\t);\n\t}\n\n\t// Check if the previous tab should be navigated to based on the event\n\ttabNavigatePrev(event) {\n\t\treturn (\n\t\t\t(this.layout === 'horizontal' && event.key === 'ArrowLeft') ||\n\t\t\t(this.layout === 'vertical' && event.key === 'ArrowUp')\n\t\t);\n\t}\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/tabs.js?\n}"); 327 328/***/ }, 329 330/***/ "./src/resources/assets/js/frontend/targetBlank.js" 331/*!*********************************************************!*\ 332 !*** ./src/resources/assets/js/frontend/targetBlank.js ***! 333 \*********************************************************/ 334(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 335 336"use strict"; 337eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TargetBlank: () => (/* binding */ TargetBlank)\n/* harmony export */ });\n/**\n * Target blank links\n *\n * Adds text for screen readers to links that open up in a new window/tab.\n * Also adding class for flagging if a visual icon needs to be added.\n *\n * @param {string} link Element on which this script will be initialized.\n */\nconst TargetBlank = function (link) {\n\t\"use strict\";\n\n\tfunction addNewTabMessage() {\n\t\t// Check that an element with screen reader class is not already existing\n\t\t!link.querySelector('.u-sr-only') && link.insertAdjacentHTML('beforeend', '<span class=\"u-sr-only\">(öppnas i nytt fönster)</span>');\n\n\t\t// Check if link contains icon, svg or img, otherwise add class to target CSS for adding icon\n\t\tconst requiredTags = ['i', 'svg', 'img'];\n\n\t\tif (!requiredTags.some(tag => link.querySelector(tag))) {\n\t\t\t// If link doesn't have any class, also add global link class\n\t\t\t!link.hasAttribute('class') && link.classList.add('u-text-link');\n\n\t\t\tlink.classList.add('u-link-external');\n\t\t}\n\t}\n\n\tfunction init() {\n\t\taddNewTabMessage();\n\t}\n\n\treturn init();\n};\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./src/resources/assets/js/frontend/targetBlank.js?\n}"); 338 339/***/ }, 340 341/***/ "./node_modules/a11y-dialog/dist/a11y-dialog.esm.js" 342/*!**********************************************************!*\ 343 !*** ./node_modules/a11y-dialog/dist/a11y-dialog.esm.js ***! 344 \**********************************************************/ 345(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 346 347"use strict"; 348eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ A11yDialog)\n/* harmony export */ });\nconst not = {\n inert: ':not([inert]):not([inert] *)',\n negTabIndex: ':not([tabindex^=\"-\"])',\n disabled: ':not(:disabled)',\n};\n\nvar focusableSelectors = [\n `a[href]${not.inert}${not.negTabIndex}`,\n `area[href]${not.inert}${not.negTabIndex}
348`,\n `input:not([type=\"hidden\"]):not([type=\"radio\"])${not.inert}${not.negTabIndex}${not.disabled}`,\n `input[type=\"radio\"]${not.inert}${not.negTabIndex}${not.disabled}`,\n `select${not.inert}${not.negTabIndex}${not.disabled}`,\n `textarea${not.inert}${not.negTabIndex}${not.disabled}`,\n `button${not.inert}${not.negTabIndex}${not.disabled}`,\n `details${not.inert} > summary:first-of-type${not.negTabIndex}`,\n // Discard until Firefox supports `:has()`\n // See: https://github.com/KittyGiraudel/focusable-selectors/issues/12\n // `details:not(:has(> summary))${not.inert}${not.negTabIndex}`,\n `iframe${not.inert}${not.negTabIndex}`,\n `audio[controls]${not.inert}${not.negTabIndex}`,\n `video[controls]${not.inert}${not.negTabIndex}`,\n `[contenteditable]${not.inert}${not.negTabIndex}`,\n `[tabindex]${not.inert}${not.negTabIndex}`,\n];\n\n/**\n * Set the focus to the first element with `autofocus` with the element or the\n * element itself.\n */\nfunction focus(el) {\n (el.querySelector('[autofocus]') || el).focus();\n}\n/**\n * Get the first and last focusable elements within a given element.\n */\nfunction getFocusableEdges(el) {\n // Check for a focusable element within the subtree of the given element.\n const firstEl = findFocusableEl(el, true);\n // Only if we find the first element do we need to look for the last one. If\n // thereâs no last element, we set `lastEl` as a reference to `firstEl` so\n // that the returned array is still always of length 2.\n const lastEl = firstEl ? findFocusableEl(el, false) || firstEl : null;\n return [firstEl, lastEl];\n}\n/**\n * Find the first focusable element inside the given element if `forward` is\n * truthy or the last focusable element otherwise.\n */\nfunction findFocusableEl(el, forward) {\n // If weâre walking forward, check if this element is focusable, and return it\n // immediately if it is.\n if (forward && isFocusable(el))\n return el;\n // We should only search the subtree of this element if it can have focusable\n // children.\n if (canHaveFocusableChildren(el)) {\n // Start walking the DOM tree, looking for focusable elements.\n // Case 1: If this element has a shadow root, search it recursively.\n if (el.shadowRoot) {\n // Descend into this subtree.\n let next = getNextChildEl(el.shadowRoot, forward);\n // Traverse the siblings, searching the subtree of each one for focusable\n // elements.\n while (next) {\n const focusableEl = findFocusableEl(next, forward);\n if (focusableEl)\n return focusableEl;\n next = getNextSiblingEl(next, forward);\n }\n }\n // Case 2: If this element is a slot for a Custom Element, search its\n // assigned elements recursively.\n else if (el.localName === 'slot') {\n const assignedElements = el.assignedElements({\n flatten: true,\n });\n if (!forward)\n assignedElements.reverse();\n for (const assignedElement of assignedElements) {\n const focusableEl = findFocusableEl(assignedElement, forward);\n if (focusableEl)\n return focusableEl;\n }\n }\n // Case 3: this is a regular Light DOM element. Search its subtree.\n else {\n // Descend into this subtree.\n let next = getNextChildEl(el, forward);\n // Traverse siblings, searching the subtree of each one\n // for focusable elements.\n while (next) {\n const focusableEl = findFocusableEl(next, forward);\n if (focusableEl)\n return focusableEl;\n next = getNextSiblingEl(next, forward);\n }\n }\n }\n // If weâre walking backward, we want to check the elementâs entire subtree\n // before checking the element itself. If this element is focusable, return\n // it.\n if (!forward && isFocusable(el))\n return el;\n return null;\n}\nfunction getNextChildEl(el, forward) {\n return forward ? el.firstElementChild : el.lastElementChild;\n}\nfunction getNextSiblingEl(el, forward) {\n return forward ? el.nextElementSibling : el.previousElementSibling;\n}\n/**\n * Determine if an element is hidden from the user.\n */\nconst isHidden = (el) => {\n // Browsers hide all non-<summary>
348 descendants of closed <details> elements\n // from user interaction, but those non-<summary> elements may still match our\n // focusable-selectors and may still have dimensions, so we need a special\n // case to ignore them.\n if (el.matches('details:not([open]) *') &&\n !el.matches('details>summary:first-of-type'))\n return true;\n // If this element has no painted dimensions, it's hidden.\n return !(el.offsetWidth || el.offsetHeight || el.getClientRects().length);\n};\n/**\n * Determine if an element is focusable and has user-visible painted dimensions.\n */\nconst isFocusable = (el) => {\n // A shadow host that delegates focus will never directly receive focus,\n // even with `tabindex=0`. Consider our <fancy-button> custom element, which\n // delegates focus to its shadow button:\n //\n // <fancy-button tabindex=\"0\">\n // #shadow-root\n // <button><slot></slot></button>\n // </fancy-button>\n //\n // The browser acts as as if there is only one focusable element â the shadow\n // button. Our library should behave the same way.\n if (el.shadowRoot?.delegatesFocus)\n return false;\n return el.matches(focusableSelectors.join(',')) && !isHidden(el);\n};\n/**\n * Determine if an element can have focusable children. Useful for bailing out\n * early when walking the DOM tree.\n * @example\n * This div is inert, so none of its children can be focused, even though they\n * meet our criteria for what is focusable. Once we check the div, we can skip\n * the rest of the subtree.\n * ```html\n * <div inert>\n * <button>Button</button>\n * <a href=\"#\">Link</a>\n * </div>\n * ```\n */\nfunction canHaveFocusableChildren(el) {\n // The browser will never send focus into a Shadow DOM if the host element\n // has a negative tabindex. This applies to both slotted Light DOM Shadow DOM\n // children\n if (el.shadowRoot && el.getAttribute('tabindex') === '-1')\n return false;\n // Elemments matching this selector are either hidden entirely from the user,\n // or are visible but unavailable for interaction. Their descentants can never\n // receive focus.\n return !el.matches(':disabled,[hidden],[inert]');\n}\n/**\n * Get the active element, accounting for Shadow DOM subtrees.\n * @author Cory LaViska\n * @see: https://www.abeautifulsite.net/posts/finding-the-active-element-in-a-shadow-root/\n */\nfunction getActiveEl(root = document) {\n const activeEl = root.activeElement;\n if (!activeEl)\n return null;\n // If thereâs a shadow root, recursively find the active element within it.\n // If the recursive call returns null, return the active element\n // of the top-level Document.\n if (activeEl.shadowRoot)\n return getActiveEl(activeEl.shadowRoot) || document.activeElement;\n // If not, we can just return the active element\n return activeEl;\n}\n/**\n * Trap the focus inside the given element\n */\nfunction trapTabKey(el, event) {\n const [firstFocusableEl, lastFocusableEl] = getFocusableEdges(el);\n // If there are no focusable children in the dialog, prevent the user from\n // tabbing out of it\n if (!firstFocusableEl)\n return event.preventDefault();\n const activeEl = getActiveEl();\n // If the SHIFT key is pressed while tabbing (moving backwards) and the\n // currently focused item is the first one, move the focus to the last\n // focusable item from the dialog element\n if (event.shiftKey && activeEl === firstFocusableEl) {\n // @ts-expect-error: we know that `lastFocusableEl` is not null here\n lastFocusableEl.focu
348s();\n event.preventDefault();\n }\n // If the SHIFT key is not pressed (moving forwards) and the currently focused\n // item is the last one, move the focus to the first focusable item from the\n // dialog element\n else if (!event.shiftKey && activeEl === lastFocusableEl) {\n firstFocusableEl.focus();\n event.preventDefault();\n }\n}\n/**\n * Find the closest element to the given element matching the given selector,\n * accounting for Shadow DOM subtrees.\n * @author Louis St-Amour\n * @see: https://stackoverflow.com/a/56105394\n */\nfunction closest(selector, base) {\n function from(el) {\n if (!el || el === document || el === window)\n return null;\n // Reading the `assignedSlot` property from the element (as suggested by the\n // aforementioned StackOverflow answer) is not enough, because it does not\n // take into consideration elements nested deeply within a <slot>. For these\n // elements, the `assignedSlot` property is `null` as it is only specified\n // for top-level elements within a <slot>. To still find the closest <slot>,\n // we walk up the tree looking for the `assignedSlot` property.\n const slot = findAssignedSlot(el);\n if (slot)\n el = slot;\n return (el.closest(selector) ||\n from(el.getRootNode().host));\n }\n return from(base);\n}\nfunction findAssignedSlot(node) {\n return (node.assignedSlot ||\n (node.parentNode ? findAssignedSlot(node.parentNode) : null));\n}\n\nconst SCOPE = 'data-a11y-dialog';\n/**\n * Controls an accessible modal dialog bound to a single DOM element.\n *\n * An instance:\n * - Initialises the dialog element with the required HTML attributes\n * (`aria-hidden`, `aria-modal`, `role=\"dialog\"` by default, and `tabindex`).\n * - Keeps track of the element that had focus before the dialog was opened and\n * restores focus when the dialog is closed.\n * - Traps focus within the dialog while it is open and closes it with the ESC\n * key (except when `role=\"alertdialog\"` or when an opened popover is\n * present).\n * - Delegates click handling for openers and closers declared with\n * `[data-a11y-dialog-show]` and `[data-a11y-dialog-hide]` attributes,\n * including elements inside Shadow DOM trees.\n *\n * The dialog starts hidden (`aria-hidden=\"true\"`). Call `show()` or activate an\n * opener to display it.\n */\nclass A11yDialog {\n $el;\n id;\n previouslyFocused;\n /**\n * Whether this dialog is currently shown.\n *\n * This flag is updated by `show()` and `hide()` and should be treated as\n * read-only by consumers.\n */\n shown;\n /**\n * Create a new `A11yDialog` controller for the given dialog element.\n *\n * The element must either:\n * - have a unique `id`, or\n * - define a `data-a11y-dialog` attribute whose value is used as the\n * instance identifier.\n *\n * That identifier is referenced by opener and closer elements using\n * `[data-a11y-dialog-show=\"<id>\"]` and `[data-a11y-dialog-hide=\"<id>\"]`.\n */\n constructor(element) {\n this.$el = element;\n this.id = this.$el.getAttribute(SCOPE) || this.$el.id;\n this.previouslyFocused = null;\n this.shown = false;\n this.maintainFocus = this.maintainFocus.bind(this);\n this.bindKeypress = this.bindKeypress.bind(this);\n this.handleTriggerClicks = this.handleTriggerClicks.bind(this);\n this.show = this.show.bind(this);\n this.hide = this.hide.bind(this);\n this.$el.setAttribute('aria-hidden', 'true');\n this.$el.setAttribute('aria-modal', 'true');\n this.$el.setAttribute('tabindex', '-1');\n if (!this.$el.hasAttribute('role')) {\n this.$el.setAttribute('role', 'dialog');\n }\n document.addEventListener('click', this.handleTriggerClicks, true);\n }\n /**\n * Destroy the current instance (after making sure the dialog has been hidden)\n * and remove all associated listeners from dialog openers and closers\n */\n destroy() {\n // Dispatch a `destroy` event\n const destroyEvent = this.fire('destroy');\n // If the event was prevented, do not continue with the normal behavior\n if (destroyEvent.defaultPrevented)\n return this;\n // Hide the dialog to avoid destroying an open instance\n this.hide();\n // Remove the click event delegates for our openers and closers\n document.removeEventListener('click', this.handleTriggerClicks, true);\n // Clone and replace the dialog element to prevent memory leaks caused by\n // event listeners that the author might not have cleaned up.\n this.$el.replaceWith(this.$el.cloneNode(true));\n return this;\n }\n /**\n * Show the dialog.\n *\n * This:\n * - updates ARIA attributes on the dialog (`aria-hidden` is removed),\n * - remembers the previously focused element to restore it on `hide()`,\n * - moves focus into the dialog (or maintains it when opened via a focus\n * event),\n * - starts trapping focus within the dialog, and\n * - dispatches a cancelable `'show'` `CustomEvent` from the dialog element.\n *\n * If a listener for the `'show'` event calls `event.preventDefault()`, the\n * dialog will not be opened.\n *\n * Returns the instance to allow method chaining.\n */\n show(event) {\n // If the dialog is already open, abort\n if (this.shown)\n return this;\n // Dispatch a `show` event\n const showEvent = this.fire('show', event);\n // If the event was prevented, do not continue with the normal behavior\n if (showEvent.defaultPrevented)\n return this;\n // Keep a reference to the currently focused element to be able to restore\n // it later\n this.shown = true;\n this.$el.removeAttribute('aria-hidden');\n this.previouslyFocused = getActiveEl();\n // Due to a long lasting bug in Safari, clicking an interactive element\n // (like a <button>) does *not* move the focus to that element, which means\n // `document.activeElement` is whatever element is currently focused (like\n // an <input>), or the <body> element otherwise. We can work around that\n // problem by checking whether the focused element is the <body>, and if it,\n // store the click event target.\n // See: https://bugs.webkit.org/show_bug.cgi?id=22261\n if (this.previouslyFocused?.tagName === 'BODY' && event?.target) {\n this.previouslyFocused = event.target;\n }\n // Set the focus to the dialog element\n // See: https://github.com/KittyGiraudel/a11y-dialog/pull/583\n if (event?.type === 'focus') {\n this.maintainFocus();\n }\n else {\n focus(this.$el);\n }\n // Bind a focus event listener to the body element to make sure the focus\n // stays trapped inside the dialog while open, and start listening for some\n // specific key presses (TAB and ESC)\n document.body.addEventListener('focus', this.maintainFocus, true);\n this.$el.addEventListener('keydown', this.bindKeypress, true);\n return this;\n }\n /**\n * Hide the dialog.\n *\n * This:\n * - sets `aria-hidden=\"true\"` on the dialog,\n * - stops trapping focus and ke
348y listeners associated with this instance, and\n * - restores focus to the element that was active before `show()` was called\n * (when possible).\n *\n * A cancelable `'hide'` `CustomEvent` is dispatched before closing. If a\n * listener calls `event.preventDefault()`, the dialog will remain open.\n *\n * Returns the instance to allow method chaining.\n */\n hide(event) {\n // If the dialog is already closed, abort\n if (!this.shown)\n return this;\n // Dispatch a `hide` event\n const hideEvent = this.fire('hide', event);\n // If the event was prevented, do not continue with the normal behavior\n if (hideEvent.defaultPrevented)\n return this;\n this.shown = false;\n this.$el.setAttribute('aria-hidden', 'true');\n // Remove the focus event listener to the body element and stop listening\n // for specific key presses\n document.body.removeEventListener('focus', this.maintainFocus, true);\n this.$el.removeEventListener('keydown', this.bindKeypress, true);\n // Ensure the previously focused element (if any) has a `focus` method\n // before attempting to call it to account for SVG elements\n // See: https://github.com/KittyGiraudel/a11y-dialog/issues/108\n this.previouslyFocused?.focus?.();\n return this;\n }\n /**\n * Register a new callback for the given event type\n */\n on(type, handler, options) {\n this.$el.addEventListener(type, handler, options);\n return this;\n }\n /**\n * Unregister an existing callback for the given event type\n */\n off(type, handler, options) {\n this.$el.removeEventListener(type, handler, options);\n return this;\n }\n /**\n * Dispatch and return a custom event from the DOM element associated with\n * this dialog; this allows authors to listen for and respond to the events\n * in their own code\n */\n fire(type, event) {\n const customEvent = new CustomEvent(type, {\n detail: event,\n cancelable: true,\n });\n this.$el.dispatchEvent(customEvent);\n return customEvent;\n }\n /**\n * Add a delegated event listener for when elememts that open or close the\n * dialog are clicked, and call `show` or `hide`, respectively\n */\n handleTriggerClicks(event) {\n // We need to retrieve the click target while accounting for Shadow DOM.\n // When within a web component, `event.target` is the shadow root (e.g.\n // `<my-dialog>`), so we need to use `event.composedPath()` to get the click\n // target\n // See: https://github.com/KittyGiraudel/a11y-dialog/issues/582\n const target = event.composedPath()[0];\n const opener = closest(`[${SCOPE}-show=\"${this.id}\"]`, target);\n const explicitCloser = closest(`[${SCOPE}-hide=\"${this.id}\"]`, target);\n const implicitCloser = closest(`[${SCOPE}-hide]`, target) &&\n closest('[aria-modal=\"true\"]', target) === this.$el;\n // We use `closest(..)` (instead of `matches(..)`) so that clicking an\n // element nested within a dialog opener does cause the dialog to open, and\n // we use our custom `closest(..)` function so that it can cross shadow\n // boundaries\n // See: https://github.com/KittyGiraudel/a11y-dialog/issues/712\n if (opener)\n this.show(event);\n if (explicitCloser || implicitCloser)\n this.hide(event);\n }\n /**\n * Private event handler used when listening to some specific key presses\n * (namely ESC and TAB)\n */\n bindKeypress(event) {\n // This is an escape hatch in case there are nested open dialogs, so that\n // only the top most dialog gets interacted with (`closest` is basically\n // `Element.prototype.closest()` accounting for Shadow DOM subtrees)\n if (closest('[aria-modal=\"true\"]', getActiveEl()) !== this.$el) {\n return;\n }\n let hasOpenPopover = false;\n try {\n hasOpenPopover = !!this.$el.querySelector('[popover]:not([popover=\"manual\"]):popover-open');\n }\n catch {\n // Run that DOM query in a try/catch because not all browsers support the\n // `:popover-open` selector, which would cause the whole expression to\n // fail\n // See: https://caniuse.com/mdn-css_selectors_popover-open\n // See: https://github.com/KittyGiraudel/a11y-dialog/pull/578#discussion_r1343215149\n }\n // If the dialog is shown and the ESC key is pressed, prevent any further\n // effects from the ESC key and hide the dialog, unless:\n // - its role is `alertdialog`, which means it should be modal\n // - or it contains an open popover, in which case ESC should close it\n if (event.key === 'Escape' &&\n this.$el.getAttribute('role') !== 'alertdialog' &&\n !hasOpenPopover) {\n event.preventDefault();\n this.hide(event);\n }\n // If the dialog is shown and the TAB key is pressed, make sure the focus\n // stays trapped within the dialog element\n if (event.key === 'Tab') {\n trapTabKey(this.$el, event);\n }\n }\n /**\n * If the dialog is shown and the focus is not within a dialog element (either\n * this one or another one in case of nested dialogs) or an element with the\n * ignore attribute, move it back to the dialog container\n * See: https://github.com/KittyGiraudel/a11y-dialog/issues/177\n */\n maintainFocus() {\n // We use `getActiveEl()` and n
348ot `event.target` here because the latter can\n // be a shadow root. This can happen when having a focusable element after\n // slotted content: tabbing out of it causes this focus listener to trigger\n // with the shadow root as a target event. In such a case, the focus would\n // be incorrectly moved to the dialog, which shouldnât happen. Getting the\n // active element (while accounting for Shadow DOM) avoids that problem.\n // See: https://github.com/KittyGiraudel/a11y-dialog/issues/778\n const target = getActiveEl();\n if (!closest(`[aria-modal=\"true\"], [${SCOPE}-ignore-focus-trap]`, target)) {\n focus(this.$el);\n }\n }\n}\n\nfunction instantiateDialogs() {\n for (const el of document.querySelectorAll('[data-a11y-dialog]')) {\n new A11yDialog(el);\n }\n}\nif (typeof document !== 'undefined') {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', instantiateDialogs);\n }\n else {\n instantiateDialogs();\n }\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/a11y-dialog/dist/a11y-dialog.esm.js?\n}"); 349 350/***/ }, 351 352/***/ "./node_modules/swiper/modules/a11y.mjs" 353/*!**********************************************!*\ 354 !*** ./node_modules/swiper/modules/a11y.mjs ***! 355 \**********************************************/ 356(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 357 358"use strict"; 359eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ A11y)\n/* harmony export */ });\n/* harmony import */ var _shared_classes_to_selector_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/classes-to-selector.mjs */ \"./node_modules/swiper/shared/classes-to-selector.mjs\");\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\n\nfunction A11y(_ref) {\n let {\n swiper,\n extendParams,\n on\n } = _ref;\n extendParams({\n a11y: {\n enabled: true,\n notificationClass: 'swiper-notification',\n prevSlideMessage: 'Previous slide',\n nextSlideMessage: 'Next slide',\n firstSlideMessage: 'This is the first slide',\n lastSlideMessage: 'This is the last slide',\n paginationBulletMessage: 'Go to slide {{index}}',\n slideLabelMessage: '{{index}} / {{slidesLength}}',\n containerMessage: null,\n containerRoleDescriptionMessage: null,\n itemRoleDescriptionMessage: null,\n slideRole: 'group',\n id: null\n }\n });\n swiper.a11y = {\n clicked: false\n };\n let liveRegion = null;\n function notify(message) {\n const notification = liveRegion;\n if (notification.length === 0) return;\n notification.innerHTML = '';\n notification.innerHTML = message;\n }\n const makeElementsArray = el => (Array.isArray(el) ? el : [el]).filter(e => !!e);\n function getRandomNumber(size) {\n if (size === void 0) {\n size = 16;\n }\n const randomChar = () => Math.round(16 * Math.random()).toString(16);\n return 'x'.repeat(size).replace(/x/g, randomChar);\n }\n function makeElFocusable(el) {\n el = makeElementsArray(el);\n el.forEach(subEl => {\n subEl.setAttribute('tabIndex', '0');\n });\n }\n function makeElNotFocusable(el) {\n el = makeElementsArray(el);\n el.forEach(subEl => {\n subEl.setAttribute('tabIndex', '-1');\n });\n }\n function addElRole(el, role) {\n el = makeElementsArray(el);\n el.forEach(subEl => {\n subEl.setAttribute('role', role);\n });\n }\n function addElRoleDescription(el, description) {\n el = makeElementsArray(el);\n el.forEach(subEl => {\n subEl.setAttribute('aria-roledescription', description);\n });\n }\n function addElControls(el, controls) {\n el = makeElementsArray(el);\n el.forEach(subEl => {\n subEl.setAttribute('aria-controls', controls);\n });\n }\n function addElLabel(el, label) {\n el = makeElementsArray(el);\n el.forEach(subEl => {\n subEl.setAttribute('aria-label', label);\n });\n }\n function addElId(el, id) {\n el = makeElementsArray(el);\n el.forEach(subEl => {\n subEl.setAttribute('id', id);\n });\n }\n function addElLive(el, live) {\n el = makeElementsArray(el);\n el.forEach(subEl => {\n subEl.setAttribute('aria-live', live);\n });\n }\n function disableEl(el) {\n el = makeElementsArray(el);\n el.forEach(subEl => {\n subEl.setAttribute('aria-disabled', true);\n });\n }\n function enableEl(el) {\n el = makeElementsArray(el);\n el.forEach(subEl => {\n subEl.setAttribute('aria-disabled', false);\n });\n }\n function onEnterOrSpaceKey(e) {\n if (e.keyCode !== 13 && e.keyCode !== 32) return;\n const params = swiper.params.a11y;\n const targetEl = e.target;\n if (swiper.pagination && swiper.pagination.el && (targetEl === swiper.pagination.el || swiper.pagination.el.contains(e.target))) {\n if (!e.target.matches((0,_shared_classes_to_selector_mjs__WEBPACK_IMPORTED_MODULE_0__.c)(swiper.params.pagination.bulletClass))) return;\n }\n if (swiper.navigation && swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl) {\n if (!(swiper.isEnd && !swiper.params.loop)) {\n swiper.slideNext();\n }\n if (swiper.isEnd) {\n notify(params.lastSlideMessage);\n } else {\n notify(params.nextSlideMessage);\n }\n }\n if (swiper.navigation && swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl) {\n if (!(swiper.isBeginning && !swiper.params.loop)) {\n swiper.slidePrev();\n }\n if (swiper.isBeginning) {\n notify(params.firstSlideMessage);\n } else {\n notify(params.prevSlideMessage);\n }\n }\n if (swiper.pagination && targetEl.matches((0,_shared_classes_to_selector_mjs__WEBPACK_IMPORTED_MODULE_0__.c)(swiper.params.pagination.bulletClass))) {\n targetEl.click();\n }\n }
359\n function updateNavigation() {\n if (swiper.params.loop || swiper.params.rewind || !swiper.navigation) return;\n const {\n nextEl,\n prevEl\n } = swiper.navigation;\n if (prevEl) {\n if (swiper.isBeginning) {\n disableEl(prevEl);\n makeElNotFocusable(prevEl);\n } else {\n enableEl(prevEl);\n makeElFocusable(prevEl);\n }\n }\n if (nextEl) {\n if (swiper.isEnd) {\n disableEl(nextEl);\n makeElNotFocusable(nextEl);\n } else {\n enableEl(nextEl);\n makeElFocusable(nextEl);\n }\n }\n }\n function hasPagination() {\n return swiper.pagination && swiper.pagination.bullets && swiper.pagination.bullets.length;\n }\n function hasClickablePagination() {\n return hasPagination() && swiper.params.pagination.clickable;\n }\n function updatePagination() {\n const params = swiper.params.a11y;\n if (!hasPagination()) return;\n swiper.pagination.bullets.forEach(bulletEl => {\n if (swiper.params.pagination.clickable) {\n makeElFocusable(bulletEl);\n if (!swiper.params.pagination.renderBullet) {\n addElRole(bulletEl, 'button');\n addElLabel(bulletEl, params.paginationBulletMessage.replace(/\\{\\{index\\}\\}/, (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.g)(bulletEl) + 1));\n }\n }\n if (bulletEl.matches((0,_shared_classes_to_selector_mjs__WEBPACK_IMPORTED_MODULE_0__.c)(swiper.params.pagination.bulletActiveClass))) {\n bulletEl.setAttribute('aria-current', 'true');\n } else {\n bulletEl.removeAttribute('aria-current');\n }\n });\n }\n const initNavEl = (el, wrapperId, message) => {\n makeElFocusable(el);\n if (el.tagName !== 'BUTTON') {\n addElRole(el, 'button');\n el.addEventListener('keydown', onEnterOrSpaceKey);\n }\n addElLabel(el, message);\n addElControls(el, wrapperId);\n };\n const handlePointerDown = () => {\n swiper.a11y.clicked = true;\n };\n const handlePointerUp = () => {\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n if (!swiper.destroyed) {\n swiper.a11y.clicked = false;\n }\n });\n });\n };\n const handleFocus = e => {\n if (swiper.a11y.clicked) return;\n const slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`);\n if (!slideEl || !swiper.slides.includes(slideEl)) return;\n const isActive = swiper.slides.indexOf(slideEl) === swiper.activeIndex;\n const isVisible = swiper.params.watchSlidesProgress && swiper.visibleSlides && swiper.visibleSlides.includes(slideEl);\n if (isActive || isVisible) return;\n if (e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents) return;\n if (swiper.isHorizontal()) {\n swiper.el.scrollLeft = 0;\n } else {\n swiper.el.scrollTop = 0;\n }\n swiper.slideTo(swiper.slides.indexOf(slideEl), 0);\n };\n const initSlides = () => {\n const params = swiper.params.a11y;\n if (params.itemRoleDescriptionMessage) {\n addElRoleDescription(swiper.slides, params.itemRoleDescriptionMessage);\n }\n if (params.slideRole) {\n addElRole(swiper.slides, params.slideRole);\n }\n const slidesLength = swiper.slides.length;\n if (params.slideLabelMessage) {\n swiper.slides.forEach((slideEl, index) => {\n const slideIndex = swiper.params.loop ? parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10) : index;\n const ariaLabelMessage = params.slideLabelMessage.replace(/\\{\\{index\\}\\}/, slideIndex + 1).replace(/\\{\\{slidesLength\\}\\}/, slidesLength);\n addElLabel(slideEl, ariaLabelMessage);\n });\n }\n };\n const init = () => {\n const params = swiper.params.a11y;\n swiper.el.append(liveRegion);\n\n // Container\n const containerEl = swiper.el;\n if (params.containerRoleDescriptionMessage) {\n addElRoleDescription(containerEl, params.containerRoleDescriptionMessage);\n }\n if (params.containerMessage) {\n addElLabel(containerEl, params.containerMessage);\n }\n\n // Wrapper\n const wrapperEl = swiper.wrapperEl;\n const wrapperId = params.id || wrapperEl.getAttribute('id') || `swiper-wrapper-${getRandomNumber(16)}`;\n const live = swiper.params.autoplay && swiper.params.autoplay.enabled ? 'off' : 'polite';\n addElId(wrapperEl, wrapperId);\n addElLive(wrapperEl, live);\n\n // Slide\n initSlides();\n\n // Navigation\n let {\n nextEl,\n prevEl\n } = swiper.navigation ? swiper.navigation : {};\n nextEl = makeElementsArray(nextEl);\n prevEl = makeElementsArray(prevEl);\n if (nextEl) {\n nextEl.forEach(el => initNavEl(el, wrapperId, params.nextSlideMessage));\n }\n if (prevEl) {\n prevEl.forEach(el => initNavEl(el, wrapperId, params.prevSlideMessage));\n }\n\n // Pagination\n if (hasClickablePagination()) {\n const paginationEl = Array.isArray(swiper.pagination.el) ? swiper.pagination.el : [swiper.pagination.el];\n paginationEl.forEach(el => {\n el.addEventListener('keydown', onEnterOrSpaceKey);\n });\n }\n\n // Tab focus\n swiper.el.addEventListener('focus', handleFocus, true);\n swiper.el.addEventListener('pointerdown', handlePointerDown, true);\n swiper.el.addEventListener('pointerup', handlePointerUp, true);\n };\n function destroy() {\n if (liveRegion) liveRegion.remove();\n let {\n nextEl,\n prevEl\n } = swiper.navigation ? swiper.navigation : {};\n nextEl = makeElementsArray(nextEl);\n prevEl = makeElementsArray(prevEl);\n if (nextEl) {\n nextEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));\n }\n if (prevEl) {\n prevEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));\n }\n\n // Pagination\n if (hasClickablePagination()) {\n const paginationEl = Array.isArray(swiper.pagination.el) ? swiper.pagination.el : [swiper.pagination.el];\n paginationEl.forEach(el => {\n el.removeEventListener('keydown', onEnterOrSpaceKey);\n });\n }\n\n // Tab focus\n swiper.el.removeEventListener('focus', handleFocus, true);\n swiper.el.removeEventListener('pointerdown', handlePointerDown, true);\n swiper.el.removeEventListener('pointerup', handlePointerUp, true);\n }\n on('beforeInit', () => {\n liveRegion = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.c)('span', swiper.params.a11y.notificationClass);\n liveRegion.setAttribute('aria-live', 'assertive');\n liveRegion.setAttribute('aria-atomic', 'true');\n });\n on('afterInit', () => {\n if (!swiper.params.a11y.enabled) return;\n init();\n });\n on('slidesLengthChange snapGridLengthChange slidesGridLengthChange', () => {\n if (!swiper.params.a11y.enabled) return;\n initSlides();\n });\n on('fromEdge toEdge afterInit lock unlock', () => {\n if (!swiper.params.a11y.enabled) return;\n updateNavigation();\n });\n on('paginationUpdate', () => {\n if (!swiper.params.a11y.enabled) return;\n updatePagination();\n });\n on('destroy', () => {\n if (!swiper.params.a11y.enabled) return;\n destroy();\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/a11y.mjs?\n}"); 360 361/***/ }, 362 363/***/ "./node_modules/swiper/modules/autoplay.mjs" 364/*!**************************************************!*\ 365 !*** ./node_modules/swiper/modules/autoplay.mjs ***! 366 \**************************************************/ 367(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 368 369"use strict"; 370eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Autoplay)\n/* harmony export */ });\n/* harmony import */ var _shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/ssr-window.esm.mjs */ \"./node_modules/swiper/shared/ssr-window.esm.mjs\");\n\n\n/* eslint no-underscore-dangle: \"off\" */\n/* eslint no-u
370se-before-define: \"off\" */\nfunction Autoplay(_ref) {\n let {\n swiper,\n extendParams,\n on,\n emit,\n params\n } = _ref;\n swiper.autoplay = {\n running: false,\n paused: false,\n timeLeft: 0\n };\n extendParams({\n autoplay: {\n enabled: false,\n delay: 3000,\n waitForTransition: true,\n disableOnInteraction: true,\n stopOnLastSlide: false,\n reverseDirection: false,\n pauseOnMouseEnter: false\n }\n });\n let timeout;\n let raf;\n let autoplayDelayTotal = params && params.autoplay ? params.autoplay.delay : 3000;\n let autoplayDelayCurrent = params && params.autoplay ? params.autoplay.delay : 3000;\n let autoplayTimeLeft;\n let autoplayStartTime = new Date().getTime;\n let wasPaused;\n let isTouched;\n let pausedByTouch;\n let touchStartTimeout;\n let slideChanged;\n let pausedByInteraction;\n function onTransitionEnd(e) {\n if (!swiper || swiper.destroyed || !swiper.wrapperEl) return;\n if (e.target !== swiper.wrapperEl) return;\n swiper.wrapperEl.removeEventListener('transitionend', onTransitionEnd);\n resume();\n }\n const calcTimeLeft = () => {\n if (swiper.destroyed || !swiper.autoplay.running) return;\n if (swiper.autoplay.paused) {\n wasPaused = true;\n } else if (wasPaused) {\n autoplayDelayCurrent = autoplayTimeLeft;\n wasPaused = false;\n }\n const timeLeft = swiper.autoplay.paused ? autoplayTimeLeft : autoplayStartTime + autoplayDelayCurrent - new Date().getTime();\n swiper.autoplay.timeLeft = timeLeft;\n emit('autoplayTimeLeft', timeLeft, timeLeft / autoplayDelayTotal);\n raf = requestAnimationFrame(() => {\n calcTimeLeft();\n });\n };\n const getSlideDelay = () => {\n let activeSlideEl;\n if (swiper.virtual && swiper.params.virtual.enabled) {\n activeSlideEl = swiper.slides.filter(slideEl => slideEl.classList.contains('swiper-slide-active'))[0];\n } else {\n activeSlideEl = swiper.slides[swiper.activeIndex];\n }\n if (!activeSlideEl) return undefined;\n const currentSlideDelay = parseInt(activeSlideEl.getAttribute('data-swiper-autoplay'), 10);\n return currentSlideDelay;\n };\n const run = delayForce => {\n if (swiper.destroyed || !swiper.autoplay.running) return;\n cancelAnimationFrame(raf);\n calcTimeLeft();\n let delay = typeof delayForce === 'undefined' ? swiper.params.autoplay.delay : delayForce;\n autoplayDelayTotal = swiper.params.autoplay.delay;\n autoplayDelayCurrent = swiper.params.autoplay.delay;\n const currentSlideDelay = getSlideDelay();\n if (!Number.isNaN(currentSlideDelay) && currentSlideDelay > 0 && typeof delayForce === 'undefined') {\n delay = currentSlideDelay;\n autoplayDelayTotal = currentSlideDelay;\n autoplayDelayCurrent = currentSlideDelay;\n }\n autoplayTimeLeft = delay;\n const speed = swiper.params.speed;\n const proceed = () => {\n if (!swiper || swiper.destroyed) return;\n if (swiper.params.autoplay.reverseDirection) {\n if (!swiper.isBeginning || swiper.params.loop || swiper.params.rewind) {\n swiper.slidePrev(speed, true, true);\n emit('autoplay');\n } else if (!swiper.params.autoplay.stopOnLastSlide) {\n swiper.slideTo(swiper.slides.length - 1, speed, true, true);\n emit('autoplay');\n }\n } else {\n if (!swiper.isEnd || swiper.params.loop || swiper.params.rewind) {\n swiper.slideNext(speed, true, true);\n emit('autoplay');\n } else if (!swiper.params.autoplay.stopOnLastSlide) {\n swiper.slideTo(0, speed, true, true);\n emit('autoplay');\n }\n }\n if (swiper.params.cssMode) {\n autoplayStartTime = new Date().getTime();\n requestAnimationFrame(() => {\n run();\n });\n }\n };\n if (delay > 0) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n proceed();\n }, delay);\n } else {\n requestAnimationFrame(() => {\n proceed();\n });\n }\n\n // eslint-disable-next-line\n return delay;\n };\n const start = () => {\n swiper.autoplay.running = true;\n run();\n emit('autoplayStart');\n };\n const stop = () => {\n swiper.autoplay.running = false;\n clearTimeout(timeout);\n cancelAnimationFrame(raf);\n emit('autoplayStop');\n };\n const pause = (internal, reset) => {\n if (swiper.destroyed || !swiper.autoplay.running) return;\n clearTimeout(timeout);\n if (!internal) {\n pausedByInteraction = true;\n }\n const proceed = () => {\n emit('autoplayPause');\n if (swiper.params.autoplay.waitForTransition) {\n swiper.wrapperEl.addEventListener('transitionend', onTransitionEnd);\n } else {\n resume();\n }\n };\n swiper.autoplay.paused = true;\n if (reset) {\n if (slideChanged) {\n autoplayTimeLeft = swiper.params.autoplay.delay;\n }\n slideChanged = false;\n proceed();\n return;\n }
370\n const delay = autoplayTimeLeft || swiper.params.autoplay.delay;\n autoplayTimeLeft = delay - (new Date().getTime() - autoplayStartTime);\n if (swiper.isEnd && autoplayTimeLeft < 0 && !swiper.params.loop) return;\n if (autoplayTimeLeft < 0) autoplayTimeLeft = 0;\n proceed();\n };\n const resume = () => {\n if (swiper.isEnd && autoplayTimeLeft < 0 && !swiper.params.loop || swiper.destroyed || !swiper.autoplay.running) return;\n autoplayStartTime = new Date().getTime();\n if (pausedByInteraction) {\n pausedByInteraction = false;\n run(autoplayTimeLeft);\n } else {\n run();\n }\n swiper.autoplay.paused = false;\n emit('autoplayResume');\n };\n const onVisibilityChange = () => {\n if (swiper.destroyed || !swiper.autoplay.running) return;\n const document = (0,_shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.g)();\n if (document.visibilityState === 'hidden') {\n pausedByInteraction = true;\n pause(true);\n }\n if (document.visibilityState === 'visible') {\n resume();\n }\n };\n const onPointerEnter = e => {\n if (e.pointerType !== 'mouse') return;\n pausedByInteraction = true;\n if (swiper.animating || swiper.autoplay.paused) return;\n pause(true);\n };\n const onPointerLeave = e => {\n if (e.pointerType !== 'mouse') return;\n if (swiper.autoplay.paused) {\n resume();\n }\n };\n const attachMouseEvents = () => {\n if (swiper.params.autoplay.pauseOnMouseEnter) {\n swiper.el.addEventListener('pointerenter', onPointerEnter);\n swiper.el.addEventListener('pointerleave', onPointerLeave);\n }\n };\n const detachMouseEvents = () => {\n swiper.el.removeEventListener('pointerenter', onPointerEnter);\n swiper.el.removeEventListener('pointerleave', onPointerLeave);\n };\n const attachDocumentEvents = () => {\n const document = (0,_shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.g)();\n document.addEventListener('visibilitychange', onVisibilityChange);\n };\n const detachDocumentEvents = () => {\n const document = (0,_shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.g)();\n document.removeEventListener('visibilitychange', onVisibilityChange);\n };\n on('init', () => {\n if (swiper.params.autoplay.enabled) {\n attachMouseEvents();\n attachDocumentEvents();\n autoplayStartTime = new Date().getTime();\n start();\n }\n });\n on('destroy', () => {\n detachMouseEvents();\n detachDocumentEvents();\n if (swiper.autoplay.running) {\n stop();\n }\n });\n on('beforeTransitionStart', (_s, speed, internal) => {\n if (swiper.destroyed || !swiper.autoplay.running) return;\n if (internal || !swiper.params.autoplay.disableOnInteraction) {\n pause(true, true);\n } else {\n stop();\n }\n });\n on('sliderFirstMove', () => {\n if (swiper.destroyed || !swiper.autoplay.running) return;\n if (swiper.params.autoplay.disableOnInteraction) {\n stop();\n return;\n }\n isTouched = true;\n pausedByTouch = false;\n pausedByInteraction = false;\n touchStartTimeout = setTimeout(() => {\n pausedByInteraction = true;\n pausedByTouch = true;\n pause(true);\n }, 200);\n });\n on('touchEnd', () => {\n if (swiper.destroyed || !swiper.autoplay.running || !isTouched) return;\n clearTimeout(touchStartTimeout);\n clearTimeout(timeout);\n if (swiper.params.autoplay.disableOnInteraction) {\n pausedByTouch = false;\n isTouched = false;\n return;\n }\n if (pausedByTouch && swiper.params.cssMode) resume();\n pausedByTouch = false;\n isTouched = false;\n });\n on('slideChange', () => {\n if (swiper.destroyed || !swiper.autoplay.running) return;\n slideChanged = true;\n });\n Object.assign(swiper.autoplay, {\n start,\n stop,\n pause,\n resume\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/autoplay.mjs?\n}"); 371 372/***/ }, 373 374/***/ "./node_modules/swiper/modules/controller.mjs" 375/*!****************************************************!*\ 376 !*** ./node_modules/swiper/modules/controller.mjs ***! 377 \****************************************************/ 378(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 379 380"use strict"; 381eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Controller)\n/* harmony export */ });\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\n/* eslint no-bitwise: [\"error\", { \"allow\": [\">>\"] }] */\nfunction Controller(_ref) {\n let {\n swiper,\n extendParams,\n on\n } = _ref;\n extendParams({\n controller: {\n control: undefined,\n inverse: false,\n by: 'slide' // or 'container'\n }\n });\n\n swiper.controller = {\n control: undefined\n };\n function LinearSpline(x, y) {\n const binarySearch = function search() {\n let maxIndex;\n let minIndex;\n let guess;\n return (array, val) => {\n minIndex = -1;\n maxIndex = array.length;\n while (maxIndex - minIndex >
381 1) {\n guess = maxIndex + minIndex >> 1;\n if (array[guess] <= val) {\n minIndex = guess;\n } else {\n maxIndex = guess;\n }\n }\n return maxIndex;\n };\n }();\n this.x = x;\n this.y = y;\n this.lastIndex = x.length - 1;\n // Given an x value (x2), return the expected y2 value:\n // (x1,y1) is the known point before given value,\n // (x3,y3) is the known point after given value.\n let i1;\n let i3;\n this.interpolate = function interpolate(x2) {\n if (!x2) return 0;\n\n // Get the indexes of x1 and x3 (the array indexes before and after given x2):\n i3 = binarySearch(this.x, x2);\n i1 = i3 - 1;\n\n // We have our indexes i1 & i3, so we can calculate already:\n // y2 := ((x2âx1) à (y3ây1)) ÷ (x3âx1) + y1\n return (x2 - this.x[i1]) * (this.y[i3] - this.y[i1]) / (this.x[i3] - this.x[i1]) + this.y[i1];\n };\n return this;\n }\n function getInterpolateFunction(c) {\n swiper.controller.spline = swiper.params.loop ? new LinearSpline(swiper.slidesGrid, c.slidesGrid) : new LinearSpline(swiper.snapGrid, c.snapGrid);\n }\n function setTranslate(_t, byController) {\n const controlled = swiper.controller.control;\n let multiplier;\n let controlledTranslate;\n const Swiper = swiper.constructor;\n function setControlledTranslate(c) {\n if (c.destroyed) return;\n\n // this will create an Interpolate function based on the snapGrids\n // x is the Grid of the scrolled scroller and y will be the controlled scroller\n // it makes sense to create this only once and recall it for the interpolation\n // the function does a lot of value caching for performance\n const translate = swiper.rtlTranslate ? -swiper.translate : swiper.translate;\n if (swiper.params.controller.by === 'slide') {\n getInterpolateFunction(c);\n // i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid\n // but it did not work out\n controlledTranslate = -swiper.controller.spline.interpolate(-translate);\n }\n if (!controlledTranslate || swiper.params.controller.by === 'container') {\n multiplier = (c.maxTranslate() - c.minTranslate()) / (swiper.maxTranslate() - swiper.minTranslate());\n if (Number.isNaN(multiplier) || !Number.isFinite(multiplier)) {\n multiplier = 1;\n }\n controlledTranslate = (translate - swiper.minTranslate()) * multiplier + c.minTranslate();\n }\n if (swiper.params.controller.inverse) {\n controlledTranslate = c.maxTranslate() - controlledTranslate;\n }\n c.updateProgress(controlledTranslate);\n c.setTranslate(controlledTranslate, swiper);\n c.updateActiveIndex();\n c.updateSlidesClasses();\n }\n if (Array.isArray(controlled)) {\n for (let i = 0; i < controlled.length; i += 1) {\n if (controlled[i] !== byController && controlled[i] instanceof Swiper) {\n setControlledTranslate(controlled[i]);\n }\n }\n } else if (controlled instanceof Swiper && byController !== controlled) {\n setControlledTranslate(controlled);\n }\n }\n function setTransition(duration, byController) {\n const Swiper = swiper.constructor;\n const controlled = swiper.controller.control;\n let i;\n function setControlledTransition(c) {\n if (c.destroyed) return;\n c.setTransition(duration, swiper);\n if (duration !== 0) {\n c.transitionStart();\n if (c.params.autoHeight) {\n (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.n)(() => {\n c.updateAutoHeight();\n });\n }\n ;(0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.i)(c.wrapperEl, () => {\n if (!controlled) return;\n c.transitionEnd();\n });\n }\n }\n if (Array.isArray(controlled)) {\n for (i = 0; i < controlled.length; i += 1) {\n if (controlled[i] !== byController && controlled[i] instanceof Swiper) {\n setControlledTransition(controlled[i]);\n }\n }\n } else if (controlled instanceof Swiper && byController !== controlled) {\n setControlledTransition(controlled);\n }\n }\n function removeSpline() {\n if (!swiper.controller.control) return;\n if (swiper.controller.spline) {\n swiper.controller.spline = undefined;\n delete swiper.controller.spline;\n }\n }\n on('beforeInit', () => {\n if (typeof window !== 'undefined' && (\n // eslint-disable-line\n typeof swiper.params.controller.control === 'string' || swiper.params.controller.control instanceof HTMLElement)) {\n const controlElement = document.querySelector(swiper.params.controller.control);\n if (controlElement && controlElement.swiper) {\n swiper.controller.control = controlElement.swiper;\n } else if (controlElement) {\n const onControllerSwiper = e => {\n swiper.controller.control = e.detail[0];
381\n swiper.update();\n controlElement.removeEventListener('init', onControllerSwiper);\n };\n controlElement.addEventListener('init', onControllerSwiper);\n }\n return;\n }\n swiper.controller.control = swiper.params.controller.control;\n });\n on('update', () => {\n removeSpline();\n });\n on('resize', () => {\n removeSpline();\n });\n on('observerUpdate', () => {\n removeSpline();\n });\n on('setTranslate', (_s, translate, byController) => {\n if (!swiper.controller.control || swiper.controller.control.destroyed) return;\n swiper.controller.setTranslate(translate, byController);\n });\n on('setTransition', (_s, duration, byController) => {\n if (!swiper.controller.control || swiper.controller.control.destroyed) return;\n swiper.controller.setTransition(duration, byController);\n });\n Object.assign(swiper.controller, {\n setTranslate,\n setTransition\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/controller.mjs?\n}"); 382 383/***/ }, 384 385/***/ "./node_modules/swiper/modules/effect-cards.mjs" 386/*!******************************************************!*\ 387 !*** ./node_modules/swiper/modules/effect-cards.mjs ***! 388 \******************************************************/ 389(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 390 391"use strict"; 392eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ EffectCards)\n/* harmony export */ });\n/* harmony import */ var _shared_create_shadow_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/create-shadow.mjs */ \"./node_modules/swiper/shared/create-shadow.mjs\");\n/* harmony import */ var _shared_effect_init_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/effect-init.mjs */ \"./node_modules/swiper/shared/effect-init.mjs\");\n/* harmony import */ var _shared_effect_target_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/effect-target.mjs */ \"./node_modules/swiper/shared/effect-target.mjs\");\n/* harmony import */ var _shared_effect_virtual_transition_end_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shared/effect-virtual-transition-end.mjs */ \"./node_modules/swiper/shared/effect-virtual-transition-end.mjs\");\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\n\n\n\n\nfunction EffectCards(_ref) {\n let {\n swiper,\n extendParams,\n on\n } = _ref;\n extendParams({\n cardsEffect: {\n slideShadows: true,\n rotate: true,\n perSlideRotate: 2,\n perSlideOffset: 8\n }\n });\n const setTranslate = () => {\n const {\n slides,\n activeIndex,\n rtlTranslate: rtl\n } = swiper;\n const params = swiper.params.cardsEffect;\n const {\n startTranslate,\n isTouched\n } = swiper.touchEventsData;\n const currentTranslate = rtl ? -swiper.translate : swiper.translate;\n for (let i = 0; i < slides.length; i += 1) {\n const slideEl = slides[i];\n const slideProgress = slideEl.progress;\n const progress = Math.min(Math.max(slideProgress, -4), 4);\n let offset = slideEl.swiperSlideOffset;\n if (swiper.params.centeredSlides && !swiper.params.cssMode) {\n swiper.wrapperEl.style.transform = `translateX(${swiper.minTranslate()}px)`;\n }\n if (swiper.params.centeredSlides && swiper.params.cssMode) {\n offset -= slides[0].swiperSlideOffset;\n }\n let tX = swiper.params.cssMode ? -offset - swiper.translate : -offset;\n let tY = 0;\n const tZ = -100 * Math.abs(progress);\n let scale = 1;\n let rotate = -params.perSlideRotate * progress;\n let tXAdd = params.perSlideOffset - Math.abs(progress) * 0.75;\n const slideIndex = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.from + i : i;\n const isSwipeToNext = (slideIndex === activeIndex || slideIndex === activeIndex - 1) && progress > 0 && progress < 1 && (isTouched || swiper.params.cssMode) && currentTranslate < startTranslate;\n const isSwipeToPrev = (slideIndex === activeIndex || slideIndex === activeIndex + 1) && progress < 0 && progress > -1 && (isTouched || swiper.params.cssMode) && currentTranslate > startTranslate;\n if (isSwipeToNext || isSwipeToPrev) {\n const subProgress = (1 - Math.abs((Math.abs(progress) - 0.5) / 0.5)) ** 0.5;\n rotate += -28 * progress * subProgress;\n scale += -0.5 * subProgress;\n tXAdd += 96 * subProgress;\n tY = `${-25 * subProgress * Math.abs(progress)}%`;\n }\n if (progress < 0) {\n // next\n tX = `calc(${tX}px ${rtl ? '-' : '+'} (${tXAdd * Math.abs(progress)}%))`;\n } else if (progress > 0) {\n // prev\n tX = `calc(${tX}px ${rtl ? '-' : '+'} (-${tXAdd * Math.abs(progress)}%))`;\n } else {\n tX = `${tX}px`;\n }\n if (!swiper.isHorizontal()) {\n const prevY = tY;\n tY = tX;\n tX = prevY;\n }
392\n const scaleString = progress < 0 ? `${1 + (1 - scale) * progress}` : `${1 - (1 - scale) * progress}`;\n\n /* eslint-disable */\n const transform = `\n translate3d(${tX}, ${tY}, ${tZ}px)\n rotateZ(${params.rotate ? rtl ? -rotate : rotate : 0}deg)\n scale(${scaleString})\n `;\n /* eslint-enable */\n\n if (params.slideShadows) {\n // Set shadows\n let shadowEl = slideEl.querySelector('.swiper-slide-shadow');\n if (!shadowEl) {\n shadowEl = (0,_shared_create_shadow_mjs__WEBPACK_IMPORTED_MODULE_0__.c)('cards', slideEl);\n }\n if (shadowEl) shadowEl.style.opacity = Math.min(Math.max((Math.abs(progress) - 0.5) / 0.5, 0), 1);\n }\n slideEl.style.zIndex = -Math.abs(Math.round(slideProgress)) + slides.length;\n const targetEl = (0,_shared_effect_target_mjs__WEBPACK_IMPORTED_MODULE_2__.e)(params, slideEl);\n targetEl.style.transform = transform;\n }\n };\n const setTransition = duration => {\n const transformElements = swiper.slides.map(slideEl => (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_4__.k)(slideEl));\n transformElements.forEach(el => {\n el.style.transitionDuration = `${duration}ms`;\n el.querySelectorAll('.swiper-slide-shadow').forEach(shadowEl => {\n shadowEl.style.transitionDuration = `${duration}ms`;\n });\n });\n (0,_shared_effect_virtual_transition_end_mjs__WEBPACK_IMPORTED_MODULE_3__.e)({\n swiper,\n duration,\n transformElements\n });\n };\n (0,_shared_effect_init_mjs__WEBPACK_IMPORTED_MODULE_1__.e)({\n effect: 'cards',\n swiper,\n on,\n setTranslate,\n setTransition,\n perspective: () => true,\n overwriteParams: () => ({\n watchSlidesProgress: true,\n virtualTranslate: !swiper.params.cssMode\n })\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/effect-cards.mjs?\n}"); 393 394/***/ }, 395 396/***/ "./node_modules/swiper/modules/effect-coverflow.mjs" 397/*!**********************************************************!*\ 398 !*** ./node_modules/swiper/modules/effect-coverflow.mjs ***! 399 \**********************************************************/ 400(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 401 402"use strict"; 403eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ EffectCoverflow)\n/* harmony export */ });\n/* harmony import */ var _shared_create_shadow_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/create-shadow.mjs */ \"./node_modules/swiper/shared/create-shadow.mjs\");\n/* harmony import */ var _shared_effect_init_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/effect-init.mjs */ \"./node_modules/swiper/shared/effect-init.mjs\");\n/* harmony import */ var _shared_effect_target_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/effect-target.mjs */ \"./node_modules/swiper/shared/effect-target.mjs\");\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\n\n\n\nfunction EffectCoverflow(_ref) {\n let {\n swiper,\n extendParams,\n on\n } = _ref;\n extendParams({\n coverflowEffect: {\n rotate: 50,\n stretch: 0,\n depth: 100,\n scale: 1,\n modifier: 1,\n slideShadows: true\n }\n });\n const setTranslate = () => {\n const {\n width: swiperWidth,\n height: swiperHeight,\n slides,\n slidesSizesGrid\n } = swiper;\n const params = swiper.params.coverflowEffect;\n const isHorizontal = swiper.isHorizontal();\n const transform = swiper.translate;\n const center = isHorizontal ? -transform + swiperWidth / 2 : -transform + swiperHeight / 2;\n const rotate = isHorizontal ? params.rotate : -params.rotate;\n const translate = params.depth;\n // Each slide offset from center\n for (let i = 0, length = slides.length; i < length; i += 1) {\n const slideEl = slides[i];\n const slideSize = slidesSizesGrid[i];\n const slideOffset = slideEl.swiperSlideOffset;\n const centerOffset = (center - slideOffset - slideSize / 2) / slideSize;\n const offsetMultiplier = typeof params.modifier === 'function' ? params.modifier(centerOffset) : centerOffset * params.modifier;\n let rotateY = isHorizontal ? rotate * offsetMultiplier : 0;\n let rotateX = isHorizontal ? 0 : rotate * offsetMultiplier;\n // var rotateZ = 0\n let translateZ = -translate * Math.abs(offsetMultiplier);\n let stretch = params.stretch;\n // Allow percentage to make a relative stretch for responsive sliders\n if (typeof stretch === 'string' && stretch.indexOf('%') !== -1) {\n stretch = parseFloat(params.stretch) / 100 * slideSize;\n }\n let translateY = isHorizontal ? 0 : stretch * offsetMultiplier;\n let translateX = isHorizontal ? stretch * offsetMultiplier : 0;\n let scale = 1 - (1 - params.scale) * Math.abs(offsetMultiplier);\n\n // Fix for ultra small values\n if (Math.abs(translateX) < 0.001) translateX = 0;\n if (Math.abs(translateY) < 0.001) translateY = 0;\n if (Math.abs(translateZ) < 0.001) translateZ = 0;\n if (Math.abs(rotateY) < 0.001) rotateY = 0;\n if (Math.abs(rotateX) < 0.001) rotateX = 0;\n if (Math.abs(scale) < 0.001) scale = 0;\n const slideTransform = `translate3d(${translateX}px,${translateY}px,${translateZ}px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) scale(${scale})`;\n const targetEl = (0,_shared_effect_target_mjs__WEBPACK_IMPORTED_MODULE_2__.e)(params, slideEl);\n targetEl.style.transform = slideTransform;\n slideEl.style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1;\n if (params.slideShadows) {\n // Set shadows\n let shadowBeforeEl = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-left') : slideEl.querySelector('.swiper-slide-shadow-top');\n let shadowAfterEl = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-right') : slideEl.querySelector('.swiper-slide-shadow-bottom');\n if (!shadowBeforeEl) {\n shadowBeforeEl = (0,_shared_create_shadow_mjs__WEBPACK_IMPORTED_MODULE_0__.c)('coverflow', slideEl, isHorizontal ? 'left' : 'top');\n }\n if (!shadowAfterEl) {\n shadowAfterEl = (0,_shared_create_shadow_mjs__WEBPACK_IMPORTED_MODULE_0__.c)('coverflow', slideEl, isHorizontal ? 'right' : 'bottom');\n }\n if (shadowBeforeEl) shadowBeforeEl.style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0;\n if (shadowAfterEl) shadowAfterEl.style.opacity = -offsetMultiplier > 0 ? -offsetMultiplier : 0;\n }\n }\n };\n const setTransition = duration => {\n const transformElements = swiper.slides.map(slideEl => (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_3__.k)(slideEl));
403\n transformElements.forEach(el => {\n el.style.transitionDuration = `${duration}ms`;\n el.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(shadowEl => {\n shadowEl.style.transitionDuration = `${duration}ms`;\n });\n });\n };\n (0,_shared_effect_init_mjs__WEBPACK_IMPORTED_MODULE_1__.e)({\n effect: 'coverflow',\n swiper,\n on,\n setTranslate,\n setTransition,\n perspective: () => true,\n overwriteParams: () => ({\n watchSlidesProgress: true\n })\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/effect-coverflow.mjs?\n}"); 404 405/***/ }, 406 407/***/ "./node_modules/swiper/modules/effect-creative.mjs" 408/*!*********************************************************!*\ 409 !*** ./node_modules/swiper/modules/effect-creative.mjs ***! 410 \*********************************************************/ 411(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 412 413"use strict"; 414eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ EffectCreative)\n/* harmony export */ });\n/* harmony import */ var _shared_create_shadow_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/create-shadow.mjs */ \"./node_modules/swiper/shared/create-shadow.mjs\");\n/* harmony import */ var _shared_effect_init_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/effect-init.mjs */ \"./node_modules/swiper/shared/effect-init.mjs\");\n/* harmony import */ var _shared_effect_target_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/effect-target.mjs */ \"./node_modules/swiper/shared/effect-target.mjs\");\n/* harmony import */ var _shared_effect_virtual_transition_end_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shared/effect-virtual-transition-end.mjs */ \"./node_modules/swiper/shared/effect-virtual-transition-end.mjs\");\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\n\n\n\n\nfunction EffectCreative(_ref) {\n let {\n swiper,\n extendParams,\n on\n } = _ref;\n extendParams({\n creativeEffect: {\n limitProgress: 1,\n shadowPerProgress: false,\n progressMultiplier: 1,\n perspective: true,\n prev: {\n translate: [0, 0, 0],\n rotate: [0, 0, 0],\n opacity: 1,\n scale: 1\n },\n next: {\n translate: [0, 0, 0],\n rotate: [0, 0, 0],\n opacity: 1,\n scale: 1\n }\n }\n });\n const getTranslateValue = value => {\n if (typeof value === 'string') return value;\n return `${value}px`;\n };\n const setTranslate = () => {\n const {\n slides,\n wrapperEl,\n slidesSizesGrid\n } = swiper;\n const params = swiper.params.creativeEffect;\n const {\n progressMultiplier: multiplier\n } = params;\n const isCenteredSlides = swiper.params.centeredSlides;\n if (isCenteredSlides) {\n const margin = slidesSizesGrid[0] / 2 - swiper.params.slidesOffsetBefore || 0;\n wrapperEl.style.transform = `translateX(calc(50% - ${margin}px))`;\n }\n for (let i = 0; i < slides.length; i += 1) {\n const slideEl = slides[i];\n const slideProgress = slideEl.progress;\n const progress = Math.min(Math.max(slideEl.progress, -params.limitProgress), params.limitProgress);\n let originalProgress = progress;\n if (!isCenteredSlides) {\n originalProgress = Math.min(Math.max(slideEl.originalProgress, -params.limitProgress), params.limitProgress);\n }\n const offset = slideEl.swiperSlideOffset;\n const t = [swiper.params.cssMode ? -offset - swiper.translate : -offset, 0, 0];\n const r = [0, 0, 0];\n let custom = false;\n if (!swiper.isHorizontal()) {\n t[1] = t[0];\n t[0] = 0;\n }\n let data = {\n translate: [0, 0, 0],\n rotate: [0, 0, 0],\n scale: 1,\n opacity: 1\n };\n if (progress < 0) {\n data = params.next;\n custom = true;\n } else if (progress > 0) {\n data = params.prev;\n custom = true;\n }\n // set translate\n t.forEach((value, index) =>
414 {\n t[index] = `calc(${value}px + (${getTranslateValue(data.translate[index])} * ${Math.abs(progress * multiplier)}))`;\n });\n // set rotates\n r.forEach((value, index) => {\n r[index] = data.rotate[index] * Math.abs(progress * multiplier);\n });\n slideEl.style.zIndex = -Math.abs(Math.round(slideProgress)) + slides.length;\n const translateString = t.join(', ');\n const rotateString = `rotateX(${r[0]}deg) rotateY(${r[1]}deg) rotateZ(${r[2]}deg)`;\n const scaleString = originalProgress < 0 ? `scale(${1 + (1 - data.scale) * originalProgress * multiplier})` : `scale(${1 - (1 - data.scale) * originalProgress * multiplier})`;\n const opacityString = originalProgress < 0 ? 1 + (1 - data.opacity) * originalProgress * multiplier : 1 - (1 - data.opacity) * originalProgress * multiplier;\n const transform = `translate3d(${translateString}) ${rotateString} ${scaleString}`;\n\n // Set shadows\n if (custom && data.shadow || !custom) {\n let shadowEl = slideEl.querySelector('.swiper-slide-shadow');\n if (!shadowEl && data.shadow) {\n shadowEl = (0,_shared_create_shadow_mjs__WEBPACK_IMPORTED_MODULE_0__.c)('creative', slideEl);\n }\n if (shadowEl) {\n const shadowOpacity = params.shadowPerProgress ? progress * (1 / params.limitProgress) : progress;\n shadowEl.style.opacity = Math.min(Math.max(Math.abs(shadowOpacity), 0), 1);\n }\n }\n const targetEl = (0,_shared_effect_target_mjs__WEBPACK_IMPORTED_MODULE_2__.e)(params, slideEl);\n targetEl.style.transform = transform;\n targetEl.style.opacity = opacityString;\n if (data.origin) {\n targetEl.style.transformOrigin = data.origin;\n }\n }\n };\n const setTransition = duration => {\n const transformElements = swiper.slides.map(slideEl => (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_4__.k)(slideEl));\n transformElements.forEach(el => {\n el.style.transitionDuration = `${duration}ms`;\n el.querySelectorAll('.swiper-slide-shadow').forEach(shadowEl => {\n shadowEl.style.transitionDuration = `${duration}ms`;\n });\n });\n (0,_shared_effect_virtual_transition_end_mjs__WEBPACK_IMPORTED_MODULE_3__.e)({\n swiper,\n duration,\n transformElements,\n allSlides: true\n });\n };\n (0,_shared_effect_init_mjs__WEBPACK_IMPORTED_MODULE_1__.e)({\n effect: 'creative',\n swiper,\n on,\n setTranslate,\n setTransition,\n perspective: () => swiper.params.creativeEffect.perspective,\n overwriteParams: () => ({\n watchSlidesProgress: true,\n virtualTranslate: !swiper.params.cssMode\n })\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/effect-creative.mjs?\n}"); 415 416/***/ }, 417 418/***/ "./node_modules/swiper/modules/effect-cube.mjs" 419/*!*****************************************************!*\ 420 !*** ./node_modules/swiper/modules/effect-cube.mjs ***! 421 \*****************************************************/ 422(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 423 424"use strict"; 425eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ EffectCube)\n/* harmony export */ });\n/* harmony import */ var _shared_effect_init_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/effect-init.mjs */ \"./node_modules/swiper/shared/effect-init.mjs\");\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\n\nfunction EffectCube(_ref) {\n let {\n swiper,\n extendParams,\n on\n } = _ref;\n extendParams({\n cubeEffect: {\n slideShadows: true,\n shadow: true,\n shadowOffset: 20,\n shadowScale: 0.94\n }\n });\n const createSlideShadows = (slideEl, progress, isHorizontal) => {\n let shadowBefore = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-left') : slideEl.querySelector('.swiper-slide-shadow-top');\n let shadowAfter = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-right') : slideEl.querySelector('.swiper-slide-shadow-bottom');\n if (!shadowBefore) {\n shadowBefore = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.c)('div', `swiper-slide-shadow-cube swiper-slide-shadow-${isHorizontal ? 'left' : 'top'}`.split(' '));\n slideEl.append(shadowBefore);\n }\n if (!shadowAfter) {\n shadowAfter = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.c)('div', `swiper-slide-shadow-cube swiper-slide-shadow-${isHorizontal ? 'right' : 'bottom'}`.split(' '));\n slideEl.append(shadowAfter);\n }\n if (shadowBefore) shadowBefore.style.opacity = Math.max(-progress, 0);\n if (shadowAfter) shadowAfter.style.opacity = Math.max(progress, 0);\n };\n const recreateShadows = () => {\n // create new ones\n const isHorizontal = swiper.isHorizontal();
425\n swiper.slides.forEach(slideEl => {\n const progress = Math.max(Math.min(slideEl.progress, 1), -1);\n createSlideShadows(slideEl, progress, isHorizontal);\n });\n };\n const setTranslate = () => {\n const {\n el,\n wrapperEl,\n slides,\n width: swiperWidth,\n height: swiperHeight,\n rtlTranslate: rtl,\n size: swiperSize,\n browser\n } = swiper;\n const params = swiper.params.cubeEffect;\n const isHorizontal = swiper.isHorizontal();\n const isVirtual = swiper.virtual && swiper.params.virtual.enabled;\n let wrapperRotate = 0;\n let cubeShadowEl;\n if (params.shadow) {\n if (isHorizontal) {\n cubeShadowEl = swiper.wrapperEl.querySelector('.swiper-cube-shadow');\n if (!cubeShadowEl) {\n cubeShadowEl = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.c)('div', 'swiper-cube-shadow');\n swiper.wrapperEl.append(cubeShadowEl);\n }\n cubeShadowEl.style.height = `${swiperWidth}px`;\n } else {\n cubeShadowEl = el.querySelector('.swiper-cube-shadow');\n if (!cubeShadowEl) {\n cubeShadowEl = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.c)('div', 'swiper-cube-shadow');\n el.append(cubeShadowEl);\n }\n }\n }\n for (let i = 0; i < slides.length; i += 1) {\n const slideEl = slides[i];\n let slideIndex = i;\n if (isVirtual) {\n slideIndex = parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10);\n }\n let slideAngle = slideIndex * 90;\n let round = Math.floor(slideAngle / 360);\n if (rtl) {\n slideAngle = -slideAngle;\n round = Math.floor(-slideAngle / 360);\n }\n const progress = Math.max(Math.min(slideEl.progress, 1), -1);\n let tx = 0;\n let ty = 0;\n let tz = 0;\n if (slideIndex % 4 === 0) {\n tx = -round * 4 * swiperSize;\n tz = 0;\n } else if ((slideIndex - 1) % 4 === 0) {\n tx = 0;\n tz = -round * 4 * swiperSize;\n } else if ((slideIndex - 2) % 4 === 0) {\n tx = swiperSize + round * 4 * swiperSize;\n tz = swiperSize;\n } else if ((slideIndex - 3) % 4 === 0) {\n tx = -swiperSize;\n tz = 3 * swiperSize + swiperSize * 4 * round;\n }\n if (rtl) {\n tx = -tx;\n }\n if (!isHorizontal) {\n ty = tx;\n tx = 0;\n }\n const transform = `rotateX(${isHorizontal ? 0 : -slideAngle}deg) rotateY(${isHorizontal ? slideAngle : 0}deg) translate3d(${tx}px, ${ty}px, ${tz}px)`;\n if (progress <= 1 && progress > -1) {\n wrapperRotate = slideIndex * 90 + progress * 90;\n if (rtl) wrapperRotate = -slideIndex * 90 - progress * 90;\n }\n slideEl.style.transform = transform;\n if (params.slideShadows) {\n createSlideShadows(slideEl, progress, isHorizontal);\n }\n }\n wrapperEl.style.transformOrigin = `50% 50% -${swiperSize / 2}px`;\n wrapperEl.style['-webkit-transform-origin'] = `50% 50% -${swiperSize / 2}px`;\n if (params.shadow) {\n if (isHorizontal) {\n cubeShadowEl.style.transform = `translate3d(0px, ${swiperWidth / 2 + params.shadowOffset}px, ${-swiperWidth / 2}px) rotateX(90deg) rotateZ(0deg) scale(${params.shadowScale})`;\n } else {\n const shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90;\n const multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2);\n const scale1 = params.shadowScale;\n const scale2 = params.shadowScale / multiplier;\n const offset = params.shadowOffset;\n cubeShadowEl.style.transform = `scale3d(${scale1}, 1, ${scale2}) translate3d(0px, ${swiperHeight / 2 + offset}px, ${-swiperHeight / 2 / scale2}px) rotateX(-90deg)`;\n }\n }\n const zFactor = (browser.isSafari || browser.isWebView) && browser.needPerspectiveFix ? -swiperSize / 2 : 0;\n wrapperEl.style.transform = `translate3d(0px,0,${zFactor}px) rotateX(${swiper.isHorizontal() ? 0 : wrapperRotate}deg) rotateY(${swiper.isHorizontal() ? -wrapperRotate : 0}deg)`;\n wrapperEl.style.setProperty('--swiper-cube-translate-z', `${zFactor}px`);\n };\n const setTransition = duration => {\n const {\n el,\n slides\n } = swiper;
425\n slides.forEach(slideEl => {\n slideEl.style.transitionDuration = `${duration}ms`;\n slideEl.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(subEl => {\n subEl.style.transitionDuration = `${duration}ms`;\n });\n });\n if (swiper.params.cubeEffect.shadow && !swiper.isHorizontal()) {\n const shadowEl = el.querySelector('.swiper-cube-shadow');\n if (shadowEl) shadowEl.style.transitionDuration = `${duration}ms`;\n }\n };\n (0,_shared_effect_init_mjs__WEBPACK_IMPORTED_MODULE_0__.e)({\n effect: 'cube',\n swiper,\n on,\n setTranslate,\n setTransition,\n recreateShadows,\n getEffectParams: () => swiper.params.cubeEffect,\n perspective: () => true,\n overwriteParams: () => ({\n slidesPerView: 1,\n slidesPerGroup: 1,\n watchSlidesProgress: true,\n resistanceRatio: 0,\n spaceBetween: 0,\n centeredSlides: false,\n virtualTranslate: true\n })\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/effect-cube.mjs?\n}"); 426 427/***/ }, 428 429/***/ "./node_modules/swiper/modules/effect-fade.mjs" 430/*!*****************************************************!*\ 431 !*** ./node_modules/swiper/modules/effect-fade.mjs ***! 432 \*****************************************************/ 433(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 434 435"use strict"; 436eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ EffectFade)\n/* harmony export */ });\n/* harmony import */ var _shared_effect_init_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/effect-init.mjs */ \"./node_modules/swiper/shared/effect-init.mjs\");\n/* harmony import */ var _shared_effect_target_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/effect-target.mjs */ \"./node_modules/swiper/shared/effect-target.mjs\");\n/* harmony import */ var _shared_effect_virtual_transition_end_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/effect-virtual-transition-end.mjs */ \"./node_modules/swiper/shared/effect-virtual-transition-end.mjs\");\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\n\n\n\nfunction EffectFade(_ref) {\n let {\n swiper,\n extendParams,\n on\n } = _ref;\n extendParams({\n fadeEffect: {\n crossFade: false\n }\n });\n const setTranslate = () => {\n const {\n slides\n } = swiper;\n const params = swiper.params.fadeEffect;\n for (let i = 0; i < slides.length; i += 1) {\n const slideEl = swiper.slides[i];\n const offset = slideEl.swiperSlideOffset;\n let tx = -offset;\n if (!swiper.params.virtualTranslate) tx -= swiper.translate;\n let ty = 0;\n if (!swiper.isHorizontal()) {\n ty = tx;\n tx = 0;\n }\n const slideOpacity = swiper.params.fadeEffect.crossFade ? Math.max(1 - Math.abs(slideEl.progress), 0) : 1 + Math.min(Math.max(slideEl.progress, -1), 0);\n const targetEl = (0,_shared_effect_target_mjs__WEBPACK_IMPORTED_MODULE_1__.e)(params, slideEl);\n targetEl.style.opacity = slideOpacity;\n targetEl.style.transform = `translate3d(${tx}px, ${ty}px, 0px)`;\n }\n };\n const setTransition = duration => {\n const transformElements = swiper.slides.map(slideEl => (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_3__.k)(slideEl));\n transformElements.forEach(el => {\n el.style.transitionDuration = `${duration}ms`;\n });\n (0,_shared_effect_virtual_transition_end_mjs__WEBPACK_IMPORTED_MODULE_2__.e)({\n swiper,\n duration,\n transformElements,\n allSlides: true\n });\n };\n (0,_shared_effect_init_mjs__WEBPACK_IMPORTED_MODULE_0__.e)({\n effect: 'fade',\n swiper,\n on,\n setTranslate,\n setTransition,\n overwriteParams: () => ({\n slidesPerView: 1,\n slidesPerGroup: 1,\n watchSlidesProgress: true,\n spaceBetween: 0,\n virtualTranslate: !swiper.params.cssMode\n })\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/effect-fade.mjs?\n}"); 437 438/***/ }, 439 440/***/ "./node_modules/swiper/modules/effect-flip.mjs" 441/*!*****************************************************!*\ 442 !*** ./node_modules/swiper/modules/effect-flip.mjs ***! 443 \*****************************************************/ 444(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 445 446"use strict"; 447eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ EffectFlip)\n/* harmony export */ });\n/* harmony import */ var _shared_create_shadow_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/create-shadow.mjs */ \"./node_modules/swiper/shared/create-shadow.mjs\");\n/* harmony import */ var _shared_effect_init_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/effect-init.mjs */ \"./node_modules/swiper/shared/effect-init.mjs\");\n/* harmony import */ var _shared_effect_target_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/effect-target.mjs */ \"./node_modules/swiper/shared/effect-target.mjs\");\n/* harmony import */ var _shared_effect_virtual_transition_end_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shared/effect-virtual-transition-end.mjs */ \"./node_modules/swiper/shared/effect-virtual-transition-end.mjs\");\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\n\n\n\n\nfunction EffectFlip(_ref) {\n let {\n swiper,\n extendParams,\n on\n } = _ref;\n extendParams({\n flipEffect: {\n slideShadows: true,\n limitRotation: true\n }\n });\n const createSlideShadows = (slideEl, progress) =>
447 {\n let shadowBefore = swiper.isHorizontal() ? slideEl.querySelector('.swiper-slide-shadow-left') : slideEl.querySelector('.swiper-slide-shadow-top');\n let shadowAfter = swiper.isHorizontal() ? slideEl.querySelector('.swiper-slide-shadow-right') : slideEl.querySelector('.swiper-slide-shadow-bottom');\n if (!shadowBefore) {\n shadowBefore = (0,_shared_create_shadow_mjs__WEBPACK_IMPORTED_MODULE_0__.c)('flip', slideEl, swiper.isHorizontal() ? 'left' : 'top');\n }\n if (!shadowAfter) {\n shadowAfter = (0,_shared_create_shadow_mjs__WEBPACK_IMPORTED_MODULE_0__.c)('flip', slideEl, swiper.isHorizontal() ? 'right' : 'bottom');\n }\n if (shadowBefore) shadowBefore.style.opacity = Math.max(-progress, 0);\n if (shadowAfter) shadowAfter.style.opacity = Math.max(progress, 0);\n };\n const recreateShadows = () => {\n // Set shadows\n swiper.params.flipEffect;\n swiper.slides.forEach(slideEl => {\n let progress = slideEl.progress;\n if (swiper.params.flipEffect.limitRotation) {\n progress = Math.max(Math.min(slideEl.progress, 1), -1);\n }\n createSlideShadows(slideEl, progress);\n });\n };\n const setTranslate = () => {\n const {\n slides,\n rtlTranslate: rtl\n } = swiper;\n const params = swiper.params.flipEffect;\n for (let i = 0; i < slides.length; i += 1) {\n const slideEl = slides[i];\n let progress = slideEl.progress;\n if (swiper.params.flipEffect.limitRotation) {\n progress = Math.max(Math.min(slideEl.progress, 1), -1);\n }\n const offset = slideEl.swiperSlideOffset;\n const rotate = -180 * progress;\n let rotateY = rotate;\n let rotateX = 0;\n let tx = swiper.params.cssMode ? -offset - swiper.translate : -offset;\n let ty = 0;\n if (!swiper.isHorizontal()) {\n ty = tx;\n tx = 0;\n rotateX = -rotateY;\n rotateY = 0;\n } else if (rtl) {\n rotateY = -rotateY;\n }\n slideEl.style.zIndex = -Math.abs(Math.round(progress)) + slides.length;\n if (params.slideShadows) {\n createSlideShadows(slideEl, progress);\n }\n const transform = `translate3d(${tx}px, ${ty}px, 0px) rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;\n const targetEl = (0,_shared_effect_target_mjs__WEBPACK_IMPORTED_MODULE_2__.e)(params, slideEl);\n targetEl.style.transform = transform;\n }\n };\n const setTransition = duration => {\n const transformElements = swiper.slides.map(slideEl => (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_4__.k)(slideEl));\n transformElements.forEach(el => {\n el.style.transitionDuration = `${duration}ms`;\n el.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(shadowEl => {\n shadowEl.style.transitionDuration = `${duration}ms`;\n });\n });\n (0,_shared_effect_virtual_transition_end_mjs__WEBPACK_IMPORTED_MODULE_3__.e)({\n swiper,\n duration,\n transformElements\n });\n };\n (0,_shared_effect_init_mjs__WEBPACK_IMPORTED_MODULE_1__.e)({\n effect: 'flip',\n swiper,\n on,\n setTranslate,\n setTransition,\n recreateShadows,\n getEffectParams: () => swiper.params.flipEffect,\n perspective: () => true,\n overwriteParams: () => ({\n slidesPerView: 1,\n slidesPerGroup: 1,\n watchSlidesProgress: true,\n spaceBetween: 0,\n virtualTranslate: !swiper.params.cssMode\n })\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/effect-flip.mjs?\n}"); 448 449/***/ }, 450 451/***/ "./node_modules/swiper/modules/free-mode.mjs" 452/*!***************************************************!*\ 453 !*** ./node_modules/swiper/modules/free-mode.mjs ***! 454 \***************************************************/ 455(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 456 457"use strict"; 458eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ freeMode)\n/* harmony export */ });\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\nfunction freeMode(_ref) {\n let {\n swiper,\n extendParams,\n emit,\n once\n } = _ref;\n extendParams({\n freeMode: {\n enabled: false,\n momentum: true,\n momentumRatio: 1,\n momentumBounce: true,\n momentumBounceRatio: 1,\n momentumVelocityRatio: 1,\n sticky: fal
458se,\n minimumVelocity: 0.02\n }\n });\n function onTouchStart() {\n if (swiper.params.cssMode) return;\n const translate = swiper.getTranslate();\n swiper.setTranslate(translate);\n swiper.setTransition(0);\n swiper.touchEventsData.velocities.length = 0;\n swiper.freeMode.onTouchEnd({\n currentPos: swiper.rtl ? swiper.translate : -swiper.translate\n });\n }\n function onTouchMove() {\n if (swiper.params.cssMode) return;\n const {\n touchEventsData: data,\n touches\n } = swiper;\n // Velocity\n if (data.velocities.length === 0) {\n data.velocities.push({\n position: touches[swiper.isHorizontal() ? 'startX' : 'startY'],\n time: data.touchStartTime\n });\n }\n data.velocities.push({\n position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'],\n time: (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.d)()\n });\n }\n function onTouchEnd(_ref2) {\n let {\n currentPos\n } = _ref2;\n if (swiper.params.cssMode) return;\n const {\n params,\n wrapperEl,\n rtlTranslate: rtl,\n snapGrid,\n touchEventsData: data\n } = swiper;\n // Time diff\n const touchEndTime = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.d)();\n const timeDiff = touchEndTime - data.touchStartTime;
458\n if (currentPos < -swiper.minTranslate()) {\n swiper.slideTo(swiper.activeIndex);\n return;\n }\n if (currentPos > -swiper.maxTranslate()) {\n if (swiper.slides.length < snapGrid.length) {\n swiper.slideTo(snapGrid.length - 1);\n } else {\n swiper.slideTo(swiper.slides.length - 1);\n }\n return;\n }\n if (params.freeMode.momentum) {\n if (data.velocities.length > 1) {\n const lastMoveEvent = data.velocities.pop();\n const velocityEvent = data.velocities.pop();\n const distance = lastMoveEvent.position - velocityEvent.position;\n const time = lastMoveEvent.time - velocityEvent.time;\n swiper.velocity = distance / time;\n swiper.velocity /= 2;\n if (Math.abs(swiper.velocity) < params.freeMode.minimumVelocity) {\n swiper.velocity = 0;\n }\n // this implies that the user stopped moving a finger then released.\n // There would be no events with distance zero, so the last event is stale.\n if (time > 150 || (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.d)() - lastMoveEvent.time > 300) {\n swiper.velocity = 0;\n }\n } else {\n swiper.velocity = 0;\n }\n swiper.velocity *= params.freeMode.momentumVelocityRatio;\n data.velocities.length = 0;\n let momentumDuration = 1000 * params.freeMode.momentumRatio;\n const momentumDistance = swiper.velocity * momentumDuration;\n let newPosition = swiper.translate + momentumDistance;\n if (rtl) newPosition = -newPosition;\n let doBounce = false;\n let afterBouncePosition;\n const bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeMode.momentumBounceRatio;\n let needsLoopFix;\n if (newPosition < swiper.maxTranslate()) {\n if (params.freeMode.momentumBounce) {\n if (newPosition + swiper.maxTranslate() < -bounceAmount) {\n newPosition = swiper.maxTranslate() - bounceAmount;\n }\n afterBouncePosition = swiper.maxTranslate();\n doBounce = true;\n data.allowMomentumBounce = true;\n } else {\n newPosition = swiper.maxTranslate();\n }\n if (params.loop && params.centeredSlides) needsLoopFix = true;\n } else if (newPosition > swiper.minTranslate()) {\n if (params.freeMode.momentumBounce) {\n if (newPosition - swiper.minTranslate() > bounceAmount) {\n newPosition = swiper.minTranslate() + bounceAmount;\n }\n afterBouncePosition = swiper.minTranslate();\n doBounce = true;\n data.allowMomentumBounce = true;\n } else {\n newPosition = swiper.minTranslate();\n }\n if (params.loop && params.centeredSlides) needsLoopFix = true;\n } else if (params.freeMode.sticky) {\n let nextSlide;\n for (let j = 0; j < snapGrid.length; j += 1) {\n if (snapGrid[j] > -newPosition) {\n nextSlide = j;\n break;\n }\n }\n if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') {\n newPosition = snapGrid[nextSlide];\n } else {\n newPosition = snapGrid[nextSlide - 1];\n }\n newPosition = -newPosition;\n }\n if (needsLoopFix) {\n once('transitionEnd', () => {\n swiper.loopFix();\n });\n }\n // Fix duration\n if (swiper.velocity !== 0) {\n if (rtl) {\n momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity);\n } else {\n momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity);\n }\n if (params.freeMode.sticky) {\n // If freeMode.sticky is active and the user ends a swipe with a slow-velocity\n // event, then durations can be 20+ seconds to slide one (or zero!) slides.\n // It's easy to see this when simulating touch with mouse events. To fix this,\n // limit single-slide swipes to the default slide duration. This also has the\n // nice side effect of matching slide speed if the user stopped moving before\n // lifting finger or mouse vs. moving slowly before lifting the finger/mouse.\n // For faster swipes, also apply limits (albeit higher ones).\n const moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate);\n const currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex];\n if (moveDistance < currentSlideSize) {\n momentumDuration = params.speed;\n } else if (moveDistance < 2 * currentSlideSize) {\n momentumDuration = params.speed * 1.5;\n } else {\n momentumDuration = params.speed * 2.5;\n }\n }\n } else if (params.freeMode.sticky) {\n swiper.slideToClosest();\n return;\n }\n if (params.freeMode.momentumBounce && doBounce) {\n swiper.updateProgress(afterBouncePosition);\n swiper.setTransition(momentumDuration);\n swiper.setTranslate(newPosition);\n swiper.transitionStart(true, swiper.swipeDirection);\n swiper.animating = true;\n (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.i)(wrapperEl, () => {\n if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return;\n emit('momentumBounce');\n swiper.setTransition(params.speed);\n setTimeout(() =>
458 {\n swiper.setTranslate(afterBouncePosition);\n (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.i)(wrapperEl, () => {\n if (!swiper || swiper.destroyed) return;\n swiper.transitionEnd();\n });\n }, 0);\n });\n } else if (swiper.velocity) {\n emit('_freeModeNoMomentumRelease');\n swiper.updateProgress(newPosition);\n swiper.setTransition(momentumDuration);\n swiper.setTranslate(newPosition);\n swiper.transitionStart(true, swiper.swipeDirection);\n if (!swiper.animating) {\n swiper.animating = true;\n (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.i)(wrapperEl, () => {\n if (!swiper || swiper.destroyed) return;\n swiper.transitionEnd();\n });\n }\n } else {\n swiper.updateProgress(newPosition);\n }\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n } else if (params.freeMode.sticky) {\n swiper.slideToClosest();\n return;\n } else if (params.freeMode) {\n emit('_freeModeNoMomentumRelease');\n }\n if (!params.freeMode.momentum || timeDiff >= params.longSwipesMs) {\n swiper.updateProgress();\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n }\n }\n Object.assign(swiper, {\n freeMode: {\n onTouchStart,\n onTouchMove,\n onTouchEnd\n }\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/free-mode.mjs?\n}"); 459 460/***/ }, 461 462/***/ "./node_modules/swiper/modules/grid.mjs" 463/*!**********************************************!*\ 464 !*** ./node_modules/swiper/modules/grid.mjs ***! 465 \**********************************************/ 466(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 467 468"use strict"; 469eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Grid)\n/* harmony export */ });\nfunction Grid(_ref) {\n let {\n swiper,\n extendParams,\n on\n } = _ref;\n extendParams({\n grid: {\n rows: 1,\n fill: 'column'\n }\n });\n let slidesNumberEvenToRows;\n let slidesPerRow;\n let numFullColumns;\n let wasMultiRow;\n const getSpaceBetween = () => {\n let spaceBetween = swiper.params.spaceBetween;\n if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {\n spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiper.size;\n } else if (typeof spaceBetween === 'string') {\n spaceBetween = parseFloat(spaceBetween);\n }\n return spaceBetween;\n };\n const initSlides = slidesLength => {\n const {\n slidesPerView\n } = swiper.params;\n const {\n rows,\n fill\n } = swiper.params.grid;\n numFullColumns = Math.floor(slidesLength / rows);\n if (Math.floor(slidesLength / rows) === slidesLength / rows) {\n slidesNumberEvenToRows = slidesLength;\n } else {\n slidesNumberEvenToRows = Math.ceil(slidesLength / rows) * rows;\n }\n if (slidesPerView !== 'auto' && fill === 'row') {\n slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, slidesPerView * rows);\n }\n slidesPerRow = slidesNumberEvenToRows / rows;\n };\n const updateSlide = (i, slide, slidesLength, getDirectionLabel) => {\n const {\n slidesPerGroup\n } = swiper.params;\n const spaceBetween = getSpaceBetween();\n const {\n rows,\n fill\n } = swiper.params.grid;\n // Set slides order\n let newSlideOrderIndex;\n let column;\n let row;\n if (fill === 'row' && slidesPerGroup > 1) {\n const groupIndex = Math.floor(i / (slidesPerGroup * rows));\n const slideIndexInGroup = i - rows * slidesPerGroup * groupIndex;\n const columnsInGroup = groupIndex === 0 ? slidesPerGroup : Math.min(Math.ceil((slidesLength - groupIndex * rows * slidesPerGroup) / rows), slidesPerGroup);\n row = Math.floor(slideIndexInGroup / columnsInGroup);\n column = slideIndexInGroup - row * columnsInGroup + groupIndex * slidesPerGroup;
469\n newSlideOrderIndex = column + row * slidesNumberEvenToRows / rows;\n slide.style.order = newSlideOrderIndex;\n } else if (fill === 'column') {\n column = Math.floor(i / rows);\n row = i - column * rows;\n if (column > numFullColumns || column === numFullColumns && row === rows - 1) {\n row += 1;\n if (row >= rows) {\n row = 0;\n column += 1;\n }\n }\n } else {\n row = Math.floor(i / slidesPerRow);\n column = i - row * slidesPerRow;\n }\n slide.row = row;\n slide.column = column;\n slide.style[getDirectionLabel('margin-top')] = row !== 0 ? spaceBetween && `${spaceBetween}px` : '';\n };\n const updateWrapperSize = (slideSize, snapGrid, getDirectionLabel) => {\n const {\n centeredSlides,\n roundLengths\n } = swiper.params;\n const spaceBetween = getSpaceBetween();\n const {\n rows\n } = swiper.params.grid;\n swiper.virtualSize = (slideSize + spaceBetween) * slidesNumberEvenToRows;\n swiper.virtualSize = Math.ceil(swiper.virtualSize / rows) - spaceBetween;\n swiper.wrapperEl.style[getDirectionLabel('width')] = `${swiper.virtualSize + spaceBetween}px`;\n if (centeredSlides) {\n const newSlidesGrid = [];\n for (let i = 0; i < snapGrid.length; i += 1) {\n let slidesGridItem = snapGrid[i];\n if (roundLengths) slidesGridItem = Math.floor(slidesGridItem);\n if (snapGrid[i] < swiper.virtualSize + snapGrid[0]) newSlidesGrid.push(slidesGridItem);\n }\n snapGrid.splice(0, snapGrid.length);\n snapGrid.push(...newSlidesGrid);\n }\n };\n const onInit = () => {\n wasMultiRow = swiper.params.grid && swiper.params.grid.rows > 1;\n };\n const onUpdate = () => {\n const {\n params,\n el\n } = swiper;\n const isMultiRow = params.grid && params.grid.rows > 1;\n if (wasMultiRow && !isMultiRow) {\n el.classList.remove(`${params.containerModifierClass}grid`, `${params.containerModifierClass}grid-column`);\n numFullColumns = 1;\n swiper.emitContainerClasses();\n } else if (!wasMultiRow && isMultiRow) {\n el.classList.add(`${params.containerModifierClass}grid`);\n if (params.grid.fill === 'column') {\n el.classList.add(`${params.containerModifierClass}grid-column`);\n }\n swiper.emitContainerClasses();\n }\n wasMultiRow = isMultiRow;\n };\n on('init', onInit);\n on('update', onUpdate);\n swiper.grid = {\n initSlides,\n updateSlide,\n updateWrapperSize\n };\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/grid.mjs?\n}"); 470 471/***/ }, 472 473/***/ "./node_modules/swiper/modules/hash-navigation.mjs" 474/*!*********************************************************!*\ 475 !*** ./node_modules/swiper/modules/hash-navigation.mjs ***! 476 \*********************************************************/ 477(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 478 479"use strict"; 480eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ HashNavigation)\n/* harmony export */ });\n/* harmony import */ var _shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/ssr-window.esm.mjs */ \"./node_modules/swiper/shared/ssr-window.esm.mjs\");\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\n\nfunction HashNavigation(_ref) {\n let {\n swiper,\n extendParams,\n emit,\n on\n } = _ref;\n let initialized = false;\n const document = (0,_shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.g)();\n const window = (0,_shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n extendParams({\n hashNavigation: {\n enabled: false,\n replaceState: false,\n watchState: false,\n getSlideIndex(_s, hash) {\n if (swiper.virtual && swiper.params.virtual.enabled) {\n const slideWithHash = swiper.slides.filter(slideEl => slideEl.getAttribute('data-hash') === hash)[0];\n if (!slideWithHash) return 0;\n const index = parseInt(slideWithHash.getAttribute('data-swiper-slide-index'), 10);\n return index;\n }\n return swiper.getSlideIndex((0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.e)(swiper.slidesEl, `.${swiper.params.slideClass}[data-hash=\"${hash}\"], swiper-slide[data-hash=\"${hash}\"]`)[0]);\n }\n }\n });\n const onHashChange = () => {\n emit('hashChange');\n const newHash = document.location.hash.replace('#', '');\n const activeSlideEl = swiper.virtual && swiper.params.virtual.enabled ? swiper.slidesEl.querySelector(`[data-swiper-slide-index=\"${swiper.activeIndex}\"]`) : swiper.slides[swiper.activeIndex];\n const activeSlideHash = activeSlideEl ? activeSlideEl.getAttribute('data-hash') : '';\n if (newHash !== activeSlideHash) {\n const newIndex = swiper.params.hashNavigation.getSlideIndex(swiper, newHash);\n if (typeof newIndex === 'undefined' || Number.isNaN(newIndex)) return;\n swiper.slideTo(newIndex);\n }\n };\n const setHash = () => {\n if (!initialized || !swiper.params.hashNavigation.enabled) return;\n const activeSlideEl = swiper.virtual && swiper.params.virtual.enabled ? swiper.slidesEl.querySelector(`[data-swiper-slide-index=\"${swiper.activeIndex}\"]`) : swiper.slides[swiper.activeIndex];\n const activeSlideHash = activeSlideEl ? activeSlideEl.getAttribute('data-hash') || activeSlideEl.getAttribute('data-history') : '';\n if (swiper.params.hashNavigation.replaceState && window.history && window.history.replaceState) {\n window.history.replaceState(null, null, `#${activeSlideHash}` || '');\n emit('hashSet');\n } else {\n document.location.hash = activeSlideHash || '';\n emit('hashSet');\n }\n };\n const init = () => {\n if (!swiper.params.hashNavigation.enabled || swiper.params.history && swiper.params.history.enabled) return;\n initialized = true;\n const hash = document.location.hash.replace('#', '');\n if (hash) {\n const speed = 0;\n const index = swiper.params.hashNavigation.getSlideIndex(swiper, hash);\n swiper.slideTo(index || 0, speed, swiper.params.runCallbacksOnInit, true);\n }\n if (swiper.params.hashNavigation.watchState) {\n window.addEventListener('hashchange', onHashChange);\n }\n };\n const destroy = () => {\n if (swiper.params.hashNavigation.watchState) {\n window.removeEventListener('hashchange', onHashChange);\n }\n };\n on('init', () => {\n if (swiper.params.hashNavigation.enabled) {\n init();\n }\n });\n on('destroy', () => {\n if (swiper.params.hashNavigation.enabled) {\n destroy();\n }\n });\n on('transitionEnd _freeModeNoMomentumRelease', () => {\n if (initialized) {\n setHash();\n }\n });\n on('slideChange', () => {\n if (initialized && swiper.params.cssMode) {\n setHash();\n }\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/hash-navigation.mjs?\n}"); 481 482/***/ }, 483 484/***/ "./node_modules/swiper/modules/history.mjs" 485/*!*************************************************!*\ 486 !*** ./node_modules/swiper/modules/history.mjs ***! 487 \*************************************************/ 488(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 489 490"use strict"; 491eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ History)\n/* harmony export */ });\n/* harmony import */ var _shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/ssr-window.esm.mjs */ \"./node_modules/swiper/shared/ssr-window.esm.mjs\");\n\n\nfunction History(_ref) {\n let {\n swiper,\n extendParams,\n on\n } = _ref;\n extendParams({\n history: {\n enabled: false,\n root: '',\n replaceState: false,\n key: 'slides',\n keepQuery: false\n }\n });\n let initialized = false;\n let paths = {};\n const slugify = text => {\n return text.toString().replace(/\\s+/g, '-').replace(/[^\\w-]+/g, '').replace(/--+/g, '-').replace(/^-+/, '').replace(/-+$/, '');\n };\n const getPathValues = urlOverride => {\n const window = (0,_shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n let location;\n if (urlOverride) {\n location = new URL(urlOverride);\n } else {\n location = window.location;\n }\n const pathArray = location.pathname.slice(1).split('/').filter(part => part !== '');\n const total = pathArray.length;
491\n const key = pathArray[total - 2];\n const value = pathArray[total - 1];\n return {\n key,\n value\n };\n };\n const setHistory = (key, index) => {\n const window = (0,_shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n if (!initialized || !swiper.params.history.enabled) return;\n let location;\n if (swiper.params.url) {\n location = new URL(swiper.params.url);\n } else {\n location = window.location;\n }\n const slide = swiper.slides[index];\n let value = slugify(slide.getAttribute('data-history'));\n if (swiper.params.history.root.length > 0) {\n let root = swiper.params.history.root;\n if (root[root.length - 1] === '/') root = root.slice(0, root.length - 1);\n value = `${root}/${key ? `${key}/` : ''}${value}`;\n } else if (!location.pathname.includes(key)) {\n value = `${key ? `${key}/` : ''}${value}`;\n }\n if (swiper.params.history.keepQuery) {\n value += location.search;\n }\n const currentState = window.history.state;\n if (currentState && currentState.value === value) {\n return;\n }\n if (swiper.params.history.replaceState) {\n window.history.replaceState({\n value\n }, null, value);\n } else {\n window.history.pushState({\n value\n }, null, value);\n }\n };\n const scrollToSlide = (speed, value, runCallbacks) => {\n if (value) {\n for (let i = 0, length = swiper.slides.length; i < length; i += 1) {\n const slide = swiper.slides[i];\n const slideHistory = slugify(slide.getAttribute('data-history'));\n if (slideHistory === value) {\n const index = swiper.getSlideIndex(slide);\n swiper.slideTo(index, speed, runCallbacks);\n }\n }\n } else {\n swiper.slideTo(0, speed, runCallbacks);\n }\n };\n const setHistoryPopState = () => {\n paths = getPathValues(swiper.params.url);\n scrollToSlide(swiper.params.speed, paths.value, false);\n };\n const init = () => {\n const window = (0,_shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n if (!swiper.params.history) return;\n if (!window.history || !window.history.pushState) {\n swiper.params.history.enabled = false;\n swiper.params.hashNavigation.enabled = true;\n return;\n }\n initialized = true;\n paths = getPathValues(swiper.params.url);\n if (!paths.key && !paths.value) {\n if (!swiper.params.history.replaceState) {\n window.addEventListener('popstate', setHistoryPopState);\n }\n return;\n }\n scrollToSlide(0, paths.value, swiper.params.runCallbacksOnInit);\n if (!swiper.params.history.replaceState) {\n window.addEventListener('popstate', setHistoryPopState);\n }\n };\n const destroy = () => {\n const window = (0,_shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n if (!swiper.params.history.replaceState) {\n window.removeEventListener('popstate', setHistoryPopState);\n }\n };\n on('init', () => {\n if (swiper.params.history.enabled) {\n init();\n }\n });\n on('destroy', () => {\n if (swiper.params.history.enabled) {\n destroy();\n }\n });\n on('transitionEnd _freeModeNoMomentumRelease', () => {\n if (initialized) {\n setHistory(swiper.params.history.key, swiper.activeIndex);\n }\n });\n on('slideChange', () => {\n if (initialized && swiper.params.cssMode) {\n setHistory(swiper.params.history.key, swiper.activeIndex);\n }\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/history.mjs?\n}"); 492 493/***/ }, 494 495/***/ "./node_modules/swiper/modules/index.mjs" 496/*!***********************************************!*\ 497 !*** ./node_modules/swiper/modules/index.mjs ***! 498 \***********************************************/ 499(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 500 501"use strict"; 502eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ A11y: () => (/* reexport safe */ _a11y_mjs__WEBPACK_IMPORTED_MODULE_9__[\"default\"]),\n/* harmony export */ Autoplay: () => (/* reexport safe */ _autoplay_mjs__WEBPACK_IMPORTED_MODULE_12__[\"default\"]),\n/* harmony export */ Controller: () => (/* reexport safe */ _controller_mjs__WEBPACK_IMPORTED_MODULE_8__[\"default\"]),\n/* harmony export */ EffectCards: () => (/* reexport safe */ _effect_cards_mjs__WEBPACK_IMPORTED_MODULE_22__[\"default\"]),\n/* harmony export */ EffectCoverflow: () => (/* reexport safe */ _effect_coverflow_mjs__WEBPACK_IMPORTED_MODULE_20__[\"default\"]),\n/* harmony export */ EffectCreative: () => (/* reexport safe */ _effect_creative_mjs__WEBPACK_IMPORTED_MODULE_21__[\"default\"]),\n/* harmony export */ EffectCube: () => (/* reexport safe */ _effect_cube_mjs__WEBPACK_IMPORTED_MODULE_18__[\"default\"]),\n/* harmony export */ EffectFade: () => (/* reexport safe */ _effect_fade_mjs__WEBPACK_IMPORTED_MODULE_17__[\"default\"]),\n/* harmony export */ EffectFlip: () => (/* reexport safe */ _effect_flip_mjs__WEBPACK_IMPORTED_MODULE_19__[\"default\"]),\n/* harmony export */ FreeMode: () => (/* reexport safe */ _free_mode_mjs__WEBPACK_IMPORTED_MODULE_14__[\"default\"]),\n/* harmony export */ Grid: () => (/* reexport safe */ _grid_mjs__WEBPACK_IMPORTED_MODULE_15__[\"default\"]),\n/* harmony export */ HashNavigation: () => (/* reexport safe */ _hash_navigation_mjs__WEBPACK_IMPORTED_MODULE_11__[\"default\"]),\n/* harmony export */ History: () => (/* reexport safe */ _history_mjs__WEBPACK_IMPORTED_MODULE_10__[\"default\"]),\n/* harmony export */ Keyboard: () => (/* reexport safe */ _keyboard_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"]),\n/* harmony export */ Manipulation: () => (/* reexport safe */ _manipulation_mjs__WEBPACK_IMPORTED_MODULE_16__[\"default\"]),\n/* harmony export */ Mousewheel: () => (/* reexport safe */ _mousewheel_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"]),\n/* harmony export */ Navigation: () => (/* reexport safe */ _navigation_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"]),\n/* harmony export */ Pagination: () => (/* reexport safe */ _pagination_mjs__WEBPACK_IMPORTED_MODULE_4__[\"default\"]),\n/* harmony export */ Parallax: () => (/* reexport safe */ _parallax_mjs__WEBPACK_IMPORTED_MODULE_6__[\"default\"]),\n/* harmony export */ Scrollbar: () => (/* reexport safe */ _scrollbar_mjs__WEBPACK_IMPORTED_MODULE_5__[\"default\"]),\n/* harmony export */ Thumbs: () => (/* reexport safe */ _thumbs_mjs__WEBPACK_IMPORTED_MODULE_13__[\"default\"]),\n/* harmony export */ Virtual: () => (/* reexport safe */ _virtual_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ Zoom: () => (/* reexport safe */ _zoom_mjs__WEBPACK_IMPORTED_MODULE_7__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _virtual_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./virtual.mjs */ \"./node_modules/swiper/modules/virtual.mjs\");\n/* harmony import */ var _keyboard_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keyboard.mjs */ \"./node_modules/swiper/modules/keyboard.mjs\");\n/* harmony import */ var _mousewheel_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mousewheel.mjs */ \"./node_modules/swiper/modules/mousewheel.mjs\");\n/* harmony import */ var _navigation_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./navigation.mjs */ \"./node_modules/swiper/modules/navigation.mjs\");\n/* harmony import */ var _pagination_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./pagination.mjs */ \"./node_modules/swiper/modules/pagination.mjs\");\n/* harmony import */ var _scrollbar_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./scrollbar.mjs */ \"./node_modules/swiper/modules/scrollbar.mjs\");\n/* harmony import */ var _parallax_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parallax.mjs */ \"./node_modules/swiper/modules/parallax.mjs\");\n/* harmony import */ var _zoom_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./zoom.mjs */ \"./node_modules/swiper/modules/zoom.mjs\");\n/* harmony import */ var _controller_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./controller.mjs */ \"./node_modules/swiper/modules/controller.mjs\");\n/* harmony import */ var _a11y_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./a11y.mjs */ \"./node_modules/swiper/modules/a11y.mjs\");\n/* harmony import */ var _history_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./history.mjs */ \"./node_modules/swiper/modules/history.mjs\");\n/* harmony import */ var _hash_navigation_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./hash-navigation.mjs */ \"./node_modules/swiper/modules/hash-navigation.mjs\");\n/* harmony import */ var _autoplay_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./autoplay.mjs */ \"./node_modules/swiper/modules/autoplay.mjs\");\n/* harmony import */ var _thumbs_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./thumbs.mjs */ \"./node_modules/swiper/modules/thumbs.mjs\");\n/* harmony import */ var _free_mode_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./free-mode.mjs */ \"./node_modules/swiper/modules/free-mode.mjs\");\n/* harmony import */ var _grid_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./grid.mjs */ \"./node_modules/swiper/modules/grid.mjs\");\n/* harmony import */ var _manipulation_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./manipulation.mjs */ \"./node_modules/swiper/modules/manipulation.mjs\");\n/* harmony import */ var _effect_fade_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./effect-fade.mjs */ \"./node_modules/swiper/modules/effect-fade.mjs\");\n/* harmony import */ var _effect_cube_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./effect-cube.mjs */ \"./node_modules/swiper/modules/effect-cube.mjs\");\n/* harmony import */ var _effect_flip_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./effect-flip.mjs */ \"./node_modules/swiper/modules/effect-flip.mjs\");\n/* harmony import */ var _effect_coverflow_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./effect-coverflow.mjs */ \"./node_modules/swiper/modules/effect-coverflow.mjs\");\n/* harmony import */ var _effect_creative_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./effect-creative.mjs */ \"./node_modules/swiper/modules/effect-creative.mjs\");\n/* harmony import */ var _effect_cards_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./effect-cards.mjs */ \"./node_modules/swiper/modules/effect-cards.mjs\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/index.mjs?\n}"); 503 504/***/ }, 505 506/***/ "./node_modules/swiper/modules/keyboard.mjs" 507/*!**************************************************!*\ 508 !*** ./node_modules/swiper/modules/keyboard.mjs ***! 509 \**************************************************/ 510(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 511 512"use strict"; 513eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Keyboard)\n/* harmony export */ });\n/* harmony import */ var _shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/ssr-window.esm.mjs */ \"./node_modules/swiper/shared/ssr-window.esm.mjs\");\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\n\n/* eslint-disable consistent-return */\nfunction Keyboard(_ref) {\n let {\n swiper,\n extendParams,\n on,\n emit\n } = _ref;\n const document = (0,_shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.g)();\n const window = (0,_shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n swiper.keyboard = {\n enabled: false\n };\n extendParams({\n keyboard: {\n enabled: false,\n onlyInViewport: true,\n pageUpDown: true\n }\n });\n function handle(event) {\n if (!swiper.enabled) return;\n const {\n rtlTranslate: rtl\n } = swiper;\n let e = event;\n if (e.originalEvent) e = e.originalEvent;
513 // jquery fix\n const kc = e.keyCode || e.charCode;\n const pageUpDown = swiper.params.keyboard.pageUpDown;\n const isPageUp = pageUpDown && kc === 33;\n const isPageDown = pageUpDown && kc === 34;\n const isArrowLeft = kc === 37;\n const isArrowRight = kc === 39;\n const isArrowUp = kc === 38;\n const isArrowDown = kc === 40;\n // Directions locks\n if (!swiper.allowSlideNext && (swiper.isHorizontal() && isArrowRight || swiper.isVertical() && isArrowDown || isPageDown)) {\n return false;\n }\n if (!swiper.allowSlidePrev && (swiper.isHorizontal() && isArrowLeft || swiper.isVertical() && isArrowUp || isPageUp)) {\n return false;\n }\n if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {\n return undefined;\n }\n if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {\n return undefined;\n }\n if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) {\n let inView = false;\n // Check that swiper should be inside of visible area of window\n if ((0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(swiper.el, `.${swiper.params.slideClass}, swiper-slide`).length > 0 && (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(swiper.el, `.${swiper.params.slideActiveClass}`).length === 0) {\n return undefined;\n }\n const el = swiper.el;\n const swiperWidth = el.clientWidth;\n const swiperHeight = el.clientHeight;\n const windowWidth = window.innerWidth;\n const windowHeight = window.innerHeight;\n const swiperOffset = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(el);\n if (rtl) swiperOffset.left -= el.scrollLeft;\n const swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiperWidth, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiperHeight], [swiperOffset.left + swiperWidth, swiperOffset.top + swiperHeight]];\n for (let i = 0; i < swiperCoord.length; i += 1) {\n const point = swiperCoord[i];\n if (point[0] >= 0 && point[0] <= windowWidth && point[1] >= 0 && point[1] <= windowHeight) {\n if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line\n inView = true;\n }\n }\n if (!inView) return undefined;\n }\n if (swiper.isHorizontal()) {\n if (isPageUp || isPageDown || isArrowLeft || isArrowRight) {\n if (e.preventDefault) e.preventDefault();else e.returnValue = false;\n }\n if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext();\n if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev();\n } else {\n if (isPageUp || isPageDown || isArrowUp || isArrowDown) {\n if (e.preventDefault) e.preventDefault();else e.returnValue = false;\n }\n if (isPageDown || isArrowDown) swiper.slideNext();\n if (isPageUp || isArrowUp) swiper.slidePrev();\n }\n emit('keyPress', kc);\n return undefined;\n }\n function enable() {\n if (swiper.keyboard.enabled) return;\n document.addEventListener('keydown', handle);\n swiper.keyboard.enabled = true;\n }\n function disable() {\n if (!swiper.keyboard.enabled) return;\n document.removeEventListener('keydown', handle);\n swiper.keyboard.enabled = false;\n }\n on('init', () => {\n if (swiper.params.keyboard.enabled) {\n enable();\n }\n });\n on('destroy', () => {\n if (swiper.keyboard.enabled) {\n disable();\n }\n });\n Object.assign(swiper.keyboard, {\n enable,\n disable\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/keyboard.mjs?\n}"); 514 515/***/ }, 516 517/***/ "./node_modules/swiper/modules/manipulation.mjs" 518/*!******************************************************!*\ 519 !*** ./node_modules/swiper/modules/manipulation.mjs ***! 520 \******************************************************/ 521(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 522 523"use strict"; 524eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Manipulation)\n/* harmony export */ });\nfunction appendSlide(slides) {\n const swiper = this;\n const {\n params,\n slidesEl\n } = swiper;\n if (params.loop) {\n swiper.loopDestroy();\n }\n const appendElement = slideEl => {\n if (typeof slideEl === 'string') {\n const tempDOM = document.createElement('div');\n tempDOM.innerHTML = slideEl;\n slidesEl.append(tempDOM.children[0]);\n tempDOM.innerHTML = '';\n } else {\n slidesEl.append(slideEl);\n }\n };\n if (typeof slides === 'object' && 'length' in slides) {\n for (let i = 0; i < slides.length; i += 1) {\n if (slides[i]) appendElement(slides[i]);\n }\n } else {\n appendElement(slides);\n }\n swiper.recalcSlides();\n if (params.loop) {\n swiper.loopCreate();\n }\n if (!params.observer || swiper.isElement) {\n swiper.update(
524);\n }\n}\n\nfunction prependSlide(slides) {\n const swiper = this;\n const {\n params,\n activeIndex,\n slidesEl\n } = swiper;\n if (params.loop) {\n swiper.loopDestroy();\n }\n let newActiveIndex = activeIndex + 1;\n const prependElement = slideEl => {\n if (typeof slideEl === 'string') {\n const tempDOM = document.createElement('div');\n tempDOM.innerHTML = slideEl;\n slidesEl.prepend(tempDOM.children[0]);\n tempDOM.innerHTML = '';\n } else {\n slidesEl.prepend(slideEl);\n }\n };\n if (typeof slides === 'object' && 'length' in slides) {\n for (let i = 0; i < slides.length; i += 1) {\n if (slides[i]) prependElement(slides[i]);\n }\n newActiveIndex = activeIndex + slides.length;\n } else {\n prependElement(slides);\n }\n swiper.recalcSlides();\n if (params.loop) {\n swiper.loopCreate();\n }\n if (!params.observer || swiper.isElement) {\n swiper.update();\n }\n swiper.slideTo(newActiveIndex, 0, false);\n}\n\nfunction addSlide(index, slides) {\n const swiper = this;\n const {\n params,\n activeIndex,\n slidesEl\n } = swiper;\n let activeIndexBuffer = activeIndex;\n if (params.loop) {\n activeIndexBuffer -= swiper.loopedSlides;\n swiper.loopDestroy();\n swiper.recalcSlides();\n }\n const baseLength = swiper.slides.length;\n if (index <= 0) {\n swiper.prependSlide(slides);\n return;\n }\n if (index >= baseLength) {\n swiper.appendSlide(slides);\n return;\n }\n let newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + 1 : activeIndexBuffer;\n const slidesBuffer = [];\n for (let i = baseLength - 1; i >= index; i -= 1) {\n const currentSlide = swiper.slides[i];\n currentSlide.remove();\n slidesBuffer.unshift(currentSlide);\n }\n if (typeof slides === 'object' && 'length' in slides) {\n for (let i = 0; i < slides.length; i += 1) {\n if (slides[i]) slidesEl.append(slides[i]);\n }\n newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + slides.length : activeIndexBuffer;\n } else {\n slidesEl.append(slides);\n }\n for (let i = 0; i < slidesBuffer.length; i += 1) {\n slidesEl.append(slidesBuffer[i]);\n }\n swiper.recalcSlides();\n if (params.loop) {\n swiper.loopCreate();\n }\n if (!params.observer || swiper.isElement) {\n swiper.update();\n }\n if (params.loop) {\n swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);\n } else {\n swiper.slideTo(newActiveIndex, 0, false);\n }\n}\n\nfunction removeSlide(slidesIndexes) {\n const swiper = this;\n const {\n params,\n activeIndex\n } = swiper;\n let activeIndexBuffer = activeIndex;\n if (params.loop) {\n activeIndexBuffer -= swiper.loopedSlides;\n swiper.loopDestroy();\n }\n let newActiveIndex = activeIndexBuffer;\n let indexToRemove;\n if (typeof slidesIndexes === 'object' && 'length' in slidesIndexes) {\n for (let i = 0; i < slidesIndexes.length; i += 1) {\n indexToRemove = slidesIndexes[i];\n if (swiper.slides[indexToRemove]) swiper.slides[indexToRemove].remove();\n if (indexToRemove < newActiveIndex) newActiveIndex -= 1;\n }\n newActiveIndex = Math.max(newActiveIndex, 0);\n } else {\n indexToRemove = slidesIndexes;\n if (swiper.slides[indexToRemove]) swiper.slides[indexToRemove].remove();\n if (indexToRemove < newActiveIndex) newActiveIndex -= 1;\n newActiveIndex = Math.max(newActiveIndex, 0);\n }\n swiper.recalcSlides();\n if (params.loop) {\n swiper.loopCreate();\n }\n if (!params.observer || swiper.isElement) {\n swiper.update();\n }\n if (params.loop) {\n swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);\n } else {\n swiper.slideTo(newActiveIndex, 0, false);\n }\n}\n\nfunction removeAllSlides() {\n const swiper = this;\n const slidesIndexes = [];\n for (let i = 0; i < swiper.slides.length; i += 1) {\n slidesIndexes.push(i);\n }\n swiper.removeSlide(slidesIndexes);\n}\n\nfunction Manipulation(_ref) {\n let {\n swiper\n } = _ref;\n Object.assign(swiper, {\n appendSlide: appendSlide.bind(swiper),\n prependSlide: prependSlide.bind(swiper),\n addSlide: addSlide.bind(swiper),\n removeSlide: removeSlide.bind(swiper),\n removeAllSlides: removeAllSlides.bind(swiper)\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/manipulation.mjs?\n}"); 525 526/***/ }, 527 528/***/ "./node_modules/swiper/modules/mousewheel.mjs" 529/*!****************************************************!*\ 530 !*** ./node_modules/swiper/modules/mousewheel.mjs ***! 531 \****************************************************/ 532(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 533 534"use strict"; 535eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Mousewheel)\n/* harmony export */ });\n/* harmony import */ var _shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/ssr-window.esm.mjs */ \"./node_modules/swiper/shared/ssr-window.esm.mjs\");\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\n\n/* eslint-disable consistent-return */\nfunction Mousewheel(_ref) {\n let {\n swiper,\n extendParams,\n on,\n emit\n } = _ref;\n const window = (0,_shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n extendParams({\n mousewheel: {\n enabled: false,\n releaseOnEdges: false,\n invert: false,\n forceToAxis: fal
535se,\n sensitivity: 1,\n eventsTarget: 'container',\n thresholdDelta: null,\n thresholdTime: null,\n noMousewheelClass: 'swiper-no-mousewheel'\n }\n });\n swiper.mousewheel = {\n enabled: false\n };\n let timeout;\n let lastScrollTime = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.d)();\n let lastEventBeforeSnap;\n const recentWheelEvents = [];\n function normalize(e) {\n // Reasonable defaults\n const PIXEL_STEP = 10;\n const LINE_HEIGHT = 40;\n const PAGE_HEIGHT = 800;\n let sX = 0;\n let sY = 0; // spinX, spinY\n let pX = 0;\n let pY = 0; // pixelX, pixelY\n\n // Legacy\n if ('detail' in e) {\n sY = e.detail;\n }\n if ('wheelDelta' in e) {\n sY = -e.wheelDelta / 120;\n }\n if ('wheelDeltaY' in e) {\n sY = -e.wheelDeltaY / 120;\n }\n if ('wheelDeltaX' in e) {\n sX = -e.wheelDeltaX / 120;\n }\n\n // side scrolling on FF with DOMMouseScroll\n if ('axis' in e && e.axis === e.HORIZONTAL_AXIS) {\n sX = sY;\n sY = 0;\n }\n pX = sX * PIXEL_STEP;\n pY = sY * PIXEL_STEP;\n if ('deltaY' in e) {\n pY = e.deltaY;\n }\n if ('deltaX' in e) {\n pX = e.deltaX;\n }\n if (e.shiftKey && !pX) {\n // if user scrolls with shift he wants horizontal scroll\n pX = pY;\n pY = 0;\n }\n if ((pX || pY) && e.deltaMode) {\n if (e.deltaMode === 1) {\n // delta in LINE units\n pX *= LINE_HEIGHT;\n pY *= LINE_HEIGHT;\n } else {\n // delta in PAGE units\n pX *= PAGE_HEIGHT;\n pY *= PAGE_HEIGHT;\n }\n }\n\n // Fall-back if spin cannot be determined\n if (pX && !sX) {\n sX = pX < 1 ? -1 : 1;\n }\n if (pY && !sY) {\n sY = pY < 1 ? -1 : 1;\n }\n return {\n spinX: sX,\n spinY: sY,\n pixelX: pX,\n pixelY: pY\n };\n }\n function handleMouseEnter() {\n if (!swiper.enabled) return;\n swiper.mouseEntered = true;\n }\n function handleMouseLeave() {\n if (!swiper.enabled) return;\n swiper.mouseEntered = false;\n }\n function animateSlider(newEvent) {\n if (swiper.params.mousewheel.thresholdDelta && newEvent.delta < swiper.params.mousewheel.thresholdDelta) {\n // Prevent if delta of wheel scroll delta is below configured threshold\n return false;\n }\n if (swiper.params.mousewheel.thresholdTime && (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.d)() - lastScrollTime < swiper.params.mousewheel.thresholdTime) {\n // Prevent if time between scrolls is below configured threshold\n return false;\n }\n\n // If the movement is NOT big enough and\n // if the last time the user scrolled was too close to the current one (avoid continuously triggering the slider):\n // Don't go any further (avoid insignificant scroll movement).\n if (newEvent.delta >= 6 && (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.d)() - lastScrollTime < 60) {\n // Return false as a default\n return true;\n }\n // If user is scrolling towards the end:\n // If the slider hasn't hit the latest slide or\n // if the slider is a loop and\n // if the slider isn't moving right now:\n // Go to next slide and\n // emit a scroll event.\n // Else (the user is scrolling towards the beginning) and\n // if the slider hasn't hit the first slide or\n // if the slider is a loop and\n // if the slider isn't moving right now:\n // Go to prev slide and\n // emit a scroll event.\n if (newEvent.direction < 0) {\n if ((!swiper.isEnd || swiper.params.loop) && !swiper.animating) {\n swiper.slideNext();\n emit('scroll', newEvent.raw);\n }\n } else if ((!swiper.isBeginning || swiper.params.loop) && !swiper.animating) {\n swiper.slidePrev();\n emit('scroll', newEvent.raw);\n }\n // If you got here is because an animation has been triggered so store the current time\n lastScrollTime = new window.Date().getTime();\n // Return false as a default\n return false;\n }\n function releaseScroll(newEvent) {\n const params = swiper.params.mousewheel;\n if (newEvent.direction < 0) {\n if (swiper.isEnd && !swiper.params.loop && params.releaseOnEdges) {\n // Return true to animate scroll on edges\n return true;\n }\n } else if (swiper.isBeginning && !swiper.params.loop && params.releaseOnEdges) {\n // Return true to animate scroll on edges\n return true;\n }\n return false;\n }\n function handle(event) {\n let e = event;\n let disableParentSwiper = true;\n if (!swiper.enabled) return;\n\n // Ignore event if the target or its parents have the swiper-no-mousewheel class\n if (event.target.closest(`.${swiper.params.mousewheel.noMousewheelClass}`)) return;\n const params = swiper.params.mousewheel;\n if (swiper.params.cssMode) {\n e.preventDefault();\n }\n let targetEl = swiper.el;\n if (swiper.params.mousewheel.eventsTarget !== 'container') {\n targetEl = document.querySelector(swiper.params.mousewheel.eventsTarget);\n }\n const targetElContainsTarget = targetEl && targetEl.contains(e.target);\n if (!swiper.mouseEntered && !targetElContainsTarget && !params.releaseOnEdges) return true;\n if (e.originalEvent) e = e.originalEvent; // jquery fix\n let delta = 0;\n const rtlFactor = swiper.rtlTranslate ? -1 : 1;\n const data = normalize(e);\n if (params.forceToAxis) {\n if (swiper.isHorizontal()) {\n if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = -data.pixelX * rtlFactor;else return true;\n } else if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = -data.pixelY;else return true;\n } else {\n delta = Math.abs(data.pixelX) >
535 Math.abs(data.pixelY) ? -data.pixelX * rtlFactor : -data.pixelY;\n }\n if (delta === 0) return true;\n if (params.invert) delta = -delta;\n\n // Get the scroll positions\n let positions = swiper.getTranslate() + delta * params.sensitivity;\n if (positions >= swiper.minTranslate()) positions = swiper.minTranslate();\n if (positions <= swiper.maxTranslate()) positions = swiper.maxTranslate();\n\n // When loop is true:\n // the disableParentSwiper will be true.\n // When loop is false:\n // if the scroll positions is not on edge,\n // then the disableParentSwiper will be true.\n // if the scroll on edge positions,\n // then the disableParentSwiper will be false.\n disableParentSwiper = swiper.params.loop ? true : !(positions === swiper.minTranslate() || positions === swiper.maxTranslate());\n if (disableParentSwiper && swiper.params.nested) e.stopPropagation();\n if (!swiper.params.freeMode || !swiper.params.freeMode.enabled) {\n // Register the new event in a variable which stores the relevant data\n const newEvent = {\n time: (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.d)(),\n delta: Math.abs(delta),\n direction: Math.sign(delta),\n raw: event\n };\n\n // Keep the most recent events\n if (recentWheelEvents.length >= 2) {\n recentWheelEvents.shift(); // only store the last N events\n }\n\n const prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined;\n recentWheelEvents.push(newEvent);\n\n // If there is at least one previous recorded event:\n // If direction has changed or\n // if the scroll is quicker than the previous one:\n // Animate the slider.\n // Else (this is the first time the wheel is moved):\n // Animate the slider.\n if (prevEvent) {\n if (newEvent.direction !== prevEvent.direction || newEvent.delta > prevEvent.delta || newEvent.time > prevEvent.time + 150) {\n animateSlider(newEvent);\n }\n } else {\n animateSlider(newEvent);\n }\n\n // If it's time to release the scroll:\n // Return now so you don't hit the preventDefault.\n if (releaseScroll(newEvent)) {\n return true;\n }\n } else {\n // Freemode or scrollContainer:\n\n // If we recently snapped after a momentum scroll, then ignore wheel events\n // to give time for the deceleration to finish. Stop ignoring after 500 msecs\n // or if it's a new scroll (larger delta or inverse sign as last event before\n // an end-of-momentum snap).\n const newEvent = {\n time: (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.d)(),\n delta: Math.abs(delta),\n direction: Math.sign(delta)\n };\n const ignoreWheelEvents = lastEventBeforeSnap && newEvent.time < lastEventBeforeSnap.time + 500 && newEvent.delta <= lastEventBeforeSnap.delta && newEvent.direction === lastEventBeforeSnap.direction;\n if (!ignoreWheelEvents) {\n lastEventBeforeSnap = undefined;\n let position = swiper.getTranslate() + delta * params.sensitivity;\n const wasBeginning = swiper.isBeginning;\n const wasEnd = swiper.isEnd;\n if (position >= swiper.minTranslate()) position = swiper.minTranslate();\n if (position <= swiper.maxTranslate()) position = swiper.maxTranslate();\n swiper.setTransition(0);\n swiper.setTranslate(position);\n swiper.updateProgress();\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n if (!wasBeginning && swiper.isBeginning || !wasEnd && swiper.isEnd) {\n swiper.updateSlidesClasses();\n }\n if (swiper.params.loop) {\n swiper.loopFix({\n direction: newEvent.direction < 0 ? 'next' : 'prev',\n byMousewheel: true\n });\n }\n if (swiper.params.freeMode.sticky) {\n // When wheel scrolling starts with sticky (aka snap) enabled, then detect\n // the end of a momentum scroll by storing recent (N=15?) wheel events.\n // 1. do all N events have decreasing or same (
535absolute value) delta?\n // 2. did all N events arrive in the last M (M=500?) msecs?\n // 3. does the earliest event have an (absolute value) delta that's\n // at least P (P=1?) larger than the most recent event's delta?\n // 4. does the latest event have a delta that's smaller than Q (Q=6?) pixels?\n // If 1-4 are \"yes\" then we're near the end of a momentum scroll deceleration.\n // Snap immediately and ignore remaining wheel events in this scroll.\n // See comment above for \"remaining wheel events in this scroll\" determination.\n // If 1-4 aren't satisfied, then wait to snap until 500ms after the last event.\n clearTimeout(timeout);\n timeout = undefined;\n if (recentWheelEvents.length >= 15) {\n recentWheelEvents.shift(); // only store the last N events\n }\n\n const prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined;\n const firstEvent = recentWheelEvents[0];\n recentWheelEvents.push(newEvent);\n if (prevEvent && (newEvent.delta > prevEvent.delta || newEvent.direction !== prevEvent.direction)) {\n // Increasing or reverse-sign delta means the user started scrolling again. Clear the wheel event log.\n recentWheelEvents.splice(0);\n } else if (recentWheelEvents.length >= 15 && newEvent.time - firstEvent.time < 500 && firstEvent.delta - newEvent.delta >= 1 && newEvent.delta <= 6) {\n // We're at the end of the deceleration of a momentum scroll, so there's no need\n // to wait for more events. Snap ASAP on the next tick.\n // Also, because there's some remaining momentum we'll bias the snap in the\n // direction of the ongoing scroll because it's better UX for the scroll to snap\n // in the same direction as the scroll instead of reversing to snap. Therefore,\n // if it's already scrolled more than 20% in the current direction, keep going.\n const snapToThreshold = delta > 0 ? 0.8 : 0.2;\n lastEventBeforeSnap = newEvent;\n recentWheelEvents.splice(0);\n timeout = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.n)(() => {\n swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold);\n }, 0); // no delay; move on next tick\n }\n\n if (!timeout) {\n // if we get here, then we haven't detected the end of a momentum scroll, so\n // we'll consider a scroll \"complete\" when there haven't been any wheel events\n // for 500ms.\n timeout = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.n)(() => {\n const snapToThreshold = 0.5;\n lastEventBeforeSnap = newEvent;\n recentWheelEvents.splice(0);\n swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold);\n }, 500);\n }\n }\n\n // Emit event\n if (!ignoreWheelEvents) emit('scroll', e);\n\n // Stop autoplay\n if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) swiper.autoplay.stop();\n // Return page scroll on edge positions\n if (params.releaseOnEdges && (position === swiper.minTranslate() || position === swiper.maxTranslate())) {\n return true;\n }\n }\n }\n if (e.preventDefault) e.preventDefault();else e.returnValue = false;\n return false;\n }\n function events(method) {\n let targetEl = swiper.el;\n if (swiper.params.mousewheel.eventsTarget !== 'container') {\n targetEl = document.querySelector(swiper.params.mousewheel.eventsTarget);\n }\n targetEl[method]('mouseenter', handleMouseEnter);\n targetEl[method]('mouseleave', handleMouseLeave);\n targetEl[method]('wheel', handle);\n }\n function enable() {\n if (swiper.params.cssMode) {\n swiper.wrapperEl.removeEventListener('wheel', handle);\n return true;\n }\n if (swiper.mousewheel.enabled) return false;\n events('addEventListener');\n swiper.mousewheel.enabled = true;\n return true;\n }\n function disable() {\n if (swiper.params.cssMode) {\n swiper.wrapperEl.addEventListener(event, handle);\n return true;\n }\n if (!swiper.mousewheel.enabled) return false;\n events('removeEventListener');\n swiper.mousewheel.enabled = false;\n return true;\n }\n on('init', () => {\n if (!swiper.params.mousewheel.enabled && swiper.params.cssMode) {\n disable();\n }\n if (swiper.params.mousewheel.enabled) enable();\n });\n on('destroy', () => {\n if (swiper.params.cssMode) {\n enable();\n }\n if (swiper.mousewheel.enabled) disable();\n });\n Object.assign(swiper.mousewheel, {\n enable,\n disable\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/mousewheel.mjs?\n}"); 536 537/***/ }, 538 539/***/ "./node_modules/swiper/modules/navigation.mjs" 540/*!****************************************************!*\ 541 !*** ./node_modules/swiper/modules/navigation.mjs ***! 542 \****************************************************/ 543(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 544 545"use strict"; 546eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Navigation)\n/* harmony export */ });\n/* harmony import */ var _shared_create_element_if_not_defined_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/create-element-if-not-defined.mjs */ \"./node_modules/swiper/shared/create-element-if-not-defined.mjs\");\n\n\nfunction Navigation(_ref) {\n let {\n swiper,\n extendParams,\n on,\n emit\n } = _ref;\n extendParams({\n navigation: {\n nextEl: null,\n prevEl: null,\n hideOnClick: false,\n disabledClass: 'swiper-button-disabled',\n hiddenClass: 'swiper-button-hidden',\n lockClass: 'swiper-button-lock',\n navigationDisabledClass: 'swiper-navigation-disabled'\n }\n });\n swiper.navigation = {\n nextEl: null,\n prevEl: null\n };\n const makeElementsArray = el => (Array.isArray(el) ? el : [el]).filter(e => !!e);\n function getEl(el) {\n let res;\n if (el && typeof el === 'string' && swiper.isElement) {\n res = swiper.el.querySelector(el);\n if (res) return res;\n }\n if (el) {\n if (typeof el === 'string') res = [...document.querySelectorAll(el)];\n if (swiper.params.uniqueNavElements && typeof el === 'string' && res.length > 1 && swiper.el.querySelectorAll(el).length === 1) {\n res = swiper.el.querySelector(el);\n }\n }\n if (el && !res) return el;\n // if (Array.isArray(res) && res.length === 1) res = res[0];\n return res;\n }\n function toggleEl(el, disabled) {\n const params = swiper.params.navigation;\n el = makeElementsArray(el);\n el.forEach(subEl => {\n if (subEl) {\n subEl.classList[disabled ? 'add' : 'remove'](...params.disabledClass.split(' '));\n if (subEl.tagName === 'BUTTON') subEl.disabled = disabled;\n if (swiper.params.watchOverflow && swiper.enabled) {\n subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);\n }\n }\n });\n }
546\n function update() {\n // Update Navigation Buttons\n const {\n nextEl,\n prevEl\n } = swiper.navigation;\n if (swiper.params.loop) {\n toggleEl(prevEl, false);\n toggleEl(nextEl, false);\n return;\n }\n toggleEl(prevEl, swiper.isBeginning && !swiper.params.rewind);\n toggleEl(nextEl, swiper.isEnd && !swiper.params.rewind);\n }\n function onPrevClick(e) {\n e.preventDefault();\n if (swiper.isBeginning && !swiper.params.loop && !swiper.params.rewind) return;\n swiper.slidePrev();\n emit('navigationPrev');\n }\n function onNextClick(e) {\n e.preventDefault();\n if (swiper.isEnd && !swiper.params.loop && !swiper.params.rewind) return;\n swiper.slideNext();\n emit('navigationNext');\n }\n function init() {\n const params = swiper.params.navigation;\n swiper.params.navigation = (0,_shared_create_element_if_not_defined_mjs__WEBPACK_IMPORTED_MODULE_0__.c)(swiper, swiper.originalParams.navigation, swiper.params.navigation, {\n nextEl: 'swiper-button-next',\n prevEl: 'swiper-button-prev'\n });\n if (!(params.nextEl || params.prevEl)) return;\n let nextEl = getEl(params.nextEl);\n let prevEl = getEl(params.prevEl);\n Object.assign(swiper.navigation, {\n nextEl,\n prevEl\n });\n nextEl = makeElementsArray(nextEl);\n prevEl = makeElementsArray(prevEl);\n const initButton = (el, dir) => {\n if (el) {\n el.addEventListener('click', dir === 'next' ? onNextClick : onPrevClick);\n }\n if (!swiper.enabled && el) {\n el.classList.add(...params.lockClass.split(' '));\n }\n };\n nextEl.forEach(el => initButton(el, 'next'));\n prevEl.forEach(el => initButton(el, 'prev'));\n }\n function destroy() {\n let {\n nextEl,\n prevEl\n } = swiper.navigation;\n nextEl = makeElementsArray(nextEl);\n prevEl = makeElementsArray(prevEl);\n const destroyButton = (el, dir) => {\n el.removeEventListener('click', dir === 'next' ? onNextClick : onPrevClick);\n el.classList.remove(...swiper.params.navigation.disabledClass.split(' '));\n };\n nextEl.forEach(el => destroyButton(el, 'next'));\n prevEl.forEach(el => destroyButton(el, 'prev'));\n }\n on('init', () => {\n if (swiper.params.navigation.enabled === false) {\n // eslint-disable-next-line\n disable();\n } else {\n init();\n update();\n }\n });\n on('toEdge fromEdge lock unlock', () => {\n update();\n });\n on('destroy', () => {\n destroy();\n });\n on('enable disable', () => {\n let {\n nextEl,\n prevEl\n } = swiper.navigation;\n nextEl = makeElementsArray(nextEl);\n prevEl = makeElementsArray(prevEl);\n if (swiper.enabled) {\n update();\n return;\n }\n [...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.add(swiper.params.navigation.lockClass));\n });\n on('click', (_s, e) => {\n let {\n nextEl,\n prevEl\n } = swiper.navigation;\n nextEl = makeElementsArray(nextEl);\n prevEl = makeElementsArray(prevEl);\n const targetEl = e.target;\n if (swiper.params.navigation.hideOnClick && !prevEl.includes(targetEl) && !nextEl.includes(targetEl)) {\n if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return;\n let isHidden;\n if (nextEl.length) {\n isHidden = nextEl[0].classList.contains(swiper.params.navigation.hiddenClass);\n } else if (prevEl.length) {\n isHidden = prevEl[0].classList.contains(swiper.params.navigation.hiddenClass);\n }\n if (isHidden === true) {\n emit('navigationShow');\n } else {\n emit('navigationHide');\n }\n [...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.toggle(swiper.params.navigation.hiddenClass));\n }\n });\n const enable = () => {\n swiper.el.classList.remove(...swiper.params.navigation.navigationDisabledClass.split(' '));\n init();\n update();\n };\n const disable = () => {\n swiper.el.classList.add(...swiper.params.navigation.navigationDisabledClass.split(' '));\n destroy();\n };\n Object.assign(swiper.navigation, {\n enable,\n disable,\n update,\n init,\n destroy\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/navigation.mjs?\n}"); 547 548/***/ }, 549 550/***/ "./node_modules/swiper/modules/pagination.mjs" 551/*!****************************************************!*\ 552 !*** ./node_modules/swiper/modules/pagination.mjs ***! 553 \****************************************************/ 554(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 555 556"use strict"; 557eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Pagination)\n/* harmony export */ });\n/* harmony import */ var _shared_classes_to_selector_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/classes-to-selector.mjs */ \"./node_modules/swiper/shared/classes-to-selector.mjs\");\n/* harmony import */ var _shared_create_element_if_not_defined_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/create-element-if-not-defined.mjs */ \"./node_modules/swiper/shared/create-element-if-not-defined.mjs\");\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\n\n\nfunction Pagination(_ref) {\n let {\n swiper,\n extendParams,\n on,\n emit\n } = _ref;\n const pfx = 'swiper-pagination';\n extendParams({\n pagination: {\n el: null,\n bulletElement: 'span',\n clickable: false,\n hideOnClick: false,\n renderBullet: null,\n renderProgressbar: null,\n renderFraction: null,\n renderCustom: null,\n progressbarOpposite: false,\n type: 'bullets',\n // 'bullets' or 'progressbar' or 'fraction' or 'custom'\n dynamicBullets: false,\n dynamicMainBullets: 1,\n formatFractionCurrent: number => number,\n formatFractionTotal: number => number,\n bulletClass: `${pfx}-bullet`,\n bulletActiveClass: `${pfx}-bullet-active`,\n modifierClass: `${pfx}-`,\n currentClass: `${pfx}-current`,\n totalClass: `${pfx}-total`,\n hiddenClass: `${pfx}-hidden`,\n progressbarFillClass: `${pfx}-progressbar-fill`,\n progressbarOppositeClass: `${pfx}-progressbar-opposite`,\n clickableClass: `${pfx}-clickable`,\n lockClass: `${pfx}-lock`,\n horizontalClass: `${pfx}-horizontal`,\n verticalClass: `${pfx}-vertical`,\n paginationDisabledClass: `${pfx}-disabled`\n }\n });\n swiper.pagination = {\n el: null,\n bullets: []\n };\n let bulletSize;\n let dynamicBulletIndex = 0;\n const makeElementsArray = el => (Array.isArray(el) ? el : [el]).filter(e => !!e);\n function isPaginationDisabled() {\n return !swiper.params.pagination.el || !swiper.pagination.el || Array.isArray(swiper.pagination.el) && swiper.pagination.el.length === 0;\n }\n function setSideBullets(bulletEl, position) {\n const {\n bulletActiveClass\n } = swiper.params.pagination;\n if (!bulletEl) return;\n bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`];\n if (bulletEl) {\n bulletEl.classList.add(`${bulletActiveClass}-${position}`);\n bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`];\n if (bulletEl) {\n bulletEl.classList.add(`${bulletActiveClass}-${position}-${position}`);\n }\n }\n }\n function onBulletClick(e) {\n const bulletEl = e.target.closest((0,_shared_classes_to_selector_mjs__WEBPACK_IMPORTED_MODULE_0__.c)(swiper.params.pagination.bulletClass));\n if (!bulletEl) {\n return;\n }\n e.preventDefault();\n const index = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.g)(bulletEl) * swiper.params.slidesPerGroup;\n if (swiper.params.loop) {\n if (swiper.realIndex === index) return;\n const realIndex = swiper.realIndex;\n const newSlideIndex = swiper.getSlideIndexByData(index);\n const currentSlideIndex = swiper.getSlideIndexByData(swiper.realIndex);\n const loopFix = dir => {\n const indexBeforeLoopFix = swiper.activeIndex;\n swiper.loopFix({\n direction: dir,\n activeSlideIndex: newSlideIndex,\n slideTo: false\n });\n const indexAfterFix = swiper.activeIndex;\n if (indexBeforeLoopFix === indexAfterFix) {\n swiper.slideToLoop(realIndex, 0, false, true);\n }\n };\n if (newSlideIndex > swiper.slides.length - swiper.loopedSlides) {\n loopFix(newSlideIndex > currentSlideIndex ? 'next' : 'prev');\n } else if (swiper.params.centeredSlides) {\n const slidesPerView = swiper.params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(swiper.params.slidesPerView, 10));\n if (newSlideIndex < Math.floor(slidesPerView / 2)) {\n loopFix('prev');\n }\n }\n swiper.slideToLoop(index);\n } else {\n swiper.slideTo(index);\n }\n }
557\n function update() {\n // Render || Update Pagination bullets/items\n const rtl = swiper.rtl;\n const params = swiper.params.pagination;\n if (isPaginationDisabled()) return;\n let el = swiper.pagination.el;\n el = makeElementsArray(el);\n // Current/Total\n let current;\n let previousIndex;\n const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;\n const total = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length;\n if (swiper.params.loop) {\n previousIndex = swiper.previousRealIndex || 0;\n current = swiper.params.slidesPerGroup > 1 ? Math.floor(swiper.realIndex / swiper.params.slidesPerGroup) : swiper.realIndex;\n } else if (typeof swiper.snapIndex !== 'undefined') {\n current = swiper.snapIndex;\n previousIndex = swiper.previousSnapIndex;\n } else {\n previousIndex = swiper.previousIndex || 0;\n current = swiper.activeIndex || 0;\n }\n // Types\n if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) {\n const bullets = swiper.pagination.bullets;\n let firstIndex;\n let lastIndex;\n let midIndex;\n if (params.dynamicBullets) {\n bulletSize = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.f)(bullets[0], swiper.isHorizontal() ? 'width' : 'height', true);\n el.forEach(subEl => {\n subEl.style[swiper.isHorizontal() ? 'width' : 'height'] = `${bulletSize * (params.dynamicMainBullets + 4)}px`;\n });\n if (params.dynamicMainBullets > 1 && previousIndex !== undefined) {\n dynamicBulletIndex += current - (previousIndex || 0);\n if (dynamicBulletIndex > params.dynamicMainBullets - 1) {\n dynamicBulletIndex = params.dynamicMainBullets - 1;\n } else if (dynamicBulletIndex < 0) {\n dynamicBulletIndex = 0;\n }\n }\n firstIndex = Math.max(current - dynamicBulletIndex, 0);\n lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1);\n midIndex = (lastIndex + firstIndex) / 2;\n }\n bullets.forEach(bulletEl => {\n const classesToRemove = [...['', '-next', '-next-next', '-prev', '-prev-prev', '-main'].map(suffix => `${params.bulletActiveClass}${suffix}`)].map(s => typeof s === 'string' && s.includes(' ') ? s.split(' ') : s).flat();\n bulletEl.classList.remove(...classesToRemove);\n });\n if (el.length > 1) {\n bullets.forEach(bullet => {\n const bulletIndex = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.g)(bullet);\n if (bulletIndex === current) {\n bullet.classList.add(...params.bulletActiveClass.split(' '));\n } else if (swiper.isElement) {\n bullet.setAttribute('part', 'bullet');\n }\n if (params.dynamicBullets) {\n if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) {\n bullet.classList.add(...`${params.bulletActiveClass}-main`.split(' '));\n }\n if (bulletIndex === firstIndex) {\n setSideBullets(bullet, 'prev');\n }\n if (bulletIndex === lastIndex) {\n setSideBullets(bullet, 'next');\n }\n }\n });\n } else {\n const bullet = bullets[current];\n if (bullet) {\n bullet.classList.add(...params.bulletActiveClass.split(' '));\n }\n if (swiper.isElement) {\n bullets.forEach((bulletEl, bulletIndex) => {\n bulletEl.setAttribute('part', bulletIndex === current ? 'bullet-active' : 'bullet');\n });\n }\n if (params.dynamicBullets) {\n const firstDisplayedBullet = bullets[firstIndex];\n const lastDisplayedBullet = bullets[lastIndex];\n for (let i = firstIndex; i <= lastIndex; i += 1) {\n if (bullets[i]) {\n bullets[i].classList.add(...`${params.bulletActiveClass}-main`.split(' '));\n }\n }\n setSideBullets(firstDisplayedBullet, 'prev');\n setSideBullets(lastDisplayedBullet, 'next');\n }\n }\n if (params.dynamicBullets) {\n const dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4);\n const bulletsOffset = (bulletSize * dynamicBulletsLength - bulletSize) / 2 - midIndex * bulletSize;\n const offsetProp = rtl ? 'right' : 'left';
557\n bullets.forEach(bullet => {\n bullet.style[swiper.isHorizontal() ? offsetProp : 'top'] = `${bulletsOffset}px`;\n });\n }\n }\n el.forEach((subEl, subElIndex) => {\n if (params.type === 'fraction') {\n subEl.querySelectorAll((0,_shared_classes_to_selector_mjs__WEBPACK_IMPORTED_MODULE_0__.c)(params.currentClass)).forEach(fractionEl => {\n fractionEl.textContent = params.formatFractionCurrent(current + 1);\n });\n subEl.querySelectorAll((0,_shared_classes_to_selector_mjs__WEBPACK_IMPORTED_MODULE_0__.c)(params.totalClass)).forEach(totalEl => {\n totalEl.textContent = params.formatFractionTotal(total);\n });\n }\n if (params.type === 'progressbar') {\n let progressbarDirection;\n if (params.progressbarOpposite) {\n progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal';\n } else {\n progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical';\n }\n const scale = (current + 1) / total;\n let scaleX = 1;\n let scaleY = 1;\n if (progressbarDirection === 'horizontal') {\n scaleX = scale;\n } else {\n scaleY = scale;\n }\n subEl.querySelectorAll((0,_shared_classes_to_selector_mjs__WEBPACK_IMPORTED_MODULE_0__.c)(params.progressbarFillClass)).forEach(progressEl => {\n progressEl.style.transform = `translate3d(0,0,0) scaleX(${scaleX}) scaleY(${scaleY})`;\n progressEl.style.transitionDuration = `${swiper.params.speed}ms`;\n });\n }\n if (params.type === 'custom' && params.renderCustom) {\n subEl.innerHTML = params.renderCustom(swiper, current + 1, total);\n if (subElIndex === 0) emit('paginationRender', subEl);\n } else {\n if (subElIndex === 0) emit('paginationRender', subEl);\n emit('paginationUpdate', subEl);\n }\n if (swiper.params.watchOverflow && swiper.enabled) {\n subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);\n }\n });\n }\n function render() {\n // Render Container\n const params = swiper.params.pagination;\n if (isPaginationDisabled()) return;\n const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;\n let el = swiper.pagination.el;\n el = makeElementsArray(el);\n let paginationHTML = '';\n if (params.type === 'bullets') {\n let numberOfBullets = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length;\n if (swiper.params.freeMode && swiper.params.freeMode.enabled && numberOfBullets > slidesLength) {\n numberOfBullets = slidesLength;\n }\n for (let i = 0; i < numberOfBullets; i += 1) {\n if (params.renderBullet) {\n paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass);\n } else {\n // prettier-ignore\n paginationHTML += `<${params.bulletElement} ${swiper.isElement ? 'part=\"bullet\"' : ''} class=\"${params.bulletClass}\"></${params.bulletElement}>`;\n }\n }\n }\n if (params.type === 'fraction') {\n if (params.renderFraction) {\n paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass);\n } else {\n paginationHTML = `<span class=\"${params.currentClass}\"></span>` + ' / ' + `<span class=\"${params.totalClass}\"></span>`;\n }\n }\n if (params.type === 'progressbar') {\n if (params.renderProgressbar) {\n paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass);\n } else {\n paginationHTML = `<span class=\"${params.progressbarFillClass}\"></span>`;\n }\n }\n swiper.pagination.bullets = [];\n el.forEach(subEl => {\n if (params.type !== 'custom') {\n subEl.innerHTML = paginationHTML || '';\n }\n if (params.type === 'bullets') {\n swiper.pagination.bullets.push(...subEl.querySelectorAll((0,_shared_classes_to_selector_mjs__WEBPACK_IMPORTED_MODULE_0__.c)(params.bulletClass)));\n }\n });\n if (params.type !== 'custom') {\n emit('paginationRender', el[0]);\n }\n }
557\n function init() {\n swiper.params.pagination = (0,_shared_create_element_if_not_defined_mjs__WEBPACK_IMPORTED_MODULE_1__.c)(swiper, swiper.originalParams.pagination, swiper.params.pagination, {\n el: 'swiper-pagination'\n });\n const params = swiper.params.pagination;\n if (!params.el) return;\n let el;\n if (typeof params.el === 'string' && swiper.isElement) {\n el = swiper.el.querySelector(params.el);\n }\n if (!el && typeof params.el === 'string') {\n el = [...document.querySelectorAll(params.el)];\n }\n if (!el) {\n el = params.el;\n }\n if (!el || el.length === 0) return;\n if (swiper.params.uniqueNavElements && typeof params.el === 'string' && Array.isArray(el) && el.length > 1) {\n el = [...swiper.el.querySelectorAll(params.el)];\n // check if it belongs to another nested Swiper\n if (el.length > 1) {\n el = el.filter(subEl => {\n if ((0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.a)(subEl, '.swiper')[0] !== swiper.el) return false;\n return true;\n })[0];\n }\n }\n if (Array.isArray(el) && el.length === 1) el = el[0];\n Object.assign(swiper.pagination, {\n el\n });\n el = makeElementsArray(el);\n el.forEach(subEl => {\n if (params.type === 'bullets' && params.clickable) {\n subEl.classList.add(...(params.clickableClass || '').split(' '));\n }\n subEl.classList.add(params.modifierClass + params.type);\n subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);\n if (params.type === 'bullets' && params.dynamicBullets) {\n subEl.classList.add(`${params.modifierClass}${params.type}-dynamic`);\n dynamicBulletIndex = 0;\n if (params.dynamicMainBullets < 1) {\n params.dynamicMainBullets = 1;\n }\n }\n if (params.type === 'progressbar' && params.progressbarOpposite) {\n subEl.classList.add(params.progressbarOppositeClass);\n }\n if (params.clickable) {\n subEl.addEventListener('click', onBulletClick);\n }\n if (!swiper.enabled) {\n subEl.classList.add(params.lockClass);\n }\n });\n }\n function destroy() {\n const params = swiper.params.pagination;\n if (isPaginationDisabled()) return;\n let el = swiper.pagination.el;\n if (el) {\n el = makeElementsArray(el);\n el.forEach(subEl => {\n subEl.classList.remove(params.hiddenClass);\n subEl.classList.remove(params.modifierClass + params.type);\n subEl.classList.remove(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);\n if (params.clickable) {\n subEl.classList.remove(...(params.clickableClass || '').split(' '));\n subEl.removeEventListener('click', onBulletClick);\n }\n });\n }\n if (swiper.pagination.bullets) swiper.pagination.bullets.forEach(subEl => subEl.classList.remove(...params.bulletActiveClass.split(' ')));\n }\n on('changeDirection', () => {\n if (!swiper.pagination || !swiper.pagination.el) return;\n const params = swiper.params.pagination;\n let {\n el\n } = swiper.pagination;\n el = makeElementsArray(el);\n el.forEach(subEl => {\n subEl.classList.remove(params.horizontalClass, params.verticalClass);\n subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);\n });\n });\n on('init', () => {\n if (swiper.params.pagination.enabled === false) {\n // eslint-disable-next-line\n disable();\n } else {\n init();\n render();\n update();\n }\n });\n on('activeIndexChange', () => {\n if (typeof swiper.snapIndex === 'undefined') {\n update();\n }\n });\n on('snapIndexChange', () => {\n update();\n });\n on('snapGridLengthChange', () => {\n render();\n update();\n });\n on('destroy', () => {\n destroy();\n });\n on('enable disable', () => {\n let {\n el\n } = swiper.pagination;\n if (el) {\n el = makeElementsArray(el);\n el.forEach(subEl => subEl.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.pagination.lockClass));\n }\n });\n on('lock unlock', () => {\n update();\n });\n on('click', (_s, e) => {\n const targetEl = e.target;\n const el = makeElementsArray(swiper.pagination.el);\n if (swiper.params.pagination.el && swiper.params.pagination.hideOnClick && el && el.length > 0 && !targetEl.classList.contains(swiper.params.pagination.bulletClass)) {\n if (swiper.navigation && (swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl || swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl)) return;\n const isHidden = el[0].classList.contains(swiper.params.pagination.hiddenClass);\n if (isHidden === true) {\n emit('paginationShow');\n } else {\n emit('paginationHide');\n }\n el.forEach(subEl => subEl.classList.toggle(swiper.params.pagination.hiddenClass));\n }\n });\n const enable = () => {\n swiper.el.classList.remove(swiper.params.pagination.paginationDisabledClass);\n let {\n el\n } = swiper.pagination;\n if (el) {\n el = makeElementsArray(el);\n el.forEach(subEl => subEl.classList.remove(swiper.params.pagination.paginationDisabledClass));\n }\n init();\n render();\n update();\n };\n const disable = () => {\n swiper.el.classList.add(swiper.params.pagination.paginationDisabledClass);\n let {\n el\n } = swiper.pagination;\n if (el) {\n el = makeElementsArray(el);\n el.forEach(subEl => subEl.classList.add(swiper.params.pagination.paginationDisabledClass));\n }\n destroy();\n };\n Object.assign(swiper.pagination, {\n enable,\n disable,\n render,\n update,\n init,\n destroy\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/pagination.mjs?\n}"); 558 559/***/ }, 560 561/***/ "./node_modules/swiper/modules/parallax.mjs" 562/*!**************************************************!*\ 563 !*** ./node_modules/swiper/modules/parallax.mjs ***! 564 \**************************************************/ 565(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 566 567"use strict"; 568eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Parallax)\n/* harmony export */ });\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\nfunction Parallax(_ref) {\n let {\n swiper,\n extendParams,\n on\n } = _ref;\n extendParams({\n parallax: {\n enabled: false\n }\n });\n const elementsSelector = '[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]';\n const setTransform = (el, progress) =>
568 {\n const {\n rtl\n } = swiper;\n const rtlFactor = rtl ? -1 : 1;\n const p = el.getAttribute('data-swiper-parallax') || '0';\n let x = el.getAttribute('data-swiper-parallax-x');\n let y = el.getAttribute('data-swiper-parallax-y');\n const scale = el.getAttribute('data-swiper-parallax-scale');\n const opacity = el.getAttribute('data-swiper-parallax-opacity');\n const rotate = el.getAttribute('data-swiper-parallax-rotate');\n if (x || y) {\n x = x || '0';\n y = y || '0';\n } else if (swiper.isHorizontal()) {\n x = p;\n y = '0';\n } else {\n y = p;\n x = '0';\n }\n if (x.indexOf('%') >= 0) {\n x = `${parseInt(x, 10) * progress * rtlFactor}%`;\n } else {\n x = `${x * progress * rtlFactor}px`;\n }\n if (y.indexOf('%') >= 0) {\n y = `${parseInt(y, 10) * progress}%`;\n } else {\n y = `${y * progress}px`;\n }\n if (typeof opacity !== 'undefined' && opacity !== null) {\n const currentOpacity = opacity - (opacity - 1) * (1 - Math.abs(progress));\n el.style.opacity = currentOpacity;\n }\n let transform = `translate3d(${x}, ${y}, 0px)`;\n if (typeof scale !== 'undefined' && scale !== null) {\n const currentScale = scale - (scale - 1) * (1 - Math.abs(progress));\n transform += ` scale(${currentScale})`;\n }\n if (rotate && typeof rotate !== 'undefined' && rotate !== null) {\n const currentRotate = rotate * progress * -1;\n transform += ` rotate(${currentRotate}deg)`;\n }\n el.style.transform = transform;\n };\n const setTranslate = () => {\n const {\n el,\n slides,\n progress,\n snapGrid,\n isElement\n } = swiper;\n const elements = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.e)(el, elementsSelector);\n if (swiper.isElement) {\n elements.push(...(0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.e)(swiper.hostEl, elementsSelector));\n }\n elements.forEach(subEl => {\n setTransform(subEl, progress);\n });\n slides.forEach((slideEl, slideIndex) => {\n let slideProgress = slideEl.progress;\n if (swiper.params.slidesPerGroup > 1 && swiper.params.slidesPerView !== 'auto') {\n slideProgress += Math.ceil(slideIndex / 2) - progress * (snapGrid.length - 1);\n }\n slideProgress = Math.min(Math.max(slideProgress, -1), 1);\n slideEl.querySelectorAll(`${elementsSelector}, [data-swiper-parallax-rotate]`).forEach(subEl => {\n setTransform(subEl, slideProgress);\n });\n });\n };\n const setTransition = function (duration) {\n if (duration === void 0) {\n duration = swiper.params.speed;\n }\n const {\n el,\n hostEl\n } = swiper;\n const elements = [...el.querySelectorAll(elementsSelector)];\n if (swiper.isElement) {\n elements.push(...hostEl.querySelectorAll(elementsSelector));\n }\n elements.forEach(parallaxEl => {\n let parallaxDuration = parseInt(parallaxEl.getAttribute('data-swiper-parallax-duration'), 10) || duration;\n if (duration === 0) parallaxDuration = 0;\n parallaxEl.style.transitionDuration = `${parallaxDuration}ms`;\n });\n };\n on('beforeInit', () => {\n if (!swiper.params.parallax.enabled) return;\n swiper.params.watchSlidesProgress = true;\n swiper.originalParams.watchSlidesProgress = true;\n });\n on('init', () => {\n if (!swiper.params.parallax.enabled) return;\n setTranslate();\n });\n on('setTranslate', () => {\n if (!swiper.params.parallax.enabled) return;\n setTranslate();\n });\n on('setTransition', (_swiper, duration) => {\n if (!swiper.params.parallax.enabled) return;\n setTransition(duration);\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/parallax.mjs?\n}"); 569 570/***/ }, 571 572/***/ "./node_modules/swiper/modules/scrollbar.mjs" 573/*!***************************************************!*\ 574 !*** ./node_modules/swiper/modules/scrollbar.mjs ***! 575 \***************************************************/ 576(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 577 578"use strict"; 579eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Scrollbar)\n/* harmony export */ });\n/* harmony import */ var _shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/ssr-window.esm.mjs */ \"./node_modules/swiper/shared/ssr-window.esm.mjs\");\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n/* harmony import */ var _shared_create_element_if_not_defined_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/create-element-if-not-defined.mjs */ \"./node_modules/swiper/shared/create-element-if-not-defined.mjs\");\n\n\n\n\nfunction Scrollbar(_ref) {\n let {\n swiper,\n extendParams,\n on,\n emit\n } = _ref;\n const document = (0,_shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.g)();\n let isTouched = false;\n let timeout = null;\n let dragTimeout = null;\n let dragStartPos;\n let dragSize;\n let trackSize;\n let divider;\n extendParams({\n scrollbar: {\n el: null,\n dragSize: 'auto',\n hide: false,\n draggable: false,\n snapOnRelease: true,\n lockClass: 'swiper-scrollbar-lock',\n dragClass: 'swiper-scrollbar-drag',\n scrollbarDisabledClass: 'swiper-scrollbar-disabled',\n horizontalClass: `swiper-scrollbar-horizontal`,\n verticalClass: `swiper-scrollbar-vertical`\n }\n });\n swiper.scrollbar = {\n el: null,\n dragEl: null\n };\n function setTranslate() {\n if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;\n const {\n scrollbar,\n rtlTranslate: rtl\n } = swiper;\n const {\n dragEl,\n el\n } = scrollbar;\n const params = swiper.params.scrollbar;\n const progress = swiper.params.loop ? swiper.progressLoop : swiper.progress;\n let newSize = dragSize;\n let newPos = (trackSize - dragSize) * progress;\n if (rtl) {\n newPos = -newPos;\n if (newPos > 0) {\n newSize = dragSize - newPos;\n newPos = 0;\n } else if (-newPos + dragSize > trackSize) {\n newSize = trackSize + newPos;\n }\n } else if (newPos < 0) {\n newSize = dragSize + newPos;\n newPos = 0;\n } else if (newPos + dragSize > trackSize) {\n newSize = trackSize - newPos;\n }\n if (swiper.isHorizontal()) {\n dragEl.style.transform = `translate3d(${newPos}px, 0, 0)`;\n dragEl.style.width = `${newSize}px`;\n } else {\n dragEl.style.transform = `translate3d(0px, ${newPos}px, 0)`;\n dragEl.style.height = `${newSize}px`;\n }\n if (params.hide) {\n clearTimeout(timeout);\n el.style.opacity = 1;\n timeout = setTimeout(() =>
579 {\n el.style.opacity = 0;\n el.style.transitionDuration = '400ms';\n }, 1000);\n }\n }\n function setTransition(duration) {\n if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;\n swiper.scrollbar.dragEl.style.transitionDuration = `${duration}ms`;\n }\n function updateSize() {\n if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;\n const {\n scrollbar\n } = swiper;\n const {\n dragEl,\n el\n } = scrollbar;\n dragEl.style.width = '';\n dragEl.style.height = '';\n trackSize = swiper.isHorizontal() ? el.offsetWidth : el.offsetHeight;\n divider = swiper.size / (swiper.virtualSize + swiper.params.slidesOffsetBefore - (swiper.params.centeredSlides ? swiper.snapGrid[0] : 0));\n if (swiper.params.scrollbar.dragSize === 'auto') {\n dragSize = trackSize * divider;\n } else {\n dragSize = parseInt(swiper.params.scrollbar.dragSize, 10);\n }\n if (swiper.isHorizontal()) {\n dragEl.style.width = `${dragSize}px`;\n } else {\n dragEl.style.height = `${dragSize}px`;\n }\n if (divider >= 1) {\n el.style.display = 'none';\n } else {\n el.style.display = '';\n }\n if (swiper.params.scrollbar.hide) {\n el.style.opacity = 0;\n }\n if (swiper.params.watchOverflow && swiper.enabled) {\n scrollbar.el.classList[swiper.isLocked ? 'add' : 'remove'](swiper.params.scrollbar.lockClass);\n }\n }\n function getPointerPosition(e) {\n return swiper.isHorizontal() ? e.clientX : e.clientY;\n }\n function setDragPosition(e) {\n const {\n scrollbar,\n rtlTranslate: rtl\n } = swiper;\n const {\n el\n } = scrollbar;\n let positionRatio;\n positionRatio = (getPointerPosition(e) - (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(el)[swiper.isHorizontal() ? 'left' : 'top'] - (dragStartPos !== null ? dragStartPos : dragSize / 2)) / (trackSize - dragSize);\n positionRatio = Math.max(Math.min(positionRatio, 1), 0);\n if (rtl) {\n positionRatio = 1 - positionRatio;\n }\n const position = swiper.minTranslate() + (swiper.maxTranslate() - swiper.minTranslate()) * positionRatio;\n swiper.updateProgress(position);\n swiper.setTranslate(position);\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n }\n function onDragStart(e) {\n const params = swiper.params.scrollbar;\n const {\n scrollbar,\n wrapperEl\n } = swiper;\n const {\n el,\n dragEl\n } = scrollbar;\n isTouched = true;\n dragStartPos = e.target === dragEl ? getPointerPosition(e) - e.target.getBoundingClientRect()[swiper.isHorizontal() ? 'left' : 'top'] : null;\n e.preventDefault();\n e.stopPropagation();\n wrapperEl.style.transitionDuration = '100ms';\n dragEl.style.transitionDuration = '100ms';\n setDragPosition(e);\n clearTimeout(dragTimeout);\n el.style.transitionDuration = '0ms';\n if (params.hide) {\n el.style.opacity = 1;\n }\n if (swiper.params.cssMode) {\n swiper.wrapperEl.style['scroll-snap-type'] = 'none';\n }\n emit('scrollbarDragStart', e);\n }\n function onDragMove(e) {\n const {\n scrollbar,\n wrapperEl\n } = swiper;\n const {\n el,\n dragEl\n } = scrollbar;\n if (!isTouched) return;\n if (e.preventDefault) e.preventDefault();else e.returnValue = false;\n setDragPosition(e);\n wrapperEl.style.transitionDuration = '0ms';\n el.style.transitionDuration = '0ms';\n dragEl.style.transitionDuration = '0ms';\n emit('scrollbarDragMove', e);\n }\n function onDragEnd(e) {\n const params = swiper.params.scrollbar;\n const {\n scrollbar,\n wrapperEl\n } = swiper;\n const {\n el\n } = scrollbar;\n if (!isTouched) return;\n isTouched = false;\n if (swiper.params.cssMode) {\n swiper.wrapperEl.style['scroll-snap-type'] = '';\n wrapperEl.style.transitionDuration = '';\n }\n if (params.hide) {\n clearTimeout(dragTimeout);\n dragTimeout = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.n)(() =>
579 {\n el.style.opacity = 0;\n el.style.transitionDuration = '400ms';\n }, 1000);\n }\n emit('scrollbarDragEnd', e);\n if (params.snapOnRelease) {\n swiper.slideToClosest();\n }\n }\n function events(method) {\n const {\n scrollbar,\n params\n } = swiper;\n const el = scrollbar.el;\n if (!el) return;\n const target = el;\n const activeListener = params.passiveListeners ? {\n passive: false,\n capture: false\n } : false;\n const passiveListener = params.passiveListeners ? {\n passive: true,\n capture: false\n } : false;\n if (!target) return;\n const eventMethod = method === 'on' ? 'addEventListener' : 'removeEventListener';\n target[eventMethod]('pointerdown', onDragStart, activeListener);\n document[eventMethod]('pointermove', onDragMove, activeListener);\n document[eventMethod]('pointerup', onDragEnd, passiveListener);\n }\n function enableDraggable() {\n if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;\n events('on');\n }\n function disableDraggable() {\n if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;\n events('off');\n }\n function init() {\n const {\n scrollbar,\n el: swiperEl\n } = swiper;\n swiper.params.scrollbar = (0,_shared_create_element_if_not_defined_mjs__WEBPACK_IMPORTED_MODULE_2__.c)(swiper, swiper.originalParams.scrollbar, swiper.params.scrollbar, {\n el: 'swiper-scrollbar'\n });\n const params = swiper.params.scrollbar;\n if (!params.el) return;\n let el;\n if (typeof params.el === 'string' && swiper.isElement) {\n el = swiper.el.querySelector(params.el);\n }\n if (!el && typeof params.el === 'string') {\n el = document.querySelectorAll(params.el);\n } else if (!el) {\n el = params.el;\n }\n if (swiper.params.uniqueNavElements && typeof params.el === 'string' && el.length > 1 && swiperEl.querySelectorAll(params.el).length === 1) {\n el = swiperEl.querySelector(params.el);\n }\n if (el.length > 0) el = el[0];\n el.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);\n let dragEl;\n if (el) {\n dragEl = el.querySelector(`.${swiper.params.scrollbar.dragClass}`);\n if (!dragEl) {\n dragEl = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.c)('div', swiper.params.scrollbar.dragClass);\n el.append(dragEl);\n }\n }\n Object.assign(scrollbar, {\n el,\n dragEl\n });\n if (params.draggable) {\n enableDraggable();\n }\n if (el) {\n el.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.scrollbar.lockClass);\n }\n }\n function destroy() {\n const params = swiper.params.scrollbar;\n const el = swiper.scrollbar.el;\n if (el) {\n el.classList.remove(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);\n }\n disableDraggable();\n }\n on('init', () => {\n if (swiper.params.scrollbar.enabled === false) {\n // eslint-disable-next-line\n disable();\n } else {\n init();\n updateSize();\n setTranslate();\n }\n });\n on('update resize observerUpdate lock unlock', () => {\n updateSize();\n });\n on('setTranslate', () => {\n setTranslate();\n });\n on('setTransition', (_s, duration) => {\n setTransition(duration);\n });\n on('enable disable', () => {\n const {\n el\n } = swiper.scrollbar;\n if (el) {\n el.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.scrollbar.lockClass);\n }\n });\n on('destroy', () => {\n destroy();\n });\n const enable = () => {\n swiper.el.classList.remove(swiper.params.scrollbar.scrollbarDisabledClass);\n if (swiper.scrollbar.el) {\n swiper.scrollbar.el.classList.remove(swiper.params.scrollbar.scrollbarDisabledClass);\n }\n init();\n updateSize();\n setTranslate();\n };\n const disable = () => {\n swiper.el.classList.add(swiper.params.scrollbar.scrollbarDisabledClass);\n if (swiper.scrollbar.el) {\n swiper.scrollbar.el.classList.add(swiper.params.scrollbar.scrollbarDisabledClass);\n }\n destroy();\n };\n Object.assign(swiper.scrollbar, {\n enable,\n disable,\n updateSize,\n setTranslate,\n init,\n destroy\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/scrollbar.mjs?\n}"); 580 581/***/ }, 582 583/***/ "./node_modules/swiper/modules/thumbs.mjs" 584/*!************************************************!*\ 585 !*** ./node_modules/swiper/modules/thumbs.mjs ***! 586 \************************************************/ 587(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 588 589"use strict"; 590eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Thumb)\n/* harmony export */ });\n/* harmony import */ var _shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/ssr-window.esm.mjs */ \"./node_modules/swiper/shared/ssr-window.esm.mjs\");\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\n\nfunction Thumb(_ref) {\n let {\n swiper,\n extendParams,\n on\n } = _ref;\n extendParams({\n thumbs: {\n swiper: null,\n multipleActiveThumbs: true,\n autoScrollOffset: 0,\n slideThumbActiveClass: 'swiper-slide-thumb-active',\n thumbsContainerClass: 'swiper-thumbs'\n }\n });\n let initialized = false;\n let swiperCreated = false;\n swiper.thumbs = {\n swiper: null\n };
590\n function onThumbClick() {\n const thumbsSwiper = swiper.thumbs.swiper;\n if (!thumbsSwiper || thumbsSwiper.destroyed) return;\n const clickedIndex = thumbsSwiper.clickedIndex;\n const clickedSlide = thumbsSwiper.clickedSlide;\n if (clickedSlide && clickedSlide.classList.contains(swiper.params.thumbs.slideThumbActiveClass)) return;\n if (typeof clickedIndex === 'undefined' || clickedIndex === null) return;\n let slideToIndex;\n if (thumbsSwiper.params.loop) {\n slideToIndex = parseInt(thumbsSwiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10);\n } else {\n slideToIndex = clickedIndex;\n }\n if (swiper.params.loop) {\n swiper.slideToLoop(slideToIndex);\n } else {\n swiper.slideTo(slideToIndex);\n }\n }\n function init() {\n const {\n thumbs: thumbsParams\n } = swiper.params;\n if (initialized) return false;\n initialized = true;\n const SwiperClass = swiper.constructor;\n if (thumbsParams.swiper instanceof SwiperClass) {\n swiper.thumbs.swiper = thumbsParams.swiper;\n Object.assign(swiper.thumbs.swiper.originalParams, {\n watchSlidesProgress: true,\n slideToClickedSlide: false\n });\n Object.assign(swiper.thumbs.swiper.params, {\n watchSlidesProgress: true,\n slideToClickedSlide: false\n });\n swiper.thumbs.swiper.update();\n } else if ((0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.j)(thumbsParams.swiper)) {\n const thumbsSwiperParams = Object.assign({}, thumbsParams.swiper);\n Object.assign(thumbsSwiperParams, {\n watchSlidesProgress: true,\n slideToClickedSlide: false\n });\n swiper.thumbs.swiper = new SwiperClass(thumbsSwiperParams);\n swiperCreated = true;\n }\n swiper.thumbs.swiper.el.classList.add(swiper.params.thumbs.thumbsContainerClass);\n swiper.thumbs.swiper.on('tap', onThumbClick);\n return true;\n }\n function update(initial) {\n const thumbsSwiper = swiper.thumbs.swiper;\n if (!thumbsSwiper || thumbsSwiper.destroyed) return;\n const slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView;\n\n // Activate thumbs\n let thumbsToActivate = 1;\n const thumbActiveClass = swiper.params.thumbs.slideThumbActiveClass;\n if (swiper.params.slidesPerView > 1 && !swiper.params.centeredSlides) {\n thumbsToActivate = swiper.params.slidesPerView;\n }\n if (!swiper.params.thumbs.multipleActiveThumbs) {\n thumbsToActivate = 1;\n }\n thumbsToActivate = Math.floor(thumbsToActivate);
590\n thumbsSwiper.slides.forEach(slideEl => slideEl.classList.remove(thumbActiveClass));\n if (thumbsSwiper.params.loop || thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled) {\n for (let i = 0; i < thumbsToActivate; i += 1) {\n (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.e)(thumbsSwiper.slidesEl, `[data-swiper-slide-index=\"${swiper.realIndex + i}\"]`).forEach(slideEl => {\n slideEl.classList.add(thumbActiveClass);\n });\n }\n } else {\n for (let i = 0; i < thumbsToActivate; i += 1) {\n if (thumbsSwiper.slides[swiper.realIndex + i]) {\n thumbsSwiper.slides[swiper.realIndex + i].classList.add(thumbActiveClass);\n }\n }\n }\n const autoScrollOffset = swiper.params.thumbs.autoScrollOffset;\n const useOffset = autoScrollOffset && !thumbsSwiper.params.loop;\n if (swiper.realIndex !== thumbsSwiper.realIndex || useOffset) {\n const currentThumbsIndex = thumbsSwiper.activeIndex;\n let newThumbsIndex;\n let direction;\n if (thumbsSwiper.params.loop) {\n const newThumbsSlide = thumbsSwiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') === `${swiper.realIndex}`)[0];\n newThumbsIndex = thumbsSwiper.slides.indexOf(newThumbsSlide);\n direction = swiper.activeIndex > swiper.previousIndex ? 'next' : 'prev';\n } else {\n newThumbsIndex = swiper.realIndex;\n direction = newThumbsIndex > swiper.previousIndex ? 'next' : 'prev';\n }\n if (useOffset) {\n newThumbsIndex += direction === 'next' ? autoScrollOffset : -1 * autoScrollOffset;\n }\n if (thumbsSwiper.visibleSlidesIndexes && thumbsSwiper.visibleSlidesIndexes.indexOf(newThumbsIndex) < 0) {\n if (thumbsSwiper.params.centeredSlides) {\n if (newThumbsIndex > currentThumbsIndex) {\n newThumbsIndex = newThumbsIndex - Math.floor(slidesPerView / 2) + 1;\n } else {\n newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1;\n }\n } else if (newThumbsIndex > currentThumbsIndex && thumbsSwiper.params.slidesPerGroup === 1) ;\n thumbsSwiper.slideTo(newThumbsIndex, initial ? 0 : undefined);\n }\n }\n }\n on('beforeInit', () => {\n const {\n thumbs\n } = swiper.params;\n if (!thumbs || !thumbs.swiper) return;\n if (typeof thumbs.swiper === 'string' || thumbs.swiper instanceof HTMLElement) {\n const document = (0,_shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.g)();\n const getThumbsElementAndInit = () => {\n const thumbsElement = typeof thumbs.swiper === 'string' ? document.querySelector(thumbs.swiper) : thumbs.swiper;\n if (thumbsElement && thumbsElement.swiper) {\n thumbs.swiper = thumbsElement.swiper;\n init();\n update(true);\n } else if (thumbsElement) {\n const onThumbsSwiper = e => {\n thumbs.swiper = e.detail[0];\n thumbsElement.removeEventListener('init', onThumbsSwiper);\n init();\n update(true);\n thumbs.swiper.update();\n swiper.update();\n };\n thumbsElement.addEventListener('init', onThumbsSwiper);\n }\n return thumbsElement;\n };\n const watchForThumbsToAppear = () => {\n if (swiper.destroyed) return;\n const thumbsElement = getThumbsElementAndInit();\n if (!thumbsElement) {\n requestAnimationFrame(watchForThumbsToAppear);\n }\n };\n requestAnimationFrame(watchForThumbsToAppear);\n } else {\n init();\n update(true);\n }\n });\n on('slideChange update resize observerUpdate', () => {\n update();\n });\n on('setTransition', (_s, duration) => {\n const thumbsSwiper = swiper.thumbs.swiper;\n if (!thumbsSwiper || thumbsSwiper.destroyed) return;\n thumbsSwiper.setTransition(duration);\n });\n on('beforeDestroy', () => {\n const thumbsSwiper = swiper.thumbs.swiper;\n if (!thumbsSwiper || thumbsSwiper.destroyed) return;\n if (swiperCreated) {\n thumbsSwiper.destroy();\n }\n });\n Object.assign(swiper.thumbs, {\n init,\n update\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/thumbs.mjs?\n}"); 591 592/***/ }, 593 594/***/ "./node_modules/swiper/modules/virtual.mjs" 595/*!*************************************************!*\ 596 !*** ./node_modules/swiper/modules/virtual.mjs ***! 597 \*************************************************/ 598(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 599 600"use strict"; 601eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Virtual)\n/* harmony export */ });\n/* harmony import */ var _shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/ssr-window.esm.mjs */ \"./node_modules/swiper/shared/ssr-window.esm.mjs\");\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\n\nfunction Virtual(_ref) {\n let {\n swiper,\n extendParams,\n on,\n emit\n } = _ref;\n extendParams({\n virtual: {\n enabled: false,\n slides: [],\n cache: true,\n renderSlide: null,\n renderExternal: null,\n renderExternalUpdate: true,\n addSlidesBefore: 0,\n addSlidesAfter: 0\n }\n });\n let cssModeTimeout;\n const document = (0,_shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.g)();\n swiper.virtual = {\n cache: {},\n from: undefined,\n to: undefined,\n slides: [],\n offset: 0,\n slidesGrid: []\n };\n const tempDOM = document.createElement('div');
601\n function renderSlide(slide, index) {\n const params = swiper.params.virtual;\n if (params.cache && swiper.virtual.cache[index]) {\n return swiper.virtual.cache[index];\n }\n // eslint-disable-next-line\n let slideEl;\n if (params.renderSlide) {\n slideEl = params.renderSlide.call(swiper, slide, index);\n if (typeof slideEl === 'string') {\n tempDOM.innerHTML = slideEl;\n slideEl = tempDOM.children[0];\n }\n } else if (swiper.isElement) {\n slideEl = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.c)('swiper-slide');\n } else {\n slideEl = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.c)('div', swiper.params.slideClass);\n }\n slideEl.setAttribute('data-swiper-slide-index', index);\n if (!params.renderSlide) {\n slideEl.innerHTML = slide;\n }\n if (params.cache) {\n swiper.virtual.cache[index] = slideEl;\n }\n return slideEl;\n }\n function update(force) {\n const {\n slidesPerView,\n slidesPerGroup,\n centeredSlides,\n loop: isLoop\n } = swiper.params;\n const {\n addSlidesBefore,\n addSlidesAfter\n } = swiper.params.virtual;\n const {\n from: previousFrom,\n to: previousTo,\n slides,\n slidesGrid: previousSlidesGrid,\n offset: previousOffset\n } = swiper.virtual;\n if (!swiper.params.cssMode) {\n swiper.updateActiveIndex();\n }\n const activeIndex = swiper.activeIndex || 0;\n let offsetProp;\n if (swiper.rtlTranslate) offsetProp = 'right';else offsetProp = swiper.isHorizontal() ? 'left' : 'top';\n let slidesAfter;\n let slidesBefore;\n if (centeredSlides) {\n slidesAfter = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesAfter;\n slidesBefore = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesBefore;\n } else {\n slidesAfter = slidesPerView + (slidesPerGroup - 1) + addSlidesAfter;\n slidesBefore = (isLoop ? slidesPerView : slidesPerGroup) + addSlidesBefore;\n }\n let from = activeIndex - slidesBefore;\n let to = activeIndex + slidesAfter;\n if (!isLoop) {\n from = Math.max(from, 0);\n to = Math.min(to, slides.length - 1);\n }\n let offset = (swiper.slidesGrid[from] || 0) - (swiper.slidesGrid[0] || 0);\n if (isLoop && activeIndex >= slidesBefore) {\n from -= slidesBefore;\n if (!centeredSlides) offset += swiper.slidesGrid[0];\n } else if (isLoop && activeIndex < slidesBefore) {\n from = -slidesBefore;\n if (centeredSlides) offset += swiper.slidesGrid[0];\n }\n Object.assign(swiper.virtual, {\n from,\n to,\n offset,\n slidesGrid: swiper.slidesGrid,\n slidesBefore,\n slidesAfter\n });\n function onRendered() {\n swiper.updateSlides();\n swiper.updateProgress();\n swiper.updateSlidesClasses();\n emit('virtualUpdate');\n }\n if (previousFrom === from && previousTo === to && !force) {\n if (swiper.slidesGrid !== previousSlidesGrid && offset !== previousOffset) {\n swiper.slides.forEach(sli
601deEl => {\n slideEl.style[offsetProp] = `${offset - Math.abs(swiper.cssOverflowAdjustment())}px`;\n });\n }\n swiper.updateProgress();\n emit('virtualUpdate');\n return;\n }\n if (swiper.params.virtual.renderExternal) {\n swiper.params.virtual.renderExternal.call(swiper, {\n offset,\n from,\n to,\n slides: function getSlides() {\n const slidesToRender = [];\n for (let i = from; i <= to; i += 1) {\n slidesToRender.push(slides[i]);\n }\n return slidesToRender;\n }()\n });\n if (swiper.params.virtual.renderExternalUpdate) {\n onRendered();\n } else {\n emit('virtualUpdate');\n }\n return;\n }\n const prependIndexes = [];\n const appendIndexes = [];\n const getSlideIndex = index => {\n let slideIndex = index;\n if (index < 0) {\n slideIndex = slides.length + index;\n } else if (slideIndex >= slides.length) {\n // eslint-disable-next-line\n slideIndex = slideIndex - slides.length;\n }\n return slideIndex;\n };\n if (force) {\n swiper.slides.filter(el => el.matches(`.${swiper.params.slideClass}
601, swiper-slide`)).forEach(slideEl => {\n slideEl.remove();\n });\n } else {\n for (let i = previousFrom; i <= previousTo; i += 1) {\n if (i < from || i > to) {\n const slideIndex = getSlideIndex(i);\n swiper.slides.filter(el => el.matches(`.${swiper.params.slideClass}[data-swiper-slide-index=\"${slideIndex}\"], swiper-slide[data-swiper-slide-index=\"${slideIndex}\"]`)).forEach(slideEl => {\n slideEl.remove();\n });\n }\n }\n }\n const loopFrom = isLoop ? -slides.length : 0;\n const loopTo = isLoop ? slides.length * 2 : slides.length;\n for (let i = loopFrom; i < loopTo; i += 1) {\n if (i >= from && i <= to) {\n const slideIndex = getSlideIndex(i);\n if (typeof previousTo === 'undefined' || force) {\n appendIndexes.push(slideIndex);\n } else {\n if (i > previousTo) appendIndexes.push(slideIndex);\n if (i < previousFrom) prependIndexes.push(slideIndex);\n }\n }\n }\n appendIndexes.forEach(index => {\n swiper.slidesEl.append(renderSlide(slides[index], index));\n });\n if (isLoop) {\n for (let i = prependIndexes.length - 1; i >= 0; i -= 1) {\n const index = prependIndexes[i];\n swiper.slidesEl.prepend(renderSlide(slides[index], index));\n }\n } else {\n prependIndexes.sort((a, b) => b - a);\n prependIndexes.forEach(index => {\n swiper.slidesEl.prepend(renderSlide(slides[index], index));\n });\n }\n ;(0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.e)(swiper.slidesEl, '.swiper-slide, swiper-slide').forEach(sli
601deEl => {\n slideEl.style[offsetProp] = `${offset - Math.abs(swiper.cssOverflowAdjustment())}px`;\n });\n onRendered();\n }\n function appendSlide(slides) {\n if (typeof slides === 'object' && 'length' in slides) {\n for (let i = 0; i < slides.length; i += 1) {\n if (slides[i]) swiper.virtual.slides.push(slides[i]);\n }\n } else {\n swiper.virtual.slides.push(slides);\n }\n update(true);\n }\n function prependSlide(slides) {\n const activeIndex = swiper.activeIndex;\n let newActiveIndex = activeIndex + 1;\n let numberOfNewSlides = 1;\n if (Array.isArray(slides)) {\n for (let i = 0; i < slides.length; i += 1) {\n if (slides[i]) swiper.virtual.slides.unshift(slides[i]);\n }\n newActiveIndex = activeIndex + slides.length;\n numberOfNewSlides = slides.length;\n } else {\n swiper.virtual.slides.unshift(slides);\n }\n if (swiper.params.virtual.cache) {\n const cache = swiper.virtual.cache;\n const newCache = {};\n Object.keys(cache).forEach(cachedIndex => {\n const cachedEl = cache[cachedIndex];\n const cachedElIndex = cachedEl.getAttribute('data-swiper-slide-index');\n if (cachedElIndex) {\n cachedEl.setAttribute('data-swiper-slide-index', parseInt(cachedElIndex, 10) + numberOfNewSlides);\n }\n newCache[parseInt(cachedIndex, 10) + numberOfNewSlides] = cachedEl;\n });\n swiper.virtual.cache = newCache;\n }\n update(true);\n swiper.slideTo(newActiveIndex, 0);\n }\n function removeSlide(slidesIndexes) {\n if (typeof slidesIndexes === 'undefined' || slidesIndexes === null) return;\n let activeIndex = swiper.activeIndex;\n if (Array.isArray(slidesIndexes)) {\n for (let i = slidesIndexes.length - 1; i >= 0; i -= 1) {\n if (swiper.params.virtual.cache) {\n delete swiper.virtual.cache[slidesIndexes[i]];\n // shift cache indexes\n Object.keys(swiper.virtual.cache).forEach(key => {\n if (key > slidesIndexes) {\n swiper.virtual.cache[key - 1] = swiper.virtual.cache[key];\n swiper.virtual.cache[key - 1].setAttribute('data-swiper-slide-index', key - 1);\n delete swiper.virtual.cache[key];\n }\n });\n }\n swiper.virtual.slides.splice(slidesIndexes[i], 1);\n if (slidesIndexes[i] < activeIndex) activeIndex -= 1;\n activeIndex = Math.max(activeIndex, 0);\n }\n } else {\n if (swiper.params.virtual.cache) {\n delete swiper.virtual.cache[slidesIndexes];\n // shift cache indexes\n Object.keys(swiper.virtual.cache).forEach(key => {\n if (key > slidesIndexes) {\n swiper.virtual.cache[key - 1] = swiper.virtual.cache[key];\n swiper.virtual.cache[key - 1].setAttribute('data-swiper-slide-index', key - 1);\n delete swiper.virtual.cache[key];\n }\n });\n }\n swiper.virtual.slides.splice(slidesIndexes, 1);\n if (slidesIndexes < activeIndex) activeIndex -= 1;\n activeIndex = Math.max(activeIndex, 0);\n }\n update(true);\n swiper.slideTo(activeIndex, 0);\n }\n function removeAllSlides() {\n swiper.virtual.slides = [];\n if (swiper.params.virtual.cache) {\n swiper.virtual.cache = {};\n }\n update(true);\n swiper.slideTo(0, 0);\n }\n on('beforeInit', () => {\n if (!swiper.params.virtual.enabled) return;\n let domSlidesAssigned;\n if (typeof swiper.passedParams.virtual.slides === 'undefined') {\n const slides = [...swiper.slidesEl.children].filter(el => el.matches(`.${swiper.params.slideClass}, swiper-slide`));\n if (slides && slides.length) {\n swiper.virtual.slides = [...slides];\n domSlidesAssigned = true;\n slides.forEach((slideEl, slideIndex) => {\n slideEl.setAttribute('data-swiper-slide-index', slideIndex);\n swiper.virtual.cache[slideIndex] = slideEl;\n slideEl.remove();\n });\n }\n }\n if (!domSlidesAssigned) {\n swiper.virtual.slides = swiper.params.virtual.slides;\n }\n swiper.classNames.push(`${swiper.params.containerModifierClass}virtual`);\n swiper.params.watchSlidesProgress = true;\n swiper.originalParams.watchSlidesProgress = true;\n update();\n });\n on('setTranslate', () => {\n if (!swiper.params.virtual.enabled) return;\n if (swiper.params.cssMode && !swiper._immediateVirtual) {\n clearTimeout(cssModeTimeout);\n cssModeTimeout = setTimeout(() =>
601 {\n update();\n }, 100);\n } else {\n update();\n }\n });\n on('init update resize', () => {\n if (!swiper.params.virtual.enabled) return;\n if (swiper.params.cssMode) {\n (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.s)(swiper.wrapperEl, '--swiper-virtual-size', `${swiper.virtualSize}px`);\n }\n });\n Object.assign(swiper.virtual, {\n appendSlide,\n prependSlide,\n removeSlide,\n removeAllSlides,\n update\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/virtual.mjs?\n}"); 602 603/***/ }, 604 605/***/ "./node_modules/swiper/modules/zoom.mjs" 606/*!**********************************************!*\ 607 !*** ./node_modules/swiper/modules/zoom.mjs ***! 608 \**********************************************/ 609(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 610 611"use strict"; 612eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Zoom)\n/* harmony export */ });\n/* harmony import */ var _shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/ssr-window.esm.mjs */ \"./node_modules/swiper/shared/ssr-window.esm.mjs\");\n/* harmony import */ var _shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\n\nfunction Zoom(_ref) {\n let {\n swiper,\n extendParams,\n on,\n emit\n } = _ref;\n const window = (0,_shared_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n extendParams({\n zoom: {\n enabled: false,\n maxRatio: 3,\n minRatio: 1,\n toggle: true,\n containerClass: 'swiper-zoom-container',\n zoomedSlideClass: 'swiper-slide-zoomed'\n }\n });\n swiper.zoom = {\n enabled: false\n };\n let currentScale = 1;\n let isScaling = false;\n let fakeGestureTouched;\n let fakeGestureMoved;\n const evCache = [];\n const gesture = {\n originX: 0,\n originY: 0,\n slideEl: undefined,\n slideWidth: undefined,\n slideHeight: undefined,\n imageEl: undefined,\n imageWrapEl: undefined,\n maxRatio: 3\n };\n const image = {\n isTouched: undefined,\n isMoved: undefined,\n currentX: undefined,\n currentY: undefined,\n minX: undefined,\n minY: undefined,\n maxX: undefined,\n maxY: undefined,\n width: undefined,\n height: undefined,\n startX: undefined,\n startY: undefined,\n touchesStart: {},\n touchesCurrent: {}\n };\n const velocity = {\n x: undefined,\n y: undefined,\n prevPositionX: undefined,\n prevPositionY: undefined,\n prevTime: undefined\n };\n let scale = 1;\n Object.defineProperty(swiper.zoom, 'scale', {\n get() {\n return scale;\n },\n set(value) {\n if (scale !== value) {\n const imageEl = gesture.imageEl;\n const slideEl = gesture.slideEl;\n emit('zoomChange', value, imageEl, slideEl);\n }\n scale = value;\n }\n });\n function getDistanceBetweenTouches() {\n if (evCache.length < 2) return 1;\n const x1 = evCache[0].pageX;\n const y1 = evCache[0].pageY;\n const x2 = evCache[1].pageX;\n const y2 = evCache[1].pageY;\n const distance = Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2);\n return distance;\n }\n function getScaleOrigin() {\n if (evCache.length < 2) return {\n x: null,\n y: null\n };\n const box = gesture.imageEl.getBoundingClientRect();\n return [(evCache[0].pageX + (evCache[1].pageX - evCache[0].pageX) / 2 - box.x - window.scrollX) / currentScale, (evCache[0].pageY + (evCache[1].pageY - evCache[0].pageY) / 2 - box.y - window.scrollY) / currentScale];\n }\n function getSlideSelector() {\n return swiper.isElement ? `swiper-slide` : `.${swiper.params.slideClass}`;\n }\n function eventWithinSlide(e) {\n const slideSelector = getSlideSelector();\n if (e.target.matches(slideSelector)) return true;\n if (swiper.slides.filter(slideEl => slideEl.contains(e.target)).length > 0) return true;\n return false;\n }\n function eventWithinZoomContainer(e) {\n const selector = `.${swiper.params.zoom.containerClass}`;\n if (e.target.matches(selector)) return true;\n if ([...swiper.hostEl.querySelectorAll(selector)].filter(containerEl => containerEl.contains(e.target)).length > 0) return true;\n return false;\n }\n\n // Events\n function onGestureStart(e) {\n if (e.pointerType === 'mouse') {\n evCache.splice(0, evCache.length);\n }\n if (!eventWithinSlide(e)) return;\n const params = swiper.params.zoom;\n fakeGestureTouched = false;\n fakeGestureMoved = false;\n evCache.push(e);\n if (evCache.length < 2) {\n return;\n }\n fakeGestureTouched = true;\n gesture.scaleStart = getDistanceBetweenTouches();\n if (!gesture.slideEl) {\n gesture.slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`);\n if (!gesture.slideEl) gesture.slideEl = swiper.slides[swiper.activeIndex];\n let imageEl = gesture.slideEl.querySelector(`.${params.containerClass}`);\n if (imageEl) {\n imageEl = imageEl.querySelectorAll('picture, img, svg, canvas, .swiper-zoom-target')[0];\n }\n gesture.imageEl = imageEl;\n if (imageEl) {\n gesture.imageWrapEl = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(gesture.imageEl, `.${params.containerClass}`)[0];\n } else {\n gesture.imageWrapEl = undefined;\n }\n if (!gesture.imageWrapEl) {\n gesture.imageEl = undefined;\n return;\n }\n gesture.maxRatio = gesture.imageWrapEl.getAttribute('data-swiper-zoom') || params.maxRatio;\n }\n if (gesture.imageEl) {\n const [originX, originY] = getScaleOrigin();\n gesture.originX = originX;\n gesture.originY = originY;\n gesture.imageEl.style.transitionDuration = '0ms';
612\n }\n isScaling = true;\n }\n function onGestureChange(e) {\n if (!eventWithinSlide(e)) return;\n const params = swiper.params.zoom;\n const zoom = swiper.zoom;\n const pointerIndex = evCache.findIndex(cachedEv => cachedEv.pointerId === e.pointerId);\n if (pointerIndex >= 0) evCache[pointerIndex] = e;\n if (evCache.length < 2) {\n return;\n }\n fakeGestureMoved = true;\n gesture.scaleMove = getDistanceBetweenTouches();\n if (!gesture.imageEl) {\n return;\n }\n zoom.scale = gesture.scaleMove / gesture.scaleStart * currentScale;\n if (zoom.scale > gesture.maxRatio) {\n zoom.scale = gesture.maxRatio - 1 + (zoom.scale - gesture.maxRatio + 1) ** 0.5;\n }\n if (zoom.scale < params.minRatio) {\n zoom.scale = params.minRatio + 1 - (params.minRatio - zoom.scale + 1) ** 0.5;\n }\n gesture.imageEl.style.transform = `translate3d(0,0,0) scale(${zoom.scale})`;\n }\n function onGestureEnd(e) {\n if (!eventWithinSlide(e)) return;\n if (e.pointerType === 'mouse' && e.type === 'pointerout') return;\n const params = swiper.params.zoom;\n const zoom = swiper.zoom;\n const pointerIndex = evCache.findIndex(cachedEv => cachedEv.pointerId === e.pointerId);\n if (pointerIndex >= 0) evCache.splice(pointerIndex, 1);\n if (!fakeGestureTouched || !fakeGestureMoved) {\n return;\n }\n fakeGestureTouched = false;\n fakeGestureMoved = false;\n if (!gesture.imageEl) return;\n zoom.scale = Math.max(Math.min(zoom.scale, gesture.maxRatio), params.minRatio);\n gesture.imageEl.style.transitionDuration = `${swiper.params.speed}ms`;\n gesture.imageEl.style.transform = `translate3d(0,0,0) scale(${zoom.scale})`;\n currentScale = zoom.scale;\n isScaling = false;\n if (zoom.scale > 1 && gesture.slideEl) {\n gesture.slideEl.classList.add(`${params.zoomedSlideClass}`);\n } else if (zoom.scale <= 1 && gesture.slideEl) {\n gesture.slideEl.classList.remove(`${params.zoomedSlideClass}`);\n }\n if (zoom.scale === 1) {\n gesture.originX = 0;\n gesture.originY = 0;\n gesture.slideEl = undefined;\n }\n }\n function onTouchStart(e) {\n const device = swiper.device;\n if (!gesture.imageEl) return;\n if (image.isTouched) return;\n if (device.android && e.cancelable) e.preventDefault();\n image.isTouched = true;\n const event = evCache.length > 0 ? evCache[0] : e;\n image.touchesStart.x = event.pageX;\n image.touchesStart.y = event.pageY;\n }\n function onTouchMove(e) {\n if (!eventWithinSlide(e) || !eventWithinZoomContainer(e)) return;\n const zoom = swiper.zoom;\n if (!gesture.imageEl) return;\n if (!image.isTouched || !gesture.slideEl) return;\n if (!image.isMoved) {\n image.width = gesture.imageEl.offsetWidth;\n image.height = gesture.imageEl.offsetHeight;\n image.startX = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.h)(gesture.imageWrapEl, 'x') || 0;\n image.startY = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.h)(gesture.imageWrapEl, 'y') || 0;\n gesture.slideWidth = gesture.slideEl.offsetWidth;\n gesture.slideHeight = gesture.slideEl.offsetHeight;\n gesture.imageWrapEl.style.transitionDuration = '0ms';\n }\n // Define if we need image drag\n const scaledWidth = image.width * zoom.scale;\n const scaledHeight = image.height * zoom.scale;\n if (scaledWidth < gesture.slideWidth && scaledHeight < gesture.slideHeight) return;\n image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0);\n image.maxX = -image.minX;\n image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0);\n image.maxY = -image.minY;\n image.touchesCurrent.x = evCache.length > 0 ? evCache[0].pageX : e.pageX;\n image.touchesCurrent.y = evCache.length > 0 ? evCache[0].pageY : e.pageY;\n const touchesDiff = Math.max(Math.abs(image.touchesCurrent.x - image.touchesStart.x), Math.abs(image.touchesCurrent.y - image.touchesStart.y));\n if (touchesDiff > 5) {\n swiper.allowClick = false;\n }\n if (!image.isMoved && !isScaling) {\n if (swiper.isHorizontal() && (Math.floor(image.minX) === Math.floor(image.startX) && image.touchesCurrent.x < image.touchesStart.x || Math.floor(image.maxX) === Math.floor(image.startX) && image.touchesCurrent.x > image.touchesStart.x)) {\n image.isTouched = false;\n return;\n }\n if (!swiper.isHorizontal() && (Math.floor(image.minY) === Math.floor(image.startY) && image.touchesCurrent.y < image.touchesStart.y || Math.floor(image.maxY) === Math.floor(image.startY) && image.touchesCurrent.y > image.touchesStart.y)) {\n image.isTouched = false;\n return;\n }\n }\n if (e.cancelable) {\n e.preventDefault();\n }\n e.stopPropagation();\n image.isMoved = true;\n const scaleRatio = (zoom.scale - currentScale) / (gesture.maxRatio - swiper.params.zoom.minRatio);\n const {\n originX,\n originY\n } = gesture;\n image.currentX = image.touchesCurrent.x - image.touchesStart.x + image.startX + scaleRatio * (image.
612width - originX * 2);\n image.currentY = image.touchesCurrent.y - image.touchesStart.y + image.startY + scaleRatio * (image.height - originY * 2);\n if (image.currentX < image.minX) {\n image.currentX = image.minX + 1 - (image.minX - image.currentX + 1) ** 0.8;\n }\n if (image.currentX > image.maxX) {\n image.currentX = image.maxX - 1 + (image.currentX - image.maxX + 1) ** 0.8;\n }\n if (image.currentY < image.minY) {\n image.currentY = image.minY + 1 - (image.minY - image.currentY + 1) ** 0.8;\n }\n if (image.currentY > image.maxY) {\n image.currentY = image.maxY - 1 + (image.currentY - image.maxY + 1) ** 0.8;\n }\n\n // Velocity\n if (!velocity.prevPositionX) velocity.prevPositionX = image.touchesCurrent.x;\n if (!velocity.prevPositionY) velocity.prevPositionY = image.touchesCurrent.y;\n if (!velocity.prevTime) velocity.prevTime = Date.now();\n velocity.x = (image.touchesCurrent.x - velocity.prevPositionX) / (Date.now() - velocity.prevTime) / 2;\n velocity.y = (image.touchesCurrent.y - velocity.prevPositionY) / (Date.now() - velocity.prevTime) / 2;\n if (Math.abs(image.touchesCurrent.x - velocity.prevPositionX) < 2) velocity.x = 0;\n if (Math.abs(image.touchesCurrent.y - velocity.prevPositionY) < 2) velocity.y = 0;\n velocity.prevPositionX = image.touchesCurrent.x;\n velocity.prevPositionY = image.touchesCurrent.y;\n velocity.prevTime = Date.now();\n gesture.imageWrapEl.style.transform = `translate3d(${image.currentX}px, ${image.currentY}px,0)`;\n }\n function onTouchEnd() {\n const zoom = swiper.zoom;\n if (!gesture.imageEl) return;\n if (!image.isTouched || !image.isMoved) {\n image.isTouched = false;\n image.isMoved = false;\n return;\n }\n image.isTouched = false;\n image.isMoved = false;\n let momentumDurationX = 300;\n let momentumDurationY = 300;\n const momentumDistanceX = velocity.x * momentumDurationX;\n const newPositionX = image.currentX + momentumDistanceX;\n const momentumDistanceY = velocity.y * momentumDurationY;\n const newPositionY = image.currentY + momentumDistanceY;\n\n // Fix duration\n if (velocity.x !== 0) momentumDurationX = Math.abs((newPositionX - image.currentX) / velocity.x);\n if (velocity.y !== 0) momentumDurationY = Math.abs((newPositionY - image.currentY) / velocity.y);\n const momentumDuration = Math.max(momentumDurationX, momentumDurationY);\n image.currentX = newPositionX;\n image.currentY = newPositionY;\n // Define if we need image drag\n const scaledWidth = image.width * zoom.scale;\n const scaledHeight = image.height * zoom.scale;\n image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0);\n image.maxX = -image.minX;\n image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0);\n image.maxY = -image.minY;\n image.currentX = Math.max(Math.min(image.currentX, image.maxX), image.minX);\n image.currentY = Math.max(Math.min(image.currentY, image.maxY), image.minY);\n gesture.imageWrapEl.style.transitionDuration = `${momentumDuration}ms`;\n gesture.imageWrapEl.style.transform = `translate3d(${image.currentX}px, ${image.currentY}px,0)`;\n }\n function onTransitionEnd() {\n const zoom = swiper.zoom;\n if (gesture.slideEl && swiper.activeIndex !== swiper.slides.indexOf(gesture.slideEl)) {\n if (gesture.imageEl) {\n gesture.imageEl.style.transform = 'translate3d(0,0,0) scale(1)';\n }\n if (gesture.imageWrapEl) {\n gesture.imageWrapEl.style.transform = 'translate3d(0,0,0)';\n }\n gesture.slideEl.classList.remove(`${swiper.params.zoom.zoomedSlideClass}`);\n zoom.scale = 1;\n currentScale = 1;\n gesture.slideEl = undefined;\n gesture.imageEl = undefined;\n gesture.imageWrapEl = undefined;\n gesture.originX = 0;\n gesture.originY = 0;\n }\n }\n function zoomIn(e) {\n const zoom = swiper.zoom;\n const params = swiper.params.zoom;\n if (!gesture.slideEl) {\n if (e && e.target) {\n gesture.slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`);\n }\n if (!gesture.slideEl) {\n if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) {\n gesture.slideEl = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.e)(swiper.slidesEl, `.${swiper.params.slideActiveClass}`)[0];\n } else {\n gesture.slideEl = swiper.slides[swiper.activeIndex];\n }\n }\n let imageEl = gesture.slideEl.querySelector(`.${params.containerClass}`);\n if (imageEl) {\n imageEl = imageEl.querySelectorAll('picture, img, svg, canvas, .swiper-zoom-target')[0];\n }\n gesture.imageEl = imageEl;\n if (imageEl) {\n gesture.imageWrapEl = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(gesture.imageEl, `.${params.containerClass}`)[0];\n } else {\n gesture.imageWrapEl = undefined;\n }\n }\n if (!gesture.imageEl || !gesture.imageWrapEl) return;\n if (swiper.params.cssMode) {\n swiper.wrapperEl.style.overflow = 'hidden';
612\n swiper.wrapperEl.style.touchAction = 'none';\n }\n gesture.slideEl.classList.add(`${params.zoomedSlideClass}`);\n let touchX;\n let touchY;\n let offsetX;\n let offsetY;\n let diffX;\n let diffY;\n let translateX;\n let translateY;\n let imageWidth;\n let imageHeight;\n let scaledWidth;\n let scaledHeight;\n let translateMinX;\n let translateMinY;\n let translateMaxX;\n let translateMaxY;\n let slideWidth;\n let slideHeight;\n if (typeof image.touchesStart.x === 'undefined' && e) {\n touchX = e.pageX;\n touchY = e.pageY;\n } else {\n touchX = image.touchesStart.x;\n touchY = image.touchesStart.y;\n }\n const forceZoomRatio = typeof e === 'number' ? e : null;\n if (currentScale === 1 && forceZoomRatio) {\n touchX = undefined;\n touchY = undefined;\n }\n zoom.scale = forceZoomRatio || gesture.imageWrapEl.getAttribute('data-swiper-zoom') || params.maxRatio;\n currentScale = forceZoomRatio || gesture.imageWrapEl.getAttribute('data-swiper-zoom') || params.maxRatio;\n if (e && !(currentScale === 1 && forceZoomRatio)) {\n slideWidth = gesture.slideEl.offsetWidth;\n slideHeight = gesture.slideEl.offsetHeight;\n offsetX = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(gesture.slideEl).left + window.scrollX;\n offsetY = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.b)(gesture.slideEl).top + window.scrollY;\n diffX = offsetX + slideWidth / 2 - touchX;\n diffY = offsetY + slideHeight / 2 - touchY;\n imageWidth = gesture.imageEl.offsetWidth;\n imageHeight = gesture.imageEl.offsetHeight;\n scaledWidth = imageWidth * zoom.scale;\n scaledHeight = imageHeight * zoom.scale;\n translateMinX = Math.min(slideWidth / 2 - scaledWidth / 2, 0);\n translateMinY = Math.min(slideHeight / 2 - scaledHeight / 2, 0);\n translateMaxX = -translateMinX;\n translateMaxY = -translateMinY;\n translateX = diffX * zoom.scale;\n translateY = diffY * zoom.scale;\n if (translateX < translateMinX) {\n translateX = translateMinX;\n }\n if (translateX > translateMaxX) {\n translateX = translateMaxX;\n }\n if (translateY < translateMinY) {\n translateY = translateMinY;\n }\n if (translateY > translateMaxY) {\n translateY = translateMaxY;\n }\n } else {\n translateX = 0;\n translateY = 0;\n }\n if (forceZoomRatio && zoom.scale === 1) {\n gesture.originX = 0;\n gesture.originY = 0;\n }\n gesture.imageWrapEl.style.transitionDuration = '300ms';\n gesture.imageWrapEl.style.transform = `translate3d(${translateX}px, ${translateY}px,0)`;\n gesture.imageEl.style.transitionDuration = '300ms';\n gesture.imageEl.style.transform = `translate3d(0,0,0) scale(${zoom.scale})`;\n }\n function zoomOut() {\n const zoom = swiper.zoom;\n const params = swiper.params.zoom;\n if (!gesture.slideEl) {\n if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) {\n gesture.slideEl = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.e)(swiper.slidesEl, `.${swiper.params.slideActiveClass}`)[0];\n } else {\n gesture.slideEl = swiper.slides[swiper.activeIndex];\n }\n let imageEl = gesture.slideEl.querySelector(`.${params.containerClass}`);\n if (imageEl) {\n imageEl = imageEl.querySelectorAll('picture, img, svg, canvas, .swiper-zoom-target')[0];\n }\n gesture.imageEl = imageEl;\n if (imageEl) {\n gesture.imageWrapEl = (0,_shared_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(gesture.imageEl, `.${params.containerClass}`)[0];\n } else {\n gesture.imageWrapEl = undefined;\n }\n }\n if (!gesture.imageEl || !gesture.imageWrapEl) return;\n if (swiper.params.cssMode) {\n swiper.wrapperEl.style.overflow = '';\n swiper.wrapperEl.style.touchAction = '';\n }\n zoom.scale = 1;\n currentScale = 1;\n gesture.imageWrapEl.style.transitionDuration = '300ms';
612\n gesture.imageWrapEl.style.transform = 'translate3d(0,0,0)';\n gesture.imageEl.style.transitionDuration = '300ms';\n gesture.imageEl.style.transform = 'translate3d(0,0,0) scale(1)';\n gesture.slideEl.classList.remove(`${params.zoomedSlideClass}`);\n gesture.slideEl = undefined;\n gesture.originX = 0;\n gesture.originY = 0;\n }\n\n // Toggle Zoom\n function zoomToggle(e) {\n const zoom = swiper.zoom;\n if (zoom.scale && zoom.scale !== 1) {\n // Zoom Out\n zoomOut();\n } else {\n // Zoom In\n zoomIn(e);\n }\n }\n function getListeners() {\n const passiveListener = swiper.params.passiveListeners ? {\n passive: true,\n capture: false\n } : false;\n const activeListenerWithCapture = swiper.params.passiveListeners ? {\n passive: false,\n capture: true\n } : true;\n return {\n passiveListener,\n activeListenerWithCapture\n };\n }\n\n // Attach/Detach Events\n function enable() {\n const zoom = swiper.zoom;\n if (zoom.enabled) return;\n zoom.enabled = true;\n const {\n passiveListener,\n activeListenerWithCapture\n } = getListeners();\n\n // Scale image\n swiper.wrapperEl.addEventListener('pointerdown', onGestureStart, passiveListener);\n swiper.wrapperEl.addEventListener('pointermove', onGestureChange, activeListenerWithCapture);\n ['pointerup', 'pointercancel', 'pointerout'].forEach(eventName => {\n swiper.wrapperEl.addEventListener(eventName, onGestureEnd, passiveListener);\n });\n\n // Move image\n swiper.wrapperEl.addEventListener('pointermove', onTouchMove, activeListenerWithCapture);\n }\n function disable() {\n const zoom = swiper.zoom;\n if (!zoom.enabled) return;\n zoom.enabled = false;\n const {\n passiveListener,\n activeListenerWithCapture\n } = getListeners();\n\n // Scale image\n swiper.wrapperEl.removeEventListener('pointerdown', onGestureStart, passiveListener);\n swiper.wrapperEl.removeEventListener('pointermove', onGestureChange, activeListenerWithCapture);\n ['pointerup', 'pointercancel', 'pointerout'].forEach(eventName => {\n swiper.wrapperEl.removeEventListener(eventName, onGestureEnd, passiveListener);\n });\n\n // Move image\n swiper.wrapperEl.removeEventListener('pointermove', onTouchMove, activeListenerWithCapture);\n }\n on('init', () => {\n if (swiper.params.zoom.enabled) {\n enable();\n }\n });\n on('destroy', () => {\n disable();\n });\n on('touchStart', (_s, e) => {\n if (!swiper.zoom.enabled) return;\n onTouchStart(e);\n });\n on('touchEnd', (_s, e) => {\n if (!swiper.zoom.enabled) return;\n onTouchEnd();\n });\n on('doubleTap', (_s, e) => {\n if (!swiper.animating && swiper.params.zoom.enabled && swiper.zoom.enabled && swiper.params.zoom.toggle) {\n zoomToggle(e);\n }\n });\n on('transitionEnd', () => {\n if (swiper.zoom.enabled && swiper.params.zoom.enabled) {\n onTransitionEnd();\n }\n });\n on('slideChange', () => {\n if (swiper.zoom.enabled && swiper.params.zoom.enabled && swiper.params.cssMode) {\n onTransitionEnd();\n }\n });\n Object.assign(swiper.zoom, {\n enable,\n disable,\n in: zoomIn,\n out: zoomOut,\n toggle: zoomToggle\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/modules/zoom.mjs?\n}"); 613 614/***/ }, 615 616/***/ "./node_modules/swiper/shared/classes-to-selector.mjs" 617/*!************************************************************!*\ 618 !*** ./node_modules/swiper/shared/classes-to-selector.mjs ***! 619 \************************************************************/ 620(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 621 622"use strict"; 623eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ c: () => (/* binding */ classesToSelector)\n/* harmony export */ });\nfunction classesToSelector(classes) {\n if (classes === void 0) {\n classes = '';\n }\n return `.${classes.trim().replace(/([\\.:!+\\/])/g, '\\\\$1') // eslint-disable-line\n .replace(/ /g, '.')}`;\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/shared/classes-to-selector.mjs?\n}"); 624 625/***/ }, 626 627/***/ "./node_modules/swiper/shared/create-element-if-not-defined.mjs" 628/*!**********************************************************************!*\ 629 !*** ./node_modules/swiper/shared/create-element-if-not-defined.mjs ***! 630 \**********************************************************************/ 631(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 632 633"use strict"; 634eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ c: () => (/* binding */ createElementIfNotDefined)\n/* harmony export */ });\n/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\nfunction createElementIfNotDefined(swiper, originalParams, params, checkProps) {\
634n if (swiper.params.createElements) {\n Object.keys(checkProps).forEach(key => {\n if (!params[key] && params.auto === true) {\n let element = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.e)(swiper.el, `.${checkProps[key]}`)[0];\n if (!element) {\n element = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.c)('div', checkProps[key]);\n element.className = checkProps[key];\n swiper.el.append(element);\n }\n params[key] = element;\n originalParams[key] = element;\n }\n });\n }\n return params;\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/shared/create-element-if-not-defined.mjs?\n}"); 635 636/***/ }, 637 638/***/ "./node_modules/swiper/shared/create-shadow.mjs" 639/*!******************************************************!*\ 640 !*** ./node_modules/swiper/shared/create-shadow.mjs ***! 641 \******************************************************/ 642(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 643 644"use strict"; 645eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ c: () => (/* binding */ createShadow)\n/* harmony export */ });\n/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\nfunction createShadow(suffix, slideEl, side) {\n const shadowClass = `swiper-slide-shadow${side ? `-${side}` : ''}${suffix ? ` swiper-slide-shadow-${suffix}` : ''}`;\n const shadowContainer = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.k)(slideEl);\n let shadowEl = shadowContainer.querySelector(`.${shadowClass.split(' ').join('.')}`);\n if (!shadowEl) {\n shadowEl = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.c)('div', shadowClass.split(' '));\n shadowContainer.append(shadowEl);\n }\n return shadowEl;\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/shared/create-shadow.mjs?\n}"); 646 647/***/ }, 648 649/***/ "./node_modules/swiper/shared/effect-init.mjs" 650/*!****************************************************!*\ 651 !*** ./node_modules/swiper/shared/effect-init.mjs ***! 652 \****************************************************/ 653(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 654 655"use strict"; 656eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ e: () => (/* binding */ effectInit)\n/* harmony export */ });\nfunction effectInit(params) {\n const {\n effect,\n swiper,\n on,\n setTranslate,\n setTransition,\n overwriteParams,\n perspective,\n recreateShadows,\n getEffectParams\n } = params;\n on('beforeInit', () => {\n if (swiper.params.effect !== effect) return;\n swiper.classNames.push(`${swiper.params.containerModifierClass}${effect}`);\n if (perspective && perspective()) {\n swiper.classNames.push(`${swiper.params.containerModifierClass}3d`);\n }\n const overwriteParamsResult = overwriteParams ? overwriteParams() : {};\n Object.assign(swiper.params, overwriteParamsResult);\n Object.assign(swiper.originalParams, overwriteParamsResult);\n });\n on('setTranslate', () => {\n if (swiper.params.effect !== effect) return;\n setTranslate();\n });\n on('setTransition', (_s, duration) => {\n if (swiper.params.effect !== effect) return;\n setTransition(duration);\n });\n on('transitionEnd', () => {\n if (swiper.params.effect !== effect) return;\n if (recreateShadows) {\n if (!getEffectParams || !getEffectParams().slideShadows) return;
656\n // remove shadows\n swiper.slides.forEach(slideEl => {\n slideEl.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(shadowEl => shadowEl.remove());\n });\n // create new one\n recreateShadows();\n }\n });\n let requireUpdateOnVirtual;\n on('virtualUpdate', () => {\n if (swiper.params.effect !== effect) return;\n if (!swiper.slides.length) {\n requireUpdateOnVirtual = true;\n }\n requestAnimationFrame(() => {\n if (requireUpdateOnVirtual && swiper.slides && swiper.slides.length) {\n setTranslate();\n requireUpdateOnVirtual = false;\n }\n });\n });\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/shared/effect-init.mjs?\n}"); 657 658/***/ }, 659 660/***/ "./node_modules/swiper/shared/effect-target.mjs" 661/*!******************************************************!*\ 662 !*** ./node_modules/swiper/shared/effect-target.mjs ***! 663 \******************************************************/ 664(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 665 666"use strict"; 667eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ e: () => (/* binding */ effectTarget)\n/* harmony export */ });\n/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\nfunction effectTarget(effectParams, slideEl) {\n const transformEl = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.k)(slideEl);\n if (transformEl !== slideEl) {\n transformEl.style.backfaceVisibility = 'hidden';\n transformEl.style['-webkit-backface-visibility'] = 'hidden';\n }\n return transformEl;\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/shared/effect-target.mjs?\n}"); 668 669/***/ }, 670 671/***/ "./node_modules/swiper/shared/effect-virtual-transition-end.mjs" 672/*!**********************************************************************!*\ 673 !*** ./node_modules/swiper/shared/effect-virtual-transition-end.mjs ***! 674 \**********************************************************************/ 675(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 676 677"use strict"; 678eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ e: () => (/* binding */ effectVirtualTransitionEnd)\n/* harmony export */ });\n/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\nfunction effectVirtualTransitionEnd(_ref) {\n let {\n swiper,\n duration,\n transformElements,\n allSlides\n } = _ref;\n const {\n activeIndex\n } = swiper;\n const getSlide = el => {\n if (!el.parentElement) {\n // assume shadow root\n const slide = swiper.slides.filter(slideEl => slideEl.shadowRoot && slideEl.shadowRoot === el.parentNode)[0];\n return slide;\n }\n return el.parentElement;\n };\n if (swiper.params.virtualTranslate && duration !== 0) {\n let eventTriggered = false;\n let transitionEndTarget;\n if (allSlides) {\n transitionEndTarget = transformElements;\n } else {\n transitionEndTarget = transformElements.filter(transformEl => {\n const el = transformEl.classList.contains('swiper-slide-transform') ? getSlide(transformEl) : transformEl;\n return swiper.getSlideIndex(el) === activeIndex;\n });\n }\n transitionEndTarget.forEach(el => {\n ;(0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.i)(el, () => {\n if (eventTriggered) return;\n if (!swiper || swiper.destroyed) return;\n eventTriggered = true;\n swiper.animating = false;\n const evt = new window.CustomEvent('transitionend', {\n bubbles: true,\n cancelable: true\n });\n swiper.wrapperEl.dispatchEvent(evt);\n });\n });\n }\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/shared/effect-virtual-transition-end.mjs?\n}"); 679 680/***/ }, 681 682/***/ "./node_modules/swiper/shared/ssr-window.esm.mjs" 683/*!*******************************************************!*\ 684 !*** ./node_modules/swiper/shared/ssr-window.esm.mjs ***! 685 \*******************************************************/ 686(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 687 688"use strict"; 689eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ a: () => (/* binding */ getWindow),\n/* harmony export */ g: () => (/* binding */ getDocument)\n/* harmony export */ });\n/**\n * SSR Window 4.0.2\n * Better handling for window object in SSR environment\n * https://github.com/nolimits4web/ssr-window\n *\n * Copyright 2021, Vladimir Kharlampidi\n *\n *
689Licensed under MIT\n *\n * Released on: December 13, 2021\n */\n/* eslint-disable no-param-reassign */\nfunction isObject(obj) {\n return obj !== null && typeof obj === 'object' && 'constructor' in obj && obj.constructor === Object;\n}\nfunction extend(target, src) {\n if (target === void 0) {\n target = {};\n }\n if (src === void 0) {\n src = {};\n }\n Object.keys(src).forEach(key => {\n if (typeof target[key] === 'undefined') target[key] = src[key];else if (isObject(src[key]) && isObject(target[key]) && Object.keys(src[key]).length > 0) {\n extend(target[key], src[key]);\n }\n });\n}\nconst ssrDocument = {\n body: {},\n addEventListener() {},\n removeEventListener() {},\n activeElement: {\n blur() {},\n nodeName: ''\n },\n querySelector() {\n return null;\n },\n querySelectorAll() {\n return [];\n },\n getElementById() {\n return null;\n },\n createEvent() {\n return {\n initEvent() {}\n };\n },\n createElement() {\n return {\n children: [],\n childNodes: [],\n style: {},\n setAttribute() {},\n getElementsByTagName() {\n return [];\n }\n };\n },\n createElementNS() {\n return {};\n },\n importNode() {\n return null;\n },\n location: {\n hash: '',\n host: '',\n hostname: '',\n href: '',\n origin: '',\n pathname: '',\n protocol: '',\n search: ''\n }\n};\nfunction getDocument() {\n const doc = typeof document !== 'undefined' ? document : {};\n extend(doc, ssrDocument);\n return doc;\n}\nconst ssrWindow = {\n document: ssrDocument,\n navigator: {\n userAgent: ''\n },\n location: {\n hash: '',\n host: '',\n hostname: '',\n href: '',\n origin: '',\n pathname: '',\n protocol: '',\n search: ''\n },\n history: {\n replaceState() {},\n pushState() {},\n go() {},\n back() {}\n },\n CustomEvent: function CustomEvent() {\n return this;\n },\n addEventListener() {},\n removeEventListener() {},\n getComputedStyle() {\n return {\n getPropertyValue() {\n return '';\n }\n };\n },\n Image() {},\n Date() {},\n screen: {},\n setTimeout() {},\n clearTimeout() {},\n matchMedia() {\n return {};\n },\n requestAnimationFrame(callback) {\n if (typeof setTimeout === 'undefined') {\n callback();\n return null;\n }\n return setTimeout(callback, 0);\n },\n cancelAnimationFrame(id) {\n if (typeof setTimeout === 'undefined') {\n return;\n }\n clearTimeout(id);\n }\n};\nfunction getWindow() {\n const win = typeof window !== 'undefined' ? window : {};\n extend(win, ssrWindow);\n return win;\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/shared/ssr-window.esm.mjs?\n}"); 690 691/***/ }, 692 693/***/ "./node_modules/swiper/shared/swiper-core.mjs" 694/*!****************************************************!*\ 695 !*** ./node_modules/swiper/shared/swiper-core.mjs ***! 696 \****************************************************/ 697(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 698 699"use strict"; 700eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ S: () => (/* binding */ Swiper),\n/* harmony export */ d: () => (/* binding */ defaults)\n/* harmony export */ });\n/* harmony import */ var _ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ssr-window.esm.mjs */ \"./node_modules/swiper/shared/ssr-window.esm.mjs\");\n/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ \"./node_modules/swiper/shared/utils.mjs\");\n\n\n\nlet support;\nfunction calcSupport() {\n const window = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n const document = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.g)();\n return {\n smoothScroll: document.documentElement && document.documentElement.style && 'scrollBehavior' in document.documentElement.style,\n touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch)\n };\n}
700\nfunction getSupport() {\n if (!support) {\n support = calcSupport();\n }\n return support;\n}\n\nlet deviceCached;\nfunction calcDevice(_temp) {\n let {\n userAgent\n } = _temp === void 0 ? {} : _temp;\n const support = getSupport();\n const window = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n const platform = window.navigator.platform;\n const ua = userAgent || window.navigator.userAgent;\n const device = {\n ios: false,\n android: false\n };\n const screenWidth = window.screen.width;\n const screenHeight = window.screen.height;\n const android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/); // eslint-disable-line\n let ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n const ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n const iphone = !ipad && ua.match(/(iPhone\\sOS|iOS)\\s([\\d_]+)/);\n const windows = platform === 'Win32';\n let macos = platform === 'MacIntel';\n\n // iPadOs 13 fix\n const iPadScreens = ['1024x1366', '1366x1024', '834x1194', '1194x834', '834x1112', '1112x834', '768x1024', '1024x768', '820x1180', '1180x820', '810x1080', '1080x810'];\n if (!ipad && macos && support.touch && iPadScreens.indexOf(`${screenWidth}x${screenHeight}`) >= 0) {\n ipad = ua.match(/(Version)\\/([\\d.]+)/);\n if (!ipad) ipad = [0, 1, '13_0_0'];\n macos = false;\n }\n\n // Android\n if (android && !windows) {\n device.os = 'android';\n device.android = true;\n }\n if (ipad || iphone || ipod) {\n device.os = 'ios';\n device.ios = true;\n }\n\n // Export object\n return device;\n}\nfunction getDevice(overrides) {\n if (overrides === void 0) {\n overrides = {};\n }\n if (!deviceCached) {\n deviceCached = calcDevice(overrides);\n }\n return deviceCached;\n}\n\nlet browser;\nfunction calcBrowser() {\n const window = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n let needPerspectiveFix = false;\n function isSafari() {\n const ua = window.navigator.userAgent.toLowerCase();\n return ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0;\n }\n if (isSafari()) {\n const ua = String(window.navigator.userAgent);\n if (ua.includes('Version/')) {\n const [major, minor] = ua.split('Version/')[1].split(' ')[0].split('.').map(num => Number(num));\n needPerspectiveFix = major < 16 || major === 16 && minor < 2;\n }\n }\n return {\n isSafari: needPerspectiveFix || isSafari(),\n needPerspectiveFix,\n isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent)\n };\n}\nfunction getBrowser() {\n if (!browser) {\n browser = calcBrowser();\n }\n return browser;\n}\n\nfunction Resize(_ref) {\n let {\n swiper,\n on,\n emit\n } = _ref;\n const window = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n let observer = null;\n let animationFrame = null;\n const resizeHandler = () => {\n if (!swiper || swiper.destroyed || !swiper.initialized) return;\n emit('beforeResize');\n emit('resize');\n };\n const createObserver = () => {\n if (!swiper || swiper.destroyed || !swiper.initialized) return;\n observer = new ResizeObserver(entries => {\n animationFrame = window.requestAnimationFrame(() => {\n const {\n width,\n height\n } = swiper;\n let newWidth = width;\n let newHeight = height;\n entries.forEach(_ref2 => {\n let {\n contentBoxSize,\n contentRect,\n target\n } = _ref2;\n if (target && target !== swiper.el) return;\n newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize;\n newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize;\n });\n if (newWidth !== width || newHeight !== height) {\n resizeHandler();\n }\n });\n });\n observer.observe(swiper.el);\n };\n const removeObserver = () => {\n if (animationFrame) {\n window.cancelAnimationFrame(animationFrame);\n }\n if (observer && observer.unobserve && swiper.el) {\n observer.unobserve(swiper.el);\n observer = null;\n }\n };\n const orientationChangeHandler = () => {\n if (!swiper || swiper.destroyed || !swiper.initialized) return;\n emit('orientationchange');\n };\n on('init', () => {\n if (swiper.params.resizeObserver && typeof window.ResizeObserver !== 'undefined') {\n createObserver();\n return;\n }\n window.addEventListener('resize', resizeHandler);\n window.addEventListener('orientationchange', orientationChangeHandler);\n });\n on('destroy', () => {\n removeObserver();\n window.removeEventListener('resize', resizeHandler);\n window.removeEventListener('orientationchange', orientationChangeHandler);\n });\n}\n\nfunction Observer(_ref) {\n let {\n swiper,\n extendParams,\n on,\n emit\n } = _ref;\n const observers = [];\n const window = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n const attach = function (target, options) {\n if (options === void 0) {\n options = {};\n }\n const ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;\n const observer = new ObserverFunc(mutations => {\n // The observerUpdate event should only be triggered\n // once despite the number of mutations. Additional\n // triggers are redundant and are very costly\n if (swiper.__preventObserver__) return;\n if (mutations.length === 1) {\n emit('observerUpdate', mutations[0]);\n return;\n }\n const observerUpdate = function observerUpdate() {\n emit('observerUpdate', mutations[0]);\n };\n if (window.requestAnimationFrame) {\n window.requestAnimationFrame(observerUpdate);\n } else {\n window.setTimeout(observerUpdate, 0);\n }\n });\n observer.observe(target, {\n attributes: typeof options.attributes === 'undefined' ? true : options.attributes,\n childList: typeof options.childList === 'undefined' ? true : options.childList,\n characterData: typeof options.characterData === 'undefined' ? true : options.characterData\n });\n observers.push(observer);\n };\n const init = () => {\n if (!swiper.params.observer) return;\n if (swiper.params.observeParents) {\n const containerParents = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.a)(swiper.hostEl);\n for (let i = 0; i < containerParents.length; i += 1) {\n attach(containerParents[i]);\n }\n }\n // Observe container\n attach(swiper.hostEl, {\n childList: swiper.params.observeSlideChildren\n });\n\n // Observe wrapper\n attach(swiper.wrapperEl, {\n attributes: false\n });\n };\n const destroy = () =>
700 {\n observers.forEach(observer => {\n observer.disconnect();\n });\n observers.splice(0, observers.length);\n };\n extendParams({\n observer: false,\n observeParents: false,\n observeSlideChildren: false\n });\n on('init', init);\n on('destroy', destroy);\n}\n\n/* eslint-disable no-underscore-dangle */\n\nvar eventsEmitter = {\n on(events, handler, priority) {\n const self = this;\n if (!self.eventsListeners || self.destroyed) return self;\n if (typeof handler !== 'function') return self;\n const method = priority ? 'unshift' : 'push';\n events.split(' ').forEach(event => {\n if (!self.eventsListeners[event]) self.eventsListeners[event] = [];\n self.eventsListeners[event][method](handler);\n });\n return self;\n },\n once(events, handler, priority) {\n const self = this;\n if (!self.eventsListeners || self.destroyed) return self;\n if (typeof handler !== 'function') return self;\n function onceHandler() {\n self.off(events, onceHandler);\n if (onceHandler.__emitterProxy) {\n delete onceHandler.__emitterProxy;\n }\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n handler.apply(self, args);\n }\n onceHandler.__emitterProxy = handler;\n return self.on(events, onceHandler, priority);\n },\n onAny(handler, priority) {\n const self = this;\n if (!self.eventsListeners || self.destroyed) return self;\n if (typeof handler !== 'function') return self;\n const method = priority ? 'unshift' : 'push';\n if (self.eventsAnyListeners.indexOf(handler) < 0) {\n self.eventsAnyListeners[method](handler);\n }\n return self;\n },\n offAny(handler) {\n const self = this;\n if (!self.eventsListeners || self.destroyed) return self;\n if (!self.eventsAnyListeners) return self;\n const index = self.eventsAnyListeners.indexOf(handler);\n if (index >= 0) {\n self.eventsAnyListeners.splice(index, 1);\n }\n return self;\n },\n off(events, handler) {\n const self = this;\n if (!self.eventsListeners || self.destroyed) return self;\n if (!self.eventsListeners) return self;\n events.split(' ').forEach(event => {\n if (typeof handler === 'undefined') {\n self.eventsListeners[event] = [];\n } else if (self.eventsListeners[event]) {\n self.eventsListeners[event].forEach((eventHandler, index) => {\n if (eventHandler === handler || eventHandler.__emitterProxy && eventHandler.__emitterProxy === handler) {\n self.eventsListeners[event].splice(index, 1);\n }\n });\n }\n });\n return self;\n },\n emit() {\n const self = this;\n if (!self.eventsListeners || self.destroyed) return self;\n if (!self.eventsListeners) return self;\n let events;\n let data;\n let context;\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n if (typeof args[0] === 'string' || Array.isArray(args[0])) {\n events = args[0];\n data = args.slice(1, args.length);\n context = self;\n } else {\n events = args[0].events;\n data = args[0].data;\n context = args[0].context || self;\n }\n data.unshift(context);\n const eventsArray = Array.isArray(events) ? events : events.split(' ');\n eventsArray.forEach(event => {\n if (self.eventsAnyListeners && self.eventsAnyListeners.length) {\n self.eventsAnyListeners.forEach(eventHandler => {\n eventHandler.apply(context, [event, ...data]);\n });\n }\n if (self.eventsListeners && self.eventsListeners[event]) {\n self.eventsListeners[event].forEach(eventHandler => {\n eventHandler.apply(context, data);\n });\n }\n });\n return self;\n }\n};\n\nfunction updateSize() {\n const swiper = this;\n let width;\n let height;\n const el = swiper.el;\n if (typeof swiper.params.width !== 'undefined' && swiper.params.width !== null) {\n width = swiper.params.width;\n } else {\n width = el.clientWidth;\n }\n if (typeof swiper.params.height !== 'undefined' && swiper.params.height !== null) {\n height = swiper.params.height;\n } else {\n height = el.clientHeight;\n }\n if (width === 0 && swiper.isHorizontal() || height === 0 && swiper.isVertical()) {\n return;\n }\n\n // Subtract paddings\n width = width - parseInt((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.l)(el, 'padding-left') || 0, 10) - parseInt((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.l)(el, 'padding-right') || 0, 10);\n height = height - parseInt((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.l)(el, 'padding-top') || 0, 10) - parseInt((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.l)(el, 'padding-bottom') || 0, 10);\n if (Number.isNaN(width)) width = 0;\n if (Number.isNaN(height)) height = 0;\n Object.assign(swiper, {\n width,\n height,\n size: swiper.isHorizontal() ? width : height\n });\n}\n\nfunction updateSlides() {\n const swiper = this;\n function getDirectionLabel(property) {\n if (swiper.isHorizontal()) {\n return property;\n }\n // prettier-ignore\n return {\n 'width': 'height',\n 'margin-top': 'margin-left',\n 'margin-bottom ': 'margin-right',\n 'margin-left': 'margin-top',\n 'margin-right': 'margin-bottom',\n 'padding-left': 'padding-top',\n 'padding-right': 'padding-bottom',\n 'marginRight': 'marginBottom'\n }[property];\n }\n function getDirectionPropertyValue(node, label) {\n return parseFloat(node.getPropertyValue(getDirectionLabel(label)) || 0);\n }\n const params = swiper.params;\n const {\n wrapperEl,\n slidesEl,\n size: swiperSize,\n rtlTranslate: rtl,\n wrongRTL\n } = swiper;\n const isVirtual = swiper.virtual && params.virtual.enabled;\n const previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;\n const slides = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.e)(slidesEl, `.${swiper.params.slideClass}, swiper-slide`);\n const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;\n let snapGrid = [];\n const slidesGrid = [];\n const slidesSizesGrid = [];\n let offsetBefore = params.slidesOffsetBefore;\n if (typeof offsetBefore === 'function') {\n offsetBefore = params.slidesOffsetBefore.call(swi
700per);\n }\n let offsetAfter = params.slidesOffsetAfter;\n if (typeof offsetAfter === 'function') {\n offsetAfter = params.slidesOffsetAfter.call(swiper);\n }\n const previousSnapGridLength = swiper.snapGrid.length;\n const previousSlidesGridLength = swiper.slidesGrid.length;\n let spaceBetween = params.spaceBetween;\n let slidePosition = -offsetBefore;\n let prevSlideSize = 0;\n let index = 0;\n if (typeof swiperSize === 'undefined') {\n return;\n }\n if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {\n spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiperSize;\n } else if (typeof spaceBetween === 'string') {\n spaceBetween = parseFloat(spaceBetween);\n }\n swiper.virtualSize = -spaceBetween;\n\n // reset margins\n slides.forEach(slideEl => {\n if (rtl) {\n slideEl.style.marginLeft = '';\n } else {\n slideEl.style.marginRight = '';\n }\n slideEl.style.marginBottom = '';\n slideEl.style.marginTop = '';\n });\n\n // reset cssMode offsets\n if (params.centeredSlides && params.cssMode) {\n (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.s)(wrapperEl, '--swiper-centered-offset-before', '');\n (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.s)(wrapperEl, '--swiper-centered-offset-after', '');\n }\n const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;\n if (gridEnabled) {\n swiper.grid.initSlides(slidesLength);\n }\n\n // Calc slides\n let slideSize;\n const shouldResetSlideSize = params.slidesPerView === 'auto' && params.breakpoints && Object.keys(params.breakpoints).filter(key => {\n return typeof params.breakpoints[key].slidesPerView !== 'undefined';\n }).length > 0;\n for (let i = 0; i < slidesLength; i += 1) {\n slideSize = 0;\n let slide;\n if (slides[i]) slide = slides[i];\n if (gridEnabled) {\n swiper.grid.updateSlide(i, slide, slidesLength, getDirectionLabel);\n }\n if (slides[i] && (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.l)(slide, 'display') === 'none') continue; // eslint-disable-line\n\n if (params.slidesPerView === 'auto') {\n if (shouldResetSlideSize) {\n slides[i].style[getDirectionLabel('width')] = ``;\n }\n const slideStyles = getComputedStyle(slide);\n const currentTransform = slide.style.transform;\n const currentWebKitTransform = slide.style.webkitTransform;\n if (currentTransform) {\n slide.style.transform = 'none';\n }\n if (currentWebKitTransform) {\n slide.style.webkitTransform = 'none';\n }\n if (params.roundLengths) {\n slideSize = swiper.isHorizontal() ? (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.f)(slide, 'width', true) : (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.f)(slide, 'height', true);\n } else {\n // eslint-disable-next-line\n const width = getDirectionPropertyValue(slideStyles, 'width');\n const paddingLeft = getDirectionPropertyValue(slideStyles, 'padding-left');\n const paddingRight = getDirectionPropertyValue(slideStyles, 'padding-right');\n const marginLeft = getDirectionPropertyValue(slideStyles, 'margin-left');\n const marginRight = getDirectionPropertyValue(slideStyles, 'margin-right');\n const boxSizing = slideStyles.getPropertyValue('box-sizing');\n if (boxSizing && boxSizing === 'border-box') {\n slideSize = width + marginLeft + marginRight;\n } else {\n const {\n clientWidth,\n offsetWidth\n } = slide;\n slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth);\n }\n }\n if (currentTransform) {\n slide.style.transform = currentTransform;\n }\n if (currentWebKitTransform) {\n slide.style.webkitTransform = currentWebKitTransform;\n }\n if (params.roundLengths) slideSize = Math.floor(slideSize);\n } else {\n slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;\n if (params.roundLengths) slideSize = Math.floor(slideSize);\n if (slides[i]) {\n slides[i].style[getDirectionLabel('width')] = `${slideSize}px`;\n }\n }\n if (slides[i]) {\n slides[i].swiperSlideSize = slideSize;\n }\n slidesSizesGrid.push(slideSize);\n if (params.centeredSlides) {\n slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;\n if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;\n if (i === 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;\n if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;\n if (params.roundLengths) slidePosition = Math.floor(slidePosition);\n if (index % params.slidesPerGroup === 0) snapGrid.push(slidePosition);\n slidesGrid.push(slidePosition);\n } else {\n if (params.roundLengths) slidePosition = Math.floor(slidePosition);\n if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition);\n slidesGrid.push(slidePosition);\n slidePosition = slidePosition + slideSize + spaceBetween;\n }\n swiper.virtualSize += slideSize + spaceBetween;\n prevSlideSize = slideSize;\n index += 1;\n }\n swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter;\n if (rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) {\n wrapperEl.style.width = `${swiper.virtualSize + spaceBetween}px`;\n }\n if (params.setWrapperSize) {\n wrapperEl.style[getDirectionLabel('width')] = `${swiper.virtualSize + spaceBetween}px`;\n }\n if (gridEnabled) {\n swiper.grid.updateWrapperSize(slideSize, snapGrid, getDirectionLabel);\n }\n\n // Remove last grid elements depending on width\n if (!params.centeredSlides) {\n const newSlidesGrid = [];\n for (let i = 0; i < snapGrid.length; i += 1) {\n let slidesGridItem = snapGrid[i];\n if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
700\n if (snapGrid[i] <= swiper.virtualSize - swiperSize) {\n newSlidesGrid.push(slidesGridItem);\n }\n }\n snapGrid = newSlidesGrid;\n if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {\n snapGrid.push(swiper.virtualSize - swiperSize);\n }\n }\n if (isVirtual && params.loop) {\n const size = slidesSizesGrid[0] + spaceBetween;\n if (params.slidesPerGroup > 1) {\n const groups = Math.ceil((swiper.virtual.slidesBefore + swiper.virtual.slidesAfter) / params.slidesPerGroup);\n const groupSize = size * params.slidesPerGroup;\n for (let i = 0; i < groups; i += 1) {\n snapGrid.push(snapGrid[snapGrid.length - 1] + groupSize);\n }\n }\n for (let i = 0; i < swiper.virtual.slidesBefore + swiper.virtual.slidesAfter; i += 1) {\n if (params.slidesPerGroup === 1) {\n snapGrid.push(snapGrid[snapGrid.length - 1] + size);\n }\n slidesGrid.push(slidesGrid[slidesGrid.length - 1] + size);\n swiper.virtualSize += size;\n }\n }\n if (snapGrid.length === 0) snapGrid = [0];\n if (spaceBetween !== 0) {\n const key = swiper.isHorizontal() && rtl ? 'marginLeft' : getDirectionLabel('marginRight');\n slides.filter((_, slideIndex) => {\n if (!params.cssMode || params.loop) return true;\n if (slideIndex === slides.length - 1) {\n return false;\n }\n return true;\n }
700).forEach(slideEl => {\n slideEl.style[key] = `${spaceBetween}px`;\n });\n }\n if (params.centeredSlides && params.centeredSlidesBounds) {\n let allSlidesSize = 0;\n slidesSizesGrid.forEach(slideSizeValue => {\n allSlidesSize += slideSizeValue + (spaceBetween || 0);\n });\n allSlidesSize -= spaceBetween;\n const maxSnap = allSlidesSize - swiperSize;\n snapGrid = snapGrid.map(snap => {\n if (snap <= 0) return -offsetBefore;\n if (snap > maxSnap) return maxSnap + offsetAfter;\n return snap;\n });\n }\n if (params.centerInsufficientSlides) {\n let allSlidesSize = 0;\n slidesSizesGrid.forEach(slideSizeValue => {\n allSlidesSize += slideSizeValue + (spaceBetween || 0);\n });\n allSlidesSize -= spaceBetween;\n if (allSlidesSize < swiperSize) {\n const allSlidesOffset = (swiperSize - allSlidesSize) / 2;\n snapGrid.forEach((snap, snapIndex) => {\n snapGrid[snapIndex] = snap - allSlidesOffset;\n });\n slidesGrid.forEach((snap, snapIndex) => {\n slidesGrid[snapIndex] = snap + allSlidesOffset;\n });\n }\n }\n Object.assign(swiper, {\n slides,\n snapGrid,\n slidesGrid,\n slidesSizesGrid\n });\n if (params.centeredSlides && params.cssMode && !params.centeredSlidesBounds) {\n (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.s)(wrapperEl, '--swiper-centered-offset-before', `${-snapGrid[0]}px`);\n (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.s)(wrapperEl, '--swiper-centered-offset-after', `${swiper.size / 2 - slidesSizesGrid[slidesSizesGrid.length - 1] / 2}px`);\n const addToSnapGrid = -swiper.snapGrid[0];\n const addToSlidesGrid = -swiper.slidesGrid[0];\n swiper.snapGrid = swiper.snapGrid.map(v => v + addToSnapGrid);\n swiper.slidesGrid = swiper.slidesGrid.map(v => v + addToSlidesGrid);\n }\n if (slidesLength !== previousSlidesLength) {\n swiper.emit('slidesLengthChange');\n }\n if (snapGrid.length !== previousSnapGridLength) {\n if (swiper.params.watchOverflow) swiper.checkOverflow();\n swiper.emit('snapGridLengthChange');\n }\n if (slidesGrid.length !== previousSlidesGridLength) {\n swiper.emit('slidesGridLengthChange');\n }\n if (params.watchSlidesProgress) {\n swiper.updateSlidesOffset();\n }\n if (!isVirtual && !params.cssMode && (params.effect === 'slide' || params.effect === 'fade')) {\n const backFaceHiddenClass = `${params.containerModifierClass}backface-hidden`;\n const hasClassBackfaceClassAdded = swiper.el.classList.contains(backFaceHiddenClass);\n if (slidesLength <= params.maxBackfaceHiddenSlides) {\n if (!hasClassBackfaceClassAdded) swiper.el.classList.add(backFaceHiddenClass);\n } else if (hasClassBackfaceClassAdded) {\n swiper.el.classList.remove(backFaceHiddenClass);\n }\n }\n}\n\nfunction updateAutoHeight(speed) {\n const swiper = this;\n const activeSlides = [];\n const isVirtual = swiper.virtual && swiper.params.virtual.enabled;\n let newHeight = 0;\n let i;\n if (typeof speed === 'number') {\n swiper.setTransition(speed);\n } else if (speed === true) {\n swiper.setTransition(swiper.params.speed);\n }\n const getSlideByIndex = index => {\n if (isVirtual) {\n return swiper.slides[swiper.getSlideIndexByData(index)];\n }\n return swiper.slides[index];\n };\n // Find slides currently in view\n if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) {\n if (swiper.params.centeredSlides) {\n (swiper.visibleSlides || []).forEach(sli
700de => {\n activeSlides.push(slide);\n });\n } else {\n for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) {\n const index = swiper.activeIndex + i;\n if (index > swiper.slides.length && !isVirtual) break;\n activeSlides.push(getSlideByIndex(index));\n }\n }\n } else {\n activeSlides.push(getSlideByIndex(swiper.activeIndex));\n }\n\n // Find new height from highest slide in view\n for (i = 0; i < activeSlides.length; i += 1) {\n if (typeof activeSlides[i] !== 'undefined') {\n const height = activeSlides[i].offsetHeight;\n newHeight = height > newHeight ? height : newHeight;\n }\n }\n\n // Update Height\n if (newHeight || newHeight === 0) swiper.wrapperEl.style.height = `${newHeight}px`;\n}\n\nfunction updateSlidesOffset() {\n const swiper = this;\n const slides = swiper.slides;\n // eslint-disable-next-line\n const minusOffset = swiper.isElement ? swiper.isHorizontal() ? swiper.wrapperEl.offsetLeft : swiper.wrapperEl.offsetTop : 0;\n for (let i = 0; i < slides.length; i += 1) {\n slides[i].swiperSlideOffset = (swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop) - minusOffset - swiper.cssOverflowAdjustment();\n }\n}\n\nfunction updateSlidesProgress(translate) {\n if (translate === void 0) {\n translate = this && this.translate || 0;\n }\n const swiper = this;\n const params = swiper.params;\n const {\n slides,\n rtlTranslate: rtl,\n snapGrid\n } = swiper;\n if (slides.length === 0) return;\n if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();\n let offsetCenter = -translate;\n if (rtl) offsetCenter = translate;
700\n\n // Visible Slides\n slides.forEach(slideEl => {\n slideEl.classList.remove(params.slideVisibleClass);\n });\n swiper.visibleSlidesIndexes = [];\n swiper.visibleSlides = [];\n let spaceBetween = params.spaceBetween;\n if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {\n spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiper.size;\n } else if (typeof spaceBetween === 'string') {\n spaceBetween = parseFloat(spaceBetween);\n }\n for (let i = 0; i < slides.length; i += 1) {\n const slide = slides[i];\n let slideOffset = slide.swiperSlideOffset;\n if (params.cssMode && params.centeredSlides) {\n slideOffset -= slides[0].swiperSlideOffset;\n }\n const slideProgress = (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + spaceBetween);\n const originalSlideProgress = (offsetCenter - snapGrid[0] + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + spaceBetween);\n const slideBefore = -(offsetCenter - slideOffset);\n const slideAfter = slideBefore + swiper.slidesSizesGrid[i];\n const isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size;\n if (isVisible) {\n swiper.visibleSlides.push(slide);\n swiper.visibleSlidesIndexes.push(i);\n slides[i].classList.add(params.slideVisibleClass);\n }\n slide.progress = rtl ? -slideProgress : slideProgress;\n slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress;\n }\n}\n\nfunction updateProgress(translate) {\n const swiper = this;\n if (typeof translate === 'undefined') {\n const multiplier = swiper.rtlTranslate ? -1 : 1;\n // eslint-disable-next-line\n translate = swiper && swiper.translate && swiper.translate * multiplier || 0;\n }\n const params = swiper.params;\n const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();\n let {\n progress,\n isBeginning,\n isEnd,\n progressLoop\n } = swiper;\n const wasBeginning = isBeginning;\n const wasEnd = isEnd;\n if (translatesDiff === 0) {\n progress = 0;\n isBeginning = true;\n isEnd = true;\n } else {\n progress = (translate - swiper.minTranslate()) / translatesDiff;\n const isBeginningRounded = Math.abs(translate - swiper.minTranslate()) < 1;\n const isEndRounded = Math.abs(translate - swiper.maxTranslate()) < 1;\n isBeginning = isBeginningRounded || progress <= 0;\n isEnd = isEndRounded || progress >= 1;\n if (isBeginningRounded) progress = 0;\n if (isEndRounded) progress = 1;\n }\n if (params.loop) {\n const firstSlideIndex = swiper.getSlideIndexByData(0);\n const lastSlideIndex = swiper.getSlideIndexByData(swiper.slides.length - 1);\n const firstSlideTranslate = swiper.slidesGrid[firstSlideIndex];\n const lastSlideTranslate = swiper.slidesGrid[lastSlideIndex];\n const translateMax = swiper.slidesGrid[swiper.slidesGrid.length - 1];\n const translateAbs = Math.abs(translate);\n if (translateAbs >= firstSlideTranslate) {\n progressLoop = (translateAbs - firstSlideTranslate) / translateMax;\n } else {\n progressLoop = (translateAbs + translateMax - lastSlideTranslate) / translateMax;\n }\n if (progressLoop > 1) progressLoop -= 1;\n }\n Object.assign(swiper, {\n progress,\n progressLoop,\n isBeginning,\n isEnd\n });\n if (params.watchSlidesProgress || params.centeredSlides && params.autoHeight) swiper.updateSlidesProgress(translate);\n if (isBeginning && !wasBeginning) {\n swiper.emit('reachBeginning toEdge');\n }\n if (isEnd && !wasEnd) {\n swiper.emit('reachEnd toEdge');\n }\n if (wasBeginning && !isBeginning || wasEnd && !isEnd) {\n swiper.emit('fromEdge');\n }\n swiper.emit('progress', progress);\n}\n\nfunction updateSlidesClasses() {\n const swiper = this;\n const {\n slides,\n params,\n slidesEl,\n activeIndex\n } = swiper;\n const isVirtual = swiper.virtual && params.virtual.enabled;\n const getFilteredSlide = selector => {\n return (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.e)(slidesEl, `.${params.slideClass}${selector}, swiper-slide${selector}`)[0];\n };
700\n slides.forEach(slideEl => {\n slideEl.classList.remove(params.slideActiveClass, params.slideNextClass, params.slidePrevClass);\n });\n let activeSlide;\n if (isVirtual) {\n if (params.loop) {\n let slideIndex = activeIndex - swiper.virtual.slidesBefore;\n if (slideIndex < 0) slideIndex = swiper.virtual.slides.length + slideIndex;\n if (slideIndex >= swiper.virtual.slides.length) slideIndex -= swiper.virtual.slides.length;\n activeSlide = getFilteredSlide(`[data-swiper-slide-index=\"${slideIndex}\"]`);\n } else {\n activeSlide = getFilteredSlide(`[data-swiper-slide-index=\"${activeIndex}\"]`);\n }\n } else {\n activeSlide = slides[activeIndex];\n }\n if (activeSlide) {\n // Active classes\n activeSlide.classList.add(params.slideActiveClass);\n\n // Next Slide\n let nextSlide = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.m)(activeSlide, `.${params.slideClass}, swiper-slide`)[0];\n if (params.loop && !nextSlide) {\n nextSlide = slides[0];\n }\n if (nextSlide) {\n nextSlide.classList.add(params.slideNextClass);\n }\n // Prev Slide\n let prevSlide = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.o)(activeSlide, `.${params.slideClass}, swiper-slide`)[0];\n if (params.loop && !prevSlide === 0) {\n prevSlide = slides[slides.length - 1];\n }\n if (prevSlide) {\n prevSlide.classList.add(params.slidePrevClass);\n }\n }\n swiper.emitSlidesClasses();\n}\n\nconst processLazyPreloader = (swiper, imageEl) => {\n if (!swiper || swiper.destroyed || !swiper.params) return;\n const slideSelector = () => swiper.isElement ? `swiper-slide` : `.${swiper.params.slideClass}`;\n const slideEl = imageEl.closest(slideSelector());\n if (slideEl) {\n let lazyEl = slideEl.querySelector(`.${swiper.params.lazyPreloaderClass}`);\n if (!lazyEl && swiper.isElement) {\n if (slideEl.shadowRoot) {\n lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`);\n } else {\n // init later\n requestAnimationFrame(() => {\n if (slideEl.shadowRoot) {\n lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`);\n if (lazyEl) lazyEl.remove();\n }\n });\n }\n }\n if (lazyEl) lazyEl.remove();\n }\n};\nconst unlazy = (swiper, index) => {\n if (!swiper.slides[index]) return;\n const imageEl = swiper.slides[index].querySelector('[loading=\"lazy\"]');\n if (imageEl) imageEl.removeAttribute('loading');\n};\nconst preload = swiper => {\n if (!swiper || swiper.destroyed || !swiper.params) return;\n let amount = swiper.params.lazyPreloadPrevNext;\n const len = swiper.slides.length;\n if (!len || !amount || amount < 0) return;\n amount = Math.min(amount, len);\n const slidesPerView = swiper.params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(swiper.params.slidesPerView);\n const activeIndex = swiper.activeIndex;\n if (swiper.params.grid && swiper.params.grid.rows > 1) {\n const activeColumn = activeIndex;\n const preloadColumns = [activeColumn - amount];\n preloadColumns.push(...Array.from({\n length: amount\n }).map((_, i) => {\n return activeColumn + slidesPerView + i;\n }));\n swiper.slides.forEach((slideEl, i) => {\n if (preloadColumns.includes(slideEl.column)) unlazy(swiper, i);\n });\n return;\n }\n const slideIndexLastInView = activeIndex + slidesPerView - 1;\n if (swiper.params.rewind || swiper.params.loop) {\n for (let i = activeIndex - amount; i <= slideIndexLastInView + amount; i += 1) {\n const realIndex = (i % len + len) % len;\n if (realIndex < activeIndex || realIndex > slideIndexLastInView) unlazy(swiper, realIndex);\n }\n } else {\n for (let i = Math.max(activeIndex - amount, 0); i <= Math.min(slideIndexLastInView + amount, len - 1); i += 1) {\n if (i !== activeIndex && (i > slideIndexLastInView || i < activeIndex)) {\n unlazy(swiper, i);\n }\n }\n }\n};\n\nfunction getActiveIndexByTranslate(swiper) {\n const {\n slidesGrid,\n params\n } = swiper;\n const translate = swiper.rtlTranslate ? swiper.translate : -swi
700per.translate;\n let activeIndex;\n for (let i = 0; i < slidesGrid.length; i += 1) {\n if (typeof slidesGrid[i + 1] !== 'undefined') {\n if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) {\n activeIndex = i;\n } else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) {\n activeIndex = i + 1;\n }\n } else if (translate >= slidesGrid[i]) {\n activeIndex = i;\n }\n }\n // Normalize slideIndex\n if (params.normalizeSlideIndex) {\n if (activeIndex < 0 || typeof activeIndex === 'undefined') activeIndex = 0;\n }\n return activeIndex;\n}\nfunction updateActiveIndex(newActiveIndex) {\n const swiper = this;\n const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;\n const {\n snapGrid,\n params,\n activeIndex: previousIndex,\n realIndex: previousRealIndex,\n snapIndex: previousSnapIndex\n } = swiper;\n let activeIndex = newActiveIndex;\n let snapIndex;\n const getVirtualRealIndex = aIndex => {\n let realIndex = aIndex - swiper.virtual.slidesBefore;\n if (realIndex < 0) {\n realIndex = swiper.virtual.slides.length + realIndex;\n }\n if (realIndex >= swiper.virtual.slides.length) {\n realIndex -= swiper.virtual.slides.length;\n }\n return realIndex;\n };\n if (typeof activeIndex === 'undefined') {\n activeIndex = getActiveIndexByTranslate(swiper);\n }\n if (snapGrid.indexOf(translate) >= 0) {\n snapIndex = snapGrid.indexOf(translate);\n } else {\n const skip = Math.min(params.slidesPerGroupSkip, activeIndex);\n snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);\n }\n if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;\n if (activeIndex === previousIndex) {\n if (snapIndex !== previousSnapIndex) {\n swiper.snapIndex = snapIndex;\n swiper.emit('snapIndexChange');\n }\n if (swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {\n swiper.realIndex = getVirtualRealIndex(activeIndex);\n }\n return;\n }\n // Get real index\n let realIndex;\n if (swiper.virtual && params.virtual.enabled && params.loop) {\n realIndex = getVirtualRealIndex(activeIndex);\n } else if (swiper.slides[activeIndex]) {\n realIndex = parseInt(swiper.slides[activeIndex].getAttribute('data-swiper-slide-index') || activeIndex, 10);\n } else {\n realIndex = activeIndex;\n }\n Object.assign(swiper, {\n previousSnapIndex,\n snapIndex,\n previousRealIndex,\n realIndex,\n previousIndex,\n activeIndex\n });\n if (swiper.initialized) {\n preload(swiper);\n }\n swiper.emit('activeIndexChange');\n swiper.emit('snapIndexChange');\n if (swiper.initialized || swiper.params.runCallbacksOnInit) {\n if (previousRealIndex !== realIndex) {\n swiper.emit('realIndexChange');\n }\n swiper.emit('slideChange');\n }\n}\n\nfunction updateClickedSlide(el, path) {\n const swiper = this;\n const params = swiper.params;\n let slide = el.closest(`.${params.slideClass}, swiper-slide`);\n if (!slide && swiper.isElement && path && path.length > 1 && path.includes(el)) {\n [...path.slice(path.indexOf(el) + 1, path.length)].forEac
700h(pathEl => {\n if (!slide && pathEl.matches && pathEl.matches(`.${params.slideClass}, swiper-slide`)) {\n slide = pathEl;\n }\n });\n }\n let slideFound = false;\n let slideIndex;\n if (slide) {\n for (let i = 0; i < swiper.slides.length; i += 1) {\n if (swiper.slides[i] === slide) {\n slideFound = true;\n slideIndex = i;\n break;\n }\n }\n }\n if (slide && slideFound) {\n swiper.clickedSlide = slide;\n if (swiper.virtual && swiper.params.virtual.enabled) {\n swiper.clickedIndex = parseInt(slide.getAttribute('data-swiper-slide-index'), 10);\n } else {\n swiper.clickedIndex = slideIndex;\n }\n } else {\n swiper.clickedSlide = undefined;\n swiper.clickedIndex = undefined;\n return;\n }\n if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) {\n swiper.slideToClickedSlide();\n }\n}\n\nvar update = {\n updateSize,\n updateSlides,\n updateAutoHeight,\n updateSlidesOffset,\n updateSlidesProgress,\n updateProgress,\n updateSlidesClasses,\n updateActiveIndex,\n updateClickedSlide\n};\n\nfunction getSwiperTranslate(axis) {\n if (axis === void 0) {\n axis = this.isHorizontal() ? 'x' : 'y';\n }\n const swiper = this;\n const {\n params,\n rtlTranslate: rtl,\n translate,\n wrapperEl\n } = swiper;\n if (params.virtualTranslate) {\n return rtl ? -translate : translate;\n }\n if (params.cssMode) {\n return translate;\n }\n let currentTranslate = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.h)(wrapperEl, axis);\n currentTranslate += swiper.cssOverflowAdjustment();\n if (rtl) currentTranslate = -currentTranslate;\n return currentTranslate || 0;\n}\n\nfunction setTranslate(translate, byController) {\n const swiper = this;\n const {\n rtlTranslate: rtl,\n params,\n wrapperEl,\n progress\n }
700 = swiper;\n let x = 0;\n let y = 0;\n const z = 0;\n if (swiper.isHorizontal()) {\n x = rtl ? -translate : translate;\n } else {\n y = translate;\n }\n if (params.roundLengths) {\n x = Math.floor(x);\n y = Math.floor(y);\n }\n swiper.previousTranslate = swiper.translate;\n swiper.translate = swiper.isHorizontal() ? x : y;\n if (params.cssMode) {\n wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y;\n } else if (!params.virtualTranslate) {\n if (swiper.isHorizontal()) {\n x -= swiper.cssOverflowAdjustment();\n } else {\n y -= swiper.cssOverflowAdjustment();\n }\n wrapperEl.style.transform = `translate3d(${x}px, ${y}px, ${z}px)`;\n }\n\n // Check if we need to update progress\n let newProgress;\n const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();\n if (translatesDiff === 0) {\n newProgress = 0;\n } else {\n newProgress = (translate - swiper.minTranslate()) / translatesDiff;\n }\n if (newProgress !== progress) {\n swiper.updateProgress(translate);\n }\n swiper.emit('setTranslate', swiper.translate, byController);\n}\n\nfunction minTranslate() {\n return -this.snapGrid[0];\n}\n\nfunction maxTranslate() {\n return -this.snapGrid[this.snapGrid.length - 1];\n}\n\nfunction translateTo(translate, speed, runCallbacks, translateBounds, internal) {\n if (translate === void 0) {\n translate = 0;\n }\n if (speed === void 0) {\n speed = this.params.speed;\n }\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n if (translateBounds === void 0) {\n translateBounds = true;\n }\n const swiper = this;\n const {\n params,\n wrapperEl\n } = swiper;\n if (swiper.animating && params.preventInteractionOnTransition) {\n return false;\n }\n const minTranslate = swiper.minTranslate();\n const maxTranslate = swiper.maxTranslate();\n let newTranslate;\n if (translateBounds && translate > minTranslate) newTranslate = minTranslate;else if (translateBounds && translate < maxTranslate) newTranslate = maxTranslate;else newTranslate = translate;\n\n // Update progress\n swiper.updateProgress(newTranslate);\n if (params.cssMode) {\n const isH = swiper.isHorizontal();\n if (speed === 0) {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;\n } else {\n if (!swiper.support.smoothScroll) {\n (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.p)({\n swiper,\n targetPosition: -newTranslate,\n side: isH ? 'left' : 'top'\n });\n return true;\n }\n wrapperEl.scrollTo({\n [isH ? 'left' : 'top']: -newTranslate,\n behavior: 'smooth'\n });\n }\n return true;\n }\n if (speed === 0) {\n swiper.setTransition(0);\n swiper.setTranslate(newTranslate);\n if (runCallbacks) {\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.emit('transitionEnd');\n }\n } else {\n swiper.setTransition(speed);\n swiper.setTranslate(newTranslate);\n if (runCallbacks) {\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.emit('transitionStart');\n }\n if (!swiper.animating) {\n swiper.animating = true;\n if (!swiper.onTranslateToWrapperTransitionEnd) {\n swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) {\n if (!swiper || swiper.destroyed) return;\n if (e.target !== this) return;\n swiper.wrapperEl.removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);\n swiper.onTranslateToWrapperTransitionEnd = null;\n delete swiper.onTranslateToWrapperTransitionEnd;\n if (runCallbacks) {\n swiper.emit('transitionEnd');\n }\n };\n }\n swiper.wrapperEl.addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);\n }\n }\n return true;\n}\n\nvar translate = {\n getTranslate: getSwiperTranslate,\n setTranslate,\n minTranslate,\n maxTranslate,\n translateTo\n};\n\nfunction setTransition(duration, byController) {\n const swiper = this;\n if (!swiper.params.cssMode) {\n swiper.wrapperEl.style.transitionDuration = `${duration}ms`;\n swiper.wrapperEl.style.transitionDelay = duration === 0 ? `0ms` : '';\n }\n swiper.emit('setTransition', duration, byController);\n}\n\nfunction transitionEmit(_ref) {\n let {\n swiper,\n runCallbacks,\n direction,\n step\n } = _ref;\n const {\n activeIndex,\n previousIndex\n } = swiper;\n let dir = direction;\n if (!dir) {\n if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';\n }\n swiper.emit(`transition${step}`);\n if (runCallbacks && activeIndex !== previousIndex) {\n if (dir === 'reset') {\n swiper.emit(`slideResetTransition${step}`);\n return;\n }\n swiper.emit(`slideChangeTransition${step}`);\n if (dir === 'next') {\n swiper.emit(`slideNextTransition${step}`);\n } else {\n swiper.emit(`slidePrevTransition${step}`);\n }\n }\n}\n\nfunction transitionStart(runCallbacks, direction) {\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n const swiper = this;\n const {\n params\n } = swiper;\n if (params.cssMode) return;\n if (params.autoHeight) {\n swiper.updateAutoHeight();\n }\n transitionEmit({\n swiper,\n runCallbacks,\n direction,\n step: 'Start'\n });\n}\n\nfunction transitionEnd(runCallbacks, direction) {\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n const swiper = this;\n const {\n params\n } = swiper;\n swiper.animating = false;\n if (params.cssMode) return;\n swiper.setTransition(0);\n transitionEmit({\n swiper,\n runCallbacks,\n direction,\n step: 'End'\n });\n}\n\nvar transition = {\n setTransition,\n transitionStart,\n transitionEnd\n};\n\nfunction slideTo(index, speed, runCallbacks, internal, initial) {\n if (index === void 0) {\n index = 0;\n }\n if (speed === void 0) {\n speed = this.params.speed;\n }\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n if (typeof index === 'string') {\n index = parseInt(index, 10);\n }\n const swiper = this;\n let slideIndex = index;\n if (slideIndex < 0) slideIndex = 0;\n const {\n params,\n snapGrid,\n slidesGrid,\n previousIndex,\n activeIndex,\n rtlTranslate: rtl,\n wrapperEl,\n enabled\n }
700 = swiper;\n if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial) {\n return false;\n }\n const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);\n let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);\n if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;\n const translate = -snapGrid[snapIndex];\n // Normalize slideIndex\n if (params.normalizeSlideIndex) {\n for (let i = 0; i < slidesGrid.length; i += 1) {\n const normalizedTranslate = -Math.floor(translate * 100);\n const normalizedGrid = Math.floor(slidesGrid[i] * 100);\n const normalizedGridNext = Math.floor(slidesGrid[i + 1] * 100);\n if (typeof slidesGrid[i + 1] !== 'undefined') {\n if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext - (normalizedGridNext - normalizedGrid) / 2) {\n slideIndex = i;\n } else if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext) {\n slideIndex = i + 1;\n }\n } else if (normalizedTranslate >= normalizedGrid) {\n slideIndex = i;\n }\n }\n }\n // Directions locks\n if (swiper.initialized && slideIndex !== activeIndex) {\n if (!swiper.allowSlideNext && (rtl ? translate > swiper.translate && translate > swiper.minTranslate() : translate < swiper.translate && translate < swiper.minTranslate())) {\n return false;\n }\n if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) {\n if ((activeIndex || 0) !== slideIndex) {\n return false;\n }\n }\n }\n if (slideIndex !== (previousIndex || 0) && runCallbacks) {\n swiper.emit('beforeSlideChangeStart');\n }\n\n // Update progress\n swiper.updateProgress(translate);\n let direction;\n if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset';\n\n // Update Index\n if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) {\n swiper.updateActiveIndex(slideIndex);\n // Update Height\n if (params.autoHeight) {\n swiper.updateAutoHeight();\n }\n swiper.updateSlidesClasses();\n if (params.effect !== 'slide') {\n swiper.setTranslate(translate);\n }\n if (direction !== 'reset') {\n swiper.transitionStart(runCallbacks, direction);\n swiper.transitionEnd(runCallbacks, direction);\n }\n return false;\n }\n if (params.cssMode) {\n const isH = swiper.isHorizontal();\n const t = rtl ? translate : -translate;\n if (speed === 0) {\n const isVirtual = swiper.virtual && swiper.params.virtual.enabled;\n if (isVirtual) {\n swiper.wrapperEl.style.scrollSnapType = 'none';\n swiper._immediateVirtual = true;\n }\n if (isVirtual && !swiper._cssModeVirtualInitialSet && swiper.params.initialSlide > 0) {\n swiper._cssModeVirtualInitialSet = true;\n requestAnimationFrame(() => {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;\n });\n } else {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;\n }\n if (isVirtual) {\n requestAnimationFrame(() => {\n swiper.wrapperEl.style.scrollSnapType = '';\n swiper._immediateVirtual = false;\n });\n }\n } else {\n if (!swiper.support.smoothScroll) {\n (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.p)({\n swiper,\n targetPosition: t,\n side: isH ? 'left' : 'top'\n });\n return true;\n }\n wrapperEl.scrollTo({\n [isH ? 'left' : 'top']: t,\n behavior: 'smooth'\n });\n }\n return true;\n }\n swiper.setTransition(speed);\n swiper.setTranslate(translate);\n swiper.updateActiveIndex(slideIndex);\n swiper.updateSlidesClasses();\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.transitionStart(runCallbacks, direction);\n if (speed === 0) {\n swiper.transitionEnd(runCallbacks, direction);\n } else if (!swiper.animating) {\n swiper.animating = true;\n if (!swiper.onSlideToWrapperTransitionEnd) {\n swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) {\n if (!swiper || swiper.destroyed) return;\n if (e.target !== this) return;\n swiper.wrapperEl.removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);\n swiper.onSlideToWrapperTransitionEnd = null;\n delete swiper.onSlideToWrapperTransitionEnd;\n swiper.transitionEnd(runCallbacks, direction);\n };\n }\n swiper.wrapperEl.addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);\n }\n return true;\n}\n\nfunction slideToLoop(index, speed, runCallbacks, internal) {\n if (index === void 0) {\n index = 0;\n }\n if (speed === void 0) {\n speed = this.params.speed;\n }\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n if (typeof index === 'string') {\n const indexAsNumber = parseInt(index, 10);\n index = indexAsNumber;\n }\n const swiper = this;\n let newIndex = index;\n if (swiper.params.loop) {\n if (swiper.virtual && swiper.params.virtual.enabled) {\n // eslint-disable-next-line\n newIndex = newIndex + swiper.virtual.slidesBefore;\n } else {\n newIndex = swiper.getSlideIndexByData(newIndex);\n }\n }\n return swiper.slideTo(newIndex, speed, runCallbacks, internal);\n}\n\n/* eslint no-unused-vars: \"off\" */\nfunction slideNext(speed, runCallbacks, internal) {\n if (speed === void 0) {\n speed = this.params.speed;\n }\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n const swiper = this;\n const {\n enabled,\n params,\n animating\n } = swiper;\n if (!enabled) return swiper;\n let perGroup = params.slidesPerGroup;\n if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {\n perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1);\n }\n const increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : perGroup;\n const isVirtual = swiper.virtual && params.virtual.enabled;\n if (params.loop) {\n if (animating && !isVirtual && params.loopPreventsSliding) return false;\n swiper.loopFix({\n direction: 'next'\n });\n // eslint-disable-next-line\n swiper._clientLeft = swiper.wrapperEl.clientLeft;\n if (swiper.activeIndex === swiper.slides.length - 1 && params.cssMode) {\n requestAnimationFrame(() =>
700 {\n swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);\n });\n return true;\n }\n }\n if (params.rewind && swiper.isEnd) {\n return swiper.slideTo(0, speed, runCallbacks, internal);\n }\n return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);\n}\n\n/* eslint no-unused-vars: \"off\" */\nfunction slidePrev(speed, runCallbacks, internal) {\n if (speed === void 0) {\n speed = this.params.speed;\n }\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n const swiper = this;\n const {\n params,\n snapGrid,\n slidesGrid,\n rtlTranslate,\n enabled,\n animating\n } = swiper;\n if (!enabled) return swiper;\n const isVirtual = swiper.virtual && params.virtual.enabled;\n if (params.loop) {\n if (animating && !isVirtual && params.loopPreventsSliding) return false;\n swiper.loopFix({\n direction: 'prev'\n });\n // eslint-disable-next-line\n swiper._clientLeft = swiper.wrapperEl.clientLeft;\n }\n const translate = rtlTranslate ? swiper.translate : -swiper.translate;\n function normalize(val) {\n if (val < 0) return -Math.floor(Math.abs(val));\n return Math.floor(val);\n }\n const normalizedTranslate = normalize(translate);\n const normalizedSnapGrid = snapGrid.map(val => normalize(val));\n let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];\n if (typeof prevSnap === 'undefined' && params.cssMode) {\n let prevSnapIndex;\n snapGrid.forEach((snap, snapIndex) => {\n if (normalizedTranslate >= snap) {\n // prevSnap = snap;\n prevSnapIndex = snapIndex;\n }\n });\n if (typeof prevSnapIndex !== 'undefined') {\n prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];\n }\n }\n let prevIndex = 0;\n if (typeof prevSnap !== 'undefined') {\n prevIndex = slidesGrid.indexOf(prevSnap);\n if (prevIndex < 0) prevIndex = swiper.activeIndex - 1;\n if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {\n prevIndex = prevIndex - swiper.slidesPerViewDynamic('previous', true) + 1;\n prevIndex = Math.max(prevIndex, 0);\n }\n }\n if (params.rewind && swiper.isBeginning) {\n const lastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1;\n return swiper.slideTo(lastIndex, speed, runCallbacks, internal);\n } else if (params.loop && swiper.activeIndex === 0 && params.cssMode) {\n requestAnimationFrame(() => {\n swiper.slideTo(prevIndex, speed, runCallbacks, internal);\n });\n return true;\n }\n return swiper.slideTo(prevIndex, speed, runCallbacks, internal);\n}\n\n/* eslint no-unused-vars: \"off\" */\nfunction slideReset(speed, runCallbacks, internal) {\n if (speed === void 0) {\n speed = this.params.speed;\n }\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n const swiper = this;\n return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);\n}\n\n/* eslint no-unused-vars: \"off\" */\nfunction slideToClosest(speed, runCallbacks, internal, threshold) {\n if (speed === void 0) {\n speed = this.params.speed;\n }\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n if (threshold === void 0) {\n threshold = 0.5;\n }\n const swiper = this;\n let index = swiper.activeIndex;\n const skip = Math.min(swiper.params.slidesPerGroupSkip, index);\n const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);\n const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;\n if (translate >= swiper.snapGrid[snapIndex]) {\n // The current translate is on or after the current snap index, so the choice\n // is between the current index and the one after it.\n const currentSnap = swiper.snapGrid[snapIndex];\n const nextSnap = swiper.snapGrid[snapIndex + 1];\n if (translate - currentSnap > (nextSnap - currentSnap) * threshold) {\n index += swiper.params.slidesPerGroup;\n }\n } else {\n // The current translate is before the current snap index, so the choice\n // is between the current index and the one before it.\n const prevSnap = swiper.snapGrid[snapIndex - 1];\n const currentSnap = swiper.snapGrid[snapIndex];\n if (translate - prevSnap <= (currentSnap - prevSnap) * threshold) {\n index -= swiper.params.slidesPerGroup;\n }\n }\n index = Math.max(index, 0);\n index = Math.min(index, swiper.slidesGrid.length - 1);\n return swiper.slideTo(index, speed, runCallbacks, internal);\n}\n\nfunction slideToClickedSlide() {\n const swiper = this;\n const {\n params,\n slidesEl\n } = swiper;\n const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;\n let slideToIndex = swiper.clickedIndex;\n let realIndex;\n const slideSelector = swiper.isElement ? `swiper-slide` : `.${params.slideClass}`;\n if (params.loop) {\n if (swiper.animating) return;\n realIndex = parseInt(swiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10);\n if (params.centeredSlides) {\n if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {\n swiper.loopFix();\n slideToIndex = swiper.getSlideIndex((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.e)(slidesEl, `${slideSelector}[data-swiper-slide-index=\"${realIndex}\"]`)[0]);\n (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.n)(() =>
700 {\n swiper.slideTo(slideToIndex);\n });\n } else {\n swiper.slideTo(slideToIndex);\n }\n } else if (slideToIndex > swiper.slides.length - slidesPerView) {\n swiper.loopFix();\n slideToIndex = swiper.getSlideIndex((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.e)(slidesEl, `${slideSelector}[data-swiper-slide-index=\"${realIndex}\"]`)[0]);\n (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.n)(() => {\n swiper.slideTo(slideToIndex);\n });\n } else {\n swiper.slideTo(slideToIndex);\n }\n } else {\n swiper.slideTo(slideToIndex);\n }\n}\n\nvar slide = {\n slideTo,\n slideToLoop,\n slideNext,\n slidePrev,\n slideReset,\n slideToClosest,\n slideToClickedSlide\n};\n\nfunction loopCreate(slideRealIndex) {\n const swiper = this;\n const {\n params,\n slidesEl\n } = swiper;\n if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;\n const slides = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.e)(slidesEl, `.${params.slideClass}, swiper-slide`);\n slides.forEach((el, index) => {\n el.setAttribute('data-swiper-slide-index', index);\n });\n swiper.loopFix({\n slideRealIndex,\n direction: params.centeredSlides ? undefined : 'next'\n });\n}\n\nfunction loopFix(_temp) {\n let {\n slideRealIndex,\n slideTo = true,\n direction,\n setTranslate,\n activeSlideIndex,\n byController,\n byMousewheel\n } = _temp === void 0 ? {} : _temp;\n const swiper = this;\n if (!swiper.params.loop) return;\n swiper.emit('beforeLoopFix');\n const {\n slides,\n allowSlidePrev,\n allowSlideNext,\n slidesEl,\n params\n } = swiper;\n swiper.allowSlidePrev = true;\n swiper.allowSlideNext = true;\n if (swiper.virtual && params.virtual.enabled) {\n if (slideTo) {\n if (!params.centeredSlides && swiper.snapIndex === 0) {\n swiper.slideTo(swiper.virtual.slides.length, 0, false, true);\n } else if (params.centeredSlides && swiper.snapIndex < params.slidesPerView) {\n swiper.slideTo(swiper.virtual.slides.length + swiper.snapIndex, 0, false, true);\n } else if (swiper.snapIndex === swiper.snapGrid.length - 1) {\n swiper.slideTo(swiper.virtual.slidesBefore, 0, false, true);\n }\n }\n swiper.allowSlidePrev = allowSlidePrev;\n swiper.allowSlideNext = allowSlideNext;\n swiper.emit('loopFix');\n return;\n }\n const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(params.slidesPerView, 10));\n let loopedSlides = params.loopedSlides || slidesPerView;\n if (loopedSlides % params.slidesPerGroup !== 0) {\n loopedSlides += params.slidesPerGroup - loopedSlides % params.slidesPerGroup;\n }\n swiper.loopedSlides = loopedSlides;\n const prependSlidesIndexes = [];\n const appendSlidesIndexes = [];\n let activeIndex = swiper.activeIndex;\n if (typeof activeSlideIndex === 'undefined') {\n activeSlideIndex = swiper.getSlideIndex(swiper.slides.filter(el => el.classList.contains(params.slideActiveClass))[0]);\n } else {\n activeIndex = activeSlideIndex;\n }\n const isNext = direction === 'next' || !direction;\n const isPrev = direction === 'prev' || !direction;\n let slidesPrepended = 0;\n let slidesAppended = 0;\n // prepend last slides before start\n if (activeSlideIndex < loopedSlides) {\n slidesPrepended = Math.max(loopedSlides - activeSlideIndex, params.slidesPerGroup);\n for (let i = 0; i < loopedSlides - activeSlideIndex; i += 1) {\n const index = i - Math.floor(i / slides.length) * slides.length;\n prependSlidesIndexes.push(slides.length - index - 1);\n }\n } else if (activeSlideIndex /* + slidesPerView */ > swiper.slides.length - loopedSlides * 2) {\n slidesAppended = Math.max(activeSlideIndex - (swiper.slides.length - loopedSlides * 2), params.slidesPerGroup);\n for (let i = 0; i < slidesAppended; i += 1) {\n const index = i - Math.floor(i / slides.length) * slides.length;\n appendSlidesIndexes.push(index);\n }\n }
700\n if (isPrev) {\n prependSlidesIndexes.forEach(index => {\n swiper.slides[index].swiperLoopMoveDOM = true;\n slidesEl.prepend(swiper.slides[index]);\n swiper.slides[index].swiperLoopMoveDOM = false;\n });\n }\n if (isNext) {\n appendSlidesIndexes.forEach(index => {\n swiper.slides[index].swiperLoopMoveDOM = true;\n slidesEl.append(swiper.slides[index]);\n swiper.slides[index].swiperLoopMoveDOM = false;\n });\n }\n swiper.recalcSlides();\n if (params.slidesPerView === 'auto') {\n swiper.updateSlides();\n }\n if (params.watchSlidesProgress) {\n swiper.updateSlidesOffset();\n }\n if (slideTo) {\n if (prependSlidesIndexes.length > 0 && isPrev) {\n if (typeof slideRealIndex === 'undefined') {\n const currentSlideTranslate = swiper.slidesGrid[activeIndex];\n const newSlideTranslate = swiper.slidesGrid[activeIndex + slidesPrepended];\n const diff = newSlideTranslate - currentSlideTranslate;\n if (byMousewheel) {\n swiper.setTranslate(swiper.translate - diff);\n } else {\n swiper.slideTo(activeIndex + slidesPrepended, 0, false, true);\n if (setTranslate) {\n swiper.touches[swiper.isHorizontal() ? 'startX' : 'startY'] += diff;\n swiper.touchEventsData.currentTranslate = swiper.translate;\n }\n }\n } else {\n if (setTranslate) {\n swiper.slideToLoop(slideRealIndex, 0, false, true);\n swiper.touchEventsData.currentTranslate = swiper.translate;\n }\n }\n } else if (appendSlidesIndexes.length > 0 && isNext) {\n if (typeof slideRealIndex === 'undefined') {\n const currentSlideTranslate = swiper.slidesGrid[activeIndex];\n const newSlideTranslate = swiper.slidesGrid[activeIndex - slidesAppended];\n const diff = newSlideTranslate - currentSlideTranslate;\n if (byMousewheel) {\n swiper.setTranslate(swiper.translate - diff);\n } else {\n swiper.slideTo(activeIndex - slidesAppended, 0, false, true);\n if (setTranslate) {\n swiper.touches[swiper.isHorizontal() ? 'startX' : 'startY'] += diff;\n swiper.touchEventsData.currentTranslate = swiper.translate;\n }\n }\n } else {\n swiper.slideToLoop(slideRealIndex, 0, false, true);\n }\n }\n }\n swiper.allowSlidePrev = allowSlidePrev;\n swiper.allowSlideNext = allowSlideNext;\n if (swiper.controller && swiper.controller.control && !byController) {\n const loopParams = {\n slideRealIndex,\n direction,\n setTranslate,\n activeSlideIndex,\n byController: true\n };\n if (Array.isArray(swiper.controller.control)) {\n swiper.controller.control.forEach(c => {\n if (!c.destroyed && c.params.loop) c.loopFix({\n ...loopParams,\n slideTo: c.params.slidesPerView === params.slidesPerView ? slideTo : false\n });\n });\n } else if (swiper.controller.control instanceof swiper.constructor && swiper.controller.control.params.loop) {\n swiper.controller.control.loopFix({\n ...loopParams,\n slideTo: swiper.controller.control.params.slidesPerView === params.slidesPerView ? slideTo : false\n });\n }\n }\n swiper.emit('loopFix');\n}\n\nfunction loopDestroy() {\n const swiper = this;\n const {\n params,\n slidesEl\n } = swiper;\n if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;\n swiper.recalcSlides();\n const newSlidesOrder = [];
700\n swiper.slides.forEach(slideEl => {\n const index = typeof slideEl.swiperSlideIndex === 'undefined' ? slideEl.getAttribute('data-swiper-slide-index') * 1 : slideEl.swiperSlideIndex;\n newSlidesOrder[index] = slideEl;\n });\n swiper.slides.forEach(slideEl => {\n slideEl.removeAttribute('data-swiper-slide-index');\n });\n newSlidesOrder.forEach(slideEl => {\n slidesEl.append(slideEl);\n });\n swiper.recalcSlides();\n swiper.slideTo(swiper.realIndex, 0);\n}\n\nvar loop = {\n loopCreate,\n loopFix,\n loopDestroy\n};\n\nfunction setGrabCursor(moving) {\n const swiper = this;\n if (!swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return;\n const el = swiper.params.touchEventsTarget === 'container' ? swiper.el : swiper.wrapperEl;\n if (swiper.isElement) {\n swiper.__preventObserver__ = true;\n }\n el.style.cursor = 'move';\n el.style.cursor = moving ? 'grabbing' : 'grab';\n if (swiper.isElement) {\n requestAnimationFrame(() => {\n swiper.__preventObserver__ = false;\n });\n }\n}\n\nfunction unsetGrabCursor() {\n const swiper = this;\n if (swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) {\n return;\n }\n if (swiper.isElement) {\n swiper.__preventObserver__ = true;\n }\n swiper[swiper.params.touchEventsTarget === 'container' ? 'el' : 'wrapperEl'].style.cursor = '';\n if (swiper.isElement) {\n requestAnimationFrame(() => {\n swiper.__preventObserver__ = false;\n });\n }\n}\n\nvar grabCursor = {\n setGrabCursor,\n unsetGrabCursor\n};\n\n// Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd\nfunction closestElement(selector, base) {\n if (base === void 0) {\n base = this;\n }\n function __closestFrom(el) {\n if (!el || el === (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.g)() || el === (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)()) return null;\n if (el.assignedSlot) el = el.assignedSlot;\n const found = el.closest(selector);\n if (!found && !el.getRootNode) {\n return null;\n }\n return found || __closestFrom(el.getRootNode().host);\n }\n return __closestFrom(base);\n}\nfunction onTouchStart(event) {\n const swiper = this;\n const document = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.g)();\n const window = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n const data = swiper.touchEventsData;\n data.evCache.push(event);\n const {\n params,\n touches,\n enabled\n } = swiper;\n if (!enabled) return;\n if (!params.simulateTouch && event.pointerType === 'mouse') return;\n if (swiper.animating && params.preventInteractionOnTransition) {\n return;\n }\n if (!swiper.animating && params.cssMode && params.loop) {\n swiper.loopFix();\n }\n let e = event;\n if (e.originalEvent) e = e.originalEvent;\n let targetEl = e.target;\n if (params.touchEventsTarget === 'wrapper') {\n if (!swiper.wrapperEl.contains(targetEl)) return;\n }\n if ('which' in e && e.which === 3) return;\n if ('button' in e && e.button > 0) return;\n if (data.isTouched && data.isMoved) return;\n\n // change target el for shadow root component\n const swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== '';\n // eslint-disable-next-line\n const eventPath = event.composedPath ? event.composedPath() : event.path;\n if (swipingClassHasValue && e.target && e.target.shadowRoot && eventPath) {\n targetEl = eventPath[0];\n }\n const noSwipingSelector = params.noSwipingSelector ? params.noSwipingSelector : `.${params.noSwipingClass}`;\n const isTargetShadow = !!(e.target && e.target.shadowRoot);\n\n // use closestElement for shadow root element to get the actual closest for nested shadow root element\n if (params.noSwiping && (isTargetShadow ? closestElement(noSwipingSelector, targetEl) : targetEl.closest(noSwipingSelector))) {\n swiper.allowClick = true;\n return;\n }\n if (params.swipeHandler) {\n if (!targetEl.closest(params.swipeHandler)) return;\n }\n touches.currentX = e.pageX;\n touches.currentY = e.pageY;\n const startX = touches.currentX;\n const startY = touches.currentY;\n\n // Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore\n\n const edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;\n const edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;\n if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) {\n if (edgeSwipeDetection === 'prevent') {\n event.preventDefault();\n } else {\n return;\n }\n }\n Object.assign(data, {\n isTouched: true,\n isMoved: false,\n allowTouchCallbacks: true,\n isScrolling: undefined,\n startMoving: undefined\n });\n touches.startX = startX;\n touches.startY = startY;\n data.touchStartTime = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.d)();\n swiper.allowClick = true;\n swiper.updateSize();\n swiper.swipeDirection = undefined;\n if (params.threshold > 0) data.allowThresholdMove = false;\n let preventDefault = true;\n if (targetEl.matches(data.focusableElements)) {\n preventDefault = false;\n if (targetEl.nodeName === 'SELECT') {\n data.isTouched = false;\n }\n }\n if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== targetEl) {\n document.activeElement.blur();\n }\n const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;\n if ((params.touchStartForcePreventDefault || shouldPreventDefault) && !targetEl.isContentEditable) {\n e.preventDefault();\n }\n if (params.freeMode && params.freeMode.enabled && swiper.freeMode && swiper.animating && !params.cssMode) {\n swiper.freeMode.onTouchStart();\n }\n swiper.emit('touchStart', e);\n}\n\nfunction onTouchMove(event) {\n const document = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.g)();\n const swiper = this;\n const data = swiper.touchEventsData;\n const {\n params,\n touches,\n rtlTranslate: rtl,\n enabled\n }
700 = swiper;\n if (!enabled) return;\n if (!params.simulateTouch && event.pointerType === 'mouse') return;\n let e = event;\n if (e.originalEvent) e = e.originalEvent;\n if (!data.isTouched) {\n if (data.startMoving && data.isScrolling) {\n swiper.emit('touchMoveOpposite', e);\n }\n return;\n }\n const pointerIndex = data.evCache.findIndex(cachedEv => cachedEv.pointerId === e.pointerId);\n if (pointerIndex >= 0) data.evCache[pointerIndex] = e;\n const targetTouch = data.evCache.length > 1 ? data.evCache[0] : e;\n const pageX = targetTouch.pageX;\n const pageY = targetTouch.pageY;\n if (e.preventedByNestedSwiper) {\n touches.startX = pageX;\n touches.startY = pageY;\n return;\n }\n if (!swiper.allowTouchMove) {\n if (!e.target.matches(data.focusableElements)) {\n swiper.allowClick = false;\n }\n if (data.isTouched) {\n Object.assign(touches, {\n startX: pageX,\n startY: pageY,\n prevX: swiper.touches.currentX,\n prevY: swiper.touches.currentY,\n currentX: pageX,\n currentY: pageY\n });\n data.touchStartTime = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.d)();\n }\n return;\n }\n if (params.touchReleaseOnEdges && !params.loop) {\n if (swiper.isVertical()) {\n // Vertical\n if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) {\n data.isTouched = false;\n data.isMoved = false;\n return;\n }\n } else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) {\n return;\n }\n }\n if (document.activeElement) {\n if (e.target === document.activeElement && e.target.matches(data.focusableElements)) {\n data.isMoved = true;\n swiper.allowClick = false;\n return;\n }\n }\n if (data.allowTouchCallbacks) {\n swiper.emit('touchMove', e);\n }\n if (e.targetTouches && e.targetTouches.length > 1) return;\n touches.currentX = pageX;\n touches.currentY = pageY;\n const diffX = touches.currentX - touches.startX;\n const diffY = touches.currentY - touches.startY;\n if (swiper.params.threshold && Math.sqrt(diffX ** 2 + diffY ** 2) < swiper.params.threshold) return;\n if (typeof data.isScrolling === 'undefined') {\n let touchAngle;\n if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) {\n data.isScrolling = false;\n } else {\n // eslint-disable-next-line\n if (diffX * diffX + diffY * diffY >= 25) {\n touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI;\n data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle;\n }\n }\n }\n if (data.isScrolling) {\n swiper.emit('touchMoveOpposite', e);\n }\n if (typeof data.startMoving === 'undefined') {\n if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {\n data.startMoving = true;\n }\n }\n if (data.isScrolling || swiper.zoom && swiper.params.zoom && swiper.params.zoom.enabled && data.evCache.length > 1) {\n data.isTouched = false;\n return;\n }\n if (!data.startMoving) {\n return;\n }\n swiper.allowClick = false;\n if (!params.cssMode && e.cancelable) {\n e.preventDefault();\n }\n if (params.touchMoveStopPropagation && !params.nested) {\n e.stopPropagation();\n }\n let diff = swiper.isHorizontal() ? diffX : diffY;\n let touchesDiff = swiper.isHorizontal() ? touches.currentX - touches.previousX : touches.currentY - touches.previousY;\n if (params.oneWayMovement) {\n diff = Math.abs(diff) * (rtl ? 1 : -1);\n touchesDiff = Math.abs(touchesDiff) * (rtl ? 1 : -1);\n }\n touches.diff = diff;\n diff *= params.touchRatio;\n if (rtl) {\n diff = -diff;\n touchesDiff = -touchesDiff;\n }\n const prevTouchesDirection = swiper.touchesDirection;\n swiper.swipeDirection = diff > 0 ? 'prev' : 'next';\n swiper.touchesDirection = touchesDiff > 0 ? 'prev' : 'next';\n const isLoop = swiper.params.loop && !params.cssMode;\n const allowLoopFix = swiper.swipeDirection === 'next' && swiper.allowSlideNext || swiper.swipeDirection === 'prev' && swiper.allowSlidePrev;\n if (!data.isMoved) {\n if (isLoop && allowLoopFix) {\n swiper.loopFix({\n direction: swiper.swipeDirection\n });\n }\n data.startTranslate = swiper.getTranslate();\n swiper.setTransition(0);\n if (swiper.animating) {\n const evt = new window.CustomEvent('transitionend', {\n bubbles: true,\n cancelable: true\n });
700\n swiper.wrapperEl.dispatchEvent(evt);\n }\n data.allowMomentumBounce = false;\n // Grab Cursor\n if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {\n swiper.setGrabCursor(true);\n }\n swiper.emit('sliderFirstMove', e);\n }\n let loopFixed;\n if (data.isMoved && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {\n // need another loop fix\n swiper.loopFix({\n direction: swiper.swipeDirection,\n setTranslate: true\n });\n loopFixed = true;\n }\n swiper.emit('sliderMove', e);\n data.isMoved = true;\n data.currentTranslate = diff + data.startTranslate;\n let disableParentSwiper = true;\n let resistanceRatio = params.resistanceRatio;\n if (params.touchReleaseOnEdges) {\n resistanceRatio = 0;\n }\n if (diff > 0) {\n if (isLoop && allowLoopFix && !loopFixed && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.size / 2 : swiper.minTranslate())) {\n swiper.loopFix({\n direction: 'prev',\n setTranslate: true,\n activeSlideIndex: 0\n });\n }\n if (data.currentTranslate > swiper.minTranslate()) {\n disableParentSwiper = false;\n if (params.resistance) {\n data.currentTranslate = swiper.minTranslate() - 1 + (-swiper.minTranslate() + data.startTranslate + diff) ** resistanceRatio;\n }\n }\n } else if (diff < 0) {\n if (isLoop && allowLoopFix && !loopFixed && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.size / 2 : swiper.maxTranslate())) {\n swiper.loopFix({\n direction: 'next',\n setTranslate: true,\n activeSlideIndex: swiper.slides.length - (params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(params.slidesPerView, 10)))\n });\n }\n if (data.currentTranslate < swiper.maxTranslate()) {\n disableParentSwiper = false;\n if (params.resistance) {\n data.currentTranslate = swiper.maxTranslate() + 1 - (swiper.maxTranslate() - data.startTranslate - diff) ** resistanceRatio;\n }\n }\n }\n if (disableParentSwiper) {\n e.preventedByNestedSwiper = true;\n }\n\n // Directions locks\n if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) {\n data.currentTranslate = data.startTranslate;\n }\n if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) {\n data.currentTranslate = data.startTranslate;\n }\n if (!swiper.allowSlidePrev && !swiper.allowSlideNext) {\n data.currentTranslate = data.startTranslate;\n }\n\n // Threshold\n if (params.threshold > 0) {\n if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {\n if (!data.allowThresholdMove) {\n data.allowThresholdMove = true;\n touches.startX = touches.currentX;\n touches.startY = touches.currentY;\n data.currentTranslate = data.startTranslate;\n touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY;\n return;\n }\n } else {\n data.currentTranslate = data.startTranslate;\n return;\n }\n }\n if (!params.followFinger || params.cssMode) return;\n\n // Update active index in free mode\n if (params.freeMode && params.freeMode.enabled && swiper.freeMode || params.watchSlidesProgress) {\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n }\n if (params.freeMode && params.freeMode.enabled && swiper.freeMode) {\n swiper.freeMode.onTouchMove();\n }\n // Update progress\n swiper.updateProgress(data.currentTranslate);\n // Update translate\n swiper.setTranslate(data.currentTranslate);\n}\n\nfunction onTouchEnd(event) {\n const swiper = this;\n const data = swiper.touchEventsData;\n const pointerIndex = data.evCache.findIndex(cachedEv => cachedEv.pointerId === event.pointerId);\n if (pointerIndex >= 0) {\n data.evCache.splice(pointerIndex, 1);\n }\n if (['pointercancel', 'pointerout', 'pointerleave', 'contextmenu'].includes(event.type)) {\n const proceed = ['pointercancel', 'contextmenu'].includes(event.type) && (swiper.browser.isSafari || swiper.browser.isWebView);
700\n if (!proceed) {\n return;\n }\n }\n const {\n params,\n touches,\n rtlTranslate: rtl,\n slidesGrid,\n enabled\n } = swiper;\n if (!enabled) return;\n if (!params.simulateTouch && event.pointerType === 'mouse') return;\n let e = event;\n if (e.originalEvent) e = e.originalEvent;\n if (data.allowTouchCallbacks) {\n swiper.emit('touchEnd', e);\n }\n data.allowTouchCallbacks = false;\n if (!data.isTouched) {\n if (data.isMoved && params.grabCursor) {\n swiper.setGrabCursor(false);\n }\n data.isMoved = false;\n data.startMoving = false;\n return;\n }\n // Return Grab Cursor\n if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {\n swiper.setGrabCursor(false);\n }\n\n // Time diff\n const touchEndTime = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.d)();\n const timeDiff = touchEndTime - data.touchStartTime;\n\n // Tap, doubleTap, Click\n if (swiper.allowClick) {\n const pathTree = e.path || e.composedPath && e.composedPath();\n swiper.updateClickedSlide(pathTree && pathTree[0] || e.target, pathTree);\n swiper.emit('tap click', e);\n if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) {\n swiper.emit('doubleTap doubleClick', e);\n }\n }\n data.lastClickTime = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.d)();\n (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.n)(() => {\n if (!swiper.destroyed) swiper.allowClick = true;\n });\n if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {\n data.isTouched = false;\n data.isMoved = false;\n data.startMoving = false;\n return;\n }\n data.isTouched = false;\n data.isMoved = false;\n data.startMoving = false;\n let currentPos;\n if (params.followFinger) {\n currentPos = rtl ? swiper.translate : -swiper.translate;\n } else {\n currentPos = -data.currentTranslate;\n }\n if (params.cssMode) {\n return;\n }\n if (params.freeMode && params.freeMode.enabled) {\n swiper.freeMode.onTouchEnd({\n currentPos\n });\n return;\n }\n\n // Find current slide\n let stopIndex = 0;\n let groupSize = swiper.slidesSizesGrid[0];\n for (let i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) {\n const increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;\n if (typeof slidesGrid[i + increment] !== 'undefined') {\n if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) {\n stopIndex = i;\n groupSize = slidesGrid[i + increment] - slidesGrid[i];\n }\n } else if (currentPos >= slidesGrid[i]) {\n stopIndex = i;\n groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];\n }\n }\n let rewindFirstIndex = null;\n let rewindLastIndex = null;\n if (params.rewind) {\n if (swiper.isBeginning) {\n rewindLastIndex = params.virtual && params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1;\n } else if (swiper.isEnd) {\n rewindFirstIndex = 0;\n }\n }\n // Find current slide size\n const ratio = (currentPos - slidesGrid[stopIndex]) / groupSize;\n const increment = stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;\n if (timeDiff > params.longSwipesMs) {\n // Long touches\n if (!params.longSwipes) {\n swiper.slideTo(swiper.activeIndex);\n return;\n }\n if (swiper.swipeDirection === 'next') {\n if (ratio >= params.longSwipesRatio) swiper.slideTo(params.rewind && swiper.isEnd ? rewindFirstIndex : stopIndex + increment);else swiper.slideTo(stopIndex);\n }\n if (swiper.swipeDirection === 'prev') {\n if (ratio > 1 - params.longSwipesRatio) {\n swiper.slideTo(stopIndex + increment);\n } else if (rewindLastIndex !== null && ratio < 0 && Math.abs(ratio) > params.longSwipesRatio) {\n swiper.slideTo(rewindLastIndex);\n } else {\n swiper.slideTo(stopIndex);\n }\n }\n } else {\n // Short swipes\n if (!params.shortSwipes) {\n swiper.slideTo(swiper.activeIndex);\n return;\n }\n const isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl);\n if (!isNavButtonTarget) {\n if (swiper.swipeDirection === 'next') {\n swiper.slideTo(rewindFirstIndex !== null ? rewindFirstIndex : stopIndex + increment);\n }\n if (swiper.swipeDirection === 'prev') {\n swiper.slideTo(rewindLastIndex !== null ? rewindLastIndex : stopIndex);\n }\n } else if (e.target === swiper.navigation.nextEl) {\n swiper.slideTo(stopIndex + increment);\n } else {\n swiper.slideTo(stopIndex);\n }\n }\n}\n\nfunction onResize() {\n const swiper = this;\n const {\n params,\n el\n } = swiper;\n if (el && el.offsetWidth === 0) return;
700\n\n // Breakpoints\n if (params.breakpoints) {\n swiper.setBreakpoint();\n }\n\n // Save locks\n const {\n allowSlideNext,\n allowSlidePrev,\n snapGrid\n } = swiper;\n const isVirtual = swiper.virtual && swiper.params.virtual.enabled;\n\n // Disable locks on resize\n swiper.allowSlideNext = true;\n swiper.allowSlidePrev = true;\n swiper.updateSize();\n swiper.updateSlides();\n swiper.updateSlidesClasses();\n const isVirtualLoop = isVirtual && params.loop;\n if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides && !isVirtualLoop) {\n swiper.slideTo(swiper.slides.length - 1, 0, false, true);\n } else {\n if (swiper.params.loop && !isVirtual) {\n swiper.slideToLoop(swiper.realIndex, 0, false, true);\n } else {\n swiper.slideTo(swiper.activeIndex, 0, false, true);\n }\n }\n if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {\n clearTimeout(swiper.autoplay.resizeTimeout);\n swiper.autoplay.resizeTimeout = setTimeout(() => {\n if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {\n swiper.autoplay.resume();\n }\n }, 500);\n }\n // Return locks after resize\n swiper.allowSlidePrev = allowSlidePrev;\n swiper.allowSlideNext = allowSlideNext;\n if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) {\n swiper.checkOverflow();\n }\n}\n\nfunction onClick(e) {\n const swiper = this;\n if (!swiper.enabled) return;\n if (!swiper.allowClick) {\n if (swiper.params.preventClicks) e.preventDefault();\n if (swiper.params.preventClicksPropagation && swiper.animating) {\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n }\n}\n\nfunction onScroll() {\n const swiper = this;\n const {\n wrapperEl,\n rtlTranslate,\n enabled\n } = swiper;\n if (!enabled) return;\n swiper.previousTranslate = swiper.translate;\n if (swiper.isHorizontal()) {\n swiper.translate = -wrapperEl.scrollLeft;\n } else {\n swiper.translate = -wrapperEl.scrollTop;\n }\n // eslint-disable-next-line\n if (swiper.translate === 0) swiper.translate = 0;\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n let newProgress;\n const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();\n if (translatesDiff === 0) {\n newProgress = 0;\n } else {\n newProgress = (swiper.translate - swiper.minTranslate()) / translatesDiff;\n }\n if (newProgress !== swiper.progress) {\n swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate);\n }\n swiper.emit('setTranslate', swiper.translate, false);\n}\n\nfunction onLoad(e) {\n const swiper = this;\n processLazyPreloader(swiper, e.target);\n if (swiper.params.cssMode || swiper.params.slidesPerView !== 'auto' && !swiper.params.autoHeight) {\n return;\n }\n swiper.update();\n}\n\nlet dummyEventAttached = false;\nfunction dummyEventListener() {}\nconst events = (swiper, method) => {\n const document = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.g)();\n const {\n params,\n el,\n wrapperEl,\n device\n } = swiper;\n const capture = !!params.nested;\n const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener';\n const swiperMethod = method;\n\n // Touch Events\n el[domMethod]('pointerdown', swiper.onTouchStart, {\n passive: false\n });\n document[domMethod]('pointermove', swiper.onTouchMove, {\n passive: false,\n capture\n });\n document[domMethod]('pointerup', swiper.onTouchEnd, {\n passive: true\n });\n document[domMethod]('pointercancel', swiper.onTouchEnd, {\n passive: true\n });\n document[domMethod]('pointerout', swiper.onTouchEnd, {\n passive: true\n });\n document[domMethod]('pointerleave', swiper.onTouchEnd, {\n passive: true\n });\n document[domMethod]('contextmenu', swiper.onTouchEnd, {\n passive: true\n });\n\n // Prevent Links Clicks\n if (params.preventClicks || params.preventClicksPropagation) {\n el[domMethod]('click', swiper.onClick, true);\n }\n if (params.cssMode) {\n wrapperEl[domMethod]('scroll', swiper.onScroll);\n }\n\n // Resize handler\n if (params.updateOnWindowResize) {\n swiper[swiperMethod](device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize, true);\n } else {\n swiper[swiperMethod]('observerUpdate', onResize, true);\n }\n\n // Images loader\n el[domMethod]('load', swiper.onLoad, {\n capture: true\n });\n};\nfunction attachEvents() {\n const swiper = this;\n const document = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.g)();\n const {\n params\n } = swiper;\n swiper.onTouchStart = onTouchStart.bind(swiper);\n swiper.onTouchMove = onTouchMove.bind(swiper);\n swiper.onTouchEnd = onTouchEnd.bind(swiper);\n if (params.cssMode) {\n swiper.onScroll = onScroll.bind(swiper);\n }\n swiper.onClick = onClick.bind(swiper);\n swiper.onLoad = onLoad.bind(swiper);\n if (!dummyEventAttached) {\n document.addEventListener('touchstart', dummyEventListener);\n dummyEventAttached = true;\n }\n events(swiper, 'on');\n}\nfunction detachEvents() {\n const swiper = this;\n events(swiper, 'off');\n}\nvar events$1 = {\n attachEvents,\n detachEvents\n};\n\nconst isGridEnabled = (swiper, params) => {\n return swiper.grid && params.grid && params.grid.rows > 1;\n};\nfunction setBreakpoint() {\n const swiper = this;\n const {\n realIndex,\n initialized,\n params,\n el\n } = swiper;\n const breakpoints = params.breakpoints;\n if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return;\n\n // Get breakpoint for window width and update parameters\n const breakpoint = swiper.getBreakp
700oint(breakpoints, swiper.params.breakpointsBase, swiper.el);\n if (!breakpoint || swiper.currentBreakpoint === breakpoint) return;\n const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;\n const breakpointParams = breakpointOnlyParams || swiper.originalParams;\n const wasMultiRow = isGridEnabled(swiper, params);\n const isMultiRow = isGridEnabled(swiper, breakpointParams);\n const wasEnabled = params.enabled;\n if (wasMultiRow && !isMultiRow) {\n el.classList.remove(`${params.containerModifierClass}grid`, `${params.containerModifierClass}grid-column`);\n swiper.emitContainerClasses();\n } else if (!wasMultiRow && isMultiRow) {\n el.classList.add(`${params.containerModifierClass}grid`);\n if (breakpointParams.grid.fill && breakpointParams.grid.fill === 'column' || !breakpointParams.grid.fill && params.grid.fill === 'column') {\n el.classList.add(`${params.containerModifierClass}grid-column`);\n }\n swiper.emitContainerClasses();\n }\n\n // Toggle navigation, pagination, scrollbar\n ['navigation', 'pagination', 'scrollbar'].forEach(prop => {\n if (typeof breakpointParams[prop] === 'undefined') return;\n const wasModuleEnabled = params[prop] && params[prop].enabled;\n const isModuleEnabled = breakpointParams[prop] && breakpointParams[prop].enabled;\n if (wasModuleEnabled && !isModuleEnabled) {\n swiper[prop].disable();\n }\n if (!wasModuleEnabled && isModuleEnabled) {\n swiper[prop].enable();\n }\n });\n const directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction;\n const needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged);\n const wasLoop = params.loop;\n if (directionChanged && initialized) {\n swiper.changeDirection();\n }\n ;(0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.q)(swiper.params, breakpointParams);\n const isEnabled = swiper.params.enabled;\n const hasLoop = swiper.params.loop;\n Object.assign(swiper, {\n allowTouchMove: swiper.params.allowTouchMove,\n allowSlideNext: swiper.params.allowSlideNext,\n allowSlidePrev: swiper.params.allowSlidePrev\n });\n if (wasEnabled && !isEnabled) {\n swiper.disable();\n } else if (!wasEnabled && isEnabled) {\n swiper.enable();\n }\n swiper.currentBreakpoint = breakpoint;\n swiper.emit('_beforeBreakpoint', breakpointParams);\n if (initialized) {\n if (needsReLoop) {\n swiper.loopDestroy();\n swiper.loopCreate(realIndex);\n swiper.updateSlides();\n } else if (!wasLoop && hasLoop) {\n swiper.loopCreate(realIndex);\n swiper.updateSlides();\n } else if (wasLoop && !hasLoop) {\n swiper.loopDestroy();\n }\n }\n swiper.emit('breakpoint', breakpointParams);\n}\n\nfunction getBreakpoint(breakpoints, base, containerEl) {\n if (base === void 0) {\n base = 'window';\n }\n if (!breakpoints || base === 'container' && !containerEl) return undefined;\n let breakpoint = false;\n const window = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n const currentHeight = base === 'window' ? window.innerHeight : containerEl.clientHeight;\n const points = Object.keys(breakpoints).map(point => {\n if (typeof point === 'string' && point.indexOf('@') === 0) {\n const minRatio = parseFloat(point.substr(1));\n const value = currentHeight * minRatio;\n return {\n value,\n point\n };\n }\n return {\n value: point,\n point\n };\n });\n points.sort((a, b) => parseInt(a.value, 10) - parseInt(b.value, 10));\n for (let i = 0; i < points.length; i += 1) {\n const {\n point,\n value\n } = points[i];\n if (base === 'window') {\n if (window.matchMedia(`(min-width: ${value}px)`).matches) {\n breakpoint = point;\n }\n } else if (value <= containerEl.clientWidth) {\n breakpoint = point;\n }\n }\n return breakpoint || 'max';\n}\n\nvar breakpoints = {\n setBreakpoint,\n getBreakpoint\n};\n\nfunction prepareClasses(entries, prefix) {\n const resultClasses = [];
700\n entries.forEach(item => {\n if (typeof item === 'object') {\n Object.keys(item).forEach(classNames => {\n if (item[classNames]) {\n resultClasses.push(prefix + classNames);\n }\n });\n } else if (typeof item === 'string') {\n resultClasses.push(prefix + item);\n }\n });\n return resultClasses;\n}\nfunction addClasses() {\n const swiper = this;\n const {\n classNames,\n params,\n rtl,\n el,\n device\n } = swiper;\n // prettier-ignore\n const suffixes = prepareClasses(['initialized', params.direction, {\n 'free-mode': swiper.params.freeMode && params.freeMode.enabled\n }, {\n 'autoheight': params.autoHeight\n }, {\n 'rtl': rtl\n }, {\n 'grid': params.grid && params.grid.rows > 1\n }, {\n 'grid-column': params.grid && params.grid.rows > 1 && params.grid.fill === 'column'\n }, {\n 'android': device.android\n }, {\n 'ios': device.ios\n }, {\n 'css-mode': params.cssMode\n }, {\n 'centered': params.cssMode && params.centeredSlides\n }, {\n 'watch-progress': params.watchSlidesProgress\n }], params.containerModifierClass);\n classNames.push(...suffixes);\n el.classList.add(...classNames);\n swiper.emitContainerClasses();\n}\n\nfunction removeClasses() {\n const swiper = this;\n const {\n el,\n classNames\n } = swiper;\n el.classList.remove(...classNames);\n swiper.emitContainerClasses();\n}\n\nvar classes = {\n addClasses,\n removeClasses\n};\n\nfunction checkOverflow() {\n const swiper = this;\n const {\n isLocked: wasLocked,\n params\n } = swiper;\n const {\n slidesOffsetBefore\n } = params;\n if (slidesOffsetBefore) {\n const lastSlideIndex = swiper.slides.length - 1;\n const lastSlideRightEdge = swiper.slidesGrid[lastSlideIndex] + swiper.slidesSizesGrid[lastSlideIndex] + slidesOffsetBefore * 2;\n swiper.isLocked = swiper.size > lastSlideRightEdge;\n } else {\n swiper.isLocked = swiper.snapGrid.length === 1;\n }\n if (params.allowSlideNext === true) {\n swiper.allowSlideNext = !swiper.isLocked;\n }\n if (params.allowSlidePrev === true) {\n swiper.allowSlidePrev = !swiper.isLocked;\n }\n if (wasLocked && wasLocked !== swiper.isLocked) {\n swiper.isEnd = false;\n }\n if (wasLocked !== swiper.isLocked) {\n swiper.emit(swiper.isLocked ? 'lock' : 'unlock');\n }\n}\nvar checkOverflow$1 = {\n checkOverflow\n};\n\nvar defaults = {\n init: true,\n direction: 'horizontal',\n oneWayMovement: false,\n touchEventsTarget: 'wrapper',\n initialSlide: 0,\n speed: 300,\n cssMode: false,\n updateOnWindowResize: true,\n resizeObserver: true,\n nested: false,\n createElements: false,\n enabled: true,\n focusableElements: 'input, select, option, textarea, button, video, label',\n // Overrides\n width: null,\n height: null,\n //\n preventInteractionOnTransition: false,\n // ssr\n userAgent: null,\n url: null,\n // To support iOS's swipe-to-go-back gesture (when being used in-app).\n edgeSwipeDetection: false,\n edgeSwipeThreshold: 20,\n // Autoheight\n autoHeight: false,\n // Set wrapper width\n setWrapperSize: false,\n // Virtual Translate\n virtualTranslate: false,\n // Effects\n effect: 'slide',\n // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'\n\n // Breakpoints\n breakpoints: undefined,\n breakpointsBase: 'window',\n // Slides grid\n spaceBetween: 0,\n slidesPerView: 1,\n slidesPerGroup: 1,\n slidesPerGroupSkip: 0,\n slidesPerGroupAuto: false,\n centeredSlides: false,\n centeredSlidesBounds: false,\n slidesOffsetBefore: 0,\n // in px\n slidesOffsetAfter: 0,\n // in px\n normalizeSlideIndex: true,\n centerInsufficientSlides: false,\n // Disable swiper and hide navigation when container not overflow\n watchOverflow: true,\n // Round length\n roundLengths: false,\n // Touches\n touchRatio: 1,\n touchAngle: 45,\n simulateTouch: true,\n shortSwipes: true,\n longSwipes: true,\n longSwipesRatio: 0.5,\n longSwipesMs: 300,\n followFinger: true,\n allowTouchMove: true,\n threshold: 5,\n touchMoveStopPropagation: false,\n touchStartPreventDefault: true,\n touchStartForcePreventDefault: false,\n touchReleaseOnEdges: false,\n // Unique Navigation Elements\n uniqueNavElements: true,\n // Resistance\n resistance: true,\n resistanceRatio: 0.85,\n // Progress\n watchSlidesProgress: false,\n // Cursor\n grabCursor: false,\n // Clicks\n preventClicks: true,\n preventClicksPropagation: true,\n slideToClickedSlide: false,\n // loop\n loop: false,\n loopedSlides: null,\n loopPreventsSliding: true,\n // rewind\n rewind: false,\n // Swiping/no swiping\n allowSlidePrev: true,\n allowSlideNext: true,\n swipeHandler: null,\n // '.swipe-handler',\n noSwiping: true,\n noSwipingClass: 'swiper-no-swiping',\n noSwipingSelector: null,\n // Passive Listeners\n passiveListeners: true,\n maxBackfaceHiddenSlides: 10,\n // NS\n containerModifierClass: 'swiper-',\n // NEW\n slideClass: 'swiper-slide',\n slideActiveClass: 'swiper-slide-active',\n slideVisibleClass: 'swiper-slide-visible',\n slideNextClass: 'swiper-slide-next',\n slidePrevClass: 'swiper-slide-prev',\n wrapperClass: 'swiper-wrapper',\n lazyPreloaderClass: 'swiper-lazy-preloader',\n lazyPreloadPrevNext: 0,\n // Callbacks\n runCallbacksOnInit: true,\n // Internals\n _emitClasses: false\n};\n\nfunction moduleExtendParams(params, allModulesParams) {\n return function extendParams(obj) {\n if (obj === void 0) {\n obj = {};\n }\n const moduleParamName = Object.keys(obj)[0];\n const moduleParams = obj[moduleParamName];\n if (typeof moduleParams !== 'object' || moduleParams === null) {\n (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.q)(allModulesParams, obj);\n return;\n }\n if (params[moduleParamName] === true) {\n params[moduleParamName] = {\n enabled: true\n };\n }\n if (moduleParamName === 'navigation' && params[moduleParamName] && params[moduleParamName].enabled && !params[moduleParamName].prevEl && !params[moduleParamName].nextEl) {\n params[moduleParamName].auto = true;\n }\n if (['pagination', 'scrollbar'].indexOf(moduleParamName) >= 0 && params[moduleParamName] && params[moduleParamName].enabled && !params[moduleParamName].el) {\n params[moduleParamName].auto = true;\n }\n if (!(moduleParamName in params && 'enabled' in moduleParams)) {\n (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.q)(allModulesParams, obj);\n return;\n }\n if (typeof params[moduleParamName] === 'object' && !('enabled' in params[moduleParamName])) {\n params[moduleParamName].enabled = true;\n }\n if (!params[moduleParamName]) params[moduleParamName] = {\n enabled: false\n };\n (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.q)(allModulesParams, obj);\n };\n}\n\n/* eslint no-param-reassign: \"off\" */\nconst prototypes = {\n eventsEmitter,\n update,\n translate,\n transition,\n slide,\n loop,\n grabCursor,\n events: events$1,\n breakpoints,\n checkOverflow: checkOverflow$1,\n classes\n};\nconst extendedDefaults = {};\nclass Swiper {\n constructor() {\n let el;\n let params;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }
700\n if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') {\n params = args[0];\n } else {\n [el, params] = args;\n }\n if (!params) params = {};\n params = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.q)({}, params);\n if (el && !params.el) params.el = el;\n const document = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.g)();\n if (params.el && typeof params.el === 'string' && document.querySelectorAll(params.el).length > 1) {\n const swipers = [];\n document.querySelectorAll(params.el).forEach(containerEl => {\n const newParams = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.q)({}, params, {\n el: containerEl\n });\n swipers.push(new Swiper(newParams));\n });\n // eslint-disable-next-line no-constructor-return\n return swipers;\n }\n\n // Swiper Instance\n const swiper = this;\n swiper.__swiper__ = true;\n swiper.support = getSupport();\n swiper.device = getDevice({\n userAgent: params.userAgent\n });\n swiper.browser = getBrowser();\n swiper.eventsListeners = {};\n swiper.eventsAnyListeners = [];\n swiper.modules = [...swiper.__modules__];\n if (params.modules && Array.isArray(params.modules)) {\n swiper.modules.push(...params.modules);\n }\n const allModulesParams = {};\n swiper.modules.forEach(mod => {\n mod({\n params,\n swiper,\n extendParams: moduleExtendParams(params, allModulesParams),\n on: swiper.on.bind(swiper),\n once: swiper.once.bind(swiper),\n off: swiper.off.bind(swiper),\n emit: swiper.emit.bind(swiper)\n });\n });\n\n // Extend defaults with modules params\n const swiperParams = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.q)({}, defaults, allModulesParams);\n\n // Extend defaults with passed params\n swiper.params = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.q)({}, swiperParams, extendedDefaults, params);\n swiper.originalParams = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.q)({}, swiper.params);\n swiper.passedParams = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.q)({}, params);\n\n // add event listeners\n if (swiper.params && swiper.params.on) {\n Object.keys(swiper.params.on).forEac
700h(eventName => {\n swiper.on(eventName, swiper.params.on[eventName]);\n });\n }\n if (swiper.params && swiper.params.onAny) {\n swiper.onAny(swiper.params.onAny);\n }\n\n // Extend Swiper\n Object.assign(swiper, {\n enabled: swiper.params.enabled,\n el,\n // Classes\n classNames: [],\n // Slides\n slides: [],\n slidesGrid: [],\n snapGrid: [],\n slidesSizesGrid: [],\n // isDirection\n isHorizontal() {\n return swiper.params.direction === 'horizontal';\n },\n isVertical() {\n return swiper.params.direction === 'vertical';\n },\n // Indexes\n activeIndex: 0,\n realIndex: 0,\n //\n isBeginning: true,\n isEnd: false,\n // Props\n translate: 0,\n previousTranslate: 0,\n progress: 0,\n velocity: 0,\n animating: false,\n cssOverflowAdjustment() {\n // Returns 0 unless `translate` is > 2**23\n // Should be subtracted from css values to prevent overflow\n return Math.trunc(this.translate / 2 ** 23) * 2 ** 23;\n },\n // Locks\n allowSlideNext: swiper.params.allowSlideNext,\n allowSlidePrev: swiper.params.allowSlidePrev,\n // Touch Events\n touchEventsData: {\n isTouched: undefined,\n isMoved: undefined,\n allowTouchCallbacks: undefined,\n touchStartTime: undefined,\n isScrolling: undefined,\n currentTranslate: undefined,\n startTranslate: undefined,\n allowThresholdMove: undefined,\n // Form elements to match\n focusableElements: swiper.params.focusableElements,\n // Last click time\n lastClickTime: 0,\n clickTimeout: undefined,\n // Velocities\n velocities: [],\n allowMomentumBounce: undefined,\n startMoving: undefined,\n evCache: []\n },\n // Clicks\n allowClick: true,\n // Touches\n allowTouchMove: swiper.params.allowTouchMove,\n touches: {\n startX: 0,\n startY: 0,\n currentX: 0,\n currentY: 0,\n diff: 0\n },\n // Images\n imagesToLoad: [],\n imagesLoaded: 0\n });\n swiper.emit('_swiper');\n\n // Init\n if (swiper.params.init) {\n swiper.init();\n }\n\n // Return app instance\n // eslint-disable-next-line no-constructor-return\n return swiper;\n }\n getSlideIndex(slideEl) {\n const {\n slidesEl,\n params\n } = this;\n const slides = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.e)(slidesEl, `.${params.slideClass}, swiper-slide`);\n const firstSlideIndex = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.g)(slides[0]);\n return (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.g)(slideEl) - firstSlideIndex;\n }\n getSlideIndexByData(index) {\n return this.getSlideIndex(this.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === index)[0]);\n }\n recalcSlides() {\n const swiper = this;\n const {\n slidesEl,\n params\n } = swiper;\n swiper.slides = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.e)(slidesEl, `.${params.slideClass}, swiper-slide`);\n }\n enable() {\n const swiper = this;\n if (swiper.enabled) return;\n swiper.enabled = true;\n if (swiper.params.grabCursor) {\n swiper.setGrabCursor();\n }\n swiper.emit('enable');\n }\n disable() {\n const swiper = this;\n if (!swiper.enabled) return;\n swiper.enabled = false;\n if (swiper.params.grabCursor) {\n swiper.unsetGrabCursor();\n }\n swiper.emit('disable');\n }\n setProgress(progress, speed) {\n const swiper = this;\n progress = Math.min(Math.max(progress, 0), 1);\n const min = swiper.minTranslate();\n const max = swiper.maxTranslate();\n const current = (max - min) * progress + min;\n swiper.translateTo(current, typeof speed === 'undefined' ? 0 : speed);\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n }\n emitContainerClasses() {\n const swiper = this;\n if (!swiper.params._emitClasses || !swiper.el) return;\n const cls = swiper.el.className.split(' ').filter(className => {\n return className.indexOf('swiper') === 0 || className.indexOf(swiper.params.containerModifierClass) === 0;\n });\n swiper.emit('_containerClasses', cls.join(' '));\n }
700\n getSlideClasses(slideEl) {\n const swiper = this;\n if (swiper.destroyed) return '';\n return slideEl.className.split(' ').filter(className => {\n return className.indexOf('swiper-slide') === 0 || className.indexOf(swiper.params.slideClass) === 0;\n }).join(' ');\n }\n emitSlidesClasses() {\n const swiper = this;\n if (!swiper.params._emitClasses || !swiper.el) return;\n const updates = [];\n swiper.slides.forEach(slideEl => {\n const classNames = swiper.getSlideClasses(slideEl);\n updates.push({\n slideEl,\n classNames\n });\n swiper.emit('_slideClass', slideEl, classNames);\n });\n swiper.emit('_slideClasses', updates);\n }\n slidesPerViewDynamic(view, exact) {\n if (view === void 0) {\n view = 'current';\n }\n if (exact === void 0) {\n exact = false;\n }\n const swiper = this;\n const {\n params,\n slides,\n slidesGrid,\n slidesSizesGrid,\n size: swiperSize,\n activeIndex\n } = swiper;\n let spv = 1;\n if (typeof params.slidesPerView === 'number') return params.slidesPerView;\n if (params.centeredSlides) {\n let slideSize = slides[activeIndex] ? slides[activeIndex].swiperSlideSize : 0;\n let breakLoop;\n for (let i = activeIndex + 1; i < slides.length; i += 1) {\n if (slides[i] && !breakLoop) {\n slideSize += slides[i].swiperSlideSize;\n spv += 1;\n if (slideSize > swiperSize) breakLoop = true;\n }\n }\n for (let i = activeIndex - 1; i >= 0; i -= 1) {\n if (slides[i] && !breakLoop) {\n slideSize += slides[i].swiperSlideSize;\n spv += 1;\n if (slideSize > swiperSize) breakLoop = true;\n }\n }\n } else {\n // eslint-disable-next-line\n if (view === 'current') {\n for (let i = activeIndex + 1; i < slides.length; i += 1) {\n const slideInView = exact ? slidesGrid[i] + slidesSizesGrid[i] - slidesGrid[activeIndex] < swiperSize : slidesGrid[i] - slidesGrid[activeIndex] < swiperSize;\n if (slideInView) {\n spv += 1;\n }\n }\n } else {\n // previous\n for (let i = activeIndex - 1; i >= 0; i -= 1) {\n const slideInView = slidesGrid[activeIndex] - slidesGrid[i] < swiperSize;\n if (slideInView) {\n spv += 1;\n }\n }\n }\n }\n return spv;\n }\n update() {\n const swiper = this;\n if (!swiper || swiper.destroyed) return;\n const {\n snapGrid,\n params\n } = swiper;
700\n // Breakpoints\n if (params.breakpoints) {\n swiper.setBreakpoint();\n }\n [...swiper.el.querySelectorAll('[loading=\"lazy\"]')].forEach(imageEl => {\n if (imageEl.complete) {\n processLazyPreloader(swiper, imageEl);\n }\n });\n swiper.updateSize();\n swiper.updateSlides();\n swiper.updateProgress();\n swiper.updateSlidesClasses();\n function setTranslate() {\n const translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate;\n const newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate());\n swiper.setTranslate(newTranslate);\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n }\n let translated;\n if (params.freeMode && params.freeMode.enabled && !params.cssMode) {\n setTranslate();\n if (params.autoHeight) {\n swiper.updateAutoHeight();\n }\n } else {\n if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !params.centeredSlides) {\n const slides = swiper.virtual && params.virtual.enabled ? swiper.virtual.slides : swiper.slides;\n translated = swiper.slideTo(slides.length - 1, 0, false, true);\n } else {\n translated = swiper.slideTo(swiper.activeIndex, 0, false, true);\n }\n if (!translated) {\n setTranslate();\n }\n }\n if (params.watchOverflow && snapGrid !== swiper.snapGrid) {\n swiper.checkOverflow();\n }\n swiper.emit('update');\n }\n changeDirection(newDirection, needUpdate) {\n if (needUpdate === void 0) {\n needUpdate = true;\n }\n const swiper = this;\n const currentDirection = swiper.params.direction;\n if (!newDirection) {\n // eslint-disable-next-line\n newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal';\n }\n if (newDirection === currentDirection || newDirection !== 'horizontal' && newDirection !== 'vertical') {\n return swiper;\n }\n swiper.el.classList.remove(`${swiper.params.containerModifierClass}${currentDirection}`);\n swiper.el.classList.add(`${swiper.params.containerModifierClass}${newDirection}`);\n swiper.emitContainerClasses();\n swiper.params.direction = newDirection;
700\n swiper.slides.forEach(slideEl => {\n if (newDirection === 'vertical') {\n slideEl.style.width = '';\n } else {\n slideEl.style.height = '';\n }\n });\n swiper.emit('changeDirection');\n if (needUpdate) swiper.update();\n return swiper;\n }\n changeLanguageDirection(direction) {\n const swiper = this;\n if (swiper.rtl && direction === 'rtl' || !swiper.rtl && direction === 'ltr') return;\n swiper.rtl = direction === 'rtl';\n swiper.rtlTranslate = swiper.params.direction === 'horizontal' && swiper.rtl;\n if (swiper.rtl) {\n swiper.el.classList.add(`${swiper.params.containerModifierClass}rtl`);\n swiper.el.dir = 'rtl';\n } else {\n swiper.el.classList.remove(`${swiper.params.containerModifierClass}rtl`);\n swiper.el.dir = 'ltr';\n }\n swiper.update();\n }\n mount(element) {\n const swiper = this;\n if (swiper.mounted) return true;\n\n // Find el\n let el = element || swiper.params.el;\n if (typeof el === 'string') {\n el = document.querySelector(el);\n }\n if (!el) {\n return false;\n }\n el.swiper = swiper;\n if (el.parentNode && el.parentNode.host && el.parentNode.host.nodeName === 'SWIPER-CONTAINER') {\n swiper.isElement = true;\n }\n const getWrapperSelector = () => {\n return `.${(swiper.params.wrapperClass || '').trim().split(' ').join('.')}`;\n };\n const getWrapper = () => {\n if (el && el.shadowRoot && el.shadowRoot.querySelector) {\n const res = el.shadowRoot.querySelector(getWrapperSelector());\n // Children needs to return slot items\n return res;\n }\n return (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.e)(el, getWrapperSelector())[0];\n };\n // Find Wrapper\n let wrapperEl = getWrapper();\n if (!wrapperEl && swiper.params.createElements) {\n wrapperEl = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.c)('div', swiper.params.wrapperClass);\n el.append(wrapperEl);\n (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.e)(el, `.${swiper.params.slideClass}
700`).forEach(slideEl => {\n wrapperEl.append(slideEl);\n });\n }\n Object.assign(swiper, {\n el,\n wrapperEl,\n slidesEl: swiper.isElement && !el.parentNode.host.slideSlots ? el.parentNode.host : wrapperEl,\n hostEl: swiper.isElement ? el.parentNode.host : el,\n mounted: true,\n // RTL\n rtl: el.dir.toLowerCase() === 'rtl' || (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.l)(el, 'direction') === 'rtl',\n rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.l)(el, 'direction') === 'rtl'),\n wrongRTL: (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.l)(wrapperEl, 'display') === '-webkit-box'\n });\n return true;\n }\n init(el) {\n const swiper = this;\n if (swiper.initialized) return swiper;\n const mounted = swiper.mount(el);\n if (mounted === false) return swiper;\n swiper.emit('beforeInit');\n\n // Set breakpoint\n if (swiper.params.breakpoints) {\n swiper.setBreakpoint();\n }\n\n // Add Classes\n swiper.addClasses();\n\n // Update size\n swiper.updateSize();\n\n // Update slides\n swiper.updateSlides();\n if (swiper.params.watchOverflow) {\n swiper.checkOverflow();\n }\n\n // Set Grab Cursor\n if (swiper.params.grabCursor && swiper.enabled) {\n swiper.setGrabCursor();\n }\n\n // Slide To Initial Slide\n if (swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {\n swiper.slideTo(swiper.params.initialSlide + swiper.virtual.slidesBefore, 0, swiper.params.runCallbacksOnInit, false, true);\n } else {\n swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit, false, true);\n }\n\n // Create loop\n if (swiper.params.loop) {\n swiper.loopCreate();\n }\n\n // Attach events\n swiper.attachEvents();\n const lazyElements = [...swiper.el.querySelectorAll('[loading=\"lazy\"]')];\n if (swiper.isElement) {\n lazyElements.push(...swiper.hostEl.querySelectorAll('[loading=\"lazy\"]'));\n }\n lazyElements.forEach(imageEl => {\n if (imageEl.complete) {\n processLazyPreloader(swiper, imageEl);\n } else {\n imageEl.addEventListener('load', e => {\n processLazyPreloader(swiper, e.target);\n });\n }\n });\n preload(swiper);\n\n // Init Flag\n swiper.initialized = true;\n preload(swiper);\n\n // Emit\n swiper.emit('init');\n swiper.emit('afterInit');\n return swiper;\n }\n destroy(deleteInstance, cleanStyles) {\n if (deleteInstance === void 0) {\n deleteInstance = true;\n }\n if (cleanStyles === void 0) {\n cleanStyles = true;\n }\n const swiper = this;\n const {\n params,\n el,\n wrapperEl,\n slides\n } = swiper;\n if (typeof swiper.params === 'undefined' || swiper.destroyed) {\n return null;\n }\n swiper.emit('beforeDestroy');\n\n // Init Flag\n swiper.initialized = false;\n\n // Detach events\n swiper.detachEvents();\n\n // Destroy loop\n if (params.loop) {\n swiper.loopDestroy();\n }\n\n // Cleanup styles\n if (cleanStyles) {\n swiper.removeClasses();\n el.removeAttribute('style');\n wrapperEl.removeAttribute('style');\n if (slides && slides.length) {\n slides.forEach(sli
700deEl => {\n slideEl.classList.remove(params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass);\n slideEl.removeAttribute('style');\n slideEl.removeAttribute('data-swiper-slide-index');\n });\n }\n }\n swiper.emit('destroy');\n\n // Detach emitter events\n Object.keys(swiper.eventsListeners).forEach(eventName => {\n swiper.off(eventName);\n });\n if (deleteInstance !== false) {\n swiper.el.swiper = null;\n (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.r)(swiper);\n }\n swiper.destroyed = true;\n return null;\n }\n static extendDefaults(newDefaults) {\n ;(0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.q)(extendedDefaults, newDefaults);\n }\n static get extendedDefaults() {\n return extendedDefaults;\n }\n static get defaults() {\n return defaults;\n }\n static installModule(mod) {\n if (!Swiper.prototype.__modules__) Swiper.prototype.__modules__ = [];\n const modules = Swiper.prototype.__modules__;\n if (typeof mod === 'function' && modules.indexOf(mod) < 0) {\n modules.push(mod);\n }\n }\n static use(module) {\n if (Array.isArray(module)) {\n module.forEach(m => Swiper.installModule(m));\n return Swiper;\n }\n Swiper.installModule(module);\n return Swiper;\n }\n}\nObject.keys(prototypes).forEach(prototypeGroup => {\n Object.keys(prototypes[prototypeGroup]).forEach(protoMethod => {\n Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod];\n });\n});\nSwiper.use([Resize, Observer]);\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/shared/swiper-core.mjs?\n}"); 701 702/***/ }, 703 704/***/ "./node_modules/swiper/shared/utils.mjs" 705/*!**********************************************!*\ 706 !*** ./node_modules/swiper/shared/utils.mjs ***! 707 \**********************************************/ 708(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 709 710"use strict"; 711eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ a: () => (/* binding */ elementParents),\n/* harmony export */ b: () => (/* binding */ elementOffset),\n/* harmony export */ c: () => (/* binding */ createElement),\n/* harmony export */ d: () => (/* binding */ now),\n/* harmony export */ e: () => (/* binding */ elementChildren),\n/* harmony export */ f: () => (/* binding */ elementOuterSize),\n/* harmony export */ g: () => (/* binding */ elementIndex),\n/* harmony export */ h: () => (/* binding */ getTranslate),\n/* harmony export */ i: () => (/* binding */ elementTransitionEnd),\n/* harmony export */ j: () => (/* binding */ isObject),\n/* harmony export */ k: () => (/* binding */ getSlideTransformEl),\n/* harmony export */ l: () => (/* binding */ elementStyle),\n/* harmony export */ m: () => (/* binding */ elementNextAll),\n/* harmony export */ n: () => (/* binding */ nextTick),\n/* harmony export */ o: () => (/* binding */ elementPrevAll),\n/* harmony export */ p: () => (/* binding */ animateCSSModeScroll),\n/* harmony export */ q: () => (/* binding */ extend),\n/* harmony export */ r: () => (/* binding */ deleteProps),\n/* harmony export */ s: () => (/* binding */ setCSSProperty)\n/* harmony export */ });\n/* harmony import */ var _ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ssr-window.esm.mjs */ \"./node_modules/swiper/shared/ssr-window.esm.mjs\");\n\n\nfunction deleteProps(obj) {\n const object = obj;\n Object.keys(object).forEach(key => {\n try {\n object[key] = null;\n } catch (e) {\n // no getter for object\n }\n try {\n delete object[key];\n } catch (e) {\n // something got wrong\n }\n });\n}\nfunction nextTick(callback, delay) {\n if (delay === void 0) {\n delay
711= 0;\n }\n return setTimeout(callback, delay);\n}\nfunction now() {\n return Date.now();\n}\nfunction getComputedStyle(el) {\n const window = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n let style;\n if (window.getComputedStyle) {\n style = window.getComputedStyle(el, null);\n }\n if (!style && el.currentStyle) {\n style = el.currentStyle;\n }\n if (!style) {\n style = el.style;\n }\n return style;\n}\nfunction getTranslate(el, axis) {\n if (axis === void 0) {\n axis = 'x';\n }\n const window = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n let matrix;\n let curTransform;\n let transformMatrix;\n const curStyle = getComputedStyle(el);\n if (window.WebKitCSSMatrix) {\n curTransform = curStyle.transform || curStyle.webkitTransform;\n if (curTransform.split(',').length > 6) {\n curTransform = curTransform.split(', ').map(a => a.replace(',', '.')).join(', ');\n }\n // Some old versions of Webkit choke when 'none' is passed; pass\n // empty string instead in this case\n transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);\n } else {\n transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');\n matrix = transformMatrix.toString().split(',');\n }\n if (axis === 'x') {\n // Latest Chrome and webkits Fix\n if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41;\n // Crazy IE10 Matrix\n else if (matrix.length === 16) curTransform = parseFloat(matrix[12]);\n // Normal Browsers\n else curTransform = parseFloat(matrix[4]);\n }\n if (axis === 'y') {\n // Latest Chrome and webkits Fix\n if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42;\n // Crazy IE10 Matrix\n else if (matrix.length === 16) curTransform = parseFloat(matrix[13]);\n // Normal Browsers\n else curTransform = parseFloat(matrix[5]);\n }\n return curTransform || 0;\n}\nfunction isObject(o) {\n return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object';\n}\nfunction isNode(node) {\n // eslint-disable-next-line\n if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') {\n return node instanceof HTMLElement;\n }\n return node && (node.nodeType === 1 || node.nodeType === 11);\n}\nfunction extend() {\n const to = Object(arguments.length <= 0 ? undefined : arguments[0]);\n const noExtend = ['__proto__', 'constructor', 'prototype'];\n for (let i = 1; i < arguments.length; i += 1) {\n const nextSource = i < 0 || arguments.length <= i ? undefined : arguments[i];\n if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) {\n const keysArray = Object.keys(Object(nextSource)).filter(key => noExtend.indexOf(key) < 0);\n for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {\n const nextKey = keysArray[nextIndex];\n const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);\n if (desc !== undefined && desc.enumerable) {\n if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) {\n if (nextSource[nextKey].__swiper__) {\n to[nextKey] = nextSource[nextKey];\n } else {\n extend(to[nextKey], nextSource[nextKey]);\n }\n } else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) {\n to[nextKey] = {};\n if (nextSource[nextKey].__swiper__) {\n to[nextKey] = nextSource[nextKey];\n } else {\n extend(to[nextKey], nextSource[nextKey]);\n }\n } else {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n }\n }\n return to;\n}\nfunction setCSSProperty(el, varName, varValue) {\n el.style.setProperty(varName, varValue);\n}\nfunction animateCSSModeScroll(_ref) {\n let {\n swiper,\n targetPosition,\n side\n } = _ref;\n const window = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n const startPosition = -swiper.translate;\n let startTime = null;\n let time;\n const duration = swiper.params.speed;\n swiper.wrapperEl.style.scrollSnapType = 'none';\n window.cancelAnimationFrame(swiper.cssModeFrameID);\n const dir = targetPosition > startPosition ? 'next' : 'prev';\n const isOutOfBound = (current, target) => {\n return dir === 'next' && current >= target || dir === 'prev' && current <= target;\n };\n const animate = () => {\n time = new Date().getTime();\n if (startTime === null) {\n startTime = time;\n }\n const progress = Math.max(Math.min((time - startTime) / duration, 1), 0);\n const easeProgress = 0.5 - Math.cos(progress * Math.PI) / 2;
711\n let currentPosition = startPosition + easeProgress * (targetPosition - startPosition);\n if (isOutOfBound(currentPosition, targetPosition)) {\n currentPosition = targetPosition;\n }\n swiper.wrapperEl.scrollTo({\n [side]: currentPosition\n });\n if (isOutOfBound(currentPosition, targetPosition)) {\n swiper.wrapperEl.style.overflow = 'hidden';\n swiper.wrapperEl.style.scrollSnapType = '';\n setTimeout(() => {\n swiper.wrapperEl.style.overflow = '';\n swiper.wrapperEl.scrollTo({\n [side]: currentPosition\n });\n });\n window.cancelAnimationFrame(swiper.cssModeFrameID);\n return;\n }\n swiper.cssModeFrameID = window.requestAnimationFrame(animate);\n };\n animate();\n}\nfunction getSlideTransformEl(slideEl) {\n return slideEl.querySelector('.swiper-slide-transform') || slideEl.shadowRoot && slideEl.shadowRoot.querySelector('.swiper-slide-transform') || slideEl;\n}\nfunction elementChildren(element, selector) {\n if (selector === void 0) {\n selector = '';\n }\n return [...element.children].filter(el => el.matches(selector));\n}\nfunction createElement(tag, classes) {\n if (classes === void 0) {\n classes = [];\n }\n const el = document.createElement(tag);\n el.classList.add(...(Array.isArray(classes) ? classes : [classes]));\n return el;\n}\nfunction elementOffset(el) {\n const window = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n const document = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.g)();\n const box = el.getBoundingClientRect();\n const body = document.body;\n const clientTop = el.clientTop || body.clientTop || 0;\n const clientLeft = el.clientLeft || body.clientLeft || 0;\n const scrollTop = el === window ? window.scrollY : el.scrollTop;\n const scrollLeft = el === window ? window.scrollX : el.scrollLeft;\n return {\n top: box.top + scrollTop - clientTop,\n left: box.left + scrollLeft - clientLeft\n };\n}\nfunction elementPrevAll(el, selector) {\n const prevEls = [];\n while (el.previousElementSibling) {\n const prev = el.previousElementSibling; // eslint-disable-line\n if (selector) {\n if (prev.matches(selector)) prevEls.push(prev);\n } else prevEls.push(prev);\n el = prev;\n }\n return prevEls;\n}\nfunction elementNextAll(el, selector) {\n const nextEls = [];\n while (el.nextElementSibling) {\n const next = el.nextElementSibling; // eslint-disable-line\n if (selector) {\n if (next.matches(selector)) nextEls.push(next);\n } else nextEls.push(next);\n el = next;\n }\n return nextEls;\n}\nfunction elementStyle(el, prop) {\n const window = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n return window.getComputedStyle(el, null).getPropertyValue(prop);\n}\nfunction elementIndex(el) {\n let child = el;\n let i;\n if (child) {\n i = 0;\n // eslint-disable-next-line\n while ((child = child.previousSibling) !== null) {\n if (child.nodeType === 1) i += 1;\n }\n return i;\n }\n return undefined;\n}\nfunction elementParents(el, selector) {\n const parents = []; // eslint-disable-line\n let parent = el.parentElement; // eslint-disable-line\n while (parent) {\n if (selector) {\n if (parent.matches(selector)) parents.push(parent);\n } else {\n parents.push(parent);\n }\n parent = parent.parentElement;\n }\n return parents;\n}\nfunction elementTransitionEnd(el, callback) {\n function fireCallBack(e) {\n if (e.target !== el) return;\n callback.call(el, e);\n el.removeEventListener('transitionend', fireCallBack);\n }\n if (callback) {\n el.addEventListener('transitionend', fireCallBack);\n }\n}\nfunction elementOuterSize(el, size, includeMargins) {\n const window = (0,_ssr_window_esm_mjs__WEBPACK_IMPORTED_MODULE_0__.a)();\n if (includeMargins) {\n return el[size === 'width' ? 'offsetWidth' : 'offsetHeight'] + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-right' : 'margin-top')) + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-left' : 'margin-bottom'));\n }\n return el.offsetWidth;\n}\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/shared/utils.mjs?\n}"); 712 713/***/ }, 714 715/***/ "./node_modules/swiper/swiper.mjs" 716/*!****************************************!*\ 717 !*** ./node_modules/swiper/swiper.mjs ***! 718 \****************************************/ 719(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 720 721"use strict"; 722eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Swiper: () => (/* reexport safe */ _shared_swiper_core_mjs__WEBPACK_IMPORTED_MODULE_0__.S),\
722n/* harmony export */ \"default\": () => (/* reexport safe */ _shared_swiper_core_mjs__WEBPACK_IMPORTED_MODULE_0__.S)\n/* harmony export */ });\n/* harmony import */ var _shared_swiper_core_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shared/swiper-core.mjs */ \"./node_modules/swiper/shared/swiper-core.mjs\");\n/**\n * Swiper 10.3.1\n * Most modern mobile touch slider and framework with hardware accelerated transitions\n * https://swiperjs.com\n *\n * Copyright 2014-2023 Vladimir Kharlampidi\n *\n * Released under the MIT License\n *\n * Released on: September 28, 2023\n */\n\n\n\n\n//# sourceURL=webpack://@academedia/ams-core/./node_modules/swiper/swiper.mjs?\n}"); 723 724/***/ } 725 726/******/ }); 727/************************************************************************/ 728/******/ // The module cache 729/******/ const __webpack_module_cache__ = {}; 730/******/ 731/******/ // The require function 732/******/ function __webpack_require__(moduleId) { 733/******/ // Check if module is in cache 734/******/ const cachedModule = __webpack_module_cache__[moduleId]; 735/******/ if (cachedModule !== undefined) { 736/******/ return cachedModule.exports; 737/******/ } 738/******/ // Create a new module (and put it into the cache) 739/******/ const module = __webpack_module_cache__[moduleId] = { 740/******/ // no module.id needed 741/******/ // no module.loaded needed 742/******/ exports: {} 743/******/ }; 744/******/ 745/******/ // Execute the module function 746/******/ if (!(moduleId in __webpack_modules__)) { 747/******/ delete __webpack_module_cache__[moduleId]; 748/******/ const e = new Error("Cannot find module '" + moduleId + "'"); 749/******/ e.code = 'MODULE_NOT_FOUND'; 750/******/ throw e; 751/******/ } 752/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 753/******/ 754/******/ // Return the exports of the module 755/******/ return module.exports; 756/******/ } 757/******/ 758/************************************************************************/ 759/******/ /* webpack/runtime/compat get default export */ 760/******/ // getDefaultExport function for compatibility with non-harmony modules 761/******/ __webpack_require__.n = (module) => { 762/******/ const getter = module && module.__esModule ? 763/******/ () => (module['default']) : 764/******/ () => (module); 765/******/ __webpack_require__.d(getter, { a: getter }); 766/******/ return getter; 767/******/ }; 768/******/ 769/******/ /* webpack/runtime/define property getters */ 770/******/ // define getter/value functions for harmony exports 771/******/ __webpack_require__.d = (exports, definition) => { 772/******/ for(var key in definition) { 773/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 774/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 775/******/ } 776/******/ } 777/******/ }; 778/******/ 779/******/ /* webpack/runtime/hasOwnProperty shorthand */ 780/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)); 781/******/ 782/******/ /* webpack/runtime/make namespace object */ 783/******/ // define __esModule on exports 784/******/ __webpack_require__.r = (exports) => { 785/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 786/******/ Object.defineProperty(exports, '__esModule', { value: true }); 787/******/ }; 788/******/ 789/************************************************************************/ 790/******/ 791/******/ // startup 792/******/ // Load entry module and return exports 793/******/ // This entry module can't be inlined because the eval devtool is used. 794/******/ let __webpack_exports__ = __webpack_require__("./src/resources/assets/js/frontend/frontend.js"); 795/******/ 796/******/ })() 797;
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.