!/*! License details at fancyapps.com/license */function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).window=e.window||{})}(this,function(e){"use strict";let t={syncOnChange:!1,syncOnClick:!0,syncOnHover:!1};e.Sync=()=>{let e,n;function i(){let n=e?.getOptions().Sync;return"object"==typeof n&&null!==n&&n.constructor===Object&&"[object Object]"===Object.prototype.toString.call(n)?{...t,...n}:t}function o(){let t=i().target;e&&t&&e&&t&&(n=t,e.getOptions().classes={...e.getOptions().classes,isSelected:""},e.getOptions().initialSlide=n.getPage()?.slides[0]?.index||0,i().syncOnChange&&e.on("change",f),i().syncOnClick&&e.on("click",l),i().syncOnHover&&e.getViewport()?.addEventListener("mouseover",g),e&&n&&(e.on("ready",s),e.on("refresh",r),n.on("change",c),n.on("filter",d)))}function s(){a()}function f(){if(e&&n){let t=e.getPage()?.slides||[],i=n.getPageIndex(t[0].index||0);i>-1&&n.goTo(i,e.hasNavigated()?void 0:{tween:!1,transition:!1}),a()}}function c(){if(e&&n){let t=e.getPageIndex(n.getPage()?.slides[0].index||0);t>-1&&e.goTo(t,n.hasNavigated()?void 0:{tween:!1,transition:!1}),a()}}function l(t,i){if(!e||!n||e.getTween()?.isRunning())return;let o=e?.getOptions().classes.slide;if(!o)return;let s=o?i.target.closest(`.${o}`):null;if(s){let e=parseInt(s.getAttribute("index")||"")||0,t=n.getPageIndex(e);n.goTo(t)}}function g(t){e&&l(e,t)}function r(){if(e&&n){let t=e.getPageIndex(n.getPage()?.slides[0].index||0);t>-1&&e.goTo(t,{tween:!1,transition:!1}),a()}}function d(t,i){e&&n&&(e.filter(i),c())}function a(){if(!n)return;let t=n.getPage()?.slides[0]?.index||0;for(let n of e?.getSlides()||[])n.el?.classList.toggle("is-selected",n.index===t)}return{init:function(t){(e=t).on("initSlides",o)},destroy:function(){e?.off("ready",s),e?.off("refresh",r),e?.off("change",f),e?.off("click",l),e?.getViewport()?.removeEventListener("mouseover",g),n?.off("change",c),n?.off("filter",d),n=void 0,e?.off("initSlides",o),e=void 0},getTarget:function(){return n}}}});