PageSourceSearch

https://ticket-hcspart.ru/local/modules/swiper/swiper-bundle.js?1753827452381828

js ticket-hcspart.ru collected 2026-10-08 14:36:19 UTC 381,828 bytes, 9,269 lines download raw bytes

vendor: 4,469 bytes, lines 1-176
1/**
2 * Swiper 10.3.1
3 * Most modern mobile touch slider and framework with hardware accelerated transitions
4 * https://swiperjs.com
5 *
6 * Copyright 2014-2023 Vladimir Kharlampidi
7 *
8 * Released under the MIT License
9 *
10 * Released on: September 28, 2023
11 */
12
13var Swiper = (function () {
14    'use strict';
15
16    /**
17     * SSR Window 4.0.2
18     * Better handling for window object in SSR environment
19     * https://github.com/nolimits4web/ssr-window
20     *
21     * Copyright 2021, Vladimir Kharlampidi
22     *
23     * Licensed under MIT
24     *
25     * Released on: December 13, 2021
26     */
27    /* eslint-disable no-param-reassign */
28    function isObject$1(obj) {
29        return obj !== null && typeof obj === 'object' && 'constructor' in obj && obj.constructor === Object;
30    }
31    function extend$1(target, src) {
32        if (target === void 0) {
33            target = {};
34        }
35        if (src === void 0) {
36            src = {};
37        }
38        Object.keys(src).forEach(key => {
39            if (typeof target[key] === 'undefined') target[key] = src[key];else if (isObject$1(src[key]) && isObject$1(target[key]) && Object.keys(src[key]).length > 0) {
40                extend$1(target[key], src[key]);
41            }
42        });
43    }
44    const ssrDocument = {
45        body: {},
46        addEventListener() {},
47        removeEventListener() {},
48        activeElement: {
49            blur() {},
50            nodeName: ''
51        },
52        querySelector() {
53            return null;
54        },
55        querySelectorAll() {
56            return [];
57        },
58        getElementById() {
59            return null;
60        },
61        createEvent() {
62            return {
63                initEvent() {}
64            };
65        },
66        createElement() {
67            return {
68                children: [],
69                childNodes: [],
70                style: {},
71                setAttribute() {},
72                getElementsByTagName() {
73                    return [];
74                }
75            };
76        },
77        createElementNS() {
78            return {};
79        },
80        importNode() {
81            return null;
82        },
83        location: {
84            hash: '',
85            host: '',
86            hostname: '',
87            href: '',
88            origin: '',
89            pathname: '',
90            protocol: '',
91            search: ''
92        }
93    };
94    function getDocument() {
95        const doc = typeof document !== 'undefined' ? document : {};
96        extend$1(doc, ssrDocument);
97        return doc;
98    }
99    const ssrWindow = {
100        document: ssrDocument,
101        navigator: {
102            userAgent: ''
103        },
104        location: {
105            hash: '',
106            host: '',
107            hostname: '',
108            href: '',
109            origin: '',
110            pathname: '',
111            protocol: '',
112            search: ''
113        },
114        history: {
115            replaceState() {},
116            pushState() {},
117            go() {},
118            back() {}
119        },
120        CustomEvent: function CustomEvent() {
121            return this;
122        },
123        addEventListener() {},
124        removeEventListener() {},
125        getComputedStyle() {
126            return {
127                getPropertyValue() {
128                    return '';
129                }
130            };
131        },
132        Image() {},
133        Date() {},
134        screen: {},
135        setTimeout() {},
136        clearTimeout() {},
137        matchMedia() {
138            return {};
139        },
140        requestAnimationFrame(callback) {
141            if (typeof setTimeout === 'undefined') {
142                callback();
143                return null;
144            }
145            return setTimeout(callback, 0);
146        },
147        cancelAnimationFrame(id) {
148            if (typeof setTimeout === 'undefined') {
149                return;
150            }
151            clearTimeout(id);
152        }
153    };
154    function getWindow() {
155        const win = typeof window !== 'undefined' ? window : {};
156        extend$1(win, ssrWindow);
157        return win;
158    }
159
160    function deleteProps(obj) {
161        const object = obj;
162        Object.keys(object).forEach(key => {
163            try {
164                object[key] = null;
165            } catch (e) {
166                // no getter for object
167            }
168            try {
169                delete object[key];
170            } catch (e) {
171                // something got wrong
172            }
173        });
174    }
175    function nextTick(callback, delay) {
176        if (delay === void 0) {
vendor: 7,242 bytes, lines 177-343
177            delay = 0;
178        }
179        return setTimeout(callback, delay);
180    }
181    function now() {
182        return Date.now();
183    }
184    function getComputedStyle$1(el) {
185        const window = getWindow();
186        let style;
187        if (window.getComputedStyle) {
188            style = window.getComputedStyle(el, null);
189        }
190        if (!style && el.currentStyle) {
191            style = el.currentStyle;
192        }
193        if (!style) {
194            style = el.style;
195        }
196        return style;
197    }
198    function getTranslate(el, axis) {
199        if (axis === void 0) {
200            axis = 'x';
201        }
202        const window = getWindow();
203        let matrix;
204        let curTransform;
205        let transformMatrix;
206        const curStyle = getComputedStyle$1(el);
207        if (window.WebKitCSSMatrix) {
208            curTransform = curStyle.transform || curStyle.webkitTransform;
209            if (curTransform.split(',').length > 6) {
210                curTransform = curTransform.split(', ').map(a => a.replace(',', '.')).join(', ');
211            }
212            // Some old versions of Webkit choke when 'none' is passed; pass
213            // empty string instead in this case
214            transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);
215        } else {
216            transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
217            matrix = transformMatrix.toString().split(',');
218        }
219        if (axis === 'x') {
220            // Latest Chrome and webkits Fix
221            if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41;
222            // Crazy IE10 Matrix
223            else if (matrix.length === 16) curTransform = parseFloat(matrix[12]);
224            // Normal Browsers
225            else curTransform = parseFloat(matrix[4]);
226        }
227        if (axis === 'y') {
228            // Latest Chrome and webkits Fix
229            if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42;
230            // Crazy IE10 Matrix
231            else if (matrix.length === 16) curTransform = parseFloat(matrix[13]);
232            // Normal Browsers
233            else curTransform = parseFloat(matrix[5]);
234        }
235        return curTransform || 0;
236    }
237    function isObject(o) {
238        return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object';
239    }
240    function isNode(node) {
241        // eslint-disable-next-line
242        if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') {
243            return node instanceof HTMLElement;
244        }
245        return node && (node.nodeType === 1 || node.nodeType === 11);
246    }
247    function extend() {
248        const to = Object(arguments.length <= 0 ? undefined : arguments[0]);
249        const noExtend = ['__proto__', 'constructor', 'prototype'];
250        for (let i = 1; i < arguments.length; i += 1) {
251            const nextSource = i < 0 || arguments.length <= i ? undefined : arguments[i];
252            if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) {
253                const keysArray = Object.keys(Object(nextSource)).filter(key => noExtend.indexOf(key) < 0);
254                for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
255                    const nextKey = keysArray[nextIndex];
256                    const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
257                    if (desc !== undefined && desc.enumerable) {
258                        if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
259                            if (nextSource[nextKey].__swiper__) {
260                                to[nextKey] = nextSource[nextKey];
261                            } else {
262                                extend(to[nextKey], nextSource[nextKey]);
263                            }
264                        } else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
265                            to[nextKey] = {};
266                            if (nextSource[nextKey].__swiper__) {
267                                to[nextKey] = nextSource[nextKey];
268                            } else {
269                                extend(to[nextKey], nextSource[nextKey]);
270                            }
271                        } else {
272                            to[nextKey] = nextSource[nextKey];
273                        }
274                    }
275                }
276            }
277        }
278        return to;
279    }
280    function setCSSProperty(el, varName, varValue) {
281        el.style.setProperty(varName, varValue);
282    }
283    function animateCSSModeScroll(_ref) {
284        let {
285            swiper,
286            targetPosition,
287            side
288        } = _ref;
289        const window = getWindow();
290        const startPosition = -swiper.translate;
291        let startTime = null;
292        let time;
293        const duration = swiper.params.speed;
294        swiper.wrapperEl.style.scrollSnapType = 'none';
295        window.cancelAnimationFrame(swiper.cssModeFrameID);
296        const dir = targetPosition > startPosition ? 'next' : 'prev';
297        const isOutOfBound = (current, target) => {
298            return dir === 'next' && current >= target || dir === 'prev' && current <= target;
299        };
300        const animate = () => {
301            time = new Date().getTime();
302            if (startTime === null) {
303                startTime = time;
304            }
305            const progress = Math.max(Math.min((time - startTime) / duration, 1), 0);
306            const easeProgress = 0.5 - Math.cos(progress * Math.PI) / 2;
307            let currentPosition = startPosition + easeProgress * (targetPosition - startPosition);
308            if (isOutOfBound(currentPosition, targetPosition)) {
309                currentPosition = targetPosition;
310            }
311            swiper.wrapperEl.scrollTo({
312                [side]: currentPosition
313            });
314            if (isOutOfBound(currentPosition, targetPosition)) {
315                swiper.wrapperEl.style.overflow = 'hidden';
316                swiper.wrapperEl.style.scrollSnapType = '';
317                setTimeout(() => {
318                    swiper.wrapperEl.style.overflow = '';
319                    swiper.wrapperEl.scrollTo({
320                        [side]: currentPosition
321                    });
322                });
323                window.cancelAnimationFrame(swiper.cssModeFrameID);
324                return;
325            }
326            swiper.cssModeFrameID = window.requestAnimationFrame(animate);
327        };
328        animate();
329    }
330    function getSlideTransformEl(slideEl) {
331        return slideEl.querySelector('.swiper-slide-transform') || slideEl.shadowRoot && slideEl.shadowRoot.querySelector('.swiper-slide-transform') || slideEl;
332    }
333    function elementChildren(element, selector) {
334        if (selector === void 0) {
335            selector = '';
336        }
337        return [...element.children].filter(el => el.matches(selector));
338    }
339    function createElement(tag, classes) {
340        if (classes === void 0) {
341            classes = [];
342        }
343        const el = document.createElement(tag);
vendor: 3,895 bytes, lines 344-451
344        el.classList.add(...(Array.isArray(classes) ? classes : [classes]));
345        return el;
346    }
347    function elementOffset(el) {
348        const window = getWindow();
349        const document = getDocument();
350        const box = el.getBoundingClientRect();
351        const body = document.body;
352        const clientTop = el.clientTop || body.clientTop || 0;
353        const clientLeft = el.clientLeft || body.clientLeft || 0;
354        const scrollTop = el === window ? window.scrollY : el.scrollTop;
355        const scrollLeft = el === window ? window.scrollX : el.scrollLeft;
356        return {
357            top: box.top + scrollTop - clientTop,
358            left: box.left + scrollLeft - clientLeft
359        };
360    }
361    function elementPrevAll(el, selector) {
362        const prevEls = [];
363        while (el.previousElementSibling) {
364            const prev = el.previousElementSibling; // eslint-disable-line
365            if (selector) {
366                if (prev.matches(selector)) prevEls.push(prev);
367            } else prevEls.push(prev);
368            el = prev;
369        }
370        return prevEls;
371    }
372    function elementNextAll(el, selector) {
373        const nextEls = [];
374        while (el.nextElementSibling) {
375            const next = el.nextElementSibling; // eslint-disable-line
376            if (selector) {
377                if (next.matches(selector)) nextEls.push(next);
378            } else nextEls.push(next);
379            el = next;
380        }
381        return nextEls;
382    }
383    function elementStyle(el, prop) {
384        const window = getWindow();
385        return window.getComputedStyle(el, null).getPropertyValue(prop);
386    }
387    function elementIndex(el) {
388        let child = el;
389        let i;
390        if (child) {
391            i = 0;
392            // eslint-disable-next-line
393            while ((child = child.previousSibling) !== null) {
394                if (child.nodeType === 1) i += 1;
395            }
396            return i;
397        }
398        return undefined;
399    }
400    function elementParents(el, selector) {
401        const parents = []; // eslint-disable-line
402        let parent = el.parentElement; // eslint-disable-line
403        while (parent) {
404            if (selector) {
405                if (parent.matches(selector)) parents.push(parent);
406            } else {
407                parents.push(parent);
408            }
409            parent = parent.parentElement;
410        }
411        return parents;
412    }
413    function elementTransitionEnd(el, callback) {
414        function fireCallBack(e) {
415            if (e.target !== el) return;
416            callback.call(el, e);
417            el.removeEventListener('transitionend', fireCallBack);
418        }
419        if (callback) {
420            el.addEventListener('transitionend', fireCallBack);
421        }
422    }
423    function elementOuterSize(el, size, includeMargins) {
424        const window = getWindow();
425        if (includeMargins) {
426            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'));
427        }
428        return el.offsetWidth;
429    }
430
431    let support;
432    function calcSupport() {
433        const window = getWindow();
434        const document = getDocument();
435        return {
436            smoothScroll: document.documentElement && document.documentElement.style && 'scrollBehavior' in document.documentElement.style,
437            touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch)
438        };
439    }
440    function getSupport() {
441        if (!support) {
442            support = calcSupport();
443        }
444        return support;
445    }
446
447    let deviceCached;
448    function calcDevice(_temp) {
449        let {
450            userAgent
451        } = _temp === void 0 ? {} : _temp;
vendor: 12,133 bytes, lines 452-759
452        const support = getSupport();
453        const window = getWindow();
454        const platform = window.navigator.platform;
455        const ua = userAgent || window.navigator.userAgent;
456        const device = {
457            ios: false,
458            android: false
459        };
460        const screenWidth = window.screen.width;
461        const screenHeight = window.screen.height;
462        const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line
463        let ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
464        const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
465        const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
466        const windows = platform === 'Win32';
467        let macos = platform === 'MacIntel';
468
469        // iPadOs 13 fix
470        const iPadScreens = ['1024x1366', '1366x1024', '834x1194', '1194x834', '834x1112', '1112x834', '768x1024', '1024x768', '820x1180', '1180x820', '810x1080', '1080x810'];
471        if (!ipad && macos && support.touch && iPadScreens.indexOf(`${screenWidth}x${screenHeight}`) >= 0) {
472            ipad = ua.match(/(Version)\/([\d.]+)/);
473            if (!ipad) ipad = [0, 1, '13_0_0'];
474            macos = false;
475        }
476
477        // Android
478        if (android && !windows) {
479            device.os = 'android';
480            device.android = true;
481        }
482        if (ipad || iphone || ipod) {
483            device.os = 'ios';
484            device.ios = true;
485        }
486
487        // Export object
488        return device;
489    }
490    function getDevice(overrides) {
491        if (overrides === void 0) {
492            overrides = {};
493        }
494        if (!deviceCached) {
495            deviceCached = calcDevice(overrides);
496        }
497        return deviceCached;
498    }
499
500    let browser;
501    function calcBrowser() {
502        const window = getWindow();
503        let needPerspectiveFix = false;
504        function isSafari() {
505            const ua = window.navigator.userAgent.toLowerCase();
506            return ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0;
507        }
508        if (isSafari()) {
509            const ua = String(window.navigator.userAgent);
510            if (ua.includes('Version/')) {
511                const [major, minor] = ua.split('Version/')[1].split(' ')[0].split('.').map(num => Number(num));
512                needPerspectiveFix = major < 16 || major === 16 && minor < 2;
513            }
514        }
515        return {
516            isSafari: needPerspectiveFix || isSafari(),
517            needPerspectiveFix,
518            isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent)
519        };
520    }
521    function getBrowser() {
522        if (!browser) {
523            browser = calcBrowser();
524        }
525        return browser;
526    }
527
528    function Resize(_ref) {
529        let {
530            swiper,
531            on,
532            emit
533        } = _ref;
534        const window = getWindow();
535        let observer = null;
536        let animationFrame = null;
537        const resizeHandler = () => {
538            if (!swiper || swiper.destroyed || !swiper.initialized) return;
539            emit('beforeResize');
540            emit('resize');
541        };
542        const createObserver = () => {
543            if (!swiper || swiper.destroyed || !swiper.initialized) return;
544            observer = new ResizeObserver(entries => {
545                animationFrame = window.requestAnimationFrame(() => {
546                    const {
547                        width,
548                        height
549                    } = swiper;
550                    let newWidth = width;
551                    let newHeight = height;
552                    entries.forEach(_ref2 => {
553                        let {
554                            contentBoxSize,
555                            contentRect,
556                            target
557                        } = _ref2;
558                        if (target && target !== swiper.el) return;
559                        newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize;
560                        newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize;
561                    });
562                    if (newWidth !== width || newHeight !== height) {
563                        resizeHandler();
564                    }
565                });
566            });
567            observer.observe(swiper.el);
568        };
569        const removeObserver = () => {
570            if (animationFrame) {
571                window.cancelAnimationFrame(animationFrame);
572            }
573            if (observer && observer.unobserve && swiper.el) {
574                observer.unobserve(swiper.el);
575                observer = null;
576            }
577        };
578        const orientationChangeHandler = () => {
579            if (!swiper || swiper.destroyed || !swiper.initialized) return;
580            emit('orientationchange');
581        };
582        on('init', () => {
583            if (swiper.params.resizeObserver && typeof window.ResizeObserver !== 'undefined') {
584                createObserver();
585                return;
586            }
587            window.addEventListener('resize', resizeHandler);
588            window.addEventListener('orientationchange', orientationChangeHandler);
589        });
590        on('destroy', () => {
591            removeObserver();
592            window.removeEventListener('resize', resizeHandler);
593            window.removeEventListener('orientationchange', orientationChangeHandler);
594        });
595    }
596
597    function Observer(_ref) {
598        let {
599            swiper,
600            extendParams,
601            on,
602            emit
603        } = _ref;
604        const observers = [];
605        const window = getWindow();
606        const attach = function (target, options) {
607            if (options === void 0) {
608                options = {};
609            }
610            const ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;
611            const observer = new ObserverFunc(mutations => {
612                // The observerUpdate event should only be triggered
613                // once despite the number of mutations.  Additional
614                // triggers are redundant and are very costly
615                if (swiper.__preventObserver__) return;
616                if (mutations.length === 1) {
617                    emit('observerUpdate', mutations[0]);
618                    return;
619                }
620                const observerUpdate = function observerUpdate() {
621                    emit('observerUpdate', mutations[0]);
622                };
623                if (window.requestAnimationFrame) {
624                    window.requestAnimationFrame(observerUpdate);
625                } else {
626                    window.setTimeout(observerUpdate, 0);
627                }
628            });
629            observer.observe(target, {
630                attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
631                childList: typeof options.childList === 'undefined' ? true : options.childList,
632                characterData: typeof options.characterData === 'undefined' ? true : options.characterData
633            });
634            observers.push(observer);
635        };
636        const init = () => {
637            if (!swiper.params.observer) return;
638            if (swiper.params.observeParents) {
639                const containerParents = elementParents(swiper.hostEl);
640                for (let i = 0; i < containerParents.length; i += 1) {
641                    attach(containerParents[i]);
642                }
643            }
644            // Observe container
645            attach(swiper.hostEl, {
646                childList: swiper.params.observeSlideChildren
647            });
648
649            // Observe wrapper
650            attach(swiper.wrapperEl, {
651                attributes: false
652            });
653        };
654        const destroy = () => {
655            observers.forEach(observer => {
656                observer.disconnect();
657            });
658            observers.splice(0, observers.length);
659        };
660        extendParams({
661            observer: false,
662            observeParents: false,
663            observeSlideChildren: false
664        });
665        on('init', init);
666        on('destroy', destroy);
667    }
668
669    /* eslint-disable no-underscore-dangle */
670
671    var eventsEmitter = {
672        on(events, handler, priority) {
673            const self = this;
674            if (!self.eventsListeners || self.destroyed) return self;
675            if (typeof handler !== 'function') return self;
676            const method = priority ? 'unshift' : 'push';
677            events.split(' ').forEach(event => {
678                if (!self.eventsListeners[event]) self.eventsListeners[event] = [];
679                self.eventsListeners[event][method](handler);
680            });
681            return self;
682        },
683        once(events, handler, priority) {
684            const self = this;
685            if (!self.eventsListeners || self.destroyed) return self;
686            if (typeof handler !== 'function') return self;
687            function onceHandler() {
688                self.off(events, onceHandler);
689                if (onceHandler.__emitterProxy) {
690                    delete onceHandler.__emitterProxy;
691                }
692                for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
693                    args[_key] = arguments[_key];
694                }
695                handler.apply(self, args);
696            }
697            onceHandler.__emitterProxy = handler;
698            return self.on(events, onceHandler, priority);
699        },
700        onAny(handler, priority) {
701            const self = this;
702            if (!self.eventsListeners || self.destroyed) return self;
703            if (typeof handler !== 'function') return self;
704            const method = priority ? 'unshift' : 'push';
705            if (self.eventsAnyListeners.indexOf(handler) < 0) {
706                self.eventsAnyListeners[method](handler);
707            }
708            return self;
709        },
710        offAny(handler) {
711            const self = this;
712            if (!self.eventsListeners || self.destroyed) return self;
713            if (!self.eventsAnyListeners) return self;
714            const index = self.eventsAnyListeners.indexOf(handler);
715            if (index >= 0) {
716                self.eventsAnyListeners.splice(index, 1);
717            }
718            return self;
719        },
720        off(events, handler) {
721            const self = this;
722            if (!self.eventsListeners || self.destroyed) return self;
723            if (!self.eventsListeners) return self;
724            events.split(' ').forEach(event => {
725                if (typeof handler === 'undefined') {
726                    self.eventsListeners[event] = [];
727                } else if (self.eventsListeners[event]) {
728                    self.eventsListeners[event].forEach((eventHandler, index) => {
729                        if (eventHandler === handler || eventHandler.__emitterProxy && eventHandler.__emitterProxy === handler) {
730                            self.eventsListeners[event].splice(index, 1);
731                        }
732                    });
733                }
734            });
735            return self;
736        },
737        emit() {
738            const self = this;
739            if (!self.eventsListeners || self.destroyed) return self;
740            if (!self.eventsListeners) return self;
741            let events;
742            let data;
743            let context;
744            for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
745                args[_key2] = arguments[_key2];
746            }
747            if (typeof args[0] === 'string' || Array.isArray(args[0])) {
748                events = args[0];
749                data = args.slice(1, args.length);
750                context = self;
751            } else {
752                events = args[0].events;
753                data = args[0].data;
754                context = args[0].context || self;
755            }
756            data.unshift(context);
757            const eventsArray = Array.isArray(events) ? events : events.split(' ');
758            eventsArray.forEach(event => {
759                if (self.eventsAnyListeners && self.eventsAnyListeners.length) {
vendor: 16,085 bytes, lines 760-1111
760                    self.eventsAnyListeners.forEach(eventHandler => {
761                        eventHandler.apply(context, [event, ...data]);
762                    });
763                }
764                if (self.eventsListeners && self.eventsListeners[event]) {
765                    self.eventsListeners[event].forEach(eventHandler => {
766                        eventHandler.apply(context, data);
767                    });
768                }
769            });
770            return self;
771        }
772    };
773
774    function updateSize() {
775        const swiper = this;
776        let width;
777        let height;
778        const el = swiper.el;
779        if (typeof swiper.params.width !== 'undefined' && swiper.params.width !== null) {
780            width = swiper.params.width;
781        } else {
782            width = el.clientWidth;
783        }
784        if (typeof swiper.params.height !== 'undefined' && swiper.params.height !== null) {
785            height = swiper.params.height;
786        } else {
787            height = el.clientHeight;
788        }
789        if (width === 0 && swiper.isHorizontal() || height === 0 && swiper.isVertical()) {
790            return;
791        }
792
793        // Subtract paddings
794        width = width - parseInt(elementStyle(el, 'padding-left') || 0, 10) - parseInt(elementStyle(el, 'padding-right') || 0, 10);
795        height = height - parseInt(elementStyle(el, 'padding-top') || 0, 10) - parseInt(elementStyle(el, 'padding-bottom') || 0, 10);
796        if (Number.isNaN(width)) width = 0;
797        if (Number.isNaN(height)) height = 0;
798        Object.assign(swiper, {
799            width,
800            height,
801            size: swiper.isHorizontal() ? width : height
802        });
803    }
804
805    function updateSlides() {
806        const swiper = this;
807        function getDirectionLabel(property) {
808            if (swiper.isHorizontal()) {
809                return property;
810            }
811            // prettier-ignore
812            return {
813                'width': 'height',
814                'margin-top': 'margin-left',
815                'margin-bottom ': 'margin-right',
816                'margin-left': 'margin-top',
817                'margin-right': 'margin-bottom',
818                'padding-left': 'padding-top',
819                'padding-right': 'padding-bottom',
820                'marginRight': 'marginBottom'
821            }[property];
822        }
823        function getDirectionPropertyValue(node, label) {
824            return parseFloat(node.getPropertyValue(getDirectionLabel(label)) || 0);
825        }
826        const params = swiper.params;
827        const {
828            wrapperEl,
829            slidesEl,
830            size: swiperSize,
831            rtlTranslate: rtl,
832            wrongRTL
833        } = swiper;
834        const isVirtual = swiper.virtual && params.virtual.enabled;
835        const previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;
836        const slides = elementChildren(slidesEl, `.${swiper.params.slideClass}, swiper-slide`);
837        const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;
838        let snapGrid = [];
839        const slidesGrid = [];
840        const slidesSizesGrid = [];
841        let offsetBefore = params.slidesOffsetBefore;
842        if (typeof offsetBefore === 'function') {
843            offsetBefore = params.slidesOffsetBefore.call(swiper);
844        }
845        let offsetAfter = params.slidesOffsetAfter;
846        if (typeof offsetAfter === 'function') {
847            offsetAfter = params.slidesOffsetAfter.call(swiper);
848        }
849        const previousSnapGridLength = swiper.snapGrid.length;
850        const previousSlidesGridLength = swiper.slidesGrid.length;
851        let spaceBetween = params.spaceBetween;
852        let slidePosition = -offsetBefore;
853        let prevSlideSize = 0;
854        let index = 0;
855        if (typeof swiperSize === 'undefined') {
856            return;
857        }
858        if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
859            spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiperSize;
860        } else if (typeof spaceBetween === 'string') {
861            spaceBetween = parseFloat(spaceBetween);
862        }
863        swiper.virtualSize = -spaceBetween;
864
865        // reset margins
866        slides.forEach(slideEl => {
867            if (rtl) {
868                slideEl.style.marginLeft = '';
869            } else {
870                slideEl.style.marginRight = '';
871            }
872            slideEl.style.marginBottom = '';
873            slideEl.style.marginTop = '';
874        });
875
876        // reset cssMode offsets
877        if (params.centeredSlides && params.cssMode) {
878            setCSSProperty(wrapperEl, '--swiper-centered-offset-before', '');
879            setCSSProperty(wrapperEl, '--swiper-centered-offset-after', '');
880        }
881        const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;
882        if (gridEnabled) {
883            swiper.grid.initSlides(slidesLength);
884        }
885
886        // Calc slides
887        let slideSize;
888        const shouldResetSlideSize = params.slidesPerView === 'auto' && params.breakpoints && Object.keys(params.breakpoints).filter(key => {
889            return typeof params.breakpoints[key].slidesPerView !== 'undefined';
890        }).length > 0;
891        for (let i = 0; i < slidesLength; i += 1) {
892            slideSize = 0;
893            let slide;
894            if (slides[i]) slide = slides[i];
895            if (gridEnabled) {
896                swiper.grid.updateSlide(i, slide, slidesLength, getDirectionLabel);
897            }
898            if (slides[i] && elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line
899
900            if (params.slidesPerView === 'auto') {
901                if (shouldResetSlideSize) {
902                    slides[i].style[getDirectionLabel('width')] = ``;
903                }
904                const slideStyles = getComputedStyle(slide);
905                const currentTransform = slide.style.transform;
906                const currentWebKitTransform = slide.style.webkitTransform;
907                if (currentTransform) {
908                    slide.style.transform = 'none';
909                }
910                if (currentWebKitTransform) {
911                    slide.style.webkitTransform = 'none';
912                }
913                if (params.roundLengths) {
914                    slideSize = swiper.isHorizontal() ? elementOuterSize(slide, 'width', true) : elementOuterSize(slide, 'height', true);
915                } else {
916                    // eslint-disable-next-line
917                    const width = getDirectionPropertyValue(slideStyles, 'width');
918                    const paddingLeft = getDirectionPropertyValue(slideStyles, 'padding-left');
919                    const paddingRight = getDirectionPropertyValue(slideStyles, 'padding-right');
920                    const marginLeft = getDirectionPropertyValue(slideStyles, 'margin-left');
921                    const marginRight = getDirectionPropertyValue(slideStyles, 'margin-right');
922                    const boxSizing = slideStyles.getPropertyValue('box-sizing');
923                    if (boxSizing && boxSizing === 'border-box') {
924                        slideSize = width + marginLeft + marginRight;
925                    } else {
926                        const {
927                            clientWidth,
928                            offsetWidth
929                        } = slide;
930                        slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth);
931                    }
932                }
933                if (currentTransform) {
934                    slide.style.transform = currentTransform;
935                }
936                if (currentWebKitTransform) {
937                    slide.style.webkitTransform = currentWebKitTransform;
938                }
939                if (params.roundLengths) slideSize = Math.floor(slideSize);
940            } else {
941                slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;
942                if (params.roundLengths) slideSize = Math.floor(slideSize);
943                if (slides[i]) {
944                    slides[i].style[getDirectionLabel('width')] = `${slideSize}px`;
945                }
946            }
947            if (slides[i]) {
948                slides[i].swiperSlideSize = slideSize;
949            }
950            slidesSizesGrid.push(slideSize);
951            if (params.centeredSlides) {
952                slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;
953                if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;
954                if (i === 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;
955                if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;
956                if (params.roundLengths) slidePosition = Math.floor(slidePosition);
957                if (index % params.slidesPerGroup === 0) snapGrid.push(slidePosition);
958                slidesGrid.push(slidePosition);
959            } else {
960                if (params.roundLengths) slidePosition = Math.floor(slidePosition);
961                if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition);
962                slidesGrid.push(slidePosition);
963                slidePosition = slidePosition + slideSize + spaceBetween;
964            }
965            swiper.virtualSize += slideSize + spaceBetween;
966            prevSlideSize = slideSize;
967            index += 1;
968        }
969        swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter;
970        if (rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) {
971            wrapperEl.style.width = `${swiper.virtualSize + spaceBetween}px`;
972        }
973        if (params.setWrapperSize) {
974            wrapperEl.style[getDirectionLabel('width')] = `${swiper.virtualSize + spaceBetween}px`;
975        }
976        if (gridEnabled) {
977            swiper.grid.updateWrapperSize(slideSize, snapGrid, getDirectionLabel);
978        }
979
980        // Remove last grid elements depending on width
981        if (!params.centeredSlides) {
982            const newSlidesGrid = [];
983            for (let i = 0; i < snapGrid.length; i += 1) {
984                let slidesGridItem = snapGrid[i];
985                if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
986                if (snapGrid[i] <= swiper.virtualSize - swiperSize) {
987                    newSlidesGrid.push(slidesGridItem);
988                }
989            }
990            snapGrid = newSlidesGrid;
991            if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {
992                snapGrid.push(swiper.virtualSize - swiperSize);
993            }
994        }
995        if (isVirtual && params.loop) {
996            const size = slidesSizesGrid[0] + spaceBetween;
997            if (params.slidesPerGroup > 1) {
998                const groups = Math.ceil((swiper.virtual.slidesBefore + swiper.virtual.slidesAfter) / params.slidesPerGroup);
999                const groupSize = size * params.slidesPerGroup;
1000                for (let i = 0; i < groups; i += 1) {
1001                    snapGrid.push(snapGrid[snapGrid.length - 1] + groupSize);
1002                }
1003            }
1004            for (let i = 0; i < swiper.virtual.slidesBefore + swiper.virtual.slidesAfter; i += 1) {
1005                if (params.slidesPerGroup === 1) {
1006                    snapGrid.push(snapGrid[snapGrid.length - 1] + size);
1007                }
1008                slidesGrid.push(slidesGrid[slidesGrid.length - 1] + size);
1009                swiper.virtualSize += size;
1010            }
1011        }
1012        if (snapGrid.length === 0) snapGrid = [0];
1013        if (spaceBetween !== 0) {
1014            const key = swiper.isHorizontal() && rtl ? 'marginLeft' : getDirectionLabel('marginRight');
1015            slides.filter((_, slideIndex) => {
1016                if (!params.cssMode || params.loop) return true;
1017                if (slideIndex === slides.length - 1) {
1018                    return false;
1019                }
1020                return true;
1021            }).forEach(slideEl => {
1022                slideEl.style[key] = `${spaceBetween}px`;
1023            });
1024        }
1025        if (params.centeredSlides && params.centeredSlidesBounds) {
1026            let allSlidesSize = 0;
1027            slidesSizesGrid.forEach(slideSizeValue => {
1028                allSlidesSize += slideSizeValue + (spaceBetween || 0);
1029            });
1030            allSlidesSize -= spaceBetween;
1031            const maxSnap = allSlidesSize - swiperSize;
1032            snapGrid = snapGrid.map(snap => {
1033                if (snap <= 0) return -offsetBefore;
1034                if (snap > maxSnap) return maxSnap + offsetAfter;
1035                return snap;
1036            });
1037        }
1038        if (params.centerInsufficientSlides) {
1039            let allSlidesSize = 0;
1040            slidesSizesGrid.forEach(slideSizeValue => {
1041                allSlidesSize += slideSizeValue + (spaceBetween || 0);
1042            });
1043            allSlidesSize -= spaceBetween;
1044            if (allSlidesSize < swiperSize) {
1045                const allSlidesOffset = (swiperSize - allSlidesSize) / 2;
1046                snapGrid.forEach((snap, snapIndex) => {
1047                    snapGrid[snapIndex] = snap - allSlidesOffset;
1048                });
1049                slidesGrid.forEach((snap, snapIndex) => {
1050                    slidesGrid[snapIndex] = snap + allSlidesOffset;
1051                });
1052            }
1053        }
1054        Object.assign(swiper, {
1055            slides,
1056            snapGrid,
1057            slidesGrid,
1058            slidesSizesGrid
1059        });
1060        if (params.centeredSlides && params.cssMode && !params.centeredSlidesBounds) {
1061            setCSSProperty(wrapperEl, '--swiper-centered-offset-before', `${-snapGrid[0]}px`);
1062            setCSSProperty(wrapperEl, '--swiper-centered-offset-after', `${swiper.size / 2 - slidesSizesGrid[slidesSizesGrid.length - 1] / 2}px`);
1063            const addToSnapGrid = -swiper.snapGrid[0];
1064            const addToSlidesGrid = -swiper.slidesGrid[0];
1065            swiper.snapGrid = swiper.snapGrid.map(v => v + addToSnapGrid);
1066            swiper.slidesGrid = swiper.slidesGrid.map(v => v + addToSlidesGrid);
1067        }
1068        if (slidesLength !== previousSlidesLength) {
1069            swiper.emit('slidesLengthChange');
1070        }
1071        if (snapGrid.length !== previousSnapGridLength) {
1072            if (swiper.params.watchOverflow) swiper.checkOverflow();
1073            swiper.emit('snapGridLengthChange');
1074        }
1075        if (slidesGrid.length !== previousSlidesGridLength) {
1076            swiper.emit('slidesGridLengthChange');
1077        }
1078        if (params.watchSlidesProgress) {
1079            swiper.updateSlidesOffset();
1080        }
1081        if (!isVirtual && !params.cssMode && (params.effect === 'slide' || params.effect === 'fade')) {
1082            const backFaceHiddenClass = `${params.containerModifierClass}backface-hidden`;
1083            const hasClassBackfaceClassAdded = swiper.el.classList.contains(backFaceHiddenClass);
1084            if (slidesLength <= params.maxBackfaceHiddenSlides) {
1085                if (!hasClassBackfaceClassAdded) swiper.el.classList.add(backFaceHiddenClass);
1086            } else if (hasClassBackfaceClassAdded) {
1087                swiper.el.classList.remove(backFaceHiddenClass);
1088            }
1089        }
1090    }
1091
1092    function updateAutoHeight(speed) {
1093        const swiper = this;
1094        const activeSlides = [];
1095        const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
1096        let newHeight = 0;
1097        let i;
1098        if (typeof speed === 'number') {
1099            swiper.setTransition(speed);
1100        } else if (speed === true) {
1101            swiper.setTransition(swiper.params.speed);
1102        }
1103        const getSlideByIndex = index => {
1104            if (isVirtual) {
1105                return swiper.slides[swiper.getSlideIndexByData(index)];
1106            }
1107            return swiper.slides[index];
1108        };
1109        // Find slides currently in view
1110        if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) {
1111            if (swiper.params.centeredSlides) {
vendor: 2,068 bytes, lines 1112-1164
1112                (swiper.visibleSlides || []).forEach(slide => {
1113                    activeSlides.push(slide);
1114                });
1115            } else {
1116                for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) {
1117                    const index = swiper.activeIndex + i;
1118                    if (index > swiper.slides.length && !isVirtual) break;
1119                    activeSlides.push(getSlideByIndex(index));
1120                }
1121            }
1122        } else {
1123            activeSlides.push(getSlideByIndex(swiper.activeIndex));
1124        }
1125
1126        // Find new height from highest slide in view
1127        for (i = 0; i < activeSlides.length; i += 1) {
1128            if (typeof activeSlides[i] !== 'undefined') {
1129                const height = activeSlides[i].offsetHeight;
1130                newHeight = height > newHeight ? height : newHeight;
1131            }
1132        }
1133
1134        // Update Height
1135        if (newHeight || newHeight === 0) swiper.wrapperEl.style.height = `${newHeight}px`;
1136    }
1137
1138    function updateSlidesOffset() {
1139        const swiper = this;
1140        const slides = swiper.slides;
1141        // eslint-disable-next-line
1142        const minusOffset = swiper.isElement ? swiper.isHorizontal() ? swiper.wrapperEl.offsetLeft : swiper.wrapperEl.offsetTop : 0;
1143        for (let i = 0; i < slides.length; i += 1) {
1144            slides[i].swiperSlideOffset = (swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop) - minusOffset - swiper.cssOverflowAdjustment();
1145        }
1146    }
1147
1148    function updateSlidesProgress(translate) {
1149        if (translate === void 0) {
1150            translate = this && this.translate || 0;
1151        }
1152        const swiper = this;
1153        const params = swiper.params;
1154        const {
1155            slides,
1156            rtlTranslate: rtl,
1157            snapGrid
1158        } = swiper;
1159        if (slides.length === 0) return;
1160        if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();
1161        let offsetCenter = -translate;
1162        if (rtl) offsetCenter = translate;
1163
1164        // Visible Slides
vendor: 13,665 bytes, lines 1165-1476
1165        slides.forEach(slideEl => {
1166            slideEl.classList.remove(params.slideVisibleClass);
1167        });
1168        swiper.visibleSlidesIndexes = [];
1169        swiper.visibleSlides = [];
1170        let spaceBetween = params.spaceBetween;
1171        if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
1172            spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiper.size;
1173        } else if (typeof spaceBetween === 'string') {
1174            spaceBetween = parseFloat(spaceBetween);
1175        }
1176        for (let i = 0; i < slides.length; i += 1) {
1177            const slide = slides[i];
1178            let slideOffset = slide.swiperSlideOffset;
1179            if (params.cssMode && params.centeredSlides) {
1180                slideOffset -= slides[0].swiperSlideOffset;
1181            }
1182            const slideProgress = (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + spaceBetween);
1183            const originalSlideProgress = (offsetCenter - snapGrid[0] + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + spaceBetween);
1184            const slideBefore = -(offsetCenter - slideOffset);
1185            const slideAfter = slideBefore + swiper.slidesSizesGrid[i];
1186            const isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size;
1187            if (isVisible) {
1188                swiper.visibleSlides.push(slide);
1189                swiper.visibleSlidesIndexes.push(i);
1190                slides[i].classList.add(params.slideVisibleClass);
1191            }
1192            slide.progress = rtl ? -slideProgress : slideProgress;
1193            slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress;
1194        }
1195    }
1196
1197    function updateProgress(translate) {
1198        const swiper = this;
1199        if (typeof translate === 'undefined') {
1200            const multiplier = swiper.rtlTranslate ? -1 : 1;
1201            // eslint-disable-next-line
1202            translate = swiper && swiper.translate && swiper.translate * multiplier || 0;
1203        }
1204        const params = swiper.params;
1205        const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
1206        let {
1207            progress,
1208            isBeginning,
1209            isEnd,
1210            progressLoop
1211        } = swiper;
1212        const wasBeginning = isBeginning;
1213        const wasEnd = isEnd;
1214        if (translatesDiff === 0) {
1215            progress = 0;
1216            isBeginning = true;
1217            isEnd = true;
1218        } else {
1219            progress = (translate - swiper.minTranslate()) / translatesDiff;
1220            const isBeginningRounded = Math.abs(translate - swiper.minTranslate()) < 1;
1221            const isEndRounded = Math.abs(translate - swiper.maxTranslate()) < 1;
1222            isBeginning = isBeginningRounded || progress <= 0;
1223            isEnd = isEndRounded || progress >= 1;
1224            if (isBeginningRounded) progress = 0;
1225            if (isEndRounded) progress = 1;
1226        }
1227        if (params.loop) {
1228            const firstSlideIndex = swiper.getSlideIndexByData(0);
1229            const lastSlideIndex = swiper.getSlideIndexByData(swiper.slides.length - 1);
1230            const firstSlideTranslate = swiper.slidesGrid[firstSlideIndex];
1231            const lastSlideTranslate = swiper.slidesGrid[lastSlideIndex];
1232            const translateMax = swiper.slidesGrid[swiper.slidesGrid.length - 1];
1233            const translateAbs = Math.abs(translate);
1234            if (translateAbs >= firstSlideTranslate) {
1235                progressLoop = (translateAbs - firstSlideTranslate) / translateMax;
1236            } else {
1237                progressLoop = (translateAbs + translateMax - lastSlideTranslate) / translateMax;
1238            }
1239            if (progressLoop > 1) progressLoop -= 1;
1240        }
1241        Object.assign(swiper, {
1242            progress,
1243            progressLoop,
1244            isBeginning,
1245            isEnd
1246        });
1247        if (params.watchSlidesProgress || params.centeredSlides && params.autoHeight) swiper.updateSlidesProgress(translate);
1248        if (isBeginning && !wasBeginning) {
1249            swiper.emit('reachBeginning toEdge');
1250        }
1251        if (isEnd && !wasEnd) {
1252            swiper.emit('reachEnd toEdge');
1253        }
1254        if (wasBeginning && !isBeginning || wasEnd && !isEnd) {
1255            swiper.emit('fromEdge');
1256        }
1257        swiper.emit('progress', progress);
1258    }
1259
1260    function updateSlidesClasses() {
1261        const swiper = this;
1262        const {
1263            slides,
1264            params,
1265            slidesEl,
1266            activeIndex
1267        } = swiper;
1268        const isVirtual = swiper.virtual && params.virtual.enabled;
1269        const getFilteredSlide = selector => {
1270            return elementChildren(slidesEl, `.${params.slideClass}${selector}, swiper-slide${selector}`)[0];
1271        };
1272        slides.forEach(slideEl => {
1273            slideEl.classList.remove(params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
1274        });
1275        let activeSlide;
1276        if (isVirtual) {
1277            if (params.loop) {
1278                let slideIndex = activeIndex - swiper.virtual.slidesBefore;
1279                if (slideIndex < 0) slideIndex = swiper.virtual.slides.length + slideIndex;
1280                if (slideIndex >= swiper.virtual.slides.length) slideIndex -= swiper.virtual.slides.length;
1281                activeSlide = getFilteredSlide(`[data-swiper-slide-index="${slideIndex}"]`);
1282            } else {
1283                activeSlide = getFilteredSlide(`[data-swiper-slide-index="${activeIndex}"]`);
1284            }
1285        } else {
1286            activeSlide = slides[activeIndex];
1287        }
1288        if (activeSlide) {
1289            // Active classes
1290            activeSlide.classList.add(params.slideActiveClass);
1291
1292            // Next Slide
1293            let nextSlide = elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
1294            if (params.loop && !nextSlide) {
1295                nextSlide = slides[0];
1296            }
1297            if (nextSlide) {
1298                nextSlide.classList.add(params.slideNextClass);
1299            }
1300            // Prev Slide
1301            let prevSlide = elementPrevAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
1302            if (params.loop && !prevSlide === 0) {
1303                prevSlide = slides[slides.length - 1];
1304            }
1305            if (prevSlide) {
1306                prevSlide.classList.add(params.slidePrevClass);
1307            }
1308        }
1309        swiper.emitSlidesClasses();
1310    }
1311
1312    const processLazyPreloader = (swiper, imageEl) => {
1313        if (!swiper || swiper.destroyed || !swiper.params) return;
1314        const slideSelector = () => swiper.isElement ? `swiper-slide` : `.${swiper.params.slideClass}`;
1315        const slideEl = imageEl.closest(slideSelector());
1316        if (slideEl) {
1317            let lazyEl = slideEl.querySelector(`.${swiper.params.lazyPreloaderClass}`);
1318            if (!lazyEl && swiper.isElement) {
1319                if (slideEl.shadowRoot) {
1320                    lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`);
1321                } else {
1322                    // init later
1323                    requestAnimationFrame(() => {
1324                        if (slideEl.shadowRoot) {
1325                            lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`);
1326                            if (lazyEl) lazyEl.remove();
1327                        }
1328                    });
1329                }
1330            }
1331            if (lazyEl) lazyEl.remove();
1332        }
1333    };
1334    const unlazy = (swiper, index) => {
1335        if (!swiper.slides[index]) return;
1336        const imageEl = swiper.slides[index].querySelector('[loading="lazy"]');
1337        if (imageEl) imageEl.removeAttribute('loading');
1338    };
1339    const preload = swiper => {
1340        if (!swiper || swiper.destroyed || !swiper.params) return;
1341        let amount = swiper.params.lazyPreloadPrevNext;
1342        const len = swiper.slides.length;
1343        if (!len || !amount || amount < 0) return;
1344        amount = Math.min(amount, len);
1345        const slidesPerView = swiper.params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(swiper.params.slidesPerView);
1346        const activeIndex = swiper.activeIndex;
1347        if (swiper.params.grid && swiper.params.grid.rows > 1) {
1348            const activeColumn = activeIndex;
1349            const preloadColumns = [activeColumn - amount];
1350            preloadColumns.push(...Array.from({
1351                length: amount
1352            }).map((_, i) => {
1353                return activeColumn + slidesPerView + i;
1354            }));
1355            swiper.slides.forEach((slideEl, i) => {
1356                if (preloadColumns.includes(slideEl.column)) unlazy(swiper, i);
1357            });
1358            return;
1359        }
1360        const slideIndexLastInView = activeIndex + slidesPerView - 1;
1361        if (swiper.params.rewind || swiper.params.loop) {
1362            for (let i = activeIndex - amount; i <= slideIndexLastInView + amount; i += 1) {
1363                const realIndex = (i % len + len) % len;
1364                if (realIndex < activeIndex || realIndex > slideIndexLastInView) unlazy(swiper, realIndex);
1365            }
1366        } else {
1367            for (let i = Math.max(activeIndex - amount, 0); i <= Math.min(slideIndexLastInView + amount, len - 1); i += 1) {
1368                if (i !== activeIndex && (i > slideIndexLastInView || i < activeIndex)) {
1369                    unlazy(swiper, i);
1370                }
1371            }
1372        }
1373    };
1374
1375    function getActiveIndexByTranslate(swiper) {
1376        const {
1377            slidesGrid,
1378            params
1379        } = swiper;
1380        const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
1381        let activeIndex;
1382        for (let i = 0; i < slidesGrid.length; i += 1) {
1383            if (typeof slidesGrid[i + 1] !== 'undefined') {
1384                if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) {
1385                    activeIndex = i;
1386                } else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) {
1387                    activeIndex = i + 1;
1388                }
1389            } else if (translate >= slidesGrid[i]) {
1390                activeIndex = i;
1391            }
1392        }
1393        // Normalize slideIndex
1394        if (params.normalizeSlideIndex) {
1395            if (activeIndex < 0 || typeof activeIndex === 'undefined') activeIndex = 0;
1396        }
1397        return activeIndex;
1398    }
1399    function updateActiveIndex(newActiveIndex) {
1400        const swiper = this;
1401        const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
1402        const {
1403            snapGrid,
1404            params,
1405            activeIndex: previousIndex,
1406            realIndex: previousRealIndex,
1407            snapIndex: previousSnapIndex
1408        } = swiper;
1409        let activeIndex = newActiveIndex;
1410        let snapIndex;
1411        const getVirtualRealIndex = aIndex => {
1412            let realIndex = aIndex - swiper.virtual.slidesBefore;
1413            if (realIndex < 0) {
1414                realIndex = swiper.virtual.slides.length + realIndex;
1415            }
1416            if (realIndex >= swiper.virtual.slides.length) {
1417                realIndex -= swiper.virtual.slides.length;
1418            }
1419            return realIndex;
1420        };
1421        if (typeof activeIndex === 'undefined') {
1422            activeIndex = getActiveIndexByTranslate(swiper);
1423        }
1424        if (snapGrid.indexOf(translate) >= 0) {
1425            snapIndex = snapGrid.indexOf(translate);
1426        } else {
1427            const skip = Math.min(params.slidesPerGroupSkip, activeIndex);
1428            snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);
1429        }
1430        if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
1431        if (activeIndex === previousIndex) {
1432            if (snapIndex !== previousSnapIndex) {
1433                swiper.snapIndex = snapIndex;
1434                swiper.emit('snapIndexChange');
1435            }
1436            if (swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {
1437                swiper.realIndex = getVirtualRealIndex(activeIndex);
1438            }
1439            return;
1440        }
1441        // Get real index
1442        let realIndex;
1443        if (swiper.virtual && params.virtual.enabled && params.loop) {
1444            realIndex = getVirtualRealIndex(activeIndex);
1445        } else if (swiper.slides[activeIndex]) {
1446            realIndex = parseInt(swiper.slides[activeIndex].getAttribute('data-swiper-slide-index') || activeIndex, 10);
1447        } else {
1448            realIndex = activeIndex;
1449        }
1450        Object.assign(swiper, {
1451            previousSnapIndex,
1452            snapIndex,
1453            previousRealIndex,
1454            realIndex,
1455            previousIndex,
1456            activeIndex
1457        });
1458        if (swiper.initialized) {
1459            preload(swiper);
1460        }
1461        swiper.emit('activeIndexChange');
1462        swiper.emit('snapIndexChange');
1463        if (swiper.initialized || swiper.params.runCallbacksOnInit) {
1464            if (previousRealIndex !== realIndex) {
1465                swiper.emit('realIndexChange');
1466            }
1467            swiper.emit('slideChange');
1468        }
1469    }
1470
1471    function updateClickedSlide(el, path) {
1472        const swiper = this;
1473        const params = swiper.params;
1474        let slide = el.closest(`.${params.slideClass}, swiper-slide`);
1475        if (!slide && swiper.isElement && path && path.length > 1 && path.includes(el)) {
1476            [...path.slice(path.indexOf(el) + 1, path.length)].forEac
vendor: 4,486 bytes, lines 1476-1619
1476h(pathEl => {
1477                if (!slide && pathEl.matches && pathEl.matches(`.${params.slideClass}, swiper-slide`)) {
1478                    slide = pathEl;
1479                }
1480            });
1481        }
1482        let slideFound = false;
1483        let slideIndex;
1484        if (slide) {
1485            for (let i = 0; i < swiper.slides.length; i += 1) {
1486                if (swiper.slides[i] === slide) {
1487                    slideFound = true;
1488                    slideIndex = i;
1489                    break;
1490                }
1491            }
1492        }
1493        if (slide && slideFound) {
1494            swiper.clickedSlide = slide;
1495            if (swiper.virtual && swiper.params.virtual.enabled) {
1496                swiper.clickedIndex = parseInt(slide.getAttribute('data-swiper-slide-index'), 10);
1497            } else {
1498                swiper.clickedIndex = slideIndex;
1499            }
1500        } else {
1501            swiper.clickedSlide = undefined;
1502            swiper.clickedIndex = undefined;
1503            return;
1504        }
1505        if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) {
1506            swiper.slideToClickedSlide();
1507        }
1508    }
1509
1510    var update = {
1511        updateSize,
1512        updateSlides,
1513        updateAutoHeight,
1514        updateSlidesOffset,
1515        updateSlidesProgress,
1516        updateProgress,
1517        updateSlidesClasses,
1518        updateActiveIndex,
1519        updateClickedSlide
1520    };
1521
1522    function getSwiperTranslate(axis) {
1523        if (axis === void 0) {
1524            axis = this.isHorizontal() ? 'x' : 'y';
1525        }
1526        const swiper = this;
1527        const {
1528            params,
1529            rtlTranslate: rtl,
1530            translate,
1531            wrapperEl
1532        } = swiper;
1533        if (params.virtualTranslate) {
1534            return rtl ? -translate : translate;
1535        }
1536        if (params.cssMode) {
1537            return translate;
1538        }
1539        let currentTranslate = getTranslate(wrapperEl, axis);
1540        currentTranslate += swiper.cssOverflowAdjustment();
1541        if (rtl) currentTranslate = -currentTranslate;
1542        return currentTranslate || 0;
1543    }
1544
1545    function setTranslate(translate, byController) {
1546        const swiper = this;
1547        const {
1548            rtlTranslate: rtl,
1549            params,
1550            wrapperEl,
1551            progress
1552        } = swiper;
1553        let x = 0;
1554        let y = 0;
1555        const z = 0;
1556        if (swiper.isHorizontal()) {
1557            x = rtl ? -translate : translate;
1558        } else {
1559            y = translate;
1560        }
1561        if (params.roundLengths) {
1562            x = Math.floor(x);
1563            y = Math.floor(y);
1564        }
1565        swiper.previousTranslate = swiper.translate;
1566        swiper.translate = swiper.isHorizontal() ? x : y;
1567        if (params.cssMode) {
1568            wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y;
1569        } else if (!params.virtualTranslate) {
1570            if (swiper.isHorizontal()) {
1571                x -= swiper.cssOverflowAdjustment();
1572            } else {
1573                y -= swiper.cssOverflowAdjustment();
1574            }
1575            wrapperEl.style.transform = `translate3d(${x}px, ${y}px, ${z}px)`;
1576        }
1577
1578        // Check if we need to update progress
1579        let newProgress;
1580        const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
1581        if (translatesDiff === 0) {
1582            newProgress = 0;
1583        } else {
1584            newProgress = (translate - swiper.minTranslate()) / translatesDiff;
1585        }
1586        if (newProgress !== progress) {
1587            swiper.updateProgress(translate);
1588        }
1589        swiper.emit('setTranslate', swiper.translate, byController);
1590    }
1591
1592    function minTranslate() {
1593        return -this.snapGrid[0];
1594    }
1595
1596    function maxTranslate() {
1597        return -this.snapGrid[this.snapGrid.length - 1];
1598    }
1599
1600    function translateTo(translate, speed, runCallbacks, translateBounds, internal) {
1601        if (translate === void 0) {
1602            translate = 0;
1603        }
1604        if (speed === void 0) {
1605            speed = this.params.speed;
1606        }
1607        if (runCallbacks === void 0) {
1608            runCallbacks = true;
1609        }
1610        if (translateBounds === void 0) {
1611            translateBounds = true;
1612        }
1613        const swiper = this;
1614        const {
1615            params,
1616            wrapperEl
1617        } = swiper;
1618        if (swiper.animating && params.preventInteractionOnTransition) {
1619            return false;
vendor: 4,796 bytes, lines 1620-1757
1620        }
1621        const minTranslate = swiper.minTranslate();
1622        const maxTranslate = swiper.maxTranslate();
1623        let newTranslate;
1624        if (translateBounds && translate > minTranslate) newTranslate = minTranslate;else if (translateBounds && translate < maxTranslate) newTranslate = maxTranslate;else newTranslate = translate;
1625
1626        // Update progress
1627        swiper.updateProgress(newTranslate);
1628        if (params.cssMode) {
1629            const isH = swiper.isHorizontal();
1630            if (speed === 0) {
1631                wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;
1632            } else {
1633                if (!swiper.support.smoothScroll) {
1634                    animateCSSModeScroll({
1635                        swiper,
1636                        targetPosition: -newTranslate,
1637                        side: isH ? 'left' : 'top'
1638                    });
1639                    return true;
1640                }
1641                wrapperEl.scrollTo({
1642                    [isH ? 'left' : 'top']: -newTranslate,
1643                    behavior: 'smooth'
1644                });
1645            }
1646            return true;
1647        }
1648        if (speed === 0) {
1649            swiper.setTransition(0);
1650            swiper.setTranslate(newTranslate);
1651            if (runCallbacks) {
1652                swiper.emit('beforeTransitionStart', speed, internal);
1653                swiper.emit('transitionEnd');
1654            }
1655        } else {
1656            swiper.setTransition(speed);
1657            swiper.setTranslate(newTranslate);
1658            if (runCallbacks) {
1659                swiper.emit('beforeTransitionStart', speed, internal);
1660                swiper.emit('transitionStart');
1661            }
1662            if (!swiper.animating) {
1663                swiper.animating = true;
1664                if (!swiper.onTranslateToWrapperTransitionEnd) {
1665                    swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) {
1666                        if (!swiper || swiper.destroyed) return;
1667                        if (e.target !== this) return;
1668                        swiper.wrapperEl.removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
1669                        swiper.onTranslateToWrapperTransitionEnd = null;
1670                        delete swiper.onTranslateToWrapperTransitionEnd;
1671                        if (runCallbacks) {
1672                            swiper.emit('transitionEnd');
1673                        }
1674                    };
1675                }
1676                swiper.wrapperEl.addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
1677            }
1678        }
1679        return true;
1680    }
1681
1682    var translate = {
1683        getTranslate: getSwiperTranslate,
1684        setTranslate,
1685        minTranslate,
1686        maxTranslate,
1687        translateTo
1688    };
1689
1690    function setTransition(duration, byController) {
1691        const swiper = this;
1692        if (!swiper.params.cssMode) {
1693            swiper.wrapperEl.style.transitionDuration = `${duration}ms`;
1694            swiper.wrapperEl.style.transitionDelay = duration === 0 ? `0ms` : '';
1695        }
1696        swiper.emit('setTransition', duration, byController);
1697    }
1698
1699    function transitionEmit(_ref) {
1700        let {
1701            swiper,
1702            runCallbacks,
1703            direction,
1704            step
1705        } = _ref;
1706        const {
1707            activeIndex,
1708            previousIndex
1709        } = swiper;
1710        let dir = direction;
1711        if (!dir) {
1712            if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';
1713        }
1714        swiper.emit(`transition${step}`);
1715        if (runCallbacks && activeIndex !== previousIndex) {
1716            if (dir === 'reset') {
1717                swiper.emit(`slideResetTransition${step}`);
1718                return;
1719            }
1720            swiper.emit(`slideChangeTransition${step}`);
1721            if (dir === 'next') {
1722                swiper.emit(`slideNextTransition${step}`);
1723            } else {
1724                swiper.emit(`slidePrevTransition${step}`);
1725            }
1726        }
1727    }
1728
1729    function transitionStart(runCallbacks, direction) {
1730        if (runCallbacks === void 0) {
1731            runCallbacks = true;
1732        }
1733        const swiper = this;
1734        const {
1735            params
1736        } = swiper;
1737        if (params.cssMode) return;
1738        if (params.autoHeight) {
1739            swiper.updateAutoHeight();
1740        }
1741        transitionEmit({
1742            swiper,
1743            runCallbacks,
1744            direction,
1745            step: 'Start'
1746        });
1747    }
1748
1749    function transitionEnd(runCallbacks, direction) {
1750        if (runCallbacks === void 0) {
1751            runCallbacks = true;
1752        }
1753        const swiper = this;
1754        const {
1755            params
1756        } = swiper;
1757        swiper.animating = false;
vendor: 5,052 bytes, lines 1758-1881
1758        if (params.cssMode) return;
1759        swiper.setTransition(0);
1760        transitionEmit({
1761            swiper,
1762            runCallbacks,
1763            direction,
1764            step: 'End'
1765        });
1766    }
1767
1768    var transition = {
1769        setTransition,
1770        transitionStart,
1771        transitionEnd
1772    };
1773
1774    function slideTo(index, speed, runCallbacks, internal, initial) {
1775        if (index === void 0) {
1776            index = 0;
1777        }
1778        if (speed === void 0) {
1779            speed = this.params.speed;
1780        }
1781        if (runCallbacks === void 0) {
1782            runCallbacks = true;
1783        }
1784        if (typeof index === 'string') {
1785            index = parseInt(index, 10);
1786        }
1787        const swiper = this;
1788        let slideIndex = index;
1789        if (slideIndex < 0) slideIndex = 0;
1790        const {
1791            params,
1792            snapGrid,
1793            slidesGrid,
1794            previousIndex,
1795            activeIndex,
1796            rtlTranslate: rtl,
1797            wrapperEl,
1798            enabled
1799        } = swiper;
1800        if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial) {
1801            return false;
1802        }
1803        const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
1804        let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
1805        if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
1806        const translate = -snapGrid[snapIndex];
1807        // Normalize slideIndex
1808        if (params.normalizeSlideIndex) {
1809            for (let i = 0; i < slidesGrid.length; i += 1) {
1810                const normalizedTranslate = -Math.floor(translate * 100);
1811                const normalizedGrid = Math.floor(slidesGrid[i] * 100);
1812                const normalizedGridNext = Math.floor(slidesGrid[i + 1] * 100);
1813                if (typeof slidesGrid[i + 1] !== 'undefined') {
1814                    if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext - (normalizedGridNext - normalizedGrid) / 2) {
1815                        slideIndex = i;
1816                    } else if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext) {
1817                        slideIndex = i + 1;
1818                    }
1819                } else if (normalizedTranslate >= normalizedGrid) {
1820                    slideIndex = i;
1821                }
1822            }
1823        }
1824        // Directions locks
1825        if (swiper.initialized && slideIndex !== activeIndex) {
1826            if (!swiper.allowSlideNext && (rtl ? translate > swiper.translate && translate > swiper.minTranslate() : translate < swiper.translate && translate < swiper.minTranslate())) {
1827                return false;
1828            }
1829            if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) {
1830                if ((activeIndex || 0) !== slideIndex) {
1831                    return false;
1832                }
1833            }
1834        }
1835        if (slideIndex !== (previousIndex || 0) && runCallbacks) {
1836            swiper.emit('beforeSlideChangeStart');
1837        }
1838
1839        // Update progress
1840        swiper.updateProgress(translate);
1841        let direction;
1842        if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset';
1843
1844        // Update Index
1845        if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) {
1846            swiper.updateActiveIndex(slideIndex);
1847            // Update Height
1848            if (params.autoHeight) {
1849                swiper.updateAutoHeight();
1850            }
1851            swiper.updateSlidesClasses();
1852            if (params.effect !== 'slide') {
1853                swiper.setTranslate(translate);
1854            }
1855            if (direction !== 'reset') {
1856                swiper.transitionStart(runCallbacks, direction);
1857                swiper.transitionEnd(runCallbacks, direction);
1858            }
1859            return false;
1860        }
1861        if (params.cssMode) {
1862            const isH = swiper.isHorizontal();
1863            const t = rtl ? translate : -translate;
1864            if (speed === 0) {
1865                const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
1866                if (isVirtual) {
1867                    swiper.wrapperEl.style.scrollSnapType = 'none';
1868                    swiper._immediateVirtual = true;
1869                }
1870                if (isVirtual && !swiper._cssModeVirtualInitialSet && swiper.params.initialSlide > 0) {
1871                    swiper._cssModeVirtualInitialSet = true;
1872                    requestAnimationFrame(() => {
1873                        wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;
1874                    });
1875                } else {
1876                    wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;
1877                }
1878                if (isVirtual) {
1879                    requestAnimationFrame(() => {
1880                        swiper.wrapperEl.style.scrollSnapType = '';
1881                        swiper._immediateVirtual = false;
vendor: 4,945 bytes, lines 1882-2013
1882                    });
1883                }
1884            } else {
1885                if (!swiper.support.smoothScroll) {
1886                    animateCSSModeScroll({
1887                        swiper,
1888                        targetPosition: t,
1889                        side: isH ? 'left' : 'top'
1890                    });
1891                    return true;
1892                }
1893                wrapperEl.scrollTo({
1894                    [isH ? 'left' : 'top']: t,
1895                    behavior: 'smooth'
1896                });
1897            }
1898            return true;
1899        }
1900        swiper.setTransition(speed);
1901        swiper.setTranslate(translate);
1902        swiper.updateActiveIndex(slideIndex);
1903        swiper.updateSlidesClasses();
1904        swiper.emit('beforeTransitionStart', speed, internal);
1905        swiper.transitionStart(runCallbacks, direction);
1906        if (speed === 0) {
1907            swiper.transitionEnd(runCallbacks, direction);
1908        } else if (!swiper.animating) {
1909            swiper.animating = true;
1910            if (!swiper.onSlideToWrapperTransitionEnd) {
1911                swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) {
1912                    if (!swiper || swiper.destroyed) return;
1913                    if (e.target !== this) return;
1914                    swiper.wrapperEl.removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
1915                    swiper.onSlideToWrapperTransitionEnd = null;
1916                    delete swiper.onSlideToWrapperTransitionEnd;
1917                    swiper.transitionEnd(runCallbacks, direction);
1918                };
1919            }
1920            swiper.wrapperEl.addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
1921        }
1922        return true;
1923    }
1924
1925    function slideToLoop(index, speed, runCallbacks, internal) {
1926        if (index === void 0) {
1927            index = 0;
1928        }
1929        if (speed === void 0) {
1930            speed = this.params.speed;
1931        }
1932        if (runCallbacks === void 0) {
1933            runCallbacks = true;
1934        }
1935        if (typeof index === 'string') {
1936            const indexAsNumber = parseInt(index, 10);
1937            index = indexAsNumber;
1938        }
1939        const swiper = this;
1940        let newIndex = index;
1941        if (swiper.params.loop) {
1942            if (swiper.virtual && swiper.params.virtual.enabled) {
1943                // eslint-disable-next-line
1944                newIndex = newIndex + swiper.virtual.slidesBefore;
1945            } else {
1946                newIndex = swiper.getSlideIndexByData(newIndex);
1947            }
1948        }
1949        return swiper.slideTo(newIndex, speed, runCallbacks, internal);
1950    }
1951
1952    /* eslint no-unused-vars: "off" */
1953    function slideNext(speed, runCallbacks, internal) {
1954        if (speed === void 0) {
1955            speed = this.params.speed;
1956        }
1957        if (runCallbacks === void 0) {
1958            runCallbacks = true;
1959        }
1960        const swiper = this;
1961        const {
1962            enabled,
1963            params,
1964            animating
1965        } = swiper;
1966        if (!enabled) return swiper;
1967        let perGroup = params.slidesPerGroup;
1968        if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
1969            perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1);
1970        }
1971        const increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : perGroup;
1972        const isVirtual = swiper.virtual && params.virtual.enabled;
1973        if (params.loop) {
1974            if (animating && !isVirtual && params.loopPreventsSliding) return false;
1975            swiper.loopFix({
1976                direction: 'next'
1977            });
1978            // eslint-disable-next-line
1979            swiper._clientLeft = swiper.wrapperEl.clientLeft;
1980            if (swiper.activeIndex === swiper.slides.length - 1 && params.cssMode) {
1981                requestAnimationFrame(() => {
1982                    swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);
1983                });
1984                return true;
1985            }
1986        }
1987        if (params.rewind && swiper.isEnd) {
1988            return swiper.slideTo(0, speed, runCallbacks, internal);
1989        }
1990        return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);
1991    }
1992
1993    /* eslint no-unused-vars: "off" */
1994    function slidePrev(speed, runCallbacks, internal) {
1995        if (speed === void 0) {
1996            speed = this.params.speed;
1997        }
1998        if (runCallbacks === void 0) {
1999            runCallbacks = true;
2000        }
2001        const swiper = this;
2002        const {
2003            params,
2004            snapGrid,
2005            slidesGrid,
2006            rtlTranslate,
2007            enabled,
2008            animating
2009        } = swiper;
2010        if (!enabled) return swiper;
2011        const isVirtual = swiper.virtual && params.virtual.enabled;
2012        if (params.loop) {
2013            if (animating && !isVirtual && params.loopPreventsSliding) return false;
vendor: 6,559 bytes, lines 2014-2165
2014            swiper.loopFix({
2015                direction: 'prev'
2016            });
2017            // eslint-disable-next-line
2018            swiper._clientLeft = swiper.wrapperEl.clientLeft;
2019        }
2020        const translate = rtlTranslate ? swiper.translate : -swiper.translate;
2021        function normalize(val) {
2022            if (val < 0) return -Math.floor(Math.abs(val));
2023            return Math.floor(val);
2024        }
2025        const normalizedTranslate = normalize(translate);
2026        const normalizedSnapGrid = snapGrid.map(val => normalize(val));
2027        let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
2028        if (typeof prevSnap === 'undefined' && params.cssMode) {
2029            let prevSnapIndex;
2030            snapGrid.forEach((snap, snapIndex) => {
2031                if (normalizedTranslate >= snap) {
2032                    // prevSnap = snap;
2033                    prevSnapIndex = snapIndex;
2034                }
2035            });
2036            if (typeof prevSnapIndex !== 'undefined') {
2037                prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];
2038            }
2039        }
2040        let prevIndex = 0;
2041        if (typeof prevSnap !== 'undefined') {
2042            prevIndex = slidesGrid.indexOf(prevSnap);
2043            if (prevIndex < 0) prevIndex = swiper.activeIndex - 1;
2044            if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
2045                prevIndex = prevIndex - swiper.slidesPerViewDynamic('previous', true) + 1;
2046                prevIndex = Math.max(prevIndex, 0);
2047            }
2048        }
2049        if (params.rewind && swiper.isBeginning) {
2050            const lastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1;
2051            return swiper.slideTo(lastIndex, speed, runCallbacks, internal);
2052        } else if (params.loop && swiper.activeIndex === 0 && params.cssMode) {
2053            requestAnimationFrame(() => {
2054                swiper.slideTo(prevIndex, speed, runCallbacks, internal);
2055            });
2056            return true;
2057        }
2058        return swiper.slideTo(prevIndex, speed, runCallbacks, internal);
2059    }
2060
2061    /* eslint no-unused-vars: "off" */
2062    function slideReset(speed, runCallbacks, internal) {
2063        if (speed === void 0) {
2064            speed = this.params.speed;
2065        }
2066        if (runCallbacks === void 0) {
2067            runCallbacks = true;
2068        }
2069        const swiper = this;
2070        return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
2071    }
2072
2073    /* eslint no-unused-vars: "off" */
2074    function slideToClosest(speed, runCallbacks, internal, threshold) {
2075        if (speed === void 0) {
2076            speed = this.params.speed;
2077        }
2078        if (runCallbacks === void 0) {
2079            runCallbacks = true;
2080        }
2081        if (threshold === void 0) {
2082            threshold = 0.5;
2083        }
2084        const swiper = this;
2085        let index = swiper.activeIndex;
2086        const skip = Math.min(swiper.params.slidesPerGroupSkip, index);
2087        const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
2088        const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
2089        if (translate >= swiper.snapGrid[snapIndex]) {
2090            // The current translate is on or after the current snap index, so the choice
2091            // is between the current index and the one after it.
2092            const currentSnap = swiper.snapGrid[snapIndex];
2093            const nextSnap = swiper.snapGrid[snapIndex + 1];
2094            if (translate - currentSnap > (nextSnap - currentSnap) * threshold) {
2095                index += swiper.params.slidesPerGroup;
2096            }
2097        } else {
2098            // The current translate is before the current snap index, so the choice
2099            // is between the current index and the one before it.
2100            const prevSnap = swiper.snapGrid[snapIndex - 1];
2101            const currentSnap = swiper.snapGrid[snapIndex];
2102            if (translate - prevSnap <= (currentSnap - prevSnap) * threshold) {
2103                index -= swiper.params.slidesPerGroup;
2104            }
2105        }
2106        index = Math.max(index, 0);
2107        index = Math.min(index, swiper.slidesGrid.length - 1);
2108        return swiper.slideTo(index, speed, runCallbacks, internal);
2109    }
2110
2111    function slideToClickedSlide() {
2112        const swiper = this;
2113        const {
2114            params,
2115            slidesEl
2116        } = swiper;
2117        const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;
2118        let slideToIndex = swiper.clickedIndex;
2119        let realIndex;
2120        const slideSelector = swiper.isElement ? `swiper-slide` : `.${params.slideClass}`;
2121        if (params.loop) {
2122            if (swiper.animating) return;
2123            realIndex = parseInt(swiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10);
2124            if (params.centeredSlides) {
2125                if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {
2126                    swiper.loopFix();
2127                    slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
2128                    nextTick(() => {
2129                        swiper.slideTo(slideToIndex);
2130                    });
2131                } else {
2132                    swiper.slideTo(slideToIndex);
2133                }
2134            } else if (slideToIndex > swiper.slides.length - slidesPerView) {
2135                swiper.loopFix();
2136                slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
2137                nextTick(() => {
2138                    swiper.slideTo(slideToIndex);
2139                });
2140            } else {
2141                swiper.slideTo(slideToIndex);
2142            }
2143        } else {
2144            swiper.slideTo(slideToIndex);
2145        }
2146    }
2147
2148    var slide = {
2149        slideTo,
2150        slideToLoop,
2151        slideNext,
2152        slidePrev,
2153        slideReset,
2154        slideToClosest,
2155        slideToClickedSlide
2156    };
2157
2158    function loopCreate(slideRealIndex) {
2159        const swiper = this;
2160        const {
2161            params,
2162            slidesEl
2163        } = swiper;
2164        if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;
2165        const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
vendor: 22,020 bytes, lines 2166-2685
2166        slides.forEach((el, index) => {
2167            el.setAttribute('data-swiper-slide-index', index);
2168        });
2169        swiper.loopFix({
2170            slideRealIndex,
2171            direction: params.centeredSlides ? undefined : 'next'
2172        });
2173    }
2174
2175    function loopFix(_temp) {
2176        let {
2177            slideRealIndex,
2178            slideTo = true,
2179            direction,
2180            setTranslate,
2181            activeSlideIndex,
2182            byController,
2183            byMousewheel
2184        } = _temp === void 0 ? {} : _temp;
2185        const swiper = this;
2186        if (!swiper.params.loop) return;
2187        swiper.emit('beforeLoopFix');
2188        const {
2189            slides,
2190            allowSlidePrev,
2191            allowSlideNext,
2192            slidesEl,
2193            params
2194        } = swiper;
2195        swiper.allowSlidePrev = true;
2196        swiper.allowSlideNext = true;
2197        if (swiper.virtual && params.virtual.enabled) {
2198            if (slideTo) {
2199                if (!params.centeredSlides && swiper.snapIndex === 0) {
2200                    swiper.slideTo(swiper.virtual.slides.length, 0, false, true);
2201                } else if (params.centeredSlides && swiper.snapIndex < params.slidesPerView) {
2202                    swiper.slideTo(swiper.virtual.slides.length + swiper.snapIndex, 0, false, true);
2203                } else if (swiper.snapIndex === swiper.snapGrid.length - 1) {
2204                    swiper.slideTo(swiper.virtual.slidesBefore, 0, false, true);
2205                }
2206            }
2207            swiper.allowSlidePrev = allowSlidePrev;
2208            swiper.allowSlideNext = allowSlideNext;
2209            swiper.emit('loopFix');
2210            return;
2211        }
2212        const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(params.slidesPerView, 10));
2213        let loopedSlides = params.loopedSlides || slidesPerView;
2214        if (loopedSlides % params.slidesPerGroup !== 0) {
2215            loopedSlides += params.slidesPerGroup - loopedSlides % params.slidesPerGroup;
2216        }
2217        swiper.loopedSlides = loopedSlides;
2218        const prependSlidesIndexes = [];
2219        const appendSlidesIndexes = [];
2220        let activeIndex = swiper.activeIndex;
2221        if (typeof activeSlideIndex === 'undefined') {
2222            activeSlideIndex = swiper.getSlideIndex(swiper.slides.filter(el => el.classList.contains(params.slideActiveClass))[0]);
2223        } else {
2224            activeIndex = activeSlideIndex;
2225        }
2226        const isNext = direction === 'next' || !direction;
2227        const isPrev = direction === 'prev' || !direction;
2228        let slidesPrepended = 0;
2229        let slidesAppended = 0;
2230        // prepend last slides before start
2231        if (activeSlideIndex < loopedSlides) {
2232            slidesPrepended = Math.max(loopedSlides - activeSlideIndex, params.slidesPerGroup);
2233            for (let i = 0; i < loopedSlides - activeSlideIndex; i += 1) {
2234                const index = i - Math.floor(i / slides.length) * slides.length;
2235                prependSlidesIndexes.push(slides.length - index - 1);
2236            }
2237        } else if (activeSlideIndex /* + slidesPerView */ > swiper.slides.length - loopedSlides * 2) {
2238            slidesAppended = Math.max(activeSlideIndex - (swiper.slides.length - loopedSlides * 2), params.slidesPerGroup);
2239            for (let i = 0; i < slidesAppended; i += 1) {
2240                const index = i - Math.floor(i / slides.length) * slides.length;
2241                appendSlidesIndexes.push(index);
2242            }
2243        }
2244        if (isPrev) {
2245            prependSlidesIndexes.forEach(index => {
2246                swiper.slides[index].swiperLoopMoveDOM = true;
2247                slidesEl.prepend(swiper.slides[index]);
2248                swiper.slides[index].swiperLoopMoveDOM = false;
2249            });
2250        }
2251        if (isNext) {
2252            appendSlidesIndexes.forEach(index => {
2253                swiper.slides[index].swiperLoopMoveDOM = true;
2254                slidesEl.append(swiper.slides[index]);
2255                swiper.slides[index].swiperLoopMoveDOM = false;
2256            });
2257        }
2258        swiper.recalcSlides();
2259        if (params.slidesPerView === 'auto') {
2260            swiper.updateSlides();
2261        }
2262        if (params.watchSlidesProgress) {
2263            swiper.updateSlidesOffset();
2264        }
2265        if (slideTo) {
2266            if (prependSlidesIndexes.length > 0 && isPrev) {
2267                if (typeof slideRealIndex === 'undefined') {
2268                    const currentSlideTranslate = swiper.slidesGrid[activeIndex];
2269                    const newSlideTranslate = swiper.slidesGrid[activeIndex + slidesPrepended];
2270                    const diff = newSlideTranslate - currentSlideTranslate;
2271                    if (byMousewheel) {
2272                        swiper.setTranslate(swiper.translate - diff);
2273                    } else {
2274                        swiper.slideTo(activeIndex + slidesPrepended, 0, false, true);
2275                        if (setTranslate) {
2276                            swiper.touches[swiper.isHorizontal() ? 'startX' : 'startY'] += diff;
2277                            swiper.touchEventsData.currentTranslate = swiper.translate;
2278                        }
2279                    }
2280                } else {
2281                    if (setTranslate) {
2282                        swiper.slideToLoop(slideRealIndex, 0, false, true);
2283                        swiper.touchEventsData.currentTranslate = swiper.translate;
2284                    }
2285                }
2286            } else if (appendSlidesIndexes.length > 0 && isNext) {
2287                if (typeof slideRealIndex === 'undefined') {
2288                    const currentSlideTranslate = swiper.slidesGrid[activeIndex];
2289                    const newSlideTranslate = swiper.slidesGrid[activeIndex - slidesAppended];
2290                    const diff = newSlideTranslate - currentSlideTranslate;
2291                    if (byMousewheel) {
2292                        swiper.setTranslate(swiper.translate - diff);
2293                    } else {
2294                        swiper.slideTo(activeIndex - slidesAppended, 0, false, true);
2295                        if (setTranslate) {
2296                            swiper.touches[swiper.isHorizontal() ? 'startX' : 'startY'] += diff;
2297                            swiper.touchEventsData.currentTranslate = swiper.translate;
2298                        }
2299                    }
2300                } else {
2301                    swiper.slideToLoop(slideRealIndex, 0, false, true);
2302                }
2303            }
2304        }
2305        swiper.allowSlidePrev = allowSlidePrev;
2306        swiper.allowSlideNext = allowSlideNext;
2307        if (swiper.controller && swiper.controller.control && !byController) {
2308            const loopParams = {
2309                slideRealIndex,
2310                direction,
2311                setTranslate,
2312                activeSlideIndex,
2313                byController: true
2314            };
2315            if (Array.isArray(swiper.controller.control)) {
2316                swiper.controller.control.forEach(c => {
2317                    if (!c.destroyed && c.params.loop) c.loopFix({
2318                        ...loopParams,
2319                        slideTo: c.params.slidesPerView === params.slidesPerView ? slideTo : false
2320                    });
2321                });
2322            } else if (swiper.controller.control instanceof swiper.constructor && swiper.controller.control.params.loop) {
2323                swiper.controller.control.loopFix({
2324                    ...loopParams,
2325                    slideTo: swiper.controller.control.params.slidesPerView === params.slidesPerView ? slideTo : false
2326                });
2327            }
2328        }
2329        swiper.emit('loopFix');
2330    }
2331
2332    function loopDestroy() {
2333        const swiper = this;
2334        const {
2335            params,
2336            slidesEl
2337        } = swiper;
2338        if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;
2339        swiper.recalcSlides();
2340        const newSlidesOrder = [];
2341        swiper.slides.forEach(slideEl => {
2342            const index = typeof slideEl.swiperSlideIndex === 'undefined' ? slideEl.getAttribute('data-swiper-slide-index') * 1 : slideEl.swiperSlideIndex;
2343            newSlidesOrder[index] = slideEl;
2344        });
2345        swiper.slides.forEach(slideEl => {
2346            slideEl.removeAttribute('data-swiper-slide-index');
2347        });
2348        newSlidesOrder.forEach(slideEl => {
2349            slidesEl.append(slideEl);
2350        });
2351        swiper.recalcSlides();
2352        swiper.slideTo(swiper.realIndex, 0);
2353    }
2354
2355    var loop = {
2356        loopCreate,
2357        loopFix,
2358        loopDestroy
2359    };
2360
2361    function setGrabCursor(moving) {
2362        const swiper = this;
2363        if (!swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return;
2364        const el = swiper.params.touchEventsTarget === 'container' ? swiper.el : swiper.wrapperEl;
2365        if (swiper.isElement) {
2366            swiper.__preventObserver__ = true;
2367        }
2368        el.style.cursor = 'move';
2369        el.style.cursor = moving ? 'grabbing' : 'grab';
2370        if (swiper.isElement) {
2371            requestAnimationFrame(() => {
2372                swiper.__preventObserver__ = false;
2373            });
2374        }
2375    }
2376
2377    function unsetGrabCursor() {
2378        const swiper = this;
2379        if (swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) {
2380            return;
2381        }
2382        if (swiper.isElement) {
2383            swiper.__preventObserver__ = true;
2384        }
2385        swiper[swiper.params.touchEventsTarget === 'container' ? 'el' : 'wrapperEl'].style.cursor = '';
2386        if (swiper.isElement) {
2387            requestAnimationFrame(() => {
2388                swiper.__preventObserver__ = false;
2389            });
2390        }
2391    }
2392
2393    var grabCursor = {
2394        setGrabCursor,
2395        unsetGrabCursor
2396    };
2397
2398    // Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd
2399    function closestElement(selector, base) {
2400        if (base === void 0) {
2401            base = this;
2402        }
2403        function __closestFrom(el) {
2404            if (!el || el === getDocument() || el === getWindow()) return null;
2405            if (el.assignedSlot) el = el.assignedSlot;
2406            const found = el.closest(selector);
2407            if (!found && !el.getRootNode) {
2408                return null;
2409            }
2410            return found || __closestFrom(el.getRootNode().host);
2411        }
2412        return __closestFrom(base);
2413    }
2414    function onTouchStart(event) {
2415        const swiper = this;
2416        const document = getDocument();
2417        const window = getWindow();
2418        const data = swiper.touchEventsData;
2419        data.evCache.push(event);
2420        const {
2421            params,
2422            touches,
2423            enabled
2424        } = swiper;
2425        if (!enabled) return;
2426        if (!params.simulateTouch && event.pointerType === 'mouse') return;
2427        if (swiper.animating && params.preventInteractionOnTransition) {
2428            return;
2429        }
2430        if (!swiper.animating && params.cssMode && params.loop) {
2431            swiper.loopFix();
2432        }
2433        let e = event;
2434        if (e.originalEvent) e = e.originalEvent;
2435        let targetEl = e.target;
2436        if (params.touchEventsTarget === 'wrapper') {
2437            if (!swiper.wrapperEl.contains(targetEl)) return;
2438        }
2439        if ('which' in e && e.which === 3) return;
2440        if ('button' in e && e.button > 0) return;
2441        if (data.isTouched && data.isMoved) return;
2442
2443        // change target el for shadow root component
2444        const swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== '';
2445        // eslint-disable-next-line
2446        const eventPath = event.composedPath ? event.composedPath() : event.path;
2447        if (swipingClassHasValue && e.target && e.target.shadowRoot && eventPath) {
2448            targetEl = eventPath[0];
2449        }
2450        const noSwipingSelector = params.noSwipingSelector ? params.noSwipingSelector : `.${params.noSwipingClass}`;
2451        const isTargetShadow = !!(e.target && e.target.shadowRoot);
2452
2453        // use closestElement for shadow root element to get the actual closest for nested shadow root element
2454        if (params.noSwiping && (isTargetShadow ? closestElement(noSwipingSelector, targetEl) : targetEl.closest(noSwipingSelector))) {
2455            swiper.allowClick = true;
2456            return;
2457        }
2458        if (params.swipeHandler) {
2459            if (!targetEl.closest(params.swipeHandler)) return;
2460        }
2461        touches.currentX = e.pageX;
2462        touches.currentY = e.pageY;
2463        const startX = touches.currentX;
2464        const startY = touches.currentY;
2465
2466        // Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore
2467
2468        const edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;
2469        const edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;
2470        if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) {
2471            if (edgeSwipeDetection === 'prevent') {
2472                event.preventDefault();
2473            } else {
2474                return;
2475            }
2476        }
2477        Object.assign(data, {
2478            isTouched: true,
2479            isMoved: false,
2480            allowTouchCallbacks: true,
2481            isScrolling: undefined,
2482            startMoving: undefined
2483        });
2484        touches.startX = startX;
2485        touches.startY = startY;
2486        data.touchStartTime = now();
2487        swiper.allowClick = true;
2488        swiper.updateSize();
2489        swiper.swipeDirection = undefined;
2490        if (params.threshold > 0) data.allowThresholdMove = false;
2491        let preventDefault = true;
2492        if (targetEl.matches(data.focusableElements)) {
2493            preventDefault = false;
2494            if (targetEl.nodeName === 'SELECT') {
2495                data.isTouched = false;
2496            }
2497        }
2498        if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== targetEl) {
2499            document.activeElement.blur();
2500        }
2501        const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
2502        if ((params.touchStartForcePreventDefault || shouldPreventDefault) && !targetEl.isContentEditable) {
2503            e.preventDefault();
2504        }
2505        if (params.freeMode && params.freeMode.enabled && swiper.freeMode && swiper.animating && !params.cssMode) {
2506            swiper.freeMode.onTouchStart();
2507        }
2508        swiper.emit('touchStart', e);
2509    }
2510
2511    function onTouchMove(event) {
2512        const document = getDocument();
2513        const swiper = this;
2514        const data = swiper.touchEventsData;
2515        const {
2516            params,
2517            touches,
2518            rtlTranslate: rtl,
2519            enabled
2520        } = swiper;
2521        if (!enabled) return;
2522        if (!params.simulateTouch && event.pointerType === 'mouse') return;
2523        let e = event;
2524        if (e.originalEvent) e = e.originalEvent;
2525        if (!data.isTouched) {
2526            if (data.startMoving && data.isScrolling) {
2527                swiper.emit('touchMoveOpposite', e);
2528            }
2529            return;
2530        }
2531        const pointerIndex = data.evCache.findIndex(cachedEv => cachedEv.pointerId === e.pointerId);
2532        if (pointerIndex >= 0) data.evCache[pointerIndex] = e;
2533        const targetTouch = data.evCache.length > 1 ? data.evCache[0] : e;
2534        const pageX = targetTouch.pageX;
2535        const pageY = targetTouch.pageY;
2536        if (e.preventedByNestedSwiper) {
2537            touches.startX = pageX;
2538            touches.startY = pageY;
2539            return;
2540        }
2541        if (!swiper.allowTouchMove) {
2542            if (!e.target.matches(data.focusableElements)) {
2543                swiper.allowClick = false;
2544            }
2545            if (data.isTouched) {
2546                Object.assign(touches, {
2547                    startX: pageX,
2548                    startY: pageY,
2549                    prevX: swiper.touches.currentX,
2550                    prevY: swiper.touches.currentY,
2551                    currentX: pageX,
2552                    currentY: pageY
2553                });
2554                data.touchStartTime = now();
2555            }
2556            return;
2557        }
2558        if (params.touchReleaseOnEdges && !params.loop) {
2559            if (swiper.isVertical()) {
2560                // Vertical
2561                if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) {
2562                    data.isTouched = false;
2563                    data.isMoved = false;
2564                    return;
2565                }
2566            } else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) {
2567                return;
2568            }
2569        }
2570        if (document.activeElement) {
2571            if (e.target === document.activeElement && e.target.matches(data.focusableElements)) {
2572                data.isMoved = true;
2573                swiper.allowClick = false;
2574                return;
2575            }
2576        }
2577        if (data.allowTouchCallbacks) {
2578            swiper.emit('touchMove', e);
2579        }
2580        if (e.targetTouches && e.targetTouches.length > 1) return;
2581        touches.currentX = pageX;
2582        touches.currentY = pageY;
2583        const diffX = touches.currentX - touches.startX;
2584        const diffY = touches.currentY - touches.startY;
2585        if (swiper.params.threshold && Math.sqrt(diffX ** 2 + diffY ** 2) < swiper.params.threshold) return;
2586        if (typeof data.isScrolling === 'undefined') {
2587            let touchAngle;
2588            if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) {
2589                data.isScrolling = false;
2590            } else {
2591                // eslint-disable-next-line
2592                if (diffX * diffX + diffY * diffY >= 25) {
2593                    touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI;
2594                    data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle;
2595                }
2596            }
2597        }
2598        if (data.isScrolling) {
2599            swiper.emit('touchMoveOpposite', e);
2600        }
2601        if (typeof data.startMoving === 'undefined') {
2602            if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {
2603                data.startMoving = true;
2604            }
2605        }
2606        if (data.isScrolling || swiper.zoom && swiper.params.zoom && swiper.params.zoom.enabled && data.evCache.length > 1) {
2607            data.isTouched = false;
2608            return;
2609        }
2610        if (!data.startMoving) {
2611            return;
2612        }
2613        swiper.allowClick = false;
2614        if (!params.cssMode && e.cancelable) {
2615            e.preventDefault();
2616        }
2617        if (params.touchMoveStopPropagation && !params.nested) {
2618            e.stopPropagation();
2619        }
2620        let diff = swiper.isHorizontal() ? diffX : diffY;
2621        let touchesDiff = swiper.isHorizontal() ? touches.currentX - touches.previousX : touches.currentY - touches.previousY;
2622        if (params.oneWayMovement) {
2623            diff = Math.abs(diff) * (rtl ? 1 : -1);
2624            touchesDiff = Math.abs(touchesDiff) * (rtl ? 1 : -1);
2625        }
2626        touches.diff = diff;
2627        diff *= params.touchRatio;
2628        if (rtl) {
2629            diff = -diff;
2630            touchesDiff = -touchesDiff;
2631        }
2632        const prevTouchesDirection = swiper.touchesDirection;
2633        swiper.swipeDirection = diff > 0 ? 'prev' : 'next';
2634        swiper.touchesDirection = touchesDiff > 0 ? 'prev' : 'next';
2635        const isLoop = swiper.params.loop && !params.cssMode;
2636        const allowLoopFix = swiper.swipeDirection === 'next' && swiper.allowSlideNext || swiper.swipeDirection === 'prev' && swiper.allowSlidePrev;
2637        if (!data.isMoved) {
2638            if (isLoop && allowLoopFix) {
2639                swiper.loopFix({
2640                    direction: swiper.swipeDirection
2641                });
2642            }
2643            data.startTranslate = swiper.getTranslate();
2644            swiper.setTransition(0);
2645            if (swiper.animating) {
2646                const evt = new window.CustomEvent('transitionend', {
2647                    bubbles: true,
2648                    cancelable: true
2649                });
2650                swiper.wrapperEl.dispatchEvent(evt);
2651            }
2652            data.allowMomentumBounce = false;
2653            // Grab Cursor
2654            if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
2655                swiper.setGrabCursor(true);
2656            }
2657            swiper.emit('sliderFirstMove', e);
2658        }
2659        let loopFixed;
2660        if (data.isMoved && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {
2661            // need another loop fix
2662            swiper.loopFix({
2663                direction: swiper.swipeDirection,
2664                setTranslate: true
2665            });
2666            loopFixed = true;
2667        }
2668        swiper.emit('sliderMove', e);
2669        data.isMoved = true;
2670        data.currentTranslate = diff + data.startTranslate;
2671        let disableParentSwiper = true;
2672        let resistanceRatio = params.resistanceRatio;
2673        if (params.touchReleaseOnEdges) {
2674            resistanceRatio = 0;
2675        }
2676        if (diff > 0) {
2677            if (isLoop && allowLoopFix && !loopFixed && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.size / 2 : swiper.minTranslate())) {
2678                swiper.loopFix({
2679                    direction: 'prev',
2680                    setTranslate: true,
2681                    activeSlideIndex: 0
2682                });
2683            }
2684            if (data.currentTranslate > swiper.minTranslate()) {
2685                disableParentSwiper = false;
vendor: 4,115 bytes, lines 2686-2779
2686                if (params.resistance) {
2687                    data.currentTranslate = swiper.minTranslate() - 1 + (-swiper.minTranslate() + data.startTranslate + diff) ** resistanceRatio;
2688                }
2689            }
2690        } else if (diff < 0) {
2691            if (isLoop && allowLoopFix && !loopFixed && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.size / 2 : swiper.maxTranslate())) {
2692                swiper.loopFix({
2693                    direction: 'next',
2694                    setTranslate: true,
2695                    activeSlideIndex: swiper.slides.length - (params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(params.slidesPerView, 10)))
2696                });
2697            }
2698            if (data.currentTranslate < swiper.maxTranslate()) {
2699                disableParentSwiper = false;
2700                if (params.resistance) {
2701                    data.currentTranslate = swiper.maxTranslate() + 1 - (swiper.maxTranslate() - data.startTranslate - diff) ** resistanceRatio;
2702                }
2703            }
2704        }
2705        if (disableParentSwiper) {
2706            e.preventedByNestedSwiper = true;
2707        }
2708
2709        // Directions locks
2710        if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) {
2711            data.currentTranslate = data.startTranslate;
2712        }
2713        if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) {
2714            data.currentTranslate = data.startTranslate;
2715        }
2716        if (!swiper.allowSlidePrev && !swiper.allowSlideNext) {
2717            data.currentTranslate = data.startTranslate;
2718        }
2719
2720        // Threshold
2721        if (params.threshold > 0) {
2722            if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {
2723                if (!data.allowThresholdMove) {
2724                    data.allowThresholdMove = true;
2725                    touches.startX = touches.currentX;
2726                    touches.startY = touches.currentY;
2727                    data.currentTranslate = data.startTranslate;
2728                    touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY;
2729                    return;
2730                }
2731            } else {
2732                data.currentTranslate = data.startTranslate;
2733                return;
2734            }
2735        }
2736        if (!params.followFinger || params.cssMode) return;
2737
2738        // Update active index in free mode
2739        if (params.freeMode && params.freeMode.enabled && swiper.freeMode || params.watchSlidesProgress) {
2740            swiper.updateActiveIndex();
2741            swiper.updateSlidesClasses();
2742        }
2743        if (params.freeMode && params.freeMode.enabled && swiper.freeMode) {
2744            swiper.freeMode.onTouchMove();
2745        }
2746        // Update progress
2747        swiper.updateProgress(data.currentTranslate);
2748        // Update translate
2749        swiper.setTranslate(data.currentTranslate);
2750    }
2751
2752    function onTouchEnd(event) {
2753        const swiper = this;
2754        const data = swiper.touchEventsData;
2755        const pointerIndex = data.evCache.findIndex(cachedEv => cachedEv.pointerId === event.pointerId);
2756        if (pointerIndex >= 0) {
2757            data.evCache.splice(pointerIndex, 1);
2758        }
2759        if (['pointercancel', 'pointerout', 'pointerleave', 'contextmenu'].includes(event.type)) {
2760            const proceed = ['pointercancel', 'contextmenu'].includes(event.type) && (swiper.browser.isSafari || swiper.browser.isWebView);
2761            if (!proceed) {
2762                return;
2763            }
2764        }
2765        const {
2766            params,
2767            touches,
2768            rtlTranslate: rtl,
2769            slidesGrid,
2770            enabled
2771        } = swiper;
2772        if (!enabled) return;
2773        if (!params.simulateTouch && event.pointerType === 'mouse') return;
2774        let e = event;
2775        if (e.originalEvent) e = e.originalEvent;
2776        if (data.allowTouchCallbacks) {
2777            swiper.emit('touchEnd', e);
2778        }
2779        data.allowTouchCallbacks = false;
vendor: 12,062 bytes, lines 2780-3108
2780        if (!data.isTouched) {
2781            if (data.isMoved && params.grabCursor) {
2782                swiper.setGrabCursor(false);
2783            }
2784            data.isMoved = false;
2785            data.startMoving = false;
2786            return;
2787        }
2788        // Return Grab Cursor
2789        if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
2790            swiper.setGrabCursor(false);
2791        }
2792
2793        // Time diff
2794        const touchEndTime = now();
2795        const timeDiff = touchEndTime - data.touchStartTime;
2796
2797        // Tap, doubleTap, Click
2798        if (swiper.allowClick) {
2799            const pathTree = e.path || e.composedPath && e.composedPath();
2800            swiper.updateClickedSlide(pathTree && pathTree[0] || e.target, pathTree);
2801            swiper.emit('tap click', e);
2802            if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) {
2803                swiper.emit('doubleTap doubleClick', e);
2804            }
2805        }
2806        data.lastClickTime = now();
2807        nextTick(() => {
2808            if (!swiper.destroyed) swiper.allowClick = true;
2809        });
2810        if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {
2811            data.isTouched = false;
2812            data.isMoved = false;
2813            data.startMoving = false;
2814            return;
2815        }
2816        data.isTouched = false;
2817        data.isMoved = false;
2818        data.startMoving = false;
2819        let currentPos;
2820        if (params.followFinger) {
2821            currentPos = rtl ? swiper.translate : -swiper.translate;
2822        } else {
2823            currentPos = -data.currentTranslate;
2824        }
2825        if (params.cssMode) {
2826            return;
2827        }
2828        if (params.freeMode && params.freeMode.enabled) {
2829            swiper.freeMode.onTouchEnd({
2830                currentPos
2831            });
2832            return;
2833        }
2834
2835        // Find current slide
2836        let stopIndex = 0;
2837        let groupSize = swiper.slidesSizesGrid[0];
2838        for (let i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) {
2839            const increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
2840            if (typeof slidesGrid[i + increment] !== 'undefined') {
2841                if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) {
2842                    stopIndex = i;
2843                    groupSize = slidesGrid[i + increment] - slidesGrid[i];
2844                }
2845            } else if (currentPos >= slidesGrid[i]) {
2846                stopIndex = i;
2847                groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];
2848            }
2849        }
2850        let rewindFirstIndex = null;
2851        let rewindLastIndex = null;
2852        if (params.rewind) {
2853            if (swiper.isBeginning) {
2854                rewindLastIndex = params.virtual && params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1;
2855            } else if (swiper.isEnd) {
2856                rewindFirstIndex = 0;
2857            }
2858        }
2859        // Find current slide size
2860        const ratio = (currentPos - slidesGrid[stopIndex]) / groupSize;
2861        const increment = stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
2862        if (timeDiff > params.longSwipesMs) {
2863            // Long touches
2864            if (!params.longSwipes) {
2865                swiper.slideTo(swiper.activeIndex);
2866                return;
2867            }
2868            if (swiper.swipeDirection === 'next') {
2869                if (ratio >= params.longSwipesRatio) swiper.slideTo(params.rewind && swiper.isEnd ? rewindFirstIndex : stopIndex + increment);else swiper.slideTo(stopIndex);
2870            }
2871            if (swiper.swipeDirection === 'prev') {
2872                if (ratio > 1 - params.longSwipesRatio) {
2873                    swiper.slideTo(stopIndex + increment);
2874                } else if (rewindLastIndex !== null && ratio < 0 && Math.abs(ratio) > params.longSwipesRatio) {
2875                    swiper.slideTo(rewindLastIndex);
2876                } else {
2877                    swiper.slideTo(stopIndex);
2878                }
2879            }
2880        } else {
2881            // Short swipes
2882            if (!params.shortSwipes) {
2883                swiper.slideTo(swiper.activeIndex);
2884                return;
2885            }
2886            const isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl);
2887            if (!isNavButtonTarget) {
2888                if (swiper.swipeDirection === 'next') {
2889                    swiper.slideTo(rewindFirstIndex !== null ? rewindFirstIndex : stopIndex + increment);
2890                }
2891                if (swiper.swipeDirection === 'prev') {
2892                    swiper.slideTo(rewindLastIndex !== null ? rewindLastIndex : stopIndex);
2893                }
2894            } else if (e.target === swiper.navigation.nextEl) {
2895                swiper.slideTo(stopIndex + increment);
2896            } else {
2897                swiper.slideTo(stopIndex);
2898            }
2899        }
2900    }
2901
2902    function onResize() {
2903        const swiper = this;
2904        const {
2905            params,
2906            el
2907        } = swiper;
2908        if (el && el.offsetWidth === 0) return;
2909
2910        // Breakpoints
2911        if (params.breakpoints) {
2912            swiper.setBreakpoint();
2913        }
2914
2915        // Save locks
2916        const {
2917            allowSlideNext,
2918            allowSlidePrev,
2919            snapGrid
2920        } = swiper;
2921        const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
2922
2923        // Disable locks on resize
2924        swiper.allowSlideNext = true;
2925        swiper.allowSlidePrev = true;
2926        swiper.updateSize();
2927        swiper.updateSlides();
2928        swiper.updateSlidesClasses();
2929        const isVirtualLoop = isVirtual && params.loop;
2930        if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides && !isVirtualLoop) {
2931            swiper.slideTo(swiper.slides.length - 1, 0, false, true);
2932        } else {
2933            if (swiper.params.loop && !isVirtual) {
2934                swiper.slideToLoop(swiper.realIndex, 0, false, true);
2935            } else {
2936                swiper.slideTo(swiper.activeIndex, 0, false, true);
2937            }
2938        }
2939        if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
2940            clearTimeout(swiper.autoplay.resizeTimeout);
2941            swiper.autoplay.resizeTimeout = setTimeout(() => {
2942                if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
2943                    swiper.autoplay.resume();
2944                }
2945            }, 500);
2946        }
2947        // Return locks after resize
2948        swiper.allowSlidePrev = allowSlidePrev;
2949        swiper.allowSlideNext = allowSlideNext;
2950        if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) {
2951            swiper.checkOverflow();
2952        }
2953    }
2954
2955    function onClick(e) {
2956        const swiper = this;
2957        if (!swiper.enabled) return;
2958        if (!swiper.allowClick) {
2959            if (swiper.params.preventClicks) e.preventDefault();
2960            if (swiper.params.preventClicksPropagation && swiper.animating) {
2961                e.stopPropagation();
2962                e.stopImmediatePropagation();
2963            }
2964        }
2965    }
2966
2967    function onScroll() {
2968        const swiper = this;
2969        const {
2970            wrapperEl,
2971            rtlTranslate,
2972            enabled
2973        } = swiper;
2974        if (!enabled) return;
2975        swiper.previousTranslate = swiper.translate;
2976        if (swiper.isHorizontal()) {
2977            swiper.translate = -wrapperEl.scrollLeft;
2978        } else {
2979            swiper.translate = -wrapperEl.scrollTop;
2980        }
2981        // eslint-disable-next-line
2982        if (swiper.translate === 0) swiper.translate = 0;
2983        swiper.updateActiveIndex();
2984        swiper.updateSlidesClasses();
2985        let newProgress;
2986        const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
2987        if (translatesDiff === 0) {
2988            newProgress = 0;
2989        } else {
2990            newProgress = (swiper.translate - swiper.minTranslate()) / translatesDiff;
2991        }
2992        if (newProgress !== swiper.progress) {
2993            swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate);
2994        }
2995        swiper.emit('setTranslate', swiper.translate, false);
2996    }
2997
2998    function onLoad(e) {
2999        const swiper = this;
3000        processLazyPreloader(swiper, e.target);
3001        if (swiper.params.cssMode || swiper.params.slidesPerView !== 'auto' && !swiper.params.autoHeight) {
3002            return;
3003        }
3004        swiper.update();
3005    }
3006
3007    let dummyEventAttached = false;
3008    function dummyEventListener() {}
3009    const events = (swiper, method) => {
3010        const document = getDocument();
3011        const {
3012            params,
3013            el,
3014            wrapperEl,
3015            device
3016        } = swiper;
3017        const capture = !!params.nested;
3018        const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener';
3019        const swiperMethod = method;
3020
3021        // Touch Events
3022        el[domMethod]('pointerdown', swiper.onTouchStart, {
3023            passive: false
3024        });
3025        document[domMethod]('pointermove', swiper.onTouchMove, {
3026            passive: false,
3027            capture
3028        });
3029        document[domMethod]('pointerup', swiper.onTouchEnd, {
3030            passive: true
3031        });
3032        document[domMethod]('pointercancel', swiper.onTouchEnd, {
3033            passive: true
3034        });
3035        document[domMethod]('pointerout', swiper.onTouchEnd, {
3036            passive: true
3037        });
3038        document[domMethod]('pointerleave', swiper.onTouchEnd, {
3039            passive: true
3040        });
3041        document[domMethod]('contextmenu', swiper.onTouchEnd, {
3042            passive: true
3043        });
3044
3045        // Prevent Links Clicks
3046        if (params.preventClicks || params.preventClicksPropagation) {
3047            el[domMethod]('click', swiper.onClick, true);
3048        }
3049        if (params.cssMode) {
3050            wrapperEl[domMethod]('scroll', swiper.onScroll);
3051        }
3052
3053        // Resize handler
3054        if (params.updateOnWindowResize) {
3055            swiper[swiperMethod](device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize, true);
3056        } else {
3057            swiper[swiperMethod]('observerUpdate', onResize, true);
3058        }
3059
3060        // Images loader
3061        el[domMethod]('load', swiper.onLoad, {
3062            capture: true
3063        });
3064    };
3065    function attachEvents() {
3066        const swiper = this;
3067        const document = getDocument();
3068        const {
3069            params
3070        } = swiper;
3071        swiper.onTouchStart = onTouchStart.bind(swiper);
3072        swiper.onTouchMove = onTouchMove.bind(swiper);
3073        swiper.onTouchEnd = onTouchEnd.bind(swiper);
3074        if (params.cssMode) {
3075            swiper.onScroll = onScroll.bind(swiper);
3076        }
3077        swiper.onClick = onClick.bind(swiper);
3078        swiper.onLoad = onLoad.bind(swiper);
3079        if (!dummyEventAttached) {
3080            document.addEventListener('touchstart', dummyEventListener);
3081            dummyEventAttached = true;
3082        }
3083        events(swiper, 'on');
3084    }
3085    function detachEvents() {
3086        const swiper = this;
3087        events(swiper, 'off');
3088    }
3089    var events$1 = {
3090        attachEvents,
3091        detachEvents
3092    };
3093
3094    const isGridEnabled = (swiper, params) => {
3095        return swiper.grid && params.grid && params.grid.rows > 1;
3096    };
3097    function setBreakpoint() {
3098        const swiper = this;
3099        const {
3100            realIndex,
3101            initialized,
3102            params,
3103            el
3104        } = swiper;
3105        const breakpoints = params.breakpoints;
3106        if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return;
3107
3108        // Get breakpoint for window width and update parameters
vendor: 4,665 bytes, lines 3109-3215
3109        const breakpoint = swiper.getBreakpoint(breakpoints, swiper.params.breakpointsBase, swiper.el);
3110        if (!breakpoint || swiper.currentBreakpoint === breakpoint) return;
3111        const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
3112        const breakpointParams = breakpointOnlyParams || swiper.originalParams;
3113        const wasMultiRow = isGridEnabled(swiper, params);
3114        const isMultiRow = isGridEnabled(swiper, breakpointParams);
3115        const wasEnabled = params.enabled;
3116        if (wasMultiRow && !isMultiRow) {
3117            el.classList.remove(`${params.containerModifierClass}grid`, `${params.containerModifierClass}grid-column`);
3118            swiper.emitContainerClasses();
3119        } else if (!wasMultiRow && isMultiRow) {
3120            el.classList.add(`${params.containerModifierClass}grid`);
3121            if (breakpointParams.grid.fill && breakpointParams.grid.fill === 'column' || !breakpointParams.grid.fill && params.grid.fill === 'column') {
3122                el.classList.add(`${params.containerModifierClass}grid-column`);
3123            }
3124            swiper.emitContainerClasses();
3125        }
3126
3127        // Toggle navigation, pagination, scrollbar
3128        ['navigation', 'pagination', 'scrollbar'].forEach(prop => {
3129            if (typeof breakpointParams[prop] === 'undefined') return;
3130            const wasModuleEnabled = params[prop] && params[prop].enabled;
3131            const isModuleEnabled = breakpointParams[prop] && breakpointParams[prop].enabled;
3132            if (wasModuleEnabled && !isModuleEnabled) {
3133                swiper[prop].disable();
3134            }
3135            if (!wasModuleEnabled && isModuleEnabled) {
3136                swiper[prop].enable();
3137            }
3138        });
3139        const directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction;
3140        const needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged);
3141        const wasLoop = params.loop;
3142        if (directionChanged && initialized) {
3143            swiper.changeDirection();
3144        }
3145        extend(swiper.params, breakpointParams);
3146        const isEnabled = swiper.params.enabled;
3147        const hasLoop = swiper.params.loop;
3148        Object.assign(swiper, {
3149            allowTouchMove: swiper.params.allowTouchMove,
3150            allowSlideNext: swiper.params.allowSlideNext,
3151            allowSlidePrev: swiper.params.allowSlidePrev
3152        });
3153        if (wasEnabled && !isEnabled) {
3154            swiper.disable();
3155        } else if (!wasEnabled && isEnabled) {
3156            swiper.enable();
3157        }
3158        swiper.currentBreakpoint = breakpoint;
3159        swiper.emit('_beforeBreakpoint', breakpointParams);
3160        if (initialized) {
3161            if (needsReLoop) {
3162                swiper.loopDestroy();
3163                swiper.loopCreate(realIndex);
3164                swiper.updateSlides();
3165            } else if (!wasLoop && hasLoop) {
3166                swiper.loopCreate(realIndex);
3167                swiper.updateSlides();
3168            } else if (wasLoop && !hasLoop) {
3169                swiper.loopDestroy();
3170            }
3171        }
3172        swiper.emit('breakpoint', breakpointParams);
3173    }
3174
3175    function getBreakpoint(breakpoints, base, containerEl) {
3176        if (base === void 0) {
3177            base = 'window';
3178        }
3179        if (!breakpoints || base === 'container' && !containerEl) return undefined;
3180        let breakpoint = false;
3181        const window = getWindow();
3182        const currentHeight = base === 'window' ? window.innerHeight : containerEl.clientHeight;
3183        const points = Object.keys(breakpoints).map(point => {
3184            if (typeof point === 'string' && point.indexOf('@') === 0) {
3185                const minRatio = parseFloat(point.substr(1));
3186                const value = currentHeight * minRatio;
3187                return {
3188                    value,
3189                    point
3190                };
3191            }
3192            return {
3193                value: point,
3194                point
3195            };
3196        });
3197        points.sort((a, b) => parseInt(a.value, 10) - parseInt(b.value, 10));
3198        for (let i = 0; i < points.length; i += 1) {
3199            const {
3200                point,
3201                value
3202            } = points[i];
3203            if (base === 'window') {
3204                if (window.matchMedia(`(min-width: ${value}px)`).matches) {
3205                    breakpoint = point;
3206                }
3207            } else if (value <= containerEl.clientWidth) {
3208                breakpoint = point;
3209            }
3210        }
3211        return breakpoint || 'max';
3212    }
3213
3214    var breakpoints = {
3215        setBreakpoint,
vendor: 4,107 bytes, lines 3216-3352
3216        getBreakpoint
3217    };
3218
3219    function prepareClasses(entries, prefix) {
3220        const resultClasses = [];
3221        entries.forEach(item => {
3222            if (typeof item === 'object') {
3223                Object.keys(item).forEach(classNames => {
3224                    if (item[classNames]) {
3225                        resultClasses.push(prefix + classNames);
3226                    }
3227                });
3228            } else if (typeof item === 'string') {
3229                resultClasses.push(prefix + item);
3230            }
3231        });
3232        return resultClasses;
3233    }
3234    function addClasses() {
3235        const swiper = this;
3236        const {
3237            classNames,
3238            params,
3239            rtl,
3240            el,
3241            device
3242        } = swiper;
3243        // prettier-ignore
3244        const suffixes = prepareClasses(['initialized', params.direction, {
3245            'free-mode': swiper.params.freeMode && params.freeMode.enabled
3246        }, {
3247            'autoheight': params.autoHeight
3248        }, {
3249            'rtl': rtl
3250        }, {
3251            'grid': params.grid && params.grid.rows > 1
3252        }, {
3253            'grid-column': params.grid && params.grid.rows > 1 && params.grid.fill === 'column'
3254        }, {
3255            'android': device.android
3256        }, {
3257            'ios': device.ios
3258        }, {
3259            'css-mode': params.cssMode
3260        }, {
3261            'centered': params.cssMode && params.centeredSlides
3262        }, {
3263            'watch-progress': params.watchSlidesProgress
3264        }], params.containerModifierClass);
3265        classNames.push(...suffixes);
3266        el.classList.add(...classNames);
3267        swiper.emitContainerClasses();
3268    }
3269
3270    function removeClasses() {
3271        const swiper = this;
3272        const {
3273            el,
3274            classNames
3275        } = swiper;
3276        el.classList.remove(...classNames);
3277        swiper.emitContainerClasses();
3278    }
3279
3280    var classes = {
3281        addClasses,
3282        removeClasses
3283    };
3284
3285    function checkOverflow() {
3286        const swiper = this;
3287        const {
3288            isLocked: wasLocked,
3289            params
3290        } = swiper;
3291        const {
3292            slidesOffsetBefore
3293        } = params;
3294        if (slidesOffsetBefore) {
3295            const lastSlideIndex = swiper.slides.length - 1;
3296            const lastSlideRightEdge = swiper.slidesGrid[lastSlideIndex] + swiper.slidesSizesGrid[lastSlideIndex] + slidesOffsetBefore * 2;
3297            swiper.isLocked = swiper.size > lastSlideRightEdge;
3298        } else {
3299            swiper.isLocked = swiper.snapGrid.length === 1;
3300        }
3301        if (params.allowSlideNext === true) {
3302            swiper.allowSlideNext = !swiper.isLocked;
3303        }
3304        if (params.allowSlidePrev === true) {
3305            swiper.allowSlidePrev = !swiper.isLocked;
3306        }
3307        if (wasLocked && wasLocked !== swiper.isLocked) {
3308            swiper.isEnd = false;
3309        }
3310        if (wasLocked !== swiper.isLocked) {
3311            swiper.emit(swiper.isLocked ? 'lock' : 'unlock');
3312        }
3313    }
3314    var checkOverflow$1 = {
3315        checkOverflow
3316    };
3317
3318    var defaults = {
3319        init: true,
3320        direction: 'horizontal',
3321        oneWayMovement: false,
3322        touchEventsTarget: 'wrapper',
3323        initialSlide: 0,
3324        speed: 300,
3325        cssMode: false,
3326        updateOnWindowResize: true,
3327        resizeObserver: true,
3328        nested: false,
3329        createElements: false,
3330        enabled: true,
3331        focusableElements: 'input, select, option, textarea, button, video, label',
3332        // Overrides
3333        width: null,
3334        height: null,
3335        //
3336        preventInteractionOnTransition: false,
3337        // ssr
3338        userAgent: null,
3339        url: null,
3340        // To support iOS's swipe-to-go-back gesture (when being used in-app).
3341        edgeSwipeDetection: false,
3342        edgeSwipeThreshold: 20,
3343        // Autoheight
3344        autoHeight: false,
3345        // Set wrapper width
3346        setWrapperSize: false,
3347        // Virtual Translate
3348        virtualTranslate: false,
3349        // Effects
3350        effect: 'slide',
3351        // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'
3352
vendor: 4,703 bytes, lines 3353-3493
3353        // Breakpoints
3354        breakpoints: undefined,
3355        breakpointsBase: 'window',
3356        // Slides grid
3357        spaceBetween: 0,
3358        slidesPerView: 1,
3359        slidesPerGroup: 1,
3360        slidesPerGroupSkip: 0,
3361        slidesPerGroupAuto: false,
3362        centeredSlides: false,
3363        centeredSlidesBounds: false,
3364        slidesOffsetBefore: 0,
3365        // in px
3366        slidesOffsetAfter: 0,
3367        // in px
3368        normalizeSlideIndex: true,
3369        centerInsufficientSlides: false,
3370        // Disable swiper and hide navigation when container not overflow
3371        watchOverflow: true,
3372        // Round length
3373        roundLengths: false,
3374        // Touches
3375        touchRatio: 1,
3376        touchAngle: 45,
3377        simulateTouch: true,
3378        shortSwipes: true,
3379        longSwipes: true,
3380        longSwipesRatio: 0.5,
3381        longSwipesMs: 300,
3382        followFinger: true,
3383        allowTouchMove: true,
3384        threshold: 5,
3385        touchMoveStopPropagation: false,
3386        touchStartPreventDefault: true,
3387        touchStartForcePreventDefault: false,
3388        touchReleaseOnEdges: false,
3389        // Unique Navigation Elements
3390        uniqueNavElements: true,
3391        // Resistance
3392        resistance: true,
3393        resistanceRatio: 0.85,
3394        // Progress
3395        watchSlidesProgress: false,
3396        // Cursor
3397        grabCursor: false,
3398        // Clicks
3399        preventClicks: true,
3400        preventClicksPropagation: true,
3401        slideToClickedSlide: false,
3402        // loop
3403        loop: false,
3404        loopedSlides: null,
3405        loopPreventsSliding: true,
3406        // rewind
3407        rewind: false,
3408        // Swiping/no swiping
3409        allowSlidePrev: true,
3410        allowSlideNext: true,
3411        swipeHandler: null,
3412        // '.swipe-handler',
3413        noSwiping: true,
3414        noSwipingClass: 'swiper-no-swiping',
3415        noSwipingSelector: null,
3416        // Passive Listeners
3417        passiveListeners: true,
3418        maxBackfaceHiddenSlides: 10,
3419        // NS
3420        containerModifierClass: 'swiper-',
3421        // NEW
3422        slideClass: 'swiper-slide',
3423        slideActiveClass: 'swiper-slide-active',
3424        slideVisibleClass: 'swiper-slide-visible',
3425        slideNextClass: 'swiper-slide-next',
3426        slidePrevClass: 'swiper-slide-prev',
3427        wrapperClass: 'swiper-wrapper',
3428        lazyPreloaderClass: 'swiper-lazy-preloader',
3429        lazyPreloadPrevNext: 0,
3430        // Callbacks
3431        runCallbacksOnInit: true,
3432        // Internals
3433        _emitClasses: false
3434    };
3435
3436    function moduleExtendParams(params, allModulesParams) {
3437        return function extendParams(obj) {
3438            if (obj === void 0) {
3439                obj = {};
3440            }
3441            const moduleParamName = Object.keys(obj)[0];
3442            const moduleParams = obj[moduleParamName];
3443            if (typeof moduleParams !== 'object' || moduleParams === null) {
3444                extend(allModulesParams, obj);
3445                return;
3446            }
3447            if (params[moduleParamName] === true) {
3448                params[moduleParamName] = {
3449                    enabled: true
3450                };
3451            }
3452            if (moduleParamName === 'navigation' && params[moduleParamName] && params[moduleParamName].enabled && !params[moduleParamName].prevEl && !params[moduleParamName].nextEl) {
3453                params[moduleParamName].auto = true;
3454            }
3455            if (['pagination', 'scrollbar'].indexOf(moduleParamName) >= 0 && params[moduleParamName] && params[moduleParamName].enabled && !params[moduleParamName].el) {
3456                params[moduleParamName].auto = true;
3457            }
3458            if (!(moduleParamName in params && 'enabled' in moduleParams)) {
3459                extend(allModulesParams, obj);
3460                return;
3461            }
3462            if (typeof params[moduleParamName] === 'object' && !('enabled' in params[moduleParamName])) {
3463                params[moduleParamName].enabled = true;
3464            }
3465            if (!params[moduleParamName]) params[moduleParamName] = {
3466                enabled: false
3467            };
3468            extend(allModulesParams, obj);
3469        };
3470    }
3471
3472    /* eslint no-param-reassign: "off" */
3473    const prototypes = {
3474        eventsEmitter,
3475        update,
3476        translate,
3477        transition,
3478        slide,
3479        loop,
3480        grabCursor,
3481        events: events$1,
3482        breakpoints,
3483        checkOverflow: checkOverflow$1,
3484        classes
3485    };
3486    const extendedDefaults = {};
3487    class Swiper {
3488        constructor() {
3489            let el;
3490            let params;
3491            for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3492                args[_key] = arguments[_key];
3493            }
vendor: 1,050 bytes, lines 3494-3517
3494            if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') {
3495                params = args[0];
3496            } else {
3497                [el, params] = args;
3498            }
3499            if (!params) params = {};
3500            params = extend({}, params);
3501            if (el && !params.el) params.el = el;
3502            const document = getDocument();
3503            if (params.el && typeof params.el === 'string' && document.querySelectorAll(params.el).length > 1) {
3504                const swipers = [];
3505                document.querySelectorAll(params.el).forEach(containerEl => {
3506                    const newParams = extend({}, params, {
3507                        el: containerEl
3508                    });
3509                    swipers.push(new Swiper(newParams));
3510                });
3511                // eslint-disable-next-line no-constructor-return
3512                return swipers;
3513            }
3514
3515            // Swiper Instance
3516            const swiper = this;
3517            swiper.__swiper__ = true;
vendor: 5,687 bytes, lines 3518-3669
3518            swiper.support = getSupport();
3519            swiper.device = getDevice({
3520                userAgent: params.userAgent
3521            });
3522            swiper.browser = getBrowser();
3523            swiper.eventsListeners = {};
3524            swiper.eventsAnyListeners = [];
3525            swiper.modules = [...swiper.__modules__];
3526            if (params.modules && Array.isArray(params.modules)) {
3527                swiper.modules.push(...params.modules);
3528            }
3529            const allModulesParams = {};
3530            swiper.modules.forEach(mod => {
3531                mod({
3532                    params,
3533                    swiper,
3534                    extendParams: moduleExtendParams(params, allModulesParams),
3535                    on: swiper.on.bind(swiper),
3536                    once: swiper.once.bind(swiper),
3537                    off: swiper.off.bind(swiper),
3538                    emit: swiper.emit.bind(swiper)
3539                });
3540            });
3541
3542            // Extend defaults with modules params
3543            const swiperParams = extend({}, defaults, allModulesParams);
3544
3545            // Extend defaults with passed params
3546            swiper.params = extend({}, swiperParams, extendedDefaults, params);
3547            swiper.originalParams = extend({}, swiper.params);
3548            swiper.passedParams = extend({}, params);
3549
3550            // add event listeners
3551            if (swiper.params && swiper.params.on) {
3552                Object.keys(swiper.params.on).forEach(eventName => {
3553                    swiper.on(eventName, swiper.params.on[eventName]);
3554                });
3555            }
3556            if (swiper.params && swiper.params.onAny) {
3557                swiper.onAny(swiper.params.onAny);
3558            }
3559
3560            // Extend Swiper
3561            Object.assign(swiper, {
3562                enabled: swiper.params.enabled,
3563                el,
3564                // Classes
3565                classNames: [],
3566                // Slides
3567                slides: [],
3568                slidesGrid: [],
3569                snapGrid: [],
3570                slidesSizesGrid: [],
3571                // isDirection
3572                isHorizontal() {
3573                    return swiper.params.direction === 'horizontal';
3574                },
3575                isVertical() {
3576                    return swiper.params.direction === 'vertical';
3577                },
3578                // Indexes
3579                activeIndex: 0,
3580                realIndex: 0,
3581                //
3582                isBeginning: true,
3583                isEnd: false,
3584                // Props
3585                translate: 0,
3586                previousTranslate: 0,
3587                progress: 0,
3588                velocity: 0,
3589                animating: false,
3590                cssOverflowAdjustment() {
3591                    // Returns 0 unless `translate` is > 2**23
3592                    // Should be subtracted from css values to prevent overflow
3593                    return Math.trunc(this.translate / 2 ** 23) * 2 ** 23;
3594                },
3595                // Locks
3596                allowSlideNext: swiper.params.allowSlideNext,
3597                allowSlidePrev: swiper.params.allowSlidePrev,
3598                // Touch Events
3599                touchEventsData: {
3600                    isTouched: undefined,
3601                    isMoved: undefined,
3602                    allowTouchCallbacks: undefined,
3603                    touchStartTime: undefined,
3604                    isScrolling: undefined,
3605                    currentTranslate: undefined,
3606                    startTranslate: undefined,
3607                    allowThresholdMove: undefined,
3608                    // Form elements to match
3609                    focusableElements: swiper.params.focusableElements,
3610                    // Last click time
3611                    lastClickTime: 0,
3612                    clickTimeout: undefined,
3613                    // Velocities
3614                    velocities: [],
3615                    allowMomentumBounce: undefined,
3616                    startMoving: undefined,
3617                    evCache: []
3618                },
3619                // Clicks
3620                allowClick: true,
3621                // Touches
3622                allowTouchMove: swiper.params.allowTouchMove,
3623                touches: {
3624                    startX: 0,
3625                    startY: 0,
3626                    currentX: 0,
3627                    currentY: 0,
3628                    diff: 0
3629                },
3630                // Images
3631                imagesToLoad: [],
3632                imagesLoaded: 0
3633            });
3634            swiper.emit('_swiper');
3635
3636            // Init
3637            if (swiper.params.init) {
3638                swiper.init();
3639            }
3640
3641            // Return app instance
3642            // eslint-disable-next-line no-constructor-return
3643            return swiper;
3644        }
3645        getSlideIndex(slideEl) {
3646            const {
3647                slidesEl,
3648                params
3649            } = this;
3650            const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
3651            const firstSlideIndex = elementIndex(slides[0]);
3652            return elementIndex(slideEl) - firstSlideIndex;
3653        }
3654        getSlideIndexByData(index) {
3655            return this.getSlideIndex(this.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === index)[0]);
3656        }
3657        recalcSlides() {
3658            const swiper = this;
3659            const {
3660                slidesEl,
3661                params
3662            } = swiper;
3663            swiper.slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
3664        }
3665        enable() {
3666            const swiper = this;
3667            if (swiper.enabled) return;
3668            swiper.enabled = true;
3669            if (swiper.params.grabCursor) {
vendor: 1,751 bytes, lines 3670-3711
3670                swiper.setGrabCursor();
3671            }
3672            swiper.emit('enable');
3673        }
3674        disable() {
3675            const swiper = this;
3676            if (!swiper.enabled) return;
3677            swiper.enabled = false;
3678            if (swiper.params.grabCursor) {
3679                swiper.unsetGrabCursor();
3680            }
3681            swiper.emit('disable');
3682        }
3683        setProgress(progress, speed) {
3684            const swiper = this;
3685            progress = Math.min(Math.max(progress, 0), 1);
3686            const min = swiper.minTranslate();
3687            const max = swiper.maxTranslate();
3688            const current = (max - min) * progress + min;
3689            swiper.translateTo(current, typeof speed === 'undefined' ? 0 : speed);
3690            swiper.updateActiveIndex();
3691            swiper.updateSlidesClasses();
3692        }
3693        emitContainerClasses() {
3694            const swiper = this;
3695            if (!swiper.params._emitClasses || !swiper.el) return;
3696            const cls = swiper.el.className.split(' ').filter(className => {
3697                return className.indexOf('swiper') === 0 || className.indexOf(swiper.params.containerModifierClass) === 0;
3698            });
3699            swiper.emit('_containerClasses', cls.join(' '));
3700        }
3701        getSlideClasses(slideEl) {
3702            const swiper = this;
3703            if (swiper.destroyed) return '';
3704            return slideEl.className.split(' ').filter(className => {
3705                return className.indexOf('swiper-slide') === 0 || className.indexOf(swiper.params.slideClass) === 0;
3706            }).join(' ');
3707        }
3708        emitSlidesClasses() {
3709            const swiper = this;
3710            if (!swiper.params._emitClasses || !swiper.el) return;
3711            const updates = [];
vendor: 2,873 bytes, lines 3712-3784
3712            swiper.slides.forEach(slideEl => {
3713                const classNames = swiper.getSlideClasses(slideEl);
3714                updates.push({
3715                    slideEl,
3716                    classNames
3717                });
3718                swiper.emit('_slideClass', slideEl, classNames);
3719            });
3720            swiper.emit('_slideClasses', updates);
3721        }
3722        slidesPerViewDynamic(view, exact) {
3723            if (view === void 0) {
3724                view = 'current';
3725            }
3726            if (exact === void 0) {
3727                exact = false;
3728            }
3729            const swiper = this;
3730            const {
3731                params,
3732                slides,
3733                slidesGrid,
3734                slidesSizesGrid,
3735                size: swiperSize,
3736                activeIndex
3737            } = swiper;
3738            let spv = 1;
3739            if (typeof params.slidesPerView === 'number') return params.slidesPerView;
3740            if (params.centeredSlides) {
3741                let slideSize = slides[activeIndex] ? slides[activeIndex].swiperSlideSize : 0;
3742                let breakLoop;
3743                for (let i = activeIndex + 1; i < slides.length; i += 1) {
3744                    if (slides[i] && !breakLoop) {
3745                        slideSize += slides[i].swiperSlideSize;
3746                        spv += 1;
3747                        if (slideSize > swiperSize) breakLoop = true;
3748                    }
3749                }
3750                for (let i = activeIndex - 1; i >= 0; i -= 1) {
3751                    if (slides[i] && !breakLoop) {
3752                        slideSize += slides[i].swiperSlideSize;
3753                        spv += 1;
3754                        if (slideSize > swiperSize) breakLoop = true;
3755                    }
3756                }
3757            } else {
3758                // eslint-disable-next-line
3759                if (view === 'current') {
3760                    for (let i = activeIndex + 1; i < slides.length; i += 1) {
3761                        const slideInView = exact ? slidesGrid[i] + slidesSizesGrid[i] - slidesGrid[activeIndex] < swiperSize : slidesGrid[i] - slidesGrid[activeIndex] < swiperSize;
3762                        if (slideInView) {
3763                            spv += 1;
3764                        }
3765                    }
3766                } else {
3767                    // previous
3768                    for (let i = activeIndex - 1; i >= 0; i -= 1) {
3769                        const slideInView = slidesGrid[activeIndex] - slidesGrid[i] < swiperSize;
3770                        if (slideInView) {
3771                            spv += 1;
3772                        }
3773                    }
3774                }
3775            }
3776            return spv;
3777        }
3778        update() {
3779            const swiper = this;
3780            if (!swiper || swiper.destroyed) return;
3781            const {
3782                snapGrid,
3783                params
3784            } = swiper;
vendor: 2,773 bytes, lines 3785-3843
3785            // Breakpoints
3786            if (params.breakpoints) {
3787                swiper.setBreakpoint();
3788            }
3789            [...swiper.el.querySelectorAll('[loading="lazy"]')].forEach(imageEl => {
3790                if (imageEl.complete) {
3791                    processLazyPreloader(swiper, imageEl);
3792                }
3793            });
3794            swiper.updateSize();
3795            swiper.updateSlides();
3796            swiper.updateProgress();
3797            swiper.updateSlidesClasses();
3798            function setTranslate() {
3799                const translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate;
3800                const newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate());
3801                swiper.setTranslate(newTranslate);
3802                swiper.updateActiveIndex();
3803                swiper.updateSlidesClasses();
3804            }
3805            let translated;
3806            if (params.freeMode && params.freeMode.enabled && !params.cssMode) {
3807                setTranslate();
3808                if (params.autoHeight) {
3809                    swiper.updateAutoHeight();
3810                }
3811            } else {
3812                if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !params.centeredSlides) {
3813                    const slides = swiper.virtual && params.virtual.enabled ? swiper.virtual.slides : swiper.slides;
3814                    translated = swiper.slideTo(slides.length - 1, 0, false, true);
3815                } else {
3816                    translated = swiper.slideTo(swiper.activeIndex, 0, false, true);
3817                }
3818                if (!translated) {
3819                    setTranslate();
3820                }
3821            }
3822            if (params.watchOverflow && snapGrid !== swiper.snapGrid) {
3823                swiper.checkOverflow();
3824            }
3825            swiper.emit('update');
3826        }
3827        changeDirection(newDirection, needUpdate) {
3828            if (needUpdate === void 0) {
3829                needUpdate = true;
3830            }
3831            const swiper = this;
3832            const currentDirection = swiper.params.direction;
3833            if (!newDirection) {
3834                // eslint-disable-next-line
3835                newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal';
3836            }
3837            if (newDirection === currentDirection || newDirection !== 'horizontal' && newDirection !== 'vertical') {
3838                return swiper;
3839            }
3840            swiper.el.classList.remove(`${swiper.params.containerModifierClass}${currentDirection}`);
3841            swiper.el.classList.add(`${swiper.params.containerModifierClass}${newDirection}`);
3842            swiper.emitContainerClasses();
3843            swiper.params.direction = newDirection;
vendor: 2,448 bytes, lines 3844-3901
3844            swiper.slides.forEach(slideEl => {
3845                if (newDirection === 'vertical') {
3846                    slideEl.style.width = '';
3847                } else {
3848                    slideEl.style.height = '';
3849                }
3850            });
3851            swiper.emit('changeDirection');
3852            if (needUpdate) swiper.update();
3853            return swiper;
3854        }
3855        changeLanguageDirection(direction) {
3856            const swiper = this;
3857            if (swiper.rtl && direction === 'rtl' || !swiper.rtl && direction === 'ltr') return;
3858            swiper.rtl = direction === 'rtl';
3859            swiper.rtlTranslate = swiper.params.direction === 'horizontal' && swiper.rtl;
3860            if (swiper.rtl) {
3861                swiper.el.classList.add(`${swiper.params.containerModifierClass}rtl`);
3862                swiper.el.dir = 'rtl';
3863            } else {
3864                swiper.el.classList.remove(`${swiper.params.containerModifierClass}rtl`);
3865                swiper.el.dir = 'ltr';
3866            }
3867            swiper.update();
3868        }
3869        mount(element) {
3870            const swiper = this;
3871            if (swiper.mounted) return true;
3872
3873            // Find el
3874            let el = element || swiper.params.el;
3875            if (typeof el === 'string') {
3876                el = document.querySelector(el);
3877            }
3878            if (!el) {
3879                return false;
3880            }
3881            el.swiper = swiper;
3882            if (el.parentNode && el.parentNode.host && el.parentNode.host.nodeName === 'SWIPER-CONTAINER') {
3883                swiper.isElement = true;
3884            }
3885            const getWrapperSelector = () => {
3886                return `.${(swiper.params.wrapperClass || '').trim().split(' ').join('.')}`;
3887            };
3888            const getWrapper = () => {
3889                if (el && el.shadowRoot && el.shadowRoot.querySelector) {
3890                    const res = el.shadowRoot.querySelector(getWrapperSelector());
3891                    // Children needs to return slot items
3892                    return res;
3893                }
3894                return elementChildren(el, getWrapperSelector())[0];
3895            };
3896            // Find Wrapper
3897            let wrapperEl = getWrapper();
3898            if (!wrapperEl && swiper.params.createElements) {
3899                wrapperEl = createElement('div', swiper.params.wrapperClass);
3900                el.append(wrapperEl);
3901                elementChildren(el, `.${swiper.params.slideClass}
3901`).forEach(slideEl => {
3902                    wrapperEl.append(slideEl);
3903                });
3904            }
3905            Object.assign(swiper, {
3906                el,
3907                wrapperEl,
3908                slidesEl: swiper.isElement && !el.parentNode.host.slideSlots ? el.parentNode.host : wrapperEl,
3909                hostEl: swiper.isElement ? el.parentNode.host : el,
3910                mounted: true,
3911                // RTL
3912                rtl: el.dir.toLowerCase() === 'rtl' || elementStyle(el, 'direction') === 'rtl',
3913                rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || elementStyle(el, 'direction') === 'rtl'),
3914                wrongRTL: elementStyle(wrapperEl, 'display') === '-webkit-box'
3915            });
3916            return true;
3917        }
3918        init(el) {
3919            const swiper = this;
3920            if (swiper.initialized) return swiper;
3921            const mounted = swiper.mount(el);
3922            if (mounted === false) return swiper;
3923            swiper.emit('beforeInit');
3924
3925            // Set breakpoint
3926            if (swiper.params.breakpoints) {
3927                swiper.setBreakpoint();
3928            }
3929
3930            // Add Classes
3931            swiper.addClasses();
3932
3933            // Update size
3934            swiper.updateSize();
3935
3936            // Update slides
3937            swiper.updateSlides();
3938            if (swiper.params.watchOverflow) {
3939                swiper.checkOverflow();
3940            }
3941
3942            // Set Grab Cursor
3943            if (swiper.params.grabCursor && swiper.enabled) {
3944                swiper.setGrabCursor();
3945            }
3946
3947            // Slide To Initial Slide
3948            if (swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {
3949                swiper.slideTo(swiper.params.initialSlide + swiper.virtual.slidesBefore, 0, swiper.params.runCallbacksOnInit, false, true);
3950            } else {
3951                swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit, false, true);
3952            }
3953
3954            // Create loop
3955            if (swiper.params.loop) {
3956                swiper.loopCreate();
3957            }
3958
3959            // Attach events
3960            swiper.attachEvents();
3961            const lazyElements = [...swiper.el.querySelectorAll('[loading="lazy"]')];
3962            if (swiper.isElement) {
3963                lazyElements.push(...swiper.hostEl.querySelectorAll('[loading="lazy"]'));
3964            }
3965            lazyElements.forEach(imageEl => {
3966                if (imageEl.complete) {
3967                    processLazyPreloader(swiper, imageEl);
3968                } else {
3969                    imageEl.addEventListener('load', e => {
3970                        processLazyPreloader(swiper, e.target);
3971                    });
3972                }
3973            });
3974            preload(swiper);
3975
3976            // Init Flag
3977            swiper.initialized = true;
3978            preload(swiper);
3979
3980            // Emit
3981            swiper.emit('init');
3982            swiper.emit('afterInit');
3983            return swiper;
3984        }
3985        destroy(deleteInstance, cleanStyles) {
3986            if (deleteInstance === void 0) {
3987                deleteInstance = true;
3988            }
3989            if (cleanStyles === void 0) {
3990                cleanStyles = true;
3991            }
3992            const swiper = this;
3993            const {
3994                params,
3995                el,
3996                wrapperEl,
3997                slides
3998            } = swiper;
3999            if (typeof swiper.params === 'undefined' || swiper.destroyed) {
4000                return null;
4001            }
4002            swiper.emit('beforeDestroy');
4003
4004            // Init Flag
4005            swiper.initialized = false;
4006
4007            // Detach events
4008            swiper.detachEvents();
4009
4010            // Destroy loop
4011            if (params.loop) {
4012                swiper.loopDestroy();
4013            }
4014
4015            // Cleanup styles
4016            if (cleanStyles) {
4017                swiper.removeClasses();
4018                el.removeAttribute('style');
4019                wrapperEl.removeAttribute('style');
4020                if (slides && slides.length) {
vendor: 6,422 bytes, lines 4021-4192
4021                    slides.forEach(slideEl => {
4022                        slideEl.classList.remove(params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
4023                        slideEl.removeAttribute('style');
4024                        slideEl.removeAttribute('data-swiper-slide-index');
4025                    });
4026                }
4027            }
4028            swiper.emit('destroy');
4029
4030            // Detach emitter events
4031            Object.keys(swiper.eventsListeners).forEach(eventName => {
4032                swiper.off(eventName);
4033            });
4034            if (deleteInstance !== false) {
4035                swiper.el.swiper = null;
4036                deleteProps(swiper);
4037            }
4038            swiper.destroyed = true;
4039            return null;
4040        }
4041        static extendDefaults(newDefaults) {
4042            extend(extendedDefaults, newDefaults);
4043        }
4044        static get extendedDefaults() {
4045            return extendedDefaults;
4046        }
4047        static get defaults() {
4048            return defaults;
4049        }
4050        static installModule(mod) {
4051            if (!Swiper.prototype.__modules__) Swiper.prototype.__modules__ = [];
4052            const modules = Swiper.prototype.__modules__;
4053            if (typeof mod === 'function' && modules.indexOf(mod) < 0) {
4054                modules.push(mod);
4055            }
4056        }
4057        static use(module) {
4058            if (Array.isArray(module)) {
4059                module.forEach(m => Swiper.installModule(m));
4060                return Swiper;
4061            }
4062            Swiper.installModule(module);
4063            return Swiper;
4064        }
4065    }
4066    Object.keys(prototypes).forEach(prototypeGroup => {
4067        Object.keys(prototypes[prototypeGroup]).forEach(protoMethod => {
4068            Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod];
4069        });
4070    });
4071    Swiper.use([Resize, Observer]);
4072
4073    function Virtual(_ref) {
4074        let {
4075            swiper,
4076            extendParams,
4077            on,
4078            emit
4079        } = _ref;
4080        extendParams({
4081            virtual: {
4082                enabled: false,
4083                slides: [],
4084                cache: true,
4085                renderSlide: null,
4086                renderExternal: null,
4087                renderExternalUpdate: true,
4088                addSlidesBefore: 0,
4089                addSlidesAfter: 0
4090            }
4091        });
4092        let cssModeTimeout;
4093        const document = getDocument();
4094        swiper.virtual = {
4095            cache: {},
4096            from: undefined,
4097            to: undefined,
4098            slides: [],
4099            offset: 0,
4100            slidesGrid: []
4101        };
4102        const tempDOM = document.createElement('div');
4103        function renderSlide(slide, index) {
4104            const params = swiper.params.virtual;
4105            if (params.cache && swiper.virtual.cache[index]) {
4106                return swiper.virtual.cache[index];
4107            }
4108            // eslint-disable-next-line
4109            let slideEl;
4110            if (params.renderSlide) {
4111                slideEl = params.renderSlide.call(swiper, slide, index);
4112                if (typeof slideEl === 'string') {
4113                    tempDOM.innerHTML = slideEl;
4114                    slideEl = tempDOM.children[0];
4115                }
4116            } else if (swiper.isElement) {
4117                slideEl = createElement('swiper-slide');
4118            } else {
4119                slideEl = createElement('div', swiper.params.slideClass);
4120            }
4121            slideEl.setAttribute('data-swiper-slide-index', index);
4122            if (!params.renderSlide) {
4123                slideEl.innerHTML = slide;
4124            }
4125            if (params.cache) {
4126                swiper.virtual.cache[index] = slideEl;
4127            }
4128            return slideEl;
4129        }
4130        function update(force) {
4131            const {
4132                slidesPerView,
4133                slidesPerGroup,
4134                centeredSlides,
4135                loop: isLoop
4136            } = swiper.params;
4137            const {
4138                addSlidesBefore,
4139                addSlidesAfter
4140            } = swiper.params.virtual;
4141            const {
4142                from: previousFrom,
4143                to: previousTo,
4144                slides,
4145                slidesGrid: previousSlidesGrid,
4146                offset: previousOffset
4147            } = swiper.virtual;
4148            if (!swiper.params.cssMode) {
4149                swiper.updateActiveIndex();
4150            }
4151            const activeIndex = swiper.activeIndex || 0;
4152            let offsetProp;
4153            if (swiper.rtlTranslate) offsetProp = 'right';else offsetProp = swiper.isHorizontal() ? 'left' : 'top';
4154            let slidesAfter;
4155            let slidesBefore;
4156            if (centeredSlides) {
4157                slidesAfter = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesAfter;
4158                slidesBefore = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesBefore;
4159            } else {
4160                slidesAfter = slidesPerView + (slidesPerGroup - 1) + addSlidesAfter;
4161                slidesBefore = (isLoop ? slidesPerView : slidesPerGroup) + addSlidesBefore;
4162            }
4163            let from = activeIndex - slidesBefore;
4164            let to = activeIndex + slidesAfter;
4165            if (!isLoop) {
4166                from = Math.max(from, 0);
4167                to = Math.min(to, slides.length - 1);
4168            }
4169            let offset = (swiper.slidesGrid[from] || 0) - (swiper.slidesGrid[0] || 0);
4170            if (isLoop && activeIndex >= slidesBefore) {
4171                from -= slidesBefore;
4172                if (!centeredSlides) offset += swiper.slidesGrid[0];
4173            } else if (isLoop && activeIndex < slidesBefore) {
4174                from = -slidesBefore;
4175                if (centeredSlides) offset += swiper.slidesGrid[0];
4176            }
4177            Object.assign(swiper.virtual, {
4178                from,
4179                to,
4180                offset,
4181                slidesGrid: swiper.slidesGrid,
4182                slidesBefore,
4183                slidesAfter
4184            });
4185            function onRendered() {
4186                swiper.updateSlides();
4187                swiper.updateProgress();
4188                swiper.updateSlidesClasses();
4189                emit('virtualUpdate');
4190            }
4191            if (previousFrom === from && previousTo === to && !force) {
4192                if (swiper.slidesGrid !== previousSlidesGrid && offset !== previousOffset) {
vendor: 1,686 bytes, lines 4193-4234
4193                    swiper.slides.forEach(slideEl => {
4194                        slideEl.style[offsetProp] = `${offset - Math.abs(swiper.cssOverflowAdjustment())}px`;
4195                    });
4196                }
4197                swiper.updateProgress();
4198                emit('virtualUpdate');
4199                return;
4200            }
4201            if (swiper.params.virtual.renderExternal) {
4202                swiper.params.virtual.renderExternal.call(swiper, {
4203                    offset,
4204                    from,
4205                    to,
4206                    slides: function getSlides() {
4207                        const slidesToRender = [];
4208                        for (let i = from; i <= to; i += 1) {
4209                            slidesToRender.push(slides[i]);
4210                        }
4211                        return slidesToRender;
4212                    }()
4213                });
4214                if (swiper.params.virtual.renderExternalUpdate) {
4215                    onRendered();
4216                } else {
4217                    emit('virtualUpdate');
4218                }
4219                return;
4220            }
4221            const prependIndexes = [];
4222            const appendIndexes = [];
4223            const getSlideIndex = index => {
4224                let slideIndex = index;
4225                if (index < 0) {
4226                    slideIndex = slides.length + index;
4227                } else if (slideIndex >= slides.length) {
4228                    // eslint-disable-next-line
4229                    slideIndex = slideIndex - slides.length;
4230                }
4231                return slideIndex;
4232            };
4233            if (force) {
4234                swiper.slides.filter(el => el.matches(`.${swiper.params.slideClass}
4234, swiper-slide`)).forEach(slideEl => {
4235                    slideEl.remove();
4236                });
4237            } else {
4238                for (let i = previousFrom; i <= previousTo; i += 1) {
4239                    if (i < from || i > to) {
4240                        const slideIndex = getSlideIndex(i);
4241                        swiper.slides.filter(el => el.matches(`.${swiper.params.slideClass}[data-swiper-slide-index="${slideIndex}"], swiper-slide[data-swiper-slide-index="${slideIndex}"]`)).forEach(slideEl => {
4242                            slideEl.remove();
4243                        });
4244                    }
4245                }
4246            }
4247            const loopFrom = isLoop ? -slides.length : 0;
4248            const loopTo = isLoop ? slides.length * 2 : slides.length;
4249            for (let i = loopFrom; i < loopTo; i += 1) {
4250                if (i >= from && i <= to) {
4251                    const slideIndex = getSlideIndex(i);
4252                    if (typeof previousTo === 'undefined' || force) {
4253                        appendIndexes.push(slideIndex);
4254                    } else {
4255                        if (i > previousTo) appendIndexes.push(slideIndex);
4256                        if (i < previousFrom) prependIndexes.push(slideIndex);
4257                    }
4258                }
4259            }
4260            appendIndexes.forEach(index => {
4261                swiper.slidesEl.append(renderSlide(slides[index], index));
4262            });
4263            if (isLoop) {
4264                for (let i = prependIndexes.length - 1; i >= 0; i -= 1) {
4265                    const index = prependIndexes[i];
4266                    swiper.slidesEl.prepend(renderSlide(slides[index], index));
4267                }
4268            } else {
4269                prependIndexes.sort((a, b) => b - a);
4270                prependIndexes.forEach(index => {
4271                    swiper.slidesEl.prepend(renderSlide(slides[index], index));
4272                });
4273            }
4274            elementChildren(swiper.slidesEl, '.swiper-slide, swiper-slide').forEach(sli
vendor: 4,735 bytes, lines 4274-4372
4274deEl => {
4275                slideEl.style[offsetProp] = `${offset - Math.abs(swiper.cssOverflowAdjustment())}px`;
4276            });
4277            onRendered();
4278        }
4279        function appendSlide(slides) {
4280            if (typeof slides === 'object' && 'length' in slides) {
4281                for (let i = 0; i < slides.length; i += 1) {
4282                    if (slides[i]) swiper.virtual.slides.push(slides[i]);
4283                }
4284            } else {
4285                swiper.virtual.slides.push(slides);
4286            }
4287            update(true);
4288        }
4289        function prependSlide(slides) {
4290            const activeIndex = swiper.activeIndex;
4291            let newActiveIndex = activeIndex + 1;
4292            let numberOfNewSlides = 1;
4293            if (Array.isArray(slides)) {
4294                for (let i = 0; i < slides.length; i += 1) {
4295                    if (slides[i]) swiper.virtual.slides.unshift(slides[i]);
4296                }
4297                newActiveIndex = activeIndex + slides.length;
4298                numberOfNewSlides = slides.length;
4299            } else {
4300                swiper.virtual.slides.unshift(slides);
4301            }
4302            if (swiper.params.virtual.cache) {
4303                const cache = swiper.virtual.cache;
4304                const newCache = {};
4305                Object.keys(cache).forEach(cachedIndex => {
4306                    const cachedEl = cache[cachedIndex];
4307                    const cachedElIndex = cachedEl.getAttribute('data-swiper-slide-index');
4308                    if (cachedElIndex) {
4309                        cachedEl.setAttribute('data-swiper-slide-index', parseInt(cachedElIndex, 10) + numberOfNewSlides);
4310                    }
4311                    newCache[parseInt(cachedIndex, 10) + numberOfNewSlides] = cachedEl;
4312                });
4313                swiper.virtual.cache = newCache;
4314            }
4315            update(true);
4316            swiper.slideTo(newActiveIndex, 0);
4317        }
4318        function removeSlide(slidesIndexes) {
4319            if (typeof slidesIndexes === 'undefined' || slidesIndexes === null) return;
4320            let activeIndex = swiper.activeIndex;
4321            if (Array.isArray(slidesIndexes)) {
4322                for (let i = slidesIndexes.length - 1; i >= 0; i -= 1) {
4323                    if (swiper.params.virtual.cache) {
4324                        delete swiper.virtual.cache[slidesIndexes[i]];
4325                        // shift cache indexes
4326                        Object.keys(swiper.virtual.cache).forEach(key => {
4327                            if (key > slidesIndexes) {
4328                                swiper.virtual.cache[key - 1] = swiper.virtual.cache[key];
4329                                swiper.virtual.cache[key - 1].setAttribute('data-swiper-slide-index', key - 1);
4330                                delete swiper.virtual.cache[key];
4331                            }
4332                        });
4333                    }
4334                    swiper.virtual.slides.splice(slidesIndexes[i], 1);
4335                    if (slidesIndexes[i] < activeIndex) activeIndex -= 1;
4336                    activeIndex = Math.max(activeIndex, 0);
4337                }
4338            } else {
4339                if (swiper.params.virtual.cache) {
4340                    delete swiper.virtual.cache[slidesIndexes];
4341                    // shift cache indexes
4342                    Object.keys(swiper.virtual.cache).forEach(key => {
4343                        if (key > slidesIndexes) {
4344                            swiper.virtual.cache[key - 1] = swiper.virtual.cache[key];
4345                            swiper.virtual.cache[key - 1].setAttribute('data-swiper-slide-index', key - 1);
4346                            delete swiper.virtual.cache[key];
4347                        }
4348                    });
4349                }
4350                swiper.virtual.slides.splice(slidesIndexes, 1);
4351                if (slidesIndexes < activeIndex) activeIndex -= 1;
4352                activeIndex = Math.max(activeIndex, 0);
4353            }
4354            update(true);
4355            swiper.slideTo(activeIndex, 0);
4356        }
4357        function removeAllSlides() {
4358            swiper.virtual.slides = [];
4359            if (swiper.params.virtual.cache) {
4360                swiper.virtual.cache = {};
4361            }
4362            update(true);
4363            swiper.slideTo(0, 0);
4364        }
4365        on('beforeInit', () => {
4366            if (!swiper.params.virtual.enabled) return;
4367            let domSlidesAssigned;
4368            if (typeof swiper.passedParams.virtual.slides === 'undefined') {
4369                const slides = [...swiper.slidesEl.children].filter(el => el.matches(`.${swiper.params.slideClass}, swiper-slide`));
4370                if (slides && slides.length) {
4371                    swiper.virtual.slides = [...slides];
4372                    domSlidesAssigned = true;
vendor: 5,206 bytes, lines 4373-4487
4373                    slides.forEach((slideEl, slideIndex) => {
4374                        slideEl.setAttribute('data-swiper-slide-index', slideIndex);
4375                        swiper.virtual.cache[slideIndex] = slideEl;
4376                        slideEl.remove();
4377                    });
4378                }
4379            }
4380            if (!domSlidesAssigned) {
4381                swiper.virtual.slides = swiper.params.virtual.slides;
4382            }
4383            swiper.classNames.push(`${swiper.params.containerModifierClass}virtual`);
4384            swiper.params.watchSlidesProgress = true;
4385            swiper.originalParams.watchSlidesProgress = true;
4386            update();
4387        });
4388        on('setTranslate', () => {
4389            if (!swiper.params.virtual.enabled) return;
4390            if (swiper.params.cssMode && !swiper._immediateVirtual) {
4391                clearTimeout(cssModeTimeout);
4392                cssModeTimeout = setTimeout(() => {
4393                    update();
4394                }, 100);
4395            } else {
4396                update();
4397            }
4398        });
4399        on('init update resize', () => {
4400            if (!swiper.params.virtual.enabled) return;
4401            if (swiper.params.cssMode) {
4402                setCSSProperty(swiper.wrapperEl, '--swiper-virtual-size', `${swiper.virtualSize}px`);
4403            }
4404        });
4405        Object.assign(swiper.virtual, {
4406            appendSlide,
4407            prependSlide,
4408            removeSlide,
4409            removeAllSlides,
4410            update
4411        });
4412    }
4413
4414    /* eslint-disable consistent-return */
4415    function Keyboard(_ref) {
4416        let {
4417            swiper,
4418            extendParams,
4419            on,
4420            emit
4421        } = _ref;
4422        const document = getDocument();
4423        const window = getWindow();
4424        swiper.keyboard = {
4425            enabled: false
4426        };
4427        extendParams({
4428            keyboard: {
4429                enabled: false,
4430                onlyInViewport: true,
4431                pageUpDown: true
4432            }
4433        });
4434        function handle(event) {
4435            if (!swiper.enabled) return;
4436            const {
4437                rtlTranslate: rtl
4438            } = swiper;
4439            let e = event;
4440            if (e.originalEvent) e = e.originalEvent; // jquery fix
4441            const kc = e.keyCode || e.charCode;
4442            const pageUpDown = swiper.params.keyboard.pageUpDown;
4443            const isPageUp = pageUpDown && kc === 33;
4444            const isPageDown = pageUpDown && kc === 34;
4445            const isArrowLeft = kc === 37;
4446            const isArrowRight = kc === 39;
4447            const isArrowUp = kc === 38;
4448            const isArrowDown = kc === 40;
4449            // Directions locks
4450            if (!swiper.allowSlideNext && (swiper.isHorizontal() && isArrowRight || swiper.isVertical() && isArrowDown || isPageDown)) {
4451                return false;
4452            }
4453            if (!swiper.allowSlidePrev && (swiper.isHorizontal() && isArrowLeft || swiper.isVertical() && isArrowUp || isPageUp)) {
4454                return false;
4455            }
4456            if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
4457                return undefined;
4458            }
4459            if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
4460                return undefined;
4461            }
4462            if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) {
4463                let inView = false;
4464                // Check that swiper should be inside of visible area of window
4465                if (elementParents(swiper.el, `.${swiper.params.slideClass}, swiper-slide`).length > 0 && elementParents(swiper.el, `.${swiper.params.slideActiveClass}`).length === 0) {
4466                    return undefined;
4467                }
4468                const el = swiper.el;
4469                const swiperWidth = el.clientWidth;
4470                const swiperHeight = el.clientHeight;
4471                const windowWidth = window.innerWidth;
4472                const windowHeight = window.innerHeight;
4473                const swiperOffset = elementOffset(el);
4474                if (rtl) swiperOffset.left -= el.scrollLeft;
4475                const swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiperWidth, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiperHeight], [swiperOffset.left + swiperWidth, swiperOffset.top + swiperHeight]];
4476                for (let i = 0; i < swiperCoord.length; i += 1) {
4477                    const point = swiperCoord[i];
4478                    if (point[0] >= 0 && point[0] <= windowWidth && point[1] >= 0 && point[1] <= windowHeight) {
4479                        if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line
4480                        inView = true;
4481                    }
4482                }
4483                if (!inView) return undefined;
4484            }
4485            if (swiper.isHorizontal()) {
4486                if (isPageUp || isPageDown || isArrowLeft || isArrowRight) {
4487                    if (e.preventDefault) e.preventDefault();else e.returnValue = false;
vendor: 1,778 bytes, lines 4488-4540
4488                }
4489                if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext();
4490                if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev();
4491            } else {
4492                if (isPageUp || isPageDown || isArrowUp || isArrowDown) {
4493                    if (e.preventDefault) e.preventDefault();else e.returnValue = false;
4494                }
4495                if (isPageDown || isArrowDown) swiper.slideNext();
4496                if (isPageUp || isArrowUp) swiper.slidePrev();
4497            }
4498            emit('keyPress', kc);
4499            return undefined;
4500        }
4501        function enable() {
4502            if (swiper.keyboard.enabled) return;
4503            document.addEventListener('keydown', handle);
4504            swiper.keyboard.enabled = true;
4505        }
4506        function disable() {
4507            if (!swiper.keyboard.enabled) return;
4508            document.removeEventListener('keydown', handle);
4509            swiper.keyboard.enabled = false;
4510        }
4511        on('init', () => {
4512            if (swiper.params.keyboard.enabled) {
4513                enable();
4514            }
4515        });
4516        on('destroy', () => {
4517            if (swiper.keyboard.enabled) {
4518                disable();
4519            }
4520        });
4521        Object.assign(swiper.keyboard, {
4522            enable,
4523            disable
4524        });
4525    }
4526
4527    /* eslint-disable consistent-return */
4528    function Mousewheel(_ref) {
4529        let {
4530            swiper,
4531            extendParams,
4532            on,
4533            emit
4534        } = _ref;
4535        const window = getWindow();
4536        extendParams({
4537            mousewheel: {
4538                enabled: false,
4539                releaseOnEdges: false,
4540                invert: false,
vendor: 35,022 bytes, lines 4541-5305
4541                forceToAxis: false,
4542                sensitivity: 1,
4543                eventsTarget: 'container',
4544                thresholdDelta: null,
4545                thresholdTime: null,
4546                noMousewheelClass: 'swiper-no-mousewheel'
4547            }
4548        });
4549        swiper.mousewheel = {
4550            enabled: false
4551        };
4552        let timeout;
4553        let lastScrollTime = now();
4554        let lastEventBeforeSnap;
4555        const recentWheelEvents = [];
4556        function normalize(e) {
4557            // Reasonable defaults
4558            const PIXEL_STEP = 10;
4559            const LINE_HEIGHT = 40;
4560            const PAGE_HEIGHT = 800;
4561            let sX = 0;
4562            let sY = 0; // spinX, spinY
4563            let pX = 0;
4564            let pY = 0; // pixelX, pixelY
4565
4566            // Legacy
4567            if ('detail' in e) {
4568                sY = e.detail;
4569            }
4570            if ('wheelDelta' in e) {
4571                sY = -e.wheelDelta / 120;
4572            }
4573            if ('wheelDeltaY' in e) {
4574                sY = -e.wheelDeltaY / 120;
4575            }
4576            if ('wheelDeltaX' in e) {
4577                sX = -e.wheelDeltaX / 120;
4578            }
4579
4580            // side scrolling on FF with DOMMouseScroll
4581            if ('axis' in e && e.axis === e.HORIZONTAL_AXIS) {
4582                sX = sY;
4583                sY = 0;
4584            }
4585            pX = sX * PIXEL_STEP;
4586            pY = sY * PIXEL_STEP;
4587            if ('deltaY' in e) {
4588                pY = e.deltaY;
4589            }
4590            if ('deltaX' in e) {
4591                pX = e.deltaX;
4592            }
4593            if (e.shiftKey && !pX) {
4594                // if user scrolls with shift he wants horizontal scroll
4595                pX = pY;
4596                pY = 0;
4597            }
4598            if ((pX || pY) && e.deltaMode) {
4599                if (e.deltaMode === 1) {
4600                    // delta in LINE units
4601                    pX *= LINE_HEIGHT;
4602                    pY *= LINE_HEIGHT;
4603                } else {
4604                    // delta in PAGE units
4605                    pX *= PAGE_HEIGHT;
4606                    pY *= PAGE_HEIGHT;
4607                }
4608            }
4609
4610            // Fall-back if spin cannot be determined
4611            if (pX && !sX) {
4612                sX = pX < 1 ? -1 : 1;
4613            }
4614            if (pY && !sY) {
4615                sY = pY < 1 ? -1 : 1;
4616            }
4617            return {
4618                spinX: sX,
4619                spinY: sY,
4620                pixelX: pX,
4621                pixelY: pY
4622            };
4623        }
4624        function handleMouseEnter() {
4625            if (!swiper.enabled) return;
4626            swiper.mouseEntered = true;
4627        }
4628        function handleMouseLeave() {
4629            if (!swiper.enabled) return;
4630            swiper.mouseEntered = false;
4631        }
4632        function animateSlider(newEvent) {
4633            if (swiper.params.mousewheel.thresholdDelta && newEvent.delta < swiper.params.mousewheel.thresholdDelta) {
4634                // Prevent if delta of wheel scroll delta is below configured threshold
4635                return false;
4636            }
4637            if (swiper.params.mousewheel.thresholdTime && now() - lastScrollTime < swiper.params.mousewheel.thresholdTime) {
4638                // Prevent if time between scrolls is below configured threshold
4639                return false;
4640            }
4641
4642            // If the movement is NOT big enough and
4643            // if the last time the user scrolled was too close to the current one (avoid continuously triggering the slider):
4644            //   Don't go any further (avoid insignificant scroll movement).
4645            if (newEvent.delta >= 6 && now() - lastScrollTime < 60) {
4646                // Return false as a default
4647                return true;
4648            }
4649            // If user is scrolling towards the end:
4650            //   If the slider hasn't hit the latest slide or
4651            //   if the slider is a loop and
4652            //   if the slider isn't moving right now:
4653            //     Go to next slide and
4654            //     emit a scroll event.
4655            // Else (the user is scrolling towards the beginning) and
4656            // if the slider hasn't hit the first slide or
4657            // if the slider is a loop and
4658            // if the slider isn't moving right now:
4659            //   Go to prev slide and
4660            //   emit a scroll event.
4661            if (newEvent.direction < 0) {
4662                if ((!swiper.isEnd || swiper.params.loop) && !swiper.animating) {
4663                    swiper.slideNext();
4664                    emit('scroll', newEvent.raw);
4665                }
4666            } else if ((!swiper.isBeginning || swiper.params.loop) && !swiper.animating) {
4667                swiper.slidePrev();
4668                emit('scroll', newEvent.raw);
4669            }
4670            // If you got here is because an animation has been triggered so store the current time
4671            lastScrollTime = new window.Date().getTime();
4672            // Return false as a default
4673            return false;
4674        }
4675        function releaseScroll(newEvent) {
4676            const params = swiper.params.mousewheel;
4677            if (newEvent.direction < 0) {
4678                if (swiper.isEnd && !swiper.params.loop && params.releaseOnEdges) {
4679                    // Return true to animate scroll on edges
4680                    return true;
4681                }
4682            } else if (swiper.isBeginning && !swiper.params.loop && params.releaseOnEdges) {
4683                // Return true to animate scroll on edges
4684                return true;
4685            }
4686            return false;
4687        }
4688        function handle(event) {
4689            let e = event;
4690            let disableParentSwiper = true;
4691            if (!swiper.enabled) return;
4692
4693            // Ignore event if the target or its parents have the swiper-no-mousewheel class
4694            if (event.target.closest(`.${swiper.params.mousewheel.noMousewheelClass}`)) return;
4695            const params = swiper.params.mousewheel;
4696            if (swiper.params.cssMode) {
4697                e.preventDefault();
4698            }
4699            let targetEl = swiper.el;
4700            if (swiper.params.mousewheel.eventsTarget !== 'container') {
4701                targetEl = document.querySelector(swiper.params.mousewheel.eventsTarget);
4702            }
4703            const targetElContainsTarget = targetEl && targetEl.contains(e.target);
4704            if (!swiper.mouseEntered && !targetElContainsTarget && !params.releaseOnEdges) return true;
4705            if (e.originalEvent) e = e.originalEvent; // jquery fix
4706            let delta = 0;
4707            const rtlFactor = swiper.rtlTranslate ? -1 : 1;
4708            const data = normalize(e);
4709            if (params.forceToAxis) {
4710                if (swiper.isHorizontal()) {
4711                    if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = -data.pixelX * rtlFactor;else return true;
4712                } else if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = -data.pixelY;else return true;
4713            } else {
4714                delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? -data.pixelX * rtlFactor : -data.pixelY;
4715            }
4716            if (delta === 0) return true;
4717            if (params.invert) delta = -delta;
4718
4719            // Get the scroll positions
4720            let positions = swiper.getTranslate() + delta * params.sensitivity;
4721            if (positions >= swiper.minTranslate()) positions = swiper.minTranslate();
4722            if (positions <= swiper.maxTranslate()) positions = swiper.maxTranslate();
4723
4724            // When loop is true:
4725            //     the disableParentSwiper will be true.
4726            // When loop is false:
4727            //     if the scroll positions is not on edge,
4728            //     then the disableParentSwiper will be true.
4729            //     if the scroll on edge positions,
4730            //     then the disableParentSwiper will be false.
4731            disableParentSwiper = swiper.params.loop ? true : !(positions === swiper.minTranslate() || positions === swiper.maxTranslate());
4732            if (disableParentSwiper && swiper.params.nested) e.stopPropagation();
4733            if (!swiper.params.freeMode || !swiper.params.freeMode.enabled) {
4734                // Register the new event in a variable which stores the relevant data
4735                const newEvent = {
4736                    time: now(),
4737                    delta: Math.abs(delta),
4738                    direction: Math.sign(delta),
4739                    raw: event
4740                };
4741
4742                // Keep the most recent events
4743                if (recentWheelEvents.length >= 2) {
4744                    recentWheelEvents.shift(); // only store the last N events
4745                }
4746
4747                const prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined;
4748                recentWheelEvents.push(newEvent);
4749
4750                // If there is at least one previous recorded event:
4751                //   If direction has changed or
4752                //   if the scroll is quicker than the previous one:
4753                //     Animate the slider.
4754                // Else (this is the first time the wheel is moved):
4755                //     Animate the slider.
4756                if (prevEvent) {
4757                    if (newEvent.direction !== prevEvent.direction || newEvent.delta > prevEvent.delta || newEvent.time > prevEvent.time + 150) {
4758                        animateSlider(newEvent);
4759                    }
4760                } else {
4761                    animateSlider(newEvent);
4762                }
4763
4764                // If it's time to release the scroll:
4765                //   Return now so you don't hit the preventDefault.
4766                if (releaseScroll(newEvent)) {
4767                    return true;
4768                }
4769            } else {
4770                // Freemode or scrollContainer:
4771
4772                // If we recently snapped after a momentum scroll, then ignore wheel events
4773                // to give time for the deceleration to finish. Stop ignoring after 500 msecs
4774                // or if it's a new scroll (larger delta or inverse sign as last event before
4775                // an end-of-momentum snap).
4776                const newEvent = {
4777                    time: now(),
4778                    delta: Math.abs(delta),
4779                    direction: Math.sign(delta)
4780                };
4781                const ignoreWheelEvents = lastEventBeforeSnap && newEvent.time < lastEventBeforeSnap.time + 500 && newEvent.delta <= lastEventBeforeSnap.delta && newEvent.direction === lastEventBeforeSnap.direction;
4782                if (!ignoreWheelEvents) {
4783                    lastEventBeforeSnap = undefined;
4784                    let position = swiper.getTranslate() + delta * params.sensitivity;
4785                    const wasBeginning = swiper.isBeginning;
4786                    const wasEnd = swiper.isEnd;
4787                    if (position >= swiper.minTranslate()) position = swiper.minTranslate();
4788                    if (position <= swiper.maxTranslate()) position = swiper.maxTranslate();
4789                    swiper.setTransition(0);
4790                    swiper.setTranslate(position);
4791                    swiper.updateProgress();
4792                    swiper.updateActiveIndex();
4793                    swiper.updateSlidesClasses();
4794                    if (!wasBeginning && swiper.isBeginning || !wasEnd && swiper.isEnd) {
4795                        swiper.updateSlidesClasses();
4796                    }
4797                    if (swiper.params.loop) {
4798                        swiper.loopFix({
4799                            direction: newEvent.direction < 0 ? 'next' : 'prev',
4800                            byMousewheel: true
4801                        });
4802                    }
4803                    if (swiper.params.freeMode.sticky) {
4804                        // When wheel scrolling starts with sticky (aka snap) enabled, then detect
4805                        // the end of a momentum scroll by storing recent (N=15?) wheel events.
4806                        // 1. do all N events have decreasing or same (absolute value) delta?
4807                        // 2. did all N events arrive in the last M (M=500?) msecs?
4808                        // 3. does the earliest event have an (absolute value) delta that's
4809                        //    at least P (P=1?) larger than the most recent event's delta?
4810                        // 4. does the latest event have a delta that's smaller than Q (Q=6?) pixels?
4811                        // If 1-4 are "yes" then we're near the end of a momentum scroll deceleration.
4812                        // Snap immediately and ignore remaining wheel events in this scroll.
4813                        // See comment above for "remaining wheel events in this scroll" determination.
4814                        // If 1-4 aren't satisfied, then wait to snap until 500ms after the last event.
4815                        clearTimeout(timeout);
4816                        timeout = undefined;
4817                        if (recentWheelEvents.length >= 15) {
4818                            recentWheelEvents.shift(); // only store the last N events
4819                        }
4820
4821                        const prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined;
4822                        const firstEvent = recentWheelEvents[0];
4823                        recentWheelEvents.push(newEvent);
4824                        if (prevEvent && (newEvent.delta > prevEvent.delta || newEvent.direction !== prevEvent.direction)) {
4825                            // Increasing or reverse-sign delta means the user started scrolling again. Clear the wheel event log.
4826                            recentWheelEvents.splice(0);
4827                        } else if (recentWheelEvents.length >= 15 && newEvent.time - firstEvent.time < 500 && firstEvent.delta - newEvent.delta >= 1 && newEvent.delta <= 6) {
4828                            // We're at the end of the deceleration of a momentum scroll, so there's no need
4829                            // to wait for more events. Snap ASAP on the next tick.
4830                            // Also, because there's some remaining momentum we'll bias the snap in the
4831                            // direction of the ongoing scroll because it's better UX for the scroll to snap
4832                            // in the same direction as the scroll instead of reversing to snap.  Therefore,
4833                            // if it's already scrolled more than 20% in the current direction, keep going.
4834                            const snapToThreshold = delta > 0 ? 0.8 : 0.2;
4835                            lastEventBeforeSnap = newEvent;
4836                            recentWheelEvents.splice(0);
4837                            timeout = nextTick(() => {
4838                                swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold);
4839                            }, 0); // no delay; move on next tick
4840                        }
4841
4842                        if (!timeout) {
4843                            // if we get here, then we haven't detected the end of a momentum scroll, so
4844                            // we'll consider a scroll "complete" when there haven't been any wheel events
4845                            // for 500ms.
4846                            timeout = nextTick(() => {
4847                                const snapToThreshold = 0.5;
4848                                lastEventBeforeSnap = newEvent;
4849                                recentWheelEvents.splice(0);
4850                                swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold);
4851                            }, 500);
4852                        }
4853                    }
4854
4855                    // Emit event
4856                    if (!ignoreWheelEvents) emit('scroll', e);
4857
4858                    // Stop autoplay
4859                    if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) swiper.autoplay.stop();
4860                    // Return page scroll on edge positions
4861                    if (params.releaseOnEdges && (position === swiper.minTranslate() || position === swiper.maxTranslate())) {
4862                        return true;
4863                    }
4864                }
4865            }
4866            if (e.preventDefault) e.preventDefault();else e.returnValue = false;
4867            return false;
4868        }
4869        function events(method) {
4870            let targetEl = swiper.el;
4871            if (swiper.params.mousewheel.eventsTarget !== 'container') {
4872                targetEl = document.querySelector(swiper.params.mousewheel.eventsTarget);
4873            }
4874            targetEl[method]('mouseenter', handleMouseEnter);
4875            targetEl[method]('mouseleave', handleMouseLeave);
4876            targetEl[method]('wheel', handle);
4877        }
4878        function enable() {
4879            if (swiper.params.cssMode) {
4880                swiper.wrapperEl.removeEventListener('wheel', handle);
4881                return true;
4882            }
4883            if (swiper.mousewheel.enabled) return false;
4884            events('addEventListener');
4885            swiper.mousewheel.enabled = true;
4886            return true;
4887        }
4888        function disable() {
4889            if (swiper.params.cssMode) {
4890                swiper.wrapperEl.addEventListener(event, handle);
4891                return true;
4892            }
4893            if (!swiper.mousewheel.enabled) return false;
4894            events('removeEventListener');
4895            swiper.mousewheel.enabled = false;
4896            return true;
4897        }
4898        on('init', () => {
4899            if (!swiper.params.mousewheel.enabled && swiper.params.cssMode) {
4900                disable();
4901            }
4902            if (swiper.params.mousewheel.enabled) enable();
4903        });
4904        on('destroy', () => {
4905            if (swiper.params.cssMode) {
4906                enable();
4907            }
4908            if (swiper.mousewheel.enabled) disable();
4909        });
4910        Object.assign(swiper.mousewheel, {
4911            enable,
4912            disable
4913        });
4914    }
4915
4916    function createElementIfNotDefined(swiper, originalParams, params, checkProps) {
4917        if (swiper.params.createElements) {
4918            Object.keys(checkProps).forEach(key => {
4919                if (!params[key] && params.auto === true) {
4920                    let element = elementChildren(swiper.el, `.${checkProps[key]}`)[0];
4921                    if (!element) {
4922                        element = createElement('div', checkProps[key]);
4923                        element.className = checkProps[key];
4924                        swiper.el.append(element);
4925                    }
4926                    params[key] = element;
4927                    originalParams[key] = element;
4928                }
4929            });
4930        }
4931        return params;
4932    }
4933
4934    function Navigation(_ref) {
4935        let {
4936            swiper,
4937            extendParams,
4938            on,
4939            emit
4940        } = _ref;
4941        extendParams({
4942            navigation: {
4943                nextEl: null,
4944                prevEl: null,
4945                hideOnClick: false,
4946                disabledClass: 'swiper-button-disabled',
4947                hiddenClass: 'swiper-button-hidden',
4948                lockClass: 'swiper-button-lock',
4949                navigationDisabledClass: 'swiper-navigation-disabled'
4950            }
4951        });
4952        swiper.navigation = {
4953            nextEl: null,
4954            prevEl: null
4955        };
4956        const makeElementsArray = el => (Array.isArray(el) ? el : [el]).filter(e => !!e);
4957        function getEl(el) {
4958            let res;
4959            if (el && typeof el === 'string' && swiper.isElement) {
4960                res = swiper.el.querySelector(el);
4961                if (res) return res;
4962            }
4963            if (el) {
4964                if (typeof el === 'string') res = [...document.querySelectorAll(el)];
4965                if (swiper.params.uniqueNavElements && typeof el === 'string' && res.length > 1 && swiper.el.querySelectorAll(el).length === 1) {
4966                    res = swiper.el.querySelector(el);
4967                }
4968            }
4969            if (el && !res) return el;
4970            // if (Array.isArray(res) && res.length === 1) res = res[0];
4971            return res;
4972        }
4973        function toggleEl(el, disabled) {
4974            const params = swiper.params.navigation;
4975            el = makeElementsArray(el);
4976            el.forEach(subEl => {
4977                if (subEl) {
4978                    subEl.classList[disabled ? 'add' : 'remove'](...params.disabledClass.split(' '));
4979                    if (subEl.tagName === 'BUTTON') subEl.disabled = disabled;
4980                    if (swiper.params.watchOverflow && swiper.enabled) {
4981                        subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);
4982                    }
4983                }
4984            });
4985        }
4986        function update() {
4987            // Update Navigation Buttons
4988            const {
4989                nextEl,
4990                prevEl
4991            } = swiper.navigation;
4992            if (swiper.params.loop) {
4993                toggleEl(prevEl, false);
4994                toggleEl(nextEl, false);
4995                return;
4996            }
4997            toggleEl(prevEl, swiper.isBeginning && !swiper.params.rewind);
4998            toggleEl(nextEl, swiper.isEnd && !swiper.params.rewind);
4999        }
5000        function onPrevClick(e) {
5001            e.preventDefault();
5002            if (swiper.isBeginning && !swiper.params.loop && !swiper.params.rewind) return;
5003            swiper.slidePrev();
5004            emit('navigationPrev');
5005        }
5006        function onNextClick(e) {
5007            e.preventDefault();
5008            if (swiper.isEnd && !swiper.params.loop && !swiper.params.rewind) return;
5009            swiper.slideNext();
5010            emit('navigationNext');
5011        }
5012        function init() {
5013            const params = swiper.params.navigation;
5014            swiper.params.navigation = createElementIfNotDefined(swiper, swiper.originalParams.navigation, swiper.params.navigation, {
5015                nextEl: 'swiper-button-next',
5016                prevEl: 'swiper-button-prev'
5017            });
5018            if (!(params.nextEl || params.prevEl)) return;
5019            let nextEl = getEl(params.nextEl);
5020            let prevEl = getEl(params.prevEl);
5021            Object.assign(swiper.navigation, {
5022                nextEl,
5023                prevEl
5024            });
5025            nextEl = makeElementsArray(nextEl);
5026            prevEl = makeElementsArray(prevEl);
5027            const initButton = (el, dir) => {
5028                if (el) {
5029                    el.addEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
5030                }
5031                if (!swiper.enabled && el) {
5032                    el.classList.add(...params.lockClass.split(' '));
5033                }
5034            };
5035            nextEl.forEach(el => initButton(el, 'next'));
5036            prevEl.forEach(el => initButton(el, 'prev'));
5037        }
5038        function destroy() {
5039            let {
5040                nextEl,
5041                prevEl
5042            } = swiper.navigation;
5043            nextEl = makeElementsArray(nextEl);
5044            prevEl = makeElementsArray(prevEl);
5045            const destroyButton = (el, dir) => {
5046                el.removeEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
5047                el.classList.remove(...swiper.params.navigation.disabledClass.split(' '));
5048            };
5049            nextEl.forEach(el => destroyButton(el, 'next'));
5050            prevEl.forEach(el => destroyButton(el, 'prev'));
5051        }
5052        on('init', () => {
5053            if (swiper.params.navigation.enabled === false) {
5054                // eslint-disable-next-line
5055                disable();
5056            } else {
5057                init();
5058                update();
5059            }
5060        });
5061        on('toEdge fromEdge lock unlock', () => {
5062            update();
5063        });
5064        on('destroy', () => {
5065            destroy();
5066        });
5067        on('enable disable', () => {
5068            let {
5069                nextEl,
5070                prevEl
5071            } = swiper.navigation;
5072            nextEl = makeElementsArray(nextEl);
5073            prevEl = makeElementsArray(prevEl);
5074            if (swiper.enabled) {
5075                update();
5076                return;
5077            }
5078            [...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.add(swiper.params.navigation.lockClass));
5079        });
5080        on('click', (_s, e) => {
5081            let {
5082                nextEl,
5083                prevEl
5084            } = swiper.navigation;
5085            nextEl = makeElementsArray(nextEl);
5086            prevEl = makeElementsArray(prevEl);
5087            const targetEl = e.target;
5088            if (swiper.params.navigation.hideOnClick && !prevEl.includes(targetEl) && !nextEl.includes(targetEl)) {
5089                if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return;
5090                let isHidden;
5091                if (nextEl.length) {
5092                    isHidden = nextEl[0].classList.contains(swiper.params.navigation.hiddenClass);
5093                } else if (prevEl.length) {
5094                    isHidden = prevEl[0].classList.contains(swiper.params.navigation.hiddenClass);
5095                }
5096                if (isHidden === true) {
5097                    emit('navigationShow');
5098                } else {
5099                    emit('navigationHide');
5100                }
5101                [...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.toggle(swiper.params.navigation.hiddenClass));
5102            }
5103        });
5104        const enable = () => {
5105            swiper.el.classList.remove(...swiper.params.navigation.navigationDisabledClass.split(' '));
5106            init();
5107            update();
5108        };
5109        const disable = () => {
5110            swiper.el.classList.add(...swiper.params.navigation.navigationDisabledClass.split(' '));
5111            destroy();
5112        };
5113        Object.assign(swiper.navigation, {
5114            enable,
5115            disable,
5116            update,
5117            init,
5118            destroy
5119        });
5120    }
5121
5122    function classesToSelector(classes) {
5123        if (classes === void 0) {
5124            classes = '';
5125        }
5126        return `.${classes.trim().replace(/([\.:!+\/])/g, '\\$1') // eslint-disable-line
5127            .replace(/ /g, '.')}`;
5128    }
5129
5130    function Pagination(_ref) {
5131        let {
5132            swiper,
5133            extendParams,
5134            on,
5135            emit
5136        } = _ref;
5137        const pfx = 'swiper-pagination';
5138        extendParams({
5139            pagination: {
5140                el: null,
5141                bulletElement: 'span',
5142                clickable: false,
5143                hideOnClick: false,
5144                renderBullet: null,
5145                renderProgressbar: null,
5146                renderFraction: null,
5147                renderCustom: null,
5148                progressbarOpposite: false,
5149                type: 'bullets',
5150                // 'bullets' or 'progressbar' or 'fraction' or 'custom'
5151                dynamicBullets: false,
5152                dynamicMainBullets: 1,
5153                formatFractionCurrent: number => number,
5154                formatFractionTotal: number => number,
5155                bulletClass: `${pfx}-bullet`,
5156                bulletActiveClass: `${pfx}-bullet-active`,
5157                modifierClass: `${pfx}-`,
5158                currentClass: `${pfx}-current`,
5159                totalClass: `${pfx}-total`,
5160                hiddenClass: `${pfx}-hidden`,
5161                progressbarFillClass: `${pfx}-progressbar-fill`,
5162                progressbarOppositeClass: `${pfx}-progressbar-opposite`,
5163                clickableClass: `${pfx}-clickable`,
5164                lockClass: `${pfx}-lock`,
5165                horizontalClass: `${pfx}-horizontal`,
5166                verticalClass: `${pfx}-vertical`,
5167                paginationDisabledClass: `${pfx}-disabled`
5168            }
5169        });
5170        swiper.pagination = {
5171            el: null,
5172            bullets: []
5173        };
5174        let bulletSize;
5175        let dynamicBulletIndex = 0;
5176        const makeElementsArray = el => (Array.isArray(el) ? el : [el]).filter(e => !!e);
5177        function isPaginationDisabled() {
5178            return !swiper.params.pagination.el || !swiper.pagination.el || Array.isArray(swiper.pagination.el) && swiper.pagination.el.length === 0;
5179        }
5180        function setSideBullets(bulletEl, position) {
5181            const {
5182                bulletActiveClass
5183            } = swiper.params.pagination;
5184            if (!bulletEl) return;
5185            bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`];
5186            if (bulletEl) {
5187                bulletEl.classList.add(`${bulletActiveClass}-${position}`);
5188                bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`];
5189                if (bulletEl) {
5190                    bulletEl.classList.add(`${bulletActiveClass}-${position}-${position}`);
5191                }
5192            }
5193        }
5194        function onBulletClick(e) {
5195            const bulletEl = e.target.closest(classesToSelector(swiper.params.pagination.bulletClass));
5196            if (!bulletEl) {
5197                return;
5198            }
5199            e.preventDefault();
5200            const index = elementIndex(bulletEl) * swiper.params.slidesPerGroup;
5201            if (swiper.params.loop) {
5202                if (swiper.realIndex === index) return;
5203                const realIndex = swiper.realIndex;
5204                const newSlideIndex = swiper.getSlideIndexByData(index);
5205                const currentSlideIndex = swiper.getSlideIndexByData(swiper.realIndex);
5206                const loopFix = dir => {
5207                    const indexBeforeLoopFix = swiper.activeIndex;
5208                    swiper.loopFix({
5209                        direction: dir,
5210                        activeSlideIndex: newSlideIndex,
5211                        slideTo: false
5212                    });
5213                    const indexAfterFix = swiper.activeIndex;
5214                    if (indexBeforeLoopFix === indexAfterFix) {
5215                        swiper.slideToLoop(realIndex, 0, false, true);
5216                    }
5217                };
5218                if (newSlideIndex > swiper.slides.length - swiper.loopedSlides) {
5219                    loopFix(newSlideIndex > currentSlideIndex ? 'next' : 'prev');
5220                } else if (swiper.params.centeredSlides) {
5221                    const slidesPerView = swiper.params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(swiper.params.slidesPerView, 10));
5222                    if (newSlideIndex < Math.floor(slidesPerView / 2)) {
5223                        loopFix('prev');
5224                    }
5225                }
5226                swiper.slideToLoop(index);
5227            } else {
5228                swiper.slideTo(index);
5229            }
5230        }
5231        function update() {
5232            // Render || Update Pagination bullets/items
5233            const rtl = swiper.rtl;
5234            const params = swiper.params.pagination;
5235            if (isPaginationDisabled()) return;
5236            let el = swiper.pagination.el;
5237            el = makeElementsArray(el);
5238            // Current/Total
5239            let current;
5240            let previousIndex;
5241            const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
5242            const total = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
5243            if (swiper.params.loop) {
5244                previousIndex = swiper.previousRealIndex || 0;
5245                current = swiper.params.slidesPerGroup > 1 ? Math.floor(swiper.realIndex / swiper.params.slidesPerGroup) : swiper.realIndex;
5246            } else if (typeof swiper.snapIndex !== 'undefined') {
5247                current = swiper.snapIndex;
5248                previousIndex = swiper.previousSnapIndex;
5249            } else {
5250                previousIndex = swiper.previousIndex || 0;
5251                current = swiper.activeIndex || 0;
5252            }
5253            // Types
5254            if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) {
5255                const bullets = swiper.pagination.bullets;
5256                let firstIndex;
5257                let lastIndex;
5258                let midIndex;
5259                if (params.dynamicBullets) {
5260                    bulletSize = elementOuterSize(bullets[0], swiper.isHorizontal() ? 'width' : 'height', true);
5261                    el.forEach(subEl => {
5262                        subEl.style[swiper.isHorizontal() ? 'width' : 'height'] = `${bulletSize * (params.dynamicMainBullets + 4)}px`;
5263                    });
5264                    if (params.dynamicMainBullets > 1 && previousIndex !== undefined) {
5265                        dynamicBulletIndex += current - (previousIndex || 0);
5266                        if (dynamicBulletIndex > params.dynamicMainBullets - 1) {
5267                            dynamicBulletIndex = params.dynamicMainBullets - 1;
5268                        } else if (dynamicBulletIndex < 0) {
5269                            dynamicBulletIndex = 0;
5270                        }
5271                    }
5272                    firstIndex = Math.max(current - dynamicBulletIndex, 0);
5273                    lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1);
5274                    midIndex = (lastIndex + firstIndex) / 2;
5275                }
5276                bullets.forEach(bulletEl => {
5277                    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();
5278                    bulletEl.classList.remove(...classesToRemove);
5279                });
5280                if (el.length > 1) {
5281                    bullets.forEach(bullet => {
5282                        const bulletIndex = elementIndex(bullet);
5283                        if (bulletIndex === current) {
5284                            bullet.classList.add(...params.bulletActiveClass.split(' '));
5285                        } else if (swiper.isElement) {
5286                            bullet.setAttribute('part', 'bullet');
5287                        }
5288                        if (params.dynamicBullets) {
5289                            if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) {
5290                                bullet.classList.add(...`${params.bulletActiveClass}-main`.split(' '));
5291                            }
5292                            if (bulletIndex === firstIndex) {
5293                                setSideBullets(bullet, 'prev');
5294                            }
5295                            if (bulletIndex === lastIndex) {
5296                                setSideBullets(bullet, 'next');
5297                            }
5298                        }
5299                    });
5300                } else {
5301                    const bullet = bullets[current];
5302                    if (bullet) {
5303                        bullet.classList.add(...params.bulletActiveClass.split(' '));
5304                    }
5305                    if (swiper.isElement) {
vendor: 4,637 bytes, lines 5306-5387
5306                        bullets.forEach((bulletEl, bulletIndex) => {
5307                            bulletEl.setAttribute('part', bulletIndex === current ? 'bullet-active' : 'bullet');
5308                        });
5309                    }
5310                    if (params.dynamicBullets) {
5311                        const firstDisplayedBullet = bullets[firstIndex];
5312                        const lastDisplayedBullet = bullets[lastIndex];
5313                        for (let i = firstIndex; i <= lastIndex; i += 1) {
5314                            if (bullets[i]) {
5315                                bullets[i].classList.add(...`${params.bulletActiveClass}-main`.split(' '));
5316                            }
5317                        }
5318                        setSideBullets(firstDisplayedBullet, 'prev');
5319                        setSideBullets(lastDisplayedBullet, 'next');
5320                    }
5321                }
5322                if (params.dynamicBullets) {
5323                    const dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4);
5324                    const bulletsOffset = (bulletSize * dynamicBulletsLength - bulletSize) / 2 - midIndex * bulletSize;
5325                    const offsetProp = rtl ? 'right' : 'left';
5326                    bullets.forEach(bullet => {
5327                        bullet.style[swiper.isHorizontal() ? offsetProp : 'top'] = `${bulletsOffset}px`;
5328                    });
5329                }
5330            }
5331            el.forEach((subEl, subElIndex) => {
5332                if (params.type === 'fraction') {
5333                    subEl.querySelectorAll(classesToSelector(params.currentClass)).forEach(fractionEl => {
5334                        fractionEl.textContent = params.formatFractionCurrent(current + 1);
5335                    });
5336                    subEl.querySelectorAll(classesToSelector(params.totalClass)).forEach(totalEl => {
5337                        totalEl.textContent = params.formatFractionTotal(total);
5338                    });
5339                }
5340                if (params.type === 'progressbar') {
5341                    let progressbarDirection;
5342                    if (params.progressbarOpposite) {
5343                        progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal';
5344                    } else {
5345                        progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical';
5346                    }
5347                    const scale = (current + 1) / total;
5348                    let scaleX = 1;
5349                    let scaleY = 1;
5350                    if (progressbarDirection === 'horizontal') {
5351                        scaleX = scale;
5352                    } else {
5353                        scaleY = scale;
5354                    }
5355                    subEl.querySelectorAll(classesToSelector(params.progressbarFillClass)).forEach(progressEl => {
5356                        progressEl.style.transform = `translate3d(0,0,0) scaleX(${scaleX}) scaleY(${scaleY})`;
5357                        progressEl.style.transitionDuration = `${swiper.params.speed}ms`;
5358                    });
5359                }
5360                if (params.type === 'custom' && params.renderCustom) {
5361                    subEl.innerHTML = params.renderCustom(swiper, current + 1, total);
5362                    if (subElIndex === 0) emit('paginationRender', subEl);
5363                } else {
5364                    if (subElIndex === 0) emit('paginationRender', subEl);
5365                    emit('paginationUpdate', subEl);
5366                }
5367                if (swiper.params.watchOverflow && swiper.enabled) {
5368                    subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);
5369                }
5370            });
5371        }
5372        function render() {
5373            // Render Container
5374            const params = swiper.params.pagination;
5375            if (isPaginationDisabled()) return;
5376            const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
5377            let el = swiper.pagination.el;
5378            el = makeElementsArray(el);
5379            let paginationHTML = '';
5380            if (params.type === 'bullets') {
5381                let numberOfBullets = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
5382                if (swiper.params.freeMode && swiper.params.freeMode.enabled && numberOfBullets > slidesLength) {
5383                    numberOfBullets = slidesLength;
5384                }
5385                for (let i = 0; i < numberOfBullets; i += 1) {
5386                    if (params.renderBullet) {
5387                        paginationHTML += params.renderBullet.call(swi
vendor: 85,357 bytes, lines 5387-7448
5387per, i, params.bulletClass);
5388                    } else {
5389                        // prettier-ignore
5390                        paginationHTML += `<${params.bulletElement} ${swiper.isElement ? 'part="bullet"' : ''} class="${params.bulletClass}"></${params.bulletElement}>`;
5391                    }
5392                }
5393            }
5394            if (params.type === 'fraction') {
5395                if (params.renderFraction) {
5396                    paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass);
5397                } else {
5398                    paginationHTML = `<span class="${params.currentClass}"></span>` + ' / ' + `<span class="${params.totalClass}"></span>`;
5399                }
5400            }
5401            if (params.type === 'progressbar') {
5402                if (params.renderProgressbar) {
5403                    paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass);
5404                } else {
5405                    paginationHTML = `<span class="${params.progressbarFillClass}"></span>`;
5406                }
5407            }
5408            swiper.pagination.bullets = [];
5409            el.forEach(subEl => {
5410                if (params.type !== 'custom') {
5411                    subEl.innerHTML = paginationHTML || '';
5412                }
5413                if (params.type === 'bullets') {
5414                    swiper.pagination.bullets.push(...subEl.querySelectorAll(classesToSelector(params.bulletClass)));
5415                }
5416            });
5417            if (params.type !== 'custom') {
5418                emit('paginationRender', el[0]);
5419            }
5420        }
5421        function init() {
5422            swiper.params.pagination = createElementIfNotDefined(swiper, swiper.originalParams.pagination, swiper.params.pagination, {
5423                el: 'swiper-pagination'
5424            });
5425            const params = swiper.params.pagination;
5426            if (!params.el) return;
5427            let el;
5428            if (typeof params.el === 'string' && swiper.isElement) {
5429                el = swiper.el.querySelector(params.el);
5430            }
5431            if (!el && typeof params.el === 'string') {
5432                el = [...document.querySelectorAll(params.el)];
5433            }
5434            if (!el) {
5435                el = params.el;
5436            }
5437            if (!el || el.length === 0) return;
5438            if (swiper.params.uniqueNavElements && typeof params.el === 'string' && Array.isArray(el) && el.length > 1) {
5439                el = [...swiper.el.querySelectorAll(params.el)];
5440                // check if it belongs to another nested Swiper
5441                if (el.length > 1) {
5442                    el = el.filter(subEl => {
5443                        if (elementParents(subEl, '.swiper')[0] !== swiper.el) return false;
5444                        return true;
5445                    })[0];
5446                }
5447            }
5448            if (Array.isArray(el) && el.length === 1) el = el[0];
5449            Object.assign(swiper.pagination, {
5450                el
5451            });
5452            el = makeElementsArray(el);
5453            el.forEach(subEl => {
5454                if (params.type === 'bullets' && params.clickable) {
5455                    subEl.classList.add(...(params.clickableClass || '').split(' '));
5456                }
5457                subEl.classList.add(params.modifierClass + params.type);
5458                subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
5459                if (params.type === 'bullets' && params.dynamicBullets) {
5460                    subEl.classList.add(`${params.modifierClass}${params.type}-dynamic`);
5461                    dynamicBulletIndex = 0;
5462                    if (params.dynamicMainBullets < 1) {
5463                        params.dynamicMainBullets = 1;
5464                    }
5465                }
5466                if (params.type === 'progressbar' && params.progressbarOpposite) {
5467                    subEl.classList.add(params.progressbarOppositeClass);
5468                }
5469                if (params.clickable) {
5470                    subEl.addEventListener('click', onBulletClick);
5471                }
5472                if (!swiper.enabled) {
5473                    subEl.classList.add(params.lockClass);
5474                }
5475            });
5476        }
5477        function destroy() {
5478            const params = swiper.params.pagination;
5479            if (isPaginationDisabled()) return;
5480            let el = swiper.pagination.el;
5481            if (el) {
5482                el = makeElementsArray(el);
5483                el.forEach(subEl => {
5484                    subEl.classList.remove(params.hiddenClass);
5485                    subEl.classList.remove(params.modifierClass + params.type);
5486                    subEl.classList.remove(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
5487                    if (params.clickable) {
5488                        subEl.classList.remove(...(params.clickableClass || '').split(' '));
5489                        subEl.removeEventListener('click', onBulletClick);
5490                    }
5491                });
5492            }
5493            if (swiper.pagination.bullets) swiper.pagination.bullets.forEach(subEl => subEl.classList.remove(...params.bulletActiveClass.split(' ')));
5494        }
5495        on('changeDirection', () => {
5496            if (!swiper.pagination || !swiper.pagination.el) return;
5497            const params = swiper.params.pagination;
5498            let {
5499                el
5500            } = swiper.pagination;
5501            el = makeElementsArray(el);
5502            el.forEach(subEl => {
5503                subEl.classList.remove(params.horizontalClass, params.verticalClass);
5504                subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
5505            });
5506        });
5507        on('init', () => {
5508            if (swiper.params.pagination.enabled === false) {
5509                // eslint-disable-next-line
5510                disable();
5511            } else {
5512                init();
5513                render();
5514                update();
5515            }
5516        });
5517        on('activeIndexChange', () => {
5518            if (typeof swiper.snapIndex === 'undefined') {
5519                update();
5520            }
5521        });
5522        on('snapIndexChange', () => {
5523            update();
5524        });
5525        on('snapGridLengthChange', () => {
5526            render();
5527            update();
5528        });
5529        on('destroy', () => {
5530            destroy();
5531        });
5532        on('enable disable', () => {
5533            let {
5534                el
5535            } = swiper.pagination;
5536            if (el) {
5537                el = makeElementsArray(el);
5538                el.forEach(subEl => subEl.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.pagination.lockClass));
5539            }
5540        });
5541        on('lock unlock', () => {
5542            update();
5543        });
5544        on('click', (_s, e) => {
5545            const targetEl = e.target;
5546            const el = makeElementsArray(swiper.pagination.el);
5547            if (swiper.params.pagination.el && swiper.params.pagination.hideOnClick && el && el.length > 0 && !targetEl.classList.contains(swiper.params.pagination.bulletClass)) {
5548                if (swiper.navigation && (swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl || swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl)) return;
5549                const isHidden = el[0].classList.contains(swiper.params.pagination.hiddenClass);
5550                if (isHidden === true) {
5551                    emit('paginationShow');
5552                } else {
5553                    emit('paginationHide');
5554                }
5555                el.forEach(subEl => subEl.classList.toggle(swiper.params.pagination.hiddenClass));
5556            }
5557        });
5558        const enable = () => {
5559            swiper.el.classList.remove(swiper.params.pagination.paginationDisabledClass);
5560            let {
5561                el
5562            } = swiper.pagination;
5563            if (el) {
5564                el = makeElementsArray(el);
5565                el.forEach(subEl => subEl.classList.remove(swiper.params.pagination.paginationDisabledClass));
5566            }
5567            init();
5568            render();
5569            update();
5570        };
5571        const disable = () => {
5572            swiper.el.classList.add(swiper.params.pagination.paginationDisabledClass);
5573            let {
5574                el
5575            } = swiper.pagination;
5576            if (el) {
5577                el = makeElementsArray(el);
5578                el.forEach(subEl => subEl.classList.add(swiper.params.pagination.paginationDisabledClass));
5579            }
5580            destroy();
5581        };
5582        Object.assign(swiper.pagination, {
5583            enable,
5584            disable,
5585            render,
5586            update,
5587            init,
5588            destroy
5589        });
5590    }
5591
5592    function Scrollbar(_ref) {
5593        let {
5594            swiper,
5595            extendParams,
5596            on,
5597            emit
5598        } = _ref;
5599        const document = getDocument();
5600        let isTouched = false;
5601        let timeout = null;
5602        let dragTimeout = null;
5603        let dragStartPos;
5604        let dragSize;
5605        let trackSize;
5606        let divider;
5607        extendParams({
5608            scrollbar: {
5609                el: null,
5610                dragSize: 'auto',
5611                hide: false,
5612                draggable: false,
5613                snapOnRelease: true,
5614                lockClass: 'swiper-scrollbar-lock',
5615                dragClass: 'swiper-scrollbar-drag',
5616                scrollbarDisabledClass: 'swiper-scrollbar-disabled',
5617                horizontalClass: `swiper-scrollbar-horizontal`,
5618                verticalClass: `swiper-scrollbar-vertical`
5619            }
5620        });
5621        swiper.scrollbar = {
5622            el: null,
5623            dragEl: null
5624        };
5625        function setTranslate() {
5626            if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;
5627            const {
5628                scrollbar,
5629                rtlTranslate: rtl
5630            } = swiper;
5631            const {
5632                dragEl,
5633                el
5634            } = scrollbar;
5635            const params = swiper.params.scrollbar;
5636            const progress = swiper.params.loop ? swiper.progressLoop : swiper.progress;
5637            let newSize = dragSize;
5638            let newPos = (trackSize - dragSize) * progress;
5639            if (rtl) {
5640                newPos = -newPos;
5641                if (newPos > 0) {
5642                    newSize = dragSize - newPos;
5643                    newPos = 0;
5644                } else if (-newPos + dragSize > trackSize) {
5645                    newSize = trackSize + newPos;
5646                }
5647            } else if (newPos < 0) {
5648                newSize = dragSize + newPos;
5649                newPos = 0;
5650            } else if (newPos + dragSize > trackSize) {
5651                newSize = trackSize - newPos;
5652            }
5653            if (swiper.isHorizontal()) {
5654                dragEl.style.transform = `translate3d(${newPos}px, 0, 0)`;
5655                dragEl.style.width = `${newSize}px`;
5656            } else {
5657                dragEl.style.transform = `translate3d(0px, ${newPos}px, 0)`;
5658                dragEl.style.height = `${newSize}px`;
5659            }
5660            if (params.hide) {
5661                clearTimeout(timeout);
5662                el.style.opacity = 1;
5663                timeout = setTimeout(() => {
5664                    el.style.opacity = 0;
5665                    el.style.transitionDuration = '400ms';
5666                }, 1000);
5667            }
5668        }
5669        function setTransition(duration) {
5670            if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;
5671            swiper.scrollbar.dragEl.style.transitionDuration = `${duration}ms`;
5672        }
5673        function updateSize() {
5674            if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;
5675            const {
5676                scrollbar
5677            } = swiper;
5678            const {
5679                dragEl,
5680                el
5681            } = scrollbar;
5682            dragEl.style.width = '';
5683            dragEl.style.height = '';
5684            trackSize = swiper.isHorizontal() ? el.offsetWidth : el.offsetHeight;
5685            divider = swiper.size / (swiper.virtualSize + swiper.params.slidesOffsetBefore - (swiper.params.centeredSlides ? swiper.snapGrid[0] : 0));
5686            if (swiper.params.scrollbar.dragSize === 'auto') {
5687                dragSize = trackSize * divider;
5688            } else {
5689                dragSize = parseInt(swiper.params.scrollbar.dragSize, 10);
5690            }
5691            if (swiper.isHorizontal()) {
5692                dragEl.style.width = `${dragSize}px`;
5693            } else {
5694                dragEl.style.height = `${dragSize}px`;
5695            }
5696            if (divider >= 1) {
5697                el.style.display = 'none';
5698            } else {
5699                el.style.display = '';
5700            }
5701            if (swiper.params.scrollbar.hide) {
5702                el.style.opacity = 0;
5703            }
5704            if (swiper.params.watchOverflow && swiper.enabled) {
5705                scrollbar.el.classList[swiper.isLocked ? 'add' : 'remove'](swiper.params.scrollbar.lockClass);
5706            }
5707        }
5708        function getPointerPosition(e) {
5709            return swiper.isHorizontal() ? e.clientX : e.clientY;
5710        }
5711        function setDragPosition(e) {
5712            const {
5713                scrollbar,
5714                rtlTranslate: rtl
5715            } = swiper;
5716            const {
5717                el
5718            } = scrollbar;
5719            let positionRatio;
5720            positionRatio = (getPointerPosition(e) - elementOffset(el)[swiper.isHorizontal() ? 'left' : 'top'] - (dragStartPos !== null ? dragStartPos : dragSize / 2)) / (trackSize - dragSize);
5721            positionRatio = Math.max(Math.min(positionRatio, 1), 0);
5722            if (rtl) {
5723                positionRatio = 1 - positionRatio;
5724            }
5725            const position = swiper.minTranslate() + (swiper.maxTranslate() - swiper.minTranslate()) * positionRatio;
5726            swiper.updateProgress(position);
5727            swiper.setTranslate(position);
5728            swiper.updateActiveIndex();
5729            swiper.updateSlidesClasses();
5730        }
5731        function onDragStart(e) {
5732            const params = swiper.params.scrollbar;
5733            const {
5734                scrollbar,
5735                wrapperEl
5736            } = swiper;
5737            const {
5738                el,
5739                dragEl
5740            } = scrollbar;
5741            isTouched = true;
5742            dragStartPos = e.target === dragEl ? getPointerPosition(e) - e.target.getBoundingClientRect()[swiper.isHorizontal() ? 'left' : 'top'] : null;
5743            e.preventDefault();
5744            e.stopPropagation();
5745            wrapperEl.style.transitionDuration = '100ms';
5746            dragEl.style.transitionDuration = '100ms';
5747            setDragPosition(e);
5748            clearTimeout(dragTimeout);
5749            el.style.transitionDuration = '0ms';
5750            if (params.hide) {
5751                el.style.opacity = 1;
5752            }
5753            if (swiper.params.cssMode) {
5754                swiper.wrapperEl.style['scroll-snap-type'] = 'none';
5755            }
5756            emit('scrollbarDragStart', e);
5757        }
5758        function onDragMove(e) {
5759            const {
5760                scrollbar,
5761                wrapperEl
5762            } = swiper;
5763            const {
5764                el,
5765                dragEl
5766            } = scrollbar;
5767            if (!isTouched) return;
5768            if (e.preventDefault) e.preventDefault();else e.returnValue = false;
5769            setDragPosition(e);
5770            wrapperEl.style.transitionDuration = '0ms';
5771            el.style.transitionDuration = '0ms';
5772            dragEl.style.transitionDuration = '0ms';
5773            emit('scrollbarDragMove', e);
5774        }
5775        function onDragEnd(e) {
5776            const params = swiper.params.scrollbar;
5777            const {
5778                scrollbar,
5779                wrapperEl
5780            } = swiper;
5781            const {
5782                el
5783            } = scrollbar;
5784            if (!isTouched) return;
5785            isTouched = false;
5786            if (swiper.params.cssMode) {
5787                swiper.wrapperEl.style['scroll-snap-type'] = '';
5788                wrapperEl.style.transitionDuration = '';
5789            }
5790            if (params.hide) {
5791                clearTimeout(dragTimeout);
5792                dragTimeout = nextTick(() => {
5793                    el.style.opacity = 0;
5794                    el.style.transitionDuration = '400ms';
5795                }, 1000);
5796            }
5797            emit('scrollbarDragEnd', e);
5798            if (params.snapOnRelease) {
5799                swiper.slideToClosest();
5800            }
5801        }
5802        function events(method) {
5803            const {
5804                scrollbar,
5805                params
5806            } = swiper;
5807            const el = scrollbar.el;
5808            if (!el) return;
5809            const target = el;
5810            const activeListener = params.passiveListeners ? {
5811                passive: false,
5812                capture: false
5813            } : false;
5814            const passiveListener = params.passiveListeners ? {
5815                passive: true,
5816                capture: false
5817            } : false;
5818            if (!target) return;
5819            const eventMethod = method === 'on' ? 'addEventListener' : 'removeEventListener';
5820            target[eventMethod]('pointerdown', onDragStart, activeListener);
5821            document[eventMethod]('pointermove', onDragMove, activeListener);
5822            document[eventMethod]('pointerup', onDragEnd, passiveListener);
5823        }
5824        function enableDraggable() {
5825            if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;
5826            events('on');
5827        }
5828        function disableDraggable() {
5829            if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;
5830            events('off');
5831        }
5832        function init() {
5833            const {
5834                scrollbar,
5835                el: swiperEl
5836            } = swiper;
5837            swiper.params.scrollbar = createElementIfNotDefined(swiper, swiper.originalParams.scrollbar, swiper.params.scrollbar, {
5838                el: 'swiper-scrollbar'
5839            });
5840            const params = swiper.params.scrollbar;
5841            if (!params.el) return;
5842            let el;
5843            if (typeof params.el === 'string' && swiper.isElement) {
5844                el = swiper.el.querySelector(params.el);
5845            }
5846            if (!el && typeof params.el === 'string') {
5847                el = document.querySelectorAll(params.el);
5848            } else if (!el) {
5849                el = params.el;
5850            }
5851            if (swiper.params.uniqueNavElements && typeof params.el === 'string' && el.length > 1 && swiperEl.querySelectorAll(params.el).length === 1) {
5852                el = swiperEl.querySelector(params.el);
5853            }
5854            if (el.length > 0) el = el[0];
5855            el.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
5856            let dragEl;
5857            if (el) {
5858                dragEl = el.querySelector(`.${swiper.params.scrollbar.dragClass}`);
5859                if (!dragEl) {
5860                    dragEl = createElement('div', swiper.params.scrollbar.dragClass);
5861                    el.append(dragEl);
5862                }
5863            }
5864            Object.assign(scrollbar, {
5865                el,
5866                dragEl
5867            });
5868            if (params.draggable) {
5869                enableDraggable();
5870            }
5871            if (el) {
5872                el.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.scrollbar.lockClass);
5873            }
5874        }
5875        function destroy() {
5876            const params = swiper.params.scrollbar;
5877            const el = swiper.scrollbar.el;
5878            if (el) {
5879                el.classList.remove(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
5880            }
5881            disableDraggable();
5882        }
5883        on('init', () => {
5884            if (swiper.params.scrollbar.enabled === false) {
5885                // eslint-disable-next-line
5886                disable();
5887            } else {
5888                init();
5889                updateSize();
5890                setTranslate();
5891            }
5892        });
5893        on('update resize observerUpdate lock unlock', () => {
5894            updateSize();
5895        });
5896        on('setTranslate', () => {
5897            setTranslate();
5898        });
5899        on('setTransition', (_s, duration) => {
5900            setTransition(duration);
5901        });
5902        on('enable disable', () => {
5903            const {
5904                el
5905            } = swiper.scrollbar;
5906            if (el) {
5907                el.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.scrollbar.lockClass);
5908            }
5909        });
5910        on('destroy', () => {
5911            destroy();
5912        });
5913        const enable = () => {
5914            swiper.el.classList.remove(swiper.params.scrollbar.scrollbarDisabledClass);
5915            if (swiper.scrollbar.el) {
5916                swiper.scrollbar.el.classList.remove(swiper.params.scrollbar.scrollbarDisabledClass);
5917            }
5918            init();
5919            updateSize();
5920            setTranslate();
5921        };
5922        const disable = () => {
5923            swiper.el.classList.add(swiper.params.scrollbar.scrollbarDisabledClass);
5924            if (swiper.scrollbar.el) {
5925                swiper.scrollbar.el.classList.add(swiper.params.scrollbar.scrollbarDisabledClass);
5926            }
5927            destroy();
5928        };
5929        Object.assign(swiper.scrollbar, {
5930            enable,
5931            disable,
5932            updateSize,
5933            setTranslate,
5934            init,
5935            destroy
5936        });
5937    }
5938
5939    function Parallax(_ref) {
5940        let {
5941            swiper,
5942            extendParams,
5943            on
5944        } = _ref;
5945        extendParams({
5946            parallax: {
5947                enabled: false
5948            }
5949        });
5950        const elementsSelector = '[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]';
5951        const setTransform = (el, progress) => {
5952            const {
5953                rtl
5954            } = swiper;
5955            const rtlFactor = rtl ? -1 : 1;
5956            const p = el.getAttribute('data-swiper-parallax') || '0';
5957            let x = el.getAttribute('data-swiper-parallax-x');
5958            let y = el.getAttribute('data-swiper-parallax-y');
5959            const scale = el.getAttribute('data-swiper-parallax-scale');
5960            const opacity = el.getAttribute('data-swiper-parallax-opacity');
5961            const rotate = el.getAttribute('data-swiper-parallax-rotate');
5962            if (x || y) {
5963                x = x || '0';
5964                y = y || '0';
5965            } else if (swiper.isHorizontal()) {
5966                x = p;
5967                y = '0';
5968            } else {
5969                y = p;
5970                x = '0';
5971            }
5972            if (x.indexOf('%') >= 0) {
5973                x = `${parseInt(x, 10) * progress * rtlFactor}%`;
5974            } else {
5975                x = `${x * progress * rtlFactor}px`;
5976            }
5977            if (y.indexOf('%') >= 0) {
5978                y = `${parseInt(y, 10) * progress}%`;
5979            } else {
5980                y = `${y * progress}px`;
5981            }
5982            if (typeof opacity !== 'undefined' && opacity !== null) {
5983                const currentOpacity = opacity - (opacity - 1) * (1 - Math.abs(progress));
5984                el.style.opacity = currentOpacity;
5985            }
5986            let transform = `translate3d(${x}, ${y}, 0px)`;
5987            if (typeof scale !== 'undefined' && scale !== null) {
5988                const currentScale = scale - (scale - 1) * (1 - Math.abs(progress));
5989                transform += ` scale(${currentScale})`;
5990            }
5991            if (rotate && typeof rotate !== 'undefined' && rotate !== null) {
5992                const currentRotate = rotate * progress * -1;
5993                transform += ` rotate(${currentRotate}deg)`;
5994            }
5995            el.style.transform = transform;
5996        };
5997        const setTranslate = () => {
5998            const {
5999                el,
6000                slides,
6001                progress,
6002                snapGrid,
6003                isElement
6004            } = swiper;
6005            const elements = elementChildren(el, elementsSelector);
6006            if (swiper.isElement) {
6007                elements.push(...elementChildren(swiper.hostEl, elementsSelector));
6008            }
6009            elements.forEach(subEl => {
6010                setTransform(subEl, progress);
6011            });
6012            slides.forEach((slideEl, slideIndex) => {
6013                let slideProgress = slideEl.progress;
6014                if (swiper.params.slidesPerGroup > 1 && swiper.params.slidesPerView !== 'auto') {
6015                    slideProgress += Math.ceil(slideIndex / 2) - progress * (snapGrid.length - 1);
6016                }
6017                slideProgress = Math.min(Math.max(slideProgress, -1), 1);
6018                slideEl.querySelectorAll(`${elementsSelector}, [data-swiper-parallax-rotate]`).forEach(subEl => {
6019                    setTransform(subEl, slideProgress);
6020                });
6021            });
6022        };
6023        const setTransition = function (duration) {
6024            if (duration === void 0) {
6025                duration = swiper.params.speed;
6026            }
6027            const {
6028                el,
6029                hostEl
6030            } = swiper;
6031            const elements = [...el.querySelectorAll(elementsSelector)];
6032            if (swiper.isElement) {
6033                elements.push(...hostEl.querySelectorAll(elementsSelector));
6034            }
6035            elements.forEach(parallaxEl => {
6036                let parallaxDuration = parseInt(parallaxEl.getAttribute('data-swiper-parallax-duration'), 10) || duration;
6037                if (duration === 0) parallaxDuration = 0;
6038                parallaxEl.style.transitionDuration = `${parallaxDuration}ms`;
6039            });
6040        };
6041        on('beforeInit', () => {
6042            if (!swiper.params.parallax.enabled) return;
6043            swiper.params.watchSlidesProgress = true;
6044            swiper.originalParams.watchSlidesProgress = true;
6045        });
6046        on('init', () => {
6047            if (!swiper.params.parallax.enabled) return;
6048            setTranslate();
6049        });
6050        on('setTranslate', () => {
6051            if (!swiper.params.parallax.enabled) return;
6052            setTranslate();
6053        });
6054        on('setTransition', (_swiper, duration) => {
6055            if (!swiper.params.parallax.enabled) return;
6056            setTransition(duration);
6057        });
6058    }
6059
6060    function Zoom(_ref) {
6061        let {
6062            swiper,
6063            extendParams,
6064            on,
6065            emit
6066        } = _ref;
6067        const window = getWindow();
6068        extendParams({
6069            zoom: {
6070                enabled: false,
6071                maxRatio: 3,
6072                minRatio: 1,
6073                toggle: true,
6074                containerClass: 'swiper-zoom-container',
6075                zoomedSlideClass: 'swiper-slide-zoomed'
6076            }
6077        });
6078        swiper.zoom = {
6079            enabled: false
6080        };
6081        let currentScale = 1;
6082        let isScaling = false;
6083        let fakeGestureTouched;
6084        let fakeGestureMoved;
6085        const evCache = [];
6086        const gesture = {
6087            originX: 0,
6088            originY: 0,
6089            slideEl: undefined,
6090            slideWidth: undefined,
6091            slideHeight: undefined,
6092            imageEl: undefined,
6093            imageWrapEl: undefined,
6094            maxRatio: 3
6095        };
6096        const image = {
6097            isTouched: undefined,
6098            isMoved: undefined,
6099            currentX: undefined,
6100            currentY: undefined,
6101            minX: undefined,
6102            minY: undefined,
6103            maxX: undefined,
6104            maxY: undefined,
6105            width: undefined,
6106            height: undefined,
6107            startX: undefined,
6108            startY: undefined,
6109            touchesStart: {},
6110            touchesCurrent: {}
6111        };
6112        const velocity = {
6113            x: undefined,
6114            y: undefined,
6115            prevPositionX: undefined,
6116            prevPositionY: undefined,
6117            prevTime: undefined
6118        };
6119        let scale = 1;
6120        Object.defineProperty(swiper.zoom, 'scale', {
6121            get() {
6122                return scale;
6123            },
6124            set(value) {
6125                if (scale !== value) {
6126                    const imageEl = gesture.imageEl;
6127                    const slideEl = gesture.slideEl;
6128                    emit('zoomChange', value, imageEl, slideEl);
6129                }
6130                scale = value;
6131            }
6132        });
6133        function getDistanceBetweenTouches() {
6134            if (evCache.length < 2) return 1;
6135            const x1 = evCache[0].pageX;
6136            const y1 = evCache[0].pageY;
6137            const x2 = evCache[1].pageX;
6138            const y2 = evCache[1].pageY;
6139            const distance = Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2);
6140            return distance;
6141        }
6142        function getScaleOrigin() {
6143            if (evCache.length < 2) return {
6144                x: null,
6145                y: null
6146            };
6147            const box = gesture.imageEl.getBoundingClientRect();
6148            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];
6149        }
6150        function getSlideSelector() {
6151            return swiper.isElement ? `swiper-slide` : `.${swiper.params.slideClass}`;
6152        }
6153        function eventWithinSlide(e) {
6154            const slideSelector = getSlideSelector();
6155            if (e.target.matches(slideSelector)) return true;
6156            if (swiper.slides.filter(slideEl => slideEl.contains(e.target)).length > 0) return true;
6157            return false;
6158        }
6159        function eventWithinZoomContainer(e) {
6160            const selector = `.${swiper.params.zoom.containerClass}`;
6161            if (e.target.matches(selector)) return true;
6162            if ([...swiper.hostEl.querySelectorAll(selector)].filter(containerEl => containerEl.contains(e.target)).length > 0) return true;
6163            return false;
6164        }
6165
6166        // Events
6167        function onGestureStart(e) {
6168            if (e.pointerType === 'mouse') {
6169                evCache.splice(0, evCache.length);
6170            }
6171            if (!eventWithinSlide(e)) return;
6172            const params = swiper.params.zoom;
6173            fakeGestureTouched = false;
6174            fakeGestureMoved = false;
6175            evCache.push(e);
6176            if (evCache.length < 2) {
6177                return;
6178            }
6179            fakeGestureTouched = true;
6180            gesture.scaleStart = getDistanceBetweenTouches();
6181            if (!gesture.slideEl) {
6182                gesture.slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`);
6183                if (!gesture.slideEl) gesture.slideEl = swiper.slides[swiper.activeIndex];
6184                let imageEl = gesture.slideEl.querySelector(`.${params.containerClass}`);
6185                if (imageEl) {
6186                    imageEl = imageEl.querySelectorAll('picture, img, svg, canvas, .swiper-zoom-target')[0];
6187                }
6188                gesture.imageEl = imageEl;
6189                if (imageEl) {
6190                    gesture.imageWrapEl = elementParents(gesture.imageEl, `.${params.containerClass}`)[0];
6191                } else {
6192                    gesture.imageWrapEl = undefined;
6193                }
6194                if (!gesture.imageWrapEl) {
6195                    gesture.imageEl = undefined;
6196                    return;
6197                }
6198                gesture.maxRatio = gesture.imageWrapEl.getAttribute('data-swiper-zoom') || params.maxRatio;
6199            }
6200            if (gesture.imageEl) {
6201                const [originX, originY] = getScaleOrigin();
6202                gesture.originX = originX;
6203                gesture.originY = originY;
6204                gesture.imageEl.style.transitionDuration = '0ms';
6205            }
6206            isScaling = true;
6207        }
6208        function onGestureChange(e) {
6209            if (!eventWithinSlide(e)) return;
6210            const params = swiper.params.zoom;
6211            const zoom = swiper.zoom;
6212            const pointerIndex = evCache.findIndex(cachedEv => cachedEv.pointerId === e.pointerId);
6213            if (pointerIndex >= 0) evCache[pointerIndex] = e;
6214            if (evCache.length < 2) {
6215                return;
6216            }
6217            fakeGestureMoved = true;
6218            gesture.scaleMove = getDistanceBetweenTouches();
6219            if (!gesture.imageEl) {
6220                return;
6221            }
6222            zoom.scale = gesture.scaleMove / gesture.scaleStart * currentScale;
6223            if (zoom.scale > gesture.maxRatio) {
6224                zoom.scale = gesture.maxRatio - 1 + (zoom.scale - gesture.maxRatio + 1) ** 0.5;
6225            }
6226            if (zoom.scale < params.minRatio) {
6227                zoom.scale = params.minRatio + 1 - (params.minRatio - zoom.scale + 1) ** 0.5;
6228            }
6229            gesture.imageEl.style.transform = `translate3d(0,0,0) scale(${zoom.scale})`;
6230        }
6231        function onGestureEnd(e) {
6232            if (!eventWithinSlide(e)) return;
6233            if (e.pointerType === 'mouse' && e.type === 'pointerout') return;
6234            const params = swiper.params.zoom;
6235            const zoom = swiper.zoom;
6236            const pointerIndex = evCache.findIndex(cachedEv => cachedEv.pointerId === e.pointerId);
6237            if (pointerIndex >= 0) evCache.splice(pointerIndex, 1);
6238            if (!fakeGestureTouched || !fakeGestureMoved) {
6239                return;
6240            }
6241            fakeGestureTouched = false;
6242            fakeGestureMoved = false;
6243            if (!gesture.imageEl) return;
6244            zoom.scale = Math.max(Math.min(zoom.scale, gesture.maxRatio), params.minRatio);
6245            gesture.imageEl.style.transitionDuration = `${swiper.params.speed}ms`;
6246            gesture.imageEl.style.transform = `translate3d(0,0,0) scale(${zoom.scale})`;
6247            currentScale = zoom.scale;
6248            isScaling = false;
6249            if (zoom.scale > 1 && gesture.slideEl) {
6250                gesture.slideEl.classList.add(`${params.zoomedSlideClass}`);
6251            } else if (zoom.scale <= 1 && gesture.slideEl) {
6252                gesture.slideEl.classList.remove(`${params.zoomedSlideClass}`);
6253            }
6254            if (zoom.scale === 1) {
6255                gesture.originX = 0;
6256                gesture.originY = 0;
6257                gesture.slideEl = undefined;
6258            }
6259        }
6260        function onTouchStart(e) {
6261            const device = swiper.device;
6262            if (!gesture.imageEl) return;
6263            if (image.isTouched) return;
6264            if (device.android && e.cancelable) e.preventDefault();
6265            image.isTouched = true;
6266            const event = evCache.length > 0 ? evCache[0] : e;
6267            image.touchesStart.x = event.pageX;
6268            image.touchesStart.y = event.pageY;
6269        }
6270        function onTouchMove(e) {
6271            if (!eventWithinSlide(e) || !eventWithinZoomContainer(e)) return;
6272            const zoom = swiper.zoom;
6273            if (!gesture.imageEl) return;
6274            if (!image.isTouched || !gesture.slideEl) return;
6275            if (!image.isMoved) {
6276                image.width = gesture.imageEl.offsetWidth;
6277                image.height = gesture.imageEl.offsetHeight;
6278                image.startX = getTranslate(gesture.imageWrapEl, 'x') || 0;
6279                image.startY = getTranslate(gesture.imageWrapEl, 'y') || 0;
6280                gesture.slideWidth = gesture.slideEl.offsetWidth;
6281                gesture.slideHeight = gesture.slideEl.offsetHeight;
6282                gesture.imageWrapEl.style.transitionDuration = '0ms';
6283            }
6284            // Define if we need image drag
6285            const scaledWidth = image.width * zoom.scale;
6286            const scaledHeight = image.height * zoom.scale;
6287            if (scaledWidth < gesture.slideWidth && scaledHeight < gesture.slideHeight) return;
6288            image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0);
6289            image.maxX = -image.minX;
6290            image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0);
6291            image.maxY = -image.minY;
6292            image.touchesCurrent.x = evCache.length > 0 ? evCache[0].pageX : e.pageX;
6293            image.touchesCurrent.y = evCache.length > 0 ? evCache[0].pageY : e.pageY;
6294            const touchesDiff = Math.max(Math.abs(image.touchesCurrent.x - image.touchesStart.x), Math.abs(image.touchesCurrent.y - image.touchesStart.y));
6295            if (touchesDiff > 5) {
6296                swiper.allowClick = false;
6297            }
6298            if (!image.isMoved && !isScaling) {
6299                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)) {
6300                    image.isTouched = false;
6301                    return;
6302                }
6303                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)) {
6304                    image.isTouched = false;
6305                    return;
6306                }
6307            }
6308            if (e.cancelable) {
6309                e.preventDefault();
6310            }
6311            e.stopPropagation();
6312            image.isMoved = true;
6313            const scaleRatio = (zoom.scale - currentScale) / (gesture.maxRatio - swiper.params.zoom.minRatio);
6314            const {
6315                originX,
6316                originY
6317            } = gesture;
6318            image.currentX = image.touchesCurrent.x - image.touchesStart.x + image.startX + scaleRatio * (image.width - originX * 2);
6319            image.currentY = image.touchesCurrent.y - image.touchesStart.y + image.startY + scaleRatio * (image.height - originY * 2);
6320            if (image.currentX < image.minX) {
6321                image.currentX = image.minX + 1 - (image.minX - image.currentX + 1) ** 0.8;
6322            }
6323            if (image.currentX > image.maxX) {
6324                image.currentX = image.maxX - 1 + (image.currentX - image.maxX + 1) ** 0.8;
6325            }
6326            if (image.currentY < image.minY) {
6327                image.currentY = image.minY + 1 - (image.minY - image.currentY + 1) ** 0.8;
6328            }
6329            if (image.currentY > image.maxY) {
6330                image.currentY = image.maxY - 1 + (image.currentY - image.maxY + 1) ** 0.8;
6331            }
6332
6333            // Velocity
6334            if (!velocity.prevPositionX) velocity.prevPositionX = image.touchesCurrent.x;
6335            if (!velocity.prevPositionY) velocity.prevPositionY = image.touchesCurrent.y;
6336            if (!velocity.prevTime) velocity.prevTime = Date.now();
6337            velocity.x = (image.touchesCurrent.x - velocity.prevPositionX) / (Date.now() - velocity.prevTime) / 2;
6338            velocity.y = (image.touchesCurrent.y - velocity.prevPositionY) / (Date.now() - velocity.prevTime) / 2;
6339            if (Math.abs(image.touchesCurrent.x - velocity.prevPositionX) < 2) velocity.x = 0;
6340            if (Math.abs(image.touchesCurrent.y - velocity.prevPositionY) < 2) velocity.y = 0;
6341            velocity.prevPositionX = image.touchesCurrent.x;
6342            velocity.prevPositionY = image.touchesCurrent.y;
6343            velocity.prevTime = Date.now();
6344            gesture.imageWrapEl.style.transform = `translate3d(${image.currentX}px, ${image.currentY}px,0)`;
6345        }
6346        function onTouchEnd() {
6347            const zoom = swiper.zoom;
6348            if (!gesture.imageEl) return;
6349            if (!image.isTouched || !image.isMoved) {
6350                image.isTouched = false;
6351                image.isMoved = false;
6352                return;
6353            }
6354            image.isTouched = false;
6355            image.isMoved = false;
6356            let momentumDurationX = 300;
6357            let momentumDurationY = 300;
6358            const momentumDistanceX = velocity.x * momentumDurationX;
6359            const newPositionX = image.currentX + momentumDistanceX;
6360            const momentumDistanceY = velocity.y * momentumDurationY;
6361            const newPositionY = image.currentY + momentumDistanceY;
6362
6363            // Fix duration
6364            if (velocity.x !== 0) momentumDurationX = Math.abs((newPositionX - image.currentX) / velocity.x);
6365            if (velocity.y !== 0) momentumDurationY = Math.abs((newPositionY - image.currentY) / velocity.y);
6366            const momentumDuration = Math.max(momentumDurationX, momentumDurationY);
6367            image.currentX = newPositionX;
6368            image.currentY = newPositionY;
6369            // Define if we need image drag
6370            const scaledWidth = image.width * zoom.scale;
6371            const scaledHeight = image.height * zoom.scale;
6372            image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0);
6373            image.maxX = -image.minX;
6374            image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0);
6375            image.maxY = -image.minY;
6376            image.currentX = Math.max(Math.min(image.currentX, image.maxX), image.minX);
6377            image.currentY = Math.max(Math.min(image.currentY, image.maxY), image.minY);
6378            gesture.imageWrapEl.style.transitionDuration = `${momentumDuration}ms`;
6379            gesture.imageWrapEl.style.transform = `translate3d(${image.currentX}px, ${image.currentY}px,0)`;
6380        }
6381        function onTransitionEnd() {
6382            const zoom = swiper.zoom;
6383            if (gesture.slideEl && swiper.activeIndex !== swiper.slides.indexOf(gesture.slideEl)) {
6384                if (gesture.imageEl) {
6385                    gesture.imageEl.style.transform = 'translate3d(0,0,0) scale(1)';
6386                }
6387                if (gesture.imageWrapEl) {
6388                    gesture.imageWrapEl.style.transform = 'translate3d(0,0,0)';
6389                }
6390                gesture.slideEl.classList.remove(`${swiper.params.zoom.zoomedSlideClass}`);
6391                zoom.scale = 1;
6392                currentScale = 1;
6393                gesture.slideEl = undefined;
6394                gesture.imageEl = undefined;
6395                gesture.imageWrapEl = undefined;
6396                gesture.originX = 0;
6397                gesture.originY = 0;
6398            }
6399        }
6400        function zoomIn(e) {
6401            const zoom = swiper.zoom;
6402            const params = swiper.params.zoom;
6403            if (!gesture.slideEl) {
6404                if (e && e.target) {
6405                    gesture.slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`);
6406                }
6407                if (!gesture.slideEl) {
6408                    if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) {
6409                        gesture.slideEl = elementChildren(swiper.slidesEl, `.${swiper.params.slideActiveClass}`)[0];
6410                    } else {
6411                        gesture.slideEl = swiper.slides[swiper.activeIndex];
6412                    }
6413                }
6414                let imageEl = gesture.slideEl.querySelector(`.${params.containerClass}`);
6415                if (imageEl) {
6416                    imageEl = imageEl.querySelectorAll('picture, img, svg, canvas, .swiper-zoom-target')[0];
6417                }
6418                gesture.imageEl = imageEl;
6419                if (imageEl) {
6420                    gesture.imageWrapEl = elementParents(gesture.imageEl, `.${params.containerClass}`)[0];
6421                } else {
6422                    gesture.imageWrapEl = undefined;
6423                }
6424            }
6425            if (!gesture.imageEl || !gesture.imageWrapEl) return;
6426            if (swiper.params.cssMode) {
6427                swiper.wrapperEl.style.overflow = 'hidden';
6428                swiper.wrapperEl.style.touchAction = 'none';
6429            }
6430            gesture.slideEl.classList.add(`${params.zoomedSlideClass}`);
6431            let touchX;
6432            let touchY;
6433            let offsetX;
6434            let offsetY;
6435            let diffX;
6436            let diffY;
6437            let translateX;
6438            let translateY;
6439            let imageWidth;
6440            let imageHeight;
6441            let scaledWidth;
6442            let scaledHeight;
6443            let translateMinX;
6444            let translateMinY;
6445            let translateMaxX;
6446            let translateMaxY;
6447            let slideWidth;
6448            let slideHeight;
6449            if (typeof image.touchesStart.x === 'undefined' && e) {
6450                touchX = e.pageX;
6451                touchY = e.pageY;
6452            } else {
6453                touchX = image.touchesStart.x;
6454                touchY = image.touchesStart.y;
6455            }
6456            const forceZoomRatio = typeof e === 'number' ? e : null;
6457            if (currentScale === 1 && forceZoomRatio) {
6458                touchX = undefined;
6459                touchY = undefined;
6460            }
6461            zoom.scale = forceZoomRatio || gesture.imageWrapEl.getAttribute('data-swiper-zoom') || params.maxRatio;
6462            currentScale = forceZoomRatio || gesture.imageWrapEl.getAttribute('data-swiper-zoom') || params.maxRatio;
6463            if (e && !(currentScale === 1 && forceZoomRatio)) {
6464                slideWidth = gesture.slideEl.offsetWidth;
6465                slideHeight = gesture.slideEl.offsetHeight;
6466                offsetX = elementOffset(gesture.slideEl).left + window.scrollX;
6467                offsetY = elementOffset(gesture.slideEl).top + window.scrollY;
6468                diffX = offsetX + slideWidth / 2 - touchX;
6469                diffY = offsetY + slideHeight / 2 - touchY;
6470                imageWidth = gesture.imageEl.offsetWidth;
6471                imageHeight = gesture.imageEl.offsetHeight;
6472                scaledWidth = imageWidth * zoom.scale;
6473                scaledHeight = imageHeight * zoom.scale;
6474                translateMinX = Math.min(slideWidth / 2 - scaledWidth / 2, 0);
6475                translateMinY = Math.min(slideHeight / 2 - scaledHeight / 2, 0);
6476                translateMaxX = -translateMinX;
6477                translateMaxY = -translateMinY;
6478                translateX = diffX * zoom.scale;
6479                translateY = diffY * zoom.scale;
6480                if (translateX < translateMinX) {
6481                    translateX = translateMinX;
6482                }
6483                if (translateX > translateMaxX) {
6484                    translateX = translateMaxX;
6485                }
6486                if (translateY < translateMinY) {
6487                    translateY = translateMinY;
6488                }
6489                if (translateY > translateMaxY) {
6490                    translateY = translateMaxY;
6491                }
6492            } else {
6493                translateX = 0;
6494                translateY = 0;
6495            }
6496            if (forceZoomRatio && zoom.scale === 1) {
6497                gesture.originX = 0;
6498                gesture.originY = 0;
6499            }
6500            gesture.imageWrapEl.style.transitionDuration = '300ms';
6501            gesture.imageWrapEl.style.transform = `translate3d(${translateX}px, ${translateY}px,0)`;
6502            gesture.imageEl.style.transitionDuration = '300ms';
6503            gesture.imageEl.style.transform = `translate3d(0,0,0) scale(${zoom.scale})`;
6504        }
6505        function zoomOut() {
6506            const zoom = swiper.zoom;
6507            const params = swiper.params.zoom;
6508            if (!gesture.slideEl) {
6509                if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) {
6510                    gesture.slideEl = elementChildren(swiper.slidesEl, `.${swiper.params.slideActiveClass}`)[0];
6511                } else {
6512                    gesture.slideEl = swiper.slides[swiper.activeIndex];
6513                }
6514                let imageEl = gesture.slideEl.querySelector(`.${params.containerClass}`);
6515                if (imageEl) {
6516                    imageEl = imageEl.querySelectorAll('picture, img, svg, canvas, .swiper-zoom-target')[0];
6517                }
6518                gesture.imageEl = imageEl;
6519                if (imageEl) {
6520                    gesture.imageWrapEl = elementParents(gesture.imageEl, `.${params.containerClass}`)[0];
6521                } else {
6522                    gesture.imageWrapEl = undefined;
6523                }
6524            }
6525            if (!gesture.imageEl || !gesture.imageWrapEl) return;
6526            if (swiper.params.cssMode) {
6527                swiper.wrapperEl.style.overflow = '';
6528                swiper.wrapperEl.style.touchAction = '';
6529            }
6530            zoom.scale = 1;
6531            currentScale = 1;
6532            gesture.imageWrapEl.style.transitionDuration = '300ms';
6533            gesture.imageWrapEl.style.transform = 'translate3d(0,0,0)';
6534            gesture.imageEl.style.transitionDuration = '300ms';
6535            gesture.imageEl.style.transform = 'translate3d(0,0,0) scale(1)';
6536            gesture.slideEl.classList.remove(`${params.zoomedSlideClass}`);
6537            gesture.slideEl = undefined;
6538            gesture.originX = 0;
6539            gesture.originY = 0;
6540        }
6541
6542        // Toggle Zoom
6543        function zoomToggle(e) {
6544            const zoom = swiper.zoom;
6545            if (zoom.scale && zoom.scale !== 1) {
6546                // Zoom Out
6547                zoomOut();
6548            } else {
6549                // Zoom In
6550                zoomIn(e);
6551            }
6552        }
6553        function getListeners() {
6554            const passiveListener = swiper.params.passiveListeners ? {
6555                passive: true,
6556                capture: false
6557            } : false;
6558            const activeListenerWithCapture = swiper.params.passiveListeners ? {
6559                passive: false,
6560                capture: true
6561            } : true;
6562            return {
6563                passiveListener,
6564                activeListenerWithCapture
6565            };
6566        }
6567
6568        // Attach/Detach Events
6569        function enable() {
6570            const zoom = swiper.zoom;
6571            if (zoom.enabled) return;
6572            zoom.enabled = true;
6573            const {
6574                passiveListener,
6575                activeListenerWithCapture
6576            } = getListeners();
6577
6578            // Scale image
6579            swiper.wrapperEl.addEventListener('pointerdown', onGestureStart, passiveListener);
6580            swiper.wrapperEl.addEventListener('pointermove', onGestureChange, activeListenerWithCapture);
6581            ['pointerup', 'pointercancel', 'pointerout'].forEach(eventName => {
6582                swiper.wrapperEl.addEventListener(eventName, onGestureEnd, passiveListener);
6583            });
6584
6585            // Move image
6586            swiper.wrapperEl.addEventListener('pointermove', onTouchMove, activeListenerWithCapture);
6587        }
6588        function disable() {
6589            const zoom = swiper.zoom;
6590            if (!zoom.enabled) return;
6591            zoom.enabled = false;
6592            const {
6593                passiveListener,
6594                activeListenerWithCapture
6595            } = getListeners();
6596
6597            // Scale image
6598            swiper.wrapperEl.removeEventListener('pointerdown', onGestureStart, passiveListener);
6599            swiper.wrapperEl.removeEventListener('pointermove', onGestureChange, activeListenerWithCapture);
6600            ['pointerup', 'pointercancel', 'pointerout'].forEach(eventName => {
6601                swiper.wrapperEl.removeEventListener(eventName, onGestureEnd, passiveListener);
6602            });
6603
6604            // Move image
6605            swiper.wrapperEl.removeEventListener('pointermove', onTouchMove, activeListenerWithCapture);
6606        }
6607        on('init', () => {
6608            if (swiper.params.zoom.enabled) {
6609                enable();
6610            }
6611        });
6612        on('destroy', () => {
6613            disable();
6614        });
6615        on('touchStart', (_s, e) => {
6616            if (!swiper.zoom.enabled) return;
6617            onTouchStart(e);
6618        });
6619        on('touchEnd', (_s, e) => {
6620            if (!swiper.zoom.enabled) return;
6621            onTouchEnd();
6622        });
6623        on('doubleTap', (_s, e) => {
6624            if (!swiper.animating && swiper.params.zoom.enabled && swiper.zoom.enabled && swiper.params.zoom.toggle) {
6625                zoomToggle(e);
6626            }
6627        });
6628        on('transitionEnd', () => {
6629            if (swiper.zoom.enabled && swiper.params.zoom.enabled) {
6630                onTransitionEnd();
6631            }
6632        });
6633        on('slideChange', () => {
6634            if (swiper.zoom.enabled && swiper.params.zoom.enabled && swiper.params.cssMode) {
6635                onTransitionEnd();
6636            }
6637        });
6638        Object.assign(swiper.zoom, {
6639            enable,
6640            disable,
6641            in: zoomIn,
6642            out: zoomOut,
6643            toggle: zoomToggle
6644        });
6645    }
6646
6647    /* eslint no-bitwise: ["error", { "allow": [">>"] }] */
6648    function Controller(_ref) {
6649        let {
6650            swiper,
6651            extendParams,
6652            on
6653        } = _ref;
6654        extendParams({
6655            controller: {
6656                control: undefined,
6657                inverse: false,
6658                by: 'slide' // or 'container'
6659            }
6660        });
6661
6662        swiper.controller = {
6663            control: undefined
6664        };
6665        function LinearSpline(x, y) {
6666            const binarySearch = function search() {
6667                let maxIndex;
6668                let minIndex;
6669                let guess;
6670                return (array, val) => {
6671                    minIndex = -1;
6672                    maxIndex = array.length;
6673                    while (maxIndex - minIndex > 1) {
6674                        guess = maxIndex + minIndex >> 1;
6675                        if (array[guess] <= val) {
6676                            minIndex = guess;
6677                        } else {
6678                            maxIndex = guess;
6679                        }
6680                    }
6681                    return maxIndex;
6682                };
6683            }();
6684            this.x = x;
6685            this.y = y;
6686            this.lastIndex = x.length - 1;
6687            // Given an x value (x2), return the expected y2 value:
6688            // (x1,y1) is the known point before given value,
6689            // (x3,y3) is the known point after given value.
6690            let i1;
6691            let i3;
6692            this.interpolate = function interpolate(x2) {
6693                if (!x2) return 0;
6694
6695                // Get the indexes of x1 and x3 (the array indexes before and after given x2):
6696                i3 = binarySearch(this.x, x2);
6697                i1 = i3 - 1;
6698
6699                // We have our indexes i1 & i3, so we can calculate already:
6700                // y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1
6701                return (x2 - this.x[i1]) * (this.y[i3] - this.y[i1]) / (this.x[i3] - this.x[i1]) + this.y[i1];
6702            };
6703            return this;
6704        }
6705        function getInterpolateFunction(c) {
6706            swiper.controller.spline = swiper.params.loop ? new LinearSpline(swiper.slidesGrid, c.slidesGrid) : new LinearSpline(swiper.snapGrid, c.snapGrid);
6707        }
6708        function setTranslate(_t, byController) {
6709            const controlled = swiper.controller.control;
6710            let multiplier;
6711            let controlledTranslate;
6712            const Swiper = swiper.constructor;
6713            function setControlledTranslate(c) {
6714                if (c.destroyed) return;
6715
6716                // this will create an Interpolate function based on the snapGrids
6717                // x is the Grid of the scrolled scroller and y will be the controlled scroller
6718                // it makes sense to create this only once and recall it for the interpolation
6719                // the function does a lot of value caching for performance
6720                const translate = swiper.rtlTranslate ? -swiper.translate : swiper.translate;
6721                if (swiper.params.controller.by === 'slide') {
6722                    getInterpolateFunction(c);
6723                    // i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid
6724                    // but it did not work out
6725                    controlledTranslate = -swiper.controller.spline.interpolate(-translate);
6726                }
6727                if (!controlledTranslate || swiper.params.controller.by === 'container') {
6728                    multiplier = (c.maxTranslate() - c.minTranslate()) / (swiper.maxTranslate() - swiper.minTranslate());
6729                    if (Number.isNaN(multiplier) || !Number.isFinite(multiplier)) {
6730                        multiplier = 1;
6731                    }
6732                    controlledTranslate = (translate - swiper.minTranslate()) * multiplier + c.minTranslate();
6733                }
6734                if (swiper.params.controller.inverse) {
6735                    controlledTranslate = c.maxTranslate() - controlledTranslate;
6736                }
6737                c.updateProgress(controlledTranslate);
6738                c.setTranslate(controlledTranslate, swiper);
6739                c.updateActiveIndex();
6740                c.updateSlidesClasses();
6741            }
6742            if (Array.isArray(controlled)) {
6743                for (let i = 0; i < controlled.length; i += 1) {
6744                    if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
6745                        setControlledTranslate(controlled[i]);
6746                    }
6747                }
6748            } else if (controlled instanceof Swiper && byController !== controlled) {
6749                setControlledTranslate(controlled);
6750            }
6751        }
6752        function setTransition(duration, byController) {
6753            const Swiper = swiper.constructor;
6754            const controlled = swiper.controller.control;
6755            let i;
6756            function setControlledTransition(c) {
6757                if (c.destroyed) return;
6758                c.setTransition(duration, swiper);
6759                if (duration !== 0) {
6760                    c.transitionStart();
6761                    if (c.params.autoHeight) {
6762                        nextTick(() => {
6763                            c.updateAutoHeight();
6764                        });
6765                    }
6766                    elementTransitionEnd(c.wrapperEl, () => {
6767                        if (!controlled) return;
6768                        c.transitionEnd();
6769                    });
6770                }
6771            }
6772            if (Array.isArray(controlled)) {
6773                for (i = 0; i < controlled.length; i += 1) {
6774                    if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
6775                        setControlledTransition(controlled[i]);
6776                    }
6777                }
6778            } else if (controlled instanceof Swiper && byController !== controlled) {
6779                setControlledTransition(controlled);
6780            }
6781        }
6782        function removeSpline() {
6783            if (!swiper.controller.control) return;
6784            if (swiper.controller.spline) {
6785                swiper.controller.spline = undefined;
6786                delete swiper.controller.spline;
6787            }
6788        }
6789        on('beforeInit', () => {
6790            if (typeof window !== 'undefined' && (
6791                // eslint-disable-line
6792                typeof swiper.params.controller.control === 'string' || swiper.params.controller.control instanceof HTMLElement)) {
6793                const controlElement = document.querySelector(swiper.params.controller.control);
6794                if (controlElement && controlElement.swiper) {
6795                    swiper.controller.control = controlElement.swiper;
6796                } else if (controlElement) {
6797                    const onControllerSwiper = e => {
6798                        swiper.controller.control = e.detail[0];
6799                        swiper.update();
6800                        controlElement.removeEventListener('init', onControllerSwiper);
6801                    };
6802                    controlElement.addEventListener('init', onControllerSwiper);
6803                }
6804                return;
6805            }
6806            swiper.controller.control = swiper.params.controller.control;
6807        });
6808        on('update', () => {
6809            removeSpline();
6810        });
6811        on('resize', () => {
6812            removeSpline();
6813        });
6814        on('observerUpdate', () => {
6815            removeSpline();
6816        });
6817        on('setTranslate', (_s, translate, byController) => {
6818            if (!swiper.controller.control || swiper.controller.control.destroyed) return;
6819            swiper.controller.setTranslate(translate, byController);
6820        });
6821        on('setTransition', (_s, duration, byController) => {
6822            if (!swiper.controller.control || swiper.controller.control.destroyed) return;
6823            swiper.controller.setTransition(duration, byController);
6824        });
6825        Object.assign(swiper.controller, {
6826            setTranslate,
6827            setTransition
6828        });
6829    }
6830
6831    function A11y(_ref) {
6832        let {
6833            swiper,
6834            extendParams,
6835            on
6836        } = _ref;
6837        extendParams({
6838            a11y: {
6839                enabled: true,
6840                notificationClass: 'swiper-notification',
6841                prevSlideMessage: 'Previous slide',
6842                nextSlideMessage: 'Next slide',
6843                firstSlideMessage: 'This is the first slide',
6844                lastSlideMessage: 'This is the last slide',
6845                paginationBulletMessage: 'Go to slide {{index}}',
6846                slideLabelMessage: '{{index}} / {{slidesLength}}',
6847                containerMessage: null,
6848                containerRoleDescriptionMessage: null,
6849                itemRoleDescriptionMessage: null,
6850                slideRole: 'group',
6851                id: null
6852            }
6853        });
6854        swiper.a11y = {
6855            clicked: false
6856        };
6857        let liveRegion = null;
6858        function notify(message) {
6859            const notification = liveRegion;
6860            if (notification.length === 0) return;
6861            notification.innerHTML = '';
6862            notification.innerHTML = message;
6863        }
6864        const makeElementsArray = el => (Array.isArray(el) ? el : [el]).filter(e => !!e);
6865        function getRandomNumber(size) {
6866            if (size === void 0) {
6867                size = 16;
6868            }
6869            const randomChar = () => Math.round(16 * Math.random()).toString(16);
6870            return 'x'.repeat(size).replace(/x/g, randomChar);
6871        }
6872        function makeElFocusable(el) {
6873            el = makeElementsArray(el);
6874            el.forEach(subEl => {
6875                subEl.setAttribute('tabIndex', '0');
6876            });
6877        }
6878        function makeElNotFocusable(el) {
6879            el = makeElementsArray(el);
6880            el.forEach(subEl => {
6881                subEl.setAttribute('tabIndex', '-1');
6882            });
6883        }
6884        function addElRole(el, role) {
6885            el = makeElementsArray(el);
6886            el.forEach(subEl => {
6887                subEl.setAttribute('role', role);
6888            });
6889        }
6890        function addElRoleDescription(el, description) {
6891            el = makeElementsArray(el);
6892            el.forEach(subEl => {
6893                subEl.setAttribute('aria-roledescription', description);
6894            });
6895        }
6896        function addElControls(el, controls) {
6897            el = makeElementsArray(el);
6898            el.forEach(subEl => {
6899                subEl.setAttribute('aria-controls', controls);
6900            });
6901        }
6902        function addElLabel(el, label) {
6903            el = makeElementsArray(el);
6904            el.forEach(subEl => {
6905                subEl.setAttribute('aria-label', label);
6906            });
6907        }
6908        function addElId(el, id) {
6909            el = makeElementsArray(el);
6910            el.forEach(subEl => {
6911                subEl.setAttribute('id', id);
6912            });
6913        }
6914        function addElLive(el, live) {
6915            el = makeElementsArray(el);
6916            el.forEach(subEl => {
6917                subEl.setAttribute('aria-live', live);
6918            });
6919        }
6920        function disableEl(el) {
6921            el = makeElementsArray(el);
6922            el.forEach(subEl => {
6923                subEl.setAttribute('aria-disabled', true);
6924            });
6925        }
6926        function enableEl(el) {
6927            el = makeElementsArray(el);
6928            el.forEach(subEl => {
6929                subEl.setAttribute('aria-disabled', false);
6930            });
6931        }
6932        function onEnterOrSpaceKey(e) {
6933            if (e.keyCode !== 13 && e.keyCode !== 32) return;
6934            const params = swiper.params.a11y;
6935            const targetEl = e.target;
6936            if (swiper.pagination && swiper.pagination.el && (targetEl === swiper.pagination.el || swiper.pagination.el.contains(e.target))) {
6937                if (!e.target.matches(classesToSelector(swiper.params.pagination.bulletClass))) return;
6938            }
6939            if (swiper.navigation && swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl) {
6940                if (!(swiper.isEnd && !swiper.params.loop)) {
6941                    swiper.slideNext();
6942                }
6943                if (swiper.isEnd) {
6944                    notify(params.lastSlideMessage);
6945                } else {
6946                    notify(params.nextSlideMessage);
6947                }
6948            }
6949            if (swiper.navigation && swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl) {
6950                if (!(swiper.isBeginning && !swiper.params.loop)) {
6951                    swiper.slidePrev();
6952                }
6953                if (swiper.isBeginning) {
6954                    notify(params.firstSlideMessage);
6955                } else {
6956                    notify(params.prevSlideMessage);
6957                }
6958            }
6959            if (swiper.pagination && targetEl.matches(classesToSelector(swiper.params.pagination.bulletClass))) {
6960                targetEl.click();
6961            }
6962        }
6963        function updateNavigation() {
6964            if (swiper.params.loop || swiper.params.rewind || !swiper.navigation) return;
6965            const {
6966                nextEl,
6967                prevEl
6968            } = swiper.navigation;
6969            if (prevEl) {
6970                if (swiper.isBeginning) {
6971                    disableEl(prevEl);
6972                    makeElNotFocusable(prevEl);
6973                } else {
6974                    enableEl(prevEl);
6975                    makeElFocusable(prevEl);
6976                }
6977            }
6978            if (nextEl) {
6979                if (swiper.isEnd) {
6980                    disableEl(nextEl);
6981                    makeElNotFocusable(nextEl);
6982                } else {
6983                    enableEl(nextEl);
6984                    makeElFocusable(nextEl);
6985                }
6986            }
6987        }
6988        function hasPagination() {
6989            return swiper.pagination && swiper.pagination.bullets && swiper.pagination.bullets.length;
6990        }
6991        function hasClickablePagination() {
6992            return hasPagination() && swiper.params.pagination.clickable;
6993        }
6994        function updatePagination() {
6995            const params = swiper.params.a11y;
6996            if (!hasPagination()) return;
6997            swiper.pagination.bullets.forEach(bulletEl => {
6998                if (swiper.params.pagination.clickable) {
6999                    makeElFocusable(bulletEl);
7000                    if (!swiper.params.pagination.renderBullet) {
7001                        addElRole(bulletEl, 'button');
7002                        addElLabel(bulletEl, params.paginationBulletMessage.replace(/\{\{index\}\}/, elementIndex(bulletEl) + 1));
7003                    }
7004                }
7005                if (bulletEl.matches(classesToSelector(swiper.params.pagination.bulletActiveClass))) {
7006                    bulletEl.setAttribute('aria-current', 'true');
7007                } else {
7008                    bulletEl.removeAttribute('aria-current');
7009                }
7010            });
7011        }
7012        const initNavEl = (el, wrapperId, message) => {
7013            makeElFocusable(el);
7014            if (el.tagName !== 'BUTTON') {
7015                addElRole(el, 'button');
7016                el.addEventListener('keydown', onEnterOrSpaceKey);
7017            }
7018            addElLabel(el, message);
7019            addElControls(el, wrapperId);
7020        };
7021        const handlePointerDown = () => {
7022            swiper.a11y.clicked = true;
7023        };
7024        const handlePointerUp = () => {
7025            requestAnimationFrame(() => {
7026                requestAnimationFrame(() => {
7027                    if (!swiper.destroyed) {
7028                        swiper.a11y.clicked = false;
7029                    }
7030                });
7031            });
7032        };
7033        const handleFocus = e => {
7034            if (swiper.a11y.clicked) return;
7035            const slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`);
7036            if (!slideEl || !swiper.slides.includes(slideEl)) return;
7037            const isActive = swiper.slides.indexOf(slideEl) === swiper.activeIndex;
7038            const isVisible = swiper.params.watchSlidesProgress && swiper.visibleSlides && swiper.visibleSlides.includes(slideEl);
7039            if (isActive || isVisible) return;
7040            if (e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents) return;
7041            if (swiper.isHorizontal()) {
7042                swiper.el.scrollLeft = 0;
7043            } else {
7044                swiper.el.scrollTop = 0;
7045            }
7046            swiper.slideTo(swiper.slides.indexOf(slideEl), 0);
7047        };
7048        const initSlides = () => {
7049            const params = swiper.params.a11y;
7050            if (params.itemRoleDescriptionMessage) {
7051                addElRoleDescription(swiper.slides, params.itemRoleDescriptionMessage);
7052            }
7053            if (params.slideRole) {
7054                addElRole(swiper.slides, params.slideRole);
7055            }
7056            const slidesLength = swiper.slides.length;
7057            if (params.slideLabelMessage) {
7058                swiper.slides.forEach((slideEl, index) => {
7059                    const slideIndex = swiper.params.loop ? parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10) : index;
7060                    const ariaLabelMessage = params.slideLabelMessage.replace(/\{\{index\}\}/, slideIndex + 1).replace(/\{\{slidesLength\}\}/, slidesLength);
7061                    addElLabel(slideEl, ariaLabelMessage);
7062                });
7063            }
7064        };
7065        const init = () => {
7066            const params = swiper.params.a11y;
7067            swiper.el.append(liveRegion);
7068
7069            // Container
7070            const containerEl = swiper.el;
7071            if (params.containerRoleDescriptionMessage) {
7072                addElRoleDescription(containerEl, params.containerRoleDescriptionMessage);
7073            }
7074            if (params.containerMessage) {
7075                addElLabel(containerEl, params.containerMessage);
7076            }
7077
7078            // Wrapper
7079            const wrapperEl = swiper.wrapperEl;
7080            const wrapperId = params.id || wrapperEl.getAttribute('id') || `swiper-wrapper-${getRandomNumber(16)}`;
7081            const live = swiper.params.autoplay && swiper.params.autoplay.enabled ? 'off' : 'polite';
7082            addElId(wrapperEl, wrapperId);
7083            addElLive(wrapperEl, live);
7084
7085            // Slide
7086            initSlides();
7087
7088            // Navigation
7089            let {
7090                nextEl,
7091                prevEl
7092            } = swiper.navigation ? swiper.navigation : {};
7093            nextEl = makeElementsArray(nextEl);
7094            prevEl = makeElementsArray(prevEl);
7095            if (nextEl) {
7096                nextEl.forEach(el => initNavEl(el, wrapperId, params.nextSlideMessage));
7097            }
7098            if (prevEl) {
7099                prevEl.forEach(el => initNavEl(el, wrapperId, params.prevSlideMessage));
7100            }
7101
7102            // Pagination
7103            if (hasClickablePagination()) {
7104                const paginationEl = Array.isArray(swiper.pagination.el) ? swiper.pagination.el : [swiper.pagination.el];
7105                paginationEl.forEach(el => {
7106                    el.addEventListener('keydown', onEnterOrSpaceKey);
7107                });
7108            }
7109
7110            // Tab focus
7111            swiper.el.addEventListener('focus', handleFocus, true);
7112            swiper.el.addEventListener('pointerdown', handlePointerDown, true);
7113            swiper.el.addEventListener('pointerup', handlePointerUp, true);
7114        };
7115        function destroy() {
7116            if (liveRegion) liveRegion.remove();
7117            let {
7118                nextEl,
7119                prevEl
7120            } = swiper.navigation ? swiper.navigation : {};
7121            nextEl = makeElementsArray(nextEl);
7122            prevEl = makeElementsArray(prevEl);
7123            if (nextEl) {
7124                nextEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));
7125            }
7126            if (prevEl) {
7127                prevEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));
7128            }
7129
7130            // Pagination
7131            if (hasClickablePagination()) {
7132                const paginationEl = Array.isArray(swiper.pagination.el) ? swiper.pagination.el : [swiper.pagination.el];
7133                paginationEl.forEach(el => {
7134                    el.removeEventListener('keydown', onEnterOrSpaceKey);
7135                });
7136            }
7137
7138            // Tab focus
7139            swiper.el.removeEventListener('focus', handleFocus, true);
7140            swiper.el.removeEventListener('pointerdown', handlePointerDown, true);
7141            swiper.el.removeEventListener('pointerup', handlePointerUp, true);
7142        }
7143        on('beforeInit', () => {
7144            liveRegion = createElement('span', swiper.params.a11y.notificationClass);
7145            liveRegion.setAttribute('aria-live', 'assertive');
7146            liveRegion.setAttribute('aria-atomic', 'true');
7147        });
7148        on('afterInit', () => {
7149            if (!swiper.params.a11y.enabled) return;
7150            init();
7151        });
7152        on('slidesLengthChange snapGridLengthChange slidesGridLengthChange', () => {
7153            if (!swiper.params.a11y.enabled) return;
7154            initSlides();
7155        });
7156        on('fromEdge toEdge afterInit lock unlock', () => {
7157            if (!swiper.params.a11y.enabled) return;
7158            updateNavigation();
7159        });
7160        on('paginationUpdate', () => {
7161            if (!swiper.params.a11y.enabled) return;
7162            updatePagination();
7163        });
7164        on('destroy', () => {
7165            if (!swiper.params.a11y.enabled) return;
7166            destroy();
7167        });
7168    }
7169
7170    function History(_ref) {
7171        let {
7172            swiper,
7173            extendParams,
7174            on
7175        } = _ref;
7176        extendParams({
7177            history: {
7178                enabled: false,
7179                root: '',
7180                replaceState: false,
7181                key: 'slides',
7182                keepQuery: false
7183            }
7184        });
7185        let initialized = false;
7186        let paths = {};
7187        const slugify = text => {
7188            return text.toString().replace(/\s+/g, '-').replace(/[^\w-]+/g, '').replace(/--+/g, '-').replace(/^-+/, '').replace(/-+$/, '');
7189        };
7190        const getPathValues = urlOverride => {
7191            const window = getWindow();
7192            let location;
7193            if (urlOverride) {
7194                location = new URL(urlOverride);
7195            } else {
7196                location = window.location;
7197            }
7198            const pathArray = location.pathname.slice(1).split('/').filter(part => part !== '');
7199            const total = pathArray.length;
7200            const key = pathArray[total - 2];
7201            const value = pathArray[total - 1];
7202            return {
7203                key,
7204                value
7205            };
7206        };
7207        const setHistory = (key, index) => {
7208            const window = getWindow();
7209            if (!initialized || !swiper.params.history.enabled) return;
7210            let location;
7211            if (swiper.params.url) {
7212                location = new URL(swiper.params.url);
7213            } else {
7214                location = window.location;
7215            }
7216            const slide = swiper.slides[index];
7217            let value = slugify(slide.getAttribute('data-history'));
7218            if (swiper.params.history.root.length > 0) {
7219                let root = swiper.params.history.root;
7220                if (root[root.length - 1] === '/') root = root.slice(0, root.length - 1);
7221                value = `${root}/${key ? `${key}/` : ''}${value}`;
7222            } else if (!location.pathname.includes(key)) {
7223                value = `${key ? `${key}/` : ''}${value}`;
7224            }
7225            if (swiper.params.history.keepQuery) {
7226                value += location.search;
7227            }
7228            const currentState = window.history.state;
7229            if (currentState && currentState.value === value) {
7230                return;
7231            }
7232            if (swiper.params.history.replaceState) {
7233                window.history.replaceState({
7234                    value
7235                }, null, value);
7236            } else {
7237                window.history.pushState({
7238                    value
7239                }, null, value);
7240            }
7241        };
7242        const scrollToSlide = (speed, value, runCallbacks) => {
7243            if (value) {
7244                for (let i = 0, length = swiper.slides.length; i < length; i += 1) {
7245                    const slide = swiper.slides[i];
7246                    const slideHistory = slugify(slide.getAttribute('data-history'));
7247                    if (slideHistory === value) {
7248                        const index = swiper.getSlideIndex(slide);
7249                        swiper.slideTo(index, speed, runCallbacks);
7250                    }
7251                }
7252            } else {
7253                swiper.slideTo(0, speed, runCallbacks);
7254            }
7255        };
7256        const setHistoryPopState = () => {
7257            paths = getPathValues(swiper.params.url);
7258            scrollToSlide(swiper.params.speed, paths.value, false);
7259        };
7260        const init = () => {
7261            const window = getWindow();
7262            if (!swiper.params.history) return;
7263            if (!window.history || !window.history.pushState) {
7264                swiper.params.history.enabled = false;
7265                swiper.params.hashNavigation.enabled = true;
7266                return;
7267            }
7268            initialized = true;
7269            paths = getPathValues(swiper.params.url);
7270            if (!paths.key && !paths.value) {
7271                if (!swiper.params.history.replaceState) {
7272                    window.addEventListener('popstate', setHistoryPopState);
7273                }
7274                return;
7275            }
7276            scrollToSlide(0, paths.value, swiper.params.runCallbacksOnInit);
7277            if (!swiper.params.history.replaceState) {
7278                window.addEventListener('popstate', setHistoryPopState);
7279            }
7280        };
7281        const destroy = () => {
7282            const window = getWindow();
7283            if (!swiper.params.history.replaceState) {
7284                window.removeEventListener('popstate', setHistoryPopState);
7285            }
7286        };
7287        on('init', () => {
7288            if (swiper.params.history.enabled) {
7289                init();
7290            }
7291        });
7292        on('destroy', () => {
7293            if (swiper.params.history.enabled) {
7294                destroy();
7295            }
7296        });
7297        on('transitionEnd _freeModeNoMomentumRelease', () => {
7298            if (initialized) {
7299                setHistory(swiper.params.history.key, swiper.activeIndex);
7300            }
7301        });
7302        on('slideChange', () => {
7303            if (initialized && swiper.params.cssMode) {
7304                setHistory(swiper.params.history.key, swiper.activeIndex);
7305            }
7306        });
7307    }
7308
7309    function HashNavigation(_ref) {
7310        let {
7311            swiper,
7312            extendParams,
7313            emit,
7314            on
7315        } = _ref;
7316        let initialized = false;
7317        const document = getDocument();
7318        const window = getWindow();
7319        extendParams({
7320            hashNavigation: {
7321                enabled: false,
7322                replaceState: false,
7323                watchState: false,
7324                getSlideIndex(_s, hash) {
7325                    if (swiper.virtual && swiper.params.virtual.enabled) {
7326                        const slideWithHash = swiper.slides.filter(slideEl => slideEl.getAttribute('data-hash') === hash)[0];
7327                        if (!slideWithHash) return 0;
7328                        const index = parseInt(slideWithHash.getAttribute('data-swiper-slide-index'), 10);
7329                        return index;
7330                    }
7331                    return swiper.getSlideIndex(elementChildren(swiper.slidesEl, `.${swiper.params.slideClass}[data-hash="${hash}"], swiper-slide[data-hash="${hash}"]`)[0]);
7332                }
7333            }
7334        });
7335        const onHashChange = () => {
7336            emit('hashChange');
7337            const newHash = document.location.hash.replace('#', '');
7338            const activeSlideEl = swiper.virtual && swiper.params.virtual.enabled ? swiper.slidesEl.querySelector(`[data-swiper-slide-index="${swiper.activeIndex}"]`) : swiper.slides[swiper.activeIndex];
7339            const activeSlideHash = activeSlideEl ? activeSlideEl.getAttribute('data-hash') : '';
7340            if (newHash !== activeSlideHash) {
7341                const newIndex = swiper.params.hashNavigation.getSlideIndex(swiper, newHash);
7342                if (typeof newIndex === 'undefined' || Number.isNaN(newIndex)) return;
7343                swiper.slideTo(newIndex);
7344            }
7345        };
7346        const setHash = () => {
7347            if (!initialized || !swiper.params.hashNavigation.enabled) return;
7348            const activeSlideEl = swiper.virtual && swiper.params.virtual.enabled ? swiper.slidesEl.querySelector(`[data-swiper-slide-index="${swiper.activeIndex}"]`) : swiper.slides[swiper.activeIndex];
7349            const activeSlideHash = activeSlideEl ? activeSlideEl.getAttribute('data-hash') || activeSlideEl.getAttribute('data-history') : '';
7350            if (swiper.params.hashNavigation.replaceState && window.history && window.history.replaceState) {
7351                window.history.replaceState(null, null, `#${activeSlideHash}` || '');
7352                emit('hashSet');
7353            } else {
7354                document.location.hash = activeSlideHash || '';
7355                emit('hashSet');
7356            }
7357        };
7358        const init = () => {
7359            if (!swiper.params.hashNavigation.enabled || swiper.params.history && swiper.params.history.enabled) return;
7360            initialized = true;
7361            const hash = document.location.hash.replace('#', '');
7362            if (hash) {
7363                const speed = 0;
7364                const index = swiper.params.hashNavigation.getSlideIndex(swiper, hash);
7365                swiper.slideTo(index || 0, speed, swiper.params.runCallbacksOnInit, true);
7366            }
7367            if (swiper.params.hashNavigation.watchState) {
7368                window.addEventListener('hashchange', onHashChange);
7369            }
7370        };
7371        const destroy = () => {
7372            if (swiper.params.hashNavigation.watchState) {
7373                window.removeEventListener('hashchange', onHashChange);
7374            }
7375        };
7376        on('init', () => {
7377            if (swiper.params.hashNavigation.enabled) {
7378                init();
7379            }
7380        });
7381        on('destroy', () => {
7382            if (swiper.params.hashNavigation.enabled) {
7383                destroy();
7384            }
7385        });
7386        on('transitionEnd _freeModeNoMomentumRelease', () => {
7387            if (initialized) {
7388                setHash();
7389            }
7390        });
7391        on('slideChange', () => {
7392            if (initialized && swiper.params.cssMode) {
7393                setHash();
7394            }
7395        });
7396    }
7397
7398    /* eslint no-underscore-dangle: "off" */
7399    /* eslint no-use-before-define: "off" */
7400    function Autoplay(_ref) {
7401        let {
7402            swiper,
7403            extendParams,
7404            on,
7405            emit,
7406            params
7407        } = _ref;
7408        swiper.autoplay = {
7409            running: false,
7410            paused: false,
7411            timeLeft: 0
7412        };
7413        extendParams({
7414            autoplay: {
7415                enabled: false,
7416                delay: 3000,
7417                waitForTransition: true,
7418                disableOnInteraction: true,
7419                stopOnLastSlide: false,
7420                reverseDirection: false,
7421                pauseOnMouseEnter: false
7422            }
7423        });
7424        let timeout;
7425        let raf;
7426        let autoplayDelayTotal = params && params.autoplay ? params.autoplay.delay : 3000;
7427        let autoplayDelayCurrent = params && params.autoplay ? params.autoplay.delay : 3000;
7428        let autoplayTimeLeft;
7429        let autoplayStartTime = new Date().getTime;
7430        let wasPaused;
7431        let isTouched;
7432        let pausedByTouch;
7433        let touchStartTimeout;
7434        let slideChanged;
7435        let pausedByInteraction;
7436        function onTransitionEnd(e) {
7437            if (!swiper || swiper.destroyed || !swiper.wrapperEl) return;
7438            if (e.target !== swiper.wrapperEl) return;
7439            swiper.wrapperEl.removeEventListener('transitionend', onTransitionEnd);
7440            resume();
7441        }
7442        const calcTimeLeft = () => {
7443            if (swiper.destroyed || !swiper.autoplay.running) return;
7444            if (swiper.autoplay.paused) {
7445                wasPaused = true;
7446            } else if (wasPaused) {
7447                autoplayDelayCurrent = autoplayTimeLeft;
7448                wasPaused = false;
vendor: 4,524 bytes, lines 7449-7553
7449            }
7450            const timeLeft = swiper.autoplay.paused ? autoplayTimeLeft : autoplayStartTime + autoplayDelayCurrent - new Date().getTime();
7451            swiper.autoplay.timeLeft = timeLeft;
7452            emit('autoplayTimeLeft', timeLeft, timeLeft / autoplayDelayTotal);
7453            raf = requestAnimationFrame(() => {
7454                calcTimeLeft();
7455            });
7456        };
7457        const getSlideDelay = () => {
7458            let activeSlideEl;
7459            if (swiper.virtual && swiper.params.virtual.enabled) {
7460                activeSlideEl = swiper.slides.filter(slideEl => slideEl.classList.contains('swiper-slide-active'))[0];
7461            } else {
7462                activeSlideEl = swiper.slides[swiper.activeIndex];
7463            }
7464            if (!activeSlideEl) return undefined;
7465            const currentSlideDelay = parseInt(activeSlideEl.getAttribute('data-swiper-autoplay'), 10);
7466            return currentSlideDelay;
7467        };
7468        const run = delayForce => {
7469            if (swiper.destroyed || !swiper.autoplay.running) return;
7470            cancelAnimationFrame(raf);
7471            calcTimeLeft();
7472            let delay = typeof delayForce === 'undefined' ? swiper.params.autoplay.delay : delayForce;
7473            autoplayDelayTotal = swiper.params.autoplay.delay;
7474            autoplayDelayCurrent = swiper.params.autoplay.delay;
7475            const currentSlideDelay = getSlideDelay();
7476            if (!Number.isNaN(currentSlideDelay) && currentSlideDelay > 0 && typeof delayForce === 'undefined') {
7477                delay = currentSlideDelay;
7478                autoplayDelayTotal = currentSlideDelay;
7479                autoplayDelayCurrent = currentSlideDelay;
7480            }
7481            autoplayTimeLeft = delay;
7482            const speed = swiper.params.speed;
7483            const proceed = () => {
7484                if (!swiper || swiper.destroyed) return;
7485                if (swiper.params.autoplay.reverseDirection) {
7486                    if (!swiper.isBeginning || swiper.params.loop || swiper.params.rewind) {
7487                        swiper.slidePrev(speed, true, true);
7488                        emit('autoplay');
7489                    } else if (!swiper.params.autoplay.stopOnLastSlide) {
7490                        swiper.slideTo(swiper.slides.length - 1, speed, true, true);
7491                        emit('autoplay');
7492                    }
7493                } else {
7494                    if (!swiper.isEnd || swiper.params.loop || swiper.params.rewind) {
7495                        swiper.slideNext(speed, true, true);
7496                        emit('autoplay');
7497                    } else if (!swiper.params.autoplay.stopOnLastSlide) {
7498                        swiper.slideTo(0, speed, true, true);
7499                        emit('autoplay');
7500                    }
7501                }
7502                if (swiper.params.cssMode) {
7503                    autoplayStartTime = new Date().getTime();
7504                    requestAnimationFrame(() => {
7505                        run();
7506                    });
7507                }
7508            };
7509            if (delay > 0) {
7510                clearTimeout(timeout);
7511                timeout = setTimeout(() => {
7512                    proceed();
7513                }, delay);
7514            } else {
7515                requestAnimationFrame(() => {
7516                    proceed();
7517                });
7518            }
7519
7520            // eslint-disable-next-line
7521            return delay;
7522        };
7523        const start = () => {
7524            swiper.autoplay.running = true;
7525            run();
7526            emit('autoplayStart');
7527        };
7528        const stop = () => {
7529            swiper.autoplay.running = false;
7530            clearTimeout(timeout);
7531            cancelAnimationFrame(raf);
7532            emit('autoplayStop');
7533        };
7534        const pause = (internal, reset) => {
7535            if (swiper.destroyed || !swiper.autoplay.running) return;
7536            clearTimeout(timeout);
7537            if (!internal) {
7538                pausedByInteraction = true;
7539            }
7540            const proceed = () => {
7541                emit('autoplayPause');
7542                if (swiper.params.autoplay.waitForTransition) {
7543                    swiper.wrapperEl.addEventListener('transitionend', onTransitionEnd);
7544                } else {
7545                    resume();
7546                }
7547            };
7548            swiper.autoplay.paused = true;
7549            if (reset) {
7550                if (slideChanged) {
7551                    autoplayTimeLeft = swiper.params.autoplay.delay;
7552                }
7553                slideChanged = false;
vendor: 24,484 bytes, lines 7554-8111
7554                proceed();
7555                return;
7556            }
7557            const delay = autoplayTimeLeft || swiper.params.autoplay.delay;
7558            autoplayTimeLeft = delay - (new Date().getTime() - autoplayStartTime);
7559            if (swiper.isEnd && autoplayTimeLeft < 0 && !swiper.params.loop) return;
7560            if (autoplayTimeLeft < 0) autoplayTimeLeft = 0;
7561            proceed();
7562        };
7563        const resume = () => {
7564            if (swiper.isEnd && autoplayTimeLeft < 0 && !swiper.params.loop || swiper.destroyed || !swiper.autoplay.running) return;
7565            autoplayStartTime = new Date().getTime();
7566            if (pausedByInteraction) {
7567                pausedByInteraction = false;
7568                run(autoplayTimeLeft);
7569            } else {
7570                run();
7571            }
7572            swiper.autoplay.paused = false;
7573            emit('autoplayResume');
7574        };
7575        const onVisibilityChange = () => {
7576            if (swiper.destroyed || !swiper.autoplay.running) return;
7577            const document = getDocument();
7578            if (document.visibilityState === 'hidden') {
7579                pausedByInteraction = true;
7580                pause(true);
7581            }
7582            if (document.visibilityState === 'visible') {
7583                resume();
7584            }
7585        };
7586        const onPointerEnter = e => {
7587            if (e.pointerType !== 'mouse') return;
7588            pausedByInteraction = true;
7589            if (swiper.animating || swiper.autoplay.paused) return;
7590            pause(true);
7591        };
7592        const onPointerLeave = e => {
7593            if (e.pointerType !== 'mouse') return;
7594            if (swiper.autoplay.paused) {
7595                resume();
7596            }
7597        };
7598        const attachMouseEvents = () => {
7599            if (swiper.params.autoplay.pauseOnMouseEnter) {
7600                swiper.el.addEventListener('pointerenter', onPointerEnter);
7601                swiper.el.addEventListener('pointerleave', onPointerLeave);
7602            }
7603        };
7604        const detachMouseEvents = () => {
7605            swiper.el.removeEventListener('pointerenter', onPointerEnter);
7606            swiper.el.removeEventListener('pointerleave', onPointerLeave);
7607        };
7608        const attachDocumentEvents = () => {
7609            const document = getDocument();
7610            document.addEventListener('visibilitychange', onVisibilityChange);
7611        };
7612        const detachDocumentEvents = () => {
7613            const document = getDocument();
7614            document.removeEventListener('visibilitychange', onVisibilityChange);
7615        };
7616        on('init', () => {
7617            if (swiper.params.autoplay.enabled) {
7618                attachMouseEvents();
7619                attachDocumentEvents();
7620                autoplayStartTime = new Date().getTime();
7621                start();
7622            }
7623        });
7624        on('destroy', () => {
7625            detachMouseEvents();
7626            detachDocumentEvents();
7627            if (swiper.autoplay.running) {
7628                stop();
7629            }
7630        });
7631        on('beforeTransitionStart', (_s, speed, internal) => {
7632            if (swiper.destroyed || !swiper.autoplay.running) return;
7633            if (internal || !swiper.params.autoplay.disableOnInteraction) {
7634                pause(true, true);
7635            } else {
7636                stop();
7637            }
7638        });
7639        on('sliderFirstMove', () => {
7640            if (swiper.destroyed || !swiper.autoplay.running) return;
7641            if (swiper.params.autoplay.disableOnInteraction) {
7642                stop();
7643                return;
7644            }
7645            isTouched = true;
7646            pausedByTouch = false;
7647            pausedByInteraction = false;
7648            touchStartTimeout = setTimeout(() => {
7649                pausedByInteraction = true;
7650                pausedByTouch = true;
7651                pause(true);
7652            }, 200);
7653        });
7654        on('touchEnd', () => {
7655            if (swiper.destroyed || !swiper.autoplay.running || !isTouched) return;
7656            clearTimeout(touchStartTimeout);
7657            clearTimeout(timeout);
7658            if (swiper.params.autoplay.disableOnInteraction) {
7659                pausedByTouch = false;
7660                isTouched = false;
7661                return;
7662            }
7663            if (pausedByTouch && swiper.params.cssMode) resume();
7664            pausedByTouch = false;
7665            isTouched = false;
7666        });
7667        on('slideChange', () => {
7668            if (swiper.destroyed || !swiper.autoplay.running) return;
7669            slideChanged = true;
7670        });
7671        Object.assign(swiper.autoplay, {
7672            start,
7673            stop,
7674            pause,
7675            resume
7676        });
7677    }
7678
7679    function Thumb(_ref) {
7680        let {
7681            swiper,
7682            extendParams,
7683            on
7684        } = _ref;
7685        extendParams({
7686            thumbs: {
7687                swiper: null,
7688                multipleActiveThumbs: true,
7689                autoScrollOffset: 0,
7690                slideThumbActiveClass: 'swiper-slide-thumb-active',
7691                thumbsContainerClass: 'swiper-thumbs'
7692            }
7693        });
7694        let initialized = false;
7695        let swiperCreated = false;
7696        swiper.thumbs = {
7697            swiper: null
7698        };
7699        function onThumbClick() {
7700            const thumbsSwiper = swiper.thumbs.swiper;
7701            if (!thumbsSwiper || thumbsSwiper.destroyed) return;
7702            const clickedIndex = thumbsSwiper.clickedIndex;
7703            const clickedSlide = thumbsSwiper.clickedSlide;
7704            if (clickedSlide && clickedSlide.classList.contains(swiper.params.thumbs.slideThumbActiveClass)) return;
7705            if (typeof clickedIndex === 'undefined' || clickedIndex === null) return;
7706            let slideToIndex;
7707            if (thumbsSwiper.params.loop) {
7708                slideToIndex = parseInt(thumbsSwiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10);
7709            } else {
7710                slideToIndex = clickedIndex;
7711            }
7712            if (swiper.params.loop) {
7713                swiper.slideToLoop(slideToIndex);
7714            } else {
7715                swiper.slideTo(slideToIndex);
7716            }
7717        }
7718        function init() {
7719            const {
7720                thumbs: thumbsParams
7721            } = swiper.params;
7722            if (initialized) return false;
7723            initialized = true;
7724            const SwiperClass = swiper.constructor;
7725            if (thumbsParams.swiper instanceof SwiperClass) {
7726                swiper.thumbs.swiper = thumbsParams.swiper;
7727                Object.assign(swiper.thumbs.swiper.originalParams, {
7728                    watchSlidesProgress: true,
7729                    slideToClickedSlide: false
7730                });
7731                Object.assign(swiper.thumbs.swiper.params, {
7732                    watchSlidesProgress: true,
7733                    slideToClickedSlide: false
7734                });
7735                swiper.thumbs.swiper.update();
7736            } else if (isObject(thumbsParams.swiper)) {
7737                const thumbsSwiperParams = Object.assign({}, thumbsParams.swiper);
7738                Object.assign(thumbsSwiperParams, {
7739                    watchSlidesProgress: true,
7740                    slideToClickedSlide: false
7741                });
7742                swiper.thumbs.swiper = new SwiperClass(thumbsSwiperParams);
7743                swiperCreated = true;
7744            }
7745            swiper.thumbs.swiper.el.classList.add(swiper.params.thumbs.thumbsContainerClass);
7746            swiper.thumbs.swiper.on('tap', onThumbClick);
7747            return true;
7748        }
7749        function update(initial) {
7750            const thumbsSwiper = swiper.thumbs.swiper;
7751            if (!thumbsSwiper || thumbsSwiper.destroyed) return;
7752            const slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView;
7753
7754            // Activate thumbs
7755            let thumbsToActivate = 1;
7756            const thumbActiveClass = swiper.params.thumbs.slideThumbActiveClass;
7757            if (swiper.params.slidesPerView > 1 && !swiper.params.centeredSlides) {
7758                thumbsToActivate = swiper.params.slidesPerView;
7759            }
7760            if (!swiper.params.thumbs.multipleActiveThumbs) {
7761                thumbsToActivate = 1;
7762            }
7763            thumbsToActivate = Math.floor(thumbsToActivate);
7764            thumbsSwiper.slides.forEach(slideEl => slideEl.classList.remove(thumbActiveClass));
7765            if (thumbsSwiper.params.loop || thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled) {
7766                for (let i = 0; i < thumbsToActivate; i += 1) {
7767                    elementChildren(thumbsSwiper.slidesEl, `[data-swiper-slide-index="${swiper.realIndex + i}"]`).forEach(slideEl => {
7768                        slideEl.classList.add(thumbActiveClass);
7769                    });
7770                }
7771            } else {
7772                for (let i = 0; i < thumbsToActivate; i += 1) {
7773                    if (thumbsSwiper.slides[swiper.realIndex + i]) {
7774                        thumbsSwiper.slides[swiper.realIndex + i].classList.add(thumbActiveClass);
7775                    }
7776                }
7777            }
7778            const autoScrollOffset = swiper.params.thumbs.autoScrollOffset;
7779            const useOffset = autoScrollOffset && !thumbsSwiper.params.loop;
7780            if (swiper.realIndex !== thumbsSwiper.realIndex || useOffset) {
7781                const currentThumbsIndex = thumbsSwiper.activeIndex;
7782                let newThumbsIndex;
7783                let direction;
7784                if (thumbsSwiper.params.loop) {
7785                    const newThumbsSlide = thumbsSwiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') === `${swiper.realIndex}`)[0];
7786                    newThumbsIndex = thumbsSwiper.slides.indexOf(newThumbsSlide);
7787                    direction = swiper.activeIndex > swiper.previousIndex ? 'next' : 'prev';
7788                } else {
7789                    newThumbsIndex = swiper.realIndex;
7790                    direction = newThumbsIndex > swiper.previousIndex ? 'next' : 'prev';
7791                }
7792                if (useOffset) {
7793                    newThumbsIndex += direction === 'next' ? autoScrollOffset : -1 * autoScrollOffset;
7794                }
7795                if (thumbsSwiper.visibleSlidesIndexes && thumbsSwiper.visibleSlidesIndexes.indexOf(newThumbsIndex) < 0) {
7796                    if (thumbsSwiper.params.centeredSlides) {
7797                        if (newThumbsIndex > currentThumbsIndex) {
7798                            newThumbsIndex = newThumbsIndex - Math.floor(slidesPerView / 2) + 1;
7799                        } else {
7800                            newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1;
7801                        }
7802                    } else if (newThumbsIndex > currentThumbsIndex && thumbsSwiper.params.slidesPerGroup === 1) ;
7803                    thumbsSwiper.slideTo(newThumbsIndex, initial ? 0 : undefined);
7804                }
7805            }
7806        }
7807        on('beforeInit', () => {
7808            const {
7809                thumbs
7810            } = swiper.params;
7811            if (!thumbs || !thumbs.swiper) return;
7812            if (typeof thumbs.swiper === 'string' || thumbs.swiper instanceof HTMLElement) {
7813                const document = getDocument();
7814                const getThumbsElementAndInit = () => {
7815                    const thumbsElement = typeof thumbs.swiper === 'string' ? document.querySelector(thumbs.swiper) : thumbs.swiper;
7816                    if (thumbsElement && thumbsElement.swiper) {
7817                        thumbs.swiper = thumbsElement.swiper;
7818                        init();
7819                        update(true);
7820                    } else if (thumbsElement) {
7821                        const onThumbsSwiper = e => {
7822                            thumbs.swiper = e.detail[0];
7823                            thumbsElement.removeEventListener('init', onThumbsSwiper);
7824                            init();
7825                            update(true);
7826                            thumbs.swiper.update();
7827                            swiper.update();
7828                        };
7829                        thumbsElement.addEventListener('init', onThumbsSwiper);
7830                    }
7831                    return thumbsElement;
7832                };
7833                const watchForThumbsToAppear = () => {
7834                    if (swiper.destroyed) return;
7835                    const thumbsElement = getThumbsElementAndInit();
7836                    if (!thumbsElement) {
7837                        requestAnimationFrame(watchForThumbsToAppear);
7838                    }
7839                };
7840                requestAnimationFrame(watchForThumbsToAppear);
7841            } else {
7842                init();
7843                update(true);
7844            }
7845        });
7846        on('slideChange update resize observerUpdate', () => {
7847            update();
7848        });
7849        on('setTransition', (_s, duration) => {
7850            const thumbsSwiper = swiper.thumbs.swiper;
7851            if (!thumbsSwiper || thumbsSwiper.destroyed) return;
7852            thumbsSwiper.setTransition(duration);
7853        });
7854        on('beforeDestroy', () => {
7855            const thumbsSwiper = swiper.thumbs.swiper;
7856            if (!thumbsSwiper || thumbsSwiper.destroyed) return;
7857            if (swiperCreated) {
7858                thumbsSwiper.destroy();
7859            }
7860        });
7861        Object.assign(swiper.thumbs, {
7862            init,
7863            update
7864        });
7865    }
7866
7867    function freeMode(_ref) {
7868        let {
7869            swiper,
7870            extendParams,
7871            emit,
7872            once
7873        } = _ref;
7874        extendParams({
7875            freeMode: {
7876                enabled: false,
7877                momentum: true,
7878                momentumRatio: 1,
7879                momentumBounce: true,
7880                momentumBounceRatio: 1,
7881                momentumVelocityRatio: 1,
7882                sticky: false,
7883                minimumVelocity: 0.02
7884            }
7885        });
7886        function onTouchStart() {
7887            if (swiper.params.cssMode) return;
7888            const translate = swiper.getTranslate();
7889            swiper.setTranslate(translate);
7890            swiper.setTransition(0);
7891            swiper.touchEventsData.velocities.length = 0;
7892            swiper.freeMode.onTouchEnd({
7893                currentPos: swiper.rtl ? swiper.translate : -swiper.translate
7894            });
7895        }
7896        function onTouchMove() {
7897            if (swiper.params.cssMode) return;
7898            const {
7899                touchEventsData: data,
7900                touches
7901            } = swiper;
7902            // Velocity
7903            if (data.velocities.length === 0) {
7904                data.velocities.push({
7905                    position: touches[swiper.isHorizontal() ? 'startX' : 'startY'],
7906                    time: data.touchStartTime
7907                });
7908            }
7909            data.velocities.push({
7910                position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'],
7911                time: now()
7912            });
7913        }
7914        function onTouchEnd(_ref2) {
7915            let {
7916                currentPos
7917            } = _ref2;
7918            if (swiper.params.cssMode) return;
7919            const {
7920                params,
7921                wrapperEl,
7922                rtlTranslate: rtl,
7923                snapGrid,
7924                touchEventsData: data
7925            } = swiper;
7926            // Time diff
7927            const touchEndTime = now();
7928            const timeDiff = touchEndTime - data.touchStartTime;
7929            if (currentPos < -swiper.minTranslate()) {
7930                swiper.slideTo(swiper.activeIndex);
7931                return;
7932            }
7933            if (currentPos > -swiper.maxTranslate()) {
7934                if (swiper.slides.length < snapGrid.length) {
7935                    swiper.slideTo(snapGrid.length - 1);
7936                } else {
7937                    swiper.slideTo(swiper.slides.length - 1);
7938                }
7939                return;
7940            }
7941            if (params.freeMode.momentum) {
7942                if (data.velocities.length > 1) {
7943                    const lastMoveEvent = data.velocities.pop();
7944                    const velocityEvent = data.velocities.pop();
7945                    const distance = lastMoveEvent.position - velocityEvent.position;
7946                    const time = lastMoveEvent.time - velocityEvent.time;
7947                    swiper.velocity = distance / time;
7948                    swiper.velocity /= 2;
7949                    if (Math.abs(swiper.velocity) < params.freeMode.minimumVelocity) {
7950                        swiper.velocity = 0;
7951                    }
7952                    // this implies that the user stopped moving a finger then released.
7953                    // There would be no events with distance zero, so the last event is stale.
7954                    if (time > 150 || now() - lastMoveEvent.time > 300) {
7955                        swiper.velocity = 0;
7956                    }
7957                } else {
7958                    swiper.velocity = 0;
7959                }
7960                swiper.velocity *= params.freeMode.momentumVelocityRatio;
7961                data.velocities.length = 0;
7962                let momentumDuration = 1000 * params.freeMode.momentumRatio;
7963                const momentumDistance = swiper.velocity * momentumDuration;
7964                let newPosition = swiper.translate + momentumDistance;
7965                if (rtl) newPosition = -newPosition;
7966                let doBounce = false;
7967                let afterBouncePosition;
7968                const bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeMode.momentumBounceRatio;
7969                let needsLoopFix;
7970                if (newPosition < swiper.maxTranslate()) {
7971                    if (params.freeMode.momentumBounce) {
7972                        if (newPosition + swiper.maxTranslate() < -bounceAmount) {
7973                            newPosition = swiper.maxTranslate() - bounceAmount;
7974                        }
7975                        afterBouncePosition = swiper.maxTranslate();
7976                        doBounce = true;
7977                        data.allowMomentumBounce = true;
7978                    } else {
7979                        newPosition = swiper.maxTranslate();
7980                    }
7981                    if (params.loop && params.centeredSlides) needsLoopFix = true;
7982                } else if (newPosition > swiper.minTranslate()) {
7983                    if (params.freeMode.momentumBounce) {
7984                        if (newPosition - swiper.minTranslate() > bounceAmount) {
7985                            newPosition = swiper.minTranslate() + bounceAmount;
7986                        }
7987                        afterBouncePosition = swiper.minTranslate();
7988                        doBounce = true;
7989                        data.allowMomentumBounce = true;
7990                    } else {
7991                        newPosition = swiper.minTranslate();
7992                    }
7993                    if (params.loop && params.centeredSlides) needsLoopFix = true;
7994                } else if (params.freeMode.sticky) {
7995                    let nextSlide;
7996                    for (let j = 0; j < snapGrid.length; j += 1) {
7997                        if (snapGrid[j] > -newPosition) {
7998                            nextSlide = j;
7999                            break;
8000                        }
8001                    }
8002                    if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') {
8003                        newPosition = snapGrid[nextSlide];
8004                    } else {
8005                        newPosition = snapGrid[nextSlide - 1];
8006                    }
8007                    newPosition = -newPosition;
8008                }
8009                if (needsLoopFix) {
8010                    once('transitionEnd', () => {
8011                        swiper.loopFix();
8012                    });
8013                }
8014                // Fix duration
8015                if (swiper.velocity !== 0) {
8016                    if (rtl) {
8017                        momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity);
8018                    } else {
8019                        momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity);
8020                    }
8021                    if (params.freeMode.sticky) {
8022                        // If freeMode.sticky is active and the user ends a swipe with a slow-velocity
8023                        // event, then durations can be 20+ seconds to slide one (or zero!) slides.
8024                        // It's easy to see this when simulating touch with mouse events. To fix this,
8025                        // limit single-slide swipes to the default slide duration. This also has the
8026                        // nice side effect of matching slide speed if the user stopped moving before
8027                        // lifting finger or mouse vs. moving slowly before lifting the finger/mouse.
8028                        // For faster swipes, also apply limits (albeit higher ones).
8029                        const moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate);
8030                        const currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex];
8031                        if (moveDistance < currentSlideSize) {
8032                            momentumDuration = params.speed;
8033                        } else if (moveDistance < 2 * currentSlideSize) {
8034                            momentumDuration = params.speed * 1.5;
8035                        } else {
8036                            momentumDuration = params.speed * 2.5;
8037                        }
8038                    }
8039                } else if (params.freeMode.sticky) {
8040                    swiper.slideToClosest();
8041                    return;
8042                }
8043                if (params.freeMode.momentumBounce && doBounce) {
8044                    swiper.updateProgress(afterBouncePosition);
8045                    swiper.setTransition(momentumDuration);
8046                    swiper.setTranslate(newPosition);
8047                    swiper.transitionStart(true, swiper.swipeDirection);
8048                    swiper.animating = true;
8049                    elementTransitionEnd(wrapperEl, () => {
8050                        if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return;
8051                        emit('momentumBounce');
8052                        swiper.setTransition(params.speed);
8053                        setTimeout(() => {
8054                            swiper.setTranslate(afterBouncePosition);
8055                            elementTransitionEnd(wrapperEl, () => {
8056                                if (!swiper || swiper.destroyed) return;
8057                                swiper.transitionEnd();
8058                            });
8059                        }, 0);
8060                    });
8061                } else if (swiper.velocity) {
8062                    emit('_freeModeNoMomentumRelease');
8063                    swiper.updateProgress(newPosition);
8064                    swiper.setTransition(momentumDuration);
8065                    swiper.setTranslate(newPosition);
8066                    swiper.transitionStart(true, swiper.swipeDirection);
8067                    if (!swiper.animating) {
8068                        swiper.animating = true;
8069                        elementTransitionEnd(wrapperEl, () => {
8070                            if (!swiper || swiper.destroyed) return;
8071                            swiper.transitionEnd();
8072                        });
8073                    }
8074                } else {
8075                    swiper.updateProgress(newPosition);
8076                }
8077                swiper.updateActiveIndex();
8078                swiper.updateSlidesClasses();
8079            } else if (params.freeMode.sticky) {
8080                swiper.slideToClosest();
8081                return;
8082            } else if (params.freeMode) {
8083                emit('_freeModeNoMomentumRelease');
8084            }
8085            if (!params.freeMode.momentum || timeDiff >= params.longSwipesMs) {
8086                swiper.updateProgress();
8087                swiper.updateActiveIndex();
8088                swiper.updateSlidesClasses();
8089            }
8090        }
8091        Object.assign(swiper, {
8092            freeMode: {
8093                onTouchStart,
8094                onTouchMove,
8095                onTouchEnd
8096            }
8097        });
8098    }
8099
8100    function Grid(_ref) {
8101        let {
8102            swiper,
8103            extendParams,
8104            on
8105        } = _ref;
8106        extendParams({
8107            grid: {
8108                rows: 1,
8109                fill: 'column'
8110            }
8111        });
vendor: 6,450 bytes, lines 8112-8267
8112        let slidesNumberEvenToRows;
8113        let slidesPerRow;
8114        let numFullColumns;
8115        let wasMultiRow;
8116        const getSpaceBetween = () => {
8117            let spaceBetween = swiper.params.spaceBetween;
8118            if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
8119                spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiper.size;
8120            } else if (typeof spaceBetween === 'string') {
8121                spaceBetween = parseFloat(spaceBetween);
8122            }
8123            return spaceBetween;
8124        };
8125        const initSlides = slidesLength => {
8126            const {
8127                slidesPerView
8128            } = swiper.params;
8129            const {
8130                rows,
8131                fill
8132            } = swiper.params.grid;
8133            numFullColumns = Math.floor(slidesLength / rows);
8134            if (Math.floor(slidesLength / rows) === slidesLength / rows) {
8135                slidesNumberEvenToRows = slidesLength;
8136            } else {
8137                slidesNumberEvenToRows = Math.ceil(slidesLength / rows) * rows;
8138            }
8139            if (slidesPerView !== 'auto' && fill === 'row') {
8140                slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, slidesPerView * rows);
8141            }
8142            slidesPerRow = slidesNumberEvenToRows / rows;
8143        };
8144        const updateSlide = (i, slide, slidesLength, getDirectionLabel) => {
8145            const {
8146                slidesPerGroup
8147            } = swiper.params;
8148            const spaceBetween = getSpaceBetween();
8149            const {
8150                rows,
8151                fill
8152            } = swiper.params.grid;
8153            // Set slides order
8154            let newSlideOrderIndex;
8155            let column;
8156            let row;
8157            if (fill === 'row' && slidesPerGroup > 1) {
8158                const groupIndex = Math.floor(i / (slidesPerGroup * rows));
8159                const slideIndexInGroup = i - rows * slidesPerGroup * groupIndex;
8160                const columnsInGroup = groupIndex === 0 ? slidesPerGroup : Math.min(Math.ceil((slidesLength - groupIndex * rows * slidesPerGroup) / rows), slidesPerGroup);
8161                row = Math.floor(slideIndexInGroup / columnsInGroup);
8162                column = slideIndexInGroup - row * columnsInGroup + groupIndex * slidesPerGroup;
8163                newSlideOrderIndex = column + row * slidesNumberEvenToRows / rows;
8164                slide.style.order = newSlideOrderIndex;
8165            } else if (fill === 'column') {
8166                column = Math.floor(i / rows);
8167                row = i - column * rows;
8168                if (column > numFullColumns || column === numFullColumns && row === rows - 1) {
8169                    row += 1;
8170                    if (row >= rows) {
8171                        row = 0;
8172                        column += 1;
8173                    }
8174                }
8175            } else {
8176                row = Math.floor(i / slidesPerRow);
8177                column = i - row * slidesPerRow;
8178            }
8179            slide.row = row;
8180            slide.column = column;
8181            slide.style[getDirectionLabel('margin-top')] = row !== 0 ? spaceBetween && `${spaceBetween}px` : '';
8182        };
8183        const updateWrapperSize = (slideSize, snapGrid, getDirectionLabel) => {
8184            const {
8185                centeredSlides,
8186                roundLengths
8187            } = swiper.params;
8188            const spaceBetween = getSpaceBetween();
8189            const {
8190                rows
8191            } = swiper.params.grid;
8192            swiper.virtualSize = (slideSize + spaceBetween) * slidesNumberEvenToRows;
8193            swiper.virtualSize = Math.ceil(swiper.virtualSize / rows) - spaceBetween;
8194            swiper.wrapperEl.style[getDirectionLabel('width')] = `${swiper.virtualSize + spaceBetween}px`;
8195            if (centeredSlides) {
8196                const newSlidesGrid = [];
8197                for (let i = 0; i < snapGrid.length; i += 1) {
8198                    let slidesGridItem = snapGrid[i];
8199                    if (roundLengths) slidesGridItem = Math.floor(slidesGridItem);
8200                    if (snapGrid[i] < swiper.virtualSize + snapGrid[0]) newSlidesGrid.push(slidesGridItem);
8201                }
8202                snapGrid.splice(0, snapGrid.length);
8203                snapGrid.push(...newSlidesGrid);
8204            }
8205        };
8206        const onInit = () => {
8207            wasMultiRow = swiper.params.grid && swiper.params.grid.rows > 1;
8208        };
8209        const onUpdate = () => {
8210            const {
8211                params,
8212                el
8213            } = swiper;
8214            const isMultiRow = params.grid && params.grid.rows > 1;
8215            if (wasMultiRow && !isMultiRow) {
8216                el.classList.remove(`${params.containerModifierClass}grid`, `${params.containerModifierClass}grid-column`);
8217                numFullColumns = 1;
8218                swiper.emitContainerClasses();
8219            } else if (!wasMultiRow && isMultiRow) {
8220                el.classList.add(`${params.containerModifierClass}grid`);
8221                if (params.grid.fill === 'column') {
8222                    el.classList.add(`${params.containerModifierClass}grid-column`);
8223                }
8224                swiper.emitContainerClasses();
8225            }
8226            wasMultiRow = isMultiRow;
8227        };
8228        on('init', onInit);
8229        on('update', onUpdate);
8230        swiper.grid = {
8231            initSlides,
8232            updateSlide,
8233            updateWrapperSize
8234        };
8235    }
8236
8237    function appendSlide(slides) {
8238        const swiper = this;
8239        const {
8240            params,
8241            slidesEl
8242        } = swiper;
8243        if (params.loop) {
8244            swiper.loopDestroy();
8245        }
8246        const appendElement = slideEl => {
8247            if (typeof slideEl === 'string') {
8248                const tempDOM = document.createElement('div');
8249                tempDOM.innerHTML = slideEl;
8250                slidesEl.append(tempDOM.children[0]);
8251                tempDOM.innerHTML = '';
8252            } else {
8253                slidesEl.append(slideEl);
8254            }
8255        };
8256        if (typeof slides === 'object' && 'length' in slides) {
8257            for (let i = 0; i < slides.length; i += 1) {
8258                if (slides[i]) appendElement(slides[i]);
8259            }
8260        } else {
8261            appendElement(slides);
8262        }
8263        swiper.recalcSlides();
8264        if (params.loop) {
8265            swiper.loopCreate();
8266        }
8267        if (!params.observer || swiper.isElement) {
vendor: 41,794 bytes, lines 8268-9269
8268            swiper.update();
8269        }
8270    }
8271
8272    function prependSlide(slides) {
8273        const swiper = this;
8274        const {
8275            params,
8276            activeIndex,
8277            slidesEl
8278        } = swiper;
8279        if (params.loop) {
8280            swiper.loopDestroy();
8281        }
8282        let newActiveIndex = activeIndex + 1;
8283        const prependElement = slideEl => {
8284            if (typeof slideEl === 'string') {
8285                const tempDOM = document.createElement('div');
8286                tempDOM.innerHTML = slideEl;
8287                slidesEl.prepend(tempDOM.children[0]);
8288                tempDOM.innerHTML = '';
8289            } else {
8290                slidesEl.prepend(slideEl);
8291            }
8292        };
8293        if (typeof slides === 'object' && 'length' in slides) {
8294            for (let i = 0; i < slides.length; i += 1) {
8295                if (slides[i]) prependElement(slides[i]);
8296            }
8297            newActiveIndex = activeIndex + slides.length;
8298        } else {
8299            prependElement(slides);
8300        }
8301        swiper.recalcSlides();
8302        if (params.loop) {
8303            swiper.loopCreate();
8304        }
8305        if (!params.observer || swiper.isElement) {
8306            swiper.update();
8307        }
8308        swiper.slideTo(newActiveIndex, 0, false);
8309    }
8310
8311    function addSlide(index, slides) {
8312        const swiper = this;
8313        const {
8314            params,
8315            activeIndex,
8316            slidesEl
8317        } = swiper;
8318        let activeIndexBuffer = activeIndex;
8319        if (params.loop) {
8320            activeIndexBuffer -= swiper.loopedSlides;
8321            swiper.loopDestroy();
8322            swiper.recalcSlides();
8323        }
8324        const baseLength = swiper.slides.length;
8325        if (index <= 0) {
8326            swiper.prependSlide(slides);
8327            return;
8328        }
8329        if (index >= baseLength) {
8330            swiper.appendSlide(slides);
8331            return;
8332        }
8333        let newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + 1 : activeIndexBuffer;
8334        const slidesBuffer = [];
8335        for (let i = baseLength - 1; i >= index; i -= 1) {
8336            const currentSlide = swiper.slides[i];
8337            currentSlide.remove();
8338            slidesBuffer.unshift(currentSlide);
8339        }
8340        if (typeof slides === 'object' && 'length' in slides) {
8341            for (let i = 0; i < slides.length; i += 1) {
8342                if (slides[i]) slidesEl.append(slides[i]);
8343            }
8344            newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + slides.length : activeIndexBuffer;
8345        } else {
8346            slidesEl.append(slides);
8347        }
8348        for (let i = 0; i < slidesBuffer.length; i += 1) {
8349            slidesEl.append(slidesBuffer[i]);
8350        }
8351        swiper.recalcSlides();
8352        if (params.loop) {
8353            swiper.loopCreate();
8354        }
8355        if (!params.observer || swiper.isElement) {
8356            swiper.update();
8357        }
8358        if (params.loop) {
8359            swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);
8360        } else {
8361            swiper.slideTo(newActiveIndex, 0, false);
8362        }
8363    }
8364
8365    function removeSlide(slidesIndexes) {
8366        const swiper = this;
8367        const {
8368            params,
8369            activeIndex
8370        } = swiper;
8371        let activeIndexBuffer = activeIndex;
8372        if (params.loop) {
8373            activeIndexBuffer -= swiper.loopedSlides;
8374            swiper.loopDestroy();
8375        }
8376        let newActiveIndex = activeIndexBuffer;
8377        let indexToRemove;
8378        if (typeof slidesIndexes === 'object' && 'length' in slidesIndexes) {
8379            for (let i = 0; i < slidesIndexes.length; i += 1) {
8380                indexToRemove = slidesIndexes[i];
8381                if (swiper.slides[indexToRemove]) swiper.slides[indexToRemove].remove();
8382                if (indexToRemove < newActiveIndex) newActiveIndex -= 1;
8383            }
8384            newActiveIndex = Math.max(newActiveIndex, 0);
8385        } else {
8386            indexToRemove = slidesIndexes;
8387            if (swiper.slides[indexToRemove]) swiper.slides[indexToRemove].remove();
8388            if (indexToRemove < newActiveIndex) newActiveIndex -= 1;
8389            newActiveIndex = Math.max(newActiveIndex, 0);
8390        }
8391        swiper.recalcSlides();
8392        if (params.loop) {
8393            swiper.loopCreate();
8394        }
8395        if (!params.observer || swiper.isElement) {
8396            swiper.update();
8397        }
8398        if (params.loop) {
8399            swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);
8400        } else {
8401            swiper.slideTo(newActiveIndex, 0, false);
8402        }
8403    }
8404
8405    function removeAllSlides() {
8406        const swiper = this;
8407        const slidesIndexes = [];
8408        for (let i = 0; i < swiper.slides.length; i += 1) {
8409            slidesIndexes.push(i);
8410        }
8411        swiper.removeSlide(slidesIndexes);
8412    }
8413
8414    function Manipulation(_ref) {
8415        let {
8416            swiper
8417        } = _ref;
8418        Object.assign(swiper, {
8419            appendSlide: appendSlide.bind(swiper),
8420            prependSlide: prependSlide.bind(swiper),
8421            addSlide: addSlide.bind(swiper),
8422            removeSlide: removeSlide.bind(swiper),
8423            removeAllSlides: removeAllSlides.bind(swiper)
8424        });
8425    }
8426
8427    function effectInit(params) {
8428        const {
8429            effect,
8430            swiper,
8431            on,
8432            setTranslate,
8433            setTransition,
8434            overwriteParams,
8435            perspective,
8436            recreateShadows,
8437            getEffectParams
8438        } = params;
8439        on('beforeInit', () => {
8440            if (swiper.params.effect !== effect) return;
8441            swiper.classNames.push(`${swiper.params.containerModifierClass}${effect}`);
8442            if (perspective && perspective()) {
8443                swiper.classNames.push(`${swiper.params.containerModifierClass}3d`);
8444            }
8445            const overwriteParamsResult = overwriteParams ? overwriteParams() : {};
8446            Object.assign(swiper.params, overwriteParamsResult);
8447            Object.assign(swiper.originalParams, overwriteParamsResult);
8448        });
8449        on('setTranslate', () => {
8450            if (swiper.params.effect !== effect) return;
8451            setTranslate();
8452        });
8453        on('setTransition', (_s, duration) => {
8454            if (swiper.params.effect !== effect) return;
8455            setTransition(duration);
8456        });
8457        on('transitionEnd', () => {
8458            if (swiper.params.effect !== effect) return;
8459            if (recreateShadows) {
8460                if (!getEffectParams || !getEffectParams().slideShadows) return;
8461                // remove shadows
8462                swiper.slides.forEach(slideEl => {
8463                    slideEl.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(shadowEl => shadowEl.remove());
8464                });
8465                // create new one
8466                recreateShadows();
8467            }
8468        });
8469        let requireUpdateOnVirtual;
8470        on('virtualUpdate', () => {
8471            if (swiper.params.effect !== effect) return;
8472            if (!swiper.slides.length) {
8473                requireUpdateOnVirtual = true;
8474            }
8475            requestAnimationFrame(() => {
8476                if (requireUpdateOnVirtual && swiper.slides && swiper.slides.length) {
8477                    setTranslate();
8478                    requireUpdateOnVirtual = false;
8479                }
8480            });
8481        });
8482    }
8483
8484    function effectTarget(effectParams, slideEl) {
8485        const transformEl = getSlideTransformEl(slideEl);
8486        if (transformEl !== slideEl) {
8487            transformEl.style.backfaceVisibility = 'hidden';
8488            transformEl.style['-webkit-backface-visibility'] = 'hidden';
8489        }
8490        return transformEl;
8491    }
8492
8493    function effectVirtualTransitionEnd(_ref) {
8494        let {
8495            swiper,
8496            duration,
8497            transformElements,
8498            allSlides
8499        } = _ref;
8500        const {
8501            activeIndex
8502        } = swiper;
8503        const getSlide = el => {
8504            if (!el.parentElement) {
8505                // assume shadow root
8506                const slide = swiper.slides.filter(slideEl => slideEl.shadowRoot && slideEl.shadowRoot === el.parentNode)[0];
8507                return slide;
8508            }
8509            return el.parentElement;
8510        };
8511        if (swiper.params.virtualTranslate && duration !== 0) {
8512            let eventTriggered = false;
8513            let transitionEndTarget;
8514            if (allSlides) {
8515                transitionEndTarget = transformElements;
8516            } else {
8517                transitionEndTarget = transformElements.filter(transformEl => {
8518                    const el = transformEl.classList.contains('swiper-slide-transform') ? getSlide(transformEl) : transformEl;
8519                    return swiper.getSlideIndex(el) === activeIndex;
8520                });
8521            }
8522            transitionEndTarget.forEach(el => {
8523                elementTransitionEnd(el, () => {
8524                    if (eventTriggered) return;
8525                    if (!swiper || swiper.destroyed) return;
8526                    eventTriggered = true;
8527                    swiper.animating = false;
8528                    const evt = new window.CustomEvent('transitionend', {
8529                        bubbles: true,
8530                        cancelable: true
8531                    });
8532                    swiper.wrapperEl.dispatchEvent(evt);
8533                });
8534            });
8535        }
8536    }
8537
8538    function EffectFade(_ref) {
8539        let {
8540            swiper,
8541            extendParams,
8542            on
8543        } = _ref;
8544        extendParams({
8545            fadeEffect: {
8546                crossFade: false
8547            }
8548        });
8549        const setTranslate = () => {
8550            const {
8551                slides
8552            } = swiper;
8553            const params = swiper.params.fadeEffect;
8554            for (let i = 0; i < slides.length; i += 1) {
8555                const slideEl = swiper.slides[i];
8556                const offset = slideEl.swiperSlideOffset;
8557                let tx = -offset;
8558                if (!swiper.params.virtualTranslate) tx -= swiper.translate;
8559                let ty = 0;
8560                if (!swiper.isHorizontal()) {
8561                    ty = tx;
8562                    tx = 0;
8563                }
8564                const slideOpacity = swiper.params.fadeEffect.crossFade ? Math.max(1 - Math.abs(slideEl.progress), 0) : 1 + Math.min(Math.max(slideEl.progress, -1), 0);
8565                const targetEl = effectTarget(params, slideEl);
8566                targetEl.style.opacity = slideOpacity;
8567                targetEl.style.transform = `translate3d(${tx}px, ${ty}px, 0px)`;
8568            }
8569        };
8570        const setTransition = duration => {
8571            const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl));
8572            transformElements.forEach(el => {
8573                el.style.transitionDuration = `${duration}ms`;
8574            });
8575            effectVirtualTransitionEnd({
8576                swiper,
8577                duration,
8578                transformElements,
8579                allSlides: true
8580            });
8581        };
8582        effectInit({
8583            effect: 'fade',
8584            swiper,
8585            on,
8586            setTranslate,
8587            setTransition,
8588            overwriteParams: () => ({
8589                slidesPerView: 1,
8590                slidesPerGroup: 1,
8591                watchSlidesProgress: true,
8592                spaceBetween: 0,
8593                virtualTranslate: !swiper.params.cssMode
8594            })
8595        });
8596    }
8597
8598    function EffectCube(_ref) {
8599        let {
8600            swiper,
8601            extendParams,
8602            on
8603        } = _ref;
8604        extendParams({
8605            cubeEffect: {
8606                slideShadows: true,
8607                shadow: true,
8608                shadowOffset: 20,
8609                shadowScale: 0.94
8610            }
8611        });
8612        const createSlideShadows = (slideEl, progress, isHorizontal) => {
8613            let shadowBefore = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-left') : slideEl.querySelector('.swiper-slide-shadow-top');
8614            let shadowAfter = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-right') : slideEl.querySelector('.swiper-slide-shadow-bottom');
8615            if (!shadowBefore) {
8616                shadowBefore = createElement('div', `swiper-slide-shadow-cube swiper-slide-shadow-${isHorizontal ? 'left' : 'top'}`.split(' '));
8617                slideEl.append(shadowBefore);
8618            }
8619            if (!shadowAfter) {
8620                shadowAfter = createElement('div', `swiper-slide-shadow-cube swiper-slide-shadow-${isHorizontal ? 'right' : 'bottom'}`.split(' '));
8621                slideEl.append(shadowAfter);
8622            }
8623            if (shadowBefore) shadowBefore.style.opacity = Math.max(-progress, 0);
8624            if (shadowAfter) shadowAfter.style.opacity = Math.max(progress, 0);
8625        };
8626        const recreateShadows = () => {
8627            // create new ones
8628            const isHorizontal = swiper.isHorizontal();
8629            swiper.slides.forEach(slideEl => {
8630                const progress = Math.max(Math.min(slideEl.progress, 1), -1);
8631                createSlideShadows(slideEl, progress, isHorizontal);
8632            });
8633        };
8634        const setTranslate = () => {
8635            const {
8636                el,
8637                wrapperEl,
8638                slides,
8639                width: swiperWidth,
8640                height: swiperHeight,
8641                rtlTranslate: rtl,
8642                size: swiperSize,
8643                browser
8644            } = swiper;
8645            const params = swiper.params.cubeEffect;
8646            const isHorizontal = swiper.isHorizontal();
8647            const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
8648            let wrapperRotate = 0;
8649            let cubeShadowEl;
8650            if (params.shadow) {
8651                if (isHorizontal) {
8652                    cubeShadowEl = swiper.wrapperEl.querySelector('.swiper-cube-shadow');
8653                    if (!cubeShadowEl) {
8654                        cubeShadowEl = createElement('div', 'swiper-cube-shadow');
8655                        swiper.wrapperEl.append(cubeShadowEl);
8656                    }
8657                    cubeShadowEl.style.height = `${swiperWidth}px`;
8658                } else {
8659                    cubeShadowEl = el.querySelector('.swiper-cube-shadow');
8660                    if (!cubeShadowEl) {
8661                        cubeShadowEl = createElement('div', 'swiper-cube-shadow');
8662                        el.append(cubeShadowEl);
8663                    }
8664                }
8665            }
8666            for (let i = 0; i < slides.length; i += 1) {
8667                const slideEl = slides[i];
8668                let slideIndex = i;
8669                if (isVirtual) {
8670                    slideIndex = parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10);
8671                }
8672                let slideAngle = slideIndex * 90;
8673                let round = Math.floor(slideAngle / 360);
8674                if (rtl) {
8675                    slideAngle = -slideAngle;
8676                    round = Math.floor(-slideAngle / 360);
8677                }
8678                const progress = Math.max(Math.min(slideEl.progress, 1), -1);
8679                let tx = 0;
8680                let ty = 0;
8681                let tz = 0;
8682                if (slideIndex % 4 === 0) {
8683                    tx = -round * 4 * swiperSize;
8684                    tz = 0;
8685                } else if ((slideIndex - 1) % 4 === 0) {
8686                    tx = 0;
8687                    tz = -round * 4 * swiperSize;
8688                } else if ((slideIndex - 2) % 4 === 0) {
8689                    tx = swiperSize + round * 4 * swiperSize;
8690                    tz = swiperSize;
8691                } else if ((slideIndex - 3) % 4 === 0) {
8692                    tx = -swiperSize;
8693                    tz = 3 * swiperSize + swiperSize * 4 * round;
8694                }
8695                if (rtl) {
8696                    tx = -tx;
8697                }
8698                if (!isHorizontal) {
8699                    ty = tx;
8700                    tx = 0;
8701                }
8702                const transform = `rotateX(${isHorizontal ? 0 : -slideAngle}deg) rotateY(${isHorizontal ? slideAngle : 0}deg) translate3d(${tx}px, ${ty}px, ${tz}px)`;
8703                if (progress <= 1 && progress > -1) {
8704                    wrapperRotate = slideIndex * 90 + progress * 90;
8705                    if (rtl) wrapperRotate = -slideIndex * 90 - progress * 90;
8706                }
8707                slideEl.style.transform = transform;
8708                if (params.slideShadows) {
8709                    createSlideShadows(slideEl, progress, isHorizontal);
8710                }
8711            }
8712            wrapperEl.style.transformOrigin = `50% 50% -${swiperSize / 2}px`;
8713            wrapperEl.style['-webkit-transform-origin'] = `50% 50% -${swiperSize / 2}px`;
8714            if (params.shadow) {
8715                if (isHorizontal) {
8716                    cubeShadowEl.style.transform = `translate3d(0px, ${swiperWidth / 2 + params.shadowOffset}px, ${-swiperWidth / 2}px) rotateX(90deg) rotateZ(0deg) scale(${params.shadowScale})`;
8717                } else {
8718                    const shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90;
8719                    const multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2);
8720                    const scale1 = params.shadowScale;
8721                    const scale2 = params.shadowScale / multiplier;
8722                    const offset = params.shadowOffset;
8723                    cubeShadowEl.style.transform = `scale3d(${scale1}, 1, ${scale2}) translate3d(0px, ${swiperHeight / 2 + offset}px, ${-swiperHeight / 2 / scale2}px) rotateX(-90deg)`;
8724                }
8725            }
8726            const zFactor = (browser.isSafari || browser.isWebView) && browser.needPerspectiveFix ? -swiperSize / 2 : 0;
8727            wrapperEl.style.transform = `translate3d(0px,0,${zFactor}px) rotateX(${swiper.isHorizontal() ? 0 : wrapperRotate}deg) rotateY(${swiper.isHorizontal() ? -wrapperRotate : 0}deg)`;
8728            wrapperEl.style.setProperty('--swiper-cube-translate-z', `${zFactor}px`);
8729        };
8730        const setTransition = duration => {
8731            const {
8732                el,
8733                slides
8734            } = swiper;
8735            slides.forEach(slideEl => {
8736                slideEl.style.transitionDuration = `${duration}ms`;
8737                slideEl.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(subEl => {
8738                    subEl.style.transitionDuration = `${duration}ms`;
8739                });
8740            });
8741            if (swiper.params.cubeEffect.shadow && !swiper.isHorizontal()) {
8742                const shadowEl = el.querySelector('.swiper-cube-shadow');
8743                if (shadowEl) shadowEl.style.transitionDuration = `${duration}ms`;
8744            }
8745        };
8746        effectInit({
8747            effect: 'cube',
8748            swiper,
8749            on,
8750            setTranslate,
8751            setTransition,
8752            recreateShadows,
8753            getEffectParams: () => swiper.params.cubeEffect,
8754            perspective: () => true,
8755            overwriteParams: () => ({
8756                slidesPerView: 1,
8757                slidesPerGroup: 1,
8758                watchSlidesProgress: true,
8759                resistanceRatio: 0,
8760                spaceBetween: 0,
8761                centeredSlides: false,
8762                virtualTranslate: true
8763            })
8764        });
8765    }
8766
8767    function createShadow(suffix, slideEl, side) {
8768        const shadowClass = `swiper-slide-shadow${side ? `-${side}` : ''}${suffix ? ` swiper-slide-shadow-${suffix}` : ''}`;
8769        const shadowContainer = getSlideTransformEl(slideEl);
8770        let shadowEl = shadowContainer.querySelector(`.${shadowClass.split(' ').join('.')}`);
8771        if (!shadowEl) {
8772            shadowEl = createElement('div', shadowClass.split(' '));
8773            shadowContainer.append(shadowEl);
8774        }
8775        return shadowEl;
8776    }
8777
8778    function EffectFlip(_ref) {
8779        let {
8780            swiper,
8781            extendParams,
8782            on
8783        } = _ref;
8784        extendParams({
8785            flipEffect: {
8786                slideShadows: true,
8787                limitRotation: true
8788            }
8789        });
8790        const createSlideShadows = (slideEl, progress) => {
8791            let shadowBefore = swiper.isHorizontal() ? slideEl.querySelector('.swiper-slide-shadow-left') : slideEl.querySelector('.swiper-slide-shadow-top');
8792            let shadowAfter = swiper.isHorizontal() ? slideEl.querySelector('.swiper-slide-shadow-right') : slideEl.querySelector('.swiper-slide-shadow-bottom');
8793            if (!shadowBefore) {
8794                shadowBefore = createShadow('flip', slideEl, swiper.isHorizontal() ? 'left' : 'top');
8795            }
8796            if (!shadowAfter) {
8797                shadowAfter = createShadow('flip', slideEl, swiper.isHorizontal() ? 'right' : 'bottom');
8798            }
8799            if (shadowBefore) shadowBefore.style.opacity = Math.max(-progress, 0);
8800            if (shadowAfter) shadowAfter.style.opacity = Math.max(progress, 0);
8801        };
8802        const recreateShadows = () => {
8803            // Set shadows
8804            swiper.params.flipEffect;
8805            swiper.slides.forEach(slideEl => {
8806                let progress = slideEl.progress;
8807                if (swiper.params.flipEffect.limitRotation) {
8808                    progress = Math.max(Math.min(slideEl.progress, 1), -1);
8809                }
8810                createSlideShadows(slideEl, progress);
8811            });
8812        };
8813        const setTranslate = () => {
8814            const {
8815                slides,
8816                rtlTranslate: rtl
8817            } = swiper;
8818            const params = swiper.params.flipEffect;
8819            for (let i = 0; i < slides.length; i += 1) {
8820                const slideEl = slides[i];
8821                let progress = slideEl.progress;
8822                if (swiper.params.flipEffect.limitRotation) {
8823                    progress = Math.max(Math.min(slideEl.progress, 1), -1);
8824                }
8825                const offset = slideEl.swiperSlideOffset;
8826                const rotate = -180 * progress;
8827                let rotateY = rotate;
8828                let rotateX = 0;
8829                let tx = swiper.params.cssMode ? -offset - swiper.translate : -offset;
8830                let ty = 0;
8831                if (!swiper.isHorizontal()) {
8832                    ty = tx;
8833                    tx = 0;
8834                    rotateX = -rotateY;
8835                    rotateY = 0;
8836                } else if (rtl) {
8837                    rotateY = -rotateY;
8838                }
8839                slideEl.style.zIndex = -Math.abs(Math.round(progress)) + slides.length;
8840                if (params.slideShadows) {
8841                    createSlideShadows(slideEl, progress);
8842                }
8843                const transform = `translate3d(${tx}px, ${ty}px, 0px) rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;
8844                const targetEl = effectTarget(params, slideEl);
8845                targetEl.style.transform = transform;
8846            }
8847        };
8848        const setTransition = duration => {
8849            const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl));
8850            transformElements.forEach(el => {
8851                el.style.transitionDuration = `${duration}ms`;
8852                el.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(shadowEl => {
8853                    shadowEl.style.transitionDuration = `${duration}ms`;
8854                });
8855            });
8856            effectVirtualTransitionEnd({
8857                swiper,
8858                duration,
8859                transformElements
8860            });
8861        };
8862        effectInit({
8863            effect: 'flip',
8864            swiper,
8865            on,
8866            setTranslate,
8867            setTransition,
8868            recreateShadows,
8869            getEffectParams: () => swiper.params.flipEffect,
8870            perspective: () => true,
8871            overwriteParams: () => ({
8872                slidesPerView: 1,
8873                slidesPerGroup: 1,
8874                watchSlidesProgress: true,
8875                spaceBetween: 0,
8876                virtualTranslate: !swiper.params.cssMode
8877            })
8878        });
8879    }
8880
8881    function EffectCoverflow(_ref) {
8882        let {
8883            swiper,
8884            extendParams,
8885            on
8886        } = _ref;
8887        extendParams({
8888            coverflowEffect: {
8889                rotate: 50,
8890                stretch: 0,
8891                depth: 100,
8892                scale: 1,
8893                modifier: 1,
8894                slideShadows: true
8895            }
8896        });
8897        const setTranslate = () => {
8898            const {
8899                width: swiperWidth,
8900                height: swiperHeight,
8901                slides,
8902                slidesSizesGrid
8903            } = swiper;
8904            const params = swiper.params.coverflowEffect;
8905            const isHorizontal = swiper.isHorizontal();
8906            const transform = swiper.translate;
8907            const center = isHorizontal ? -transform + swiperWidth / 2 : -transform + swiperHeight / 2;
8908            const rotate = isHorizontal ? params.rotate : -params.rotate;
8909            const translate = params.depth;
8910            // Each slide offset from center
8911            for (let i = 0, length = slides.length; i < length; i += 1) {
8912                const slideEl = slides[i];
8913                const slideSize = slidesSizesGrid[i];
8914                const slideOffset = slideEl.swiperSlideOffset;
8915                const centerOffset = (center - slideOffset - slideSize / 2) / slideSize;
8916                const offsetMultiplier = typeof params.modifier === 'function' ? params.modifier(centerOffset) : centerOffset * params.modifier;
8917                let rotateY = isHorizontal ? rotate * offsetMultiplier : 0;
8918                let rotateX = isHorizontal ? 0 : rotate * offsetMultiplier;
8919                // var rotateZ = 0
8920                let translateZ = -translate * Math.abs(offsetMultiplier);
8921                let stretch = params.stretch;
8922                // Allow percentage to make a relative stretch for responsive sliders
8923                if (typeof stretch === 'string' && stretch.indexOf('%') !== -1) {
8924                    stretch = parseFloat(params.stretch) / 100 * slideSize;
8925                }
8926                let translateY = isHorizontal ? 0 : stretch * offsetMultiplier;
8927                let translateX = isHorizontal ? stretch * offsetMultiplier : 0;
8928                let scale = 1 - (1 - params.scale) * Math.abs(offsetMultiplier);
8929
8930                // Fix for ultra small values
8931                if (Math.abs(translateX) < 0.001) translateX = 0;
8932                if (Math.abs(translateY) < 0.001) translateY = 0;
8933                if (Math.abs(translateZ) < 0.001) translateZ = 0;
8934                if (Math.abs(rotateY) < 0.001) rotateY = 0;
8935                if (Math.abs(rotateX) < 0.001) rotateX = 0;
8936                if (Math.abs(scale) < 0.001) scale = 0;
8937                const slideTransform = `translate3d(${translateX}px,${translateY}px,${translateZ}px)  rotateX(${rotateX}deg) rotateY(${rotateY}deg) scale(${scale})`;
8938                const targetEl = effectTarget(params, slideEl);
8939                targetEl.style.transform = slideTransform;
8940                slideEl.style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1;
8941                if (params.slideShadows) {
8942                    // Set shadows
8943                    let shadowBeforeEl = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-left') : slideEl.querySelector('.swiper-slide-shadow-top');
8944                    let shadowAfterEl = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-right') : slideEl.querySelector('.swiper-slide-shadow-bottom');
8945                    if (!shadowBeforeEl) {
8946                        shadowBeforeEl = createShadow('coverflow', slideEl, isHorizontal ? 'left' : 'top');
8947                    }
8948                    if (!shadowAfterEl) {
8949                        shadowAfterEl = createShadow('coverflow', slideEl, isHorizontal ? 'right' : 'bottom');
8950                    }
8951                    if (shadowBeforeEl) shadowBeforeEl.style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0;
8952                    if (shadowAfterEl) shadowAfterEl.style.opacity = -offsetMultiplier > 0 ? -offsetMultiplier : 0;
8953                }
8954            }
8955        };
8956        const setTransition = duration => {
8957            const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl));
8958            transformElements.forEach(el => {
8959                el.style.transitionDuration = `${duration}ms`;
8960                el.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(shadowEl => {
8961                    shadowEl.style.transitionDuration = `${duration}ms`;
8962                });
8963            });
8964        };
8965        effectInit({
8966            effect: 'coverflow',
8967            swiper,
8968            on,
8969            setTranslate,
8970            setTransition,
8971            perspective: () => true,
8972            overwriteParams: () => ({
8973                watchSlidesProgress: true
8974            })
8975        });
8976    }
8977
8978    function EffectCreative(_ref) {
8979        let {
8980            swiper,
8981            extendParams,
8982            on
8983        } = _ref;
8984        extendParams({
8985            creativeEffect: {
8986                limitProgress: 1,
8987                shadowPerProgress: false,
8988                progressMultiplier: 1,
8989                perspective: true,
8990                prev: {
8991                    translate: [0, 0, 0],
8992                    rotate: [0, 0, 0],
8993                    opacity: 1,
8994                    scale: 1
8995                },
8996                next: {
8997                    translate: [0, 0, 0],
8998                    rotate: [0, 0, 0],
8999                    opacity: 1,
9000                    scale: 1
9001                }
9002            }
9003        });
9004        const getTranslateValue = value => {
9005            if (typeof value === 'string') return value;
9006            return `${value}px`;
9007        };
9008        const setTranslate = () => {
9009            const {
9010                slides,
9011                wrapperEl,
9012                slidesSizesGrid
9013            } = swiper;
9014            const params = swiper.params.creativeEffect;
9015            const {
9016                progressMultiplier: multiplier
9017            } = params;
9018            const isCenteredSlides = swiper.params.centeredSlides;
9019            if (isCenteredSlides) {
9020                const margin = slidesSizesGrid[0] / 2 - swiper.params.slidesOffsetBefore || 0;
9021                wrapperEl.style.transform = `translateX(calc(50% - ${margin}px))`;
9022            }
9023            for (let i = 0; i < slides.length; i += 1) {
9024                const slideEl = slides[i];
9025                const slideProgress = slideEl.progress;
9026                const progress = Math.min(Math.max(slideEl.progress, -params.limitProgress), params.limitProgress);
9027                let originalProgress = progress;
9028                if (!isCenteredSlides) {
9029                    originalProgress = Math.min(Math.max(slideEl.originalProgress, -params.limitProgress), params.limitProgress);
9030                }
9031                const offset = slideEl.swiperSlideOffset;
9032                const t = [swiper.params.cssMode ? -offset - swiper.translate : -offset, 0, 0];
9033                const r = [0, 0, 0];
9034                let custom = false;
9035                if (!swiper.isHorizontal()) {
9036                    t[1] = t[0];
9037                    t[0] = 0;
9038                }
9039                let data = {
9040                    translate: [0, 0, 0],
9041                    rotate: [0, 0, 0],
9042                    scale: 1,
9043                    opacity: 1
9044                };
9045                if (progress < 0) {
9046                    data = params.next;
9047                    custom = true;
9048                } else if (progress > 0) {
9049                    data = params.prev;
9050                    custom = true;
9051                }
9052                // set translate
9053                t.forEach((value, index) => {
9054                    t[index] = `calc(${value}px + (${getTranslateValue(data.translate[index])} * ${Math.abs(progress * multiplier)}))`;
9055                });
9056                // set rotates
9057                r.forEach((value, index) => {
9058                    r[index] = data.rotate[index] * Math.abs(progress * multiplier);
9059                });
9060                slideEl.style.zIndex = -Math.abs(Math.round(slideProgress)) + slides.length;
9061                const translateString = t.join(', ');
9062                const rotateString = `rotateX(${r[0]}deg) rotateY(${r[1]}deg) rotateZ(${r[2]}deg)`;
9063                const scaleString = originalProgress < 0 ? `scale(${1 + (1 - data.scale) * originalProgress * multiplier})` : `scale(${1 - (1 - data.scale) * originalProgress * multiplier})`;
9064                const opacityString = originalProgress < 0 ? 1 + (1 - data.opacity) * originalProgress * multiplier : 1 - (1 - data.opacity) * originalProgress * multiplier;
9065                const transform = `translate3d(${translateString}) ${rotateString} ${scaleString}`;
9066
9067                // Set shadows
9068                if (custom && data.shadow || !custom) {
9069                    let shadowEl = slideEl.querySelector('.swiper-slide-shadow');
9070                    if (!shadowEl && data.shadow) {
9071                        shadowEl = createShadow('creative', slideEl);
9072                    }
9073                    if (shadowEl) {
9074                        const shadowOpacity = params.shadowPerProgress ? progress * (1 / params.limitProgress) : progress;
9075                        shadowEl.style.opacity = Math.min(Math.max(Math.abs(shadowOpacity), 0), 1);
9076                    }
9077                }
9078                const targetEl = effectTarget(params, slideEl);
9079                targetEl.style.transform = transform;
9080                targetEl.style.opacity = opacityString;
9081                if (data.origin) {
9082                    targetEl.style.transformOrigin = data.origin;
9083                }
9084            }
9085        };
9086        const setTransition = duration => {
9087            const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl));
9088            transformElements.forEach(el => {
9089                el.style.transitionDuration = `${duration}ms`;
9090                el.querySelectorAll('.swiper-slide-shadow').forEach(shadowEl => {
9091                    shadowEl.style.transitionDuration = `${duration}ms`;
9092                });
9093            });
9094            effectVirtualTransitionEnd({
9095                swiper,
9096                duration,
9097                transformElements,
9098                allSlides: true
9099            });
9100        };
9101        effectInit({
9102            effect: 'creative',
9103            swiper,
9104            on,
9105            setTranslate,
9106            setTransition,
9107            perspective: () => swiper.params.creativeEffect.perspective,
9108            overwriteParams: () => ({
9109                watchSlidesProgress: true,
9110                virtualTranslate: !swiper.params.cssMode
9111            })
9112        });
9113    }
9114
9115    function EffectCards(_ref) {
9116        let {
9117            swiper,
9118            extendParams,
9119            on
9120        } = _ref;
9121        extendParams({
9122            cardsEffect: {
9123                slideShadows: true,
9124                rotate: true,
9125                perSlideRotate: 2,
9126                perSlideOffset: 8
9127            }
9128        });
9129        const setTranslate = () => {
9130            const {
9131                slides,
9132                activeIndex,
9133                rtlTranslate: rtl
9134            } = swiper;
9135            const params = swiper.params.cardsEffect;
9136            const {
9137                startTranslate,
9138                isTouched
9139            } = swiper.touchEventsData;
9140            const currentTranslate = rtl ? -swiper.translate : swiper.translate;
9141            for (let i = 0; i < slides.length; i += 1) {
9142                const slideEl = slides[i];
9143                const slideProgress = slideEl.progress;
9144                const progress = Math.min(Math.max(slideProgress, -4), 4);
9145                let offset = slideEl.swiperSlideOffset;
9146                if (swiper.params.centeredSlides && !swiper.params.cssMode) {
9147                    swiper.wrapperEl.style.transform = `translateX(${swiper.minTranslate()}px)`;
9148                }
9149                if (swiper.params.centeredSlides && swiper.params.cssMode) {
9150                    offset -= slides[0].swiperSlideOffset;
9151                }
9152                let tX = swiper.params.cssMode ? -offset - swiper.translate : -offset;
9153                let tY = 0;
9154                const tZ = -100 * Math.abs(progress);
9155                let scale = 1;
9156                let rotate = -params.perSlideRotate * progress;
9157                let tXAdd = params.perSlideOffset - Math.abs(progress) * 0.75;
9158                const slideIndex = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.from + i : i;
9159                const isSwipeToNext = (slideIndex === activeIndex || slideIndex === activeIndex - 1) && progress > 0 && progress < 1 && (isTouched || swiper.params.cssMode) && currentTranslate < startTranslate;
9160                const isSwipeToPrev = (slideIndex === activeIndex || slideIndex === activeIndex + 1) && progress < 0 && progress > -1 && (isTouched || swiper.params.cssMode) && currentTranslate > startTranslate;
9161                if (isSwipeToNext || isSwipeToPrev) {
9162                    const subProgress = (1 - Math.abs((Math.abs(progress) - 0.5) / 0.5)) ** 0.5;
9163                    rotate += -28 * progress * subProgress;
9164                    scale += -0.5 * subProgress;
9165                    tXAdd += 96 * subProgress;
9166                    tY = `${-25 * subProgress * Math.abs(progress/1.5)}%`;
9167                }
9168                if (progress < 0) {
9169                    // next
9170                    tY = `calc(${tY}px ${rtl ? '+' : '-'} (${tXAdd * Math.abs(progress/1.5)}%))`;
9171                } else if (progress > 0) {
9172                    // prev
9173                    tY = `calc(${tY}px ${rtl ? '-' : '+'} (-${tXAdd * Math.abs(progress/1.5)}%))`;
9174                } else {
9175                    tY = `${tY}px`;
9176                }
9177                if (progress < 0) {
9178                    // next
9179                    tX = `calc(${tX}px)`;
9180                } else if (progress > 0) {
9181                    // prev
9182                    tX = `calc(${tX}px)`;
9183                } else {
9184                    tX = `${tX}px`;
9185                }
9186                if (!swiper.isHorizontal()) {
9187                    const prevY = tY;
9188                    tY = tX;
9189                    tX = prevY;
9190                }
9191                const scaleString = progress < 0 ? `${1 - (0 - scale * progress * 0.02)}` : `${1 + (0 - scale * progress* 0.02)}`;
9192
9193                /* eslint-disable */
9194                const transform = `
9195        translate3d(${tX}, ${tY}, ${tZ}px)
9196        rotateZ(0deg)
9197        scale(${scaleString})
9198      `;
9199                //        rotateZ(${params.rotate ? rtl ? -rotate : rotate : 0}deg)
9200                /* eslint-enable */
9201
9202                if (params.slideShadows) {
9203                    // Set shadows
9204                    let shadowEl = slideEl.querySelector('.swiper-slide-shadow');
9205                    if (!shadowEl) {
9206                        shadowEl = createShadow('cards', slideEl);
9207                    }
9208                    if (shadowEl) shadowEl.style.opacity = Math.min(Math.max((Math.abs(progress) - 0.5) / 0.5, 0), 1);
9209                }
9210                const zIndex = -Math.abs(Math.round(slideProgress)) + slides.length
9211                slideEl.style.zIndex = zIndex;
9212                const slideIsVisible = (zIndex - slides.length + 3) <= 0; // скрывать больше 3х карточек
9213                if (slideIsVisible){
9214                    slideEl.style.opacity = 0;
9215                }else {
9216                    slideEl.style.opacity = 1;
9217                }
9218                const targetEl = effectTarget(params, slideEl);
9219                targetEl.style.transform = transform;
9220            }
9221        };
9222        const setTransition = duration => {
9223            const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl));
9224            transformElements.forEach(el => {
9225                el.style.transitionDuration = `${duration}ms`;
9226                el.querySelectorAll('.swiper-slide-shadow').forEach(shadowEl => {
9227                    shadowEl.style.transitionDuration = `${duration}ms`;
9228                });
9229            });
9230            effectVirtualTransitionEnd({
9231                swiper,
9232                duration,
9233                transformElements
9234            });
9235        };
9236        effectInit({
9237            effect: 'cards',
9238            swiper,
9239            on,
9240            setTranslate,
9241            setTransition,
9242            perspective: () => true,
9243            overwriteParams: () => ({
9244                watchSlidesProgress: true,
9245                virtualTranslate: !swiper.params.cssMode
9246            })
9247        });
9248    }
9249
9250    /**
9251     * Swiper 10.3.1
9252     * Most modern mobile touch slider and framework with hardware accelerated transitions
9253     * https://swiperjs.com
9254     *
9255     * Copyright 2014-2023 Vladimir Kharlampidi
9256     *
9257     * Released under the MIT License
9258     *
9259     * Released on: September 28, 2023
9260     */
9261
9262
9263        // Swiper Class
9264    const modules = [Virtual, Keyboard, Mousewheel, Navigation, Pagination, Scrollbar, Parallax, Zoom, Controller, A11y, History, HashNavigation, Autoplay, Thumb, freeMode, Grid, Manipulation, EffectFade, EffectCube, EffectFlip, EffectCoverflow, EffectCreative, EffectCards];
9265    Swiper.use(modules);
9266
9267    return Swiper;
9268
9269})();

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.