@realsee/dnalogel 2.1.0-alpha.12 → 2.1.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('three'), require('three/examples/jsm/renderers/CSS3DRenderer'), require('@realsee/five/line'), require('svelte/internal'), require('svelte'), require('svelte/easing'), require('svelte/transition'), require('svelte/store'), require('@realsee/five'), require('three/examples/jsm/loaders/FBXLoader'), require('@tweenjs/tween.js'), require('hammerjs'), require('classnames'), require('object-assign-deep'), require('animejs'), require('swiper/svelte'), require('swiper'), require('swiper/css'), require('swiper/css/autoplay')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'three', 'three/examples/jsm/renderers/CSS3DRenderer', '@realsee/five/line', 'svelte/internal', 'svelte', 'svelte/easing', 'svelte/transition', 'svelte/store', '@realsee/five', 'three/examples/jsm/loaders/FBXLoader', '@tweenjs/tween.js', 'hammerjs', 'classnames', 'object-assign-deep', 'animejs', 'swiper/svelte', 'swiper', 'swiper/css', 'swiper/css/autoplay'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.dnalogel = {}, global.THREE, global.CSS3DRenderer, global.FiveSDK_Line, global.internal, global.svelte, global.easing, global.transition, global.store, global.five, global.FBXLoader, global.TWEEN, global.Hammer, global.classNames, global.objectAssignDeep, global.anime, global.svelte$1, global.swiper));
5
- })(this, (function (exports, THREE, CSS3DRenderer, line, internal, svelte, easing, transition, store, five, FBXLoader, TWEEN, Hammer, classNames, objectAssignDeep, anime, svelte$1, swiper) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('three'), require('three/examples/jsm/renderers/CSS3DRenderer'), require('@realsee/five/line'), require('svelte/internal'), require('svelte'), require('svelte/easing'), require('svelte/transition'), require('svelte/store'), require('@realsee/five'), require('three/examples/jsm/loaders/FBXLoader'), require('@tweenjs/tween.js'), require('hammerjs'), require('classnames'), require('object-assign-deep'), require('animejs'), require('swiper/svelte'), require('ssr-window'), require('dom7'), require('swiper/css'), require('swiper/css/autoplay')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'three', 'three/examples/jsm/renderers/CSS3DRenderer', '@realsee/five/line', 'svelte/internal', 'svelte', 'svelte/easing', 'svelte/transition', 'svelte/store', '@realsee/five', 'three/examples/jsm/loaders/FBXLoader', '@tweenjs/tween.js', 'hammerjs', 'classnames', 'object-assign-deep', 'animejs', 'swiper/svelte', 'ssr-window', 'dom7', 'swiper/css', 'swiper/css/autoplay'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.dnalogel = {}, global.THREE, global.CSS3DRenderer, global.FiveSDK_Line, global.internal, global.svelte, global.easing, global.transition$1, global.store, global.five, global.FBXLoader, global.TWEEN, global.Hammer, global.classNames, global.objectAssignDeep, global.anime, global.svelte$1, global.ssrWindow, global.dom7));
5
+ })(this, (function (exports, THREE, CSS3DRenderer, line, internal, svelte, easing, transition$1, store, five, FBXLoader, TWEEN, Hammer, classNames, objectAssignDeep, anime, svelte$1, ssrWindow, dom7) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -4864,7 +4864,7 @@
4864
4864
 
4865
4865
  if (!div_intro) {
4866
4866
  internal.add_render_callback(() => {
4867
- div_intro = internal.create_in_transition(div, transition.fade, {
4867
+ div_intro = internal.create_in_transition(div, transition$1.fade, {
4868
4868
  duration: /*duration*/ ctx[0],
4869
4869
  easing: easing.linear
4870
4870
  });
@@ -20372,7 +20372,7 @@ void main() {
20372
20372
  internal.add_render_callback(() => {
20373
20373
  if (path_outro) path_outro.end(1);
20374
20374
 
20375
- path_intro = internal.create_in_transition(path, transition.draw, {
20375
+ path_intro = internal.create_in_transition(path, transition$1.draw, {
20376
20376
  duration: /*duration*/ ctx[1],
20377
20377
  delay: /*inDelay*/ ctx[0]
20378
20378
  });
@@ -20387,7 +20387,7 @@ void main() {
20387
20387
  if (path_intro) path_intro.invalidate();
20388
20388
 
20389
20389
  if (local) {
20390
- path_outro = internal.create_out_transition(path, transition.draw, {
20390
+ path_outro = internal.create_out_transition(path, transition$1.draw, {
20391
20391
  duration: /*duration*/ ctx[1],
20392
20392
  delay: /*outDelay*/ ctx[2]
20393
20393
  });
@@ -20593,7 +20593,7 @@ void main() {
20593
20593
  if (local) {
20594
20594
  internal.add_render_callback(() => {
20595
20595
  if (div_outro) div_outro.end(1);
20596
- div_intro = internal.create_in_transition(div, transition.fade, { duration: /*inDelay*/ ctx[0] });
20596
+ div_intro = internal.create_in_transition(div, transition$1.fade, { duration: /*inDelay*/ ctx[0] });
20597
20597
  div_intro.start();
20598
20598
  });
20599
20599
  }
@@ -20604,7 +20604,7 @@ void main() {
20604
20604
  if (div_intro) div_intro.invalidate();
20605
20605
 
20606
20606
  if (local) {
20607
- div_outro = internal.create_out_transition(div, transition.fade, { duration: /*outDelay*/ ctx[1] });
20607
+ div_outro = internal.create_out_transition(div, transition$1.fade, { duration: /*outDelay*/ ctx[1] });
20608
20608
  }
20609
20609
 
20610
20610
  current = false;
@@ -21055,7 +21055,7 @@ void main() {
21055
21055
  internal.add_render_callback(() => {
21056
21056
  if (div0_outro) div0_outro.end(1);
21057
21057
 
21058
- div0_intro = internal.create_in_transition(div0, transition.fade, {
21058
+ div0_intro = internal.create_in_transition(div0, transition$1.fade, {
21059
21059
  duration: /*duration*/ ctx[2],
21060
21060
  delay: /*inDelay*/ ctx[3],
21061
21061
  easing: easing.cubicInOut
@@ -21072,7 +21072,7 @@ void main() {
21072
21072
  if (div0_intro) div0_intro.invalidate();
21073
21073
 
21074
21074
  if (local) {
21075
- div0_outro = internal.create_out_transition(div0, transition.fade, {
21075
+ div0_outro = internal.create_out_transition(div0, transition$1.fade, {
21076
21076
  duration: /*duration*/ ctx[2],
21077
21077
  delay: /*outDelay*/ ctx[4],
21078
21078
  easing: easing.cubicInOut
@@ -21791,7 +21791,7 @@ void main() {
21791
21791
  internal.add_render_callback(() => {
21792
21792
  if (path_outro) path_outro.end(1);
21793
21793
 
21794
- path_intro = internal.create_in_transition(path, transition.draw, {
21794
+ path_intro = internal.create_in_transition(path, transition$1.draw, {
21795
21795
  duration: /*duration*/ ctx[1],
21796
21796
  delay: /*inDelay*/ ctx[0],
21797
21797
  easing: easing.cubicOut
@@ -21807,7 +21807,7 @@ void main() {
21807
21807
  if (path_intro) path_intro.invalidate();
21808
21808
 
21809
21809
  if (local) {
21810
- path_outro = internal.create_out_transition(path, transition.draw, {
21810
+ path_outro = internal.create_out_transition(path, transition$1.draw, {
21811
21811
  duration: /*duration*/ ctx[1],
21812
21812
  delay: /*outDelay*/ ctx[2],
21813
21813
  easing: easing.cubicInOut
@@ -21933,6 +21933,4107 @@ void main() {
21933
21933
  }
21934
21934
  }
21935
21935
 
21936
+ const Methods = {
21937
+ addClass: dom7.addClass,
21938
+ removeClass: dom7.removeClass,
21939
+ hasClass: dom7.hasClass,
21940
+ toggleClass: dom7.toggleClass,
21941
+ attr: dom7.attr,
21942
+ removeAttr: dom7.removeAttr,
21943
+ transform: dom7.transform,
21944
+ transition: dom7.transition,
21945
+ on: dom7.on,
21946
+ off: dom7.off,
21947
+ trigger: dom7.trigger,
21948
+ transitionEnd: dom7.transitionEnd,
21949
+ outerWidth: dom7.outerWidth,
21950
+ outerHeight: dom7.outerHeight,
21951
+ styles: dom7.styles,
21952
+ offset: dom7.offset,
21953
+ css: dom7.css,
21954
+ each: dom7.each,
21955
+ html: dom7.html,
21956
+ text: dom7.text,
21957
+ is: dom7.is,
21958
+ index: dom7.index,
21959
+ eq: dom7.eq,
21960
+ append: dom7.append,
21961
+ prepend: dom7.prepend,
21962
+ next: dom7.next,
21963
+ nextAll: dom7.nextAll,
21964
+ prev: dom7.prev,
21965
+ prevAll: dom7.prevAll,
21966
+ parent: dom7.parent,
21967
+ parents: dom7.parents,
21968
+ closest: dom7.closest,
21969
+ find: dom7.find,
21970
+ children: dom7.children,
21971
+ filter: dom7.filter,
21972
+ remove: dom7.remove
21973
+ };
21974
+ Object.keys(Methods).forEach(methodName => {
21975
+ Object.defineProperty(dom7.$.fn, methodName, {
21976
+ value: Methods[methodName],
21977
+ writable: true
21978
+ });
21979
+ });
21980
+
21981
+ function deleteProps(obj) {
21982
+ const object = obj;
21983
+ Object.keys(object).forEach(key => {
21984
+ try {
21985
+ object[key] = null;
21986
+ } catch (e) {// no getter for object
21987
+ }
21988
+
21989
+ try {
21990
+ delete object[key];
21991
+ } catch (e) {// something got wrong
21992
+ }
21993
+ });
21994
+ }
21995
+
21996
+ function nextTick(callback, delay = 0) {
21997
+ return setTimeout(callback, delay);
21998
+ }
21999
+
22000
+ function now() {
22001
+ return Date.now();
22002
+ }
22003
+
22004
+ function getComputedStyle$1(el) {
22005
+ const window = ssrWindow.getWindow();
22006
+ let style;
22007
+
22008
+ if (window.getComputedStyle) {
22009
+ style = window.getComputedStyle(el, null);
22010
+ }
22011
+
22012
+ if (!style && el.currentStyle) {
22013
+ style = el.currentStyle;
22014
+ }
22015
+
22016
+ if (!style) {
22017
+ style = el.style;
22018
+ }
22019
+
22020
+ return style;
22021
+ }
22022
+
22023
+ function getTranslate(el, axis = 'x') {
22024
+ const window = ssrWindow.getWindow();
22025
+ let matrix;
22026
+ let curTransform;
22027
+ let transformMatrix;
22028
+ const curStyle = getComputedStyle$1(el);
22029
+
22030
+ if (window.WebKitCSSMatrix) {
22031
+ curTransform = curStyle.transform || curStyle.webkitTransform;
22032
+
22033
+ if (curTransform.split(',').length > 6) {
22034
+ curTransform = curTransform.split(', ').map(a => a.replace(',', '.')).join(', ');
22035
+ } // Some old versions of Webkit choke when 'none' is passed; pass
22036
+ // empty string instead in this case
22037
+
22038
+
22039
+ transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);
22040
+ } else {
22041
+ transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
22042
+ matrix = transformMatrix.toString().split(',');
22043
+ }
22044
+
22045
+ if (axis === 'x') {
22046
+ // Latest Chrome and webkits Fix
22047
+ if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41; // Crazy IE10 Matrix
22048
+ else if (matrix.length === 16) curTransform = parseFloat(matrix[12]); // Normal Browsers
22049
+ else curTransform = parseFloat(matrix[4]);
22050
+ }
22051
+
22052
+ if (axis === 'y') {
22053
+ // Latest Chrome and webkits Fix
22054
+ if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42; // Crazy IE10 Matrix
22055
+ else if (matrix.length === 16) curTransform = parseFloat(matrix[13]); // Normal Browsers
22056
+ else curTransform = parseFloat(matrix[5]);
22057
+ }
22058
+
22059
+ return curTransform || 0;
22060
+ }
22061
+
22062
+ function isObject(o) {
22063
+ return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object';
22064
+ }
22065
+
22066
+ function isNode(node) {
22067
+ // eslint-disable-next-line
22068
+ if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') {
22069
+ return node instanceof HTMLElement;
22070
+ }
22071
+
22072
+ return node && (node.nodeType === 1 || node.nodeType === 11);
22073
+ }
22074
+
22075
+ function extend(...args) {
22076
+ const to = Object(args[0]);
22077
+ const noExtend = ['__proto__', 'constructor', 'prototype'];
22078
+
22079
+ for (let i = 1; i < args.length; i += 1) {
22080
+ const nextSource = args[i];
22081
+
22082
+ if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) {
22083
+ const keysArray = Object.keys(Object(nextSource)).filter(key => noExtend.indexOf(key) < 0);
22084
+
22085
+ for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
22086
+ const nextKey = keysArray[nextIndex];
22087
+ const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
22088
+
22089
+ if (desc !== undefined && desc.enumerable) {
22090
+ if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
22091
+ if (nextSource[nextKey].__swiper__) {
22092
+ to[nextKey] = nextSource[nextKey];
22093
+ } else {
22094
+ extend(to[nextKey], nextSource[nextKey]);
22095
+ }
22096
+ } else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
22097
+ to[nextKey] = {};
22098
+
22099
+ if (nextSource[nextKey].__swiper__) {
22100
+ to[nextKey] = nextSource[nextKey];
22101
+ } else {
22102
+ extend(to[nextKey], nextSource[nextKey]);
22103
+ }
22104
+ } else {
22105
+ to[nextKey] = nextSource[nextKey];
22106
+ }
22107
+ }
22108
+ }
22109
+ }
22110
+ }
22111
+
22112
+ return to;
22113
+ }
22114
+
22115
+ function setCSSProperty(el, varName, varValue) {
22116
+ el.style.setProperty(varName, varValue);
22117
+ }
22118
+
22119
+ function animateCSSModeScroll({
22120
+ swiper,
22121
+ targetPosition,
22122
+ side
22123
+ }) {
22124
+ const window = ssrWindow.getWindow();
22125
+ const startPosition = -swiper.translate;
22126
+ let startTime = null;
22127
+ let time;
22128
+ const duration = swiper.params.speed;
22129
+ swiper.wrapperEl.style.scrollSnapType = 'none';
22130
+ window.cancelAnimationFrame(swiper.cssModeFrameID);
22131
+ const dir = targetPosition > startPosition ? 'next' : 'prev';
22132
+
22133
+ const isOutOfBound = (current, target) => {
22134
+ return dir === 'next' && current >= target || dir === 'prev' && current <= target;
22135
+ };
22136
+
22137
+ const animate = () => {
22138
+ time = new Date().getTime();
22139
+
22140
+ if (startTime === null) {
22141
+ startTime = time;
22142
+ }
22143
+
22144
+ const progress = Math.max(Math.min((time - startTime) / duration, 1), 0);
22145
+ const easeProgress = 0.5 - Math.cos(progress * Math.PI) / 2;
22146
+ let currentPosition = startPosition + easeProgress * (targetPosition - startPosition);
22147
+
22148
+ if (isOutOfBound(currentPosition, targetPosition)) {
22149
+ currentPosition = targetPosition;
22150
+ }
22151
+
22152
+ swiper.wrapperEl.scrollTo({
22153
+ [side]: currentPosition
22154
+ });
22155
+
22156
+ if (isOutOfBound(currentPosition, targetPosition)) {
22157
+ swiper.wrapperEl.style.overflow = 'hidden';
22158
+ swiper.wrapperEl.style.scrollSnapType = '';
22159
+ setTimeout(() => {
22160
+ swiper.wrapperEl.style.overflow = '';
22161
+ swiper.wrapperEl.scrollTo({
22162
+ [side]: currentPosition
22163
+ });
22164
+ });
22165
+ window.cancelAnimationFrame(swiper.cssModeFrameID);
22166
+ return;
22167
+ }
22168
+
22169
+ swiper.cssModeFrameID = window.requestAnimationFrame(animate);
22170
+ };
22171
+
22172
+ animate();
22173
+ }
22174
+
22175
+ let support;
22176
+
22177
+ function calcSupport() {
22178
+ const window = ssrWindow.getWindow();
22179
+ const document = ssrWindow.getDocument();
22180
+ return {
22181
+ smoothScroll: document.documentElement && 'scrollBehavior' in document.documentElement.style,
22182
+ touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch),
22183
+ passiveListener: function checkPassiveListener() {
22184
+ let supportsPassive = false;
22185
+
22186
+ try {
22187
+ const opts = Object.defineProperty({}, 'passive', {
22188
+ // eslint-disable-next-line
22189
+ get() {
22190
+ supportsPassive = true;
22191
+ }
22192
+
22193
+ });
22194
+ window.addEventListener('testPassiveListener', null, opts);
22195
+ } catch (e) {// No support
22196
+ }
22197
+
22198
+ return supportsPassive;
22199
+ }(),
22200
+ gestures: function checkGestures() {
22201
+ return 'ongesturestart' in window;
22202
+ }()
22203
+ };
22204
+ }
22205
+
22206
+ function getSupport() {
22207
+ if (!support) {
22208
+ support = calcSupport();
22209
+ }
22210
+
22211
+ return support;
22212
+ }
22213
+
22214
+ let deviceCached;
22215
+
22216
+ function calcDevice({
22217
+ userAgent
22218
+ } = {}) {
22219
+ const support = getSupport();
22220
+ const window = ssrWindow.getWindow();
22221
+ const platform = window.navigator.platform;
22222
+ const ua = userAgent || window.navigator.userAgent;
22223
+ const device = {
22224
+ ios: false,
22225
+ android: false
22226
+ };
22227
+ const screenWidth = window.screen.width;
22228
+ const screenHeight = window.screen.height;
22229
+ const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line
22230
+
22231
+ let ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
22232
+ const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
22233
+ const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
22234
+ const windows = platform === 'Win32';
22235
+ let macos = platform === 'MacIntel'; // iPadOs 13 fix
22236
+
22237
+ const iPadScreens = ['1024x1366', '1366x1024', '834x1194', '1194x834', '834x1112', '1112x834', '768x1024', '1024x768', '820x1180', '1180x820', '810x1080', '1080x810'];
22238
+
22239
+ if (!ipad && macos && support.touch && iPadScreens.indexOf(`${screenWidth}x${screenHeight}`) >= 0) {
22240
+ ipad = ua.match(/(Version)\/([\d.]+)/);
22241
+ if (!ipad) ipad = [0, 1, '13_0_0'];
22242
+ macos = false;
22243
+ } // Android
22244
+
22245
+
22246
+ if (android && !windows) {
22247
+ device.os = 'android';
22248
+ device.android = true;
22249
+ }
22250
+
22251
+ if (ipad || iphone || ipod) {
22252
+ device.os = 'ios';
22253
+ device.ios = true;
22254
+ } // Export object
22255
+
22256
+
22257
+ return device;
22258
+ }
22259
+
22260
+ function getDevice(overrides = {}) {
22261
+ if (!deviceCached) {
22262
+ deviceCached = calcDevice(overrides);
22263
+ }
22264
+
22265
+ return deviceCached;
22266
+ }
22267
+
22268
+ let browser;
22269
+
22270
+ function calcBrowser() {
22271
+ const window = ssrWindow.getWindow();
22272
+
22273
+ function isSafari() {
22274
+ const ua = window.navigator.userAgent.toLowerCase();
22275
+ return ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0;
22276
+ }
22277
+
22278
+ return {
22279
+ isSafari: isSafari(),
22280
+ isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent)
22281
+ };
22282
+ }
22283
+
22284
+ function getBrowser() {
22285
+ if (!browser) {
22286
+ browser = calcBrowser();
22287
+ }
22288
+
22289
+ return browser;
22290
+ }
22291
+
22292
+ function Resize({
22293
+ swiper,
22294
+ on,
22295
+ emit
22296
+ }) {
22297
+ const window = ssrWindow.getWindow();
22298
+ let observer = null;
22299
+ let animationFrame = null;
22300
+
22301
+ const resizeHandler = () => {
22302
+ if (!swiper || swiper.destroyed || !swiper.initialized) return;
22303
+ emit('beforeResize');
22304
+ emit('resize');
22305
+ };
22306
+
22307
+ const createObserver = () => {
22308
+ if (!swiper || swiper.destroyed || !swiper.initialized) return;
22309
+ observer = new ResizeObserver(entries => {
22310
+ animationFrame = window.requestAnimationFrame(() => {
22311
+ const {
22312
+ width,
22313
+ height
22314
+ } = swiper;
22315
+ let newWidth = width;
22316
+ let newHeight = height;
22317
+ entries.forEach(({
22318
+ contentBoxSize,
22319
+ contentRect,
22320
+ target
22321
+ }) => {
22322
+ if (target && target !== swiper.el) return;
22323
+ newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize;
22324
+ newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize;
22325
+ });
22326
+
22327
+ if (newWidth !== width || newHeight !== height) {
22328
+ resizeHandler();
22329
+ }
22330
+ });
22331
+ });
22332
+ observer.observe(swiper.el);
22333
+ };
22334
+
22335
+ const removeObserver = () => {
22336
+ if (animationFrame) {
22337
+ window.cancelAnimationFrame(animationFrame);
22338
+ }
22339
+
22340
+ if (observer && observer.unobserve && swiper.el) {
22341
+ observer.unobserve(swiper.el);
22342
+ observer = null;
22343
+ }
22344
+ };
22345
+
22346
+ const orientationChangeHandler = () => {
22347
+ if (!swiper || swiper.destroyed || !swiper.initialized) return;
22348
+ emit('orientationchange');
22349
+ };
22350
+
22351
+ on('init', () => {
22352
+ if (swiper.params.resizeObserver && typeof window.ResizeObserver !== 'undefined') {
22353
+ createObserver();
22354
+ return;
22355
+ }
22356
+
22357
+ window.addEventListener('resize', resizeHandler);
22358
+ window.addEventListener('orientationchange', orientationChangeHandler);
22359
+ });
22360
+ on('destroy', () => {
22361
+ removeObserver();
22362
+ window.removeEventListener('resize', resizeHandler);
22363
+ window.removeEventListener('orientationchange', orientationChangeHandler);
22364
+ });
22365
+ }
22366
+
22367
+ function Observer({
22368
+ swiper,
22369
+ extendParams,
22370
+ on,
22371
+ emit
22372
+ }) {
22373
+ const observers = [];
22374
+ const window = ssrWindow.getWindow();
22375
+
22376
+ const attach = (target, options = {}) => {
22377
+ const ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;
22378
+ const observer = new ObserverFunc(mutations => {
22379
+ // The observerUpdate event should only be triggered
22380
+ // once despite the number of mutations. Additional
22381
+ // triggers are redundant and are very costly
22382
+ if (mutations.length === 1) {
22383
+ emit('observerUpdate', mutations[0]);
22384
+ return;
22385
+ }
22386
+
22387
+ const observerUpdate = function observerUpdate() {
22388
+ emit('observerUpdate', mutations[0]);
22389
+ };
22390
+
22391
+ if (window.requestAnimationFrame) {
22392
+ window.requestAnimationFrame(observerUpdate);
22393
+ } else {
22394
+ window.setTimeout(observerUpdate, 0);
22395
+ }
22396
+ });
22397
+ observer.observe(target, {
22398
+ attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
22399
+ childList: typeof options.childList === 'undefined' ? true : options.childList,
22400
+ characterData: typeof options.characterData === 'undefined' ? true : options.characterData
22401
+ });
22402
+ observers.push(observer);
22403
+ };
22404
+
22405
+ const init = () => {
22406
+ if (!swiper.params.observer) return;
22407
+
22408
+ if (swiper.params.observeParents) {
22409
+ const containerParents = swiper.$el.parents();
22410
+
22411
+ for (let i = 0; i < containerParents.length; i += 1) {
22412
+ attach(containerParents[i]);
22413
+ }
22414
+ } // Observe container
22415
+
22416
+
22417
+ attach(swiper.$el[0], {
22418
+ childList: swiper.params.observeSlideChildren
22419
+ }); // Observe wrapper
22420
+
22421
+ attach(swiper.$wrapperEl[0], {
22422
+ attributes: false
22423
+ });
22424
+ };
22425
+
22426
+ const destroy = () => {
22427
+ observers.forEach(observer => {
22428
+ observer.disconnect();
22429
+ });
22430
+ observers.splice(0, observers.length);
22431
+ };
22432
+
22433
+ extendParams({
22434
+ observer: false,
22435
+ observeParents: false,
22436
+ observeSlideChildren: false
22437
+ });
22438
+ on('init', init);
22439
+ on('destroy', destroy);
22440
+ }
22441
+
22442
+ /* eslint-disable no-underscore-dangle */
22443
+ var eventsEmitter = {
22444
+ on(events, handler, priority) {
22445
+ const self = this;
22446
+ if (!self.eventsListeners || self.destroyed) return self;
22447
+ if (typeof handler !== 'function') return self;
22448
+ const method = priority ? 'unshift' : 'push';
22449
+ events.split(' ').forEach(event => {
22450
+ if (!self.eventsListeners[event]) self.eventsListeners[event] = [];
22451
+ self.eventsListeners[event][method](handler);
22452
+ });
22453
+ return self;
22454
+ },
22455
+
22456
+ once(events, handler, priority) {
22457
+ const self = this;
22458
+ if (!self.eventsListeners || self.destroyed) return self;
22459
+ if (typeof handler !== 'function') return self;
22460
+
22461
+ function onceHandler(...args) {
22462
+ self.off(events, onceHandler);
22463
+
22464
+ if (onceHandler.__emitterProxy) {
22465
+ delete onceHandler.__emitterProxy;
22466
+ }
22467
+
22468
+ handler.apply(self, args);
22469
+ }
22470
+
22471
+ onceHandler.__emitterProxy = handler;
22472
+ return self.on(events, onceHandler, priority);
22473
+ },
22474
+
22475
+ onAny(handler, priority) {
22476
+ const self = this;
22477
+ if (!self.eventsListeners || self.destroyed) return self;
22478
+ if (typeof handler !== 'function') return self;
22479
+ const method = priority ? 'unshift' : 'push';
22480
+
22481
+ if (self.eventsAnyListeners.indexOf(handler) < 0) {
22482
+ self.eventsAnyListeners[method](handler);
22483
+ }
22484
+
22485
+ return self;
22486
+ },
22487
+
22488
+ offAny(handler) {
22489
+ const self = this;
22490
+ if (!self.eventsListeners || self.destroyed) return self;
22491
+ if (!self.eventsAnyListeners) return self;
22492
+ const index = self.eventsAnyListeners.indexOf(handler);
22493
+
22494
+ if (index >= 0) {
22495
+ self.eventsAnyListeners.splice(index, 1);
22496
+ }
22497
+
22498
+ return self;
22499
+ },
22500
+
22501
+ off(events, handler) {
22502
+ const self = this;
22503
+ if (!self.eventsListeners || self.destroyed) return self;
22504
+ if (!self.eventsListeners) return self;
22505
+ events.split(' ').forEach(event => {
22506
+ if (typeof handler === 'undefined') {
22507
+ self.eventsListeners[event] = [];
22508
+ } else if (self.eventsListeners[event]) {
22509
+ self.eventsListeners[event].forEach((eventHandler, index) => {
22510
+ if (eventHandler === handler || eventHandler.__emitterProxy && eventHandler.__emitterProxy === handler) {
22511
+ self.eventsListeners[event].splice(index, 1);
22512
+ }
22513
+ });
22514
+ }
22515
+ });
22516
+ return self;
22517
+ },
22518
+
22519
+ emit(...args) {
22520
+ const self = this;
22521
+ if (!self.eventsListeners || self.destroyed) return self;
22522
+ if (!self.eventsListeners) return self;
22523
+ let events;
22524
+ let data;
22525
+ let context;
22526
+
22527
+ if (typeof args[0] === 'string' || Array.isArray(args[0])) {
22528
+ events = args[0];
22529
+ data = args.slice(1, args.length);
22530
+ context = self;
22531
+ } else {
22532
+ events = args[0].events;
22533
+ data = args[0].data;
22534
+ context = args[0].context || self;
22535
+ }
22536
+
22537
+ data.unshift(context);
22538
+ const eventsArray = Array.isArray(events) ? events : events.split(' ');
22539
+ eventsArray.forEach(event => {
22540
+ if (self.eventsAnyListeners && self.eventsAnyListeners.length) {
22541
+ self.eventsAnyListeners.forEach(eventHandler => {
22542
+ eventHandler.apply(context, [event, ...data]);
22543
+ });
22544
+ }
22545
+
22546
+ if (self.eventsListeners && self.eventsListeners[event]) {
22547
+ self.eventsListeners[event].forEach(eventHandler => {
22548
+ eventHandler.apply(context, data);
22549
+ });
22550
+ }
22551
+ });
22552
+ return self;
22553
+ }
22554
+
22555
+ };
22556
+
22557
+ function updateSize() {
22558
+ const swiper = this;
22559
+ let width;
22560
+ let height;
22561
+ const $el = swiper.$el;
22562
+
22563
+ if (typeof swiper.params.width !== 'undefined' && swiper.params.width !== null) {
22564
+ width = swiper.params.width;
22565
+ } else {
22566
+ width = $el[0].clientWidth;
22567
+ }
22568
+
22569
+ if (typeof swiper.params.height !== 'undefined' && swiper.params.height !== null) {
22570
+ height = swiper.params.height;
22571
+ } else {
22572
+ height = $el[0].clientHeight;
22573
+ }
22574
+
22575
+ if (width === 0 && swiper.isHorizontal() || height === 0 && swiper.isVertical()) {
22576
+ return;
22577
+ } // Subtract paddings
22578
+
22579
+
22580
+ width = width - parseInt($el.css('padding-left') || 0, 10) - parseInt($el.css('padding-right') || 0, 10);
22581
+ height = height - parseInt($el.css('padding-top') || 0, 10) - parseInt($el.css('padding-bottom') || 0, 10);
22582
+ if (Number.isNaN(width)) width = 0;
22583
+ if (Number.isNaN(height)) height = 0;
22584
+ Object.assign(swiper, {
22585
+ width,
22586
+ height,
22587
+ size: swiper.isHorizontal() ? width : height
22588
+ });
22589
+ }
22590
+
22591
+ function updateSlides() {
22592
+ const swiper = this;
22593
+
22594
+ function getDirectionLabel(property) {
22595
+ if (swiper.isHorizontal()) {
22596
+ return property;
22597
+ } // prettier-ignore
22598
+
22599
+
22600
+ return {
22601
+ 'width': 'height',
22602
+ 'margin-top': 'margin-left',
22603
+ 'margin-bottom ': 'margin-right',
22604
+ 'margin-left': 'margin-top',
22605
+ 'margin-right': 'margin-bottom',
22606
+ 'padding-left': 'padding-top',
22607
+ 'padding-right': 'padding-bottom',
22608
+ 'marginRight': 'marginBottom'
22609
+ }[property];
22610
+ }
22611
+
22612
+ function getDirectionPropertyValue(node, label) {
22613
+ return parseFloat(node.getPropertyValue(getDirectionLabel(label)) || 0);
22614
+ }
22615
+
22616
+ const params = swiper.params;
22617
+ const {
22618
+ $wrapperEl,
22619
+ size: swiperSize,
22620
+ rtlTranslate: rtl,
22621
+ wrongRTL
22622
+ } = swiper;
22623
+ const isVirtual = swiper.virtual && params.virtual.enabled;
22624
+ const previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;
22625
+ const slides = $wrapperEl.children(`.${swiper.params.slideClass}`);
22626
+ const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;
22627
+ let snapGrid = [];
22628
+ const slidesGrid = [];
22629
+ const slidesSizesGrid = [];
22630
+ let offsetBefore = params.slidesOffsetBefore;
22631
+
22632
+ if (typeof offsetBefore === 'function') {
22633
+ offsetBefore = params.slidesOffsetBefore.call(swiper);
22634
+ }
22635
+
22636
+ let offsetAfter = params.slidesOffsetAfter;
22637
+
22638
+ if (typeof offsetAfter === 'function') {
22639
+ offsetAfter = params.slidesOffsetAfter.call(swiper);
22640
+ }
22641
+
22642
+ const previousSnapGridLength = swiper.snapGrid.length;
22643
+ const previousSlidesGridLength = swiper.slidesGrid.length;
22644
+ let spaceBetween = params.spaceBetween;
22645
+ let slidePosition = -offsetBefore;
22646
+ let prevSlideSize = 0;
22647
+ let index = 0;
22648
+
22649
+ if (typeof swiperSize === 'undefined') {
22650
+ return;
22651
+ }
22652
+
22653
+ if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
22654
+ spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiperSize;
22655
+ }
22656
+
22657
+ swiper.virtualSize = -spaceBetween; // reset margins
22658
+
22659
+ if (rtl) slides.css({
22660
+ marginLeft: '',
22661
+ marginBottom: '',
22662
+ marginTop: ''
22663
+ });else slides.css({
22664
+ marginRight: '',
22665
+ marginBottom: '',
22666
+ marginTop: ''
22667
+ }); // reset cssMode offsets
22668
+
22669
+ if (params.centeredSlides && params.cssMode) {
22670
+ setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-before', '');
22671
+ setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-after', '');
22672
+ }
22673
+
22674
+ const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;
22675
+
22676
+ if (gridEnabled) {
22677
+ swiper.grid.initSlides(slidesLength);
22678
+ } // Calc slides
22679
+
22680
+
22681
+ let slideSize;
22682
+ const shouldResetSlideSize = params.slidesPerView === 'auto' && params.breakpoints && Object.keys(params.breakpoints).filter(key => {
22683
+ return typeof params.breakpoints[key].slidesPerView !== 'undefined';
22684
+ }).length > 0;
22685
+
22686
+ for (let i = 0; i < slidesLength; i += 1) {
22687
+ slideSize = 0;
22688
+ const slide = slides.eq(i);
22689
+
22690
+ if (gridEnabled) {
22691
+ swiper.grid.updateSlide(i, slide, slidesLength, getDirectionLabel);
22692
+ }
22693
+
22694
+ if (slide.css('display') === 'none') continue; // eslint-disable-line
22695
+
22696
+ if (params.slidesPerView === 'auto') {
22697
+ if (shouldResetSlideSize) {
22698
+ slides[i].style[getDirectionLabel('width')] = ``;
22699
+ }
22700
+
22701
+ const slideStyles = getComputedStyle(slide[0]);
22702
+ const currentTransform = slide[0].style.transform;
22703
+ const currentWebKitTransform = slide[0].style.webkitTransform;
22704
+
22705
+ if (currentTransform) {
22706
+ slide[0].style.transform = 'none';
22707
+ }
22708
+
22709
+ if (currentWebKitTransform) {
22710
+ slide[0].style.webkitTransform = 'none';
22711
+ }
22712
+
22713
+ if (params.roundLengths) {
22714
+ slideSize = swiper.isHorizontal() ? slide.outerWidth(true) : slide.outerHeight(true);
22715
+ } else {
22716
+ // eslint-disable-next-line
22717
+ const width = getDirectionPropertyValue(slideStyles, 'width');
22718
+ const paddingLeft = getDirectionPropertyValue(slideStyles, 'padding-left');
22719
+ const paddingRight = getDirectionPropertyValue(slideStyles, 'padding-right');
22720
+ const marginLeft = getDirectionPropertyValue(slideStyles, 'margin-left');
22721
+ const marginRight = getDirectionPropertyValue(slideStyles, 'margin-right');
22722
+ const boxSizing = slideStyles.getPropertyValue('box-sizing');
22723
+
22724
+ if (boxSizing && boxSizing === 'border-box') {
22725
+ slideSize = width + marginLeft + marginRight;
22726
+ } else {
22727
+ const {
22728
+ clientWidth,
22729
+ offsetWidth
22730
+ } = slide[0];
22731
+ slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth);
22732
+ }
22733
+ }
22734
+
22735
+ if (currentTransform) {
22736
+ slide[0].style.transform = currentTransform;
22737
+ }
22738
+
22739
+ if (currentWebKitTransform) {
22740
+ slide[0].style.webkitTransform = currentWebKitTransform;
22741
+ }
22742
+
22743
+ if (params.roundLengths) slideSize = Math.floor(slideSize);
22744
+ } else {
22745
+ slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;
22746
+ if (params.roundLengths) slideSize = Math.floor(slideSize);
22747
+
22748
+ if (slides[i]) {
22749
+ slides[i].style[getDirectionLabel('width')] = `${slideSize}px`;
22750
+ }
22751
+ }
22752
+
22753
+ if (slides[i]) {
22754
+ slides[i].swiperSlideSize = slideSize;
22755
+ }
22756
+
22757
+ slidesSizesGrid.push(slideSize);
22758
+
22759
+ if (params.centeredSlides) {
22760
+ slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;
22761
+ if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;
22762
+ if (i === 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;
22763
+ if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;
22764
+ if (params.roundLengths) slidePosition = Math.floor(slidePosition);
22765
+ if (index % params.slidesPerGroup === 0) snapGrid.push(slidePosition);
22766
+ slidesGrid.push(slidePosition);
22767
+ } else {
22768
+ if (params.roundLengths) slidePosition = Math.floor(slidePosition);
22769
+ if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition);
22770
+ slidesGrid.push(slidePosition);
22771
+ slidePosition = slidePosition + slideSize + spaceBetween;
22772
+ }
22773
+
22774
+ swiper.virtualSize += slideSize + spaceBetween;
22775
+ prevSlideSize = slideSize;
22776
+ index += 1;
22777
+ }
22778
+
22779
+ swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter;
22780
+
22781
+ if (rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) {
22782
+ $wrapperEl.css({
22783
+ width: `${swiper.virtualSize + params.spaceBetween}px`
22784
+ });
22785
+ }
22786
+
22787
+ if (params.setWrapperSize) {
22788
+ $wrapperEl.css({
22789
+ [getDirectionLabel('width')]: `${swiper.virtualSize + params.spaceBetween}px`
22790
+ });
22791
+ }
22792
+
22793
+ if (gridEnabled) {
22794
+ swiper.grid.updateWrapperSize(slideSize, snapGrid, getDirectionLabel);
22795
+ } // Remove last grid elements depending on width
22796
+
22797
+
22798
+ if (!params.centeredSlides) {
22799
+ const newSlidesGrid = [];
22800
+
22801
+ for (let i = 0; i < snapGrid.length; i += 1) {
22802
+ let slidesGridItem = snapGrid[i];
22803
+ if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
22804
+
22805
+ if (snapGrid[i] <= swiper.virtualSize - swiperSize) {
22806
+ newSlidesGrid.push(slidesGridItem);
22807
+ }
22808
+ }
22809
+
22810
+ snapGrid = newSlidesGrid;
22811
+
22812
+ if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {
22813
+ snapGrid.push(swiper.virtualSize - swiperSize);
22814
+ }
22815
+ }
22816
+
22817
+ if (snapGrid.length === 0) snapGrid = [0];
22818
+
22819
+ if (params.spaceBetween !== 0) {
22820
+ const key = swiper.isHorizontal() && rtl ? 'marginLeft' : getDirectionLabel('marginRight');
22821
+ slides.filter((_, slideIndex) => {
22822
+ if (!params.cssMode) return true;
22823
+
22824
+ if (slideIndex === slides.length - 1) {
22825
+ return false;
22826
+ }
22827
+
22828
+ return true;
22829
+ }).css({
22830
+ [key]: `${spaceBetween}px`
22831
+ });
22832
+ }
22833
+
22834
+ if (params.centeredSlides && params.centeredSlidesBounds) {
22835
+ let allSlidesSize = 0;
22836
+ slidesSizesGrid.forEach(slideSizeValue => {
22837
+ allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0);
22838
+ });
22839
+ allSlidesSize -= params.spaceBetween;
22840
+ const maxSnap = allSlidesSize - swiperSize;
22841
+ snapGrid = snapGrid.map(snap => {
22842
+ if (snap < 0) return -offsetBefore;
22843
+ if (snap > maxSnap) return maxSnap + offsetAfter;
22844
+ return snap;
22845
+ });
22846
+ }
22847
+
22848
+ if (params.centerInsufficientSlides) {
22849
+ let allSlidesSize = 0;
22850
+ slidesSizesGrid.forEach(slideSizeValue => {
22851
+ allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0);
22852
+ });
22853
+ allSlidesSize -= params.spaceBetween;
22854
+
22855
+ if (allSlidesSize < swiperSize) {
22856
+ const allSlidesOffset = (swiperSize - allSlidesSize) / 2;
22857
+ snapGrid.forEach((snap, snapIndex) => {
22858
+ snapGrid[snapIndex] = snap - allSlidesOffset;
22859
+ });
22860
+ slidesGrid.forEach((snap, snapIndex) => {
22861
+ slidesGrid[snapIndex] = snap + allSlidesOffset;
22862
+ });
22863
+ }
22864
+ }
22865
+
22866
+ Object.assign(swiper, {
22867
+ slides,
22868
+ snapGrid,
22869
+ slidesGrid,
22870
+ slidesSizesGrid
22871
+ });
22872
+
22873
+ if (params.centeredSlides && params.cssMode && !params.centeredSlidesBounds) {
22874
+ setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-before', `${-snapGrid[0]}px`);
22875
+ setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-after', `${swiper.size / 2 - slidesSizesGrid[slidesSizesGrid.length - 1] / 2}px`);
22876
+ const addToSnapGrid = -swiper.snapGrid[0];
22877
+ const addToSlidesGrid = -swiper.slidesGrid[0];
22878
+ swiper.snapGrid = swiper.snapGrid.map(v => v + addToSnapGrid);
22879
+ swiper.slidesGrid = swiper.slidesGrid.map(v => v + addToSlidesGrid);
22880
+ }
22881
+
22882
+ if (slidesLength !== previousSlidesLength) {
22883
+ swiper.emit('slidesLengthChange');
22884
+ }
22885
+
22886
+ if (snapGrid.length !== previousSnapGridLength) {
22887
+ if (swiper.params.watchOverflow) swiper.checkOverflow();
22888
+ swiper.emit('snapGridLengthChange');
22889
+ }
22890
+
22891
+ if (slidesGrid.length !== previousSlidesGridLength) {
22892
+ swiper.emit('slidesGridLengthChange');
22893
+ }
22894
+
22895
+ if (params.watchSlidesProgress) {
22896
+ swiper.updateSlidesOffset();
22897
+ }
22898
+
22899
+ if (!isVirtual && !params.cssMode && (params.effect === 'slide' || params.effect === 'fade')) {
22900
+ const backFaceHiddenClass = `${params.containerModifierClass}backface-hidden`;
22901
+ const hasClassBackfaceClassAdded = swiper.$el.hasClass(backFaceHiddenClass);
22902
+
22903
+ if (slidesLength <= params.maxBackfaceHiddenSlides) {
22904
+ if (!hasClassBackfaceClassAdded) swiper.$el.addClass(backFaceHiddenClass);
22905
+ } else if (hasClassBackfaceClassAdded) {
22906
+ swiper.$el.removeClass(backFaceHiddenClass);
22907
+ }
22908
+ }
22909
+ }
22910
+
22911
+ function updateAutoHeight(speed) {
22912
+ const swiper = this;
22913
+ const activeSlides = [];
22914
+ const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
22915
+ let newHeight = 0;
22916
+ let i;
22917
+
22918
+ if (typeof speed === 'number') {
22919
+ swiper.setTransition(speed);
22920
+ } else if (speed === true) {
22921
+ swiper.setTransition(swiper.params.speed);
22922
+ }
22923
+
22924
+ const getSlideByIndex = index => {
22925
+ if (isVirtual) {
22926
+ return swiper.slides.filter(el => parseInt(el.getAttribute('data-swiper-slide-index'), 10) === index)[0];
22927
+ }
22928
+
22929
+ return swiper.slides.eq(index)[0];
22930
+ }; // Find slides currently in view
22931
+
22932
+
22933
+ if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) {
22934
+ if (swiper.params.centeredSlides) {
22935
+ (swiper.visibleSlides || dom7.$([])).each(slide => {
22936
+ activeSlides.push(slide);
22937
+ });
22938
+ } else {
22939
+ for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) {
22940
+ const index = swiper.activeIndex + i;
22941
+ if (index > swiper.slides.length && !isVirtual) break;
22942
+ activeSlides.push(getSlideByIndex(index));
22943
+ }
22944
+ }
22945
+ } else {
22946
+ activeSlides.push(getSlideByIndex(swiper.activeIndex));
22947
+ } // Find new height from highest slide in view
22948
+
22949
+
22950
+ for (i = 0; i < activeSlides.length; i += 1) {
22951
+ if (typeof activeSlides[i] !== 'undefined') {
22952
+ const height = activeSlides[i].offsetHeight;
22953
+ newHeight = height > newHeight ? height : newHeight;
22954
+ }
22955
+ } // Update Height
22956
+
22957
+
22958
+ if (newHeight || newHeight === 0) swiper.$wrapperEl.css('height', `${newHeight}px`);
22959
+ }
22960
+
22961
+ function updateSlidesOffset() {
22962
+ const swiper = this;
22963
+ const slides = swiper.slides;
22964
+
22965
+ for (let i = 0; i < slides.length; i += 1) {
22966
+ slides[i].swiperSlideOffset = swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop;
22967
+ }
22968
+ }
22969
+
22970
+ function updateSlidesProgress(translate = this && this.translate || 0) {
22971
+ const swiper = this;
22972
+ const params = swiper.params;
22973
+ const {
22974
+ slides,
22975
+ rtlTranslate: rtl,
22976
+ snapGrid
22977
+ } = swiper;
22978
+ if (slides.length === 0) return;
22979
+ if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();
22980
+ let offsetCenter = -translate;
22981
+ if (rtl) offsetCenter = translate; // Visible Slides
22982
+
22983
+ slides.removeClass(params.slideVisibleClass);
22984
+ swiper.visibleSlidesIndexes = [];
22985
+ swiper.visibleSlides = [];
22986
+
22987
+ for (let i = 0; i < slides.length; i += 1) {
22988
+ const slide = slides[i];
22989
+ let slideOffset = slide.swiperSlideOffset;
22990
+
22991
+ if (params.cssMode && params.centeredSlides) {
22992
+ slideOffset -= slides[0].swiperSlideOffset;
22993
+ }
22994
+
22995
+ const slideProgress = (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + params.spaceBetween);
22996
+ const originalSlideProgress = (offsetCenter - snapGrid[0] + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + params.spaceBetween);
22997
+ const slideBefore = -(offsetCenter - slideOffset);
22998
+ const slideAfter = slideBefore + swiper.slidesSizesGrid[i];
22999
+ const isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size;
23000
+
23001
+ if (isVisible) {
23002
+ swiper.visibleSlides.push(slide);
23003
+ swiper.visibleSlidesIndexes.push(i);
23004
+ slides.eq(i).addClass(params.slideVisibleClass);
23005
+ }
23006
+
23007
+ slide.progress = rtl ? -slideProgress : slideProgress;
23008
+ slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress;
23009
+ }
23010
+
23011
+ swiper.visibleSlides = dom7.$(swiper.visibleSlides);
23012
+ }
23013
+
23014
+ function updateProgress(translate) {
23015
+ const swiper = this;
23016
+
23017
+ if (typeof translate === 'undefined') {
23018
+ const multiplier = swiper.rtlTranslate ? -1 : 1; // eslint-disable-next-line
23019
+
23020
+ translate = swiper && swiper.translate && swiper.translate * multiplier || 0;
23021
+ }
23022
+
23023
+ const params = swiper.params;
23024
+ const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
23025
+ let {
23026
+ progress,
23027
+ isBeginning,
23028
+ isEnd
23029
+ } = swiper;
23030
+ const wasBeginning = isBeginning;
23031
+ const wasEnd = isEnd;
23032
+
23033
+ if (translatesDiff === 0) {
23034
+ progress = 0;
23035
+ isBeginning = true;
23036
+ isEnd = true;
23037
+ } else {
23038
+ progress = (translate - swiper.minTranslate()) / translatesDiff;
23039
+ isBeginning = progress <= 0;
23040
+ isEnd = progress >= 1;
23041
+ }
23042
+
23043
+ Object.assign(swiper, {
23044
+ progress,
23045
+ isBeginning,
23046
+ isEnd
23047
+ });
23048
+ if (params.watchSlidesProgress || params.centeredSlides && params.autoHeight) swiper.updateSlidesProgress(translate);
23049
+
23050
+ if (isBeginning && !wasBeginning) {
23051
+ swiper.emit('reachBeginning toEdge');
23052
+ }
23053
+
23054
+ if (isEnd && !wasEnd) {
23055
+ swiper.emit('reachEnd toEdge');
23056
+ }
23057
+
23058
+ if (wasBeginning && !isBeginning || wasEnd && !isEnd) {
23059
+ swiper.emit('fromEdge');
23060
+ }
23061
+
23062
+ swiper.emit('progress', progress);
23063
+ }
23064
+
23065
+ function updateSlidesClasses() {
23066
+ const swiper = this;
23067
+ const {
23068
+ slides,
23069
+ params,
23070
+ $wrapperEl,
23071
+ activeIndex,
23072
+ realIndex
23073
+ } = swiper;
23074
+ const isVirtual = swiper.virtual && params.virtual.enabled;
23075
+ slides.removeClass(`${params.slideActiveClass} ${params.slideNextClass} ${params.slidePrevClass} ${params.slideDuplicateActiveClass} ${params.slideDuplicateNextClass} ${params.slideDuplicatePrevClass}`);
23076
+ let activeSlide;
23077
+
23078
+ if (isVirtual) {
23079
+ activeSlide = swiper.$wrapperEl.find(`.${params.slideClass}[data-swiper-slide-index="${activeIndex}"]`);
23080
+ } else {
23081
+ activeSlide = slides.eq(activeIndex);
23082
+ } // Active classes
23083
+
23084
+
23085
+ activeSlide.addClass(params.slideActiveClass);
23086
+
23087
+ if (params.loop) {
23088
+ // Duplicate to all looped slides
23089
+ if (activeSlide.hasClass(params.slideDuplicateClass)) {
23090
+ $wrapperEl.children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${realIndex}"]`).addClass(params.slideDuplicateActiveClass);
23091
+ } else {
23092
+ $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${realIndex}"]`).addClass(params.slideDuplicateActiveClass);
23093
+ }
23094
+ } // Next Slide
23095
+
23096
+
23097
+ let nextSlide = activeSlide.nextAll(`.${params.slideClass}`).eq(0).addClass(params.slideNextClass);
23098
+
23099
+ if (params.loop && nextSlide.length === 0) {
23100
+ nextSlide = slides.eq(0);
23101
+ nextSlide.addClass(params.slideNextClass);
23102
+ } // Prev Slide
23103
+
23104
+
23105
+ let prevSlide = activeSlide.prevAll(`.${params.slideClass}`).eq(0).addClass(params.slidePrevClass);
23106
+
23107
+ if (params.loop && prevSlide.length === 0) {
23108
+ prevSlide = slides.eq(-1);
23109
+ prevSlide.addClass(params.slidePrevClass);
23110
+ }
23111
+
23112
+ if (params.loop) {
23113
+ // Duplicate to all looped slides
23114
+ if (nextSlide.hasClass(params.slideDuplicateClass)) {
23115
+ $wrapperEl.children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${nextSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicateNextClass);
23116
+ } else {
23117
+ $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${nextSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicateNextClass);
23118
+ }
23119
+
23120
+ if (prevSlide.hasClass(params.slideDuplicateClass)) {
23121
+ $wrapperEl.children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${prevSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicatePrevClass);
23122
+ } else {
23123
+ $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${prevSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicatePrevClass);
23124
+ }
23125
+ }
23126
+
23127
+ swiper.emitSlidesClasses();
23128
+ }
23129
+
23130
+ function updateActiveIndex(newActiveIndex) {
23131
+ const swiper = this;
23132
+ const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
23133
+ const {
23134
+ slidesGrid,
23135
+ snapGrid,
23136
+ params,
23137
+ activeIndex: previousIndex,
23138
+ realIndex: previousRealIndex,
23139
+ snapIndex: previousSnapIndex
23140
+ } = swiper;
23141
+ let activeIndex = newActiveIndex;
23142
+ let snapIndex;
23143
+
23144
+ if (typeof activeIndex === 'undefined') {
23145
+ for (let i = 0; i < slidesGrid.length; i += 1) {
23146
+ if (typeof slidesGrid[i + 1] !== 'undefined') {
23147
+ if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) {
23148
+ activeIndex = i;
23149
+ } else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) {
23150
+ activeIndex = i + 1;
23151
+ }
23152
+ } else if (translate >= slidesGrid[i]) {
23153
+ activeIndex = i;
23154
+ }
23155
+ } // Normalize slideIndex
23156
+
23157
+
23158
+ if (params.normalizeSlideIndex) {
23159
+ if (activeIndex < 0 || typeof activeIndex === 'undefined') activeIndex = 0;
23160
+ }
23161
+ }
23162
+
23163
+ if (snapGrid.indexOf(translate) >= 0) {
23164
+ snapIndex = snapGrid.indexOf(translate);
23165
+ } else {
23166
+ const skip = Math.min(params.slidesPerGroupSkip, activeIndex);
23167
+ snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);
23168
+ }
23169
+
23170
+ if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
23171
+
23172
+ if (activeIndex === previousIndex) {
23173
+ if (snapIndex !== previousSnapIndex) {
23174
+ swiper.snapIndex = snapIndex;
23175
+ swiper.emit('snapIndexChange');
23176
+ }
23177
+
23178
+ return;
23179
+ } // Get real index
23180
+
23181
+
23182
+ const realIndex = parseInt(swiper.slides.eq(activeIndex).attr('data-swiper-slide-index') || activeIndex, 10);
23183
+ Object.assign(swiper, {
23184
+ snapIndex,
23185
+ realIndex,
23186
+ previousIndex,
23187
+ activeIndex
23188
+ });
23189
+ swiper.emit('activeIndexChange');
23190
+ swiper.emit('snapIndexChange');
23191
+
23192
+ if (previousRealIndex !== realIndex) {
23193
+ swiper.emit('realIndexChange');
23194
+ }
23195
+
23196
+ if (swiper.initialized || swiper.params.runCallbacksOnInit) {
23197
+ swiper.emit('slideChange');
23198
+ }
23199
+ }
23200
+
23201
+ function updateClickedSlide(e) {
23202
+ const swiper = this;
23203
+ const params = swiper.params;
23204
+ const slide = dom7.$(e).closest(`.${params.slideClass}`)[0];
23205
+ let slideFound = false;
23206
+ let slideIndex;
23207
+
23208
+ if (slide) {
23209
+ for (let i = 0; i < swiper.slides.length; i += 1) {
23210
+ if (swiper.slides[i] === slide) {
23211
+ slideFound = true;
23212
+ slideIndex = i;
23213
+ break;
23214
+ }
23215
+ }
23216
+ }
23217
+
23218
+ if (slide && slideFound) {
23219
+ swiper.clickedSlide = slide;
23220
+
23221
+ if (swiper.virtual && swiper.params.virtual.enabled) {
23222
+ swiper.clickedIndex = parseInt(dom7.$(slide).attr('data-swiper-slide-index'), 10);
23223
+ } else {
23224
+ swiper.clickedIndex = slideIndex;
23225
+ }
23226
+ } else {
23227
+ swiper.clickedSlide = undefined;
23228
+ swiper.clickedIndex = undefined;
23229
+ return;
23230
+ }
23231
+
23232
+ if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) {
23233
+ swiper.slideToClickedSlide();
23234
+ }
23235
+ }
23236
+
23237
+ var update = {
23238
+ updateSize,
23239
+ updateSlides,
23240
+ updateAutoHeight,
23241
+ updateSlidesOffset,
23242
+ updateSlidesProgress,
23243
+ updateProgress,
23244
+ updateSlidesClasses,
23245
+ updateActiveIndex,
23246
+ updateClickedSlide
23247
+ };
23248
+
23249
+ function getSwiperTranslate(axis = this.isHorizontal() ? 'x' : 'y') {
23250
+ const swiper = this;
23251
+ const {
23252
+ params,
23253
+ rtlTranslate: rtl,
23254
+ translate,
23255
+ $wrapperEl
23256
+ } = swiper;
23257
+
23258
+ if (params.virtualTranslate) {
23259
+ return rtl ? -translate : translate;
23260
+ }
23261
+
23262
+ if (params.cssMode) {
23263
+ return translate;
23264
+ }
23265
+
23266
+ let currentTranslate = getTranslate($wrapperEl[0], axis);
23267
+ if (rtl) currentTranslate = -currentTranslate;
23268
+ return currentTranslate || 0;
23269
+ }
23270
+
23271
+ function setTranslate(translate, byController) {
23272
+ const swiper = this;
23273
+ const {
23274
+ rtlTranslate: rtl,
23275
+ params,
23276
+ $wrapperEl,
23277
+ wrapperEl,
23278
+ progress
23279
+ } = swiper;
23280
+ let x = 0;
23281
+ let y = 0;
23282
+ const z = 0;
23283
+
23284
+ if (swiper.isHorizontal()) {
23285
+ x = rtl ? -translate : translate;
23286
+ } else {
23287
+ y = translate;
23288
+ }
23289
+
23290
+ if (params.roundLengths) {
23291
+ x = Math.floor(x);
23292
+ y = Math.floor(y);
23293
+ }
23294
+
23295
+ if (params.cssMode) {
23296
+ wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y;
23297
+ } else if (!params.virtualTranslate) {
23298
+ $wrapperEl.transform(`translate3d(${x}px, ${y}px, ${z}px)`);
23299
+ }
23300
+
23301
+ swiper.previousTranslate = swiper.translate;
23302
+ swiper.translate = swiper.isHorizontal() ? x : y; // Check if we need to update progress
23303
+
23304
+ let newProgress;
23305
+ const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
23306
+
23307
+ if (translatesDiff === 0) {
23308
+ newProgress = 0;
23309
+ } else {
23310
+ newProgress = (translate - swiper.minTranslate()) / translatesDiff;
23311
+ }
23312
+
23313
+ if (newProgress !== progress) {
23314
+ swiper.updateProgress(translate);
23315
+ }
23316
+
23317
+ swiper.emit('setTranslate', swiper.translate, byController);
23318
+ }
23319
+
23320
+ function minTranslate() {
23321
+ return -this.snapGrid[0];
23322
+ }
23323
+
23324
+ function maxTranslate() {
23325
+ return -this.snapGrid[this.snapGrid.length - 1];
23326
+ }
23327
+
23328
+ function translateTo(translate = 0, speed = this.params.speed, runCallbacks = true, translateBounds = true, internal) {
23329
+ const swiper = this;
23330
+ const {
23331
+ params,
23332
+ wrapperEl
23333
+ } = swiper;
23334
+
23335
+ if (swiper.animating && params.preventInteractionOnTransition) {
23336
+ return false;
23337
+ }
23338
+
23339
+ const minTranslate = swiper.minTranslate();
23340
+ const maxTranslate = swiper.maxTranslate();
23341
+ let newTranslate;
23342
+ if (translateBounds && translate > minTranslate) newTranslate = minTranslate;else if (translateBounds && translate < maxTranslate) newTranslate = maxTranslate;else newTranslate = translate; // Update progress
23343
+
23344
+ swiper.updateProgress(newTranslate);
23345
+
23346
+ if (params.cssMode) {
23347
+ const isH = swiper.isHorizontal();
23348
+
23349
+ if (speed === 0) {
23350
+ wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;
23351
+ } else {
23352
+ if (!swiper.support.smoothScroll) {
23353
+ animateCSSModeScroll({
23354
+ swiper,
23355
+ targetPosition: -newTranslate,
23356
+ side: isH ? 'left' : 'top'
23357
+ });
23358
+ return true;
23359
+ }
23360
+
23361
+ wrapperEl.scrollTo({
23362
+ [isH ? 'left' : 'top']: -newTranslate,
23363
+ behavior: 'smooth'
23364
+ });
23365
+ }
23366
+
23367
+ return true;
23368
+ }
23369
+
23370
+ if (speed === 0) {
23371
+ swiper.setTransition(0);
23372
+ swiper.setTranslate(newTranslate);
23373
+
23374
+ if (runCallbacks) {
23375
+ swiper.emit('beforeTransitionStart', speed, internal);
23376
+ swiper.emit('transitionEnd');
23377
+ }
23378
+ } else {
23379
+ swiper.setTransition(speed);
23380
+ swiper.setTranslate(newTranslate);
23381
+
23382
+ if (runCallbacks) {
23383
+ swiper.emit('beforeTransitionStart', speed, internal);
23384
+ swiper.emit('transitionStart');
23385
+ }
23386
+
23387
+ if (!swiper.animating) {
23388
+ swiper.animating = true;
23389
+
23390
+ if (!swiper.onTranslateToWrapperTransitionEnd) {
23391
+ swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) {
23392
+ if (!swiper || swiper.destroyed) return;
23393
+ if (e.target !== this) return;
23394
+ swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
23395
+ swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd);
23396
+ swiper.onTranslateToWrapperTransitionEnd = null;
23397
+ delete swiper.onTranslateToWrapperTransitionEnd;
23398
+
23399
+ if (runCallbacks) {
23400
+ swiper.emit('transitionEnd');
23401
+ }
23402
+ };
23403
+ }
23404
+
23405
+ swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
23406
+ swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd);
23407
+ }
23408
+ }
23409
+
23410
+ return true;
23411
+ }
23412
+
23413
+ var translate = {
23414
+ getTranslate: getSwiperTranslate,
23415
+ setTranslate,
23416
+ minTranslate,
23417
+ maxTranslate,
23418
+ translateTo
23419
+ };
23420
+
23421
+ function setTransition(duration, byController) {
23422
+ const swiper = this;
23423
+
23424
+ if (!swiper.params.cssMode) {
23425
+ swiper.$wrapperEl.transition(duration);
23426
+ }
23427
+
23428
+ swiper.emit('setTransition', duration, byController);
23429
+ }
23430
+
23431
+ function transitionEmit({
23432
+ swiper,
23433
+ runCallbacks,
23434
+ direction,
23435
+ step
23436
+ }) {
23437
+ const {
23438
+ activeIndex,
23439
+ previousIndex
23440
+ } = swiper;
23441
+ let dir = direction;
23442
+
23443
+ if (!dir) {
23444
+ if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';
23445
+ }
23446
+
23447
+ swiper.emit(`transition${step}`);
23448
+
23449
+ if (runCallbacks && activeIndex !== previousIndex) {
23450
+ if (dir === 'reset') {
23451
+ swiper.emit(`slideResetTransition${step}`);
23452
+ return;
23453
+ }
23454
+
23455
+ swiper.emit(`slideChangeTransition${step}`);
23456
+
23457
+ if (dir === 'next') {
23458
+ swiper.emit(`slideNextTransition${step}`);
23459
+ } else {
23460
+ swiper.emit(`slidePrevTransition${step}`);
23461
+ }
23462
+ }
23463
+ }
23464
+
23465
+ function transitionStart(runCallbacks = true, direction) {
23466
+ const swiper = this;
23467
+ const {
23468
+ params
23469
+ } = swiper;
23470
+ if (params.cssMode) return;
23471
+
23472
+ if (params.autoHeight) {
23473
+ swiper.updateAutoHeight();
23474
+ }
23475
+
23476
+ transitionEmit({
23477
+ swiper,
23478
+ runCallbacks,
23479
+ direction,
23480
+ step: 'Start'
23481
+ });
23482
+ }
23483
+
23484
+ function transitionEnd(runCallbacks = true, direction) {
23485
+ const swiper = this;
23486
+ const {
23487
+ params
23488
+ } = swiper;
23489
+ swiper.animating = false;
23490
+ if (params.cssMode) return;
23491
+ swiper.setTransition(0);
23492
+ transitionEmit({
23493
+ swiper,
23494
+ runCallbacks,
23495
+ direction,
23496
+ step: 'End'
23497
+ });
23498
+ }
23499
+
23500
+ var transition = {
23501
+ setTransition,
23502
+ transitionStart,
23503
+ transitionEnd
23504
+ };
23505
+
23506
+ function slideTo(index = 0, speed = this.params.speed, runCallbacks = true, internal, initial) {
23507
+ if (typeof index !== 'number' && typeof index !== 'string') {
23508
+ throw new Error(`The 'index' argument cannot have type other than 'number' or 'string'. [${typeof index}] given.`);
23509
+ }
23510
+
23511
+ if (typeof index === 'string') {
23512
+ /**
23513
+ * The `index` argument converted from `string` to `number`.
23514
+ * @type {number}
23515
+ */
23516
+ const indexAsNumber = parseInt(index, 10);
23517
+ /**
23518
+ * Determines whether the `index` argument is a valid `number`
23519
+ * after being converted from the `string` type.
23520
+ * @type {boolean}
23521
+ */
23522
+
23523
+ const isValidNumber = isFinite(indexAsNumber);
23524
+
23525
+ if (!isValidNumber) {
23526
+ throw new Error(`The passed-in 'index' (string) couldn't be converted to 'number'. [${index}] given.`);
23527
+ } // Knowing that the converted `index` is a valid number,
23528
+ // we can update the original argument's value.
23529
+
23530
+
23531
+ index = indexAsNumber;
23532
+ }
23533
+
23534
+ const swiper = this;
23535
+ let slideIndex = index;
23536
+ if (slideIndex < 0) slideIndex = 0;
23537
+ const {
23538
+ params,
23539
+ snapGrid,
23540
+ slidesGrid,
23541
+ previousIndex,
23542
+ activeIndex,
23543
+ rtlTranslate: rtl,
23544
+ wrapperEl,
23545
+ enabled
23546
+ } = swiper;
23547
+
23548
+ if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial) {
23549
+ return false;
23550
+ }
23551
+
23552
+ const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
23553
+ let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
23554
+ if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
23555
+ const translate = -snapGrid[snapIndex]; // Normalize slideIndex
23556
+
23557
+ if (params.normalizeSlideIndex) {
23558
+ for (let i = 0; i < slidesGrid.length; i += 1) {
23559
+ const normalizedTranslate = -Math.floor(translate * 100);
23560
+ const normalizedGrid = Math.floor(slidesGrid[i] * 100);
23561
+ const normalizedGridNext = Math.floor(slidesGrid[i + 1] * 100);
23562
+
23563
+ if (typeof slidesGrid[i + 1] !== 'undefined') {
23564
+ if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext - (normalizedGridNext - normalizedGrid) / 2) {
23565
+ slideIndex = i;
23566
+ } else if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext) {
23567
+ slideIndex = i + 1;
23568
+ }
23569
+ } else if (normalizedTranslate >= normalizedGrid) {
23570
+ slideIndex = i;
23571
+ }
23572
+ }
23573
+ } // Directions locks
23574
+
23575
+
23576
+ if (swiper.initialized && slideIndex !== activeIndex) {
23577
+ if (!swiper.allowSlideNext && translate < swiper.translate && translate < swiper.minTranslate()) {
23578
+ return false;
23579
+ }
23580
+
23581
+ if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) {
23582
+ if ((activeIndex || 0) !== slideIndex) return false;
23583
+ }
23584
+ }
23585
+
23586
+ if (slideIndex !== (previousIndex || 0) && runCallbacks) {
23587
+ swiper.emit('beforeSlideChangeStart');
23588
+ } // Update progress
23589
+
23590
+
23591
+ swiper.updateProgress(translate);
23592
+ let direction;
23593
+ if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset'; // Update Index
23594
+
23595
+ if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) {
23596
+ swiper.updateActiveIndex(slideIndex); // Update Height
23597
+
23598
+ if (params.autoHeight) {
23599
+ swiper.updateAutoHeight();
23600
+ }
23601
+
23602
+ swiper.updateSlidesClasses();
23603
+
23604
+ if (params.effect !== 'slide') {
23605
+ swiper.setTranslate(translate);
23606
+ }
23607
+
23608
+ if (direction !== 'reset') {
23609
+ swiper.transitionStart(runCallbacks, direction);
23610
+ swiper.transitionEnd(runCallbacks, direction);
23611
+ }
23612
+
23613
+ return false;
23614
+ }
23615
+
23616
+ if (params.cssMode) {
23617
+ const isH = swiper.isHorizontal();
23618
+ const t = rtl ? translate : -translate;
23619
+
23620
+ if (speed === 0) {
23621
+ const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
23622
+
23623
+ if (isVirtual) {
23624
+ swiper.wrapperEl.style.scrollSnapType = 'none';
23625
+ swiper._immediateVirtual = true;
23626
+ }
23627
+
23628
+ wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;
23629
+
23630
+ if (isVirtual) {
23631
+ requestAnimationFrame(() => {
23632
+ swiper.wrapperEl.style.scrollSnapType = '';
23633
+ swiper._swiperImmediateVirtual = false;
23634
+ });
23635
+ }
23636
+ } else {
23637
+ if (!swiper.support.smoothScroll) {
23638
+ animateCSSModeScroll({
23639
+ swiper,
23640
+ targetPosition: t,
23641
+ side: isH ? 'left' : 'top'
23642
+ });
23643
+ return true;
23644
+ }
23645
+
23646
+ wrapperEl.scrollTo({
23647
+ [isH ? 'left' : 'top']: t,
23648
+ behavior: 'smooth'
23649
+ });
23650
+ }
23651
+
23652
+ return true;
23653
+ }
23654
+
23655
+ swiper.setTransition(speed);
23656
+ swiper.setTranslate(translate);
23657
+ swiper.updateActiveIndex(slideIndex);
23658
+ swiper.updateSlidesClasses();
23659
+ swiper.emit('beforeTransitionStart', speed, internal);
23660
+ swiper.transitionStart(runCallbacks, direction);
23661
+
23662
+ if (speed === 0) {
23663
+ swiper.transitionEnd(runCallbacks, direction);
23664
+ } else if (!swiper.animating) {
23665
+ swiper.animating = true;
23666
+
23667
+ if (!swiper.onSlideToWrapperTransitionEnd) {
23668
+ swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) {
23669
+ if (!swiper || swiper.destroyed) return;
23670
+ if (e.target !== this) return;
23671
+ swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
23672
+ swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);
23673
+ swiper.onSlideToWrapperTransitionEnd = null;
23674
+ delete swiper.onSlideToWrapperTransitionEnd;
23675
+ swiper.transitionEnd(runCallbacks, direction);
23676
+ };
23677
+ }
23678
+
23679
+ swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
23680
+ swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);
23681
+ }
23682
+
23683
+ return true;
23684
+ }
23685
+
23686
+ function slideToLoop(index = 0, speed = this.params.speed, runCallbacks = true, internal) {
23687
+ if (typeof index === 'string') {
23688
+ /**
23689
+ * The `index` argument converted from `string` to `number`.
23690
+ * @type {number}
23691
+ */
23692
+ const indexAsNumber = parseInt(index, 10);
23693
+ /**
23694
+ * Determines whether the `index` argument is a valid `number`
23695
+ * after being converted from the `string` type.
23696
+ * @type {boolean}
23697
+ */
23698
+
23699
+ const isValidNumber = isFinite(indexAsNumber);
23700
+
23701
+ if (!isValidNumber) {
23702
+ throw new Error(`The passed-in 'index' (string) couldn't be converted to 'number'. [${index}] given.`);
23703
+ } // Knowing that the converted `index` is a valid number,
23704
+ // we can update the original argument's value.
23705
+
23706
+
23707
+ index = indexAsNumber;
23708
+ }
23709
+
23710
+ const swiper = this;
23711
+ let newIndex = index;
23712
+
23713
+ if (swiper.params.loop) {
23714
+ newIndex += swiper.loopedSlides;
23715
+ }
23716
+
23717
+ return swiper.slideTo(newIndex, speed, runCallbacks, internal);
23718
+ }
23719
+
23720
+ /* eslint no-unused-vars: "off" */
23721
+ function slideNext(speed = this.params.speed, runCallbacks = true, internal) {
23722
+ const swiper = this;
23723
+ const {
23724
+ animating,
23725
+ enabled,
23726
+ params
23727
+ } = swiper;
23728
+ if (!enabled) return swiper;
23729
+ let perGroup = params.slidesPerGroup;
23730
+
23731
+ if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
23732
+ perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1);
23733
+ }
23734
+
23735
+ const increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : perGroup;
23736
+
23737
+ if (params.loop) {
23738
+ if (animating && params.loopPreventsSlide) return false;
23739
+ swiper.loopFix(); // eslint-disable-next-line
23740
+
23741
+ swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
23742
+ }
23743
+
23744
+ if (params.rewind && swiper.isEnd) {
23745
+ return swiper.slideTo(0, speed, runCallbacks, internal);
23746
+ }
23747
+
23748
+ return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);
23749
+ }
23750
+
23751
+ /* eslint no-unused-vars: "off" */
23752
+ function slidePrev(speed = this.params.speed, runCallbacks = true, internal) {
23753
+ const swiper = this;
23754
+ const {
23755
+ params,
23756
+ animating,
23757
+ snapGrid,
23758
+ slidesGrid,
23759
+ rtlTranslate,
23760
+ enabled
23761
+ } = swiper;
23762
+ if (!enabled) return swiper;
23763
+
23764
+ if (params.loop) {
23765
+ if (animating && params.loopPreventsSlide) return false;
23766
+ swiper.loopFix(); // eslint-disable-next-line
23767
+
23768
+ swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
23769
+ }
23770
+
23771
+ const translate = rtlTranslate ? swiper.translate : -swiper.translate;
23772
+
23773
+ function normalize(val) {
23774
+ if (val < 0) return -Math.floor(Math.abs(val));
23775
+ return Math.floor(val);
23776
+ }
23777
+
23778
+ const normalizedTranslate = normalize(translate);
23779
+ const normalizedSnapGrid = snapGrid.map(val => normalize(val));
23780
+ let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
23781
+
23782
+ if (typeof prevSnap === 'undefined' && params.cssMode) {
23783
+ let prevSnapIndex;
23784
+ snapGrid.forEach((snap, snapIndex) => {
23785
+ if (normalizedTranslate >= snap) {
23786
+ // prevSnap = snap;
23787
+ prevSnapIndex = snapIndex;
23788
+ }
23789
+ });
23790
+
23791
+ if (typeof prevSnapIndex !== 'undefined') {
23792
+ prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];
23793
+ }
23794
+ }
23795
+
23796
+ let prevIndex = 0;
23797
+
23798
+ if (typeof prevSnap !== 'undefined') {
23799
+ prevIndex = slidesGrid.indexOf(prevSnap);
23800
+ if (prevIndex < 0) prevIndex = swiper.activeIndex - 1;
23801
+
23802
+ if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
23803
+ prevIndex = prevIndex - swiper.slidesPerViewDynamic('previous', true) + 1;
23804
+ prevIndex = Math.max(prevIndex, 0);
23805
+ }
23806
+ }
23807
+
23808
+ if (params.rewind && swiper.isBeginning) {
23809
+ const lastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1;
23810
+ return swiper.slideTo(lastIndex, speed, runCallbacks, internal);
23811
+ }
23812
+
23813
+ return swiper.slideTo(prevIndex, speed, runCallbacks, internal);
23814
+ }
23815
+
23816
+ /* eslint no-unused-vars: "off" */
23817
+ function slideReset(speed = this.params.speed, runCallbacks = true, internal) {
23818
+ const swiper = this;
23819
+ return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
23820
+ }
23821
+
23822
+ /* eslint no-unused-vars: "off" */
23823
+ function slideToClosest(speed = this.params.speed, runCallbacks = true, internal, threshold = 0.5) {
23824
+ const swiper = this;
23825
+ let index = swiper.activeIndex;
23826
+ const skip = Math.min(swiper.params.slidesPerGroupSkip, index);
23827
+ const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
23828
+ const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
23829
+
23830
+ if (translate >= swiper.snapGrid[snapIndex]) {
23831
+ // The current translate is on or after the current snap index, so the choice
23832
+ // is between the current index and the one after it.
23833
+ const currentSnap = swiper.snapGrid[snapIndex];
23834
+ const nextSnap = swiper.snapGrid[snapIndex + 1];
23835
+
23836
+ if (translate - currentSnap > (nextSnap - currentSnap) * threshold) {
23837
+ index += swiper.params.slidesPerGroup;
23838
+ }
23839
+ } else {
23840
+ // The current translate is before the current snap index, so the choice
23841
+ // is between the current index and the one before it.
23842
+ const prevSnap = swiper.snapGrid[snapIndex - 1];
23843
+ const currentSnap = swiper.snapGrid[snapIndex];
23844
+
23845
+ if (translate - prevSnap <= (currentSnap - prevSnap) * threshold) {
23846
+ index -= swiper.params.slidesPerGroup;
23847
+ }
23848
+ }
23849
+
23850
+ index = Math.max(index, 0);
23851
+ index = Math.min(index, swiper.slidesGrid.length - 1);
23852
+ return swiper.slideTo(index, speed, runCallbacks, internal);
23853
+ }
23854
+
23855
+ function slideToClickedSlide() {
23856
+ const swiper = this;
23857
+ const {
23858
+ params,
23859
+ $wrapperEl
23860
+ } = swiper;
23861
+ const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;
23862
+ let slideToIndex = swiper.clickedIndex;
23863
+ let realIndex;
23864
+
23865
+ if (params.loop) {
23866
+ if (swiper.animating) return;
23867
+ realIndex = parseInt(dom7.$(swiper.clickedSlide).attr('data-swiper-slide-index'), 10);
23868
+
23869
+ if (params.centeredSlides) {
23870
+ if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {
23871
+ swiper.loopFix();
23872
+ slideToIndex = $wrapperEl.children(`.${params.slideClass}[data-swiper-slide-index="${realIndex}"]:not(.${params.slideDuplicateClass})`).eq(0).index();
23873
+ nextTick(() => {
23874
+ swiper.slideTo(slideToIndex);
23875
+ });
23876
+ } else {
23877
+ swiper.slideTo(slideToIndex);
23878
+ }
23879
+ } else if (slideToIndex > swiper.slides.length - slidesPerView) {
23880
+ swiper.loopFix();
23881
+ slideToIndex = $wrapperEl.children(`.${params.slideClass}[data-swiper-slide-index="${realIndex}"]:not(.${params.slideDuplicateClass})`).eq(0).index();
23882
+ nextTick(() => {
23883
+ swiper.slideTo(slideToIndex);
23884
+ });
23885
+ } else {
23886
+ swiper.slideTo(slideToIndex);
23887
+ }
23888
+ } else {
23889
+ swiper.slideTo(slideToIndex);
23890
+ }
23891
+ }
23892
+
23893
+ var slide = {
23894
+ slideTo,
23895
+ slideToLoop,
23896
+ slideNext,
23897
+ slidePrev,
23898
+ slideReset,
23899
+ slideToClosest,
23900
+ slideToClickedSlide
23901
+ };
23902
+
23903
+ function loopCreate() {
23904
+ const swiper = this;
23905
+ const document = ssrWindow.getDocument();
23906
+ const {
23907
+ params,
23908
+ $wrapperEl
23909
+ } = swiper; // Remove duplicated slides
23910
+
23911
+ const $selector = $wrapperEl.children().length > 0 ? dom7.$($wrapperEl.children()[0].parentNode) : $wrapperEl;
23912
+ $selector.children(`.${params.slideClass}.${params.slideDuplicateClass}`).remove();
23913
+ let slides = $selector.children(`.${params.slideClass}`);
23914
+
23915
+ if (params.loopFillGroupWithBlank) {
23916
+ const blankSlidesNum = params.slidesPerGroup - slides.length % params.slidesPerGroup;
23917
+
23918
+ if (blankSlidesNum !== params.slidesPerGroup) {
23919
+ for (let i = 0; i < blankSlidesNum; i += 1) {
23920
+ const blankNode = dom7.$(document.createElement('div')).addClass(`${params.slideClass} ${params.slideBlankClass}`);
23921
+ $selector.append(blankNode);
23922
+ }
23923
+
23924
+ slides = $selector.children(`.${params.slideClass}`);
23925
+ }
23926
+ }
23927
+
23928
+ if (params.slidesPerView === 'auto' && !params.loopedSlides) params.loopedSlides = slides.length;
23929
+ swiper.loopedSlides = Math.ceil(parseFloat(params.loopedSlides || params.slidesPerView, 10));
23930
+ swiper.loopedSlides += params.loopAdditionalSlides;
23931
+
23932
+ if (swiper.loopedSlides > slides.length && swiper.params.loopedSlidesLimit) {
23933
+ swiper.loopedSlides = slides.length;
23934
+ }
23935
+
23936
+ const prependSlides = [];
23937
+ const appendSlides = [];
23938
+ slides.each((el, index) => {
23939
+ const slide = dom7.$(el);
23940
+ slide.attr('data-swiper-slide-index', index);
23941
+ });
23942
+
23943
+ for (let i = 0; i < swiper.loopedSlides; i += 1) {
23944
+ const index = i - Math.floor(i / slides.length) * slides.length;
23945
+ appendSlides.push(slides.eq(index)[0]);
23946
+ prependSlides.unshift(slides.eq(slides.length - index - 1)[0]);
23947
+ }
23948
+
23949
+ for (let i = 0; i < appendSlides.length; i += 1) {
23950
+ $selector.append(dom7.$(appendSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass));
23951
+ }
23952
+
23953
+ for (let i = prependSlides.length - 1; i >= 0; i -= 1) {
23954
+ $selector.prepend(dom7.$(prependSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass));
23955
+ }
23956
+ }
23957
+
23958
+ function loopFix() {
23959
+ const swiper = this;
23960
+ swiper.emit('beforeLoopFix');
23961
+ const {
23962
+ activeIndex,
23963
+ slides,
23964
+ loopedSlides,
23965
+ allowSlidePrev,
23966
+ allowSlideNext,
23967
+ snapGrid,
23968
+ rtlTranslate: rtl
23969
+ } = swiper;
23970
+ let newIndex;
23971
+ swiper.allowSlidePrev = true;
23972
+ swiper.allowSlideNext = true;
23973
+ const snapTranslate = -snapGrid[activeIndex];
23974
+ const diff = snapTranslate - swiper.getTranslate(); // Fix For Negative Oversliding
23975
+
23976
+ if (activeIndex < loopedSlides) {
23977
+ newIndex = slides.length - loopedSlides * 3 + activeIndex;
23978
+ newIndex += loopedSlides;
23979
+ const slideChanged = swiper.slideTo(newIndex, 0, false, true);
23980
+
23981
+ if (slideChanged && diff !== 0) {
23982
+ swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
23983
+ }
23984
+ } else if (activeIndex >= slides.length - loopedSlides) {
23985
+ // Fix For Positive Oversliding
23986
+ newIndex = -slides.length + activeIndex + loopedSlides;
23987
+ newIndex += loopedSlides;
23988
+ const slideChanged = swiper.slideTo(newIndex, 0, false, true);
23989
+
23990
+ if (slideChanged && diff !== 0) {
23991
+ swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
23992
+ }
23993
+ }
23994
+
23995
+ swiper.allowSlidePrev = allowSlidePrev;
23996
+ swiper.allowSlideNext = allowSlideNext;
23997
+ swiper.emit('loopFix');
23998
+ }
23999
+
24000
+ function loopDestroy() {
24001
+ const swiper = this;
24002
+ const {
24003
+ $wrapperEl,
24004
+ params,
24005
+ slides
24006
+ } = swiper;
24007
+ $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass},.${params.slideClass}.${params.slideBlankClass}`).remove();
24008
+ slides.removeAttr('data-swiper-slide-index');
24009
+ }
24010
+
24011
+ var loop = {
24012
+ loopCreate,
24013
+ loopFix,
24014
+ loopDestroy
24015
+ };
24016
+
24017
+ function setGrabCursor(moving) {
24018
+ const swiper = this;
24019
+ if (swiper.support.touch || !swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return;
24020
+ const el = swiper.params.touchEventsTarget === 'container' ? swiper.el : swiper.wrapperEl;
24021
+ el.style.cursor = 'move';
24022
+ el.style.cursor = moving ? 'grabbing' : 'grab';
24023
+ }
24024
+
24025
+ function unsetGrabCursor() {
24026
+ const swiper = this;
24027
+
24028
+ if (swiper.support.touch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) {
24029
+ return;
24030
+ }
24031
+
24032
+ swiper[swiper.params.touchEventsTarget === 'container' ? 'el' : 'wrapperEl'].style.cursor = '';
24033
+ }
24034
+
24035
+ var grabCursor = {
24036
+ setGrabCursor,
24037
+ unsetGrabCursor
24038
+ };
24039
+
24040
+ function closestElement(selector, base = this) {
24041
+ function __closestFrom(el) {
24042
+ if (!el || el === ssrWindow.getDocument() || el === ssrWindow.getWindow()) return null;
24043
+ if (el.assignedSlot) el = el.assignedSlot;
24044
+ const found = el.closest(selector);
24045
+
24046
+ if (!found && !el.getRootNode) {
24047
+ return null;
24048
+ }
24049
+
24050
+ return found || __closestFrom(el.getRootNode().host);
24051
+ }
24052
+
24053
+ return __closestFrom(base);
24054
+ }
24055
+
24056
+ function onTouchStart(event) {
24057
+ const swiper = this;
24058
+ const document = ssrWindow.getDocument();
24059
+ const window = ssrWindow.getWindow();
24060
+ const data = swiper.touchEventsData;
24061
+ const {
24062
+ params,
24063
+ touches,
24064
+ enabled
24065
+ } = swiper;
24066
+ if (!enabled) return;
24067
+
24068
+ if (swiper.animating && params.preventInteractionOnTransition) {
24069
+ return;
24070
+ }
24071
+
24072
+ if (!swiper.animating && params.cssMode && params.loop) {
24073
+ swiper.loopFix();
24074
+ }
24075
+
24076
+ let e = event;
24077
+ if (e.originalEvent) e = e.originalEvent;
24078
+ let $targetEl = dom7.$(e.target);
24079
+
24080
+ if (params.touchEventsTarget === 'wrapper') {
24081
+ if (!$targetEl.closest(swiper.wrapperEl).length) return;
24082
+ }
24083
+
24084
+ data.isTouchEvent = e.type === 'touchstart';
24085
+ if (!data.isTouchEvent && 'which' in e && e.which === 3) return;
24086
+ if (!data.isTouchEvent && 'button' in e && e.button > 0) return;
24087
+ if (data.isTouched && data.isMoved) return; // change target el for shadow root component
24088
+
24089
+ const swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== ''; // eslint-disable-next-line
24090
+
24091
+ const eventPath = event.composedPath ? event.composedPath() : event.path;
24092
+
24093
+ if (swipingClassHasValue && e.target && e.target.shadowRoot && eventPath) {
24094
+ $targetEl = dom7.$(eventPath[0]);
24095
+ }
24096
+
24097
+ const noSwipingSelector = params.noSwipingSelector ? params.noSwipingSelector : `.${params.noSwipingClass}`;
24098
+ const isTargetShadow = !!(e.target && e.target.shadowRoot); // use closestElement for shadow root element to get the actual closest for nested shadow root element
24099
+
24100
+ if (params.noSwiping && (isTargetShadow ? closestElement(noSwipingSelector, $targetEl[0]) : $targetEl.closest(noSwipingSelector)[0])) {
24101
+ swiper.allowClick = true;
24102
+ return;
24103
+ }
24104
+
24105
+ if (params.swipeHandler) {
24106
+ if (!$targetEl.closest(params.swipeHandler)[0]) return;
24107
+ }
24108
+
24109
+ touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
24110
+ touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
24111
+ const startX = touches.currentX;
24112
+ const startY = touches.currentY; // Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore
24113
+
24114
+ const edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;
24115
+ const edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;
24116
+
24117
+ if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) {
24118
+ if (edgeSwipeDetection === 'prevent') {
24119
+ event.preventDefault();
24120
+ } else {
24121
+ return;
24122
+ }
24123
+ }
24124
+
24125
+ Object.assign(data, {
24126
+ isTouched: true,
24127
+ isMoved: false,
24128
+ allowTouchCallbacks: true,
24129
+ isScrolling: undefined,
24130
+ startMoving: undefined
24131
+ });
24132
+ touches.startX = startX;
24133
+ touches.startY = startY;
24134
+ data.touchStartTime = now();
24135
+ swiper.allowClick = true;
24136
+ swiper.updateSize();
24137
+ swiper.swipeDirection = undefined;
24138
+ if (params.threshold > 0) data.allowThresholdMove = false;
24139
+
24140
+ if (e.type !== 'touchstart') {
24141
+ let preventDefault = true;
24142
+
24143
+ if ($targetEl.is(data.focusableElements)) {
24144
+ preventDefault = false;
24145
+
24146
+ if ($targetEl[0].nodeName === 'SELECT') {
24147
+ data.isTouched = false;
24148
+ }
24149
+ }
24150
+
24151
+ if (document.activeElement && dom7.$(document.activeElement).is(data.focusableElements) && document.activeElement !== $targetEl[0]) {
24152
+ document.activeElement.blur();
24153
+ }
24154
+
24155
+ const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
24156
+
24157
+ if ((params.touchStartForcePreventDefault || shouldPreventDefault) && !$targetEl[0].isContentEditable) {
24158
+ e.preventDefault();
24159
+ }
24160
+ }
24161
+
24162
+ if (swiper.params.freeMode && swiper.params.freeMode.enabled && swiper.freeMode && swiper.animating && !params.cssMode) {
24163
+ swiper.freeMode.onTouchStart();
24164
+ }
24165
+
24166
+ swiper.emit('touchStart', e);
24167
+ }
24168
+
24169
+ function onTouchMove(event) {
24170
+ const document = ssrWindow.getDocument();
24171
+ const swiper = this;
24172
+ const data = swiper.touchEventsData;
24173
+ const {
24174
+ params,
24175
+ touches,
24176
+ rtlTranslate: rtl,
24177
+ enabled
24178
+ } = swiper;
24179
+ if (!enabled) return;
24180
+ let e = event;
24181
+ if (e.originalEvent) e = e.originalEvent;
24182
+
24183
+ if (!data.isTouched) {
24184
+ if (data.startMoving && data.isScrolling) {
24185
+ swiper.emit('touchMoveOpposite', e);
24186
+ }
24187
+
24188
+ return;
24189
+ }
24190
+
24191
+ if (data.isTouchEvent && e.type !== 'touchmove') return;
24192
+ const targetTouch = e.type === 'touchmove' && e.targetTouches && (e.targetTouches[0] || e.changedTouches[0]);
24193
+ const pageX = e.type === 'touchmove' ? targetTouch.pageX : e.pageX;
24194
+ const pageY = e.type === 'touchmove' ? targetTouch.pageY : e.pageY;
24195
+
24196
+ if (e.preventedByNestedSwiper) {
24197
+ touches.startX = pageX;
24198
+ touches.startY = pageY;
24199
+ return;
24200
+ }
24201
+
24202
+ if (!swiper.allowTouchMove) {
24203
+ if (!dom7.$(e.target).is(data.focusableElements)) {
24204
+ swiper.allowClick = false;
24205
+ }
24206
+
24207
+ if (data.isTouched) {
24208
+ Object.assign(touches, {
24209
+ startX: pageX,
24210
+ startY: pageY,
24211
+ currentX: pageX,
24212
+ currentY: pageY
24213
+ });
24214
+ data.touchStartTime = now();
24215
+ }
24216
+
24217
+ return;
24218
+ }
24219
+
24220
+ if (data.isTouchEvent && params.touchReleaseOnEdges && !params.loop) {
24221
+ if (swiper.isVertical()) {
24222
+ // Vertical
24223
+ if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) {
24224
+ data.isTouched = false;
24225
+ data.isMoved = false;
24226
+ return;
24227
+ }
24228
+ } else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) {
24229
+ return;
24230
+ }
24231
+ }
24232
+
24233
+ if (data.isTouchEvent && document.activeElement) {
24234
+ if (e.target === document.activeElement && dom7.$(e.target).is(data.focusableElements)) {
24235
+ data.isMoved = true;
24236
+ swiper.allowClick = false;
24237
+ return;
24238
+ }
24239
+ }
24240
+
24241
+ if (data.allowTouchCallbacks) {
24242
+ swiper.emit('touchMove', e);
24243
+ }
24244
+
24245
+ if (e.targetTouches && e.targetTouches.length > 1) return;
24246
+ touches.currentX = pageX;
24247
+ touches.currentY = pageY;
24248
+ const diffX = touches.currentX - touches.startX;
24249
+ const diffY = touches.currentY - touches.startY;
24250
+ if (swiper.params.threshold && Math.sqrt(diffX ** 2 + diffY ** 2) < swiper.params.threshold) return;
24251
+
24252
+ if (typeof data.isScrolling === 'undefined') {
24253
+ let touchAngle;
24254
+
24255
+ if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) {
24256
+ data.isScrolling = false;
24257
+ } else {
24258
+ // eslint-disable-next-line
24259
+ if (diffX * diffX + diffY * diffY >= 25) {
24260
+ touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI;
24261
+ data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle;
24262
+ }
24263
+ }
24264
+ }
24265
+
24266
+ if (data.isScrolling) {
24267
+ swiper.emit('touchMoveOpposite', e);
24268
+ }
24269
+
24270
+ if (typeof data.startMoving === 'undefined') {
24271
+ if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {
24272
+ data.startMoving = true;
24273
+ }
24274
+ }
24275
+
24276
+ if (data.isScrolling) {
24277
+ data.isTouched = false;
24278
+ return;
24279
+ }
24280
+
24281
+ if (!data.startMoving) {
24282
+ return;
24283
+ }
24284
+
24285
+ swiper.allowClick = false;
24286
+
24287
+ if (!params.cssMode && e.cancelable) {
24288
+ e.preventDefault();
24289
+ }
24290
+
24291
+ if (params.touchMoveStopPropagation && !params.nested) {
24292
+ e.stopPropagation();
24293
+ }
24294
+
24295
+ if (!data.isMoved) {
24296
+ if (params.loop && !params.cssMode) {
24297
+ swiper.loopFix();
24298
+ }
24299
+
24300
+ data.startTranslate = swiper.getTranslate();
24301
+ swiper.setTransition(0);
24302
+
24303
+ if (swiper.animating) {
24304
+ swiper.$wrapperEl.trigger('webkitTransitionEnd transitionend');
24305
+ }
24306
+
24307
+ data.allowMomentumBounce = false; // Grab Cursor
24308
+
24309
+ if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
24310
+ swiper.setGrabCursor(true);
24311
+ }
24312
+
24313
+ swiper.emit('sliderFirstMove', e);
24314
+ }
24315
+
24316
+ swiper.emit('sliderMove', e);
24317
+ data.isMoved = true;
24318
+ let diff = swiper.isHorizontal() ? diffX : diffY;
24319
+ touches.diff = diff;
24320
+ diff *= params.touchRatio;
24321
+ if (rtl) diff = -diff;
24322
+ swiper.swipeDirection = diff > 0 ? 'prev' : 'next';
24323
+ data.currentTranslate = diff + data.startTranslate;
24324
+ let disableParentSwiper = true;
24325
+ let resistanceRatio = params.resistanceRatio;
24326
+
24327
+ if (params.touchReleaseOnEdges) {
24328
+ resistanceRatio = 0;
24329
+ }
24330
+
24331
+ if (diff > 0 && data.currentTranslate > swiper.minTranslate()) {
24332
+ disableParentSwiper = false;
24333
+ if (params.resistance) data.currentTranslate = swiper.minTranslate() - 1 + (-swiper.minTranslate() + data.startTranslate + diff) ** resistanceRatio;
24334
+ } else if (diff < 0 && data.currentTranslate < swiper.maxTranslate()) {
24335
+ disableParentSwiper = false;
24336
+ if (params.resistance) data.currentTranslate = swiper.maxTranslate() + 1 - (swiper.maxTranslate() - data.startTranslate - diff) ** resistanceRatio;
24337
+ }
24338
+
24339
+ if (disableParentSwiper) {
24340
+ e.preventedByNestedSwiper = true;
24341
+ } // Directions locks
24342
+
24343
+
24344
+ if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) {
24345
+ data.currentTranslate = data.startTranslate;
24346
+ }
24347
+
24348
+ if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) {
24349
+ data.currentTranslate = data.startTranslate;
24350
+ }
24351
+
24352
+ if (!swiper.allowSlidePrev && !swiper.allowSlideNext) {
24353
+ data.currentTranslate = data.startTranslate;
24354
+ } // Threshold
24355
+
24356
+
24357
+ if (params.threshold > 0) {
24358
+ if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {
24359
+ if (!data.allowThresholdMove) {
24360
+ data.allowThresholdMove = true;
24361
+ touches.startX = touches.currentX;
24362
+ touches.startY = touches.currentY;
24363
+ data.currentTranslate = data.startTranslate;
24364
+ touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY;
24365
+ return;
24366
+ }
24367
+ } else {
24368
+ data.currentTranslate = data.startTranslate;
24369
+ return;
24370
+ }
24371
+ }
24372
+
24373
+ if (!params.followFinger || params.cssMode) return; // Update active index in free mode
24374
+
24375
+ if (params.freeMode && params.freeMode.enabled && swiper.freeMode || params.watchSlidesProgress) {
24376
+ swiper.updateActiveIndex();
24377
+ swiper.updateSlidesClasses();
24378
+ }
24379
+
24380
+ if (swiper.params.freeMode && params.freeMode.enabled && swiper.freeMode) {
24381
+ swiper.freeMode.onTouchMove();
24382
+ } // Update progress
24383
+
24384
+
24385
+ swiper.updateProgress(data.currentTranslate); // Update translate
24386
+
24387
+ swiper.setTranslate(data.currentTranslate);
24388
+ }
24389
+
24390
+ function onTouchEnd(event) {
24391
+ const swiper = this;
24392
+ const data = swiper.touchEventsData;
24393
+ const {
24394
+ params,
24395
+ touches,
24396
+ rtlTranslate: rtl,
24397
+ slidesGrid,
24398
+ enabled
24399
+ } = swiper;
24400
+ if (!enabled) return;
24401
+ let e = event;
24402
+ if (e.originalEvent) e = e.originalEvent;
24403
+
24404
+ if (data.allowTouchCallbacks) {
24405
+ swiper.emit('touchEnd', e);
24406
+ }
24407
+
24408
+ data.allowTouchCallbacks = false;
24409
+
24410
+ if (!data.isTouched) {
24411
+ if (data.isMoved && params.grabCursor) {
24412
+ swiper.setGrabCursor(false);
24413
+ }
24414
+
24415
+ data.isMoved = false;
24416
+ data.startMoving = false;
24417
+ return;
24418
+ } // Return Grab Cursor
24419
+
24420
+
24421
+ if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
24422
+ swiper.setGrabCursor(false);
24423
+ } // Time diff
24424
+
24425
+
24426
+ const touchEndTime = now();
24427
+ const timeDiff = touchEndTime - data.touchStartTime; // Tap, doubleTap, Click
24428
+
24429
+ if (swiper.allowClick) {
24430
+ const pathTree = e.path || e.composedPath && e.composedPath();
24431
+ swiper.updateClickedSlide(pathTree && pathTree[0] || e.target);
24432
+ swiper.emit('tap click', e);
24433
+
24434
+ if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) {
24435
+ swiper.emit('doubleTap doubleClick', e);
24436
+ }
24437
+ }
24438
+
24439
+ data.lastClickTime = now();
24440
+ nextTick(() => {
24441
+ if (!swiper.destroyed) swiper.allowClick = true;
24442
+ });
24443
+
24444
+ if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {
24445
+ data.isTouched = false;
24446
+ data.isMoved = false;
24447
+ data.startMoving = false;
24448
+ return;
24449
+ }
24450
+
24451
+ data.isTouched = false;
24452
+ data.isMoved = false;
24453
+ data.startMoving = false;
24454
+ let currentPos;
24455
+
24456
+ if (params.followFinger) {
24457
+ currentPos = rtl ? swiper.translate : -swiper.translate;
24458
+ } else {
24459
+ currentPos = -data.currentTranslate;
24460
+ }
24461
+
24462
+ if (params.cssMode) {
24463
+ return;
24464
+ }
24465
+
24466
+ if (swiper.params.freeMode && params.freeMode.enabled) {
24467
+ swiper.freeMode.onTouchEnd({
24468
+ currentPos
24469
+ });
24470
+ return;
24471
+ } // Find current slide
24472
+
24473
+
24474
+ let stopIndex = 0;
24475
+ let groupSize = swiper.slidesSizesGrid[0];
24476
+
24477
+ for (let i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) {
24478
+ const increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
24479
+
24480
+ if (typeof slidesGrid[i + increment] !== 'undefined') {
24481
+ if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) {
24482
+ stopIndex = i;
24483
+ groupSize = slidesGrid[i + increment] - slidesGrid[i];
24484
+ }
24485
+ } else if (currentPos >= slidesGrid[i]) {
24486
+ stopIndex = i;
24487
+ groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];
24488
+ }
24489
+ }
24490
+
24491
+ let rewindFirstIndex = null;
24492
+ let rewindLastIndex = null;
24493
+
24494
+ if (params.rewind) {
24495
+ if (swiper.isBeginning) {
24496
+ rewindLastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1;
24497
+ } else if (swiper.isEnd) {
24498
+ rewindFirstIndex = 0;
24499
+ }
24500
+ } // Find current slide size
24501
+
24502
+
24503
+ const ratio = (currentPos - slidesGrid[stopIndex]) / groupSize;
24504
+ const increment = stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
24505
+
24506
+ if (timeDiff > params.longSwipesMs) {
24507
+ // Long touches
24508
+ if (!params.longSwipes) {
24509
+ swiper.slideTo(swiper.activeIndex);
24510
+ return;
24511
+ }
24512
+
24513
+ if (swiper.swipeDirection === 'next') {
24514
+ if (ratio >= params.longSwipesRatio) swiper.slideTo(params.rewind && swiper.isEnd ? rewindFirstIndex : stopIndex + increment);else swiper.slideTo(stopIndex);
24515
+ }
24516
+
24517
+ if (swiper.swipeDirection === 'prev') {
24518
+ if (ratio > 1 - params.longSwipesRatio) {
24519
+ swiper.slideTo(stopIndex + increment);
24520
+ } else if (rewindLastIndex !== null && ratio < 0 && Math.abs(ratio) > params.longSwipesRatio) {
24521
+ swiper.slideTo(rewindLastIndex);
24522
+ } else {
24523
+ swiper.slideTo(stopIndex);
24524
+ }
24525
+ }
24526
+ } else {
24527
+ // Short swipes
24528
+ if (!params.shortSwipes) {
24529
+ swiper.slideTo(swiper.activeIndex);
24530
+ return;
24531
+ }
24532
+
24533
+ const isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl);
24534
+
24535
+ if (!isNavButtonTarget) {
24536
+ if (swiper.swipeDirection === 'next') {
24537
+ swiper.slideTo(rewindFirstIndex !== null ? rewindFirstIndex : stopIndex + increment);
24538
+ }
24539
+
24540
+ if (swiper.swipeDirection === 'prev') {
24541
+ swiper.slideTo(rewindLastIndex !== null ? rewindLastIndex : stopIndex);
24542
+ }
24543
+ } else if (e.target === swiper.navigation.nextEl) {
24544
+ swiper.slideTo(stopIndex + increment);
24545
+ } else {
24546
+ swiper.slideTo(stopIndex);
24547
+ }
24548
+ }
24549
+ }
24550
+
24551
+ function onResize() {
24552
+ const swiper = this;
24553
+ const {
24554
+ params,
24555
+ el
24556
+ } = swiper;
24557
+ if (el && el.offsetWidth === 0) return; // Breakpoints
24558
+
24559
+ if (params.breakpoints) {
24560
+ swiper.setBreakpoint();
24561
+ } // Save locks
24562
+
24563
+
24564
+ const {
24565
+ allowSlideNext,
24566
+ allowSlidePrev,
24567
+ snapGrid
24568
+ } = swiper; // Disable locks on resize
24569
+
24570
+ swiper.allowSlideNext = true;
24571
+ swiper.allowSlidePrev = true;
24572
+ swiper.updateSize();
24573
+ swiper.updateSlides();
24574
+ swiper.updateSlidesClasses();
24575
+
24576
+ if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides) {
24577
+ swiper.slideTo(swiper.slides.length - 1, 0, false, true);
24578
+ } else {
24579
+ swiper.slideTo(swiper.activeIndex, 0, false, true);
24580
+ }
24581
+
24582
+ if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
24583
+ swiper.autoplay.run();
24584
+ } // Return locks after resize
24585
+
24586
+
24587
+ swiper.allowSlidePrev = allowSlidePrev;
24588
+ swiper.allowSlideNext = allowSlideNext;
24589
+
24590
+ if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) {
24591
+ swiper.checkOverflow();
24592
+ }
24593
+ }
24594
+
24595
+ function onClick(e) {
24596
+ const swiper = this;
24597
+ if (!swiper.enabled) return;
24598
+
24599
+ if (!swiper.allowClick) {
24600
+ if (swiper.params.preventClicks) e.preventDefault();
24601
+
24602
+ if (swiper.params.preventClicksPropagation && swiper.animating) {
24603
+ e.stopPropagation();
24604
+ e.stopImmediatePropagation();
24605
+ }
24606
+ }
24607
+ }
24608
+
24609
+ function onScroll() {
24610
+ const swiper = this;
24611
+ const {
24612
+ wrapperEl,
24613
+ rtlTranslate,
24614
+ enabled
24615
+ } = swiper;
24616
+ if (!enabled) return;
24617
+ swiper.previousTranslate = swiper.translate;
24618
+
24619
+ if (swiper.isHorizontal()) {
24620
+ swiper.translate = -wrapperEl.scrollLeft;
24621
+ } else {
24622
+ swiper.translate = -wrapperEl.scrollTop;
24623
+ } // eslint-disable-next-line
24624
+
24625
+
24626
+ if (swiper.translate === 0) swiper.translate = 0;
24627
+ swiper.updateActiveIndex();
24628
+ swiper.updateSlidesClasses();
24629
+ let newProgress;
24630
+ const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
24631
+
24632
+ if (translatesDiff === 0) {
24633
+ newProgress = 0;
24634
+ } else {
24635
+ newProgress = (swiper.translate - swiper.minTranslate()) / translatesDiff;
24636
+ }
24637
+
24638
+ if (newProgress !== swiper.progress) {
24639
+ swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate);
24640
+ }
24641
+
24642
+ swiper.emit('setTranslate', swiper.translate, false);
24643
+ }
24644
+
24645
+ let dummyEventAttached = false;
24646
+
24647
+ function dummyEventListener() {}
24648
+
24649
+ const events = (swiper, method) => {
24650
+ const document = ssrWindow.getDocument();
24651
+ const {
24652
+ params,
24653
+ touchEvents,
24654
+ el,
24655
+ wrapperEl,
24656
+ device,
24657
+ support
24658
+ } = swiper;
24659
+ const capture = !!params.nested;
24660
+ const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener';
24661
+ const swiperMethod = method; // Touch Events
24662
+
24663
+ if (!support.touch) {
24664
+ el[domMethod](touchEvents.start, swiper.onTouchStart, false);
24665
+ document[domMethod](touchEvents.move, swiper.onTouchMove, capture);
24666
+ document[domMethod](touchEvents.end, swiper.onTouchEnd, false);
24667
+ } else {
24668
+ const passiveListener = touchEvents.start === 'touchstart' && support.passiveListener && params.passiveListeners ? {
24669
+ passive: true,
24670
+ capture: false
24671
+ } : false;
24672
+ el[domMethod](touchEvents.start, swiper.onTouchStart, passiveListener);
24673
+ el[domMethod](touchEvents.move, swiper.onTouchMove, support.passiveListener ? {
24674
+ passive: false,
24675
+ capture
24676
+ } : capture);
24677
+ el[domMethod](touchEvents.end, swiper.onTouchEnd, passiveListener);
24678
+
24679
+ if (touchEvents.cancel) {
24680
+ el[domMethod](touchEvents.cancel, swiper.onTouchEnd, passiveListener);
24681
+ }
24682
+ } // Prevent Links Clicks
24683
+
24684
+
24685
+ if (params.preventClicks || params.preventClicksPropagation) {
24686
+ el[domMethod]('click', swiper.onClick, true);
24687
+ }
24688
+
24689
+ if (params.cssMode) {
24690
+ wrapperEl[domMethod]('scroll', swiper.onScroll);
24691
+ } // Resize handler
24692
+
24693
+
24694
+ if (params.updateOnWindowResize) {
24695
+ swiper[swiperMethod](device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize, true);
24696
+ } else {
24697
+ swiper[swiperMethod]('observerUpdate', onResize, true);
24698
+ }
24699
+ };
24700
+
24701
+ function attachEvents() {
24702
+ const swiper = this;
24703
+ const document = ssrWindow.getDocument();
24704
+ const {
24705
+ params,
24706
+ support
24707
+ } = swiper;
24708
+ swiper.onTouchStart = onTouchStart.bind(swiper);
24709
+ swiper.onTouchMove = onTouchMove.bind(swiper);
24710
+ swiper.onTouchEnd = onTouchEnd.bind(swiper);
24711
+
24712
+ if (params.cssMode) {
24713
+ swiper.onScroll = onScroll.bind(swiper);
24714
+ }
24715
+
24716
+ swiper.onClick = onClick.bind(swiper);
24717
+
24718
+ if (support.touch && !dummyEventAttached) {
24719
+ document.addEventListener('touchstart', dummyEventListener);
24720
+ dummyEventAttached = true;
24721
+ }
24722
+
24723
+ events(swiper, 'on');
24724
+ }
24725
+
24726
+ function detachEvents() {
24727
+ const swiper = this;
24728
+ events(swiper, 'off');
24729
+ }
24730
+
24731
+ var events$1 = {
24732
+ attachEvents,
24733
+ detachEvents
24734
+ };
24735
+
24736
+ const isGridEnabled = (swiper, params) => {
24737
+ return swiper.grid && params.grid && params.grid.rows > 1;
24738
+ };
24739
+
24740
+ function setBreakpoint() {
24741
+ const swiper = this;
24742
+ const {
24743
+ activeIndex,
24744
+ initialized,
24745
+ loopedSlides = 0,
24746
+ params,
24747
+ $el
24748
+ } = swiper;
24749
+ const breakpoints = params.breakpoints;
24750
+ if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return; // Get breakpoint for window width and update parameters
24751
+
24752
+ const breakpoint = swiper.getBreakpoint(breakpoints, swiper.params.breakpointsBase, swiper.el);
24753
+ if (!breakpoint || swiper.currentBreakpoint === breakpoint) return;
24754
+ const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
24755
+ const breakpointParams = breakpointOnlyParams || swiper.originalParams;
24756
+ const wasMultiRow = isGridEnabled(swiper, params);
24757
+ const isMultiRow = isGridEnabled(swiper, breakpointParams);
24758
+ const wasEnabled = params.enabled;
24759
+
24760
+ if (wasMultiRow && !isMultiRow) {
24761
+ $el.removeClass(`${params.containerModifierClass}grid ${params.containerModifierClass}grid-column`);
24762
+ swiper.emitContainerClasses();
24763
+ } else if (!wasMultiRow && isMultiRow) {
24764
+ $el.addClass(`${params.containerModifierClass}grid`);
24765
+
24766
+ if (breakpointParams.grid.fill && breakpointParams.grid.fill === 'column' || !breakpointParams.grid.fill && params.grid.fill === 'column') {
24767
+ $el.addClass(`${params.containerModifierClass}grid-column`);
24768
+ }
24769
+
24770
+ swiper.emitContainerClasses();
24771
+ } // Toggle navigation, pagination, scrollbar
24772
+
24773
+
24774
+ ['navigation', 'pagination', 'scrollbar'].forEach(prop => {
24775
+ const wasModuleEnabled = params[prop] && params[prop].enabled;
24776
+ const isModuleEnabled = breakpointParams[prop] && breakpointParams[prop].enabled;
24777
+
24778
+ if (wasModuleEnabled && !isModuleEnabled) {
24779
+ swiper[prop].disable();
24780
+ }
24781
+
24782
+ if (!wasModuleEnabled && isModuleEnabled) {
24783
+ swiper[prop].enable();
24784
+ }
24785
+ });
24786
+ const directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction;
24787
+ const needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged);
24788
+
24789
+ if (directionChanged && initialized) {
24790
+ swiper.changeDirection();
24791
+ }
24792
+
24793
+ extend(swiper.params, breakpointParams);
24794
+ const isEnabled = swiper.params.enabled;
24795
+ Object.assign(swiper, {
24796
+ allowTouchMove: swiper.params.allowTouchMove,
24797
+ allowSlideNext: swiper.params.allowSlideNext,
24798
+ allowSlidePrev: swiper.params.allowSlidePrev
24799
+ });
24800
+
24801
+ if (wasEnabled && !isEnabled) {
24802
+ swiper.disable();
24803
+ } else if (!wasEnabled && isEnabled) {
24804
+ swiper.enable();
24805
+ }
24806
+
24807
+ swiper.currentBreakpoint = breakpoint;
24808
+ swiper.emit('_beforeBreakpoint', breakpointParams);
24809
+
24810
+ if (needsReLoop && initialized) {
24811
+ swiper.loopDestroy();
24812
+ swiper.loopCreate();
24813
+ swiper.updateSlides();
24814
+ swiper.slideTo(activeIndex - loopedSlides + swiper.loopedSlides, 0, false);
24815
+ }
24816
+
24817
+ swiper.emit('breakpoint', breakpointParams);
24818
+ }
24819
+
24820
+ function getBreakpoint(breakpoints, base = 'window', containerEl) {
24821
+ if (!breakpoints || base === 'container' && !containerEl) return undefined;
24822
+ let breakpoint = false;
24823
+ const window = ssrWindow.getWindow();
24824
+ const currentHeight = base === 'window' ? window.innerHeight : containerEl.clientHeight;
24825
+ const points = Object.keys(breakpoints).map(point => {
24826
+ if (typeof point === 'string' && point.indexOf('@') === 0) {
24827
+ const minRatio = parseFloat(point.substr(1));
24828
+ const value = currentHeight * minRatio;
24829
+ return {
24830
+ value,
24831
+ point
24832
+ };
24833
+ }
24834
+
24835
+ return {
24836
+ value: point,
24837
+ point
24838
+ };
24839
+ });
24840
+ points.sort((a, b) => parseInt(a.value, 10) - parseInt(b.value, 10));
24841
+
24842
+ for (let i = 0; i < points.length; i += 1) {
24843
+ const {
24844
+ point,
24845
+ value
24846
+ } = points[i];
24847
+
24848
+ if (base === 'window') {
24849
+ if (window.matchMedia(`(min-width: ${value}px)`).matches) {
24850
+ breakpoint = point;
24851
+ }
24852
+ } else if (value <= containerEl.clientWidth) {
24853
+ breakpoint = point;
24854
+ }
24855
+ }
24856
+
24857
+ return breakpoint || 'max';
24858
+ }
24859
+
24860
+ var breakpoints = {
24861
+ setBreakpoint,
24862
+ getBreakpoint
24863
+ };
24864
+
24865
+ function prepareClasses(entries, prefix) {
24866
+ const resultClasses = [];
24867
+ entries.forEach(item => {
24868
+ if (typeof item === 'object') {
24869
+ Object.keys(item).forEach(classNames => {
24870
+ if (item[classNames]) {
24871
+ resultClasses.push(prefix + classNames);
24872
+ }
24873
+ });
24874
+ } else if (typeof item === 'string') {
24875
+ resultClasses.push(prefix + item);
24876
+ }
24877
+ });
24878
+ return resultClasses;
24879
+ }
24880
+
24881
+ function addClasses() {
24882
+ const swiper = this;
24883
+ const {
24884
+ classNames,
24885
+ params,
24886
+ rtl,
24887
+ $el,
24888
+ device,
24889
+ support
24890
+ } = swiper; // prettier-ignore
24891
+
24892
+ const suffixes = prepareClasses(['initialized', params.direction, {
24893
+ 'pointer-events': !support.touch
24894
+ }, {
24895
+ 'free-mode': swiper.params.freeMode && params.freeMode.enabled
24896
+ }, {
24897
+ 'autoheight': params.autoHeight
24898
+ }, {
24899
+ 'rtl': rtl
24900
+ }, {
24901
+ 'grid': params.grid && params.grid.rows > 1
24902
+ }, {
24903
+ 'grid-column': params.grid && params.grid.rows > 1 && params.grid.fill === 'column'
24904
+ }, {
24905
+ 'android': device.android
24906
+ }, {
24907
+ 'ios': device.ios
24908
+ }, {
24909
+ 'css-mode': params.cssMode
24910
+ }, {
24911
+ 'centered': params.cssMode && params.centeredSlides
24912
+ }, {
24913
+ 'watch-progress': params.watchSlidesProgress
24914
+ }], params.containerModifierClass);
24915
+ classNames.push(...suffixes);
24916
+ $el.addClass([...classNames].join(' '));
24917
+ swiper.emitContainerClasses();
24918
+ }
24919
+
24920
+ function removeClasses() {
24921
+ const swiper = this;
24922
+ const {
24923
+ $el,
24924
+ classNames
24925
+ } = swiper;
24926
+ $el.removeClass(classNames.join(' '));
24927
+ swiper.emitContainerClasses();
24928
+ }
24929
+
24930
+ var classes = {
24931
+ addClasses,
24932
+ removeClasses
24933
+ };
24934
+
24935
+ function loadImage(imageEl, src, srcset, sizes, checkForComplete, callback) {
24936
+ const window = ssrWindow.getWindow();
24937
+ let image;
24938
+
24939
+ function onReady() {
24940
+ if (callback) callback();
24941
+ }
24942
+
24943
+ const isPicture = dom7.$(imageEl).parent('picture')[0];
24944
+
24945
+ if (!isPicture && (!imageEl.complete || !checkForComplete)) {
24946
+ if (src) {
24947
+ image = new window.Image();
24948
+ image.onload = onReady;
24949
+ image.onerror = onReady;
24950
+
24951
+ if (sizes) {
24952
+ image.sizes = sizes;
24953
+ }
24954
+
24955
+ if (srcset) {
24956
+ image.srcset = srcset;
24957
+ }
24958
+
24959
+ if (src) {
24960
+ image.src = src;
24961
+ }
24962
+ } else {
24963
+ onReady();
24964
+ }
24965
+ } else {
24966
+ // image already loaded...
24967
+ onReady();
24968
+ }
24969
+ }
24970
+
24971
+ function preloadImages() {
24972
+ const swiper = this;
24973
+ swiper.imagesToLoad = swiper.$el.find('img');
24974
+
24975
+ function onReady() {
24976
+ if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper.destroyed) return;
24977
+ if (swiper.imagesLoaded !== undefined) swiper.imagesLoaded += 1;
24978
+
24979
+ if (swiper.imagesLoaded === swiper.imagesToLoad.length) {
24980
+ if (swiper.params.updateOnImagesReady) swiper.update();
24981
+ swiper.emit('imagesReady');
24982
+ }
24983
+ }
24984
+
24985
+ for (let i = 0; i < swiper.imagesToLoad.length; i += 1) {
24986
+ const imageEl = swiper.imagesToLoad[i];
24987
+ swiper.loadImage(imageEl, imageEl.currentSrc || imageEl.getAttribute('src'), imageEl.srcset || imageEl.getAttribute('srcset'), imageEl.sizes || imageEl.getAttribute('sizes'), true, onReady);
24988
+ }
24989
+ }
24990
+
24991
+ var images = {
24992
+ loadImage,
24993
+ preloadImages
24994
+ };
24995
+
24996
+ function checkOverflow() {
24997
+ const swiper = this;
24998
+ const {
24999
+ isLocked: wasLocked,
25000
+ params
25001
+ } = swiper;
25002
+ const {
25003
+ slidesOffsetBefore
25004
+ } = params;
25005
+
25006
+ if (slidesOffsetBefore) {
25007
+ const lastSlideIndex = swiper.slides.length - 1;
25008
+ const lastSlideRightEdge = swiper.slidesGrid[lastSlideIndex] + swiper.slidesSizesGrid[lastSlideIndex] + slidesOffsetBefore * 2;
25009
+ swiper.isLocked = swiper.size > lastSlideRightEdge;
25010
+ } else {
25011
+ swiper.isLocked = swiper.snapGrid.length === 1;
25012
+ }
25013
+
25014
+ if (params.allowSlideNext === true) {
25015
+ swiper.allowSlideNext = !swiper.isLocked;
25016
+ }
25017
+
25018
+ if (params.allowSlidePrev === true) {
25019
+ swiper.allowSlidePrev = !swiper.isLocked;
25020
+ }
25021
+
25022
+ if (wasLocked && wasLocked !== swiper.isLocked) {
25023
+ swiper.isEnd = false;
25024
+ }
25025
+
25026
+ if (wasLocked !== swiper.isLocked) {
25027
+ swiper.emit(swiper.isLocked ? 'lock' : 'unlock');
25028
+ }
25029
+ }
25030
+
25031
+ var checkOverflow$1 = {
25032
+ checkOverflow
25033
+ };
25034
+
25035
+ var defaults = {
25036
+ init: true,
25037
+ direction: 'horizontal',
25038
+ touchEventsTarget: 'wrapper',
25039
+ initialSlide: 0,
25040
+ speed: 300,
25041
+ cssMode: false,
25042
+ updateOnWindowResize: true,
25043
+ resizeObserver: true,
25044
+ nested: false,
25045
+ createElements: false,
25046
+ enabled: true,
25047
+ focusableElements: 'input, select, option, textarea, button, video, label',
25048
+ // Overrides
25049
+ width: null,
25050
+ height: null,
25051
+ //
25052
+ preventInteractionOnTransition: false,
25053
+ // ssr
25054
+ userAgent: null,
25055
+ url: null,
25056
+ // To support iOS's swipe-to-go-back gesture (when being used in-app).
25057
+ edgeSwipeDetection: false,
25058
+ edgeSwipeThreshold: 20,
25059
+ // Autoheight
25060
+ autoHeight: false,
25061
+ // Set wrapper width
25062
+ setWrapperSize: false,
25063
+ // Virtual Translate
25064
+ virtualTranslate: false,
25065
+ // Effects
25066
+ effect: 'slide',
25067
+ // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'
25068
+ // Breakpoints
25069
+ breakpoints: undefined,
25070
+ breakpointsBase: 'window',
25071
+ // Slides grid
25072
+ spaceBetween: 0,
25073
+ slidesPerView: 1,
25074
+ slidesPerGroup: 1,
25075
+ slidesPerGroupSkip: 0,
25076
+ slidesPerGroupAuto: false,
25077
+ centeredSlides: false,
25078
+ centeredSlidesBounds: false,
25079
+ slidesOffsetBefore: 0,
25080
+ // in px
25081
+ slidesOffsetAfter: 0,
25082
+ // in px
25083
+ normalizeSlideIndex: true,
25084
+ centerInsufficientSlides: false,
25085
+ // Disable swiper and hide navigation when container not overflow
25086
+ watchOverflow: true,
25087
+ // Round length
25088
+ roundLengths: false,
25089
+ // Touches
25090
+ touchRatio: 1,
25091
+ touchAngle: 45,
25092
+ simulateTouch: true,
25093
+ shortSwipes: true,
25094
+ longSwipes: true,
25095
+ longSwipesRatio: 0.5,
25096
+ longSwipesMs: 300,
25097
+ followFinger: true,
25098
+ allowTouchMove: true,
25099
+ threshold: 0,
25100
+ touchMoveStopPropagation: false,
25101
+ touchStartPreventDefault: true,
25102
+ touchStartForcePreventDefault: false,
25103
+ touchReleaseOnEdges: false,
25104
+ // Unique Navigation Elements
25105
+ uniqueNavElements: true,
25106
+ // Resistance
25107
+ resistance: true,
25108
+ resistanceRatio: 0.85,
25109
+ // Progress
25110
+ watchSlidesProgress: false,
25111
+ // Cursor
25112
+ grabCursor: false,
25113
+ // Clicks
25114
+ preventClicks: true,
25115
+ preventClicksPropagation: true,
25116
+ slideToClickedSlide: false,
25117
+ // Images
25118
+ preloadImages: true,
25119
+ updateOnImagesReady: true,
25120
+ // loop
25121
+ loop: false,
25122
+ loopAdditionalSlides: 0,
25123
+ loopedSlides: null,
25124
+ loopedSlidesLimit: true,
25125
+ loopFillGroupWithBlank: false,
25126
+ loopPreventsSlide: true,
25127
+ // rewind
25128
+ rewind: false,
25129
+ // Swiping/no swiping
25130
+ allowSlidePrev: true,
25131
+ allowSlideNext: true,
25132
+ swipeHandler: null,
25133
+ // '.swipe-handler',
25134
+ noSwiping: true,
25135
+ noSwipingClass: 'swiper-no-swiping',
25136
+ noSwipingSelector: null,
25137
+ // Passive Listeners
25138
+ passiveListeners: true,
25139
+ maxBackfaceHiddenSlides: 10,
25140
+ // NS
25141
+ containerModifierClass: 'swiper-',
25142
+ // NEW
25143
+ slideClass: 'swiper-slide',
25144
+ slideBlankClass: 'swiper-slide-invisible-blank',
25145
+ slideActiveClass: 'swiper-slide-active',
25146
+ slideDuplicateActiveClass: 'swiper-slide-duplicate-active',
25147
+ slideVisibleClass: 'swiper-slide-visible',
25148
+ slideDuplicateClass: 'swiper-slide-duplicate',
25149
+ slideNextClass: 'swiper-slide-next',
25150
+ slideDuplicateNextClass: 'swiper-slide-duplicate-next',
25151
+ slidePrevClass: 'swiper-slide-prev',
25152
+ slideDuplicatePrevClass: 'swiper-slide-duplicate-prev',
25153
+ wrapperClass: 'swiper-wrapper',
25154
+ // Callbacks
25155
+ runCallbacksOnInit: true,
25156
+ // Internals
25157
+ _emitClasses: false
25158
+ };
25159
+
25160
+ function moduleExtendParams(params, allModulesParams) {
25161
+ return function extendParams(obj = {}) {
25162
+ const moduleParamName = Object.keys(obj)[0];
25163
+ const moduleParams = obj[moduleParamName];
25164
+
25165
+ if (typeof moduleParams !== 'object' || moduleParams === null) {
25166
+ extend(allModulesParams, obj);
25167
+ return;
25168
+ }
25169
+
25170
+ if (['navigation', 'pagination', 'scrollbar'].indexOf(moduleParamName) >= 0 && params[moduleParamName] === true) {
25171
+ params[moduleParamName] = {
25172
+ auto: true
25173
+ };
25174
+ }
25175
+
25176
+ if (!(moduleParamName in params && 'enabled' in moduleParams)) {
25177
+ extend(allModulesParams, obj);
25178
+ return;
25179
+ }
25180
+
25181
+ if (params[moduleParamName] === true) {
25182
+ params[moduleParamName] = {
25183
+ enabled: true
25184
+ };
25185
+ }
25186
+
25187
+ if (typeof params[moduleParamName] === 'object' && !('enabled' in params[moduleParamName])) {
25188
+ params[moduleParamName].enabled = true;
25189
+ }
25190
+
25191
+ if (!params[moduleParamName]) params[moduleParamName] = {
25192
+ enabled: false
25193
+ };
25194
+ extend(allModulesParams, obj);
25195
+ };
25196
+ }
25197
+
25198
+ /* eslint no-param-reassign: "off" */
25199
+ const prototypes = {
25200
+ eventsEmitter,
25201
+ update,
25202
+ translate,
25203
+ transition,
25204
+ slide,
25205
+ loop,
25206
+ grabCursor,
25207
+ events: events$1,
25208
+ breakpoints,
25209
+ checkOverflow: checkOverflow$1,
25210
+ classes,
25211
+ images
25212
+ };
25213
+ const extendedDefaults = {};
25214
+
25215
+ class Swiper {
25216
+ constructor(...args) {
25217
+ let el;
25218
+ let params;
25219
+
25220
+ if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') {
25221
+ params = args[0];
25222
+ } else {
25223
+ [el, params] = args;
25224
+ }
25225
+
25226
+ if (!params) params = {};
25227
+ params = extend({}, params);
25228
+ if (el && !params.el) params.el = el;
25229
+
25230
+ if (params.el && dom7.$(params.el).length > 1) {
25231
+ const swipers = [];
25232
+ dom7.$(params.el).each(containerEl => {
25233
+ const newParams = extend({}, params, {
25234
+ el: containerEl
25235
+ });
25236
+ swipers.push(new Swiper(newParams));
25237
+ }); // eslint-disable-next-line no-constructor-return
25238
+
25239
+ return swipers;
25240
+ } // Swiper Instance
25241
+
25242
+
25243
+ const swiper = this;
25244
+ swiper.__swiper__ = true;
25245
+ swiper.support = getSupport();
25246
+ swiper.device = getDevice({
25247
+ userAgent: params.userAgent
25248
+ });
25249
+ swiper.browser = getBrowser();
25250
+ swiper.eventsListeners = {};
25251
+ swiper.eventsAnyListeners = [];
25252
+ swiper.modules = [...swiper.__modules__];
25253
+
25254
+ if (params.modules && Array.isArray(params.modules)) {
25255
+ swiper.modules.push(...params.modules);
25256
+ }
25257
+
25258
+ const allModulesParams = {};
25259
+ swiper.modules.forEach(mod => {
25260
+ mod({
25261
+ swiper,
25262
+ extendParams: moduleExtendParams(params, allModulesParams),
25263
+ on: swiper.on.bind(swiper),
25264
+ once: swiper.once.bind(swiper),
25265
+ off: swiper.off.bind(swiper),
25266
+ emit: swiper.emit.bind(swiper)
25267
+ });
25268
+ }); // Extend defaults with modules params
25269
+
25270
+ const swiperParams = extend({}, defaults, allModulesParams); // Extend defaults with passed params
25271
+
25272
+ swiper.params = extend({}, swiperParams, extendedDefaults, params);
25273
+ swiper.originalParams = extend({}, swiper.params);
25274
+ swiper.passedParams = extend({}, params); // add event listeners
25275
+
25276
+ if (swiper.params && swiper.params.on) {
25277
+ Object.keys(swiper.params.on).forEach(eventName => {
25278
+ swiper.on(eventName, swiper.params.on[eventName]);
25279
+ });
25280
+ }
25281
+
25282
+ if (swiper.params && swiper.params.onAny) {
25283
+ swiper.onAny(swiper.params.onAny);
25284
+ } // Save Dom lib
25285
+
25286
+
25287
+ swiper.$ = dom7.$; // Extend Swiper
25288
+
25289
+ Object.assign(swiper, {
25290
+ enabled: swiper.params.enabled,
25291
+ el,
25292
+ // Classes
25293
+ classNames: [],
25294
+ // Slides
25295
+ slides: dom7.$(),
25296
+ slidesGrid: [],
25297
+ snapGrid: [],
25298
+ slidesSizesGrid: [],
25299
+
25300
+ // isDirection
25301
+ isHorizontal() {
25302
+ return swiper.params.direction === 'horizontal';
25303
+ },
25304
+
25305
+ isVertical() {
25306
+ return swiper.params.direction === 'vertical';
25307
+ },
25308
+
25309
+ // Indexes
25310
+ activeIndex: 0,
25311
+ realIndex: 0,
25312
+ //
25313
+ isBeginning: true,
25314
+ isEnd: false,
25315
+ // Props
25316
+ translate: 0,
25317
+ previousTranslate: 0,
25318
+ progress: 0,
25319
+ velocity: 0,
25320
+ animating: false,
25321
+ // Locks
25322
+ allowSlideNext: swiper.params.allowSlideNext,
25323
+ allowSlidePrev: swiper.params.allowSlidePrev,
25324
+ // Touch Events
25325
+ touchEvents: function touchEvents() {
25326
+ const touch = ['touchstart', 'touchmove', 'touchend', 'touchcancel'];
25327
+ const desktop = ['pointerdown', 'pointermove', 'pointerup'];
25328
+ swiper.touchEventsTouch = {
25329
+ start: touch[0],
25330
+ move: touch[1],
25331
+ end: touch[2],
25332
+ cancel: touch[3]
25333
+ };
25334
+ swiper.touchEventsDesktop = {
25335
+ start: desktop[0],
25336
+ move: desktop[1],
25337
+ end: desktop[2]
25338
+ };
25339
+ return swiper.support.touch || !swiper.params.simulateTouch ? swiper.touchEventsTouch : swiper.touchEventsDesktop;
25340
+ }(),
25341
+ touchEventsData: {
25342
+ isTouched: undefined,
25343
+ isMoved: undefined,
25344
+ allowTouchCallbacks: undefined,
25345
+ touchStartTime: undefined,
25346
+ isScrolling: undefined,
25347
+ currentTranslate: undefined,
25348
+ startTranslate: undefined,
25349
+ allowThresholdMove: undefined,
25350
+ // Form elements to match
25351
+ focusableElements: swiper.params.focusableElements,
25352
+ // Last click time
25353
+ lastClickTime: now(),
25354
+ clickTimeout: undefined,
25355
+ // Velocities
25356
+ velocities: [],
25357
+ allowMomentumBounce: undefined,
25358
+ isTouchEvent: undefined,
25359
+ startMoving: undefined
25360
+ },
25361
+ // Clicks
25362
+ allowClick: true,
25363
+ // Touches
25364
+ allowTouchMove: swiper.params.allowTouchMove,
25365
+ touches: {
25366
+ startX: 0,
25367
+ startY: 0,
25368
+ currentX: 0,
25369
+ currentY: 0,
25370
+ diff: 0
25371
+ },
25372
+ // Images
25373
+ imagesToLoad: [],
25374
+ imagesLoaded: 0
25375
+ });
25376
+ swiper.emit('_swiper'); // Init
25377
+
25378
+ if (swiper.params.init) {
25379
+ swiper.init();
25380
+ } // Return app instance
25381
+ // eslint-disable-next-line no-constructor-return
25382
+
25383
+
25384
+ return swiper;
25385
+ }
25386
+
25387
+ enable() {
25388
+ const swiper = this;
25389
+ if (swiper.enabled) return;
25390
+ swiper.enabled = true;
25391
+
25392
+ if (swiper.params.grabCursor) {
25393
+ swiper.setGrabCursor();
25394
+ }
25395
+
25396
+ swiper.emit('enable');
25397
+ }
25398
+
25399
+ disable() {
25400
+ const swiper = this;
25401
+ if (!swiper.enabled) return;
25402
+ swiper.enabled = false;
25403
+
25404
+ if (swiper.params.grabCursor) {
25405
+ swiper.unsetGrabCursor();
25406
+ }
25407
+
25408
+ swiper.emit('disable');
25409
+ }
25410
+
25411
+ setProgress(progress, speed) {
25412
+ const swiper = this;
25413
+ progress = Math.min(Math.max(progress, 0), 1);
25414
+ const min = swiper.minTranslate();
25415
+ const max = swiper.maxTranslate();
25416
+ const current = (max - min) * progress + min;
25417
+ swiper.translateTo(current, typeof speed === 'undefined' ? 0 : speed);
25418
+ swiper.updateActiveIndex();
25419
+ swiper.updateSlidesClasses();
25420
+ }
25421
+
25422
+ emitContainerClasses() {
25423
+ const swiper = this;
25424
+ if (!swiper.params._emitClasses || !swiper.el) return;
25425
+ const cls = swiper.el.className.split(' ').filter(className => {
25426
+ return className.indexOf('swiper') === 0 || className.indexOf(swiper.params.containerModifierClass) === 0;
25427
+ });
25428
+ swiper.emit('_containerClasses', cls.join(' '));
25429
+ }
25430
+
25431
+ getSlideClasses(slideEl) {
25432
+ const swiper = this;
25433
+ if (swiper.destroyed) return '';
25434
+ return slideEl.className.split(' ').filter(className => {
25435
+ return className.indexOf('swiper-slide') === 0 || className.indexOf(swiper.params.slideClass) === 0;
25436
+ }).join(' ');
25437
+ }
25438
+
25439
+ emitSlidesClasses() {
25440
+ const swiper = this;
25441
+ if (!swiper.params._emitClasses || !swiper.el) return;
25442
+ const updates = [];
25443
+ swiper.slides.each(slideEl => {
25444
+ const classNames = swiper.getSlideClasses(slideEl);
25445
+ updates.push({
25446
+ slideEl,
25447
+ classNames
25448
+ });
25449
+ swiper.emit('_slideClass', slideEl, classNames);
25450
+ });
25451
+ swiper.emit('_slideClasses', updates);
25452
+ }
25453
+
25454
+ slidesPerViewDynamic(view = 'current', exact = false) {
25455
+ const swiper = this;
25456
+ const {
25457
+ params,
25458
+ slides,
25459
+ slidesGrid,
25460
+ slidesSizesGrid,
25461
+ size: swiperSize,
25462
+ activeIndex
25463
+ } = swiper;
25464
+ let spv = 1;
25465
+
25466
+ if (params.centeredSlides) {
25467
+ let slideSize = slides[activeIndex].swiperSlideSize;
25468
+ let breakLoop;
25469
+
25470
+ for (let i = activeIndex + 1; i < slides.length; i += 1) {
25471
+ if (slides[i] && !breakLoop) {
25472
+ slideSize += slides[i].swiperSlideSize;
25473
+ spv += 1;
25474
+ if (slideSize > swiperSize) breakLoop = true;
25475
+ }
25476
+ }
25477
+
25478
+ for (let i = activeIndex - 1; i >= 0; i -= 1) {
25479
+ if (slides[i] && !breakLoop) {
25480
+ slideSize += slides[i].swiperSlideSize;
25481
+ spv += 1;
25482
+ if (slideSize > swiperSize) breakLoop = true;
25483
+ }
25484
+ }
25485
+ } else {
25486
+ // eslint-disable-next-line
25487
+ if (view === 'current') {
25488
+ for (let i = activeIndex + 1; i < slides.length; i += 1) {
25489
+ const slideInView = exact ? slidesGrid[i] + slidesSizesGrid[i] - slidesGrid[activeIndex] < swiperSize : slidesGrid[i] - slidesGrid[activeIndex] < swiperSize;
25490
+
25491
+ if (slideInView) {
25492
+ spv += 1;
25493
+ }
25494
+ }
25495
+ } else {
25496
+ // previous
25497
+ for (let i = activeIndex - 1; i >= 0; i -= 1) {
25498
+ const slideInView = slidesGrid[activeIndex] - slidesGrid[i] < swiperSize;
25499
+
25500
+ if (slideInView) {
25501
+ spv += 1;
25502
+ }
25503
+ }
25504
+ }
25505
+ }
25506
+
25507
+ return spv;
25508
+ }
25509
+
25510
+ update() {
25511
+ const swiper = this;
25512
+ if (!swiper || swiper.destroyed) return;
25513
+ const {
25514
+ snapGrid,
25515
+ params
25516
+ } = swiper; // Breakpoints
25517
+
25518
+ if (params.breakpoints) {
25519
+ swiper.setBreakpoint();
25520
+ }
25521
+
25522
+ swiper.updateSize();
25523
+ swiper.updateSlides();
25524
+ swiper.updateProgress();
25525
+ swiper.updateSlidesClasses();
25526
+
25527
+ function setTranslate() {
25528
+ const translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate;
25529
+ const newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate());
25530
+ swiper.setTranslate(newTranslate);
25531
+ swiper.updateActiveIndex();
25532
+ swiper.updateSlidesClasses();
25533
+ }
25534
+
25535
+ let translated;
25536
+
25537
+ if (swiper.params.freeMode && swiper.params.freeMode.enabled) {
25538
+ setTranslate();
25539
+
25540
+ if (swiper.params.autoHeight) {
25541
+ swiper.updateAutoHeight();
25542
+ }
25543
+ } else {
25544
+ if ((swiper.params.slidesPerView === 'auto' || swiper.params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) {
25545
+ translated = swiper.slideTo(swiper.slides.length - 1, 0, false, true);
25546
+ } else {
25547
+ translated = swiper.slideTo(swiper.activeIndex, 0, false, true);
25548
+ }
25549
+
25550
+ if (!translated) {
25551
+ setTranslate();
25552
+ }
25553
+ }
25554
+
25555
+ if (params.watchOverflow && snapGrid !== swiper.snapGrid) {
25556
+ swiper.checkOverflow();
25557
+ }
25558
+
25559
+ swiper.emit('update');
25560
+ }
25561
+
25562
+ changeDirection(newDirection, needUpdate = true) {
25563
+ const swiper = this;
25564
+ const currentDirection = swiper.params.direction;
25565
+
25566
+ if (!newDirection) {
25567
+ // eslint-disable-next-line
25568
+ newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal';
25569
+ }
25570
+
25571
+ if (newDirection === currentDirection || newDirection !== 'horizontal' && newDirection !== 'vertical') {
25572
+ return swiper;
25573
+ }
25574
+
25575
+ swiper.$el.removeClass(`${swiper.params.containerModifierClass}${currentDirection}`).addClass(`${swiper.params.containerModifierClass}${newDirection}`);
25576
+ swiper.emitContainerClasses();
25577
+ swiper.params.direction = newDirection;
25578
+ swiper.slides.each(slideEl => {
25579
+ if (newDirection === 'vertical') {
25580
+ slideEl.style.width = '';
25581
+ } else {
25582
+ slideEl.style.height = '';
25583
+ }
25584
+ });
25585
+ swiper.emit('changeDirection');
25586
+ if (needUpdate) swiper.update();
25587
+ return swiper;
25588
+ }
25589
+
25590
+ changeLanguageDirection(direction) {
25591
+ const swiper = this;
25592
+ if (swiper.rtl && direction === 'rtl' || !swiper.rtl && direction === 'ltr') return;
25593
+ swiper.rtl = direction === 'rtl';
25594
+ swiper.rtlTranslate = swiper.params.direction === 'horizontal' && swiper.rtl;
25595
+
25596
+ if (swiper.rtl) {
25597
+ swiper.$el.addClass(`${swiper.params.containerModifierClass}rtl`);
25598
+ swiper.el.dir = 'rtl';
25599
+ } else {
25600
+ swiper.$el.removeClass(`${swiper.params.containerModifierClass}rtl`);
25601
+ swiper.el.dir = 'ltr';
25602
+ }
25603
+
25604
+ swiper.update();
25605
+ }
25606
+
25607
+ mount(el) {
25608
+ const swiper = this;
25609
+ if (swiper.mounted) return true; // Find el
25610
+
25611
+ const $el = dom7.$(el || swiper.params.el);
25612
+ el = $el[0];
25613
+
25614
+ if (!el) {
25615
+ return false;
25616
+ }
25617
+
25618
+ el.swiper = swiper;
25619
+
25620
+ const getWrapperSelector = () => {
25621
+ return `.${(swiper.params.wrapperClass || '').trim().split(' ').join('.')}`;
25622
+ };
25623
+
25624
+ const getWrapper = () => {
25625
+ if (el && el.shadowRoot && el.shadowRoot.querySelector) {
25626
+ const res = dom7.$(el.shadowRoot.querySelector(getWrapperSelector())); // Children needs to return slot items
25627
+
25628
+ res.children = options => $el.children(options);
25629
+
25630
+ return res;
25631
+ }
25632
+
25633
+ if (!$el.children) {
25634
+ return dom7.$($el).children(getWrapperSelector());
25635
+ }
25636
+
25637
+ return $el.children(getWrapperSelector());
25638
+ }; // Find Wrapper
25639
+
25640
+
25641
+ let $wrapperEl = getWrapper();
25642
+
25643
+ if ($wrapperEl.length === 0 && swiper.params.createElements) {
25644
+ const document = ssrWindow.getDocument();
25645
+ const wrapper = document.createElement('div');
25646
+ $wrapperEl = dom7.$(wrapper);
25647
+ wrapper.className = swiper.params.wrapperClass;
25648
+ $el.append(wrapper);
25649
+ $el.children(`.${swiper.params.slideClass}`).each(slideEl => {
25650
+ $wrapperEl.append(slideEl);
25651
+ });
25652
+ }
25653
+
25654
+ Object.assign(swiper, {
25655
+ $el,
25656
+ el,
25657
+ $wrapperEl,
25658
+ wrapperEl: $wrapperEl[0],
25659
+ mounted: true,
25660
+ // RTL
25661
+ rtl: el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl',
25662
+ rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'),
25663
+ wrongRTL: $wrapperEl.css('display') === '-webkit-box'
25664
+ });
25665
+ return true;
25666
+ }
25667
+
25668
+ init(el) {
25669
+ const swiper = this;
25670
+ if (swiper.initialized) return swiper;
25671
+ const mounted = swiper.mount(el);
25672
+ if (mounted === false) return swiper;
25673
+ swiper.emit('beforeInit'); // Set breakpoint
25674
+
25675
+ if (swiper.params.breakpoints) {
25676
+ swiper.setBreakpoint();
25677
+ } // Add Classes
25678
+
25679
+
25680
+ swiper.addClasses(); // Create loop
25681
+
25682
+ if (swiper.params.loop) {
25683
+ swiper.loopCreate();
25684
+ } // Update size
25685
+
25686
+
25687
+ swiper.updateSize(); // Update slides
25688
+
25689
+ swiper.updateSlides();
25690
+
25691
+ if (swiper.params.watchOverflow) {
25692
+ swiper.checkOverflow();
25693
+ } // Set Grab Cursor
25694
+
25695
+
25696
+ if (swiper.params.grabCursor && swiper.enabled) {
25697
+ swiper.setGrabCursor();
25698
+ }
25699
+
25700
+ if (swiper.params.preloadImages) {
25701
+ swiper.preloadImages();
25702
+ } // Slide To Initial Slide
25703
+
25704
+
25705
+ if (swiper.params.loop) {
25706
+ swiper.slideTo(swiper.params.initialSlide + swiper.loopedSlides, 0, swiper.params.runCallbacksOnInit, false, true);
25707
+ } else {
25708
+ swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit, false, true);
25709
+ } // Attach events
25710
+
25711
+
25712
+ swiper.attachEvents(); // Init Flag
25713
+
25714
+ swiper.initialized = true; // Emit
25715
+
25716
+ swiper.emit('init');
25717
+ swiper.emit('afterInit');
25718
+ return swiper;
25719
+ }
25720
+
25721
+ destroy(deleteInstance = true, cleanStyles = true) {
25722
+ const swiper = this;
25723
+ const {
25724
+ params,
25725
+ $el,
25726
+ $wrapperEl,
25727
+ slides
25728
+ } = swiper;
25729
+
25730
+ if (typeof swiper.params === 'undefined' || swiper.destroyed) {
25731
+ return null;
25732
+ }
25733
+
25734
+ swiper.emit('beforeDestroy'); // Init Flag
25735
+
25736
+ swiper.initialized = false; // Detach events
25737
+
25738
+ swiper.detachEvents(); // Destroy loop
25739
+
25740
+ if (params.loop) {
25741
+ swiper.loopDestroy();
25742
+ } // Cleanup styles
25743
+
25744
+
25745
+ if (cleanStyles) {
25746
+ swiper.removeClasses();
25747
+ $el.removeAttr('style');
25748
+ $wrapperEl.removeAttr('style');
25749
+
25750
+ if (slides && slides.length) {
25751
+ slides.removeClass([params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass].join(' ')).removeAttr('style').removeAttr('data-swiper-slide-index');
25752
+ }
25753
+ }
25754
+
25755
+ swiper.emit('destroy'); // Detach emitter events
25756
+
25757
+ Object.keys(swiper.eventsListeners).forEach(eventName => {
25758
+ swiper.off(eventName);
25759
+ });
25760
+
25761
+ if (deleteInstance !== false) {
25762
+ swiper.$el[0].swiper = null;
25763
+ deleteProps(swiper);
25764
+ }
25765
+
25766
+ swiper.destroyed = true;
25767
+ return null;
25768
+ }
25769
+
25770
+ static extendDefaults(newDefaults) {
25771
+ extend(extendedDefaults, newDefaults);
25772
+ }
25773
+
25774
+ static get extendedDefaults() {
25775
+ return extendedDefaults;
25776
+ }
25777
+
25778
+ static get defaults() {
25779
+ return defaults;
25780
+ }
25781
+
25782
+ static installModule(mod) {
25783
+ if (!Swiper.prototype.__modules__) Swiper.prototype.__modules__ = [];
25784
+ const modules = Swiper.prototype.__modules__;
25785
+
25786
+ if (typeof mod === 'function' && modules.indexOf(mod) < 0) {
25787
+ modules.push(mod);
25788
+ }
25789
+ }
25790
+
25791
+ static use(module) {
25792
+ if (Array.isArray(module)) {
25793
+ module.forEach(m => Swiper.installModule(m));
25794
+ return Swiper;
25795
+ }
25796
+
25797
+ Swiper.installModule(module);
25798
+ return Swiper;
25799
+ }
25800
+
25801
+ }
25802
+
25803
+ Object.keys(prototypes).forEach(prototypeGroup => {
25804
+ Object.keys(prototypes[prototypeGroup]).forEach(protoMethod => {
25805
+ Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod];
25806
+ });
25807
+ });
25808
+ Swiper.use([Resize, Observer]);
25809
+
25810
+ /* eslint no-underscore-dangle: "off" */
25811
+ function Autoplay({
25812
+ swiper,
25813
+ extendParams,
25814
+ on,
25815
+ emit
25816
+ }) {
25817
+ let timeout;
25818
+ swiper.autoplay = {
25819
+ running: false,
25820
+ paused: false
25821
+ };
25822
+ extendParams({
25823
+ autoplay: {
25824
+ enabled: false,
25825
+ delay: 3000,
25826
+ waitForTransition: true,
25827
+ disableOnInteraction: true,
25828
+ stopOnLastSlide: false,
25829
+ reverseDirection: false,
25830
+ pauseOnMouseEnter: false
25831
+ }
25832
+ });
25833
+
25834
+ function run() {
25835
+ if (!swiper.size) {
25836
+ swiper.autoplay.running = false;
25837
+ swiper.autoplay.paused = false;
25838
+ return;
25839
+ }
25840
+
25841
+ const $activeSlideEl = swiper.slides.eq(swiper.activeIndex);
25842
+ let delay = swiper.params.autoplay.delay;
25843
+
25844
+ if ($activeSlideEl.attr('data-swiper-autoplay')) {
25845
+ delay = $activeSlideEl.attr('data-swiper-autoplay') || swiper.params.autoplay.delay;
25846
+ }
25847
+
25848
+ clearTimeout(timeout);
25849
+ timeout = nextTick(() => {
25850
+ let autoplayResult;
25851
+
25852
+ if (swiper.params.autoplay.reverseDirection) {
25853
+ if (swiper.params.loop) {
25854
+ swiper.loopFix();
25855
+ autoplayResult = swiper.slidePrev(swiper.params.speed, true, true);
25856
+ emit('autoplay');
25857
+ } else if (!swiper.isBeginning) {
25858
+ autoplayResult = swiper.slidePrev(swiper.params.speed, true, true);
25859
+ emit('autoplay');
25860
+ } else if (!swiper.params.autoplay.stopOnLastSlide) {
25861
+ autoplayResult = swiper.slideTo(swiper.slides.length - 1, swiper.params.speed, true, true);
25862
+ emit('autoplay');
25863
+ } else {
25864
+ stop();
25865
+ }
25866
+ } else if (swiper.params.loop) {
25867
+ swiper.loopFix();
25868
+ autoplayResult = swiper.slideNext(swiper.params.speed, true, true);
25869
+ emit('autoplay');
25870
+ } else if (!swiper.isEnd) {
25871
+ autoplayResult = swiper.slideNext(swiper.params.speed, true, true);
25872
+ emit('autoplay');
25873
+ } else if (!swiper.params.autoplay.stopOnLastSlide) {
25874
+ autoplayResult = swiper.slideTo(0, swiper.params.speed, true, true);
25875
+ emit('autoplay');
25876
+ } else {
25877
+ stop();
25878
+ }
25879
+
25880
+ if (swiper.params.cssMode && swiper.autoplay.running) run();else if (autoplayResult === false) {
25881
+ run();
25882
+ }
25883
+ }, delay);
25884
+ }
25885
+
25886
+ function start() {
25887
+ if (typeof timeout !== 'undefined') return false;
25888
+ if (swiper.autoplay.running) return false;
25889
+ swiper.autoplay.running = true;
25890
+ emit('autoplayStart');
25891
+ run();
25892
+ return true;
25893
+ }
25894
+
25895
+ function stop() {
25896
+ if (!swiper.autoplay.running) return false;
25897
+ if (typeof timeout === 'undefined') return false;
25898
+
25899
+ if (timeout) {
25900
+ clearTimeout(timeout);
25901
+ timeout = undefined;
25902
+ }
25903
+
25904
+ swiper.autoplay.running = false;
25905
+ emit('autoplayStop');
25906
+ return true;
25907
+ }
25908
+
25909
+ function pause(speed) {
25910
+ if (!swiper.autoplay.running) return;
25911
+ if (swiper.autoplay.paused) return;
25912
+ if (timeout) clearTimeout(timeout);
25913
+ swiper.autoplay.paused = true;
25914
+
25915
+ if (speed === 0 || !swiper.params.autoplay.waitForTransition) {
25916
+ swiper.autoplay.paused = false;
25917
+ run();
25918
+ } else {
25919
+ ['transitionend', 'webkitTransitionEnd'].forEach(event => {
25920
+ swiper.$wrapperEl[0].addEventListener(event, onTransitionEnd);
25921
+ });
25922
+ }
25923
+ }
25924
+
25925
+ function onVisibilityChange() {
25926
+ const document = ssrWindow.getDocument();
25927
+
25928
+ if (document.visibilityState === 'hidden' && swiper.autoplay.running) {
25929
+ pause();
25930
+ }
25931
+
25932
+ if (document.visibilityState === 'visible' && swiper.autoplay.paused) {
25933
+ run();
25934
+ swiper.autoplay.paused = false;
25935
+ }
25936
+ }
25937
+
25938
+ function onTransitionEnd(e) {
25939
+ if (!swiper || swiper.destroyed || !swiper.$wrapperEl) return;
25940
+ if (e.target !== swiper.$wrapperEl[0]) return;
25941
+ ['transitionend', 'webkitTransitionEnd'].forEach(event => {
25942
+ swiper.$wrapperEl[0].removeEventListener(event, onTransitionEnd);
25943
+ });
25944
+ swiper.autoplay.paused = false;
25945
+
25946
+ if (!swiper.autoplay.running) {
25947
+ stop();
25948
+ } else {
25949
+ run();
25950
+ }
25951
+ }
25952
+
25953
+ function onMouseEnter() {
25954
+ if (swiper.params.autoplay.disableOnInteraction) {
25955
+ stop();
25956
+ } else {
25957
+ emit('autoplayPause');
25958
+ pause();
25959
+ }
25960
+
25961
+ ['transitionend', 'webkitTransitionEnd'].forEach(event => {
25962
+ swiper.$wrapperEl[0].removeEventListener(event, onTransitionEnd);
25963
+ });
25964
+ }
25965
+
25966
+ function onMouseLeave() {
25967
+ if (swiper.params.autoplay.disableOnInteraction) {
25968
+ return;
25969
+ }
25970
+
25971
+ swiper.autoplay.paused = false;
25972
+ emit('autoplayResume');
25973
+ run();
25974
+ }
25975
+
25976
+ function attachMouseEvents() {
25977
+ if (swiper.params.autoplay.pauseOnMouseEnter) {
25978
+ swiper.$el.on('mouseenter', onMouseEnter);
25979
+ swiper.$el.on('mouseleave', onMouseLeave);
25980
+ }
25981
+ }
25982
+
25983
+ function detachMouseEvents() {
25984
+ swiper.$el.off('mouseenter', onMouseEnter);
25985
+ swiper.$el.off('mouseleave', onMouseLeave);
25986
+ }
25987
+
25988
+ on('init', () => {
25989
+ if (swiper.params.autoplay.enabled) {
25990
+ start();
25991
+ const document = ssrWindow.getDocument();
25992
+ document.addEventListener('visibilitychange', onVisibilityChange);
25993
+ attachMouseEvents();
25994
+ }
25995
+ });
25996
+ on('beforeTransitionStart', (_s, speed, internal) => {
25997
+ if (swiper.autoplay.running) {
25998
+ if (internal || !swiper.params.autoplay.disableOnInteraction) {
25999
+ swiper.autoplay.pause(speed);
26000
+ } else {
26001
+ stop();
26002
+ }
26003
+ }
26004
+ });
26005
+ on('sliderFirstMove', () => {
26006
+ if (swiper.autoplay.running) {
26007
+ if (swiper.params.autoplay.disableOnInteraction) {
26008
+ stop();
26009
+ } else {
26010
+ pause();
26011
+ }
26012
+ }
26013
+ });
26014
+ on('touchEnd', () => {
26015
+ if (swiper.params.cssMode && swiper.autoplay.paused && !swiper.params.autoplay.disableOnInteraction) {
26016
+ run();
26017
+ }
26018
+ });
26019
+ on('destroy', () => {
26020
+ detachMouseEvents();
26021
+
26022
+ if (swiper.autoplay.running) {
26023
+ stop();
26024
+ }
26025
+
26026
+ const document = ssrWindow.getDocument();
26027
+ document.removeEventListener('visibilitychange', onVisibilityChange);
26028
+ });
26029
+ Object.assign(swiper.autoplay, {
26030
+ pause,
26031
+ run,
26032
+ start,
26033
+ stop
26034
+ });
26035
+ }
26036
+
21936
26037
  /* src/PanoTagPlugin/Components/Common/MediaItem.svelte generated by Svelte v3.50.1 */
21937
26038
 
21938
26039
  function add_css$e(target) {
@@ -22212,7 +26313,7 @@ void main() {
22212
26313
  internal.add_render_callback(() => {
22213
26314
  if (div_outro) div_outro.end(1);
22214
26315
 
22215
- div_intro = internal.create_in_transition(div, transition.fly, /*animation*/ ctx[5]
26316
+ div_intro = internal.create_in_transition(div, transition$1.fly, /*animation*/ ctx[5]
22216
26317
  ? {
22217
26318
  y: 4,
22218
26319
  duration: /*duration*/ ctx[3],
@@ -22232,7 +26333,7 @@ void main() {
22232
26333
  if (div_intro) div_intro.invalidate();
22233
26334
 
22234
26335
  if (local) {
22235
- div_outro = internal.create_out_transition(div, transition.fly, /*animation*/ ctx[5]
26336
+ div_outro = internal.create_out_transition(div, transition$1.fly, /*animation*/ ctx[5]
22236
26337
  ? {
22237
26338
  y: 4,
22238
26339
  duration: /*duration*/ ctx[3],
@@ -22295,13 +26396,13 @@ void main() {
22295
26396
 
22296
26397
  // (31:4) {#if carouselEnabled}
22297
26398
  function create_if_block_1$6(ctx) {
22298
- let swiper$1;
26399
+ let swiper;
22299
26400
  let current;
22300
26401
 
22301
- swiper$1 = new svelte$1.Swiper({
26402
+ swiper = new svelte$1.Swiper({
22302
26403
  props: {
22303
26404
  style: "height: 100%",
22304
- modules: [swiper.Autoplay],
26405
+ modules: [Autoplay],
22305
26406
  spaceBetween: 30,
22306
26407
  autoplay: /*autoplay*/ ctx[10]
22307
26408
  ? noTypecheck({
@@ -22316,14 +26417,14 @@ void main() {
22316
26417
  }
22317
26418
  });
22318
26419
 
22319
- swiper$1.$on("slideChange", /*slideChange_handler*/ ctx[13]);
26420
+ swiper.$on("slideChange", /*slideChange_handler*/ ctx[13]);
22320
26421
 
22321
26422
  return {
22322
26423
  c() {
22323
- internal.create_component(swiper$1.$$.fragment);
26424
+ internal.create_component(swiper.$$.fragment);
22324
26425
  },
22325
26426
  m(target, anchor) {
22326
- internal.mount_component(swiper$1, target, anchor);
26427
+ internal.mount_component(swiper, target, anchor);
22327
26428
  current = true;
22328
26429
  },
22329
26430
  p(ctx, dirty) {
@@ -22341,19 +26442,19 @@ void main() {
22341
26442
  swiper_changes.$$scope = { dirty, ctx };
22342
26443
  }
22343
26444
 
22344
- swiper$1.$set(swiper_changes);
26445
+ swiper.$set(swiper_changes);
22345
26446
  },
22346
26447
  i(local) {
22347
26448
  if (current) return;
22348
- internal.transition_in(swiper$1.$$.fragment, local);
26449
+ internal.transition_in(swiper.$$.fragment, local);
22349
26450
  current = true;
22350
26451
  },
22351
26452
  o(local) {
22352
- internal.transition_out(swiper$1.$$.fragment, local);
26453
+ internal.transition_out(swiper.$$.fragment, local);
22353
26454
  current = false;
22354
26455
  },
22355
26456
  d(detaching) {
22356
- internal.destroy_component(swiper$1, detaching);
26457
+ internal.destroy_component(swiper, detaching);
22357
26458
  }
22358
26459
  };
22359
26460
  }
@@ -23763,7 +27864,7 @@ void main() {
23763
27864
  internal.add_render_callback(() => {
23764
27865
  if (div1_outro) div1_outro.end(1);
23765
27866
 
23766
- div1_intro = internal.create_in_transition(div1, transition.fade, {
27867
+ div1_intro = internal.create_in_transition(div1, transition$1.fade, {
23767
27868
  duration: /*duration*/ ctx[2],
23768
27869
  delay: /*inDelay*/ ctx[0],
23769
27870
  easing: easing.cubicInOut
@@ -23780,7 +27881,7 @@ void main() {
23780
27881
  if (div1_intro) div1_intro.invalidate();
23781
27882
 
23782
27883
  if (local) {
23783
- div1_outro = internal.create_out_transition(div1, transition.fade, {
27884
+ div1_outro = internal.create_out_transition(div1, transition$1.fade, {
23784
27885
  duration: /*duration*/ ctx[2],
23785
27886
  delay: /*outDelay*/ ctx[1],
23786
27887
  easing: easing.cubicInOut