Version Description
Download this release
Release Info
Developer | pasyuk |
Plugin | Gmedia Photo Gallery |
Version | 1.18.0 |
Comparing to | |
See all releases |
Code changes from version 1.17.6 to 1.18.0
- admin/assets/js/gmedia-block.js +222 -17
- assets/swiper/maps/swiper.jquery.min.js.map +0 -1
- assets/swiper/swiper.jquery.js +0 -4630
- assets/swiper/swiper.jquery.min.js +0 -18
- assets/swiper/swiper.js +8662 -0
- assets/swiper/swiper.js.map +1 -0
admin/assets/js/gmedia-block.js
CHANGED
@@ -1,7 +1,54 @@
|
|
1 |
(function(blocks, element) {
|
|
|
2 |
var el = element.createElement,
|
3 |
-
source = blocks.source
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
function GmediaGallery(atts) {
|
6 |
var id = atts.id;
|
7 |
var tagtext = '[gmedia id=' + id + ']';
|
@@ -19,15 +66,53 @@
|
|
19 |
return el('div', {className: 'gmedia-shortcode'}, tagtext);
|
20 |
}
|
21 |
|
|
|
22 |
blocks.registerBlockType('gmedia/gallery', {
|
23 |
title: 'Gmedia Gallery',
|
24 |
-
icon:
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
attributes: {
|
27 |
id: {
|
28 |
type: 'integer'
|
29 |
}
|
30 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
edit: function(props) {
|
33 |
var id = props.attributes.id;
|
@@ -73,12 +158,18 @@
|
|
73 |
|
74 |
if(id) {
|
75 |
var module = gmedia_data.galleries[id].module_name;
|
76 |
-
image = gmedia_data.modules[module].screenshot
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
-
children.push(
|
79 |
-
el('img', {className: 'gmedia-module-screenshot', src: image})
|
80 |
-
);
|
81 |
-
|
82 |
return el('form', {className: 'gmedia-preview', onSubmit: setGallery}, children);
|
83 |
},
|
84 |
|
@@ -93,19 +184,57 @@
|
|
93 |
|
94 |
blocks.registerBlockType('gmedia/album', {
|
95 |
title: 'Gmedia Album',
|
96 |
-
icon:
|
97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
attributes: {
|
99 |
id: {
|
100 |
type: 'integer'
|
101 |
},
|
102 |
module_name: {
|
103 |
-
type: 'string'
|
104 |
},
|
105 |
module_preset: {
|
106 |
-
type: 'string'
|
107 |
}
|
108 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
|
110 |
edit: function(props) {
|
111 |
var id = props.attributes.id;
|
@@ -206,8 +335,21 @@
|
|
206 |
|
207 |
blocks.registerBlockType('gmedia/category', {
|
208 |
title: 'Gmedia Category',
|
209 |
-
icon:
|
210 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
attributes: {
|
212 |
id: {
|
213 |
type: 'integer'
|
@@ -219,6 +361,31 @@
|
|
219 |
type: 'string'
|
220 |
}
|
221 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
|
223 |
edit: function(props) {
|
224 |
var id = props.attributes.id;
|
@@ -319,8 +486,21 @@
|
|
319 |
|
320 |
blocks.registerBlockType('gmedia/tag', {
|
321 |
title: 'Gmedia Tag',
|
322 |
-
icon:
|
323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
attributes: {
|
325 |
id: {
|
326 |
type: 'integer'
|
@@ -332,6 +512,31 @@
|
|
332 |
type: 'string'
|
333 |
}
|
334 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
|
336 |
edit: function(props) {
|
337 |
var id = props.attributes.id;
|
1 |
(function(blocks, element) {
|
2 |
+
console
|
3 |
var el = element.createElement,
|
4 |
+
source = blocks.source,
|
5 |
+
setCategories = blocks.setCategories,
|
6 |
+
getCategories = blocks.getCategories,
|
7 |
+
createBlock = blocks.createBlock;
|
8 |
+
|
9 |
+
var icons={};
|
10 |
+
var iconColor = '#316778'
|
11 |
+
icons.iconAlbum = el(
|
12 |
+
'svg',
|
13 |
+
{ width: 24, height: 24, style:{fill:iconColor}, viewBox:'0 0 24 24'},
|
14 |
+
el('path', { d:"M24,6c0-2.2-1.8-4-4-4H4C1.8,2,0,3.8,0,6v12c0,2.2,1.8,4,4,4h16c2.2,0,4-1.8,4-4V6z M6,6c1.1,0,2,0.9,2,2 c0,1.1-0.9,2-2,2S4,9.1,4,8C4,6.9,4.9,6,6,6z M22,18c0,1.1-0.9,2-2,2H4.4c-0.9,0-1.3-1.1-0.7-1.7l3.6-3.6c0.4-0.4,1-0.4,1.4,0 l0.6,0.6c0.4,0.4,1,0.4,1.4,0l6.6-6.6c0.4-0.4,1-0.4,1.4,0l3,3c0.2,0.2,0.3,0.4,0.3,0.7V18z"})
|
15 |
+
);
|
16 |
+
icons.iconGal = el(
|
17 |
+
'svg',
|
18 |
+
{ width: 24, height: 24, style:{fill:iconColor}, viewBox:'0 0 512 512'},
|
19 |
+
[
|
20 |
+
el('path', { d:"M464,128h-16v-16c0-26.51-21.49-48-48-48h-16V48c0-26.51-21.49-48-48-48H48C21.49,0,0,21.49,0,48v288 c0,26.51,21.49,48,48,48h16v16c0,26.51,21.49,48,48,48h16v16c0,26.51,21.49,48,48,48h288c26.51,0,48-21.49,48-48V176 C512,149.49,490.51,128,464,128z M32,265.44V48c0-8.837,7.163-16,16-16h288c8.837,0,16,7.163,16,16v153.44l-36.64-36.64 c-6.241-6.204-16.319-6.204-22.56,0L224,233.44l-68.64-68.8c-6.241-6.204-16.319-6.204-22.56,0L32,265.44z M112,416 c-8.837,0-16-7.163-16-16v-16h240c26.51,0,48-21.49,48-48V96h16c8.837,0,16,7.163,16,16v288c0,8.837-7.163,16-16,16H112z M480,464 c0,8.837-7.163,16-16,16H176c-8.837,0-16-7.163-16-16v-16h240c26.51,0,48-21.49,48-48V160h16c8.837,0,16,7.163,16,16V464z"}),
|
21 |
+
]
|
22 |
+
);
|
23 |
+
icons.iconCat = el(
|
24 |
+
'svg',
|
25 |
+
{ width: 24, height: 24, style:{fill:iconColor}, viewBox:'0 0 24 24'},
|
26 |
+
el('path', { d:"M24,6c0-2.2-1.8-4-4-4H4C1.8,2,0,3.8,0,6v12c0,2.2,1.8,4,4,4h16c2.2,0,4-1.8,4-4V6z M6,6c1.1,0,2,0.9,2,2 c0,1.1-0.9,2-2,2S4,9.1,4,8C4,6.9,4.9,6,6,6z M22,18c0,1.1-0.9,2-2,2H4.4c-0.9,0-1.3-1.1-0.7-1.7l3.6-3.6c0.4-0.4,1-0.4,1.4,0 l0.6,0.6c0.4,0.4,1,0.4,1.4,0l6.6-6.6c0.4-0.4,1-0.4,1.4,0l3,3c0.2,0.2,0.3,0.4,0.3,0.7V18z"})
|
27 |
+
);
|
28 |
+
icons.iconTag = el(
|
29 |
+
'svg',
|
30 |
+
{ width: 24, height: 24, style:{fill:iconColor}, viewBox:'0 0 427 427'},
|
31 |
+
[
|
32 |
+
el('path', { d:"M414.08,204.373L222.187,12.48C214.4,4.8,203.733,0,192,0H42.667C19.093,0,0,19.093,0,42.667V192 c0,11.84,4.8,22.507,12.587,30.187l192,192c7.68,7.68,18.347,12.48,30.08,12.48s22.507-4.8,30.187-12.48l149.333-149.333 c7.68-7.787,12.48-18.453,12.48-30.187C426.667,222.827,421.867,212.16,414.08,204.373z M74.667,106.667 c-17.707,0-32-14.293-32-32s14.293-32,32-32s32,14.293,32,32S92.373,106.667,74.667,106.667z"}),
|
33 |
+
]
|
34 |
+
);
|
35 |
+
icons.attention=el(
|
36 |
+
'svg',
|
37 |
+
{ width: 34, height: 34, style:{fill:iconColor}, viewBox:'0 0 30 30'},
|
38 |
+
[
|
39 |
+
el('path', { d:"M15,3C8.373,3,3,8.373,3,15c0,6.627,5.373,12,12,12s12-5.373,12-12C27,8.373,21.627,3,15,3z M16.212,8l-0.2,9h-2.024l-0.2-9 H16.212z M15.003,22.189c-0.828,0-1.323-0.441-1.323-1.182c0-0.755,0.494-1.196,1.323-1.196c0.822,0,1.316,0.441,1.316,1.196 C16.319,21.748,15.825,22.189,15.003,22.189z"}),
|
40 |
+
]
|
41 |
+
);
|
42 |
+
|
43 |
+
var category = {
|
44 |
+
slug: 'gmedia/gallery',
|
45 |
+
title: 'Gmedia Gallery',
|
46 |
+
icon: icons.iconAlbum
|
47 |
+
};
|
48 |
+
var catt = [category];
|
49 |
+
catt = catt.concat(getCategories());
|
50 |
+
setCategories(catt);
|
51 |
+
|
52 |
function GmediaGallery(atts) {
|
53 |
var id = atts.id;
|
54 |
var tagtext = '[gmedia id=' + id + ']';
|
66 |
return el('div', {className: 'gmedia-shortcode'}, tagtext);
|
67 |
}
|
68 |
|
69 |
+
|
70 |
blocks.registerBlockType('gmedia/gallery', {
|
71 |
title: 'Gmedia Gallery',
|
72 |
+
icon: { src: icons.iconGal},
|
73 |
+
description: 'Add Gmedia Gallery',
|
74 |
+
keywords: [
|
75 |
+
'gallery',
|
76 |
+
'images',
|
77 |
+
'video',
|
78 |
+
'youtube',
|
79 |
+
'vimeo',
|
80 |
+
'video',
|
81 |
+
'audio',
|
82 |
+
'mp3',
|
83 |
+
'lightbox',
|
84 |
+
],
|
85 |
+
category: category.slug,
|
86 |
attributes: {
|
87 |
id: {
|
88 |
type: 'integer'
|
89 |
}
|
90 |
},
|
91 |
+
transforms:{
|
92 |
+
to: [
|
93 |
+
{
|
94 |
+
type: 'block',
|
95 |
+
blocks: [ 'gmedia/album' ],
|
96 |
+
transform: function(){
|
97 |
+
return createBlock( 'gmedia/album', {})
|
98 |
+
}
|
99 |
+
},
|
100 |
+
{
|
101 |
+
type: 'block',
|
102 |
+
blocks: [ 'gmedia/category' ],
|
103 |
+
transform: function(){
|
104 |
+
return createBlock( 'gmedia/category', {})
|
105 |
+
}
|
106 |
+
},
|
107 |
+
{
|
108 |
+
type: 'block',
|
109 |
+
blocks: [ 'gmedia/tag' ],
|
110 |
+
transform: function(){
|
111 |
+
return createBlock( 'gmedia/tag', {})
|
112 |
+
}
|
113 |
+
}
|
114 |
+
]
|
115 |
+
},
|
116 |
|
117 |
edit: function(props) {
|
118 |
var id = props.attributes.id;
|
158 |
|
159 |
if(id) {
|
160 |
var module = gmedia_data.galleries[id].module_name;
|
161 |
+
image = (gmedia_data.modules[module] && gmedia_data.modules[module].screenshot)
|
162 |
+
?gmedia_data.modules[module].screenshot:undefined;
|
163 |
+
}
|
164 |
+
if(image){
|
165 |
+
children.push( el('img', {className: 'gmedia-module-screenshot', src: image}));
|
166 |
+
}else{
|
167 |
+
children.push( el('div', {style:{width:'240px', height:'140px', color:'red', margin:'10px', padding:'15px', display:'flex',
|
168 |
+
flexDirection: 'column', justifyContent: 'center', alignItems:'center', backgroundCcolor:'#fef8ee', textAlign: 'center'}}, [
|
169 |
+
'This gallery is broken, select another!',
|
170 |
+
icons.attention
|
171 |
+
]));
|
172 |
}
|
|
|
|
|
|
|
|
|
173 |
return el('form', {className: 'gmedia-preview', onSubmit: setGallery}, children);
|
174 |
},
|
175 |
|
184 |
|
185 |
blocks.registerBlockType('gmedia/album', {
|
186 |
title: 'Gmedia Album',
|
187 |
+
icon: { src: icons.iconAlbum},
|
188 |
+
description: 'Add Gmedia Album',
|
189 |
+
keywords: [
|
190 |
+
'gallery',
|
191 |
+
'images',
|
192 |
+
'video',
|
193 |
+
'youtube',
|
194 |
+
'vimeo',
|
195 |
+
'video',
|
196 |
+
'audio',
|
197 |
+
'mp3',
|
198 |
+
'lightbox',
|
199 |
+
'album'
|
200 |
+
],
|
201 |
+
category: category.slug,
|
202 |
attributes: {
|
203 |
id: {
|
204 |
type: 'integer'
|
205 |
},
|
206 |
module_name: {
|
207 |
+
type: 'string',
|
208 |
},
|
209 |
module_preset: {
|
210 |
+
type: 'string',
|
211 |
}
|
212 |
},
|
213 |
+
transforms:{
|
214 |
+
to: [
|
215 |
+
{
|
216 |
+
type: 'block',
|
217 |
+
blocks: [ 'gmedia/gallery' ],
|
218 |
+
transform: function(){
|
219 |
+
return createBlock( 'gmedia/gallery', {})
|
220 |
+
}
|
221 |
+
},
|
222 |
+
{
|
223 |
+
type: 'block',
|
224 |
+
blocks: [ 'gmedia/category' ],
|
225 |
+
transform: function(){
|
226 |
+
return createBlock( 'gmedia/category', {})
|
227 |
+
}
|
228 |
+
},
|
229 |
+
{
|
230 |
+
type: 'block',
|
231 |
+
blocks: [ 'gmedia/tag' ],
|
232 |
+
transform: function(){
|
233 |
+
return createBlock( 'gmedia/tag', {})
|
234 |
+
}
|
235 |
+
}
|
236 |
+
]
|
237 |
+
},
|
238 |
|
239 |
edit: function(props) {
|
240 |
var id = props.attributes.id;
|
335 |
|
336 |
blocks.registerBlockType('gmedia/category', {
|
337 |
title: 'Gmedia Category',
|
338 |
+
icon: { src: icons.iconCat},
|
339 |
+
description: 'Add Gmedia Category',
|
340 |
+
keywords: [
|
341 |
+
'gallery',
|
342 |
+
'images',
|
343 |
+
'video',
|
344 |
+
'youtube',
|
345 |
+
'vimeo',
|
346 |
+
'video',
|
347 |
+
'audio',
|
348 |
+
'mp3',
|
349 |
+
'lightbox',
|
350 |
+
'category'
|
351 |
+
],
|
352 |
+
category: category.slug,
|
353 |
attributes: {
|
354 |
id: {
|
355 |
type: 'integer'
|
361 |
type: 'string'
|
362 |
}
|
363 |
},
|
364 |
+
transforms:{
|
365 |
+
to: [
|
366 |
+
{
|
367 |
+
type: 'block',
|
368 |
+
blocks: [ 'gmedia/album' ],
|
369 |
+
transform: function(){
|
370 |
+
return createBlock( 'gmedia/album', {})
|
371 |
+
}
|
372 |
+
},
|
373 |
+
{
|
374 |
+
type: 'block',
|
375 |
+
blocks: [ 'gmedia/gallery' ],
|
376 |
+
transform: function(){
|
377 |
+
return createBlock( 'gmedia/gallery', {})
|
378 |
+
}
|
379 |
+
},
|
380 |
+
{
|
381 |
+
type: 'block',
|
382 |
+
blocks: [ 'gmedia/tag' ],
|
383 |
+
transform: function(){
|
384 |
+
return createBlock( 'gmedia/tag', {})
|
385 |
+
}
|
386 |
+
}
|
387 |
+
]
|
388 |
+
},
|
389 |
|
390 |
edit: function(props) {
|
391 |
var id = props.attributes.id;
|
486 |
|
487 |
blocks.registerBlockType('gmedia/tag', {
|
488 |
title: 'Gmedia Tag',
|
489 |
+
icon: { src: icons.iconTag},
|
490 |
+
description: 'Publish gallery by Gmedia Tag',
|
491 |
+
keywords: [
|
492 |
+
'gallery',
|
493 |
+
'images',
|
494 |
+
'video',
|
495 |
+
'youtube',
|
496 |
+
'vimeo',
|
497 |
+
'video',
|
498 |
+
'audio',
|
499 |
+
'mp3',
|
500 |
+
'lightbox',
|
501 |
+
'tag'
|
502 |
+
],
|
503 |
+
category: category.slug,
|
504 |
attributes: {
|
505 |
id: {
|
506 |
type: 'integer'
|
512 |
type: 'string'
|
513 |
}
|
514 |
},
|
515 |
+
transforms:{
|
516 |
+
to: [
|
517 |
+
{
|
518 |
+
type: 'block',
|
519 |
+
blocks: [ 'gmedia/album' ],
|
520 |
+
transform: function(){
|
521 |
+
return createBlock( 'gmedia/album', {})
|
522 |
+
}
|
523 |
+
},
|
524 |
+
{
|
525 |
+
type: 'block',
|
526 |
+
blocks: [ 'gmedia/category' ],
|
527 |
+
transform: function(){
|
528 |
+
return createBlock( 'gmedia/category', {})
|
529 |
+
}
|
530 |
+
},
|
531 |
+
{
|
532 |
+
type: 'block',
|
533 |
+
blocks: [ 'gmedia/gallery' ],
|
534 |
+
transform: function(){
|
535 |
+
return createBlock( 'gmedia/gallery', {})
|
536 |
+
}
|
537 |
+
}
|
538 |
+
]
|
539 |
+
},
|
540 |
|
541 |
edit: function(props) {
|
542 |
var id = props.attributes.id;
|
assets/swiper/maps/swiper.jquery.min.js.map
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"version":3,"sources":["swiper.jquery.js"],"names":["addLibraryPlugin","lib","fn","swiper","params","firstInstance","this","each","s","Swiper","$","container","round","a","Math","floor","autoplay","autoplayDelay","activeSlide","slides","eq","activeIndex","attr","autoplayTimeoutId","setTimeout","loop","fixLoop","_slideNext","emit","isEnd","autoplayStopOnLast","stopAutoplay","_slideTo","findElementInEvent","e","selector","el","target","is","parents","nodeType","found","index","_el","length","initObserver","options","ObserverFunc","window","MutationObserver","WebkitMutationObserver","observer","mutations","forEach","mutation","onResize","observe","attributes","childList","characterData","observers","push","handleKeyboard","originalEvent","kc","keyCode","charCode","allowSwipeToNext","isHorizontal","allowSwipeToPrev","shiftKey","altKey","ctrlKey","metaKey","document","activeElement","nodeName","toLowerCase","inView","slideClass","slideActiveClass","windowScroll","left","pageXOffset","top","pageYOffset","windowWidth","innerWidth","windowHeight","innerHeight","swiperOffset","offset","rtl","scrollLeft","swiperCoord","width","height","i","point","preventDefault","returnValue","slideNext","slidePrev","isEventSupported","eventName","isSupported","element","createElement","setAttribute","implementation","hasFeature","handleMousewheel","delta","rtlFactor","data","normalizeWheel","mousewheelForceToAxis","abs","pixelX","pixelY","mousewheelInvert","freeMode","position","getWrapperTranslate","mousewheelSensitivity","wasBeginning","isBeginning","wasEnd","minTranslate","maxTranslate","setWrapperTransition","setWrapperTranslate","updateProgress","updateActiveIndex","updateClasses","freeModeSticky","clearTimeout","mousewheel","timeout","slideReset","lazyLoading","lazy","load","autoplayDisableOnInteraction","Date","getTime","lastScrollTime","animating","mousewheelReleaseOnEdges","event","PIXEL_STEP","LINE_HEIGHT","PAGE_HEIGHT","sX","sY","pX","pY","detail","wheelDelta","wheelDeltaY","wheelDeltaX","axis","HORIZONTAL_AXIS","deltaY","deltaX","deltaMode","spinX","spinY","setParallaxTransform","progress","p","indexOf","parseInt","transform","normalizeEventName","toUpperCase","substring","defaults","direction","touchEventsTarget","initialSlide","speed","iOSEdgeSwipeDetection","iOSEdgeSwipeThreshold","freeModeMomentum","freeModeMomentumRatio","freeModeMomentumBounce","freeModeMomentumBounceRatio","freeModeMomentumVelocityRatio","freeModeMinimumVelocity","autoHeight","setWrapperSize","virtualTranslate","effect","coverflow","rotate","stretch","depth","modifier","slideShadows","flip","limitRotation","cube","shadow","shadowOffset","shadowScale","fade","crossFade","parallax","zoom","zoomMax","zoomMin","zoomToggle","scrollbar","scrollbarHide","scrollbarDraggable","scrollbarSnapOnRelease","keyboardControl","mousewheelControl","mousewheelEventsTarged","hashnav","hashnavWatchState","history","replaceState","breakpoints","undefined","spaceBetween","slidesPerView","slidesPerColumn","slidesPerColumnFill","slidesPerGroup","centeredSlides","slidesOffsetBefore","slidesOffsetAfter","roundLengths","touchRatio","touchAngle","simulateTouch","shortSwipes","longSwipes","longSwipesRatio","longSwipesMs","followFinger","onlyExternal","threshold","touchMoveStopPropagation","touchReleaseOnEdges","uniqueNavElements","pagination","paginationElement","paginationClickable","paginationHide","paginationBulletRender","paginationProgressRender","paginationFractionRender","paginationCustomRender","paginationType","resistance","resistanceRatio","nextButton","prevButton","watchSlidesProgress","watchSlidesVisibility","grabCursor","preventClicks","preventClicksPropagation","slideToClickedSlide","lazyLoadingInPrevNext","lazyLoadingInPrevNextAmount","lazyLoadingOnTransitionStart","preloadImages","updateOnImagesReady","loopAdditionalSlides","loopedSlides","control","controlInverse","controlBy","normalizeSlideIndex","swipeHandler","noSwiping","noSwipingClass","passiveListeners","containerModifierClass","slideDuplicateActiveClass","slideVisibleClass","slideDuplicateClass","slideNextClass","slideDuplicateNextClass","slidePrevClass","slideDuplicatePrevClass","wrapperClass","bulletClass","bulletActiveClass","buttonDisabledClass","paginationCurrentClass","paginationTotalClass","paginationHiddenClass","paginationProgressbarClass","paginationClickableClass","paginationModifierClass","lazyLoadingClass","lazyStatusLoadingClass","lazyStatusLoadedClass","lazyPreloaderClass","notificationClass","preloaderClass","zoomContainerClass","observeParents","a11y","prevSlideMessage","nextSlideMessage","firstSlideMessage","lastSlideMessage","paginationBulletMessage","runCallbacksOnInit","initialVirtualTranslate","originalParams","param","Dom7","jQuery","deepParam","def","deepDef","classNames","Zepto","currentBreakpoint","getActiveBreakpoint","breakpoint","points","hasOwnProperty","sort","b","setBreakpoint","breakPointsParams","needsReLoop","destroyLoop","reLoop","swipers","support","flexbox","transforms3d","touch","wrapper","children","paginationContainer","find","addClass","dir","css","wrongRTL","device","android","join","translate","velocity","lockSwipeToNext","unsetGrabCursor","lockSwipeToPrev","lockSwipes","unlockSwipeToNext","setGrabCursor","unlockSwipeToPrev","unlockSwipes","moving","style","cursor","imagesToLoad","imagesLoaded","loadImage","imgElement","src","srcset","sizes","checkForComplete","callback","onReady","image","complete","Image","onload","onerror","_onReady","update","currentSrc","getAttribute","autoplaying","autoplayPaused","startAutoplay","internal","pauseAutoplay","transitionEnd","snapGrid","updateAutoHeight","activeSlides","newHeight","ceil","offsetHeight","updateContainerSize","clientWidth","clientHeight","size","updateSlidesSize","slidesGrid","slidesSizesGrid","slidePosition","prevSlideSize","parseFloat","replace","virtualSize","marginLeft","marginTop","marginRight","marginBottom","slidesNumberEvenToRows","max","slideSize","slidesPerRow","numFullColumns","slide","newSlideOrderIndex","column","row","-webkit-box-ordinal-group","-moz-box-ordinal-group","-ms-flex-order","-webkit-order","order","outerWidth","outerHeight","swiperSlideSize","newSlidesGrid","updateSlidesOffset","swiperSlideOffset","offsetLeft","offsetTop","updateSlidesProgress","offsetCenter","removeClass","slideProgress","slideBefore","slideAfter","isVisible","translatesDiff","newActiveIndex","snapIndex","previousIndex","updateRealIndex","realIndex","hasClass","nextSlide","next","prevSlide","prev","current","total","bullets","text","scale","scaleX","scaleY","transition","html","disable","enable","updatePagination","paginationHTML","numberOfBullets","initPagination","updateTranslate","forceSetTranslate","newTranslate","min","set","translated","controller","spline","slideTo","forceUpdatePagination","slideChangedBySlideTo","touchEventsDesktop","start","move","end","navigator","pointerEnabled","msPointerEnabled","touchEvents","initEvents","detach","actionDom","action","moveCapture","nested","browser","ie","onTouchStart","onTouchMove","onTouchEnd","passiveListener","passive","capture","ios","onClickNext","onEnterKey","onClickPrev","onClickIndex","attachEvents","detachEvents","allowClick","stopPropagation","stopImmediatePropagation","updateClickedSlide","slideFound","clickedSlide","clickedIndex","slideToIndex","isTouched","isMoved","allowTouchCallbacks","touchStartTime","isScrolling","currentTranslate","startTranslate","allowThresholdMove","clickTimeout","allowMomentumBounce","formElements","lastClickTime","now","velocities","touches","startX","startY","currentX","currentY","diff","isTouchEvent","startMoving","type","which","targetTouches","pageX","pageY","swipeDirection","blur","preventedByNestedSwiper","atan2","PI","ieTouch","trigger","disableParentSwiper","pow","time","touchEndTime","timeDiff","toggleClass","currentPos","lastMoveEvent","pop","velocityEvent","distance","momentumDuration","momentumDistance","newPosition","afterBouncePosition","doBounce","bounceAmount","j","onTransitionStart","onTransitionEnd","stopIndex","groupSize","ratio","slideIndex","runCallbacks","lteIE9","setHistory","setHash","clientLeft","_slidePrev","disableTouchControl","enableTouchControl","duration","byController","effects","setTransition","x","y","z","setTranslate","getTranslate","matrix","curTransform","curStyle","transformMatrix","getComputedStyle","WebKitCSSMatrix","webkitTransform","split","map","MozTransform","OTransform","MsTransform","msTransform","getPropertyValue","toString","m41","m42","initObservers","containerParents","disconnectObservers","disconnect","createLoop","remove","prependSlides","appendSlides","append","cloneNode","prepend","removeAttr","updatePosition","oldIndex","newIndex","appendSlide","prependSlide","removeSlide","slidesIndexes","indexToRemove","removeAllSlides","tx","ty","slideOpacity","opacity","eventTriggered","triggerEvents","rotateY","rotateX","zIndex","shadowBefore","shadowAfter","cubeShadow","wrapperRotate","slideAngle","tz","-webkit-transform-origin","-moz-transform-origin","-ms-transform-origin","transform-origin","shadowAngle","multiplier","sin","cos","scale1","scale2","zFactor","isSafari","isUiWebView","center","slideOffset","offsetMultiplier","translateZ","translateY","translateX","slideTransform","ws","perspectiveOrigin","initialImageLoaded","loadImageInSlide","loadInDuplicate","img","add","_img","background","slideOriginalIndex","originalSlide","duplicatedSlide","amount","spv","maxIndex","minIndex","setDragPosition","sb","pointerPosition","clientX","clientY","track","dragSize","positionMin","moveDivider","positionMax","dragStart","dragTimeout","drag","dragMove","dragEnd","draggableEvents","enableDraggable","on","disableDraggable","off","trackSize","offsetWidth","divider","display","newPos","newSize","LinearSpline","lastIndex","i1","i3","interpolate","x2","binarySearch","guess","array","val","getInterpolateFunction","c","setControlledTranslate","controlledTranslate","controlled","isArray","setControlledTransition","onHashCange","newHash","location","hash","activeSlideHash","initialized","init","slideHash","destroy","pushState","paths","getPathValues","key","value","scrollToSlide","addEventListener","setHistoryPopState","pathArray","pathname","slice","slugify","includes","slideHistory","disableKeyboardControl","enableKeyboardControl","userAgent","disableMousewheelControl","enableMousewheelControl","parallaxDuration","currentScale","isScaling","gesture","slideWidth","slideHeight","imageWrap","minX","minY","maxX","maxY","touchesStart","touchesCurrent","prevPositionX","prevPositionY","prevTime","getDistanceBetweenTouches","x1","y1","y2","sqrt","onGestureStart","gestures","scaleStart","parent","onGestureChange","scaleMove","onGestureEnd","changedTouches","os","scaledWidth","scaledHeight","momentumDurationX","momentumDurationY","momentumDistanceX","newPositionX","momentumDistanceY","newPositionY","toggleZoom","touchX","touchY","offsetX","offsetY","diffX","diffY","imageWidth","imageHeight","translateMinX","translateMinY","translateMaxX","translateMaxY","_plugins","plugin","plugins","callPlugins","arguments","emitterEventListeners","handler","splice","once","_handler","makeFocusable","$el","addRole","role","addLabel","label","notify","click","liveRegion","message","notification","bullet","hashnavReplaceState","cleanupStyles","deleteInstance","removeEventListener","prototype","ua","test","arr","Object","apply","msMaxTouchPoints","maxTouchPoints","div","innerHTML","getElementsByTagName","match","ipad","ipod","iphone","Modernizr","DocumentTouch","csstransforms3d","styles","supportsPassive","opts","defineProperty","get","swiperDomPlugins","domLib","fireCallBack","call","events","dom","elStyle","webkitTransitionDuration","MsTransitionDuration","msTransitionDuration","MozTransitionDuration","OTransitionDuration","transitionDuration","includeMargins","module","exports","define","amd"],"mappings":";;;;;;;;;;;;;;CAcA,WACI,YAq7IA,SAASA,GAAiBC,GACtBA,EAAIC,GAAGC,OAAS,SAAUC,GACtB,GAAIC,EAKJ,OAJAJ,GAAIK,MAAMC,KAAK,WACX,GAAIC,GAAI,GAAIC,GAAOH,KAAMF,EACpBC,KAAeA,EAAgBG,KAEjCH,GA37If,GAAIK,GAIAD,EAAS,SAAUE,EAAWP,GAqgB9B,QAASQ,GAAMC,GACX,MAAOC,MAAKC,MAAMF,GAuEtB,QAASG,KACL,GAAIC,GAAgBT,EAAEJ,OAAOY,SACzBE,EAAcV,EAAEW,OAAOC,GAAGZ,EAAEa,YAC5BH,GAAYI,KAAK,0BACjBL,EAAgBC,EAAYI,KAAK,yBAA2Bd,EAAEJ,OAAOY,UAEzER,EAAEe,kBAAoBC,WAAW,WACzBhB,EAAEJ,OAAOqB,MACTjB,EAAEkB,UACFlB,EAAEmB,aACFnB,EAAEoB,KAAK,aAAcpB,IAGhBA,EAAEqB,MAKEzB,EAAO0B,mBAKRtB,EAAEuB,gBAJFvB,EAAEwB,SAAS,GACXxB,EAAEoB,KAAK,aAAcpB,KANzBA,EAAEmB,aACFnB,EAAEoB,KAAK,aAAcpB,KAY9BS,GAmvBP,QAASgB,GAAmBC,EAAGC,GAC3B,GAAIC,GAAK1B,EAAEwB,EAAEG,OACb,KAAKD,EAAGE,GAAGH,GACP,GAAwB,gBAAbA,GACPC,EAAKA,EAAGG,QAAQJ,OAE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AAUlzB,OAAOvC,OAED,kBAAX01B,SAAyBA,OAAOC,KAC5CD,UAAW,WACP,YACA,OAAOnzB,QAAOvC","file":"../swiper.jquery.min.js","sourcesContent":["/**\n * Swiper 3.4.0\n * Most modern mobile touch slider and framework with hardware accelerated transitions\n * \n * http://www.idangero.us/swiper/\n * \n * Copyright 2016, Vladimir Kharlampidi\n * The iDangero.us\n * http://www.idangero.us/\n * \n * Licensed under MIT\n * \n * Released on: October 16, 2016\n */\n(function () {\n 'use strict';\n var $;\n /*===========================\n Swiper\n ===========================*/\n var Swiper = function (container, params) {\n if (!(this instanceof Swiper)) return new Swiper(container, params);\n\n var defaults = {\n direction: 'horizontal',\n touchEventsTarget: 'container',\n initialSlide: 0,\n speed: 300,\n // autoplay\n autoplay: false,\n autoplayDisableOnInteraction: true,\n autoplayStopOnLast: false,\n // To support iOS's swipe-to-go-back gesture (when being used in-app, with UIWebView).\n iOSEdgeSwipeDetection: false,\n iOSEdgeSwipeThreshold: 20,\n // Free mode\n freeMode: false,\n freeModeMomentum: true,\n freeModeMomentumRatio: 1,\n freeModeMomentumBounce: true,\n freeModeMomentumBounceRatio: 1,\n freeModeMomentumVelocityRatio: 1,\n freeModeSticky: false,\n freeModeMinimumVelocity: 0.02,\n // Autoheight\n autoHeight: false,\n // Set wrapper width\n setWrapperSize: false,\n // Virtual Translate\n virtualTranslate: false,\n // Effects\n effect: 'slide', // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'\n coverflow: {\n rotate: 50,\n stretch: 0,\n depth: 100,\n modifier: 1,\n slideShadows : true\n },\n flip: {\n slideShadows : true,\n limitRotation: true\n },\n cube: {\n slideShadows: true,\n shadow: true,\n shadowOffset: 20,\n shadowScale: 0.94\n },\n fade: {\n crossFade: false\n },\n // Parallax\n parallax: false,\n // Zoom\n zoom: false,\n zoomMax: 3,\n zoomMin: 1,\n zoomToggle: true,\n // Scrollbar\n scrollbar: null,\n scrollbarHide: true,\n scrollbarDraggable: false,\n scrollbarSnapOnRelease: false,\n // Keyboard Mousewheel\n keyboardControl: false,\n mousewheelControl: false,\n mousewheelReleaseOnEdges: false,\n mousewheelInvert: false,\n mousewheelForceToAxis: false,\n mousewheelSensitivity: 1,\n mousewheelEventsTarged: 'container',\n // Hash Navigation\n hashnav: false,\n hashnavWatchState: false,\n // History\n history: false,\n // Commong Nav State\n replaceState: false,\n // Breakpoints\n breakpoints: undefined,\n // Slides grid\n spaceBetween: 0,\n slidesPerView: 1,\n slidesPerColumn: 1,\n slidesPerColumnFill: 'column',\n slidesPerGroup: 1,\n centeredSlides: false,\n slidesOffsetBefore: 0, // in px\n slidesOffsetAfter: 0, // in px\n // Round length\n roundLengths: false,\n // Touches\n touchRatio: 1,\n touchAngle: 45,\n simulateTouch: true,\n shortSwipes: true,\n longSwipes: true,\n longSwipesRatio: 0.5,\n longSwipesMs: 300,\n followFinger: true,\n onlyExternal: false,\n threshold: 0,\n touchMoveStopPropagation: true,\n touchReleaseOnEdges: false,\n // Unique Navigation Elements\n uniqueNavElements: true,\n // Pagination\n pagination: null,\n paginationElement: 'span',\n paginationClickable: false,\n paginationHide: false,\n paginationBulletRender: null,\n paginationProgressRender: null,\n paginationFractionRender: null,\n paginationCustomRender: null,\n paginationType: 'bullets', // 'bullets' or 'progress' or 'fraction' or 'custom'\n // Resistance\n resistance: true,\n resistanceRatio: 0.85,\n // Next/prev buttons\n nextButton: null,\n prevButton: null,\n // Progress\n watchSlidesProgress: false,\n watchSlidesVisibility: false,\n // Cursor\n grabCursor: false,\n // Clicks\n preventClicks: true,\n preventClicksPropagation: true,\n slideToClickedSlide: false,\n // Lazy Loading\n lazyLoading: false,\n lazyLoadingInPrevNext: false,\n lazyLoadingInPrevNextAmount: 1,\n lazyLoadingOnTransitionStart: false,\n // Images\n preloadImages: true,\n updateOnImagesReady: true,\n // loop\n loop: false,\n loopAdditionalSlides: 0,\n loopedSlides: null,\n // Control\n control: undefined,\n controlInverse: false,\n controlBy: 'slide', //or 'container'\n normalizeSlideIndex: true,\n // Swiping/no swiping\n allowSwipeToPrev: true,\n allowSwipeToNext: true,\n swipeHandler: null, //'.swipe-handler',\n noSwiping: true,\n noSwipingClass: 'swiper-no-swiping',\n // Passive Listeners\n passiveListeners: true,\n // NS\n containerModifierClass: 'swiper-container-', // NEW\n slideClass: 'swiper-slide',\n slideActiveClass: 'swiper-slide-active',\n slideDuplicateActiveClass: 'swiper-slide-duplicate-active',\n slideVisibleClass: 'swiper-slide-visible',\n slideDuplicateClass: 'swiper-slide-duplicate',\n slideNextClass: 'swiper-slide-next',\n slideDuplicateNextClass: 'swiper-slide-duplicate-next',\n slidePrevClass: 'swiper-slide-prev',\n slideDuplicatePrevClass: 'swiper-slide-duplicate-prev',\n wrapperClass: 'swiper-wrapper',\n bulletClass: 'swiper-pagination-bullet',\n bulletActiveClass: 'swiper-pagination-bullet-active',\n buttonDisabledClass: 'swiper-button-disabled',\n paginationCurrentClass: 'swiper-pagination-current',\n paginationTotalClass: 'swiper-pagination-total',\n paginationHiddenClass: 'swiper-pagination-hidden',\n paginationProgressbarClass: 'swiper-pagination-progressbar',\n paginationClickableClass: 'swiper-pagination-clickable', // NEW\n paginationModifierClass: 'swiper-pagination-', // NEW\n lazyLoadingClass: 'swiper-lazy',\n lazyStatusLoadingClass: 'swiper-lazy-loading',\n lazyStatusLoadedClass: 'swiper-lazy-loaded',\n lazyPreloaderClass: 'swiper-lazy-preloader',\n notificationClass: 'swiper-notification',\n preloaderClass: 'preloader',\n zoomContainerClass: 'swiper-zoom-container',\n \n // Observer\n observer: false,\n observeParents: false,\n // Accessibility\n a11y: false,\n prevSlideMessage: 'Previous slide',\n nextSlideMessage: 'Next slide',\n firstSlideMessage: 'This is the first slide',\n lastSlideMessage: 'This is the last slide',\n paginationBulletMessage: 'Go to slide {{index}}',\n // Callbacks\n runCallbacksOnInit: true\n /*\n Callbacks:\n onInit: function (swiper)\n onDestroy: function (swiper)\n onClick: function (swiper, e)\n onTap: function (swiper, e)\n onDoubleTap: function (swiper, e)\n onSliderMove: function (swiper, e)\n onSlideChangeStart: function (swiper)\n onSlideChangeEnd: function (swiper)\n onTransitionStart: function (swiper)\n onTransitionEnd: function (swiper)\n onImagesReady: function (swiper)\n onProgress: function (swiper, progress)\n onTouchStart: function (swiper, e)\n onTouchMove: function (swiper, e)\n onTouchMoveOpposite: function (swiper, e)\n onTouchEnd: function (swiper, e)\n onReachBeginning: function (swiper)\n onReachEnd: function (swiper)\n onSetTransition: function (swiper, duration)\n onSetTranslate: function (swiper, translate)\n onAutoplayStart: function (swiper)\n onAutoplayStop: function (swiper),\n onLazyImageLoad: function (swiper, slide, image)\n onLazyImageReady: function (swiper, slide, image)\n */\n \n };\n var initialVirtualTranslate = params && params.virtualTranslate;\n \n params = params || {};\n var originalParams = {};\n for (var param in params) {\n if (typeof params[param] === 'object' && params[param] !== null && !(params[param].nodeType || params[param] === window || params[param] === document || (typeof Dom7 !== 'undefined' && params[param] instanceof Dom7) || (typeof jQuery !== 'undefined' && params[param] instanceof jQuery))) {\n originalParams[param] = {};\n for (var deepParam in params[param]) {\n originalParams[param][deepParam] = params[param][deepParam];\n }\n }\n else {\n originalParams[param] = params[param];\n }\n }\n for (var def in defaults) {\n if (typeof params[def] === 'undefined') {\n params[def] = defaults[def];\n }\n else if (typeof params[def] === 'object') {\n for (var deepDef in defaults[def]) {\n if (typeof params[def][deepDef] === 'undefined') {\n params[def][deepDef] = defaults[def][deepDef];\n }\n }\n }\n }\n \n // Swiper\n var s = this;\n \n // Params\n s.params = params;\n s.originalParams = originalParams;\n \n // Classname\n s.classNames = [];\n /*=========================\n Dom Library and plugins\n ===========================*/\n if (typeof $ !== 'undefined' && typeof Dom7 !== 'undefined'){\n $ = Dom7;\n }\n if (typeof $ === 'undefined') {\n if (typeof Dom7 === 'undefined') {\n $ = window.Dom7 || window.Zepto || window.jQuery;\n }\n else {\n $ = Dom7;\n }\n if (!$) return;\n }\n // Export it to Swiper instance\n s.$ = $;\n \n /*=========================\n Breakpoints\n ===========================*/\n s.currentBreakpoint = undefined;\n s.getActiveBreakpoint = function () {\n //Get breakpoint for window width\n if (!s.params.breakpoints) return false;\n var breakpoint = false;\n var points = [], point;\n for ( point in s.params.breakpoints ) {\n if (s.params.breakpoints.hasOwnProperty(point)) {\n points.push(point);\n }\n }\n points.sort(function (a, b) {\n return parseInt(a, 10) > parseInt(b, 10);\n });\n for (var i = 0; i < points.length; i++) {\n point = points[i];\n if (point >= window.innerWidth && !breakpoint) {\n breakpoint = point;\n }\n }\n return breakpoint || 'max';\n };\n s.setBreakpoint = function () {\n //Set breakpoint for window width and update parameters\n var breakpoint = s.getActiveBreakpoint();\n if (breakpoint && s.currentBreakpoint !== breakpoint) {\n var breakPointsParams = breakpoint in s.params.breakpoints ? s.params.breakpoints[breakpoint] : s.originalParams;\n var needsReLoop = s.params.loop && (breakPointsParams.slidesPerView !== s.params.slidesPerView);\n for ( var param in breakPointsParams ) {\n s.params[param] = breakPointsParams[param];\n }\n s.currentBreakpoint = breakpoint;\n if(needsReLoop && s.destroyLoop) {\n s.reLoop(true);\n }\n }\n };\n // Set breakpoint on load\n if (s.params.breakpoints) {\n s.setBreakpoint();\n }\n \n /*=========================\n Preparation - Define Container, Wrapper and Pagination\n ===========================*/\n s.container = $(container);\n if (s.container.length === 0) return;\n if (s.container.length > 1) {\n var swipers = [];\n s.container.each(function () {\n var container = this;\n swipers.push(new Swiper(this, params));\n });\n return swipers;\n }\n \n // Save instance in container HTML Element and in data\n s.container[0].swiper = s;\n s.container.data('swiper', s);\n \n s.classNames.push(s.params.containerModifierClass + s.params.direction);\n \n if (s.params.freeMode) {\n s.classNames.push(s.params.containerModifierClass + 'free-mode');\n }\n if (!s.support.flexbox) {\n s.classNames.push(s.params.containerModifierClass + 'no-flexbox');\n s.params.slidesPerColumn = 1;\n }\n if (s.params.autoHeight) {\n s.classNames.push(s.params.containerModifierClass + 'autoheight');\n }\n // Enable slides progress when required\n if (s.params.parallax || s.params.watchSlidesVisibility) {\n s.params.watchSlidesProgress = true;\n }\n // Max resistance when touchReleaseOnEdges\n if (s.params.touchReleaseOnEdges) {\n s.params.resistanceRatio = 0;\n }\n // Coverflow / 3D\n if (['cube', 'coverflow', 'flip'].indexOf(s.params.effect) >= 0) {\n if (s.support.transforms3d) {\n s.params.watchSlidesProgress = true;\n s.classNames.push(s.params.containerModifierClass + '3d');\n }\n else {\n s.params.effect = 'slide';\n }\n }\n if (s.params.effect !== 'slide') {\n s.classNames.push(s.params.containerModifierClass + s.params.effect);\n }\n if (s.params.effect === 'cube') {\n s.params.resistanceRatio = 0;\n s.params.slidesPerView = 1;\n s.params.slidesPerColumn = 1;\n s.params.slidesPerGroup = 1;\n s.params.centeredSlides = false;\n s.params.spaceBetween = 0;\n s.params.virtualTranslate = true;\n s.params.setWrapperSize = false;\n }\n if (s.params.effect === 'fade' || s.params.effect === 'flip') {\n s.params.slidesPerView = 1;\n s.params.slidesPerColumn = 1;\n s.params.slidesPerGroup = 1;\n s.params.watchSlidesProgress = true;\n s.params.spaceBetween = 0;\n s.params.setWrapperSize = false;\n if (typeof initialVirtualTranslate === 'undefined') {\n s.params.virtualTranslate = true;\n }\n }\n \n // Grab Cursor\n if (s.params.grabCursor && s.support.touch) {\n s.params.grabCursor = false;\n }\n \n // Wrapper\n s.wrapper = s.container.children('.' + s.params.wrapperClass);\n \n // Pagination\n if (s.params.pagination) {\n s.paginationContainer = $(s.params.pagination);\n if (s.params.uniqueNavElements && typeof s.params.pagination === 'string' && s.paginationContainer.length > 1 && s.container.find(s.params.pagination).length === 1) {\n s.paginationContainer = s.container.find(s.params.pagination);\n }\n \n if (s.params.paginationType === 'bullets' && s.params.paginationClickable) {\n s.paginationContainer.addClass(s.params.paginationModifierClass + 'clickable');\n }\n else {\n s.params.paginationClickable = false;\n }\n s.paginationContainer.addClass(s.params.paginationModifierClass + s.params.paginationType);\n }\n // Next/Prev Buttons\n if (s.params.nextButton || s.params.prevButton) {\n if (s.params.nextButton) {\n s.nextButton = $(s.params.nextButton);\n if (s.params.uniqueNavElements && typeof s.params.nextButton === 'string' && s.nextButton.length > 1 && s.container.find(s.params.nextButton).length === 1) {\n s.nextButton = s.container.find(s.params.nextButton);\n }\n }\n if (s.params.prevButton) {\n s.prevButton = $(s.params.prevButton);\n if (s.params.uniqueNavElements && typeof s.params.prevButton === 'string' && s.prevButton.length > 1 && s.container.find(s.params.prevButton).length === 1) {\n s.prevButton = s.container.find(s.params.prevButton);\n }\n }\n }\n \n // Is Horizontal\n s.isHorizontal = function () {\n return s.params.direction === 'horizontal';\n };\n // s.isH = isH;\n \n // RTL\n s.rtl = s.isHorizontal() && (s.container[0].dir.toLowerCase() === 'rtl' || s.container.css('direction') === 'rtl');\n if (s.rtl) {\n s.classNames.push(s.params.containerModifierClass + 'rtl');\n }\n \n // Wrong RTL support\n if (s.rtl) {\n s.wrongRTL = s.wrapper.css('display') === '-webkit-box';\n }\n \n // Columns\n if (s.params.slidesPerColumn > 1) {\n s.classNames.push(s.params.containerModifierClass + 'multirow');\n }\n \n // Check for Android\n if (s.device.android) {\n s.classNames.push(s.params.containerModifierClass + 'android');\n }\n \n // Add classes\n s.container.addClass(s.classNames.join(' '));\n \n // Translate\n s.translate = 0;\n \n // Progress\n s.progress = 0;\n \n // Velocity\n s.velocity = 0;\n \n /*=========================\n Locks, unlocks\n ===========================*/\n s.lockSwipeToNext = function () {\n s.params.allowSwipeToNext = false;\n if (s.params.allowSwipeToPrev === false && s.params.grabCursor) {\n s.unsetGrabCursor();\n }\n };\n s.lockSwipeToPrev = function () {\n s.params.allowSwipeToPrev = false;\n if (s.params.allowSwipeToNext === false && s.params.grabCursor) {\n s.unsetGrabCursor();\n }\n };\n s.lockSwipes = function () {\n s.params.allowSwipeToNext = s.params.allowSwipeToPrev = false;\n if (s.params.grabCursor) s.unsetGrabCursor();\n };\n s.unlockSwipeToNext = function () {\n s.params.allowSwipeToNext = true;\n if (s.params.allowSwipeToPrev === true && s.params.grabCursor) {\n s.setGrabCursor();\n }\n };\n s.unlockSwipeToPrev = function () {\n s.params.allowSwipeToPrev = true;\n if (s.params.allowSwipeToNext === true && s.params.grabCursor) {\n s.setGrabCursor();\n }\n };\n s.unlockSwipes = function () {\n s.params.allowSwipeToNext = s.params.allowSwipeToPrev = true;\n if (s.params.grabCursor) s.setGrabCursor();\n };\n \n /*=========================\n Round helper\n ===========================*/\n function round(a) {\n return Math.floor(a);\n }\n /*=========================\n Set grab cursor\n ===========================*/\n s.setGrabCursor = function(moving) {\n s.container[0].style.cursor = 'move';\n s.container[0].style.cursor = moving ? '-webkit-grabbing' : '-webkit-grab';\n s.container[0].style.cursor = moving ? '-moz-grabbin' : '-moz-grab';\n s.container[0].style.cursor = moving ? 'grabbing': 'grab';\n };\n s.unsetGrabCursor = function () {\n s.container[0].style.cursor = '';\n };\n if (s.params.grabCursor) {\n s.setGrabCursor();\n }\n /*=========================\n Update on Images Ready\n ===========================*/\n s.imagesToLoad = [];\n s.imagesLoaded = 0;\n \n s.loadImage = function (imgElement, src, srcset, sizes, checkForComplete, callback) {\n var image;\n function onReady () {\n if (callback) callback();\n }\n if (!imgElement.complete || !checkForComplete) {\n if (src) {\n image = new window.Image();\n image.onload = onReady;\n image.onerror = onReady;\n if (sizes) {\n image.sizes = sizes;\n }\n if (srcset) {\n image.srcset = srcset;\n }\n if (src) {\n image.src = src;\n }\n } else {\n onReady();\n }\n \n } else {//image already loaded...\n onReady();\n }\n };\n s.preloadImages = function () {\n s.imagesToLoad = s.container.find('img');\n function _onReady() {\n if (typeof s === 'undefined' || s === null) return;\n if (s.imagesLoaded !== undefined) s.imagesLoaded++;\n if (s.imagesLoaded === s.imagesToLoad.length) {\n if (s.params.updateOnImagesReady) s.update();\n s.emit('onImagesReady', s);\n }\n }\n for (var i = 0; i < s.imagesToLoad.length; i++) {\n s.loadImage(s.imagesToLoad[i], (s.imagesToLoad[i].currentSrc || s.imagesToLoad[i].getAttribute('src')), (s.imagesToLoad[i].srcset || s.imagesToLoad[i].getAttribute('srcset')), s.imagesToLoad[i].sizes || s.imagesToLoad[i].getAttribute('sizes'), true, _onReady);\n }\n };\n \n /*=========================\n Autoplay\n ===========================*/\n s.autoplayTimeoutId = undefined;\n s.autoplaying = false;\n s.autoplayPaused = false;\n function autoplay() {\n var autoplayDelay = s.params.autoplay;\n var activeSlide = s.slides.eq(s.activeIndex);\n if (activeSlide.attr('data-swiper-autoplay')) {\n autoplayDelay = activeSlide.attr('data-swiper-autoplay') || s.params.autoplay;\n }\n s.autoplayTimeoutId = setTimeout(function () {\n if (s.params.loop) {\n s.fixLoop();\n s._slideNext();\n s.emit('onAutoplay', s);\n }\n else {\n if (!s.isEnd) {\n s._slideNext();\n s.emit('onAutoplay', s);\n }\n else {\n if (!params.autoplayStopOnLast) {\n s._slideTo(0);\n s.emit('onAutoplay', s);\n }\n else {\n s.stopAutoplay();\n }\n }\n }\n }, autoplayDelay);\n }\n s.startAutoplay = function () {\n if (typeof s.autoplayTimeoutId !== 'undefined') return false;\n if (!s.params.autoplay) return false;\n if (s.autoplaying) return false;\n s.autoplaying = true;\n s.emit('onAutoplayStart', s);\n autoplay();\n };\n s.stopAutoplay = function (internal) {\n if (!s.autoplayTimeoutId) return;\n if (s.autoplayTimeoutId) clearTimeout(s.autoplayTimeoutId);\n s.autoplaying = false;\n s.autoplayTimeoutId = undefined;\n s.emit('onAutoplayStop', s);\n };\n s.pauseAutoplay = function (speed) {\n if (s.autoplayPaused) return;\n if (s.autoplayTimeoutId) clearTimeout(s.autoplayTimeoutId);\n s.autoplayPaused = true;\n if (speed === 0) {\n s.autoplayPaused = false;\n autoplay();\n }\n else {\n s.wrapper.transitionEnd(function () {\n if (!s) return;\n s.autoplayPaused = false;\n if (!s.autoplaying) {\n s.stopAutoplay();\n }\n else {\n autoplay();\n }\n });\n }\n };\n /*=========================\n Min/Max Translate\n ===========================*/\n s.minTranslate = function () {\n return (-s.snapGrid[0]);\n };\n s.maxTranslate = function () {\n return (-s.snapGrid[s.snapGrid.length - 1]);\n };\n /*=========================\n Slider/slides sizes\n ===========================*/\n s.updateAutoHeight = function () {\n var activeSlides = [];\n var newHeight = 0;\n \n // Find slides currently in view\n if(s.params.slidesPerView !== 'auto' && s.params.slidesPerView > 1) {\n for (i = 0; i < Math.ceil(s.params.slidesPerView); i++) {\n var index = s.activeIndex + i;\n if(index > s.slides.length) break;\n activeSlides.push(s.slides.eq(index)[0]);\n }\n } else {\n activeSlides.push(s.slides.eq(s.activeIndex)[0]);\n }\n \n // Find new height from heighest slide in view\n for (i = 0; i < activeSlides.length; i++) {\n if (typeof activeSlides[i] !== 'undefined') {\n var height = activeSlides[i].offsetHeight;\n newHeight = height > newHeight ? height : newHeight;\n }\n }\n \n // Update Height\n if (newHeight) s.wrapper.css('height', newHeight + 'px');\n };\n s.updateContainerSize = function () {\n var width, height;\n if (typeof s.params.width !== 'undefined') {\n width = s.params.width;\n }\n else {\n width = s.container[0].clientWidth;\n }\n if (typeof s.params.height !== 'undefined') {\n height = s.params.height;\n }\n else {\n height = s.container[0].clientHeight;\n }\n if (width === 0 && s.isHorizontal() || height === 0 && !s.isHorizontal()) {\n return;\n }\n \n //Subtract paddings\n width = width - parseInt(s.container.css('padding-left'), 10) - parseInt(s.container.css('padding-right'), 10);\n height = height - parseInt(s.container.css('padding-top'), 10) - parseInt(s.container.css('padding-bottom'), 10);\n \n // Store values\n s.width = width;\n s.height = height;\n s.size = s.isHorizontal() ? s.width : s.height;\n };\n \n s.updateSlidesSize = function () {\n s.slides = s.wrapper.children('.' + s.params.slideClass);\n s.snapGrid = [];\n s.slidesGrid = [];\n s.slidesSizesGrid = [];\n \n var spaceBetween = s.params.spaceBetween,\n slidePosition = -s.params.slidesOffsetBefore,\n i,\n prevSlideSize = 0,\n index = 0;\n if (typeof s.size === 'undefined') return;\n if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {\n spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * s.size;\n }\n \n s.virtualSize = -spaceBetween;\n // reset margins\n if (s.rtl) s.slides.css({marginLeft: '', marginTop: ''});\n else s.slides.css({marginRight: '', marginBottom: ''});\n \n var slidesNumberEvenToRows;\n if (s.params.slidesPerColumn > 1) {\n if (Math.floor(s.slides.length / s.params.slidesPerColumn) === s.slides.length / s.params.slidesPerColumn) {\n slidesNumberEvenToRows = s.slides.length;\n }\n else {\n slidesNumberEvenToRows = Math.ceil(s.slides.length / s.params.slidesPerColumn) * s.params.slidesPerColumn;\n }\n if (s.params.slidesPerView !== 'auto' && s.params.slidesPerColumnFill === 'row') {\n slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, s.params.slidesPerView * s.params.slidesPerColumn);\n }\n }\n \n // Calc slides\n var slideSize;\n var slidesPerColumn = s.params.slidesPerColumn;\n var slidesPerRow = slidesNumberEvenToRows / slidesPerColumn;\n var numFullColumns = slidesPerRow - (s.params.slidesPerColumn * slidesPerRow - s.slides.length);\n for (i = 0; i < s.slides.length; i++) {\n slideSize = 0;\n var slide = s.slides.eq(i);\n if (s.params.slidesPerColumn > 1) {\n // Set slides order\n var newSlideOrderIndex;\n var column, row;\n if (s.params.slidesPerColumnFill === 'column') {\n column = Math.floor(i / slidesPerColumn);\n row = i - column * slidesPerColumn;\n if (column > numFullColumns || (column === numFullColumns && row === slidesPerColumn-1)) {\n if (++row >= slidesPerColumn) {\n row = 0;\n column++;\n }\n }\n newSlideOrderIndex = column + row * slidesNumberEvenToRows / slidesPerColumn;\n slide\n .css({\n '-webkit-box-ordinal-group': newSlideOrderIndex,\n '-moz-box-ordinal-group': newSlideOrderIndex,\n '-ms-flex-order': newSlideOrderIndex,\n '-webkit-order': newSlideOrderIndex,\n 'order': newSlideOrderIndex\n });\n }\n else {\n row = Math.floor(i / slidesPerRow);\n column = i - row * slidesPerRow;\n }\n slide\n .css(\n 'margin-' + (s.isHorizontal() ? 'top' : 'left'),\n (row !== 0 && s.params.spaceBetween) && (s.params.spaceBetween + 'px')\n )\n .attr('data-swiper-column', column)\n .attr('data-swiper-row', row);\n \n }\n if (slide.css('display') === 'none') continue;\n if (s.params.slidesPerView === 'auto') {\n slideSize = s.isHorizontal() ? slide.outerWidth(true) : slide.outerHeight(true);\n if (s.params.roundLengths) slideSize = round(slideSize);\n }\n else {\n slideSize = (s.size - (s.params.slidesPerView - 1) * spaceBetween) / s.params.slidesPerView;\n if (s.params.roundLengths) slideSize = round(slideSize);\n \n if (s.isHorizontal()) {\n s.slides[i].style.width = slideSize + 'px';\n }\n else {\n s.slides[i].style.height = slideSize + 'px';\n }\n }\n s.slides[i].swiperSlideSize = slideSize;\n s.slidesSizesGrid.push(slideSize);\n \n \n if (s.params.centeredSlides) {\n slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;\n if (i === 0) slidePosition = slidePosition - s.size / 2 - spaceBetween;\n if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;\n if ((index) % s.params.slidesPerGroup === 0) s.snapGrid.push(slidePosition);\n s.slidesGrid.push(slidePosition);\n }\n else {\n if ((index) % s.params.slidesPerGroup === 0) s.snapGrid.push(slidePosition);\n s.slidesGrid.push(slidePosition);\n slidePosition = slidePosition + slideSize + spaceBetween;\n }\n \n s.virtualSize += slideSize + spaceBetween;\n \n prevSlideSize = slideSize;\n \n index ++;\n }\n s.virtualSize = Math.max(s.virtualSize, s.size) + s.params.slidesOffsetAfter;\n var newSlidesGrid;\n \n if (\n s.rtl && s.wrongRTL && (s.params.effect === 'slide' || s.params.effect === 'coverflow')) {\n s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'});\n }\n if (!s.support.flexbox || s.params.setWrapperSize) {\n if (s.isHorizontal()) s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'});\n else s.wrapper.css({height: s.virtualSize + s.params.spaceBetween + 'px'});\n }\n \n if (s.params.slidesPerColumn > 1) {\n s.virtualSize = (slideSize + s.params.spaceBetween) * slidesNumberEvenToRows;\n s.virtualSize = Math.ceil(s.virtualSize / s.params.slidesPerColumn) - s.params.spaceBetween;\n if (s.isHorizontal()) s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'});\n else s.wrapper.css({height: s.virtualSize + s.params.spaceBetween + 'px'});\n if (s.params.centeredSlides) {\n newSlidesGrid = [];\n for (i = 0; i < s.snapGrid.length; i++) {\n if (s.snapGrid[i] < s.virtualSize + s.snapGrid[0]) newSlidesGrid.push(s.snapGrid[i]);\n }\n s.snapGrid = newSlidesGrid;\n }\n }\n \n // Remove last grid elements depending on width\n if (!s.params.centeredSlides) {\n newSlidesGrid = [];\n for (i = 0; i < s.snapGrid.length; i++) {\n if (s.snapGrid[i] <= s.virtualSize - s.size) {\n newSlidesGrid.push(s.snapGrid[i]);\n }\n }\n s.snapGrid = newSlidesGrid;\n if (Math.floor(s.virtualSize - s.size) - Math.floor(s.snapGrid[s.snapGrid.length - 1]) > 1) {\n s.snapGrid.push(s.virtualSize - s.size);\n }\n }\n if (s.snapGrid.length === 0) s.snapGrid = [0];\n \n if (s.params.spaceBetween !== 0) {\n if (s.isHorizontal()) {\n if (s.rtl) s.slides.css({marginLeft: spaceBetween + 'px'});\n else s.slides.css({marginRight: spaceBetween + 'px'});\n }\n else s.slides.css({marginBottom: spaceBetween + 'px'});\n }\n if (s.params.watchSlidesProgress) {\n s.updateSlidesOffset();\n }\n };\n s.updateSlidesOffset = function () {\n for (var i = 0; i < s.slides.length; i++) {\n s.slides[i].swiperSlideOffset = s.isHorizontal() ? s.slides[i].offsetLeft : s.slides[i].offsetTop;\n }\n };\n \n /*=========================\n Slider/slides progress\n ===========================*/\n s.updateSlidesProgress = function (translate) {\n if (typeof translate === 'undefined') {\n translate = s.translate || 0;\n }\n if (s.slides.length === 0) return;\n if (typeof s.slides[0].swiperSlideOffset === 'undefined') s.updateSlidesOffset();\n \n var offsetCenter = -translate;\n if (s.rtl) offsetCenter = translate;\n \n // Visible Slides\n s.slides.removeClass(s.params.slideVisibleClass);\n for (var i = 0; i < s.slides.length; i++) {\n var slide = s.slides[i];\n var slideProgress = (offsetCenter + (s.params.centeredSlides ? s.minTranslate() : 0) - slide.swiperSlideOffset) / (slide.swiperSlideSize + s.params.spaceBetween);\n if (s.params.watchSlidesVisibility) {\n var slideBefore = -(offsetCenter - slide.swiperSlideOffset);\n var slideAfter = slideBefore + s.slidesSizesGrid[i];\n var isVisible =\n (slideBefore >= 0 && slideBefore < s.size) ||\n (slideAfter > 0 && slideAfter <= s.size) ||\n (slideBefore <= 0 && slideAfter >= s.size);\n if (isVisible) {\n s.slides.eq(i).addClass(s.params.slideVisibleClass);\n }\n }\n slide.progress = s.rtl ? -slideProgress : slideProgress;\n }\n };\n s.updateProgress = function (translate) {\n if (typeof translate === 'undefined') {\n translate = s.translate || 0;\n }\n var translatesDiff = s.maxTranslate() - s.minTranslate();\n var wasBeginning = s.isBeginning;\n var wasEnd = s.isEnd;\n if (translatesDiff === 0) {\n s.progress = 0;\n s.isBeginning = s.isEnd = true;\n }\n else {\n s.progress = (translate - s.minTranslate()) / (translatesDiff);\n s.isBeginning = s.progress <= 0;\n s.isEnd = s.progress >= 1;\n }\n if (s.isBeginning && !wasBeginning) s.emit('onReachBeginning', s);\n if (s.isEnd && !wasEnd) s.emit('onReachEnd', s);\n \n if (s.params.watchSlidesProgress) s.updateSlidesProgress(translate);\n s.emit('onProgress', s, s.progress);\n };\n s.updateActiveIndex = function () {\n var translate = s.rtl ? s.translate : -s.translate;\n var newActiveIndex, i, snapIndex;\n for (i = 0; i < s.slidesGrid.length; i ++) {\n if (typeof s.slidesGrid[i + 1] !== 'undefined') {\n if (translate >= s.slidesGrid[i] && translate < s.slidesGrid[i + 1] - (s.slidesGrid[i + 1] - s.slidesGrid[i]) / 2) {\n newActiveIndex = i;\n }\n else if (translate >= s.slidesGrid[i] && translate < s.slidesGrid[i + 1]) {\n newActiveIndex = i + 1;\n }\n }\n else {\n if (translate >= s.slidesGrid[i]) {\n newActiveIndex = i;\n }\n }\n }\n // Normalize slideIndex\n if(s.params.normalizeSlideIndex){\n if (newActiveIndex < 0 || typeof newActiveIndex === 'undefined') newActiveIndex = 0;\n }\n // for (i = 0; i < s.slidesGrid.length; i++) {\n // if (- translate >= s.slidesGrid[i]) {\n // newActiveIndex = i;\n // }\n // }\n snapIndex = Math.floor(newActiveIndex / s.params.slidesPerGroup);\n if (snapIndex >= s.snapGrid.length) snapIndex = s.snapGrid.length - 1;\n \n if (newActiveIndex === s.activeIndex) {\n return;\n }\n s.snapIndex = snapIndex;\n s.previousIndex = s.activeIndex;\n s.activeIndex = newActiveIndex;\n s.updateClasses();\n s.updateRealIndex();\n };\n s.updateRealIndex = function(){\n s.realIndex = s.slides.eq(s.activeIndex).attr('data-swiper-slide-index') || s.activeIndex;\n };\n \n /*=========================\n Classes\n ===========================*/\n s.updateClasses = function () {\n s.slides.removeClass(s.params.slideActiveClass + ' ' + s.params.slideNextClass + ' ' + s.params.slidePrevClass + ' ' + s.params.slideDuplicateActiveClass + ' ' + s.params.slideDuplicateNextClass + ' ' + s.params.slideDuplicatePrevClass);\n var activeSlide = s.slides.eq(s.activeIndex);\n // Active classes\n activeSlide.addClass(s.params.slideActiveClass);\n if (params.loop) {\n // Duplicate to all looped slides\n if (activeSlide.hasClass(s.params.slideDuplicateClass)) {\n s.wrapper.children('.' + s.params.slideClass + ':not(.' + s.params.slideDuplicateClass + ')[data-swiper-slide-index=\"' + s.realIndex + '\"]').addClass(s.params.slideDuplicateActiveClass);\n }\n else {\n s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass + '[data-swiper-slide-index=\"' + s.realIndex + '\"]').addClass(s.params.slideDuplicateActiveClass);\n }\n }\n // Next Slide\n var nextSlide = activeSlide.next('.' + s.params.slideClass).addClass(s.params.slideNextClass);\n if (s.params.loop && nextSlide.length === 0) {\n nextSlide = s.slides.eq(0);\n nextSlide.addClass(s.params.slideNextClass);\n }\n // Prev Slide\n var prevSlide = activeSlide.prev('.' + s.params.slideClass).addClass(s.params.slidePrevClass);\n if (s.params.loop && prevSlide.length === 0) {\n prevSlide = s.slides.eq(-1);\n prevSlide.addClass(s.params.slidePrevClass);\n }\n if (params.loop) {\n // Duplicate to all looped slides\n if (nextSlide.hasClass(s.params.slideDuplicateClass)) {\n s.wrapper.children('.' + s.params.slideClass + ':not(.' + s.params.slideDuplicateClass + ')[data-swiper-slide-index=\"' + nextSlide.attr('data-swiper-slide-index') + '\"]').addClass(s.params.slideDuplicateNextClass);\n }\n else {\n s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass + '[data-swiper-slide-index=\"' + nextSlide.attr('data-swiper-slide-index') + '\"]').addClass(s.params.slideDuplicateNextClass);\n }\n if (prevSlide.hasClass(s.params.slideDuplicateClass)) {\n s.wrapper.children('.' + s.params.slideClass + ':not(.' + s.params.slideDuplicateClass + ')[data-swiper-slide-index=\"' + prevSlide.attr('data-swiper-slide-index') + '\"]').addClass(s.params.slideDuplicatePrevClass);\n }\n else {\n s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass + '[data-swiper-slide-index=\"' + prevSlide.attr('data-swiper-slide-index') + '\"]').addClass(s.params.slideDuplicatePrevClass);\n }\n }\n \n // Pagination\n if (s.paginationContainer && s.paginationContainer.length > 0) {\n // Current/Total\n var current,\n total = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length;\n if (s.params.loop) {\n current = Math.ceil((s.activeIndex - s.loopedSlides)/s.params.slidesPerGroup);\n if (current > s.slides.length - 1 - s.loopedSlides * 2) {\n current = current - (s.slides.length - s.loopedSlides * 2);\n }\n if (current > total - 1) current = current - total;\n if (current < 0 && s.params.paginationType !== 'bullets') current = total + current;\n }\n else {\n if (typeof s.snapIndex !== 'undefined') {\n current = s.snapIndex;\n }\n else {\n current = s.activeIndex || 0;\n }\n }\n // Types\n if (s.params.paginationType === 'bullets' && s.bullets && s.bullets.length > 0) {\n s.bullets.removeClass(s.params.bulletActiveClass);\n if (s.paginationContainer.length > 1) {\n s.bullets.each(function () {\n if ($(this).index() === current) $(this).addClass(s.params.bulletActiveClass);\n });\n }\n else {\n s.bullets.eq(current).addClass(s.params.bulletActiveClass);\n }\n }\n if (s.params.paginationType === 'fraction') {\n s.paginationContainer.find('.' + s.params.paginationCurrentClass).text(current + 1);\n s.paginationContainer.find('.' + s.params.paginationTotalClass).text(total);\n }\n if (s.params.paginationType === 'progress') {\n var scale = (current + 1) / total,\n scaleX = scale,\n scaleY = 1;\n if (!s.isHorizontal()) {\n scaleY = scale;\n scaleX = 1;\n }\n s.paginationContainer.find('.' + s.params.paginationProgressbarClass).transform('translate3d(0,0,0) scaleX(' + scaleX + ') scaleY(' + scaleY + ')').transition(s.params.speed);\n }\n if (s.params.paginationType === 'custom' && s.params.paginationCustomRender) {\n s.paginationContainer.html(s.params.paginationCustomRender(s, current + 1, total));\n s.emit('onPaginationRendered', s, s.paginationContainer[0]);\n }\n }\n \n // Next/active buttons\n if (!s.params.loop) {\n if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {\n if (s.isBeginning) {\n s.prevButton.addClass(s.params.buttonDisabledClass);\n if (s.params.a11y && s.a11y) s.a11y.disable(s.prevButton);\n }\n else {\n s.prevButton.removeClass(s.params.buttonDisabledClass);\n if (s.params.a11y && s.a11y) s.a11y.enable(s.prevButton);\n }\n }\n if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {\n if (s.isEnd) {\n s.nextButton.addClass(s.params.buttonDisabledClass);\n if (s.params.a11y && s.a11y) s.a11y.disable(s.nextButton);\n }\n else {\n s.nextButton.removeClass(s.params.buttonDisabledClass);\n if (s.params.a11y && s.a11y) s.a11y.enable(s.nextButton);\n }\n }\n }\n };\n \n /*=========================\n Pagination\n ===========================*/\n s.updatePagination = function () {\n if (!s.params.pagination) return;\n if (s.paginationContainer && s.paginationContainer.length > 0) {\n var paginationHTML = '';\n if (s.params.paginationType === 'bullets') {\n var numberOfBullets = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length;\n for (var i = 0; i < numberOfBullets; i++) {\n if (s.params.paginationBulletRender) {\n paginationHTML += s.params.paginationBulletRender(s, i, s.params.bulletClass);\n }\n else {\n paginationHTML += '<' + s.params.paginationElement+' class=\"' + s.params.bulletClass + '\"></' + s.params.paginationElement + '>';\n }\n }\n s.paginationContainer.html(paginationHTML);\n s.bullets = s.paginationContainer.find('.' + s.params.bulletClass);\n if (s.params.paginationClickable && s.params.a11y && s.a11y) {\n s.a11y.initPagination();\n }\n }\n if (s.params.paginationType === 'fraction') {\n if (s.params.paginationFractionRender) {\n paginationHTML = s.params.paginationFractionRender(s, s.params.paginationCurrentClass, s.params.paginationTotalClass);\n }\n else {\n paginationHTML =\n '<span class=\"' + s.params.paginationCurrentClass + '\"></span>' +\n ' / ' +\n '<span class=\"' + s.params.paginationTotalClass+'\"></span>';\n }\n s.paginationContainer.html(paginationHTML);\n }\n if (s.params.paginationType === 'progress') {\n if (s.params.paginationProgressRender) {\n paginationHTML = s.params.paginationProgressRender(s, s.params.paginationProgressbarClass);\n }\n else {\n paginationHTML = '<span class=\"' + s.params.paginationProgressbarClass + '\"></span>';\n }\n s.paginationContainer.html(paginationHTML);\n }\n if (s.params.paginationType !== 'custom') {\n s.emit('onPaginationRendered', s, s.paginationContainer[0]);\n }\n }\n };\n /*=========================\n Common update method\n ===========================*/\n s.update = function (updateTranslate) {\n s.updateContainerSize();\n s.updateSlidesSize();\n s.updateProgress();\n s.updatePagination();\n s.updateClasses();\n if (s.params.scrollbar && s.scrollbar) {\n s.scrollbar.set();\n }\n function forceSetTranslate() {\n var translate = s.rtl ? -s.translate : s.translate;\n newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate());\n s.setWrapperTranslate(newTranslate);\n s.updateActiveIndex();\n s.updateClasses();\n }\n if (updateTranslate) {\n var translated, newTranslate;\n if (s.controller && s.controller.spline) {\n s.controller.spline = undefined;\n }\n if (s.params.freeMode) {\n forceSetTranslate();\n if (s.params.autoHeight) {\n s.updateAutoHeight();\n }\n }\n else {\n if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) {\n translated = s.slideTo(s.slides.length - 1, 0, false, true);\n }\n else {\n translated = s.slideTo(s.activeIndex, 0, false, true);\n }\n if (!translated) {\n forceSetTranslate();\n }\n }\n }\n else if (s.params.autoHeight) {\n s.updateAutoHeight();\n }\n };\n \n /*=========================\n Resize Handler\n ===========================*/\n s.onResize = function (forceUpdatePagination) {\n //Breakpoints\n if (s.params.breakpoints) {\n s.setBreakpoint();\n }\n \n // Disable locks on resize\n var allowSwipeToPrev = s.params.allowSwipeToPrev;\n var allowSwipeToNext = s.params.allowSwipeToNext;\n s.params.allowSwipeToPrev = s.params.allowSwipeToNext = true;\n \n s.updateContainerSize();\n s.updateSlidesSize();\n if (s.params.slidesPerView === 'auto' || s.params.freeMode || forceUpdatePagination) s.updatePagination();\n if (s.params.scrollbar && s.scrollbar) {\n s.scrollbar.set();\n }\n if (s.controller && s.controller.spline) {\n s.controller.spline = undefined;\n }\n var slideChangedBySlideTo = false;\n if (s.params.freeMode) {\n var newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate());\n s.setWrapperTranslate(newTranslate);\n s.updateActiveIndex();\n s.updateClasses();\n \n if (s.params.autoHeight) {\n s.updateAutoHeight();\n }\n }\n else {\n s.updateClasses();\n if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) {\n slideChangedBySlideTo = s.slideTo(s.slides.length - 1, 0, false, true);\n }\n else {\n slideChangedBySlideTo = s.slideTo(s.activeIndex, 0, false, true);\n }\n }\n if (s.params.lazyLoading && !slideChangedBySlideTo && s.lazy) {\n s.lazy.load();\n }\n // Return locks after resize\n s.params.allowSwipeToPrev = allowSwipeToPrev;\n s.params.allowSwipeToNext = allowSwipeToNext;\n };\n \n /*=========================\n Events\n ===========================*/\n \n //Define Touch Events\n s.touchEventsDesktop = {start: 'mousedown', move: 'mousemove', end: 'mouseup'};\n if (window.navigator.pointerEnabled) s.touchEventsDesktop = {start: 'pointerdown', move: 'pointermove', end: 'pointerup'};\n else if (window.navigator.msPointerEnabled) s.touchEventsDesktop = {start: 'MSPointerDown', move: 'MSPointerMove', end: 'MSPointerUp'};\n s.touchEvents = {\n start : s.support.touch || !s.params.simulateTouch ? 'touchstart' : s.touchEventsDesktop.start,\n move : s.support.touch || !s.params.simulateTouch ? 'touchmove' : s.touchEventsDesktop.move,\n end : s.support.touch || !s.params.simulateTouch ? 'touchend' : s.touchEventsDesktop.end\n };\n \n \n // WP8 Touch Events Fix\n if (window.navigator.pointerEnabled || window.navigator.msPointerEnabled) {\n (s.params.touchEventsTarget === 'container' ? s.container : s.wrapper).addClass('swiper-wp8-' + s.params.direction);\n }\n \n // Attach/detach events\n s.initEvents = function (detach) {\n var actionDom = detach ? 'off' : 'on';\n var action = detach ? 'removeEventListener' : 'addEventListener';\n var touchEventsTarget = s.params.touchEventsTarget === 'container' ? s.container[0] : s.wrapper[0];\n var target = s.support.touch ? touchEventsTarget : document;\n \n var moveCapture = s.params.nested ? true : false;\n \n //Touch Events\n if (s.browser.ie) {\n touchEventsTarget[action](s.touchEvents.start, s.onTouchStart, false);\n target[action](s.touchEvents.move, s.onTouchMove, moveCapture);\n target[action](s.touchEvents.end, s.onTouchEnd, false);\n }\n else {\n if (s.support.touch) {\n var passiveListener = s.touchEvents.start === 'touchstart' && s.support.passiveListener && s.params.passiveListeners ? {passive: true, capture: false} : false;\n touchEventsTarget[action](s.touchEvents.start, s.onTouchStart, passiveListener);\n touchEventsTarget[action](s.touchEvents.move, s.onTouchMove, moveCapture);\n touchEventsTarget[action](s.touchEvents.end, s.onTouchEnd, passiveListener);\n }\n if ((params.simulateTouch && !s.device.ios && !s.device.android) || (params.simulateTouch && !s.support.touch && s.device.ios)) {\n touchEventsTarget[action]('mousedown', s.onTouchStart, false);\n document[action]('mousemove', s.onTouchMove, moveCapture);\n document[action]('mouseup', s.onTouchEnd, false);\n }\n }\n window[action]('resize', s.onResize);\n \n // Next, Prev, Index\n if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {\n s.nextButton[actionDom]('click', s.onClickNext);\n if (s.params.a11y && s.a11y) s.nextButton[actionDom]('keydown', s.a11y.onEnterKey);\n }\n if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {\n s.prevButton[actionDom]('click', s.onClickPrev);\n if (s.params.a11y && s.a11y) s.prevButton[actionDom]('keydown', s.a11y.onEnterKey);\n }\n if (s.params.pagination && s.params.paginationClickable) {\n s.paginationContainer[actionDom]('click', '.' + s.params.bulletClass, s.onClickIndex);\n if (s.params.a11y && s.a11y) s.paginationContainer[actionDom]('keydown', '.' + s.params.bulletClass, s.a11y.onEnterKey);\n }\n \n // Prevent Links Clicks\n if (s.params.preventClicks || s.params.preventClicksPropagation) touchEventsTarget[action]('click', s.preventClicks, true);\n };\n s.attachEvents = function () {\n s.initEvents();\n };\n s.detachEvents = function () {\n s.initEvents(true);\n };\n \n /*=========================\n Handle Clicks\n ===========================*/\n // Prevent Clicks\n s.allowClick = true;\n s.preventClicks = function (e) {\n if (!s.allowClick) {\n if (s.params.preventClicks) e.preventDefault();\n if (s.params.preventClicksPropagation && s.animating) {\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n }\n };\n // Clicks\n s.onClickNext = function (e) {\n e.preventDefault();\n if (s.isEnd && !s.params.loop) return;\n s.slideNext();\n };\n s.onClickPrev = function (e) {\n e.preventDefault();\n if (s.isBeginning && !s.params.loop) return;\n s.slidePrev();\n };\n s.onClickIndex = function (e) {\n e.preventDefault();\n var index = $(this).index() * s.params.slidesPerGroup;\n if (s.params.loop) index = index + s.loopedSlides;\n s.slideTo(index);\n };\n \n /*=========================\n Handle Touches\n ===========================*/\n function findElementInEvent(e, selector) {\n var el = $(e.target);\n if (!el.is(selector)) {\n if (typeof selector === 'string') {\n el = el.parents(selector);\n }\n else if (selector.nodeType) {\n var found;\n el.parents().each(function (index, _el) {\n if (_el === selector) found = selector;\n });\n if (!found) return undefined;\n else return selector;\n }\n }\n if (el.length === 0) {\n return undefined;\n }\n return el[0];\n }\n s.updateClickedSlide = function (e) {\n var slide = findElementInEvent(e, '.' + s.params.slideClass);\n var slideFound = false;\n if (slide) {\n for (var i = 0; i < s.slides.length; i++) {\n if (s.slides[i] === slide) slideFound = true;\n }\n }\n \n if (slide && slideFound) {\n s.clickedSlide = slide;\n s.clickedIndex = $(slide).index();\n }\n else {\n s.clickedSlide = undefined;\n s.clickedIndex = undefined;\n return;\n }\n if (s.params.slideToClickedSlide && s.clickedIndex !== undefined && s.clickedIndex !== s.activeIndex) {\n var slideToIndex = s.clickedIndex,\n realIndex,\n duplicatedSlides;\n if (s.params.loop) {\n if (s.animating) return;\n realIndex = $(s.clickedSlide).attr('data-swiper-slide-index');\n if (s.params.centeredSlides) {\n if ((slideToIndex < s.loopedSlides - s.params.slidesPerView/2) || (slideToIndex > s.slides.length - s.loopedSlides + s.params.slidesPerView/2)) {\n s.fixLoop();\n slideToIndex = s.wrapper.children('.' + s.params.slideClass + '[data-swiper-slide-index=\"' + realIndex + '\"]:not(.' + s.params.slideDuplicateClass + ')').eq(0).index();\n setTimeout(function () {\n s.slideTo(slideToIndex);\n }, 0);\n }\n else {\n s.slideTo(slideToIndex);\n }\n }\n else {\n if (slideToIndex > s.slides.length - s.params.slidesPerView) {\n s.fixLoop();\n slideToIndex = s.wrapper.children('.' + s.params.slideClass + '[data-swiper-slide-index=\"' + realIndex + '\"]:not(.' + s.params.slideDuplicateClass + ')').eq(0).index();\n setTimeout(function () {\n s.slideTo(slideToIndex);\n }, 0);\n }\n else {\n s.slideTo(slideToIndex);\n }\n }\n }\n else {\n s.slideTo(slideToIndex);\n }\n }\n };\n \n var isTouched,\n isMoved,\n allowTouchCallbacks,\n touchStartTime,\n isScrolling,\n currentTranslate,\n startTranslate,\n allowThresholdMove,\n // Form elements to match\n formElements = 'input, select, textarea, button, video',\n // Last click time\n lastClickTime = Date.now(), clickTimeout,\n //Velocities\n velocities = [],\n allowMomentumBounce;\n \n // Animating Flag\n s.animating = false;\n \n // Touches information\n s.touches = {\n startX: 0,\n startY: 0,\n currentX: 0,\n currentY: 0,\n diff: 0\n };\n \n // Touch handlers\n var isTouchEvent, startMoving;\n s.onTouchStart = function (e) {\n if (e.originalEvent) e = e.originalEvent;\n isTouchEvent = e.type === 'touchstart';\n if (!isTouchEvent && 'which' in e && e.which === 3) return;\n if (s.params.noSwiping && findElementInEvent(e, '.' + s.params.noSwipingClass)) {\n s.allowClick = true;\n return;\n }\n if (s.params.swipeHandler) {\n if (!findElementInEvent(e, s.params.swipeHandler)) return;\n }\n \n var startX = s.touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;\n var startY = s.touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;\n \n // Do NOT start if iOS edge swipe is detected. Otherwise iOS app (UIWebView) cannot swipe-to-go-back anymore\n if(s.device.ios && s.params.iOSEdgeSwipeDetection && startX <= s.params.iOSEdgeSwipeThreshold) {\n return;\n }\n \n isTouched = true;\n isMoved = false;\n allowTouchCallbacks = true;\n isScrolling = undefined;\n startMoving = undefined;\n s.touches.startX = startX;\n s.touches.startY = startY;\n touchStartTime = Date.now();\n s.allowClick = true;\n s.updateContainerSize();\n s.swipeDirection = undefined;\n if (s.params.threshold > 0) allowThresholdMove = false;\n if (e.type !== 'touchstart') {\n var preventDefault = true;\n if ($(e.target).is(formElements)) preventDefault = false;\n if (document.activeElement && $(document.activeElement).is(formElements)) {\n document.activeElement.blur();\n }\n if (preventDefault) {\n e.preventDefault();\n }\n }\n s.emit('onTouchStart', s, e);\n };\n \n s.onTouchMove = function (e) {\n if (e.originalEvent) e = e.originalEvent;\n if (isTouchEvent && e.type === 'mousemove') return;\n if (e.preventedByNestedSwiper) {\n s.touches.startX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;\n s.touches.startY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;\n return;\n }\n if (s.params.onlyExternal) {\n // isMoved = true;\n s.allowClick = false;\n if (isTouched) {\n s.touches.startX = s.touches.currentX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;\n s.touches.startY = s.touches.currentY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;\n touchStartTime = Date.now();\n }\n return;\n }\n if (isTouchEvent && s.params.touchReleaseOnEdges && !s.params.loop) {\n if (!s.isHorizontal()) {\n // Vertical\n if (\n (s.touches.currentY < s.touches.startY && s.translate <= s.maxTranslate()) ||\n (s.touches.currentY > s.touches.startY && s.translate >= s.minTranslate())\n ) {\n return;\n }\n }\n else {\n if (\n (s.touches.currentX < s.touches.startX && s.translate <= s.maxTranslate()) ||\n (s.touches.currentX > s.touches.startX && s.translate >= s.minTranslate())\n ) {\n return;\n }\n }\n }\n if (isTouchEvent && document.activeElement) {\n if (e.target === document.activeElement && $(e.target).is(formElements)) {\n isMoved = true;\n s.allowClick = false;\n return;\n }\n }\n if (allowTouchCallbacks) {\n s.emit('onTouchMove', s, e);\n }\n if (e.targetTouches && e.targetTouches.length > 1) return;\n \n s.touches.currentX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;\n s.touches.currentY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;\n \n if (typeof isScrolling === 'undefined') {\n var touchAngle;\n if (s.isHorizontal() && s.touches.currentY === s.touches.startY || !s.isHorizontal() && s.touches.currentX !== s.touches.startX) {\n isScrolling = false;\n }\n else {\n touchAngle = Math.atan2(Math.abs(s.touches.currentY - s.touches.startY), Math.abs(s.touches.currentX - s.touches.startX)) * 180 / Math.PI;\n isScrolling = s.isHorizontal() ? touchAngle > s.params.touchAngle : (90 - touchAngle > s.params.touchAngle);\n }\n }\n if (isScrolling) {\n s.emit('onTouchMoveOpposite', s, e);\n }\n if (typeof startMoving === 'undefined' && s.browser.ieTouch) {\n if (s.touches.currentX !== s.touches.startX || s.touches.currentY !== s.touches.startY) {\n startMoving = true;\n }\n }\n if (!isTouched) return;\n if (isScrolling) {\n isTouched = false;\n return;\n }\n if (!startMoving && s.browser.ieTouch) {\n return;\n }\n s.allowClick = false;\n s.emit('onSliderMove', s, e);\n e.preventDefault();\n if (s.params.touchMoveStopPropagation && !s.params.nested) {\n e.stopPropagation();\n }\n \n if (!isMoved) {\n if (params.loop) {\n s.fixLoop();\n }\n startTranslate = s.getWrapperTranslate();\n s.setWrapperTransition(0);\n if (s.animating) {\n s.wrapper.trigger('webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd msTransitionEnd');\n }\n if (s.params.autoplay && s.autoplaying) {\n if (s.params.autoplayDisableOnInteraction) {\n s.stopAutoplay();\n }\n else {\n s.pauseAutoplay();\n }\n }\n allowMomentumBounce = false;\n //Grab Cursor\n if (s.params.grabCursor && (s.params.allowSwipeToNext === true || s.params.allowSwipeToPrev === true)) {\n s.setGrabCursor(true);\n }\n }\n isMoved = true;\n \n var diff = s.touches.diff = s.isHorizontal() ? s.touches.currentX - s.touches.startX : s.touches.currentY - s.touches.startY;\n \n diff = diff * s.params.touchRatio;\n if (s.rtl) diff = -diff;\n \n s.swipeDirection = diff > 0 ? 'prev' : 'next';\n currentTranslate = diff + startTranslate;\n \n var disableParentSwiper = true;\n if ((diff > 0 && currentTranslate > s.minTranslate())) {\n disableParentSwiper = false;\n if (s.params.resistance) currentTranslate = s.minTranslate() - 1 + Math.pow(-s.minTranslate() + startTranslate + diff, s.params.resistanceRatio);\n }\n else if (diff < 0 && currentTranslate < s.maxTranslate()) {\n disableParentSwiper = false;\n if (s.params.resistance) currentTranslate = s.maxTranslate() + 1 - Math.pow(s.maxTranslate() - startTranslate - diff, s.params.resistanceRatio);\n }\n \n if (disableParentSwiper) {\n e.preventedByNestedSwiper = true;\n }\n \n // Directions locks\n if (!s.params.allowSwipeToNext && s.swipeDirection === 'next' && currentTranslate < startTranslate) {\n currentTranslate = startTranslate;\n }\n if (!s.params.allowSwipeToPrev && s.swipeDirection === 'prev' && currentTranslate > startTranslate) {\n currentTranslate = startTranslate;\n }\n \n \n // Threshold\n if (s.params.threshold > 0) {\n if (Math.abs(diff) > s.params.threshold || allowThresholdMove) {\n if (!allowThresholdMove) {\n allowThresholdMove = true;\n s.touches.startX = s.touches.currentX;\n s.touches.startY = s.touches.currentY;\n currentTranslate = startTranslate;\n s.touches.diff = s.isHorizontal() ? s.touches.currentX - s.touches.startX : s.touches.currentY - s.touches.startY;\n return;\n }\n }\n else {\n currentTranslate = startTranslate;\n return;\n }\n }\n \n if (!s.params.followFinger) return;\n \n // Update active index in free mode\n if (s.params.freeMode || s.params.watchSlidesProgress) {\n s.updateActiveIndex();\n }\n if (s.params.freeMode) {\n //Velocity\n if (velocities.length === 0) {\n velocities.push({\n position: s.touches[s.isHorizontal() ? 'startX' : 'startY'],\n time: touchStartTime\n });\n }\n velocities.push({\n position: s.touches[s.isHorizontal() ? 'currentX' : 'currentY'],\n time: (new window.Date()).getTime()\n });\n }\n // Update progress\n s.updateProgress(currentTranslate);\n // Update translate\n s.setWrapperTranslate(currentTranslate);\n };\n s.onTouchEnd = function (e) {\n if (e.originalEvent) e = e.originalEvent;\n if (allowTouchCallbacks) {\n s.emit('onTouchEnd', s, e);\n }\n allowTouchCallbacks = false;\n if (!isTouched) return;\n //Return Grab Cursor\n if (s.params.grabCursor && isMoved && isTouched && (s.params.allowSwipeToNext === true || s.params.allowSwipeToPrev === true)) {\n s.setGrabCursor(false);\n }\n \n // Time diff\n var touchEndTime = Date.now();\n var timeDiff = touchEndTime - touchStartTime;\n \n // Tap, doubleTap, Click\n if (s.allowClick) {\n s.updateClickedSlide(e);\n s.emit('onTap', s, e);\n if (timeDiff < 300 && (touchEndTime - lastClickTime) > 300) {\n if (clickTimeout) clearTimeout(clickTimeout);\n clickTimeout = setTimeout(function () {\n if (!s) return;\n if (s.params.paginationHide && s.paginationContainer.length > 0 && !$(e.target).hasClass(s.params.bulletClass)) {\n s.paginationContainer.toggleClass(s.params.paginationHiddenClass);\n }\n s.emit('onClick', s, e);\n }, 300);\n \n }\n if (timeDiff < 300 && (touchEndTime - lastClickTime) < 300) {\n if (clickTimeout) clearTimeout(clickTimeout);\n s.emit('onDoubleTap', s, e);\n }\n }\n \n lastClickTime = Date.now();\n setTimeout(function () {\n if (s) s.allowClick = true;\n }, 0);\n \n if (!isTouched || !isMoved || !s.swipeDirection || s.touches.diff === 0 || currentTranslate === startTranslate) {\n isTouched = isMoved = false;\n return;\n }\n isTouched = isMoved = false;\n \n var currentPos;\n if (s.params.followFinger) {\n currentPos = s.rtl ? s.translate : -s.translate;\n }\n else {\n currentPos = -currentTranslate;\n }\n if (s.params.freeMode) {\n if (currentPos < -s.minTranslate()) {\n s.slideTo(s.activeIndex);\n return;\n }\n else if (currentPos > -s.maxTranslate()) {\n if (s.slides.length < s.snapGrid.length) {\n s.slideTo(s.snapGrid.length - 1);\n }\n else {\n s.slideTo(s.slides.length - 1);\n }\n return;\n }\n \n if (s.params.freeModeMomentum) {\n if (velocities.length > 1) {\n var lastMoveEvent = velocities.pop(), velocityEvent = velocities.pop();\n \n var distance = lastMoveEvent.position - velocityEvent.position;\n var time = lastMoveEvent.time - velocityEvent.time;\n s.velocity = distance / time;\n s.velocity = s.velocity / 2;\n if (Math.abs(s.velocity) < s.params.freeModeMinimumVelocity) {\n s.velocity = 0;\n }\n // this implies that the user stopped moving a finger then released.\n // There would be no events with distance zero, so the last event is stale.\n if (time > 150 || (new window.Date().getTime() - lastMoveEvent.time) > 300) {\n s.velocity = 0;\n }\n } else {\n s.velocity = 0;\n }\n s.velocity = s.velocity * s.params.freeModeMomentumVelocityRatio;\n \n velocities.length = 0;\n var momentumDuration = 1000 * s.params.freeModeMomentumRatio;\n var momentumDistance = s.velocity * momentumDuration;\n \n var newPosition = s.translate + momentumDistance;\n if (s.rtl) newPosition = - newPosition;\n var doBounce = false;\n var afterBouncePosition;\n var bounceAmount = Math.abs(s.velocity) * 20 * s.params.freeModeMomentumBounceRatio;\n if (newPosition < s.maxTranslate()) {\n if (s.params.freeModeMomentumBounce) {\n if (newPosition + s.maxTranslate() < -bounceAmount) {\n newPosition = s.maxTranslate() - bounceAmount;\n }\n afterBouncePosition = s.maxTranslate();\n doBounce = true;\n allowMomentumBounce = true;\n }\n else {\n newPosition = s.maxTranslate();\n }\n }\n else if (newPosition > s.minTranslate()) {\n if (s.params.freeModeMomentumBounce) {\n if (newPosition - s.minTranslate() > bounceAmount) {\n newPosition = s.minTranslate() + bounceAmount;\n }\n afterBouncePosition = s.minTranslate();\n doBounce = true;\n allowMomentumBounce = true;\n }\n else {\n newPosition = s.minTranslate();\n }\n }\n else if (s.params.freeModeSticky) {\n var j = 0,\n nextSlide;\n for (j = 0; j < s.snapGrid.length; j += 1) {\n if (s.snapGrid[j] > -newPosition) {\n nextSlide = j;\n break;\n }\n \n }\n if (Math.abs(s.snapGrid[nextSlide] - newPosition) < Math.abs(s.snapGrid[nextSlide - 1] - newPosition) || s.swipeDirection === 'next') {\n newPosition = s.snapGrid[nextSlide];\n } else {\n newPosition = s.snapGrid[nextSlide - 1];\n }\n if (!s.rtl) newPosition = - newPosition;\n }\n //Fix duration\n if (s.velocity !== 0) {\n if (s.rtl) {\n momentumDuration = Math.abs((-newPosition - s.translate) / s.velocity);\n }\n else {\n momentumDuration = Math.abs((newPosition - s.translate) / s.velocity);\n }\n }\n else if (s.params.freeModeSticky) {\n s.slideReset();\n return;\n }\n \n if (s.params.freeModeMomentumBounce && doBounce) {\n s.updateProgress(afterBouncePosition);\n s.setWrapperTransition(momentumDuration);\n s.setWrapperTranslate(newPosition);\n s.onTransitionStart();\n s.animating = true;\n s.wrapper.transitionEnd(function () {\n if (!s || !allowMomentumBounce) return;\n s.emit('onMomentumBounce', s);\n \n s.setWrapperTransition(s.params.speed);\n s.setWrapperTranslate(afterBouncePosition);\n s.wrapper.transitionEnd(function () {\n if (!s) return;\n s.onTransitionEnd();\n });\n });\n } else if (s.velocity) {\n s.updateProgress(newPosition);\n s.setWrapperTransition(momentumDuration);\n s.setWrapperTranslate(newPosition);\n s.onTransitionStart();\n if (!s.animating) {\n s.animating = true;\n s.wrapper.transitionEnd(function () {\n if (!s) return;\n s.onTransitionEnd();\n });\n }\n \n } else {\n s.updateProgress(newPosition);\n }\n \n s.updateActiveIndex();\n }\n if (!s.params.freeModeMomentum || timeDiff >= s.params.longSwipesMs) {\n s.updateProgress();\n s.updateActiveIndex();\n }\n return;\n }\n \n // Find current slide\n var i, stopIndex = 0, groupSize = s.slidesSizesGrid[0];\n for (i = 0; i < s.slidesGrid.length; i += s.params.slidesPerGroup) {\n if (typeof s.slidesGrid[i + s.params.slidesPerGroup] !== 'undefined') {\n if (currentPos >= s.slidesGrid[i] && currentPos < s.slidesGrid[i + s.params.slidesPerGroup]) {\n stopIndex = i;\n groupSize = s.slidesGrid[i + s.params.slidesPerGroup] - s.slidesGrid[i];\n }\n }\n else {\n if (currentPos >= s.slidesGrid[i]) {\n stopIndex = i;\n groupSize = s.slidesGrid[s.slidesGrid.length - 1] - s.slidesGrid[s.slidesGrid.length - 2];\n }\n }\n }\n \n // Find current slide size\n var ratio = (currentPos - s.slidesGrid[stopIndex]) / groupSize;\n \n if (timeDiff > s.params.longSwipesMs) {\n // Long touches\n if (!s.params.longSwipes) {\n s.slideTo(s.activeIndex);\n return;\n }\n if (s.swipeDirection === 'next') {\n if (ratio >= s.params.longSwipesRatio) s.slideTo(stopIndex + s.params.slidesPerGroup);\n else s.slideTo(stopIndex);\n \n }\n if (s.swipeDirection === 'prev') {\n if (ratio > (1 - s.params.longSwipesRatio)) s.slideTo(stopIndex + s.params.slidesPerGroup);\n else s.slideTo(stopIndex);\n }\n }\n else {\n // Short swipes\n if (!s.params.shortSwipes) {\n s.slideTo(s.activeIndex);\n return;\n }\n if (s.swipeDirection === 'next') {\n s.slideTo(stopIndex + s.params.slidesPerGroup);\n \n }\n if (s.swipeDirection === 'prev') {\n s.slideTo(stopIndex);\n }\n }\n };\n /*=========================\n Transitions\n ===========================*/\n s._slideTo = function (slideIndex, speed) {\n return s.slideTo(slideIndex, speed, true, true);\n };\n s.slideTo = function (slideIndex, speed, runCallbacks, internal) {\n if (typeof runCallbacks === 'undefined') runCallbacks = true;\n if (typeof slideIndex === 'undefined') slideIndex = 0;\n if (slideIndex < 0) slideIndex = 0;\n s.snapIndex = Math.floor(slideIndex / s.params.slidesPerGroup);\n if (s.snapIndex >= s.snapGrid.length) s.snapIndex = s.snapGrid.length - 1;\n \n var translate = - s.snapGrid[s.snapIndex];\n // Stop autoplay\n if (s.params.autoplay && s.autoplaying) {\n if (internal || !s.params.autoplayDisableOnInteraction) {\n s.pauseAutoplay(speed);\n }\n else {\n s.stopAutoplay();\n }\n }\n // Update progress\n s.updateProgress(translate);\n \n // Normalize slideIndex\n if(s.params.normalizeSlideIndex){\n for (var i = 0; i < s.slidesGrid.length; i++) {\n if (- Math.floor(translate * 100) >= Math.floor(s.slidesGrid[i] * 100)) {\n slideIndex = i;\n }\n }\n }\n \n // Directions locks\n if (!s.params.allowSwipeToNext && translate < s.translate && translate < s.minTranslate()) {\n return false;\n }\n if (!s.params.allowSwipeToPrev && translate > s.translate && translate > s.maxTranslate()) {\n if ((s.activeIndex || 0) !== slideIndex ) return false;\n }\n \n // Update Index\n if (typeof speed === 'undefined') speed = s.params.speed;\n s.previousIndex = s.activeIndex || 0;\n s.activeIndex = slideIndex;\n s.updateRealIndex();\n if ((s.rtl && -translate === s.translate) || (!s.rtl && translate === s.translate)) {\n // Update Height\n if (s.params.autoHeight) {\n s.updateAutoHeight();\n }\n s.updateClasses();\n if (s.params.effect !== 'slide') {\n s.setWrapperTranslate(translate);\n }\n return false;\n }\n s.updateClasses();\n s.onTransitionStart(runCallbacks);\n \n if (speed === 0 || s.browser.lteIE9) {\n s.setWrapperTranslate(translate);\n s.setWrapperTransition(0);\n s.onTransitionEnd(runCallbacks);\n }\n else {\n s.setWrapperTranslate(translate);\n s.setWrapperTransition(speed);\n if (!s.animating) {\n s.animating = true;\n s.wrapper.transitionEnd(function () {\n if (!s) return;\n s.onTransitionEnd(runCallbacks);\n });\n }\n \n }\n \n return true;\n };\n \n s.onTransitionStart = function (runCallbacks) {\n if (typeof runCallbacks === 'undefined') runCallbacks = true;\n if (s.params.autoHeight) {\n s.updateAutoHeight();\n }\n if (s.lazy) s.lazy.onTransitionStart();\n if (runCallbacks) {\n s.emit('onTransitionStart', s);\n if (s.activeIndex !== s.previousIndex) {\n s.emit('onSlideChangeStart', s);\n if (s.activeIndex > s.previousIndex) {\n s.emit('onSlideNextStart', s);\n }\n else {\n s.emit('onSlidePrevStart', s);\n }\n }\n \n }\n };\n s.onTransitionEnd = function (runCallbacks) {\n s.animating = false;\n s.setWrapperTransition(0);\n if (typeof runCallbacks === 'undefined') runCallbacks = true;\n if (s.lazy) s.lazy.onTransitionEnd();\n if (runCallbacks) {\n s.emit('onTransitionEnd', s);\n if (s.activeIndex !== s.previousIndex) {\n s.emit('onSlideChangeEnd', s);\n if (s.activeIndex > s.previousIndex) {\n s.emit('onSlideNextEnd', s);\n }\n else {\n s.emit('onSlidePrevEnd', s);\n }\n }\n }\n if (s.params.history && s.history) {\n s.history.setHistory(s.params.history, s.activeIndex);\n }\n if (s.params.hashnav && s.hashnav) {\n s.hashnav.setHash();\n }\n \n };\n s.slideNext = function (runCallbacks, speed, internal) {\n if (s.params.loop) {\n if (s.animating) return false;\n s.fixLoop();\n var clientLeft = s.container[0].clientLeft;\n return s.slideTo(s.activeIndex + s.params.slidesPerGroup, speed, runCallbacks, internal);\n }\n else return s.slideTo(s.activeIndex + s.params.slidesPerGroup, speed, runCallbacks, internal);\n };\n s._slideNext = function (speed) {\n return s.slideNext(true, speed, true);\n };\n s.slidePrev = function (runCallbacks, speed, internal) {\n if (s.params.loop) {\n if (s.animating) return false;\n s.fixLoop();\n var clientLeft = s.container[0].clientLeft;\n return s.slideTo(s.activeIndex - 1, speed, runCallbacks, internal);\n }\n else return s.slideTo(s.activeIndex - 1, speed, runCallbacks, internal);\n };\n s._slidePrev = function (speed) {\n return s.slidePrev(true, speed, true);\n };\n s.slideReset = function (runCallbacks, speed, internal) {\n return s.slideTo(s.activeIndex, speed, runCallbacks);\n };\n \n s.disableTouchControl = function () {\n s.params.onlyExternal = true;\n return true;\n };\n s.enableTouchControl = function () {\n s.params.onlyExternal = false;\n return true;\n };\n \n /*=========================\n Translate/transition helpers\n ===========================*/\n s.setWrapperTransition = function (duration, byController) {\n s.wrapper.transition(duration);\n if (s.params.effect !== 'slide' && s.effects[s.params.effect]) {\n s.effects[s.params.effect].setTransition(duration);\n }\n if (s.params.parallax && s.parallax) {\n s.parallax.setTransition(duration);\n }\n if (s.params.scrollbar && s.scrollbar) {\n s.scrollbar.setTransition(duration);\n }\n if (s.params.control && s.controller) {\n s.controller.setTransition(duration, byController);\n }\n s.emit('onSetTransition', s, duration);\n };\n s.setWrapperTranslate = function (translate, updateActiveIndex, byController) {\n var x = 0, y = 0, z = 0;\n if (s.isHorizontal()) {\n x = s.rtl ? -translate : translate;\n }\n else {\n y = translate;\n }\n \n if (s.params.roundLengths) {\n x = round(x);\n y = round(y);\n }\n \n if (!s.params.virtualTranslate) {\n if (s.support.transforms3d) s.wrapper.transform('translate3d(' + x + 'px, ' + y + 'px, ' + z + 'px)');\n else s.wrapper.transform('translate(' + x + 'px, ' + y + 'px)');\n }\n \n s.translate = s.isHorizontal() ? x : y;\n \n // Check if we need to update progress\n var progress;\n var translatesDiff = s.maxTranslate() - s.minTranslate();\n if (translatesDiff === 0) {\n progress = 0;\n }\n else {\n progress = (translate - s.minTranslate()) / (translatesDiff);\n }\n if (progress !== s.progress) {\n s.updateProgress(translate);\n }\n \n if (updateActiveIndex) s.updateActiveIndex();\n if (s.params.effect !== 'slide' && s.effects[s.params.effect]) {\n s.effects[s.params.effect].setTranslate(s.translate);\n }\n if (s.params.parallax && s.parallax) {\n s.parallax.setTranslate(s.translate);\n }\n if (s.params.scrollbar && s.scrollbar) {\n s.scrollbar.setTranslate(s.translate);\n }\n if (s.params.control && s.controller) {\n s.controller.setTranslate(s.translate, byController);\n }\n s.emit('onSetTranslate', s, s.translate);\n };\n \n s.getTranslate = function (el, axis) {\n var matrix, curTransform, curStyle, transformMatrix;\n \n // automatic axis detection\n if (typeof axis === 'undefined') {\n axis = 'x';\n }\n \n if (s.params.virtualTranslate) {\n return s.rtl ? -s.translate : s.translate;\n }\n \n curStyle = window.getComputedStyle(el, null);\n if (window.WebKitCSSMatrix) {\n curTransform = curStyle.transform || curStyle.webkitTransform;\n if (curTransform.split(',').length > 6) {\n curTransform = curTransform.split(', ').map(function(a){\n return a.replace(',','.');\n }).join(', ');\n }\n // Some old versions of Webkit choke when 'none' is passed; pass\n // empty string instead in this case\n transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);\n }\n else {\n transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');\n matrix = transformMatrix.toString().split(',');\n }\n \n if (axis === 'x') {\n //Latest Chrome and webkits Fix\n if (window.WebKitCSSMatrix)\n curTransform = transformMatrix.m41;\n //Crazy IE10 Matrix\n else if (matrix.length === 16)\n curTransform = parseFloat(matrix[12]);\n //Normal Browsers\n else\n curTransform = parseFloat(matrix[4]);\n }\n if (axis === 'y') {\n //Latest Chrome and webkits Fix\n if (window.WebKitCSSMatrix)\n curTransform = transformMatrix.m42;\n //Crazy IE10 Matrix\n else if (matrix.length === 16)\n curTransform = parseFloat(matrix[13]);\n //Normal Browsers\n else\n curTransform = parseFloat(matrix[5]);\n }\n if (s.rtl && curTransform) curTransform = -curTransform;\n return curTransform || 0;\n };\n s.getWrapperTranslate = function (axis) {\n if (typeof axis === 'undefined') {\n axis = s.isHorizontal() ? 'x' : 'y';\n }\n return s.getTranslate(s.wrapper[0], axis);\n };\n \n /*=========================\n Observer\n ===========================*/\n s.observers = [];\n function initObserver(target, options) {\n options = options || {};\n // create an observer instance\n var ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;\n var observer = new ObserverFunc(function (mutations) {\n mutations.forEach(function (mutation) {\n s.onResize(true);\n s.emit('onObserverUpdate', s, mutation);\n });\n });\n \n observer.observe(target, {\n attributes: typeof options.attributes === 'undefined' ? true : options.attributes,\n childList: typeof options.childList === 'undefined' ? true : options.childList,\n characterData: typeof options.characterData === 'undefined' ? true : options.characterData\n });\n \n s.observers.push(observer);\n }\n s.initObservers = function () {\n if (s.params.observeParents) {\n var containerParents = s.container.parents();\n for (var i = 0; i < containerParents.length; i++) {\n initObserver(containerParents[i]);\n }\n }\n \n // Observe container\n initObserver(s.container[0], {childList: false});\n \n // Observe wrapper\n initObserver(s.wrapper[0], {attributes: false});\n };\n s.disconnectObservers = function () {\n for (var i = 0; i < s.observers.length; i++) {\n s.observers[i].disconnect();\n }\n s.observers = [];\n };\n /*=========================\n Loop\n ===========================*/\n // Create looped slides\n s.createLoop = function () {\n // Remove duplicated slides\n s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove();\n \n var slides = s.wrapper.children('.' + s.params.slideClass);\n \n if(s.params.slidesPerView === 'auto' && !s.params.loopedSlides) s.params.loopedSlides = slides.length;\n \n s.loopedSlides = parseInt(s.params.loopedSlides || s.params.slidesPerView, 10);\n s.loopedSlides = s.loopedSlides + s.params.loopAdditionalSlides;\n if (s.loopedSlides > slides.length) {\n s.loopedSlides = slides.length;\n }\n \n var prependSlides = [], appendSlides = [], i;\n slides.each(function (index, el) {\n var slide = $(this);\n if (index < s.loopedSlides) appendSlides.push(el);\n if (index < slides.length && index >= slides.length - s.loopedSlides) prependSlides.push(el);\n slide.attr('data-swiper-slide-index', index);\n });\n for (i = 0; i < appendSlides.length; i++) {\n s.wrapper.append($(appendSlides[i].cloneNode(true)).addClass(s.params.slideDuplicateClass));\n }\n for (i = prependSlides.length - 1; i >= 0; i--) {\n s.wrapper.prepend($(prependSlides[i].cloneNode(true)).addClass(s.params.slideDuplicateClass));\n }\n };\n s.destroyLoop = function () {\n s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove();\n s.slides.removeAttr('data-swiper-slide-index');\n };\n s.reLoop = function (updatePosition) {\n var oldIndex = s.activeIndex - s.loopedSlides;\n s.destroyLoop();\n s.createLoop();\n s.updateSlidesSize();\n if (updatePosition) {\n s.slideTo(oldIndex + s.loopedSlides, 0, false);\n }\n \n };\n s.fixLoop = function () {\n var newIndex;\n //Fix For Negative Oversliding\n if (s.activeIndex < s.loopedSlides) {\n newIndex = s.slides.length - s.loopedSlides * 3 + s.activeIndex;\n newIndex = newIndex + s.loopedSlides;\n s.slideTo(newIndex, 0, false, true);\n }\n //Fix For Positive Oversliding\n else if ((s.params.slidesPerView === 'auto' && s.activeIndex >= s.loopedSlides * 2) || (s.activeIndex > s.slides.length - s.params.slidesPerView * 2)) {\n newIndex = -s.slides.length + s.activeIndex + s.loopedSlides;\n newIndex = newIndex + s.loopedSlides;\n s.slideTo(newIndex, 0, false, true);\n }\n };\n /*=========================\n Append/Prepend/Remove Slides\n ===========================*/\n s.appendSlide = function (slides) {\n if (s.params.loop) {\n s.destroyLoop();\n }\n if (typeof slides === 'object' && slides.length) {\n for (var i = 0; i < slides.length; i++) {\n if (slides[i]) s.wrapper.append(slides[i]);\n }\n }\n else {\n s.wrapper.append(slides);\n }\n if (s.params.loop) {\n s.createLoop();\n }\n if (!(s.params.observer && s.support.observer)) {\n s.update(true);\n }\n };\n s.prependSlide = function (slides) {\n if (s.params.loop) {\n s.destroyLoop();\n }\n var newActiveIndex = s.activeIndex + 1;\n if (typeof slides === 'object' && slides.length) {\n for (var i = 0; i < slides.length; i++) {\n if (slides[i]) s.wrapper.prepend(slides[i]);\n }\n newActiveIndex = s.activeIndex + slides.length;\n }\n else {\n s.wrapper.prepend(slides);\n }\n if (s.params.loop) {\n s.createLoop();\n }\n if (!(s.params.observer && s.support.observer)) {\n s.update(true);\n }\n s.slideTo(newActiveIndex, 0, false);\n };\n s.removeSlide = function (slidesIndexes) {\n if (s.params.loop) {\n s.destroyLoop();\n s.slides = s.wrapper.children('.' + s.params.slideClass);\n }\n var newActiveIndex = s.activeIndex,\n indexToRemove;\n if (typeof slidesIndexes === 'object' && slidesIndexes.length) {\n for (var i = 0; i < slidesIndexes.length; i++) {\n indexToRemove = slidesIndexes[i];\n if (s.slides[indexToRemove]) s.slides.eq(indexToRemove).remove();\n if (indexToRemove < newActiveIndex) newActiveIndex--;\n }\n newActiveIndex = Math.max(newActiveIndex, 0);\n }\n else {\n indexToRemove = slidesIndexes;\n if (s.slides[indexToRemove]) s.slides.eq(indexToRemove).remove();\n if (indexToRemove < newActiveIndex) newActiveIndex--;\n newActiveIndex = Math.max(newActiveIndex, 0);\n }\n \n if (s.params.loop) {\n s.createLoop();\n }\n \n if (!(s.params.observer && s.support.observer)) {\n s.update(true);\n }\n if (s.params.loop) {\n s.slideTo(newActiveIndex + s.loopedSlides, 0, false);\n }\n else {\n s.slideTo(newActiveIndex, 0, false);\n }\n \n };\n s.removeAllSlides = function () {\n var slidesIndexes = [];\n for (var i = 0; i < s.slides.length; i++) {\n slidesIndexes.push(i);\n }\n s.removeSlide(slidesIndexes);\n };\n \n\n /*=========================\n Effects\n ===========================*/\n s.effects = {\n fade: {\n setTranslate: function () {\n for (var i = 0; i < s.slides.length; i++) {\n var slide = s.slides.eq(i);\n var offset = slide[0].swiperSlideOffset;\n var tx = -offset;\n if (!s.params.virtualTranslate) tx = tx - s.translate;\n var ty = 0;\n if (!s.isHorizontal()) {\n ty = tx;\n tx = 0;\n }\n var slideOpacity = s.params.fade.crossFade ?\n Math.max(1 - Math.abs(slide[0].progress), 0) :\n 1 + Math.min(Math.max(slide[0].progress, -1), 0);\n slide\n .css({\n opacity: slideOpacity\n })\n .transform('translate3d(' + tx + 'px, ' + ty + 'px, 0px)');\n \n }\n \n },\n setTransition: function (duration) {\n s.slides.transition(duration);\n if (s.params.virtualTranslate && duration !== 0) {\n var eventTriggered = false;\n s.slides.transitionEnd(function () {\n if (eventTriggered) return;\n if (!s) return;\n eventTriggered = true;\n s.animating = false;\n var triggerEvents = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'];\n for (var i = 0; i < triggerEvents.length; i++) {\n s.wrapper.trigger(triggerEvents[i]);\n }\n });\n }\n }\n },\n flip: {\n setTranslate: function () {\n for (var i = 0; i < s.slides.length; i++) {\n var slide = s.slides.eq(i);\n var progress = slide[0].progress;\n if (s.params.flip.limitRotation) {\n progress = Math.max(Math.min(slide[0].progress, 1), -1);\n }\n var offset = slide[0].swiperSlideOffset;\n var rotate = -180 * progress,\n rotateY = rotate,\n rotateX = 0,\n tx = -offset,\n ty = 0;\n if (!s.isHorizontal()) {\n ty = tx;\n tx = 0;\n rotateX = -rotateY;\n rotateY = 0;\n }\n else if (s.rtl) {\n rotateY = -rotateY;\n }\n \n slide[0].style.zIndex = -Math.abs(Math.round(progress)) + s.slides.length;\n \n if (s.params.flip.slideShadows) {\n //Set shadows\n var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');\n var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');\n if (shadowBefore.length === 0) {\n shadowBefore = $('<div class=\"swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '\"></div>');\n slide.append(shadowBefore);\n }\n if (shadowAfter.length === 0) {\n shadowAfter = $('<div class=\"swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '\"></div>');\n slide.append(shadowAfter);\n }\n if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0);\n if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0);\n }\n \n slide\n .transform('translate3d(' + tx + 'px, ' + ty + 'px, 0px) rotateX(' + rotateX + 'deg) rotateY(' + rotateY + 'deg)');\n }\n },\n setTransition: function (duration) {\n s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);\n if (s.params.virtualTranslate && duration !== 0) {\n var eventTriggered = false;\n s.slides.eq(s.activeIndex).transitionEnd(function () {\n if (eventTriggered) return;\n if (!s) return;\n if (!$(this).hasClass(s.params.slideActiveClass)) return;\n eventTriggered = true;\n s.animating = false;\n var triggerEvents = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'];\n for (var i = 0; i < triggerEvents.length; i++) {\n s.wrapper.trigger(triggerEvents[i]);\n }\n });\n }\n }\n },\n cube: {\n setTranslate: function () {\n var wrapperRotate = 0, cubeShadow;\n if (s.params.cube.shadow) {\n if (s.isHorizontal()) {\n cubeShadow = s.wrapper.find('.swiper-cube-shadow');\n if (cubeShadow.length === 0) {\n cubeShadow = $('<div class=\"swiper-cube-shadow\"></div>');\n s.wrapper.append(cubeShadow);\n }\n cubeShadow.css({height: s.width + 'px'});\n }\n else {\n cubeShadow = s.container.find('.swiper-cube-shadow');\n if (cubeShadow.length === 0) {\n cubeShadow = $('<div class=\"swiper-cube-shadow\"></div>');\n s.container.append(cubeShadow);\n }\n }\n }\n for (var i = 0; i < s.slides.length; i++) {\n var slide = s.slides.eq(i);\n var slideAngle = i * 90;\n var round = Math.floor(slideAngle / 360);\n if (s.rtl) {\n slideAngle = -slideAngle;\n round = Math.floor(-slideAngle / 360);\n }\n var progress = Math.max(Math.min(slide[0].progress, 1), -1);\n var tx = 0, ty = 0, tz = 0;\n if (i % 4 === 0) {\n tx = - round * 4 * s.size;\n tz = 0;\n }\n else if ((i - 1) % 4 === 0) {\n tx = 0;\n tz = - round * 4 * s.size;\n }\n else if ((i - 2) % 4 === 0) {\n tx = s.size + round * 4 * s.size;\n tz = s.size;\n }\n else if ((i - 3) % 4 === 0) {\n tx = - s.size;\n tz = 3 * s.size + s.size * 4 * round;\n }\n if (s.rtl) {\n tx = -tx;\n }\n \n if (!s.isHorizontal()) {\n ty = tx;\n tx = 0;\n }\n \n var transform = 'rotateX(' + (s.isHorizontal() ? 0 : -slideAngle) + 'deg) rotateY(' + (s.isHorizontal() ? slideAngle : 0) + 'deg) translate3d(' + tx + 'px, ' + ty + 'px, ' + tz + 'px)';\n if (progress <= 1 && progress > -1) {\n wrapperRotate = i * 90 + progress * 90;\n if (s.rtl) wrapperRotate = -i * 90 - progress * 90;\n }\n slide.transform(transform);\n if (s.params.cube.slideShadows) {\n //Set shadows\n var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');\n var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');\n if (shadowBefore.length === 0) {\n shadowBefore = $('<div class=\"swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '\"></div>');\n slide.append(shadowBefore);\n }\n if (shadowAfter.length === 0) {\n shadowAfter = $('<div class=\"swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '\"></div>');\n slide.append(shadowAfter);\n }\n if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0);\n if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0);\n }\n }\n s.wrapper.css({\n '-webkit-transform-origin': '50% 50% -' + (s.size / 2) + 'px',\n '-moz-transform-origin': '50% 50% -' + (s.size / 2) + 'px',\n '-ms-transform-origin': '50% 50% -' + (s.size / 2) + 'px',\n 'transform-origin': '50% 50% -' + (s.size / 2) + 'px'\n });\n \n if (s.params.cube.shadow) {\n if (s.isHorizontal()) {\n cubeShadow.transform('translate3d(0px, ' + (s.width / 2 + s.params.cube.shadowOffset) + 'px, ' + (-s.width / 2) + 'px) rotateX(90deg) rotateZ(0deg) scale(' + (s.params.cube.shadowScale) + ')');\n }\n else {\n var shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90;\n var multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2);\n var scale1 = s.params.cube.shadowScale,\n scale2 = s.params.cube.shadowScale / multiplier,\n offset = s.params.cube.shadowOffset;\n cubeShadow.transform('scale3d(' + scale1 + ', 1, ' + scale2 + ') translate3d(0px, ' + (s.height / 2 + offset) + 'px, ' + (-s.height / 2 / scale2) + 'px) rotateX(-90deg)');\n }\n }\n var zFactor = (s.isSafari || s.isUiWebView) ? (-s.size / 2) : 0;\n s.wrapper.transform('translate3d(0px,0,' + zFactor + 'px) rotateX(' + (s.isHorizontal() ? 0 : wrapperRotate) + 'deg) rotateY(' + (s.isHorizontal() ? -wrapperRotate : 0) + 'deg)');\n },\n setTransition: function (duration) {\n s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);\n if (s.params.cube.shadow && !s.isHorizontal()) {\n s.container.find('.swiper-cube-shadow').transition(duration);\n }\n }\n },\n coverflow: {\n setTranslate: function () {\n var transform = s.translate;\n var center = s.isHorizontal() ? -transform + s.width / 2 : -transform + s.height / 2;\n var rotate = s.isHorizontal() ? s.params.coverflow.rotate: -s.params.coverflow.rotate;\n var translate = s.params.coverflow.depth;\n //Each slide offset from center\n for (var i = 0, length = s.slides.length; i < length; i++) {\n var slide = s.slides.eq(i);\n var slideSize = s.slidesSizesGrid[i];\n var slideOffset = slide[0].swiperSlideOffset;\n var offsetMultiplier = (center - slideOffset - slideSize / 2) / slideSize * s.params.coverflow.modifier;\n \n var rotateY = s.isHorizontal() ? rotate * offsetMultiplier : 0;\n var rotateX = s.isHorizontal() ? 0 : rotate * offsetMultiplier;\n // var rotateZ = 0\n var translateZ = -translate * Math.abs(offsetMultiplier);\n \n var translateY = s.isHorizontal() ? 0 : s.params.coverflow.stretch * (offsetMultiplier);\n var translateX = s.isHorizontal() ? s.params.coverflow.stretch * (offsetMultiplier) : 0;\n \n //Fix for ultra small values\n if (Math.abs(translateX) < 0.001) translateX = 0;\n if (Math.abs(translateY) < 0.001) translateY = 0;\n if (Math.abs(translateZ) < 0.001) translateZ = 0;\n if (Math.abs(rotateY) < 0.001) rotateY = 0;\n if (Math.abs(rotateX) < 0.001) rotateX = 0;\n \n var slideTransform = 'translate3d(' + translateX + 'px,' + translateY + 'px,' + translateZ + 'px) rotateX(' + rotateX + 'deg) rotateY(' + rotateY + 'deg)';\n \n slide.transform(slideTransform);\n slide[0].style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1;\n if (s.params.coverflow.slideShadows) {\n //Set shadows\n var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');\n var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');\n if (shadowBefore.length === 0) {\n shadowBefore = $('<div class=\"swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '\"></div>');\n slide.append(shadowBefore);\n }\n if (shadowAfter.length === 0) {\n shadowAfter = $('<div class=\"swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '\"></div>');\n slide.append(shadowAfter);\n }\n if (shadowBefore.length) shadowBefore[0].style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0;\n if (shadowAfter.length) shadowAfter[0].style.opacity = (-offsetMultiplier) > 0 ? -offsetMultiplier : 0;\n }\n }\n \n //Set correct perspective for IE10\n if (s.browser.ie) {\n var ws = s.wrapper[0].style;\n ws.perspectiveOrigin = center + 'px 50%';\n }\n },\n setTransition: function (duration) {\n s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);\n }\n }\n };\n\n /*=========================\n Images Lazy Loading\n ===========================*/\n s.lazy = {\n initialImageLoaded: false,\n loadImageInSlide: function (index, loadInDuplicate) {\n if (typeof index === 'undefined') return;\n if (typeof loadInDuplicate === 'undefined') loadInDuplicate = true;\n if (s.slides.length === 0) return;\n \n var slide = s.slides.eq(index);\n var img = slide.find('.' + s.params.lazyLoadingClass + ':not(.' + s.params.lazyStatusLoadedClass + '):not(.' + s.params.lazyStatusLoadingClass + ')');\n if (slide.hasClass(s.params.lazyLoadingClass) && !slide.hasClass(s.params.lazyStatusLoadedClass) && !slide.hasClass(s.params.lazyStatusLoadingClass)) {\n img = img.add(slide[0]);\n }\n if (img.length === 0) return;\n \n img.each(function () {\n var _img = $(this);\n _img.addClass(s.params.lazyStatusLoadingClass);\n var background = _img.attr('data-background');\n var src = _img.attr('data-src'),\n srcset = _img.attr('data-srcset'),\n sizes = _img.attr('data-sizes');\n s.loadImage(_img[0], (src || background), srcset, sizes, false, function () {\n if (background) {\n _img.css('background-image', 'url(\"' + background + '\")');\n _img.removeAttr('data-background');\n }\n else {\n if (srcset) {\n _img.attr('srcset', srcset);\n _img.removeAttr('data-srcset');\n }\n if (sizes) {\n _img.attr('sizes', sizes);\n _img.removeAttr('data-sizes');\n }\n if (src) {\n _img.attr('src', src);\n _img.removeAttr('data-src');\n }\n \n }\n \n _img.addClass(s.params.lazyStatusLoadedClass).removeClass(s.params.lazyStatusLoadingClass);\n slide.find('.' + s.params.lazyPreloaderClass + ', .' + s.params.preloaderClass).remove();\n if (s.params.loop && loadInDuplicate) {\n var slideOriginalIndex = slide.attr('data-swiper-slide-index');\n if (slide.hasClass(s.params.slideDuplicateClass)) {\n var originalSlide = s.wrapper.children('[data-swiper-slide-index=\"' + slideOriginalIndex + '\"]:not(.' + s.params.slideDuplicateClass + ')');\n s.lazy.loadImageInSlide(originalSlide.index(), false);\n }\n else {\n var duplicatedSlide = s.wrapper.children('.' + s.params.slideDuplicateClass + '[data-swiper-slide-index=\"' + slideOriginalIndex + '\"]');\n s.lazy.loadImageInSlide(duplicatedSlide.index(), false);\n }\n }\n s.emit('onLazyImageReady', s, slide[0], _img[0]);\n });\n \n s.emit('onLazyImageLoad', s, slide[0], _img[0]);\n });\n \n },\n load: function () {\n var i;\n var slidesPerView = s.params.slidesPerView;\n if (slidesPerView === 'auto') {\n slidesPerView = 0;\n }\n if (!s.lazy.initialImageLoaded) s.lazy.initialImageLoaded = true;\n if (s.params.watchSlidesVisibility) {\n s.wrapper.children('.' + s.params.slideVisibleClass).each(function () {\n s.lazy.loadImageInSlide($(this).index());\n });\n }\n else {\n if (slidesPerView > 1) {\n for (i = s.activeIndex; i < s.activeIndex + slidesPerView ; i++) {\n if (s.slides[i]) s.lazy.loadImageInSlide(i);\n }\n }\n else {\n s.lazy.loadImageInSlide(s.activeIndex);\n }\n }\n if (s.params.lazyLoadingInPrevNext) {\n if (slidesPerView > 1 || (s.params.lazyLoadingInPrevNextAmount && s.params.lazyLoadingInPrevNextAmount > 1)) {\n var amount = s.params.lazyLoadingInPrevNextAmount;\n var spv = slidesPerView;\n var maxIndex = Math.min(s.activeIndex + spv + Math.max(amount, spv), s.slides.length);\n var minIndex = Math.max(s.activeIndex - Math.max(spv, amount), 0);\n // Next Slides\n for (i = s.activeIndex + slidesPerView; i < maxIndex; i++) {\n if (s.slides[i]) s.lazy.loadImageInSlide(i);\n }\n // Prev Slides\n for (i = minIndex; i < s.activeIndex ; i++) {\n if (s.slides[i]) s.lazy.loadImageInSlide(i);\n }\n }\n else {\n var nextSlide = s.wrapper.children('.' + s.params.slideNextClass);\n if (nextSlide.length > 0) s.lazy.loadImageInSlide(nextSlide.index());\n \n var prevSlide = s.wrapper.children('.' + s.params.slidePrevClass);\n if (prevSlide.length > 0) s.lazy.loadImageInSlide(prevSlide.index());\n }\n }\n },\n onTransitionStart: function () {\n if (s.params.lazyLoading) {\n if (s.params.lazyLoadingOnTransitionStart || (!s.params.lazyLoadingOnTransitionStart && !s.lazy.initialImageLoaded)) {\n s.lazy.load();\n }\n }\n },\n onTransitionEnd: function () {\n if (s.params.lazyLoading && !s.params.lazyLoadingOnTransitionStart) {\n s.lazy.load();\n }\n }\n };\n \n\n /*=========================\n Scrollbar\n ===========================*/\n s.scrollbar = {\n isTouched: false,\n setDragPosition: function (e) {\n var sb = s.scrollbar;\n var x = 0, y = 0;\n var translate;\n var pointerPosition = s.isHorizontal() ?\n ((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].pageX : e.pageX || e.clientX) :\n ((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].pageY : e.pageY || e.clientY) ;\n var position = (pointerPosition) - sb.track.offset()[s.isHorizontal() ? 'left' : 'top'] - sb.dragSize / 2;\n var positionMin = -s.minTranslate() * sb.moveDivider;\n var positionMax = -s.maxTranslate() * sb.moveDivider;\n if (position < positionMin) {\n position = positionMin;\n }\n else if (position > positionMax) {\n position = positionMax;\n }\n position = -position / sb.moveDivider;\n s.updateProgress(position);\n s.setWrapperTranslate(position, true);\n },\n dragStart: function (e) {\n var sb = s.scrollbar;\n sb.isTouched = true;\n e.preventDefault();\n e.stopPropagation();\n \n sb.setDragPosition(e);\n clearTimeout(sb.dragTimeout);\n \n sb.track.transition(0);\n if (s.params.scrollbarHide) {\n sb.track.css('opacity', 1);\n }\n s.wrapper.transition(100);\n sb.drag.transition(100);\n s.emit('onScrollbarDragStart', s);\n },\n dragMove: function (e) {\n var sb = s.scrollbar;\n if (!sb.isTouched) return;\n if (e.preventDefault) e.preventDefault();\n else e.returnValue = false;\n sb.setDragPosition(e);\n s.wrapper.transition(0);\n sb.track.transition(0);\n sb.drag.transition(0);\n s.emit('onScrollbarDragMove', s);\n },\n dragEnd: function (e) {\n var sb = s.scrollbar;\n if (!sb.isTouched) return;\n sb.isTouched = false;\n if (s.params.scrollbarHide) {\n clearTimeout(sb.dragTimeout);\n sb.dragTimeout = setTimeout(function () {\n sb.track.css('opacity', 0);\n sb.track.transition(400);\n }, 1000);\n \n }\n s.emit('onScrollbarDragEnd', s);\n if (s.params.scrollbarSnapOnRelease) {\n s.slideReset();\n }\n },\n draggableEvents: (function () {\n if ((s.params.simulateTouch === false && !s.support.touch)) return s.touchEventsDesktop;\n else return s.touchEvents;\n })(),\n enableDraggable: function () {\n var sb = s.scrollbar;\n var target = s.support.touch ? sb.track : document;\n $(sb.track).on(sb.draggableEvents.start, sb.dragStart);\n $(target).on(sb.draggableEvents.move, sb.dragMove);\n $(target).on(sb.draggableEvents.end, sb.dragEnd);\n },\n disableDraggable: function () {\n var sb = s.scrollbar;\n var target = s.support.touch ? sb.track : document;\n $(sb.track).off(s.draggableEvents.start, sb.dragStart);\n $(target).off(s.draggableEvents.move, sb.dragMove);\n $(target).off(s.draggableEvents.end, sb.dragEnd);\n },\n set: function () {\n if (!s.params.scrollbar) return;\n var sb = s.scrollbar;\n sb.track = $(s.params.scrollbar);\n if (s.params.uniqueNavElements && typeof s.params.scrollbar === 'string' && sb.track.length > 1 && s.container.find(s.params.scrollbar).length === 1) {\n sb.track = s.container.find(s.params.scrollbar);\n }\n sb.drag = sb.track.find('.swiper-scrollbar-drag');\n if (sb.drag.length === 0) {\n sb.drag = $('<div class=\"swiper-scrollbar-drag\"></div>');\n sb.track.append(sb.drag);\n }\n sb.drag[0].style.width = '';\n sb.drag[0].style.height = '';\n sb.trackSize = s.isHorizontal() ? sb.track[0].offsetWidth : sb.track[0].offsetHeight;\n \n sb.divider = s.size / s.virtualSize;\n sb.moveDivider = sb.divider * (sb.trackSize / s.size);\n sb.dragSize = sb.trackSize * sb.divider;\n \n if (s.isHorizontal()) {\n sb.drag[0].style.width = sb.dragSize + 'px';\n }\n else {\n sb.drag[0].style.height = sb.dragSize + 'px';\n }\n \n if (sb.divider >= 1) {\n sb.track[0].style.display = 'none';\n }\n else {\n sb.track[0].style.display = '';\n }\n if (s.params.scrollbarHide) {\n sb.track[0].style.opacity = 0;\n }\n },\n setTranslate: function () {\n if (!s.params.scrollbar) return;\n var diff;\n var sb = s.scrollbar;\n var translate = s.translate || 0;\n var newPos;\n \n var newSize = sb.dragSize;\n newPos = (sb.trackSize - sb.dragSize) * s.progress;\n if (s.rtl && s.isHorizontal()) {\n newPos = -newPos;\n if (newPos > 0) {\n newSize = sb.dragSize - newPos;\n newPos = 0;\n }\n else if (-newPos + sb.dragSize > sb.trackSize) {\n newSize = sb.trackSize + newPos;\n }\n }\n else {\n if (newPos < 0) {\n newSize = sb.dragSize + newPos;\n newPos = 0;\n }\n else if (newPos + sb.dragSize > sb.trackSize) {\n newSize = sb.trackSize - newPos;\n }\n }\n if (s.isHorizontal()) {\n if (s.support.transforms3d) {\n sb.drag.transform('translate3d(' + (newPos) + 'px, 0, 0)');\n }\n else {\n sb.drag.transform('translateX(' + (newPos) + 'px)');\n }\n sb.drag[0].style.width = newSize + 'px';\n }\n else {\n if (s.support.transforms3d) {\n sb.drag.transform('translate3d(0px, ' + (newPos) + 'px, 0)');\n }\n else {\n sb.drag.transform('translateY(' + (newPos) + 'px)');\n }\n sb.drag[0].style.height = newSize + 'px';\n }\n if (s.params.scrollbarHide) {\n clearTimeout(sb.timeout);\n sb.track[0].style.opacity = 1;\n sb.timeout = setTimeout(function () {\n sb.track[0].style.opacity = 0;\n sb.track.transition(400);\n }, 1000);\n }\n },\n setTransition: function (duration) {\n if (!s.params.scrollbar) return;\n s.scrollbar.drag.transition(duration);\n }\n };\n\n /*=========================\n Controller\n ===========================*/\n s.controller = {\n LinearSpline: function (x, y) {\n this.x = x;\n this.y = y;\n this.lastIndex = x.length - 1;\n // Given an x value (x2), return the expected y2 value:\n // (x1,y1) is the known point before given value,\n // (x3,y3) is the known point after given value.\n var i1, i3;\n var l = this.x.length;\n \n this.interpolate = function (x2) {\n if (!x2) return 0;\n \n // Get the indexes of x1 and x3 (the array indexes before and after given x2):\n i3 = binarySearch(this.x, x2);\n i1 = i3 - 1;\n \n // We have our indexes i1 & i3, so we can calculate already:\n // y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1\n return ((x2 - this.x[i1]) * (this.y[i3] - this.y[i1])) / (this.x[i3] - this.x[i1]) + this.y[i1];\n };\n \n var binarySearch = (function() {\n var maxIndex, minIndex, guess;\n return function(array, val) {\n minIndex = -1;\n maxIndex = array.length;\n while (maxIndex - minIndex > 1)\n if (array[guess = maxIndex + minIndex >> 1] <= val) {\n minIndex = guess;\n } else {\n maxIndex = guess;\n }\n return maxIndex;\n };\n })();\n },\n //xxx: for now i will just save one spline function to to\n getInterpolateFunction: function(c){\n if(!s.controller.spline) s.controller.spline = s.params.loop ?\n new s.controller.LinearSpline(s.slidesGrid, c.slidesGrid) :\n new s.controller.LinearSpline(s.snapGrid, c.snapGrid);\n },\n setTranslate: function (translate, byController) {\n var controlled = s.params.control;\n var multiplier, controlledTranslate;\n function setControlledTranslate(c) {\n // this will create an Interpolate function based on the snapGrids\n // x is the Grid of the scrolled scroller and y will be the controlled scroller\n // it makes sense to create this only once and recall it for the interpolation\n // the function does a lot of value caching for performance\n translate = c.rtl && c.params.direction === 'horizontal' ? -s.translate : s.translate;\n if (s.params.controlBy === 'slide') {\n s.controller.getInterpolateFunction(c);\n // i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid\n // but it did not work out\n controlledTranslate = -s.controller.spline.interpolate(-translate);\n }\n \n if(!controlledTranslate || s.params.controlBy === 'container'){\n multiplier = (c.maxTranslate() - c.minTranslate()) / (s.maxTranslate() - s.minTranslate());\n controlledTranslate = (translate - s.minTranslate()) * multiplier + c.minTranslate();\n }\n \n if (s.params.controlInverse) {\n controlledTranslate = c.maxTranslate() - controlledTranslate;\n }\n c.updateProgress(controlledTranslate);\n c.setWrapperTranslate(controlledTranslate, false, s);\n c.updateActiveIndex();\n }\n if (s.isArray(controlled)) {\n for (var i = 0; i < controlled.length; i++) {\n if (controlled[i] !== byController && controlled[i] instanceof Swiper) {\n setControlledTranslate(controlled[i]);\n }\n }\n }\n else if (controlled instanceof Swiper && byController !== controlled) {\n \n setControlledTranslate(controlled);\n }\n },\n setTransition: function (duration, byController) {\n var controlled = s.params.control;\n var i;\n function setControlledTransition(c) {\n c.setWrapperTransition(duration, s);\n if (duration !== 0) {\n c.onTransitionStart();\n c.wrapper.transitionEnd(function(){\n if (!controlled) return;\n if (c.params.loop && s.params.controlBy === 'slide') {\n c.fixLoop();\n }\n c.onTransitionEnd();\n \n });\n }\n }\n if (s.isArray(controlled)) {\n for (i = 0; i < controlled.length; i++) {\n if (controlled[i] !== byController && controlled[i] instanceof Swiper) {\n setControlledTransition(controlled[i]);\n }\n }\n }\n else if (controlled instanceof Swiper && byController !== controlled) {\n setControlledTransition(controlled);\n }\n }\n };\n\n /*=========================\n Hash Navigation\n ===========================*/\n s.hashnav = {\n onHashCange: function (e, a) {\n var newHash = document.location.hash.replace('#', '');\n var activeSlideHash = s.slides.eq(s.activeIndex).attr('data-hash');\n if (newHash !== activeSlideHash) {\n s.slideTo(s.wrapper.children('.' + s.params.slideClass + '[data-hash=\"' + (newHash) + '\"]').index());\n }\n },\n attachEvents: function (detach) {\n var action = detach ? 'off' : 'on';\n $(window)[action]('hashchange', s.hashnav.onHashCange);\n },\n setHash: function () {\n if (!s.hashnav.initialized || !s.params.hashnav) return;\n if (s.params.replaceState && window.history && window.history.replaceState) {\n window.history.replaceState(null, null, ('#' + s.slides.eq(s.activeIndex).attr('data-hash') || ''));\n } else {\n var slide = s.slides.eq(s.activeIndex);\n var hash = slide.attr('data-hash') || slide.attr('data-history');\n document.location.hash = hash || '';\n }\n },\n init: function () {\n if (!s.params.hashnav || s.params.history) return;\n s.hashnav.initialized = true;\n var hash = document.location.hash.replace('#', '');\n if (!hash) return;\n var speed = 0;\n for (var i = 0, length = s.slides.length; i < length; i++) {\n var slide = s.slides.eq(i);\n var slideHash = slide.attr('data-hash') || slide.attr('data-history');\n if (slideHash === hash && !slide.hasClass(s.params.slideDuplicateClass)) {\n var index = slide.index();\n s.slideTo(index, speed, s.params.runCallbacksOnInit, true);\n }\n }\n if (s.params.hashnavWatchState) s.hashnav.attachEvents();\n },\n destroy: function () {\n if (s.params.hashnavWatchState) s.hashnav.attachEvents(true);\n }\n };\n\n /*=========================\n History Api with fallback to Hashnav\n ===========================*/\n s.history = {\n init: function () {\n if (!s.params.history) return;\n if (!window.history || !window.history.pushState) {\n s.params.history = false;\n s.params.hashnav = true;\n return;\n }\n s.history.initialized = true;\n this.paths = this.getPathValues();\n if (!this.paths.key && !this.paths.value) return;\n this.scrollToSlide(0, this.paths.value, s.params.runCallbacksOnInit);\n if (!s.params.replaceState) {\n window.addEventListener('popstate', this.setHistoryPopState);\n }\n },\n setHistoryPopState: function() {\n s.history.paths = s.history.getPathValues();\n s.history.scrollToSlide(s.params.speed, s.history.paths.value, false);\n },\n getPathValues: function() {\n var pathArray = window.location.pathname.slice(1).split('/');\n var total = pathArray.length;\n var key = pathArray[total - 2];\n var value = pathArray[total - 1];\n return { key: key, value: value };\n },\n setHistory: function (key, index) {\n if (!s.history.initialized || !s.params.history) return;\n var slide = s.slides.eq(index);\n var value = this.slugify(slide.attr('data-history'));\n if (!window.location.pathname.includes(key)) {\n value = key + '/' + value;\n }\n if (s.params.replaceState) {\n window.history.replaceState(null, null, value);\n } else {\n window.history.pushState(null, null, value);\n }\n },\n slugify: function(text) {\n return text.toString().toLowerCase()\n .replace(/\\s+/g, '-')\n .replace(/[^\\w\\-]+/g, '')\n .replace(/\\-\\-+/g, '-')\n .replace(/^-+/, '')\n .replace(/-+$/, '');\n },\n scrollToSlide: function(speed, value, runCallbacks) {\n if (value) {\n for (var i = 0, length = s.slides.length; i < length; i++) {\n var slide = s.slides.eq(i);\n var slideHistory = this.slugify(slide.attr('data-history'));\n if (slideHistory === value && !slide.hasClass(s.params.slideDuplicateClass)) {\n var index = slide.index();\n s.slideTo(index, speed, runCallbacks);\n }\n }\n } else {\n s.slideTo(0, speed, runCallbacks);\n }\n }\n };\n\n /*=========================\n Keyboard Control\n ===========================*/\n function handleKeyboard(e) {\n if (e.originalEvent) e = e.originalEvent; //jquery fix\n var kc = e.keyCode || e.charCode;\n // Directions locks\n if (!s.params.allowSwipeToNext && (s.isHorizontal() && kc === 39 || !s.isHorizontal() && kc === 40)) {\n return false;\n }\n if (!s.params.allowSwipeToPrev && (s.isHorizontal() && kc === 37 || !s.isHorizontal() && kc === 38)) {\n return false;\n }\n if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {\n return;\n }\n if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {\n return;\n }\n if (kc === 37 || kc === 39 || kc === 38 || kc === 40) {\n var inView = false;\n //Check that swiper should be inside of visible area of window\n if (s.container.parents('.' + s.params.slideClass).length > 0 && s.container.parents('.' + s.params.slideActiveClass).length === 0) {\n return;\n }\n var windowScroll = {\n left: window.pageXOffset,\n top: window.pageYOffset\n };\n var windowWidth = window.innerWidth;\n var windowHeight = window.innerHeight;\n var swiperOffset = s.container.offset();\n if (s.rtl) swiperOffset.left = swiperOffset.left - s.container[0].scrollLeft;\n var swiperCoord = [\n [swiperOffset.left, swiperOffset.top],\n [swiperOffset.left + s.width, swiperOffset.top],\n [swiperOffset.left, swiperOffset.top + s.height],\n [swiperOffset.left + s.width, swiperOffset.top + s.height]\n ];\n for (var i = 0; i < swiperCoord.length; i++) {\n var point = swiperCoord[i];\n if (\n point[0] >= windowScroll.left && point[0] <= windowScroll.left + windowWidth &&\n point[1] >= windowScroll.top && point[1] <= windowScroll.top + windowHeight\n ) {\n inView = true;\n }\n \n }\n if (!inView) return;\n }\n if (s.isHorizontal()) {\n if (kc === 37 || kc === 39) {\n if (e.preventDefault) e.preventDefault();\n else e.returnValue = false;\n }\n if ((kc === 39 && !s.rtl) || (kc === 37 && s.rtl)) s.slideNext();\n if ((kc === 37 && !s.rtl) || (kc === 39 && s.rtl)) s.slidePrev();\n }\n else {\n if (kc === 38 || kc === 40) {\n if (e.preventDefault) e.preventDefault();\n else e.returnValue = false;\n }\n if (kc === 40) s.slideNext();\n if (kc === 38) s.slidePrev();\n }\n }\n s.disableKeyboardControl = function () {\n s.params.keyboardControl = false;\n $(document).off('keydown', handleKeyboard);\n };\n s.enableKeyboardControl = function () {\n s.params.keyboardControl = true;\n $(document).on('keydown', handleKeyboard);\n };\n \n\n /*=========================\n Mousewheel Control\n ===========================*/\n s.mousewheel = {\n event: false,\n lastScrollTime: (new window.Date()).getTime()\n };\n if (s.params.mousewheelControl) {\n /**\n * The best combination if you prefer spinX + spinY normalization. It favors\n * the older DOMMouseScroll for Firefox, as FF does not include wheelDelta with\n * 'wheel' event, making spin speed determination impossible.\n */\n s.mousewheel.event = (navigator.userAgent.indexOf('firefox') > -1) ?\n 'DOMMouseScroll' :\n isEventSupported() ?\n 'wheel' : 'mousewheel';\n }\n \n function isEventSupported() {\n var eventName = 'onwheel';\n var isSupported = eventName in document;\n \n if (!isSupported) {\n var element = document.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof element[eventName] === 'function';\n }\n \n if (!isSupported &&\n document.implementation &&\n document.implementation.hasFeature &&\n // always returns true in newer browsers as per the standard.\n // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature\n document.implementation.hasFeature('', '') !== true ) {\n // This is the only way to test support for the `wheel` event in IE9+.\n isSupported = document.implementation.hasFeature('Events.wheel', '3.0');\n }\n \n return isSupported;\n }\n \n function handleMousewheel(e) {\n if (e.originalEvent) e = e.originalEvent; //jquery fix\n var delta = 0;\n var rtlFactor = s.rtl ? -1 : 1;\n \n var data = normalizeWheel( e );\n \n if (s.params.mousewheelForceToAxis) {\n if (s.isHorizontal()) {\n if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = data.pixelX * rtlFactor;\n else return;\n }\n else {\n if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = data.pixelY;\n else return;\n }\n }\n else {\n delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? - data.pixelX * rtlFactor : - data.pixelY;\n }\n \n if (delta === 0) return;\n \n if (s.params.mousewheelInvert) delta = -delta;\n \n if (!s.params.freeMode) {\n if ((new window.Date()).getTime() - s.mousewheel.lastScrollTime > 60) {\n if (delta < 0) {\n if ((!s.isEnd || s.params.loop) && !s.animating) {\n s.slideNext();\n s.emit('onScroll', s, e);\n }\n else if (s.params.mousewheelReleaseOnEdges) return true;\n }\n else {\n if ((!s.isBeginning || s.params.loop) && !s.animating) {\n s.slidePrev();\n s.emit('onScroll', s, e);\n }\n else if (s.params.mousewheelReleaseOnEdges) return true;\n }\n }\n s.mousewheel.lastScrollTime = (new window.Date()).getTime();\n \n }\n else {\n //Freemode or scrollContainer:\n var position = s.getWrapperTranslate() + delta * s.params.mousewheelSensitivity;\n var wasBeginning = s.isBeginning,\n wasEnd = s.isEnd;\n \n if (position >= s.minTranslate()) position = s.minTranslate();\n if (position <= s.maxTranslate()) position = s.maxTranslate();\n \n s.setWrapperTransition(0);\n s.setWrapperTranslate(position);\n s.updateProgress();\n s.updateActiveIndex();\n \n if (!wasBeginning && s.isBeginning || !wasEnd && s.isEnd) {\n s.updateClasses();\n }\n \n if (s.params.freeModeSticky) {\n clearTimeout(s.mousewheel.timeout);\n s.mousewheel.timeout = setTimeout(function () {\n s.slideReset();\n }, 300);\n }\n else {\n if (s.params.lazyLoading && s.lazy) {\n s.lazy.load();\n }\n }\n // Emit event\n s.emit('onScroll', s, e);\n \n // Stop autoplay\n if (s.params.autoplay && s.params.autoplayDisableOnInteraction) s.stopAutoplay();\n \n // Return page scroll on edge positions\n if (position === 0 || position === s.maxTranslate()) return;\n }\n \n if (e.preventDefault) e.preventDefault();\n else e.returnValue = false;\n return false;\n }\n s.disableMousewheelControl = function () {\n if (!s.mousewheel.event) return false;\n var target = s.container;\n if (s.params.mousewheelEventsTarged !== 'container') {\n target = $(s.params.mousewheelEventsTarged);\n }\n target.off(s.mousewheel.event, handleMousewheel);\n return true;\n };\n \n s.enableMousewheelControl = function () {\n if (!s.mousewheel.event) return false;\n var target = s.container;\n if (s.params.mousewheelEventsTarged !== 'container') {\n target = $(s.params.mousewheelEventsTarged);\n }\n target.on(s.mousewheel.event, handleMousewheel);\n return true;\n };\n \n /**\n * Mouse wheel (and 2-finger trackpad) support on the web sucks. It is\n * complicated, thus this doc is long and (hopefully) detailed enough to answer\n * your questions.\n *\n * If you need to react to the mouse wheel in a predictable way, this code is\n * like your bestest friend. * hugs *\n *\n * As of today, there are 4 DOM event types you can listen to:\n *\n * 'wheel' -- Chrome(31+), FF(17+), IE(9+)\n * 'mousewheel' -- Chrome, IE(6+), Opera, Safari\n * 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother!\n * 'DOMMouseScroll' -- FF(0.9.7+) since 2003\n *\n * So what to do? The is the best:\n *\n * normalizeWheel.getEventType();\n *\n * In your event callback, use this code to get sane interpretation of the\n * deltas. This code will return an object with properties:\n *\n * spinX -- normalized spin speed (use for zoom) - x plane\n * spinY -- \" - y plane\n * pixelX -- normalized distance (to pixels) - x plane\n * pixelY -- \" - y plane\n *\n * Wheel values are provided by the browser assuming you are using the wheel to\n * scroll a web page by a number of lines or pixels (or pages). Values can vary\n * significantly on different platforms and browsers, forgetting that you can\n * scroll at different speeds. Some devices (like trackpads) emit more events\n * at smaller increments with fine granularity, and some emit massive jumps with\n * linear speed or acceleration.\n *\n * This code does its best to normalize the deltas for you:\n *\n * - spin is trying to normalize how far the wheel was spun (or trackpad\n * dragged). This is super useful for zoom support where you want to\n * throw away the chunky scroll steps on the PC and make those equal to\n * the slow and smooth tiny steps on the Mac. Key data: This code tries to\n * resolve a single slow step on a wheel to 1.\n *\n * - pixel is normalizing the desired scroll delta in pixel units. You'll\n * get the crazy differences between browsers, but at least it'll be in\n * pixels!\n *\n * - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This\n * should translate to positive value zooming IN, negative zooming OUT.\n * This matches the newer 'wheel' event.\n *\n * Why are there spinX, spinY (or pixels)?\n *\n * - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn\n * with a mouse. It results in side-scrolling in the browser by default.\n *\n * - spinY is what you expect -- it's the classic axis of a mouse wheel.\n *\n * - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and\n * probably is by browsers in conjunction with fancy 3D controllers .. but\n * you know.\n *\n * Implementation info:\n *\n * Examples of 'wheel' event if you scroll slowly (down) by one step with an\n * average mouse:\n *\n * OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120)\n * OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12)\n * OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A)\n * Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120)\n * Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120)\n *\n * On the trackpad:\n *\n * OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6)\n * OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A)\n *\n * On other/older browsers.. it's more complicated as there can be multiple and\n * also missing delta values.\n *\n * The 'wheel' event is more standard:\n *\n * http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents\n *\n * The basics is that it includes a unit, deltaMode (pixels, lines, pages), and\n * deltaX, deltaY and deltaZ. Some browsers provide other values to maintain\n * backward compatibility with older events. Those other values help us\n * better normalize spin speed. Example of what the browsers provide:\n *\n * | event.wheelDelta | event.detail\n * ------------------+------------------+--------------\n * Safari v5/OS X | -120 | 0\n * Safari v5/Win7 | -120 | 0\n * Chrome v17/OS X | -120 | 0\n * Chrome v17/Win7 | -120 | 0\n * IE9/Win7 | -120 | undefined\n * Firefox v4/OS X | undefined | 1\n * Firefox v4/Win7 | undefined | 3\n *\n */\n function normalizeWheel( /*object*/ event ) /*object*/ {\n // Reasonable defaults\n var PIXEL_STEP = 10;\n var LINE_HEIGHT = 40;\n var PAGE_HEIGHT = 800;\n \n var sX = 0, sY = 0, // spinX, spinY\n pX = 0, pY = 0; // pixelX, pixelY\n \n // Legacy\n if( 'detail' in event ) {\n sY = event.detail;\n }\n if( 'wheelDelta' in event ) {\n sY = -event.wheelDelta / 120;\n }\n if( 'wheelDeltaY' in event ) {\n sY = -event.wheelDeltaY / 120;\n }\n if( 'wheelDeltaX' in event ) {\n sX = -event.wheelDeltaX / 120;\n }\n \n // side scrolling on FF with DOMMouseScroll\n if( 'axis' in event && event.axis === event.HORIZONTAL_AXIS ) {\n sX = sY;\n sY = 0;\n }\n \n pX = sX * PIXEL_STEP;\n pY = sY * PIXEL_STEP;\n \n if( 'deltaY' in event ) {\n pY = event.deltaY;\n }\n if( 'deltaX' in event ) {\n pX = event.deltaX;\n }\n \n if( (pX || pY) && event.deltaMode ) {\n if( event.deltaMode === 1 ) { // delta in LINE units\n pX *= LINE_HEIGHT;\n pY *= LINE_HEIGHT;\n } else { // delta in PAGE units\n pX *= PAGE_HEIGHT;\n pY *= PAGE_HEIGHT;\n }\n }\n \n // Fall-back if spin cannot be determined\n if( pX && !sX ) {\n sX = (pX < 1) ? -1 : 1;\n }\n if( pY && !sY ) {\n sY = (pY < 1) ? -1 : 1;\n }\n \n return {\n spinX: sX,\n spinY: sY,\n pixelX: pX,\n pixelY: pY\n };\n }\n\n /*=========================\n Parallax\n ===========================*/\n function setParallaxTransform(el, progress) {\n el = $(el);\n var p, pX, pY;\n var rtlFactor = s.rtl ? -1 : 1;\n \n p = el.attr('data-swiper-parallax') || '0';\n pX = el.attr('data-swiper-parallax-x');\n pY = el.attr('data-swiper-parallax-y');\n if (pX || pY) {\n pX = pX || '0';\n pY = pY || '0';\n }\n else {\n if (s.isHorizontal()) {\n pX = p;\n pY = '0';\n }\n else {\n pY = p;\n pX = '0';\n }\n }\n \n if ((pX).indexOf('%') >= 0) {\n pX = parseInt(pX, 10) * progress * rtlFactor + '%';\n }\n else {\n pX = pX * progress * rtlFactor + 'px' ;\n }\n if ((pY).indexOf('%') >= 0) {\n pY = parseInt(pY, 10) * progress + '%';\n }\n else {\n pY = pY * progress + 'px' ;\n }\n \n el.transform('translate3d(' + pX + ', ' + pY + ',0px)');\n }\n s.parallax = {\n setTranslate: function () {\n s.container.children('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function(){\n setParallaxTransform(this, s.progress);\n \n });\n s.slides.each(function () {\n var slide = $(this);\n slide.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function () {\n var progress = Math.min(Math.max(slide[0].progress, -1), 1);\n setParallaxTransform(this, progress);\n });\n });\n },\n setTransition: function (duration) {\n if (typeof duration === 'undefined') duration = s.params.speed;\n s.container.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function(){\n var el = $(this);\n var parallaxDuration = parseInt(el.attr('data-swiper-parallax-duration'), 10) || duration;\n if (duration === 0) parallaxDuration = 0;\n el.transition(parallaxDuration);\n });\n }\n };\n \n\n /*=========================\n Zoom\n ===========================*/\n s.zoom = {\n // \"Global\" Props\n scale: 1,\n currentScale: 1,\n isScaling: false,\n gesture: {\n slide: undefined,\n slideWidth: undefined,\n slideHeight: undefined,\n image: undefined,\n imageWrap: undefined,\n zoomMax: s.params.zoomMax\n },\n image: {\n isTouched: undefined,\n isMoved: undefined,\n currentX: undefined,\n currentY: undefined,\n minX: undefined,\n minY: undefined,\n maxX: undefined,\n maxY: undefined,\n width: undefined,\n height: undefined,\n startX: undefined,\n startY: undefined,\n touchesStart: {},\n touchesCurrent: {}\n },\n velocity: {\n x: undefined,\n y: undefined,\n prevPositionX: undefined,\n prevPositionY: undefined,\n prevTime: undefined\n },\n // Calc Scale From Multi-touches\n getDistanceBetweenTouches: function (e) {\n if (e.targetTouches.length < 2) return 1;\n var x1 = e.targetTouches[0].pageX,\n y1 = e.targetTouches[0].pageY,\n x2 = e.targetTouches[1].pageX,\n y2 = e.targetTouches[1].pageY;\n var distance = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n return distance;\n },\n // Events\n onGestureStart: function (e) {\n var z = s.zoom;\n if (!s.support.gestures) {\n if (e.type !== 'touchstart' || e.type === 'touchstart' && e.targetTouches.length < 2) {\n return;\n }\n z.gesture.scaleStart = z.getDistanceBetweenTouches(e);\n }\n if (!z.gesture.slide || !z.gesture.slide.length) {\n z.gesture.slide = $(this);\n if (z.gesture.slide.length === 0) z.gesture.slide = s.slides.eq(s.activeIndex);\n z.gesture.image = z.gesture.slide.find('img, svg, canvas');\n z.gesture.imageWrap = z.gesture.image.parent('.' + s.params.zoomContainerClass);\n z.gesture.zoomMax = z.gesture.imageWrap.attr('data-swiper-zoom') || s.params.zoomMax ;\n if (z.gesture.imageWrap.length === 0) {\n z.gesture.image = undefined;\n return;\n }\n }\n z.gesture.image.transition(0);\n z.isScaling = true;\n },\n onGestureChange: function (e) {\n var z = s.zoom;\n if (!s.support.gestures) {\n if (e.type !== 'touchmove' || e.type === 'touchmove' && e.targetTouches.length < 2) {\n return;\n }\n z.gesture.scaleMove = z.getDistanceBetweenTouches(e);\n }\n if (!z.gesture.image || z.gesture.image.length === 0) return;\n if (s.support.gestures) {\n z.scale = e.scale * z.currentScale;\n }\n else {\n z.scale = (z.gesture.scaleMove / z.gesture.scaleStart) * z.currentScale;\n }\n if (z.scale > z.gesture.zoomMax) {\n z.scale = z.gesture.zoomMax - 1 + Math.pow((z.scale - z.gesture.zoomMax + 1), 0.5);\n }\n if (z.scale < s.params.zoomMin) {\n z.scale = s.params.zoomMin + 1 - Math.pow((s.params.zoomMin - z.scale + 1), 0.5);\n }\n z.gesture.image.transform('translate3d(0,0,0) scale(' + z.scale + ')');\n },\n onGestureEnd: function (e) {\n var z = s.zoom;\n if (!s.support.gestures) {\n if (e.type !== 'touchend' || e.type === 'touchend' && e.changedTouches.length < 2) {\n return;\n }\n }\n if (!z.gesture.image || z.gesture.image.length === 0) return;\n z.scale = Math.max(Math.min(z.scale, z.gesture.zoomMax), s.params.zoomMin);\n z.gesture.image.transition(s.params.speed).transform('translate3d(0,0,0) scale(' + z.scale + ')');\n z.currentScale = z.scale;\n z.isScaling = false;\n if (z.scale === 1) z.gesture.slide = undefined;\n },\n onTouchStart: function (s, e) {\n var z = s.zoom;\n if (!z.gesture.image || z.gesture.image.length === 0) return;\n if (z.image.isTouched) return;\n if (s.device.os === 'android') e.preventDefault();\n z.image.isTouched = true;\n z.image.touchesStart.x = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;\n z.image.touchesStart.y = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;\n },\n onTouchMove: function (e) {\n var z = s.zoom;\n if (!z.gesture.image || z.gesture.image.length === 0) return;\n s.allowClick = false;\n if (!z.image.isTouched || !z.gesture.slide) return;\n \n if (!z.image.isMoved) {\n z.image.width = z.gesture.image[0].offsetWidth;\n z.image.height = z.gesture.image[0].offsetHeight;\n z.image.startX = s.getTranslate(z.gesture.imageWrap[0], 'x') || 0;\n z.image.startY = s.getTranslate(z.gesture.imageWrap[0], 'y') || 0;\n z.gesture.slideWidth = z.gesture.slide[0].offsetWidth;\n z.gesture.slideHeight = z.gesture.slide[0].offsetHeight;\n z.gesture.imageWrap.transition(0);\n }\n // Define if we need image drag\n var scaledWidth = z.image.width * z.scale;\n var scaledHeight = z.image.height * z.scale;\n \n if (scaledWidth < z.gesture.slideWidth && scaledHeight < z.gesture.slideHeight) return;\n \n z.image.minX = Math.min((z.gesture.slideWidth / 2 - scaledWidth / 2), 0);\n z.image.maxX = -z.image.minX;\n z.image.minY = Math.min((z.gesture.slideHeight / 2 - scaledHeight / 2), 0);\n z.image.maxY = -z.image.minY;\n \n z.image.touchesCurrent.x = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;\n z.image.touchesCurrent.y = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;\n \n if (!z.image.isMoved && !z.isScaling) {\n if (s.isHorizontal() &&\n (Math.floor(z.image.minX) === Math.floor(z.image.startX) && z.image.touchesCurrent.x < z.image.touchesStart.x) ||\n (Math.floor(z.image.maxX) === Math.floor(z.image.startX) && z.image.touchesCurrent.x > z.image.touchesStart.x)\n ) {\n z.image.isTouched = false;\n return;\n }\n else if (!s.isHorizontal() &&\n (Math.floor(z.image.minY) === Math.floor(z.image.startY) && z.image.touchesCurrent.y < z.image.touchesStart.y) ||\n (Math.floor(z.image.maxY) === Math.floor(z.image.startY) && z.image.touchesCurrent.y > z.image.touchesStart.y)\n ) {\n z.image.isTouched = false;\n return;\n }\n }\n e.preventDefault();\n e.stopPropagation();\n \n z.image.isMoved = true;\n z.image.currentX = z.image.touchesCurrent.x - z.image.touchesStart.x + z.image.startX;\n z.image.currentY = z.image.touchesCurrent.y - z.image.touchesStart.y + z.image.startY;\n \n if (z.image.currentX < z.image.minX) {\n z.image.currentX = z.image.minX + 1 - Math.pow((z.image.minX - z.image.currentX + 1), 0.8);\n }\n if (z.image.currentX > z.image.maxX) {\n z.image.currentX = z.image.maxX - 1 + Math.pow((z.image.currentX - z.image.maxX + 1), 0.8);\n }\n \n if (z.image.currentY < z.image.minY) {\n z.image.currentY = z.image.minY + 1 - Math.pow((z.image.minY - z.image.currentY + 1), 0.8);\n }\n if (z.image.currentY > z.image.maxY) {\n z.image.currentY = z.image.maxY - 1 + Math.pow((z.image.currentY - z.image.maxY + 1), 0.8);\n }\n \n //Velocity\n if (!z.velocity.prevPositionX) z.velocity.prevPositionX = z.image.touchesCurrent.x;\n if (!z.velocity.prevPositionY) z.velocity.prevPositionY = z.image.touchesCurrent.y;\n if (!z.velocity.prevTime) z.velocity.prevTime = Date.now();\n z.velocity.x = (z.image.touchesCurrent.x - z.velocity.prevPositionX) / (Date.now() - z.velocity.prevTime) / 2;\n z.velocity.y = (z.image.touchesCurrent.y - z.velocity.prevPositionY) / (Date.now() - z.velocity.prevTime) / 2;\n if (Math.abs(z.image.touchesCurrent.x - z.velocity.prevPositionX) < 2) z.velocity.x = 0;\n if (Math.abs(z.image.touchesCurrent.y - z.velocity.prevPositionY) < 2) z.velocity.y = 0;\n z.velocity.prevPositionX = z.image.touchesCurrent.x;\n z.velocity.prevPositionY = z.image.touchesCurrent.y;\n z.velocity.prevTime = Date.now();\n \n z.gesture.imageWrap.transform('translate3d(' + z.image.currentX + 'px, ' + z.image.currentY + 'px,0)');\n },\n onTouchEnd: function (s, e) {\n var z = s.zoom;\n if (!z.gesture.image || z.gesture.image.length === 0) return;\n if (!z.image.isTouched || !z.image.isMoved) {\n z.image.isTouched = false;\n z.image.isMoved = false;\n return;\n }\n z.image.isTouched = false;\n z.image.isMoved = false;\n var momentumDurationX = 300;\n var momentumDurationY = 300;\n var momentumDistanceX = z.velocity.x * momentumDurationX;\n var newPositionX = z.image.currentX + momentumDistanceX;\n var momentumDistanceY = z.velocity.y * momentumDurationY;\n var newPositionY = z.image.currentY + momentumDistanceY;\n \n //Fix duration\n if (z.velocity.x !== 0) momentumDurationX = Math.abs((newPositionX - z.image.currentX) / z.velocity.x);\n if (z.velocity.y !== 0) momentumDurationY = Math.abs((newPositionY - z.image.currentY) / z.velocity.y);\n var momentumDuration = Math.max(momentumDurationX, momentumDurationY);\n \n z.image.currentX = newPositionX;\n z.image.currentY = newPositionY;\n \n // Define if we need image drag\n var scaledWidth = z.image.width * z.scale;\n var scaledHeight = z.image.height * z.scale;\n z.image.minX = Math.min((z.gesture.slideWidth / 2 - scaledWidth / 2), 0);\n z.image.maxX = -z.image.minX;\n z.image.minY = Math.min((z.gesture.slideHeight / 2 - scaledHeight / 2), 0);\n z.image.maxY = -z.image.minY;\n z.image.currentX = Math.max(Math.min(z.image.currentX, z.image.maxX), z.image.minX);\n z.image.currentY = Math.max(Math.min(z.image.currentY, z.image.maxY), z.image.minY);\n \n z.gesture.imageWrap.transition(momentumDuration).transform('translate3d(' + z.image.currentX + 'px, ' + z.image.currentY + 'px,0)');\n },\n onTransitionEnd: function (s) {\n var z = s.zoom;\n if (z.gesture.slide && s.previousIndex !== s.activeIndex) {\n z.gesture.image.transform('translate3d(0,0,0) scale(1)');\n z.gesture.imageWrap.transform('translate3d(0,0,0)');\n z.gesture.slide = z.gesture.image = z.gesture.imageWrap = undefined;\n z.scale = z.currentScale = 1;\n }\n },\n // Toggle Zoom\n toggleZoom: function (s, e) {\n var z = s.zoom;\n if (!z.gesture.slide) {\n z.gesture.slide = s.clickedSlide ? $(s.clickedSlide) : s.slides.eq(s.activeIndex);\n z.gesture.image = z.gesture.slide.find('img, svg, canvas');\n z.gesture.imageWrap = z.gesture.image.parent('.' + s.params.zoomContainerClass);\n }\n if (!z.gesture.image || z.gesture.image.length === 0) return;\n \n var touchX, touchY, offsetX, offsetY, diffX, diffY, translateX, translateY, imageWidth, imageHeight, scaledWidth, scaledHeight, translateMinX, translateMinY, translateMaxX, translateMaxY, slideWidth, slideHeight;\n \n if (typeof z.image.touchesStart.x === 'undefined' && e) {\n touchX = e.type === 'touchend' ? e.changedTouches[0].pageX : e.pageX;\n touchY = e.type === 'touchend' ? e.changedTouches[0].pageY : e.pageY;\n }\n else {\n touchX = z.image.touchesStart.x;\n touchY = z.image.touchesStart.y;\n }\n \n if (z.scale && z.scale !== 1) {\n // Zoom Out\n z.scale = z.currentScale = 1;\n z.gesture.imageWrap.transition(300).transform('translate3d(0,0,0)');\n z.gesture.image.transition(300).transform('translate3d(0,0,0) scale(1)');\n z.gesture.slide = undefined;\n }\n else {\n // Zoom In\n z.scale = z.currentScale = z.gesture.imageWrap.attr('data-swiper-zoom') || s.params.zoomMax;\n if (e) {\n slideWidth = z.gesture.slide[0].offsetWidth;\n slideHeight = z.gesture.slide[0].offsetHeight;\n offsetX = z.gesture.slide.offset().left;\n offsetY = z.gesture.slide.offset().top;\n diffX = offsetX + slideWidth/2 - touchX;\n diffY = offsetY + slideHeight/2 - touchY;\n \n imageWidth = z.gesture.image[0].offsetWidth;\n imageHeight = z.gesture.image[0].offsetHeight;\n scaledWidth = imageWidth * z.scale;\n scaledHeight = imageHeight * z.scale;\n \n translateMinX = Math.min((slideWidth / 2 - scaledWidth / 2), 0);\n translateMinY = Math.min((slideHeight / 2 - scaledHeight / 2), 0);\n translateMaxX = -translateMinX;\n translateMaxY = -translateMinY;\n \n translateX = diffX * z.scale;\n translateY = diffY * z.scale;\n \n if (translateX < translateMinX) {\n translateX = translateMinX;\n }\n if (translateX > translateMaxX) {\n translateX = translateMaxX;\n }\n \n if (translateY < translateMinY) {\n translateY = translateMinY;\n }\n if (translateY > translateMaxY) {\n translateY = translateMaxY;\n }\n }\n else {\n translateX = 0;\n translateY = 0;\n }\n z.gesture.imageWrap.transition(300).transform('translate3d(' + translateX + 'px, ' + translateY + 'px,0)');\n z.gesture.image.transition(300).transform('translate3d(0,0,0) scale(' + z.scale + ')');\n }\n },\n // Attach/Detach Events\n attachEvents: function (detach) {\n var action = detach ? 'off' : 'on';\n \n if (s.params.zoom) {\n var target = s.slides;\n var passiveListener = s.touchEvents.start === 'touchstart' && s.support.passiveListener && s.params.passiveListeners ? {passive: true, capture: false} : false;\n // Scale image\n if (s.support.gestures) {\n s.slides[action]('gesturestart', s.zoom.onGestureStart, passiveListener);\n s.slides[action]('gesturechange', s.zoom.onGestureChange, passiveListener);\n s.slides[action]('gestureend', s.zoom.onGestureEnd, passiveListener);\n }\n else if (s.touchEvents.start === 'touchstart') {\n s.slides[action](s.touchEvents.start, s.zoom.onGestureStart, passiveListener);\n s.slides[action](s.touchEvents.move, s.zoom.onGestureChange, passiveListener);\n s.slides[action](s.touchEvents.end, s.zoom.onGestureEnd, passiveListener);\n }\n \n // Move image\n s[action]('touchStart', s.zoom.onTouchStart);\n s.slides.each(function (index, slide){\n if ($(slide).find('.' + s.params.zoomContainerClass).length > 0) {\n $(slide)[action](s.touchEvents.move, s.zoom.onTouchMove);\n }\n });\n s[action]('touchEnd', s.zoom.onTouchEnd);\n \n // Scale Out\n s[action]('transitionEnd', s.zoom.onTransitionEnd);\n if (s.params.zoomToggle) {\n s.on('doubleTap', s.zoom.toggleZoom);\n }\n }\n },\n init: function () {\n s.zoom.attachEvents();\n },\n destroy: function () {\n s.zoom.attachEvents(true);\n }\n };\n\n /*=========================\n Plugins API. Collect all and init all plugins\n ===========================*/\n s._plugins = [];\n for (var plugin in s.plugins) {\n var p = s.plugins[plugin](s, s.params[plugin]);\n if (p) s._plugins.push(p);\n }\n // Method to call all plugins event/method\n s.callPlugins = function (eventName) {\n for (var i = 0; i < s._plugins.length; i++) {\n if (eventName in s._plugins[i]) {\n s._plugins[i][eventName](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);\n }\n }\n };\n\n /*=========================\n Events/Callbacks/Plugins Emitter\n ===========================*/\n function normalizeEventName (eventName) {\n if (eventName.indexOf('on') !== 0) {\n if (eventName[0] !== eventName[0].toUpperCase()) {\n eventName = 'on' + eventName[0].toUpperCase() + eventName.substring(1);\n }\n else {\n eventName = 'on' + eventName;\n }\n }\n return eventName;\n }\n s.emitterEventListeners = {\n \n };\n s.emit = function (eventName) {\n // Trigger callbacks\n if (s.params[eventName]) {\n s.params[eventName](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);\n }\n var i;\n // Trigger events\n if (s.emitterEventListeners[eventName]) {\n for (i = 0; i < s.emitterEventListeners[eventName].length; i++) {\n s.emitterEventListeners[eventName][i](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);\n }\n }\n // Trigger plugins\n if (s.callPlugins) s.callPlugins(eventName, arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);\n };\n s.on = function (eventName, handler) {\n eventName = normalizeEventName(eventName);\n if (!s.emitterEventListeners[eventName]) s.emitterEventListeners[eventName] = [];\n s.emitterEventListeners[eventName].push(handler);\n return s;\n };\n s.off = function (eventName, handler) {\n var i;\n eventName = normalizeEventName(eventName);\n if (typeof handler === 'undefined') {\n // Remove all handlers for such event\n s.emitterEventListeners[eventName] = [];\n return s;\n }\n if (!s.emitterEventListeners[eventName] || s.emitterEventListeners[eventName].length === 0) return;\n for (i = 0; i < s.emitterEventListeners[eventName].length; i++) {\n if(s.emitterEventListeners[eventName][i] === handler) s.emitterEventListeners[eventName].splice(i, 1);\n }\n return s;\n };\n s.once = function (eventName, handler) {\n eventName = normalizeEventName(eventName);\n var _handler = function () {\n handler(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);\n s.off(eventName, _handler);\n };\n s.on(eventName, _handler);\n return s;\n };\n\n // Accessibility tools\n s.a11y = {\n makeFocusable: function ($el) {\n $el.attr('tabIndex', '0');\n return $el;\n },\n addRole: function ($el, role) {\n $el.attr('role', role);\n return $el;\n },\n \n addLabel: function ($el, label) {\n $el.attr('aria-label', label);\n return $el;\n },\n \n disable: function ($el) {\n $el.attr('aria-disabled', true);\n return $el;\n },\n \n enable: function ($el) {\n $el.attr('aria-disabled', false);\n return $el;\n },\n \n onEnterKey: function (event) {\n if (event.keyCode !== 13) return;\n if ($(event.target).is(s.params.nextButton)) {\n s.onClickNext(event);\n if (s.isEnd) {\n s.a11y.notify(s.params.lastSlideMessage);\n }\n else {\n s.a11y.notify(s.params.nextSlideMessage);\n }\n }\n else if ($(event.target).is(s.params.prevButton)) {\n s.onClickPrev(event);\n if (s.isBeginning) {\n s.a11y.notify(s.params.firstSlideMessage);\n }\n else {\n s.a11y.notify(s.params.prevSlideMessage);\n }\n }\n if ($(event.target).is('.' + s.params.bulletClass)) {\n $(event.target)[0].click();\n }\n },\n \n liveRegion: $('<span class=\"' + s.params.notificationClass + '\" aria-live=\"assertive\" aria-atomic=\"true\"></span>'),\n \n notify: function (message) {\n var notification = s.a11y.liveRegion;\n if (notification.length === 0) return;\n notification.html('');\n notification.html(message);\n },\n init: function () {\n // Setup accessibility\n if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {\n s.a11y.makeFocusable(s.nextButton);\n s.a11y.addRole(s.nextButton, 'button');\n s.a11y.addLabel(s.nextButton, s.params.nextSlideMessage);\n }\n if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {\n s.a11y.makeFocusable(s.prevButton);\n s.a11y.addRole(s.prevButton, 'button');\n s.a11y.addLabel(s.prevButton, s.params.prevSlideMessage);\n }\n \n $(s.container).append(s.a11y.liveRegion);\n },\n initPagination: function () {\n if (s.params.pagination && s.params.paginationClickable && s.bullets && s.bullets.length) {\n s.bullets.each(function () {\n var bullet = $(this);\n s.a11y.makeFocusable(bullet);\n s.a11y.addRole(bullet, 'button');\n s.a11y.addLabel(bullet, s.params.paginationBulletMessage.replace(/{{index}}/, bullet.index() + 1));\n });\n }\n },\n destroy: function () {\n if (s.a11y.liveRegion && s.a11y.liveRegion.length > 0) s.a11y.liveRegion.remove();\n }\n };\n \n\n /*=========================\n Init/Destroy\n ===========================*/\n s.init = function () {\n if (s.params.loop) s.createLoop();\n s.updateContainerSize();\n s.updateSlidesSize();\n s.updatePagination();\n if (s.params.scrollbar && s.scrollbar) {\n s.scrollbar.set();\n if (s.params.scrollbarDraggable) {\n s.scrollbar.enableDraggable();\n }\n }\n if (s.params.effect !== 'slide' && s.effects[s.params.effect]) {\n if (!s.params.loop) s.updateProgress();\n s.effects[s.params.effect].setTranslate();\n }\n if (s.params.loop) {\n s.slideTo(s.params.initialSlide + s.loopedSlides, 0, s.params.runCallbacksOnInit);\n }\n else {\n s.slideTo(s.params.initialSlide, 0, s.params.runCallbacksOnInit);\n if (s.params.initialSlide === 0) {\n if (s.parallax && s.params.parallax) s.parallax.setTranslate();\n if (s.lazy && s.params.lazyLoading) {\n s.lazy.load();\n s.lazy.initialImageLoaded = true;\n }\n }\n }\n s.attachEvents();\n if (s.params.observer && s.support.observer) {\n s.initObservers();\n }\n if (s.params.preloadImages && !s.params.lazyLoading) {\n s.preloadImages();\n }\n if (s.params.zoom && s.zoom) {\n s.zoom.init();\n }\n if (s.params.autoplay) {\n s.startAutoplay();\n }\n if (s.params.keyboardControl) {\n if (s.enableKeyboardControl) s.enableKeyboardControl();\n }\n if (s.params.mousewheelControl) {\n if (s.enableMousewheelControl) s.enableMousewheelControl();\n }\n // Deprecated hashnavReplaceState changed to replaceState for use in hashnav and history\n if (s.params.hashnavReplaceState) {\n s.params.replaceState = s.params.hashnavReplaceState;\n }\n if (s.params.history) {\n if (s.history) s.history.init();\n }\n if (s.params.hashnav) {\n if (s.hashnav) s.hashnav.init();\n }\n if (s.params.a11y && s.a11y) s.a11y.init();\n s.emit('onInit', s);\n };\n \n // Cleanup dynamic styles\n s.cleanupStyles = function () {\n // Container\n s.container.removeClass(s.classNames.join(' ')).removeAttr('style');\n \n // Wrapper\n s.wrapper.removeAttr('style');\n \n // Slides\n if (s.slides && s.slides.length) {\n s.slides\n .removeClass([\n s.params.slideVisibleClass,\n s.params.slideActiveClass,\n s.params.slideNextClass,\n s.params.slidePrevClass\n ].join(' '))\n .removeAttr('style')\n .removeAttr('data-swiper-column')\n .removeAttr('data-swiper-row');\n }\n \n // Pagination/Bullets\n if (s.paginationContainer && s.paginationContainer.length) {\n s.paginationContainer.removeClass(s.params.paginationHiddenClass);\n }\n if (s.bullets && s.bullets.length) {\n s.bullets.removeClass(s.params.bulletActiveClass);\n }\n \n // Buttons\n if (s.params.prevButton) $(s.params.prevButton).removeClass(s.params.buttonDisabledClass);\n if (s.params.nextButton) $(s.params.nextButton).removeClass(s.params.buttonDisabledClass);\n \n // Scrollbar\n if (s.params.scrollbar && s.scrollbar) {\n if (s.scrollbar.track && s.scrollbar.track.length) s.scrollbar.track.removeAttr('style');\n if (s.scrollbar.drag && s.scrollbar.drag.length) s.scrollbar.drag.removeAttr('style');\n }\n };\n \n // Destroy\n s.destroy = function (deleteInstance, cleanupStyles) {\n // Detach evebts\n s.detachEvents();\n // Stop autoplay\n s.stopAutoplay();\n // Disable draggable\n if (s.params.scrollbar && s.scrollbar) {\n if (s.params.scrollbarDraggable) {\n s.scrollbar.disableDraggable();\n }\n }\n // Destroy loop\n if (s.params.loop) {\n s.destroyLoop();\n }\n // Cleanup styles\n if (cleanupStyles) {\n s.cleanupStyles();\n }\n // Disconnect observer\n s.disconnectObservers();\n \n // Destroy zoom\n if (s.params.zoom && s.zoom) {\n s.zoom.destroy();\n }\n // Disable keyboard/mousewheel\n if (s.params.keyboardControl) {\n if (s.disableKeyboardControl) s.disableKeyboardControl();\n }\n if (s.params.mousewheelControl) {\n if (s.disableMousewheelControl) s.disableMousewheelControl();\n }\n // Disable a11y\n if (s.params.a11y && s.a11y) s.a11y.destroy();\n // Delete history popstate\n if (s.params.history && !s.params.replaceState) {\n window.removeEventListener('popstate', s.history.setHistoryPopState);\n }\n if (s.params.hashnav && s.hashnav) {\n s.hashnav.destroy();\n }\n // Destroy callback\n s.emit('onDestroy');\n // Delete instance\n if (deleteInstance !== false) s = null;\n };\n \n s.init();\n \n\n \n // Return swiper instance\n return s;\n };\n \n\n /*==================================================\n Prototype\n ====================================================*/\n Swiper.prototype = {\n isSafari: (function () {\n var ua = navigator.userAgent.toLowerCase();\n return (ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0);\n })(),\n isUiWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent),\n isArray: function (arr) {\n return Object.prototype.toString.apply(arr) === '[object Array]';\n },\n /*==================================================\n Browser\n ====================================================*/\n browser: {\n ie: window.navigator.pointerEnabled || window.navigator.msPointerEnabled,\n ieTouch: (window.navigator.msPointerEnabled && window.navigator.msMaxTouchPoints > 1) || (window.navigator.pointerEnabled && window.navigator.maxTouchPoints > 1),\n lteIE9: (function() {\n // create temporary DIV\n var div = document.createElement('div');\n // add content to tmp DIV which is wrapped into the IE HTML conditional statement\n div.innerHTML = '<!--[if lte IE 9]><i></i><![endif]-->';\n // return true / false value based on what will browser render\n return div.getElementsByTagName('i').length === 1;\n })()\n },\n /*==================================================\n Devices\n ====================================================*/\n device: (function () {\n var ua = navigator.userAgent;\n var android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/);\n var ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n var ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n var iphone = !ipad && ua.match(/(iPhone\\sOS)\\s([\\d_]+)/);\n return {\n ios: ipad || iphone || ipod,\n android: android\n };\n })(),\n /*==================================================\n Feature Detection\n ====================================================*/\n support: {\n touch : (window.Modernizr && Modernizr.touch === true) || (function () {\n return !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch);\n })(),\n \n transforms3d : (window.Modernizr && Modernizr.csstransforms3d === true) || (function () {\n var div = document.createElement('div').style;\n return ('webkitPerspective' in div || 'MozPerspective' in div || 'OPerspective' in div || 'MsPerspective' in div || 'perspective' in div);\n })(),\n \n flexbox: (function () {\n var div = document.createElement('div').style;\n var styles = ('alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient').split(' ');\n for (var i = 0; i < styles.length; i++) {\n if (styles[i] in div) return true;\n }\n })(),\n \n observer: (function () {\n return ('MutationObserver' in window || 'WebkitMutationObserver' in window);\n })(),\n \n passiveListener: (function () {\n var supportsPassive = false;\n try {\n var opts = Object.defineProperty({}, 'passive', {\n get: function() {\n supportsPassive = true;\n }\n });\n window.addEventListener('testPassiveListener', null, opts);\n } catch (e) {}\n return supportsPassive;\n })(),\n \n gestures: (function () {\n return 'ongesturestart' in window;\n })()\n },\n /*==================================================\n Plugins\n ====================================================*/\n plugins: {}\n };\n \n\n /*===========================\n Get Dom libraries\n ===========================*/\n var swiperDomPlugins = ['jQuery', 'Zepto', 'Dom7'];\n for (var i = 0; i < swiperDomPlugins.length; i++) {\n \tif (window[swiperDomPlugins[i]]) {\n \t\taddLibraryPlugin(window[swiperDomPlugins[i]]);\n \t}\n }\n // Required DOM Plugins\n var domLib;\n if (typeof Dom7 === 'undefined') {\n \tdomLib = window.Dom7 || window.Zepto || window.jQuery;\n }\n else {\n \tdomLib = Dom7;\n }\n\n /*===========================\n Add .swiper plugin from Dom libraries\n ===========================*/\n function addLibraryPlugin(lib) {\n lib.fn.swiper = function (params) {\n var firstInstance;\n lib(this).each(function () {\n var s = new Swiper(this, params);\n if (!firstInstance) firstInstance = s;\n });\n return firstInstance;\n };\n }\n \n if (domLib) {\n if (!('transitionEnd' in domLib.fn)) {\n domLib.fn.transitionEnd = function (callback) {\n var events = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'],\n i, j, dom = this;\n function fireCallBack(e) {\n /*jshint validthis:true */\n if (e.target !== this) return;\n callback.call(this, e);\n for (i = 0; i < events.length; i++) {\n dom.off(events[i], fireCallBack);\n }\n }\n if (callback) {\n for (i = 0; i < events.length; i++) {\n dom.on(events[i], fireCallBack);\n }\n }\n return this;\n };\n }\n if (!('transform' in domLib.fn)) {\n domLib.fn.transform = function (transform) {\n for (var i = 0; i < this.length; i++) {\n var elStyle = this[i].style;\n elStyle.webkitTransform = elStyle.MsTransform = elStyle.msTransform = elStyle.MozTransform = elStyle.OTransform = elStyle.transform = transform;\n }\n return this;\n };\n }\n if (!('transition' in domLib.fn)) {\n domLib.fn.transition = function (duration) {\n if (typeof duration !== 'string') {\n duration = duration + 'ms';\n }\n for (var i = 0; i < this.length; i++) {\n var elStyle = this[i].style;\n elStyle.webkitTransitionDuration = elStyle.MsTransitionDuration = elStyle.msTransitionDuration = elStyle.MozTransitionDuration = elStyle.OTransitionDuration = elStyle.transitionDuration = duration;\n }\n return this;\n };\n }\n if (!('outerWidth' in domLib.fn)) {\n domLib.fn.outerWidth = function (includeMargins) {\n if (this.length > 0) {\n if (includeMargins)\n return this[0].offsetWidth + parseFloat(this.css('margin-right')) + parseFloat(this.css('margin-left'));\n else\n return this[0].offsetWidth;\n }\n else return null;\n };\n }\n }\n\n window.Swiper = Swiper;\n})();\n/*===========================\nSwiper AMD Export\n===========================*/\nif (typeof(module) !== 'undefined')\n{\n module.exports = window.Swiper;\n}\nelse if (typeof define === 'function' && define.amd) {\n define([], function () {\n 'use strict';\n return window.Swiper;\n });\n}\n//# sourceMappingURL=maps/swiper.jquery.js.map\n"]}
|
|
assets/swiper/swiper.jquery.js
DELETED
@@ -1,4630 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Swiper 3.4.0
|
3 |
-
* Most modern mobile touch slider and framework with hardware accelerated transitions
|
4 |
-
*
|
5 |
-
* http://www.idangero.us/swiper/
|
6 |
-
*
|
7 |
-
* Copyright 2016, Vladimir Kharlampidi
|
8 |
-
* The iDangero.us
|
9 |
-
* http://www.idangero.us/
|
10 |
-
*
|
11 |
-
* Licensed under MIT
|
12 |
-
*
|
13 |
-
* Released on: October 16, 2016
|
14 |
-
*/
|
15 |
-
(function () {
|
16 |
-
'use strict';
|
17 |
-
var $;
|
18 |
-
/*===========================
|
19 |
-
Swiper
|
20 |
-
===========================*/
|
21 |
-
var Swiper = function (container, params) {
|
22 |
-
if (!(this instanceof Swiper)) return new Swiper(container, params);
|
23 |
-
|
24 |
-
var defaults = {
|
25 |
-
direction: 'horizontal',
|
26 |
-
touchEventsTarget: 'container',
|
27 |
-
initialSlide: 0,
|
28 |
-
speed: 300,
|
29 |
-
// autoplay
|
30 |
-
autoplay: false,
|
31 |
-
autoplayDisableOnInteraction: true,
|
32 |
-
autoplayStopOnLast: false,
|
33 |
-
// To support iOS's swipe-to-go-back gesture (when being used in-app, with UIWebView).
|
34 |
-
iOSEdgeSwipeDetection: false,
|
35 |
-
iOSEdgeSwipeThreshold: 20,
|
36 |
-
// Free mode
|
37 |
-
freeMode: false,
|
38 |
-
freeModeMomentum: true,
|
39 |
-
freeModeMomentumRatio: 1,
|
40 |
-
freeModeMomentumBounce: true,
|
41 |
-
freeModeMomentumBounceRatio: 1,
|
42 |
-
freeModeMomentumVelocityRatio: 1,
|
43 |
-
freeModeSticky: false,
|
44 |
-
freeModeMinimumVelocity: 0.02,
|
45 |
-
// Autoheight
|
46 |
-
autoHeight: false,
|
47 |
-
// Set wrapper width
|
48 |
-
setWrapperSize: false,
|
49 |
-
// Virtual Translate
|
50 |
-
virtualTranslate: false,
|
51 |
-
// Effects
|
52 |
-
effect: 'slide', // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'
|
53 |
-
coverflow: {
|
54 |
-
rotate: 50,
|
55 |
-
stretch: 0,
|
56 |
-
depth: 100,
|
57 |
-
modifier: 1,
|
58 |
-
slideShadows : true
|
59 |
-
},
|
60 |
-
flip: {
|
61 |
-
slideShadows : true,
|
62 |
-
limitRotation: true
|
63 |
-
},
|
64 |
-
cube: {
|
65 |
-
slideShadows: true,
|
66 |
-
shadow: true,
|
67 |
-
shadowOffset: 20,
|
68 |
-
shadowScale: 0.94
|
69 |
-
},
|
70 |
-
fade: {
|
71 |
-
crossFade: false
|
72 |
-
},
|
73 |
-
// Parallax
|
74 |
-
parallax: false,
|
75 |
-
// Zoom
|
76 |
-
zoom: false,
|
77 |
-
zoomMax: 3,
|
78 |
-
zoomMin: 1,
|
79 |
-
zoomToggle: true,
|
80 |
-
// Scrollbar
|
81 |
-
scrollbar: null,
|
82 |
-
scrollbarHide: true,
|
83 |
-
scrollbarDraggable: false,
|
84 |
-
scrollbarSnapOnRelease: false,
|
85 |
-
// Keyboard Mousewheel
|
86 |
-
keyboardControl: false,
|
87 |
-
mousewheelControl: false,
|
88 |
-
mousewheelReleaseOnEdges: false,
|
89 |
-
mousewheelInvert: false,
|
90 |
-
mousewheelForceToAxis: false,
|
91 |
-
mousewheelSensitivity: 1,
|
92 |
-
mousewheelEventsTarged: 'container',
|
93 |
-
// Hash Navigation
|
94 |
-
hashnav: false,
|
95 |
-
hashnavWatchState: false,
|
96 |
-
// History
|
97 |
-
history: false,
|
98 |
-
// Commong Nav State
|
99 |
-
replaceState: false,
|
100 |
-
// Breakpoints
|
101 |
-
breakpoints: undefined,
|
102 |
-
// Slides grid
|
103 |
-
spaceBetween: 0,
|
104 |
-
slidesPerView: 1,
|
105 |
-
slidesPerColumn: 1,
|
106 |
-
slidesPerColumnFill: 'column',
|
107 |
-
slidesPerGroup: 1,
|
108 |
-
centeredSlides: false,
|
109 |
-
slidesOffsetBefore: 0, // in px
|
110 |
-
slidesOffsetAfter: 0, // in px
|
111 |
-
// Round length
|
112 |
-
roundLengths: false,
|
113 |
-
// Touches
|
114 |
-
touchRatio: 1,
|
115 |
-
touchAngle: 45,
|
116 |
-
simulateTouch: true,
|
117 |
-
shortSwipes: true,
|
118 |
-
longSwipes: true,
|
119 |
-
longSwipesRatio: 0.5,
|
120 |
-
longSwipesMs: 300,
|
121 |
-
followFinger: true,
|
122 |
-
onlyExternal: false,
|
123 |
-
threshold: 0,
|
124 |
-
touchMoveStopPropagation: true,
|
125 |
-
touchReleaseOnEdges: false,
|
126 |
-
// Unique Navigation Elements
|
127 |
-
uniqueNavElements: true,
|
128 |
-
// Pagination
|
129 |
-
pagination: null,
|
130 |
-
paginationElement: 'span',
|
131 |
-
paginationClickable: false,
|
132 |
-
paginationHide: false,
|
133 |
-
paginationBulletRender: null,
|
134 |
-
paginationProgressRender: null,
|
135 |
-
paginationFractionRender: null,
|
136 |
-
paginationCustomRender: null,
|
137 |
-
paginationType: 'bullets', // 'bullets' or 'progress' or 'fraction' or 'custom'
|
138 |
-
// Resistance
|
139 |
-
resistance: true,
|
140 |
-
resistanceRatio: 0.85,
|
141 |
-
// Next/prev buttons
|
142 |
-
nextButton: null,
|
143 |
-
prevButton: null,
|
144 |
-
// Progress
|
145 |
-
watchSlidesProgress: false,
|
146 |
-
watchSlidesVisibility: false,
|
147 |
-
// Cursor
|
148 |
-
grabCursor: false,
|
149 |
-
// Clicks
|
150 |
-
preventClicks: true,
|
151 |
-
preventClicksPropagation: true,
|
152 |
-
slideToClickedSlide: false,
|
153 |
-
// Lazy Loading
|
154 |
-
lazyLoading: false,
|
155 |
-
lazyLoadingInPrevNext: false,
|
156 |
-
lazyLoadingInPrevNextAmount: 1,
|
157 |
-
lazyLoadingOnTransitionStart: false,
|
158 |
-
// Images
|
159 |
-
preloadImages: true,
|
160 |
-
updateOnImagesReady: true,
|
161 |
-
// loop
|
162 |
-
loop: false,
|
163 |
-
loopAdditionalSlides: 0,
|
164 |
-
loopedSlides: null,
|
165 |
-
// Control
|
166 |
-
control: undefined,
|
167 |
-
controlInverse: false,
|
168 |
-
controlBy: 'slide', //or 'container'
|
169 |
-
normalizeSlideIndex: true,
|
170 |
-
// Swiping/no swiping
|
171 |
-
allowSwipeToPrev: true,
|
172 |
-
allowSwipeToNext: true,
|
173 |
-
swipeHandler: null, //'.swipe-handler',
|
174 |
-
noSwiping: true,
|
175 |
-
noSwipingClass: 'swiper-no-swiping',
|
176 |
-
// Passive Listeners
|
177 |
-
passiveListeners: true,
|
178 |
-
// NS
|
179 |
-
containerModifierClass: 'swiper-container-', // NEW
|
180 |
-
slideClass: 'swiper-slide',
|
181 |
-
slideActiveClass: 'swiper-slide-active',
|
182 |
-
slideDuplicateActiveClass: 'swiper-slide-duplicate-active',
|
183 |
-
slideVisibleClass: 'swiper-slide-visible',
|
184 |
-
slideDuplicateClass: 'swiper-slide-duplicate',
|
185 |
-
slideNextClass: 'swiper-slide-next',
|
186 |
-
slideDuplicateNextClass: 'swiper-slide-duplicate-next',
|
187 |
-
slidePrevClass: 'swiper-slide-prev',
|
188 |
-
slideDuplicatePrevClass: 'swiper-slide-duplicate-prev',
|
189 |
-
wrapperClass: 'swiper-wrapper',
|
190 |
-
bulletClass: 'swiper-pagination-bullet',
|
191 |
-
bulletActiveClass: 'swiper-pagination-bullet-active',
|
192 |
-
buttonDisabledClass: 'swiper-button-disabled',
|
193 |
-
paginationCurrentClass: 'swiper-pagination-current',
|
194 |
-
paginationTotalClass: 'swiper-pagination-total',
|
195 |
-
paginationHiddenClass: 'swiper-pagination-hidden',
|
196 |
-
paginationProgressbarClass: 'swiper-pagination-progressbar',
|
197 |
-
paginationClickableClass: 'swiper-pagination-clickable', // NEW
|
198 |
-
paginationModifierClass: 'swiper-pagination-', // NEW
|
199 |
-
lazyLoadingClass: 'swiper-lazy',
|
200 |
-
lazyStatusLoadingClass: 'swiper-lazy-loading',
|
201 |
-
lazyStatusLoadedClass: 'swiper-lazy-loaded',
|
202 |
-
lazyPreloaderClass: 'swiper-lazy-preloader',
|
203 |
-
notificationClass: 'swiper-notification',
|
204 |
-
preloaderClass: 'preloader',
|
205 |
-
zoomContainerClass: 'swiper-zoom-container',
|
206 |
-
|
207 |
-
// Observer
|
208 |
-
observer: false,
|
209 |
-
observeParents: false,
|
210 |
-
// Accessibility
|
211 |
-
a11y: false,
|
212 |
-
prevSlideMessage: 'Previous slide',
|
213 |
-
nextSlideMessage: 'Next slide',
|
214 |
-
firstSlideMessage: 'This is the first slide',
|
215 |
-
lastSlideMessage: 'This is the last slide',
|
216 |
-
paginationBulletMessage: 'Go to slide {{index}}',
|
217 |
-
// Callbacks
|
218 |
-
runCallbacksOnInit: true
|
219 |
-
/*
|
220 |
-
Callbacks:
|
221 |
-
onInit: function (swiper)
|
222 |
-
onDestroy: function (swiper)
|
223 |
-
onClick: function (swiper, e)
|
224 |
-
onTap: function (swiper, e)
|
225 |
-
onDoubleTap: function (swiper, e)
|
226 |
-
onSliderMove: function (swiper, e)
|
227 |
-
onSlideChangeStart: function (swiper)
|
228 |
-
onSlideChangeEnd: function (swiper)
|
229 |
-
onTransitionStart: function (swiper)
|
230 |
-
onTransitionEnd: function (swiper)
|
231 |
-
onImagesReady: function (swiper)
|
232 |
-
onProgress: function (swiper, progress)
|
233 |
-
onTouchStart: function (swiper, e)
|
234 |
-
onTouchMove: function (swiper, e)
|
235 |
-
onTouchMoveOpposite: function (swiper, e)
|
236 |
-
onTouchEnd: function (swiper, e)
|
237 |
-
onReachBeginning: function (swiper)
|
238 |
-
onReachEnd: function (swiper)
|
239 |
-
onSetTransition: function (swiper, duration)
|
240 |
-
onSetTranslate: function (swiper, translate)
|
241 |
-
onAutoplayStart: function (swiper)
|
242 |
-
onAutoplayStop: function (swiper),
|
243 |
-
onLazyImageLoad: function (swiper, slide, image)
|
244 |
-
onLazyImageReady: function (swiper, slide, image)
|
245 |
-
*/
|
246 |
-
|
247 |
-
};
|
248 |
-
var initialVirtualTranslate = params && params.virtualTranslate;
|
249 |
-
|
250 |
-
params = params || {};
|
251 |
-
var originalParams = {};
|
252 |
-
for (var param in params) {
|
253 |
-
if (typeof params[param] === 'object' && params[param] !== null && !(params[param].nodeType || params[param] === window || params[param] === document || (typeof Dom7 !== 'undefined' && params[param] instanceof Dom7) || (typeof jQuery !== 'undefined' && params[param] instanceof jQuery))) {
|
254 |
-
originalParams[param] = {};
|
255 |
-
for (var deepParam in params[param]) {
|
256 |
-
originalParams[param][deepParam] = params[param][deepParam];
|
257 |
-
}
|
258 |
-
}
|
259 |
-
else {
|
260 |
-
originalParams[param] = params[param];
|
261 |
-
}
|
262 |
-
}
|
263 |
-
for (var def in defaults) {
|
264 |
-
if (typeof params[def] === 'undefined') {
|
265 |
-
params[def] = defaults[def];
|
266 |
-
}
|
267 |
-
else if (typeof params[def] === 'object') {
|
268 |
-
for (var deepDef in defaults[def]) {
|
269 |
-
if (typeof params[def][deepDef] === 'undefined') {
|
270 |
-
params[def][deepDef] = defaults[def][deepDef];
|
271 |
-
}
|
272 |
-
}
|
273 |
-
}
|
274 |
-
}
|
275 |
-
|
276 |
-
// Swiper
|
277 |
-
var s = this;
|
278 |
-
|
279 |
-
// Params
|
280 |
-
s.params = params;
|
281 |
-
s.originalParams = originalParams;
|
282 |
-
|
283 |
-
// Classname
|
284 |
-
s.classNames = [];
|
285 |
-
/*=========================
|
286 |
-
Dom Library and plugins
|
287 |
-
===========================*/
|
288 |
-
if (typeof $ !== 'undefined' && typeof Dom7 !== 'undefined'){
|
289 |
-
$ = Dom7;
|
290 |
-
}
|
291 |
-
if (typeof $ === 'undefined') {
|
292 |
-
if (typeof Dom7 === 'undefined') {
|
293 |
-
$ = window.Dom7 || window.Zepto || window.jQuery;
|
294 |
-
}
|
295 |
-
else {
|
296 |
-
$ = Dom7;
|
297 |
-
}
|
298 |
-
if (!$) return;
|
299 |
-
}
|
300 |
-
// Export it to Swiper instance
|
301 |
-
s.$ = $;
|
302 |
-
|
303 |
-
/*=========================
|
304 |
-
Breakpoints
|
305 |
-
===========================*/
|
306 |
-
s.currentBreakpoint = undefined;
|
307 |
-
s.getActiveBreakpoint = function () {
|
308 |
-
//Get breakpoint for window width
|
309 |
-
if (!s.params.breakpoints) return false;
|
310 |
-
var breakpoint = false;
|
311 |
-
var points = [], point;
|
312 |
-
for ( point in s.params.breakpoints ) {
|
313 |
-
if (s.params.breakpoints.hasOwnProperty(point)) {
|
314 |
-
points.push(point);
|
315 |
-
}
|
316 |
-
}
|
317 |
-
points.sort(function (a, b) {
|
318 |
-
return parseInt(a, 10) > parseInt(b, 10);
|
319 |
-
});
|
320 |
-
for (var i = 0; i < points.length; i++) {
|
321 |
-
point = points[i];
|
322 |
-
if (point >= window.innerWidth && !breakpoint) {
|
323 |
-
breakpoint = point;
|
324 |
-
}
|
325 |
-
}
|
326 |
-
return breakpoint || 'max';
|
327 |
-
};
|
328 |
-
s.setBreakpoint = function () {
|
329 |
-
//Set breakpoint for window width and update parameters
|
330 |
-
var breakpoint = s.getActiveBreakpoint();
|
331 |
-
if (breakpoint && s.currentBreakpoint !== breakpoint) {
|
332 |
-
var breakPointsParams = breakpoint in s.params.breakpoints ? s.params.breakpoints[breakpoint] : s.originalParams;
|
333 |
-
var needsReLoop = s.params.loop && (breakPointsParams.slidesPerView !== s.params.slidesPerView);
|
334 |
-
for ( var param in breakPointsParams ) {
|
335 |
-
s.params[param] = breakPointsParams[param];
|
336 |
-
}
|
337 |
-
s.currentBreakpoint = breakpoint;
|
338 |
-
if(needsReLoop && s.destroyLoop) {
|
339 |
-
s.reLoop(true);
|
340 |
-
}
|
341 |
-
}
|
342 |
-
};
|
343 |
-
// Set breakpoint on load
|
344 |
-
if (s.params.breakpoints) {
|
345 |
-
s.setBreakpoint();
|
346 |
-
}
|
347 |
-
|
348 |
-
/*=========================
|
349 |
-
Preparation - Define Container, Wrapper and Pagination
|
350 |
-
===========================*/
|
351 |
-
s.container = $(container);
|
352 |
-
if (s.container.length === 0) return;
|
353 |
-
if (s.container.length > 1) {
|
354 |
-
var swipers = [];
|
355 |
-
s.container.each(function () {
|
356 |
-
var container = this;
|
357 |
-
swipers.push(new Swiper(this, params));
|
358 |
-
});
|
359 |
-
return swipers;
|
360 |
-
}
|
361 |
-
|
362 |
-
// Save instance in container HTML Element and in data
|
363 |
-
s.container[0].swiper = s;
|
364 |
-
s.container.data('swiper', s);
|
365 |
-
|
366 |
-
s.classNames.push(s.params.containerModifierClass + s.params.direction);
|
367 |
-
|
368 |
-
if (s.params.freeMode) {
|
369 |
-
s.classNames.push(s.params.containerModifierClass + 'free-mode');
|
370 |
-
}
|
371 |
-
if (!s.support.flexbox) {
|
372 |
-
s.classNames.push(s.params.containerModifierClass + 'no-flexbox');
|
373 |
-
s.params.slidesPerColumn = 1;
|
374 |
-
}
|
375 |
-
if (s.params.autoHeight) {
|
376 |
-
s.classNames.push(s.params.containerModifierClass + 'autoheight');
|
377 |
-
}
|
378 |
-
// Enable slides progress when required
|
379 |
-
if (s.params.parallax || s.params.watchSlidesVisibility) {
|
380 |
-
s.params.watchSlidesProgress = true;
|
381 |
-
}
|
382 |
-
// Max resistance when touchReleaseOnEdges
|
383 |
-
if (s.params.touchReleaseOnEdges) {
|
384 |
-
s.params.resistanceRatio = 0;
|
385 |
-
}
|
386 |
-
// Coverflow / 3D
|
387 |
-
if (['cube', 'coverflow', 'flip'].indexOf(s.params.effect) >= 0) {
|
388 |
-
if (s.support.transforms3d) {
|
389 |
-
s.params.watchSlidesProgress = true;
|
390 |
-
s.classNames.push(s.params.containerModifierClass + '3d');
|
391 |
-
}
|
392 |
-
else {
|
393 |
-
s.params.effect = 'slide';
|
394 |
-
}
|
395 |
-
}
|
396 |
-
if (s.params.effect !== 'slide') {
|
397 |
-
s.classNames.push(s.params.containerModifierClass + s.params.effect);
|
398 |
-
}
|
399 |
-
if (s.params.effect === 'cube') {
|
400 |
-
s.params.resistanceRatio = 0;
|
401 |
-
s.params.slidesPerView = 1;
|
402 |
-
s.params.slidesPerColumn = 1;
|
403 |
-
s.params.slidesPerGroup = 1;
|
404 |
-
s.params.centeredSlides = false;
|
405 |
-
s.params.spaceBetween = 0;
|
406 |
-
s.params.virtualTranslate = true;
|
407 |
-
s.params.setWrapperSize = false;
|
408 |
-
}
|
409 |
-
if (s.params.effect === 'fade' || s.params.effect === 'flip') {
|
410 |
-
s.params.slidesPerView = 1;
|
411 |
-
s.params.slidesPerColumn = 1;
|
412 |
-
s.params.slidesPerGroup = 1;
|
413 |
-
s.params.watchSlidesProgress = true;
|
414 |
-
s.params.spaceBetween = 0;
|
415 |
-
s.params.setWrapperSize = false;
|
416 |
-
if (typeof initialVirtualTranslate === 'undefined') {
|
417 |
-
s.params.virtualTranslate = true;
|
418 |
-
}
|
419 |
-
}
|
420 |
-
|
421 |
-
// Grab Cursor
|
422 |
-
if (s.params.grabCursor && s.support.touch) {
|
423 |
-
s.params.grabCursor = false;
|
424 |
-
}
|
425 |
-
|
426 |
-
// Wrapper
|
427 |
-
s.wrapper = s.container.children('.' + s.params.wrapperClass);
|
428 |
-
|
429 |
-
// Pagination
|
430 |
-
if (s.params.pagination) {
|
431 |
-
s.paginationContainer = $(s.params.pagination);
|
432 |
-
if (s.params.uniqueNavElements && typeof s.params.pagination === 'string' && s.paginationContainer.length > 1 && s.container.find(s.params.pagination).length === 1) {
|
433 |
-
s.paginationContainer = s.container.find(s.params.pagination);
|
434 |
-
}
|
435 |
-
|
436 |
-
if (s.params.paginationType === 'bullets' && s.params.paginationClickable) {
|
437 |
-
s.paginationContainer.addClass(s.params.paginationModifierClass + 'clickable');
|
438 |
-
}
|
439 |
-
else {
|
440 |
-
s.params.paginationClickable = false;
|
441 |
-
}
|
442 |
-
s.paginationContainer.addClass(s.params.paginationModifierClass + s.params.paginationType);
|
443 |
-
}
|
444 |
-
// Next/Prev Buttons
|
445 |
-
if (s.params.nextButton || s.params.prevButton) {
|
446 |
-
if (s.params.nextButton) {
|
447 |
-
s.nextButton = $(s.params.nextButton);
|
448 |
-
if (s.params.uniqueNavElements && typeof s.params.nextButton === 'string' && s.nextButton.length > 1 && s.container.find(s.params.nextButton).length === 1) {
|
449 |
-
s.nextButton = s.container.find(s.params.nextButton);
|
450 |
-
}
|
451 |
-
}
|
452 |
-
if (s.params.prevButton) {
|
453 |
-
s.prevButton = $(s.params.prevButton);
|
454 |
-
if (s.params.uniqueNavElements && typeof s.params.prevButton === 'string' && s.prevButton.length > 1 && s.container.find(s.params.prevButton).length === 1) {
|
455 |
-
s.prevButton = s.container.find(s.params.prevButton);
|
456 |
-
}
|
457 |
-
}
|
458 |
-
}
|
459 |
-
|
460 |
-
// Is Horizontal
|
461 |
-
s.isHorizontal = function () {
|
462 |
-
return s.params.direction === 'horizontal';
|
463 |
-
};
|
464 |
-
// s.isH = isH;
|
465 |
-
|
466 |
-
// RTL
|
467 |
-
s.rtl = s.isHorizontal() && (s.container[0].dir.toLowerCase() === 'rtl' || s.container.css('direction') === 'rtl');
|
468 |
-
if (s.rtl) {
|
469 |
-
s.classNames.push(s.params.containerModifierClass + 'rtl');
|
470 |
-
}
|
471 |
-
|
472 |
-
// Wrong RTL support
|
473 |
-
if (s.rtl) {
|
474 |
-
s.wrongRTL = s.wrapper.css('display') === '-webkit-box';
|
475 |
-
}
|
476 |
-
|
477 |
-
// Columns
|
478 |
-
if (s.params.slidesPerColumn > 1) {
|
479 |
-
s.classNames.push(s.params.containerModifierClass + 'multirow');
|
480 |
-
}
|
481 |
-
|
482 |
-
// Check for Android
|
483 |
-
if (s.device.android) {
|
484 |
-
s.classNames.push(s.params.containerModifierClass + 'android');
|
485 |
-
}
|
486 |
-
|
487 |
-
// Add classes
|
488 |
-
s.container.addClass(s.classNames.join(' '));
|
489 |
-
|
490 |
-
// Translate
|
491 |
-
s.translate = 0;
|
492 |
-
|
493 |
-
// Progress
|
494 |
-
s.progress = 0;
|
495 |
-
|
496 |
-
// Velocity
|
497 |
-
s.velocity = 0;
|
498 |
-
|
499 |
-
/*=========================
|
500 |
-
Locks, unlocks
|
501 |
-
===========================*/
|
502 |
-
s.lockSwipeToNext = function () {
|
503 |
-
s.params.allowSwipeToNext = false;
|
504 |
-
if (s.params.allowSwipeToPrev === false && s.params.grabCursor) {
|
505 |
-
s.unsetGrabCursor();
|
506 |
-
}
|
507 |
-
};
|
508 |
-
s.lockSwipeToPrev = function () {
|
509 |
-
s.params.allowSwipeToPrev = false;
|
510 |
-
if (s.params.allowSwipeToNext === false && s.params.grabCursor) {
|
511 |
-
s.unsetGrabCursor();
|
512 |
-
}
|
513 |
-
};
|
514 |
-
s.lockSwipes = function () {
|
515 |
-
s.params.allowSwipeToNext = s.params.allowSwipeToPrev = false;
|
516 |
-
if (s.params.grabCursor) s.unsetGrabCursor();
|
517 |
-
};
|
518 |
-
s.unlockSwipeToNext = function () {
|
519 |
-
s.params.allowSwipeToNext = true;
|
520 |
-
if (s.params.allowSwipeToPrev === true && s.params.grabCursor) {
|
521 |
-
s.setGrabCursor();
|
522 |
-
}
|
523 |
-
};
|
524 |
-
s.unlockSwipeToPrev = function () {
|
525 |
-
s.params.allowSwipeToPrev = true;
|
526 |
-
if (s.params.allowSwipeToNext === true && s.params.grabCursor) {
|
527 |
-
s.setGrabCursor();
|
528 |
-
}
|
529 |
-
};
|
530 |
-
s.unlockSwipes = function () {
|
531 |
-
s.params.allowSwipeToNext = s.params.allowSwipeToPrev = true;
|
532 |
-
if (s.params.grabCursor) s.setGrabCursor();
|
533 |
-
};
|
534 |
-
|
535 |
-
/*=========================
|
536 |
-
Round helper
|
537 |
-
===========================*/
|
538 |
-
function round(a) {
|
539 |
-
return Math.floor(a);
|
540 |
-
}
|
541 |
-
/*=========================
|
542 |
-
Set grab cursor
|
543 |
-
===========================*/
|
544 |
-
s.setGrabCursor = function(moving) {
|
545 |
-
s.container[0].style.cursor = 'move';
|
546 |
-
s.container[0].style.cursor = moving ? '-webkit-grabbing' : '-webkit-grab';
|
547 |
-
s.container[0].style.cursor = moving ? '-moz-grabbin' : '-moz-grab';
|
548 |
-
s.container[0].style.cursor = moving ? 'grabbing': 'grab';
|
549 |
-
};
|
550 |
-
s.unsetGrabCursor = function () {
|
551 |
-
s.container[0].style.cursor = '';
|
552 |
-
};
|
553 |
-
if (s.params.grabCursor) {
|
554 |
-
s.setGrabCursor();
|
555 |
-
}
|
556 |
-
/*=========================
|
557 |
-
Update on Images Ready
|
558 |
-
===========================*/
|
559 |
-
s.imagesToLoad = [];
|
560 |
-
s.imagesLoaded = 0;
|
561 |
-
|
562 |
-
s.loadImage = function (imgElement, src, srcset, sizes, checkForComplete, callback) {
|
563 |
-
var image;
|
564 |
-
function onReady () {
|
565 |
-
if (callback) callback();
|
566 |
-
}
|
567 |
-
if (!imgElement.complete || !checkForComplete) {
|
568 |
-
if (src) {
|
569 |
-
image = new window.Image();
|
570 |
-
image.onload = onReady;
|
571 |
-
image.onerror = onReady;
|
572 |
-
if (sizes) {
|
573 |
-
image.sizes = sizes;
|
574 |
-
}
|
575 |
-
if (srcset) {
|
576 |
-
image.srcset = srcset;
|
577 |
-
}
|
578 |
-
if (src) {
|
579 |
-
image.src = src;
|
580 |
-
}
|
581 |
-
} else {
|
582 |
-
onReady();
|
583 |
-
}
|
584 |
-
|
585 |
-
} else {//image already loaded...
|
586 |
-
onReady();
|
587 |
-
}
|
588 |
-
};
|
589 |
-
s.preloadImages = function () {
|
590 |
-
s.imagesToLoad = s.container.find('img');
|
591 |
-
function _onReady() {
|
592 |
-
if (typeof s === 'undefined' || s === null) return;
|
593 |
-
if (s.imagesLoaded !== undefined) s.imagesLoaded++;
|
594 |
-
if (s.imagesLoaded === s.imagesToLoad.length) {
|
595 |
-
if (s.params.updateOnImagesReady) s.update();
|
596 |
-
s.emit('onImagesReady', s);
|
597 |
-
}
|
598 |
-
}
|
599 |
-
for (var i = 0; i < s.imagesToLoad.length; i++) {
|
600 |
-
s.loadImage(s.imagesToLoad[i], (s.imagesToLoad[i].currentSrc || s.imagesToLoad[i].getAttribute('src')), (s.imagesToLoad[i].srcset || s.imagesToLoad[i].getAttribute('srcset')), s.imagesToLoad[i].sizes || s.imagesToLoad[i].getAttribute('sizes'), true, _onReady);
|
601 |
-
}
|
602 |
-
};
|
603 |
-
|
604 |
-
/*=========================
|
605 |
-
Autoplay
|
606 |
-
===========================*/
|
607 |
-
s.autoplayTimeoutId = undefined;
|
608 |
-
s.autoplaying = false;
|
609 |
-
s.autoplayPaused = false;
|
610 |
-
function autoplay() {
|
611 |
-
var autoplayDelay = s.params.autoplay;
|
612 |
-
var activeSlide = s.slides.eq(s.activeIndex);
|
613 |
-
if (activeSlide.attr('data-swiper-autoplay')) {
|
614 |
-
autoplayDelay = activeSlide.attr('data-swiper-autoplay') || s.params.autoplay;
|
615 |
-
}
|
616 |
-
s.autoplayTimeoutId = setTimeout(function () {
|
617 |
-
if (s.params.loop) {
|
618 |
-
s.fixLoop();
|
619 |
-
s._slideNext();
|
620 |
-
s.emit('onAutoplay', s);
|
621 |
-
}
|
622 |
-
else {
|
623 |
-
if (!s.isEnd) {
|
624 |
-
s._slideNext();
|
625 |
-
s.emit('onAutoplay', s);
|
626 |
-
}
|
627 |
-
else {
|
628 |
-
if (!params.autoplayStopOnLast) {
|
629 |
-
s._slideTo(0);
|
630 |
-
s.emit('onAutoplay', s);
|
631 |
-
}
|
632 |
-
else {
|
633 |
-
s.stopAutoplay();
|
634 |
-
}
|
635 |
-
}
|
636 |
-
}
|
637 |
-
}, autoplayDelay);
|
638 |
-
}
|
639 |
-
s.startAutoplay = function () {
|
640 |
-
if (typeof s.autoplayTimeoutId !== 'undefined') return false;
|
641 |
-
if (!s.params.autoplay) return false;
|
642 |
-
if (s.autoplaying) return false;
|
643 |
-
s.autoplaying = true;
|
644 |
-
s.emit('onAutoplayStart', s);
|
645 |
-
autoplay();
|
646 |
-
};
|
647 |
-
s.stopAutoplay = function (internal) {
|
648 |
-
if (!s.autoplayTimeoutId) return;
|
649 |
-
if (s.autoplayTimeoutId) clearTimeout(s.autoplayTimeoutId);
|
650 |
-
s.autoplaying = false;
|
651 |
-
s.autoplayTimeoutId = undefined;
|
652 |
-
s.emit('onAutoplayStop', s);
|
653 |
-
};
|
654 |
-
s.pauseAutoplay = function (speed) {
|
655 |
-
if (s.autoplayPaused) return;
|
656 |
-
if (s.autoplayTimeoutId) clearTimeout(s.autoplayTimeoutId);
|
657 |
-
s.autoplayPaused = true;
|
658 |
-
if (speed === 0) {
|
659 |
-
s.autoplayPaused = false;
|
660 |
-
autoplay();
|
661 |
-
}
|
662 |
-
else {
|
663 |
-
s.wrapper.transitionEnd(function () {
|
664 |
-
if (!s) return;
|
665 |
-
s.autoplayPaused = false;
|
666 |
-
if (!s.autoplaying) {
|
667 |
-
s.stopAutoplay();
|
668 |
-
}
|
669 |
-
else {
|
670 |
-
autoplay();
|
671 |
-
}
|
672 |
-
});
|
673 |
-
}
|
674 |
-
};
|
675 |
-
/*=========================
|
676 |
-
Min/Max Translate
|
677 |
-
===========================*/
|
678 |
-
s.minTranslate = function () {
|
679 |
-
return (-s.snapGrid[0]);
|
680 |
-
};
|
681 |
-
s.maxTranslate = function () {
|
682 |
-
return (-s.snapGrid[s.snapGrid.length - 1]);
|
683 |
-
};
|
684 |
-
/*=========================
|
685 |
-
Slider/slides sizes
|
686 |
-
===========================*/
|
687 |
-
s.updateAutoHeight = function () {
|
688 |
-
var activeSlides = [];
|
689 |
-
var newHeight = 0;
|
690 |
-
|
691 |
-
// Find slides currently in view
|
692 |
-
if(s.params.slidesPerView !== 'auto' && s.params.slidesPerView > 1) {
|
693 |
-
for (i = 0; i < Math.ceil(s.params.slidesPerView); i++) {
|
694 |
-
var index = s.activeIndex + i;
|
695 |
-
if(index > s.slides.length) break;
|
696 |
-
activeSlides.push(s.slides.eq(index)[0]);
|
697 |
-
}
|
698 |
-
} else {
|
699 |
-
activeSlides.push(s.slides.eq(s.activeIndex)[0]);
|
700 |
-
}
|
701 |
-
|
702 |
-
// Find new height from heighest slide in view
|
703 |
-
for (i = 0; i < activeSlides.length; i++) {
|
704 |
-
if (typeof activeSlides[i] !== 'undefined') {
|
705 |
-
var height = activeSlides[i].offsetHeight;
|
706 |
-
newHeight = height > newHeight ? height : newHeight;
|
707 |
-
}
|
708 |
-
}
|
709 |
-
|
710 |
-
// Update Height
|
711 |
-
if (newHeight) s.wrapper.css('height', newHeight + 'px');
|
712 |
-
};
|
713 |
-
s.updateContainerSize = function () {
|
714 |
-
var width, height;
|
715 |
-
if (typeof s.params.width !== 'undefined') {
|
716 |
-
width = s.params.width;
|
717 |
-
}
|
718 |
-
else {
|
719 |
-
width = s.container[0].clientWidth;
|
720 |
-
}
|
721 |
-
if (typeof s.params.height !== 'undefined') {
|
722 |
-
height = s.params.height;
|
723 |
-
}
|
724 |
-
else {
|
725 |
-
height = s.container[0].clientHeight;
|
726 |
-
}
|
727 |
-
if (width === 0 && s.isHorizontal() || height === 0 && !s.isHorizontal()) {
|
728 |
-
return;
|
729 |
-
}
|
730 |
-
|
731 |
-
//Subtract paddings
|
732 |
-
width = width - parseInt(s.container.css('padding-left'), 10) - parseInt(s.container.css('padding-right'), 10);
|
733 |
-
height = height - parseInt(s.container.css('padding-top'), 10) - parseInt(s.container.css('padding-bottom'), 10);
|
734 |
-
|
735 |
-
// Store values
|
736 |
-
s.width = width;
|
737 |
-
s.height = height;
|
738 |
-
s.size = s.isHorizontal() ? s.width : s.height;
|
739 |
-
};
|
740 |
-
|
741 |
-
s.updateSlidesSize = function () {
|
742 |
-
s.slides = s.wrapper.children('.' + s.params.slideClass);
|
743 |
-
s.snapGrid = [];
|
744 |
-
s.slidesGrid = [];
|
745 |
-
s.slidesSizesGrid = [];
|
746 |
-
|
747 |
-
var spaceBetween = s.params.spaceBetween,
|
748 |
-
slidePosition = -s.params.slidesOffsetBefore,
|
749 |
-
i,
|
750 |
-
prevSlideSize = 0,
|
751 |
-
index = 0;
|
752 |
-
if (typeof s.size === 'undefined') return;
|
753 |
-
if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
|
754 |
-
spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * s.size;
|
755 |
-
}
|
756 |
-
|
757 |
-
s.virtualSize = -spaceBetween;
|
758 |
-
// reset margins
|
759 |
-
if (s.rtl) s.slides.css({marginLeft: '', marginTop: ''});
|
760 |
-
else s.slides.css({marginRight: '', marginBottom: ''});
|
761 |
-
|
762 |
-
var slidesNumberEvenToRows;
|
763 |
-
if (s.params.slidesPerColumn > 1) {
|
764 |
-
if (Math.floor(s.slides.length / s.params.slidesPerColumn) === s.slides.length / s.params.slidesPerColumn) {
|
765 |
-
slidesNumberEvenToRows = s.slides.length;
|
766 |
-
}
|
767 |
-
else {
|
768 |
-
slidesNumberEvenToRows = Math.ceil(s.slides.length / s.params.slidesPerColumn) * s.params.slidesPerColumn;
|
769 |
-
}
|
770 |
-
if (s.params.slidesPerView !== 'auto' && s.params.slidesPerColumnFill === 'row') {
|
771 |
-
slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, s.params.slidesPerView * s.params.slidesPerColumn);
|
772 |
-
}
|
773 |
-
}
|
774 |
-
|
775 |
-
// Calc slides
|
776 |
-
var slideSize;
|
777 |
-
var slidesPerColumn = s.params.slidesPerColumn;
|
778 |
-
var slidesPerRow = slidesNumberEvenToRows / slidesPerColumn;
|
779 |
-
var numFullColumns = slidesPerRow - (s.params.slidesPerColumn * slidesPerRow - s.slides.length);
|
780 |
-
for (i = 0; i < s.slides.length; i++) {
|
781 |
-
slideSize = 0;
|
782 |
-
var slide = s.slides.eq(i);
|
783 |
-
if (s.params.slidesPerColumn > 1) {
|
784 |
-
// Set slides order
|
785 |
-
var newSlideOrderIndex;
|
786 |
-
var column, row;
|
787 |
-
if (s.params.slidesPerColumnFill === 'column') {
|
788 |
-
column = Math.floor(i / slidesPerColumn);
|
789 |
-
row = i - column * slidesPerColumn;
|
790 |
-
if (column > numFullColumns || (column === numFullColumns && row === slidesPerColumn-1)) {
|
791 |
-
if (++row >= slidesPerColumn) {
|
792 |
-
row = 0;
|
793 |
-
column++;
|
794 |
-
}
|
795 |
-
}
|
796 |
-
newSlideOrderIndex = column + row * slidesNumberEvenToRows / slidesPerColumn;
|
797 |
-
slide
|
798 |
-
.css({
|
799 |
-
'-webkit-box-ordinal-group': newSlideOrderIndex,
|
800 |
-
'-moz-box-ordinal-group': newSlideOrderIndex,
|
801 |
-
'-ms-flex-order': newSlideOrderIndex,
|
802 |
-
'-webkit-order': newSlideOrderIndex,
|
803 |
-
'order': newSlideOrderIndex
|
804 |
-
});
|
805 |
-
}
|
806 |
-
else {
|
807 |
-
row = Math.floor(i / slidesPerRow);
|
808 |
-
column = i - row * slidesPerRow;
|
809 |
-
}
|
810 |
-
slide
|
811 |
-
.css(
|
812 |
-
'margin-' + (s.isHorizontal() ? 'top' : 'left'),
|
813 |
-
(row !== 0 && s.params.spaceBetween) && (s.params.spaceBetween + 'px')
|
814 |
-
)
|
815 |
-
.attr('data-swiper-column', column)
|
816 |
-
.attr('data-swiper-row', row);
|
817 |
-
|
818 |
-
}
|
819 |
-
if (slide.css('display') === 'none') continue;
|
820 |
-
if (s.params.slidesPerView === 'auto') {
|
821 |
-
slideSize = s.isHorizontal() ? slide.outerWidth(true) : slide.outerHeight(true);
|
822 |
-
if (s.params.roundLengths) slideSize = round(slideSize);
|
823 |
-
}
|
824 |
-
else {
|
825 |
-
slideSize = (s.size - (s.params.slidesPerView - 1) * spaceBetween) / s.params.slidesPerView;
|
826 |
-
if (s.params.roundLengths) slideSize = round(slideSize);
|
827 |
-
|
828 |
-
if (s.isHorizontal()) {
|
829 |
-
s.slides[i].style.width = slideSize + 'px';
|
830 |
-
}
|
831 |
-
else {
|
832 |
-
s.slides[i].style.height = slideSize + 'px';
|
833 |
-
}
|
834 |
-
}
|
835 |
-
s.slides[i].swiperSlideSize = slideSize;
|
836 |
-
s.slidesSizesGrid.push(slideSize);
|
837 |
-
|
838 |
-
|
839 |
-
if (s.params.centeredSlides) {
|
840 |
-
slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;
|
841 |
-
if (i === 0) slidePosition = slidePosition - s.size / 2 - spaceBetween;
|
842 |
-
if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;
|
843 |
-
if ((index) % s.params.slidesPerGroup === 0) s.snapGrid.push(slidePosition);
|
844 |
-
s.slidesGrid.push(slidePosition);
|
845 |
-
}
|
846 |
-
else {
|
847 |
-
if ((index) % s.params.slidesPerGroup === 0) s.snapGrid.push(slidePosition);
|
848 |
-
s.slidesGrid.push(slidePosition);
|
849 |
-
slidePosition = slidePosition + slideSize + spaceBetween;
|
850 |
-
}
|
851 |
-
|
852 |
-
s.virtualSize += slideSize + spaceBetween;
|
853 |
-
|
854 |
-
prevSlideSize = slideSize;
|
855 |
-
|
856 |
-
index ++;
|
857 |
-
}
|
858 |
-
s.virtualSize = Math.max(s.virtualSize, s.size) + s.params.slidesOffsetAfter;
|
859 |
-
var newSlidesGrid;
|
860 |
-
|
861 |
-
if (
|
862 |
-
s.rtl && s.wrongRTL && (s.params.effect === 'slide' || s.params.effect === 'coverflow')) {
|
863 |
-
s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'});
|
864 |
-
}
|
865 |
-
if (!s.support.flexbox || s.params.setWrapperSize) {
|
866 |
-
if (s.isHorizontal()) s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'});
|
867 |
-
else s.wrapper.css({height: s.virtualSize + s.params.spaceBetween + 'px'});
|
868 |
-
}
|
869 |
-
|
870 |
-
if (s.params.slidesPerColumn > 1) {
|
871 |
-
s.virtualSize = (slideSize + s.params.spaceBetween) * slidesNumberEvenToRows;
|
872 |
-
s.virtualSize = Math.ceil(s.virtualSize / s.params.slidesPerColumn) - s.params.spaceBetween;
|
873 |
-
if (s.isHorizontal()) s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'});
|
874 |
-
else s.wrapper.css({height: s.virtualSize + s.params.spaceBetween + 'px'});
|
875 |
-
if (s.params.centeredSlides) {
|
876 |
-
newSlidesGrid = [];
|
877 |
-
for (i = 0; i < s.snapGrid.length; i++) {
|
878 |
-
if (s.snapGrid[i] < s.virtualSize + s.snapGrid[0]) newSlidesGrid.push(s.snapGrid[i]);
|
879 |
-
}
|
880 |
-
s.snapGrid = newSlidesGrid;
|
881 |
-
}
|
882 |
-
}
|
883 |
-
|
884 |
-
// Remove last grid elements depending on width
|
885 |
-
if (!s.params.centeredSlides) {
|
886 |
-
newSlidesGrid = [];
|
887 |
-
for (i = 0; i < s.snapGrid.length; i++) {
|
888 |
-
if (s.snapGrid[i] <= s.virtualSize - s.size) {
|
889 |
-
newSlidesGrid.push(s.snapGrid[i]);
|
890 |
-
}
|
891 |
-
}
|
892 |
-
s.snapGrid = newSlidesGrid;
|
893 |
-
if (Math.floor(s.virtualSize - s.size) - Math.floor(s.snapGrid[s.snapGrid.length - 1]) > 1) {
|
894 |
-
s.snapGrid.push(s.virtualSize - s.size);
|
895 |
-
}
|
896 |
-
}
|
897 |
-
if (s.snapGrid.length === 0) s.snapGrid = [0];
|
898 |
-
|
899 |
-
if (s.params.spaceBetween !== 0) {
|
900 |
-
if (s.isHorizontal()) {
|
901 |
-
if (s.rtl) s.slides.css({marginLeft: spaceBetween + 'px'});
|
902 |
-
else s.slides.css({marginRight: spaceBetween + 'px'});
|
903 |
-
}
|
904 |
-
else s.slides.css({marginBottom: spaceBetween + 'px'});
|
905 |
-
}
|
906 |
-
if (s.params.watchSlidesProgress) {
|
907 |
-
s.updateSlidesOffset();
|
908 |
-
}
|
909 |
-
};
|
910 |
-
s.updateSlidesOffset = function () {
|
911 |
-
for (var i = 0; i < s.slides.length; i++) {
|
912 |
-
s.slides[i].swiperSlideOffset = s.isHorizontal() ? s.slides[i].offsetLeft : s.slides[i].offsetTop;
|
913 |
-
}
|
914 |
-
};
|
915 |
-
|
916 |
-
/*=========================
|
917 |
-
Slider/slides progress
|
918 |
-
===========================*/
|
919 |
-
s.updateSlidesProgress = function (translate) {
|
920 |
-
if (typeof translate === 'undefined') {
|
921 |
-
translate = s.translate || 0;
|
922 |
-
}
|
923 |
-
if (s.slides.length === 0) return;
|
924 |
-
if (typeof s.slides[0].swiperSlideOffset === 'undefined') s.updateSlidesOffset();
|
925 |
-
|
926 |
-
var offsetCenter = -translate;
|
927 |
-
if (s.rtl) offsetCenter = translate;
|
928 |
-
|
929 |
-
// Visible Slides
|
930 |
-
s.slides.removeClass(s.params.slideVisibleClass);
|
931 |
-
for (var i = 0; i < s.slides.length; i++) {
|
932 |
-
var slide = s.slides[i];
|
933 |
-
var slideProgress = (offsetCenter + (s.params.centeredSlides ? s.minTranslate() : 0) - slide.swiperSlideOffset) / (slide.swiperSlideSize + s.params.spaceBetween);
|
934 |
-
if (s.params.watchSlidesVisibility) {
|
935 |
-
var slideBefore = -(offsetCenter - slide.swiperSlideOffset);
|
936 |
-
var slideAfter = slideBefore + s.slidesSizesGrid[i];
|
937 |
-
var isVisible =
|
938 |
-
(slideBefore >= 0 && slideBefore < s.size) ||
|
939 |
-
(slideAfter > 0 && slideAfter <= s.size) ||
|
940 |
-
(slideBefore <= 0 && slideAfter >= s.size);
|
941 |
-
if (isVisible) {
|
942 |
-
s.slides.eq(i).addClass(s.params.slideVisibleClass);
|
943 |
-
}
|
944 |
-
}
|
945 |
-
slide.progress = s.rtl ? -slideProgress : slideProgress;
|
946 |
-
}
|
947 |
-
};
|
948 |
-
s.updateProgress = function (translate) {
|
949 |
-
if (typeof translate === 'undefined') {
|
950 |
-
translate = s.translate || 0;
|
951 |
-
}
|
952 |
-
var translatesDiff = s.maxTranslate() - s.minTranslate();
|
953 |
-
var wasBeginning = s.isBeginning;
|
954 |
-
var wasEnd = s.isEnd;
|
955 |
-
if (translatesDiff === 0) {
|
956 |
-
s.progress = 0;
|
957 |
-
s.isBeginning = s.isEnd = true;
|
958 |
-
}
|
959 |
-
else {
|
960 |
-
s.progress = (translate - s.minTranslate()) / (translatesDiff);
|
961 |
-
s.isBeginning = s.progress <= 0;
|
962 |
-
s.isEnd = s.progress >= 1;
|
963 |
-
}
|
964 |
-
if (s.isBeginning && !wasBeginning) s.emit('onReachBeginning', s);
|
965 |
-
if (s.isEnd && !wasEnd) s.emit('onReachEnd', s);
|
966 |
-
|
967 |
-
if (s.params.watchSlidesProgress) s.updateSlidesProgress(translate);
|
968 |
-
s.emit('onProgress', s, s.progress);
|
969 |
-
};
|
970 |
-
s.updateActiveIndex = function () {
|
971 |
-
var translate = s.rtl ? s.translate : -s.translate;
|
972 |
-
var newActiveIndex, i, snapIndex;
|
973 |
-
for (i = 0; i < s.slidesGrid.length; i ++) {
|
974 |
-
if (typeof s.slidesGrid[i + 1] !== 'undefined') {
|
975 |
-
if (translate >= s.slidesGrid[i] && translate < s.slidesGrid[i + 1] - (s.slidesGrid[i + 1] - s.slidesGrid[i]) / 2) {
|
976 |
-
newActiveIndex = i;
|
977 |
-
}
|
978 |
-
else if (translate >= s.slidesGrid[i] && translate < s.slidesGrid[i + 1]) {
|
979 |
-
newActiveIndex = i + 1;
|
980 |
-
}
|
981 |
-
}
|
982 |
-
else {
|
983 |
-
if (translate >= s.slidesGrid[i]) {
|
984 |
-
newActiveIndex = i;
|
985 |
-
}
|
986 |
-
}
|
987 |
-
}
|
988 |
-
// Normalize slideIndex
|
989 |
-
if(s.params.normalizeSlideIndex){
|
990 |
-
if (newActiveIndex < 0 || typeof newActiveIndex === 'undefined') newActiveIndex = 0;
|
991 |
-
}
|
992 |
-
// for (i = 0; i < s.slidesGrid.length; i++) {
|
993 |
-
// if (- translate >= s.slidesGrid[i]) {
|
994 |
-
// newActiveIndex = i;
|
995 |
-
// }
|
996 |
-
// }
|
997 |
-
snapIndex = Math.floor(newActiveIndex / s.params.slidesPerGroup);
|
998 |
-
if (snapIndex >= s.snapGrid.length) snapIndex = s.snapGrid.length - 1;
|
999 |
-
|
1000 |
-
if (newActiveIndex === s.activeIndex) {
|
1001 |
-
return;
|
1002 |
-
}
|
1003 |
-
s.snapIndex = snapIndex;
|
1004 |
-
s.previousIndex = s.activeIndex;
|
1005 |
-
s.activeIndex = newActiveIndex;
|
1006 |
-
s.updateClasses();
|
1007 |
-
s.updateRealIndex();
|
1008 |
-
};
|
1009 |
-
s.updateRealIndex = function(){
|
1010 |
-
s.realIndex = s.slides.eq(s.activeIndex).attr('data-swiper-slide-index') || s.activeIndex;
|
1011 |
-
};
|
1012 |
-
|
1013 |
-
/*=========================
|
1014 |
-
Classes
|
1015 |
-
===========================*/
|
1016 |
-
s.updateClasses = function () {
|
1017 |
-
s.slides.removeClass(s.params.slideActiveClass + ' ' + s.params.slideNextClass + ' ' + s.params.slidePrevClass + ' ' + s.params.slideDuplicateActiveClass + ' ' + s.params.slideDuplicateNextClass + ' ' + s.params.slideDuplicatePrevClass);
|
1018 |
-
var activeSlide = s.slides.eq(s.activeIndex);
|
1019 |
-
// Active classes
|
1020 |
-
activeSlide.addClass(s.params.slideActiveClass);
|
1021 |
-
if (params.loop) {
|
1022 |
-
// Duplicate to all looped slides
|
1023 |
-
if (activeSlide.hasClass(s.params.slideDuplicateClass)) {
|
1024 |
-
s.wrapper.children('.' + s.params.slideClass + ':not(.' + s.params.slideDuplicateClass + ')[data-swiper-slide-index="' + s.realIndex + '"]').addClass(s.params.slideDuplicateActiveClass);
|
1025 |
-
}
|
1026 |
-
else {
|
1027 |
-
s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass + '[data-swiper-slide-index="' + s.realIndex + '"]').addClass(s.params.slideDuplicateActiveClass);
|
1028 |
-
}
|
1029 |
-
}
|
1030 |
-
// Next Slide
|
1031 |
-
var nextSlide = activeSlide.next('.' + s.params.slideClass).addClass(s.params.slideNextClass);
|
1032 |
-
if (s.params.loop && nextSlide.length === 0) {
|
1033 |
-
nextSlide = s.slides.eq(0);
|
1034 |
-
nextSlide.addClass(s.params.slideNextClass);
|
1035 |
-
}
|
1036 |
-
// Prev Slide
|
1037 |
-
var prevSlide = activeSlide.prev('.' + s.params.slideClass).addClass(s.params.slidePrevClass);
|
1038 |
-
if (s.params.loop && prevSlide.length === 0) {
|
1039 |
-
prevSlide = s.slides.eq(-1);
|
1040 |
-
prevSlide.addClass(s.params.slidePrevClass);
|
1041 |
-
}
|
1042 |
-
if (params.loop) {
|
1043 |
-
// Duplicate to all looped slides
|
1044 |
-
if (nextSlide.hasClass(s.params.slideDuplicateClass)) {
|
1045 |
-
s.wrapper.children('.' + s.params.slideClass + ':not(.' + s.params.slideDuplicateClass + ')[data-swiper-slide-index="' + nextSlide.attr('data-swiper-slide-index') + '"]').addClass(s.params.slideDuplicateNextClass);
|
1046 |
-
}
|
1047 |
-
else {
|
1048 |
-
s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass + '[data-swiper-slide-index="' + nextSlide.attr('data-swiper-slide-index') + '"]').addClass(s.params.slideDuplicateNextClass);
|
1049 |
-
}
|
1050 |
-
if (prevSlide.hasClass(s.params.slideDuplicateClass)) {
|
1051 |
-
s.wrapper.children('.' + s.params.slideClass + ':not(.' + s.params.slideDuplicateClass + ')[data-swiper-slide-index="' + prevSlide.attr('data-swiper-slide-index') + '"]').addClass(s.params.slideDuplicatePrevClass);
|
1052 |
-
}
|
1053 |
-
else {
|
1054 |
-
s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass + '[data-swiper-slide-index="' + prevSlide.attr('data-swiper-slide-index') + '"]').addClass(s.params.slideDuplicatePrevClass);
|
1055 |
-
}
|
1056 |
-
}
|
1057 |
-
|
1058 |
-
// Pagination
|
1059 |
-
if (s.paginationContainer && s.paginationContainer.length > 0) {
|
1060 |
-
// Current/Total
|
1061 |
-
var current,
|
1062 |
-
total = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length;
|
1063 |
-
if (s.params.loop) {
|
1064 |
-
current = Math.ceil((s.activeIndex - s.loopedSlides)/s.params.slidesPerGroup);
|
1065 |
-
if (current > s.slides.length - 1 - s.loopedSlides * 2) {
|
1066 |
-
current = current - (s.slides.length - s.loopedSlides * 2);
|
1067 |
-
}
|
1068 |
-
if (current > total - 1) current = current - total;
|
1069 |
-
if (current < 0 && s.params.paginationType !== 'bullets') current = total + current;
|
1070 |
-
}
|
1071 |
-
else {
|
1072 |
-
if (typeof s.snapIndex !== 'undefined') {
|
1073 |
-
current = s.snapIndex;
|
1074 |
-
}
|
1075 |
-
else {
|
1076 |
-
current = s.activeIndex || 0;
|
1077 |
-
}
|
1078 |
-
}
|
1079 |
-
// Types
|
1080 |
-
if (s.params.paginationType === 'bullets' && s.bullets && s.bullets.length > 0) {
|
1081 |
-
s.bullets.removeClass(s.params.bulletActiveClass);
|
1082 |
-
if (s.paginationContainer.length > 1) {
|
1083 |
-
s.bullets.each(function () {
|
1084 |
-
if ($(this).index() === current) $(this).addClass(s.params.bulletActiveClass);
|
1085 |
-
});
|
1086 |
-
}
|
1087 |
-
else {
|
1088 |
-
s.bullets.eq(current).addClass(s.params.bulletActiveClass);
|
1089 |
-
}
|
1090 |
-
}
|
1091 |
-
if (s.params.paginationType === 'fraction') {
|
1092 |
-
s.paginationContainer.find('.' + s.params.paginationCurrentClass).text(current + 1);
|
1093 |
-
s.paginationContainer.find('.' + s.params.paginationTotalClass).text(total);
|
1094 |
-
}
|
1095 |
-
if (s.params.paginationType === 'progress') {
|
1096 |
-
var scale = (current + 1) / total,
|
1097 |
-
scaleX = scale,
|
1098 |
-
scaleY = 1;
|
1099 |
-
if (!s.isHorizontal()) {
|
1100 |
-
scaleY = scale;
|
1101 |
-
scaleX = 1;
|
1102 |
-
}
|
1103 |
-
s.paginationContainer.find('.' + s.params.paginationProgressbarClass).transform('translate3d(0,0,0) scaleX(' + scaleX + ') scaleY(' + scaleY + ')').transition(s.params.speed);
|
1104 |
-
}
|
1105 |
-
if (s.params.paginationType === 'custom' && s.params.paginationCustomRender) {
|
1106 |
-
s.paginationContainer.html(s.params.paginationCustomRender(s, current + 1, total));
|
1107 |
-
s.emit('onPaginationRendered', s, s.paginationContainer[0]);
|
1108 |
-
}
|
1109 |
-
}
|
1110 |
-
|
1111 |
-
// Next/active buttons
|
1112 |
-
if (!s.params.loop) {
|
1113 |
-
if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
|
1114 |
-
if (s.isBeginning) {
|
1115 |
-
s.prevButton.addClass(s.params.buttonDisabledClass);
|
1116 |
-
if (s.params.a11y && s.a11y) s.a11y.disable(s.prevButton);
|
1117 |
-
}
|
1118 |
-
else {
|
1119 |
-
s.prevButton.removeClass(s.params.buttonDisabledClass);
|
1120 |
-
if (s.params.a11y && s.a11y) s.a11y.enable(s.prevButton);
|
1121 |
-
}
|
1122 |
-
}
|
1123 |
-
if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
|
1124 |
-
if (s.isEnd) {
|
1125 |
-
s.nextButton.addClass(s.params.buttonDisabledClass);
|
1126 |
-
if (s.params.a11y && s.a11y) s.a11y.disable(s.nextButton);
|
1127 |
-
}
|
1128 |
-
else {
|
1129 |
-
s.nextButton.removeClass(s.params.buttonDisabledClass);
|
1130 |
-
if (s.params.a11y && s.a11y) s.a11y.enable(s.nextButton);
|
1131 |
-
}
|
1132 |
-
}
|
1133 |
-
}
|
1134 |
-
};
|
1135 |
-
|
1136 |
-
/*=========================
|
1137 |
-
Pagination
|
1138 |
-
===========================*/
|
1139 |
-
s.updatePagination = function () {
|
1140 |
-
if (!s.params.pagination) return;
|
1141 |
-
if (s.paginationContainer && s.paginationContainer.length > 0) {
|
1142 |
-
var paginationHTML = '';
|
1143 |
-
if (s.params.paginationType === 'bullets') {
|
1144 |
-
var numberOfBullets = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length;
|
1145 |
-
for (var i = 0; i < numberOfBullets; i++) {
|
1146 |
-
if (s.params.paginationBulletRender) {
|
1147 |
-
paginationHTML += s.params.paginationBulletRender(s, i, s.params.bulletClass);
|
1148 |
-
}
|
1149 |
-
else {
|
1150 |
-
paginationHTML += '<' + s.params.paginationElement+' class="' + s.params.bulletClass + '"></' + s.params.paginationElement + '>';
|
1151 |
-
}
|
1152 |
-
}
|
1153 |
-
s.paginationContainer.html(paginationHTML);
|
1154 |
-
s.bullets = s.paginationContainer.find('.' + s.params.bulletClass);
|
1155 |
-
if (s.params.paginationClickable && s.params.a11y && s.a11y) {
|
1156 |
-
s.a11y.initPagination();
|
1157 |
-
}
|
1158 |
-
}
|
1159 |
-
if (s.params.paginationType === 'fraction') {
|
1160 |
-
if (s.params.paginationFractionRender) {
|
1161 |
-
paginationHTML = s.params.paginationFractionRender(s, s.params.paginationCurrentClass, s.params.paginationTotalClass);
|
1162 |
-
}
|
1163 |
-
else {
|
1164 |
-
paginationHTML =
|
1165 |
-
'<span class="' + s.params.paginationCurrentClass + '"></span>' +
|
1166 |
-
' / ' +
|
1167 |
-
'<span class="' + s.params.paginationTotalClass+'"></span>';
|
1168 |
-
}
|
1169 |
-
s.paginationContainer.html(paginationHTML);
|
1170 |
-
}
|
1171 |
-
if (s.params.paginationType === 'progress') {
|
1172 |
-
if (s.params.paginationProgressRender) {
|
1173 |
-
paginationHTML = s.params.paginationProgressRender(s, s.params.paginationProgressbarClass);
|
1174 |
-
}
|
1175 |
-
else {
|
1176 |
-
paginationHTML = '<span class="' + s.params.paginationProgressbarClass + '"></span>';
|
1177 |
-
}
|
1178 |
-
s.paginationContainer.html(paginationHTML);
|
1179 |
-
}
|
1180 |
-
if (s.params.paginationType !== 'custom') {
|
1181 |
-
s.emit('onPaginationRendered', s, s.paginationContainer[0]);
|
1182 |
-
}
|
1183 |
-
}
|
1184 |
-
};
|
1185 |
-
/*=========================
|
1186 |
-
Common update method
|
1187 |
-
===========================*/
|
1188 |
-
s.update = function (updateTranslate) {
|
1189 |
-
s.updateContainerSize();
|
1190 |
-
s.updateSlidesSize();
|
1191 |
-
s.updateProgress();
|
1192 |
-
s.updatePagination();
|
1193 |
-
s.updateClasses();
|
1194 |
-
if (s.params.scrollbar && s.scrollbar) {
|
1195 |
-
s.scrollbar.set();
|
1196 |
-
}
|
1197 |
-
function forceSetTranslate() {
|
1198 |
-
var translate = s.rtl ? -s.translate : s.translate;
|
1199 |
-
newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate());
|
1200 |
-
s.setWrapperTranslate(newTranslate);
|
1201 |
-
s.updateActiveIndex();
|
1202 |
-
s.updateClasses();
|
1203 |
-
}
|
1204 |
-
if (updateTranslate) {
|
1205 |
-
var translated, newTranslate;
|
1206 |
-
if (s.controller && s.controller.spline) {
|
1207 |
-
s.controller.spline = undefined;
|
1208 |
-
}
|
1209 |
-
if (s.params.freeMode) {
|
1210 |
-
forceSetTranslate();
|
1211 |
-
if (s.params.autoHeight) {
|
1212 |
-
s.updateAutoHeight();
|
1213 |
-
}
|
1214 |
-
}
|
1215 |
-
else {
|
1216 |
-
if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) {
|
1217 |
-
translated = s.slideTo(s.slides.length - 1, 0, false, true);
|
1218 |
-
}
|
1219 |
-
else {
|
1220 |
-
translated = s.slideTo(s.activeIndex, 0, false, true);
|
1221 |
-
}
|
1222 |
-
if (!translated) {
|
1223 |
-
forceSetTranslate();
|
1224 |
-
}
|
1225 |
-
}
|
1226 |
-
}
|
1227 |
-
else if (s.params.autoHeight) {
|
1228 |
-
s.updateAutoHeight();
|
1229 |
-
}
|
1230 |
-
};
|
1231 |
-
|
1232 |
-
/*=========================
|
1233 |
-
Resize Handler
|
1234 |
-
===========================*/
|
1235 |
-
s.onResize = function (forceUpdatePagination) {
|
1236 |
-
//Breakpoints
|
1237 |
-
if (s.params.breakpoints) {
|
1238 |
-
s.setBreakpoint();
|
1239 |
-
}
|
1240 |
-
|
1241 |
-
// Disable locks on resize
|
1242 |
-
var allowSwipeToPrev = s.params.allowSwipeToPrev;
|
1243 |
-
var allowSwipeToNext = s.params.allowSwipeToNext;
|
1244 |
-
s.params.allowSwipeToPrev = s.params.allowSwipeToNext = true;
|
1245 |
-
|
1246 |
-
s.updateContainerSize();
|
1247 |
-
s.updateSlidesSize();
|
1248 |
-
if (s.params.slidesPerView === 'auto' || s.params.freeMode || forceUpdatePagination) s.updatePagination();
|
1249 |
-
if (s.params.scrollbar && s.scrollbar) {
|
1250 |
-
s.scrollbar.set();
|
1251 |
-
}
|
1252 |
-
if (s.controller && s.controller.spline) {
|
1253 |
-
s.controller.spline = undefined;
|
1254 |
-
}
|
1255 |
-
var slideChangedBySlideTo = false;
|
1256 |
-
if (s.params.freeMode) {
|
1257 |
-
var newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate());
|
1258 |
-
s.setWrapperTranslate(newTranslate);
|
1259 |
-
s.updateActiveIndex();
|
1260 |
-
s.updateClasses();
|
1261 |
-
|
1262 |
-
if (s.params.autoHeight) {
|
1263 |
-
s.updateAutoHeight();
|
1264 |
-
}
|
1265 |
-
}
|
1266 |
-
else {
|
1267 |
-
s.updateClasses();
|
1268 |
-
if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) {
|
1269 |
-
slideChangedBySlideTo = s.slideTo(s.slides.length - 1, 0, false, true);
|
1270 |
-
}
|
1271 |
-
else {
|
1272 |
-
slideChangedBySlideTo = s.slideTo(s.activeIndex, 0, false, true);
|
1273 |
-
}
|
1274 |
-
}
|
1275 |
-
if (s.params.lazyLoading && !slideChangedBySlideTo && s.lazy) {
|
1276 |
-
s.lazy.load();
|
1277 |
-
}
|
1278 |
-
// Return locks after resize
|
1279 |
-
s.params.allowSwipeToPrev = allowSwipeToPrev;
|
1280 |
-
s.params.allowSwipeToNext = allowSwipeToNext;
|
1281 |
-
};
|
1282 |
-
|
1283 |
-
/*=========================
|
1284 |
-
Events
|
1285 |
-
===========================*/
|
1286 |
-
|
1287 |
-
//Define Touch Events
|
1288 |
-
s.touchEventsDesktop = {start: 'mousedown', move: 'mousemove', end: 'mouseup'};
|
1289 |
-
if (window.navigator.pointerEnabled) s.touchEventsDesktop = {start: 'pointerdown', move: 'pointermove', end: 'pointerup'};
|
1290 |
-
else if (window.navigator.msPointerEnabled) s.touchEventsDesktop = {start: 'MSPointerDown', move: 'MSPointerMove', end: 'MSPointerUp'};
|
1291 |
-
s.touchEvents = {
|
1292 |
-
start : s.support.touch || !s.params.simulateTouch ? 'touchstart' : s.touchEventsDesktop.start,
|
1293 |
-
move : s.support.touch || !s.params.simulateTouch ? 'touchmove' : s.touchEventsDesktop.move,
|
1294 |
-
end : s.support.touch || !s.params.simulateTouch ? 'touchend' : s.touchEventsDesktop.end
|
1295 |
-
};
|
1296 |
-
|
1297 |
-
|
1298 |
-
// WP8 Touch Events Fix
|
1299 |
-
if (window.navigator.pointerEnabled || window.navigator.msPointerEnabled) {
|
1300 |
-
(s.params.touchEventsTarget === 'container' ? s.container : s.wrapper).addClass('swiper-wp8-' + s.params.direction);
|
1301 |
-
}
|
1302 |
-
|
1303 |
-
// Attach/detach events
|
1304 |
-
s.initEvents = function (detach) {
|
1305 |
-
var actionDom = detach ? 'off' : 'on';
|
1306 |
-
var action = detach ? 'removeEventListener' : 'addEventListener';
|
1307 |
-
var touchEventsTarget = s.params.touchEventsTarget === 'container' ? s.container[0] : s.wrapper[0];
|
1308 |
-
var target = s.support.touch ? touchEventsTarget : document;
|
1309 |
-
|
1310 |
-
var moveCapture = s.params.nested ? true : false;
|
1311 |
-
|
1312 |
-
//Touch Events
|
1313 |
-
if (s.browser.ie) {
|
1314 |
-
touchEventsTarget[action](s.touchEvents.start, s.onTouchStart, false);
|
1315 |
-
target[action](s.touchEvents.move, s.onTouchMove, moveCapture);
|
1316 |
-
target[action](s.touchEvents.end, s.onTouchEnd, false);
|
1317 |
-
}
|
1318 |
-
else {
|
1319 |
-
if (s.support.touch) {
|
1320 |
-
var passiveListener = s.touchEvents.start === 'touchstart' && s.support.passiveListener && s.params.passiveListeners ? {passive: true, capture: false} : false;
|
1321 |
-
touchEventsTarget[action](s.touchEvents.start, s.onTouchStart, passiveListener);
|
1322 |
-
touchEventsTarget[action](s.touchEvents.move, s.onTouchMove, moveCapture);
|
1323 |
-
touchEventsTarget[action](s.touchEvents.end, s.onTouchEnd, passiveListener);
|
1324 |
-
}
|
1325 |
-
if ((params.simulateTouch && !s.device.ios && !s.device.android) || (params.simulateTouch && !s.support.touch && s.device.ios)) {
|
1326 |
-
touchEventsTarget[action]('mousedown', s.onTouchStart, false);
|
1327 |
-
document[action]('mousemove', s.onTouchMove, moveCapture);
|
1328 |
-
document[action]('mouseup', s.onTouchEnd, false);
|
1329 |
-
}
|
1330 |
-
}
|
1331 |
-
window[action]('resize', s.onResize);
|
1332 |
-
|
1333 |
-
// Next, Prev, Index
|
1334 |
-
if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
|
1335 |
-
s.nextButton[actionDom]('click', s.onClickNext);
|
1336 |
-
if (s.params.a11y && s.a11y) s.nextButton[actionDom]('keydown', s.a11y.onEnterKey);
|
1337 |
-
}
|
1338 |
-
if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
|
1339 |
-
s.prevButton[actionDom]('click', s.onClickPrev);
|
1340 |
-
if (s.params.a11y && s.a11y) s.prevButton[actionDom]('keydown', s.a11y.onEnterKey);
|
1341 |
-
}
|
1342 |
-
if (s.params.pagination && s.params.paginationClickable) {
|
1343 |
-
s.paginationContainer[actionDom]('click', '.' + s.params.bulletClass, s.onClickIndex);
|
1344 |
-
if (s.params.a11y && s.a11y) s.paginationContainer[actionDom]('keydown', '.' + s.params.bulletClass, s.a11y.onEnterKey);
|
1345 |
-
}
|
1346 |
-
|
1347 |
-
// Prevent Links Clicks
|
1348 |
-
if (s.params.preventClicks || s.params.preventClicksPropagation) touchEventsTarget[action]('click', s.preventClicks, true);
|
1349 |
-
};
|
1350 |
-
s.attachEvents = function () {
|
1351 |
-
s.initEvents();
|
1352 |
-
};
|
1353 |
-
s.detachEvents = function () {
|
1354 |
-
s.initEvents(true);
|
1355 |
-
};
|
1356 |
-
|
1357 |
-
/*=========================
|
1358 |
-
Handle Clicks
|
1359 |
-
===========================*/
|
1360 |
-
// Prevent Clicks
|
1361 |
-
s.allowClick = true;
|
1362 |
-
s.preventClicks = function (e) {
|
1363 |
-
if (!s.allowClick) {
|
1364 |
-
if (s.params.preventClicks) e.preventDefault();
|
1365 |
-
if (s.params.preventClicksPropagation && s.animating) {
|
1366 |
-
e.stopPropagation();
|
1367 |
-
e.stopImmediatePropagation();
|
1368 |
-
}
|
1369 |
-
}
|
1370 |
-
};
|
1371 |
-
// Clicks
|
1372 |
-
s.onClickNext = function (e) {
|
1373 |
-
e.preventDefault();
|
1374 |
-
if (s.isEnd && !s.params.loop) return;
|
1375 |
-
s.slideNext();
|
1376 |
-
};
|
1377 |
-
s.onClickPrev = function (e) {
|
1378 |
-
e.preventDefault();
|
1379 |
-
if (s.isBeginning && !s.params.loop) return;
|
1380 |
-
s.slidePrev();
|
1381 |
-
};
|
1382 |
-
s.onClickIndex = function (e) {
|
1383 |
-
e.preventDefault();
|
1384 |
-
var index = $(this).index() * s.params.slidesPerGroup;
|
1385 |
-
if (s.params.loop) index = index + s.loopedSlides;
|
1386 |
-
s.slideTo(index);
|
1387 |
-
};
|
1388 |
-
|
1389 |
-
/*=========================
|
1390 |
-
Handle Touches
|
1391 |
-
===========================*/
|
1392 |
-
function findElementInEvent(e, selector) {
|
1393 |
-
var el = $(e.target);
|
1394 |
-
if (!el.is(selector)) {
|
1395 |
-
if (typeof selector === 'string') {
|
1396 |
-
el = el.parents(selector);
|
1397 |
-
}
|
1398 |
-
else if (selector.nodeType) {
|
1399 |
-
var found;
|
1400 |
-
el.parents().each(function (index, _el) {
|
1401 |
-
if (_el === selector) found = selector;
|
1402 |
-
});
|
1403 |
-
if (!found) return undefined;
|
1404 |
-
else return selector;
|
1405 |
-
}
|
1406 |
-
}
|
1407 |
-
if (el.length === 0) {
|
1408 |
-
return undefined;
|
1409 |
-
}
|
1410 |
-
return el[0];
|
1411 |
-
}
|
1412 |
-
s.updateClickedSlide = function (e) {
|
1413 |
-
var slide = findElementInEvent(e, '.' + s.params.slideClass);
|
1414 |
-
var slideFound = false;
|
1415 |
-
if (slide) {
|
1416 |
-
for (var i = 0; i < s.slides.length; i++) {
|
1417 |
-
if (s.slides[i] === slide) slideFound = true;
|
1418 |
-
}
|
1419 |
-
}
|
1420 |
-
|
1421 |
-
if (slide && slideFound) {
|
1422 |
-
s.clickedSlide = slide;
|
1423 |
-
s.clickedIndex = $(slide).index();
|
1424 |
-
}
|
1425 |
-
else {
|
1426 |
-
s.clickedSlide = undefined;
|
1427 |
-
s.clickedIndex = undefined;
|
1428 |
-
return;
|
1429 |
-
}
|
1430 |
-
if (s.params.slideToClickedSlide && s.clickedIndex !== undefined && s.clickedIndex !== s.activeIndex) {
|
1431 |
-
var slideToIndex = s.clickedIndex,
|
1432 |
-
realIndex,
|
1433 |
-
duplicatedSlides;
|
1434 |
-
if (s.params.loop) {
|
1435 |
-
if (s.animating) return;
|
1436 |
-
realIndex = $(s.clickedSlide).attr('data-swiper-slide-index');
|
1437 |
-
if (s.params.centeredSlides) {
|
1438 |
-
if ((slideToIndex < s.loopedSlides - s.params.slidesPerView/2) || (slideToIndex > s.slides.length - s.loopedSlides + s.params.slidesPerView/2)) {
|
1439 |
-
s.fixLoop();
|
1440 |
-
slideToIndex = s.wrapper.children('.' + s.params.slideClass + '[data-swiper-slide-index="' + realIndex + '"]:not(.' + s.params.slideDuplicateClass + ')').eq(0).index();
|
1441 |
-
setTimeout(function () {
|
1442 |
-
s.slideTo(slideToIndex);
|
1443 |
-
}, 0);
|
1444 |
-
}
|
1445 |
-
else {
|
1446 |
-
s.slideTo(slideToIndex);
|
1447 |
-
}
|
1448 |
-
}
|
1449 |
-
else {
|
1450 |
-
if (slideToIndex > s.slides.length - s.params.slidesPerView) {
|
1451 |
-
s.fixLoop();
|
1452 |
-
slideToIndex = s.wrapper.children('.' + s.params.slideClass + '[data-swiper-slide-index="' + realIndex + '"]:not(.' + s.params.slideDuplicateClass + ')').eq(0).index();
|
1453 |
-
setTimeout(function () {
|
1454 |
-
s.slideTo(slideToIndex);
|
1455 |
-
}, 0);
|
1456 |
-
}
|
1457 |
-
else {
|
1458 |
-
s.slideTo(slideToIndex);
|
1459 |
-
}
|
1460 |
-
}
|
1461 |
-
}
|
1462 |
-
else {
|
1463 |
-
s.slideTo(slideToIndex);
|
1464 |
-
}
|
1465 |
-
}
|
1466 |
-
};
|
1467 |
-
|
1468 |
-
var isTouched,
|
1469 |
-
isMoved,
|
1470 |
-
allowTouchCallbacks,
|
1471 |
-
touchStartTime,
|
1472 |
-
isScrolling,
|
1473 |
-
currentTranslate,
|
1474 |
-
startTranslate,
|
1475 |
-
allowThresholdMove,
|
1476 |
-
// Form elements to match
|
1477 |
-
formElements = 'input, select, textarea, button, video',
|
1478 |
-
// Last click time
|
1479 |
-
lastClickTime = Date.now(), clickTimeout,
|
1480 |
-
//Velocities
|
1481 |
-
velocities = [],
|
1482 |
-
allowMomentumBounce;
|
1483 |
-
|
1484 |
-
// Animating Flag
|
1485 |
-
s.animating = false;
|
1486 |
-
|
1487 |
-
// Touches information
|
1488 |
-
s.touches = {
|
1489 |
-
startX: 0,
|
1490 |
-
startY: 0,
|
1491 |
-
currentX: 0,
|
1492 |
-
currentY: 0,
|
1493 |
-
diff: 0
|
1494 |
-
};
|
1495 |
-
|
1496 |
-
// Touch handlers
|
1497 |
-
var isTouchEvent, startMoving;
|
1498 |
-
s.onTouchStart = function (e) {
|
1499 |
-
if (e.originalEvent) e = e.originalEvent;
|
1500 |
-
isTouchEvent = e.type === 'touchstart';
|
1501 |
-
if (!isTouchEvent && 'which' in e && e.which === 3) return;
|
1502 |
-
if (s.params.noSwiping && findElementInEvent(e, '.' + s.params.noSwipingClass)) {
|
1503 |
-
s.allowClick = true;
|
1504 |
-
return;
|
1505 |
-
}
|
1506 |
-
if (s.params.swipeHandler) {
|
1507 |
-
if (!findElementInEvent(e, s.params.swipeHandler)) return;
|
1508 |
-
}
|
1509 |
-
|
1510 |
-
var startX = s.touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
|
1511 |
-
var startY = s.touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
|
1512 |
-
|
1513 |
-
// Do NOT start if iOS edge swipe is detected. Otherwise iOS app (UIWebView) cannot swipe-to-go-back anymore
|
1514 |
-
if(s.device.ios && s.params.iOSEdgeSwipeDetection && startX <= s.params.iOSEdgeSwipeThreshold) {
|
1515 |
-
return;
|
1516 |
-
}
|
1517 |
-
|
1518 |
-
isTouched = true;
|
1519 |
-
isMoved = false;
|
1520 |
-
allowTouchCallbacks = true;
|
1521 |
-
isScrolling = undefined;
|
1522 |
-
startMoving = undefined;
|
1523 |
-
s.touches.startX = startX;
|
1524 |
-
s.touches.startY = startY;
|
1525 |
-
touchStartTime = Date.now();
|
1526 |
-
s.allowClick = true;
|
1527 |
-
s.updateContainerSize();
|
1528 |
-
s.swipeDirection = undefined;
|
1529 |
-
if (s.params.threshold > 0) allowThresholdMove = false;
|
1530 |
-
if (e.type !== 'touchstart') {
|
1531 |
-
var preventDefault = true;
|
1532 |
-
if ($(e.target).is(formElements)) preventDefault = false;
|
1533 |
-
if (document.activeElement && $(document.activeElement).is(formElements)) {
|
1534 |
-
document.activeElement.blur();
|
1535 |
-
}
|
1536 |
-
if (preventDefault) {
|
1537 |
-
e.preventDefault();
|
1538 |
-
}
|
1539 |
-
}
|
1540 |
-
s.emit('onTouchStart', s, e);
|
1541 |
-
};
|
1542 |
-
|
1543 |
-
s.onTouchMove = function (e) {
|
1544 |
-
if (e.originalEvent) e = e.originalEvent;
|
1545 |
-
if (isTouchEvent && e.type === 'mousemove') return;
|
1546 |
-
if (e.preventedByNestedSwiper) {
|
1547 |
-
s.touches.startX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
|
1548 |
-
s.touches.startY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
|
1549 |
-
return;
|
1550 |
-
}
|
1551 |
-
if (s.params.onlyExternal) {
|
1552 |
-
// isMoved = true;
|
1553 |
-
s.allowClick = false;
|
1554 |
-
if (isTouched) {
|
1555 |
-
s.touches.startX = s.touches.currentX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
|
1556 |
-
s.touches.startY = s.touches.currentY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
|
1557 |
-
touchStartTime = Date.now();
|
1558 |
-
}
|
1559 |
-
return;
|
1560 |
-
}
|
1561 |
-
if (isTouchEvent && s.params.touchReleaseOnEdges && !s.params.loop) {
|
1562 |
-
if (!s.isHorizontal()) {
|
1563 |
-
// Vertical
|
1564 |
-
if (
|
1565 |
-
(s.touches.currentY < s.touches.startY && s.translate <= s.maxTranslate()) ||
|
1566 |
-
(s.touches.currentY > s.touches.startY && s.translate >= s.minTranslate())
|
1567 |
-
) {
|
1568 |
-
return;
|
1569 |
-
}
|
1570 |
-
}
|
1571 |
-
else {
|
1572 |
-
if (
|
1573 |
-
(s.touches.currentX < s.touches.startX && s.translate <= s.maxTranslate()) ||
|
1574 |
-
(s.touches.currentX > s.touches.startX && s.translate >= s.minTranslate())
|
1575 |
-
) {
|
1576 |
-
return;
|
1577 |
-
}
|
1578 |
-
}
|
1579 |
-
}
|
1580 |
-
if (isTouchEvent && document.activeElement) {
|
1581 |
-
if (e.target === document.activeElement && $(e.target).is(formElements)) {
|
1582 |
-
isMoved = true;
|
1583 |
-
s.allowClick = false;
|
1584 |
-
return;
|
1585 |
-
}
|
1586 |
-
}
|
1587 |
-
if (allowTouchCallbacks) {
|
1588 |
-
s.emit('onTouchMove', s, e);
|
1589 |
-
}
|
1590 |
-
if (e.targetTouches && e.targetTouches.length > 1) return;
|
1591 |
-
|
1592 |
-
s.touches.currentX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
|
1593 |
-
s.touches.currentY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
|
1594 |
-
|
1595 |
-
if (typeof isScrolling === 'undefined') {
|
1596 |
-
var touchAngle;
|
1597 |
-
if (s.isHorizontal() && s.touches.currentY === s.touches.startY || !s.isHorizontal() && s.touches.currentX !== s.touches.startX) {
|
1598 |
-
isScrolling = false;
|
1599 |
-
}
|
1600 |
-
else {
|
1601 |
-
touchAngle = Math.atan2(Math.abs(s.touches.currentY - s.touches.startY), Math.abs(s.touches.currentX - s.touches.startX)) * 180 / Math.PI;
|
1602 |
-
isScrolling = s.isHorizontal() ? touchAngle > s.params.touchAngle : (90 - touchAngle > s.params.touchAngle);
|
1603 |
-
}
|
1604 |
-
}
|
1605 |
-
if (isScrolling) {
|
1606 |
-
s.emit('onTouchMoveOpposite', s, e);
|
1607 |
-
}
|
1608 |
-
if (typeof startMoving === 'undefined' && s.browser.ieTouch) {
|
1609 |
-
if (s.touches.currentX !== s.touches.startX || s.touches.currentY !== s.touches.startY) {
|
1610 |
-
startMoving = true;
|
1611 |
-
}
|
1612 |
-
}
|
1613 |
-
if (!isTouched) return;
|
1614 |
-
if (isScrolling) {
|
1615 |
-
isTouched = false;
|
1616 |
-
return;
|
1617 |
-
}
|
1618 |
-
if (!startMoving && s.browser.ieTouch) {
|
1619 |
-
return;
|
1620 |
-
}
|
1621 |
-
s.allowClick = false;
|
1622 |
-
s.emit('onSliderMove', s, e);
|
1623 |
-
e.preventDefault();
|
1624 |
-
if (s.params.touchMoveStopPropagation && !s.params.nested) {
|
1625 |
-
e.stopPropagation();
|
1626 |
-
}
|
1627 |
-
|
1628 |
-
if (!isMoved) {
|
1629 |
-
if (params.loop) {
|
1630 |
-
s.fixLoop();
|
1631 |
-
}
|
1632 |
-
startTranslate = s.getWrapperTranslate();
|
1633 |
-
s.setWrapperTransition(0);
|
1634 |
-
if (s.animating) {
|
1635 |
-
s.wrapper.trigger('webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd msTransitionEnd');
|
1636 |
-
}
|
1637 |
-
if (s.params.autoplay && s.autoplaying) {
|
1638 |
-
if (s.params.autoplayDisableOnInteraction) {
|
1639 |
-
s.stopAutoplay();
|
1640 |
-
}
|
1641 |
-
else {
|
1642 |
-
s.pauseAutoplay();
|
1643 |
-
}
|
1644 |
-
}
|
1645 |
-
allowMomentumBounce = false;
|
1646 |
-
//Grab Cursor
|
1647 |
-
if (s.params.grabCursor && (s.params.allowSwipeToNext === true || s.params.allowSwipeToPrev === true)) {
|
1648 |
-
s.setGrabCursor(true);
|
1649 |
-
}
|
1650 |
-
}
|
1651 |
-
isMoved = true;
|
1652 |
-
|
1653 |
-
var diff = s.touches.diff = s.isHorizontal() ? s.touches.currentX - s.touches.startX : s.touches.currentY - s.touches.startY;
|
1654 |
-
|
1655 |
-
diff = diff * s.params.touchRatio;
|
1656 |
-
if (s.rtl) diff = -diff;
|
1657 |
-
|
1658 |
-
s.swipeDirection = diff > 0 ? 'prev' : 'next';
|
1659 |
-
currentTranslate = diff + startTranslate;
|
1660 |
-
|
1661 |
-
var disableParentSwiper = true;
|
1662 |
-
if ((diff > 0 && currentTranslate > s.minTranslate())) {
|
1663 |
-
disableParentSwiper = false;
|
1664 |
-
if (s.params.resistance) currentTranslate = s.minTranslate() - 1 + Math.pow(-s.minTranslate() + startTranslate + diff, s.params.resistanceRatio);
|
1665 |
-
}
|
1666 |
-
else if (diff < 0 && currentTranslate < s.maxTranslate()) {
|
1667 |
-
disableParentSwiper = false;
|
1668 |
-
if (s.params.resistance) currentTranslate = s.maxTranslate() + 1 - Math.pow(s.maxTranslate() - startTranslate - diff, s.params.resistanceRatio);
|
1669 |
-
}
|
1670 |
-
|
1671 |
-
if (disableParentSwiper) {
|
1672 |
-
e.preventedByNestedSwiper = true;
|
1673 |
-
}
|
1674 |
-
|
1675 |
-
// Directions locks
|
1676 |
-
if (!s.params.allowSwipeToNext && s.swipeDirection === 'next' && currentTranslate < startTranslate) {
|
1677 |
-
currentTranslate = startTranslate;
|
1678 |
-
}
|
1679 |
-
if (!s.params.allowSwipeToPrev && s.swipeDirection === 'prev' && currentTranslate > startTranslate) {
|
1680 |
-
currentTranslate = startTranslate;
|
1681 |
-
}
|
1682 |
-
|
1683 |
-
|
1684 |
-
// Threshold
|
1685 |
-
if (s.params.threshold > 0) {
|
1686 |
-
if (Math.abs(diff) > s.params.threshold || allowThresholdMove) {
|
1687 |
-
if (!allowThresholdMove) {
|
1688 |
-
allowThresholdMove = true;
|
1689 |
-
s.touches.startX = s.touches.currentX;
|
1690 |
-
s.touches.startY = s.touches.currentY;
|
1691 |
-
currentTranslate = startTranslate;
|
1692 |
-
s.touches.diff = s.isHorizontal() ? s.touches.currentX - s.touches.startX : s.touches.currentY - s.touches.startY;
|
1693 |
-
return;
|
1694 |
-
}
|
1695 |
-
}
|
1696 |
-
else {
|
1697 |
-
currentTranslate = startTranslate;
|
1698 |
-
return;
|
1699 |
-
}
|
1700 |
-
}
|
1701 |
-
|
1702 |
-
if (!s.params.followFinger) return;
|
1703 |
-
|
1704 |
-
// Update active index in free mode
|
1705 |
-
if (s.params.freeMode || s.params.watchSlidesProgress) {
|
1706 |
-
s.updateActiveIndex();
|
1707 |
-
}
|
1708 |
-
if (s.params.freeMode) {
|
1709 |
-
//Velocity
|
1710 |
-
if (velocities.length === 0) {
|
1711 |
-
velocities.push({
|
1712 |
-
position: s.touches[s.isHorizontal() ? 'startX' : 'startY'],
|
1713 |
-
time: touchStartTime
|
1714 |
-
});
|
1715 |
-
}
|
1716 |
-
velocities.push({
|
1717 |
-
position: s.touches[s.isHorizontal() ? 'currentX' : 'currentY'],
|
1718 |
-
time: (new window.Date()).getTime()
|
1719 |
-
});
|
1720 |
-
}
|
1721 |
-
// Update progress
|
1722 |
-
s.updateProgress(currentTranslate);
|
1723 |
-
// Update translate
|
1724 |
-
s.setWrapperTranslate(currentTranslate);
|
1725 |
-
};
|
1726 |
-
s.onTouchEnd = function (e) {
|
1727 |
-
if (e.originalEvent) e = e.originalEvent;
|
1728 |
-
if (allowTouchCallbacks) {
|
1729 |
-
s.emit('onTouchEnd', s, e);
|
1730 |
-
}
|
1731 |
-
allowTouchCallbacks = false;
|
1732 |
-
if (!isTouched) return;
|
1733 |
-
//Return Grab Cursor
|
1734 |
-
if (s.params.grabCursor && isMoved && isTouched && (s.params.allowSwipeToNext === true || s.params.allowSwipeToPrev === true)) {
|
1735 |
-
s.setGrabCursor(false);
|
1736 |
-
}
|
1737 |
-
|
1738 |
-
// Time diff
|
1739 |
-
var touchEndTime = Date.now();
|
1740 |
-
var timeDiff = touchEndTime - touchStartTime;
|
1741 |
-
|
1742 |
-
// Tap, doubleTap, Click
|
1743 |
-
if (s.allowClick) {
|
1744 |
-
s.updateClickedSlide(e);
|
1745 |
-
s.emit('onTap', s, e);
|
1746 |
-
if (timeDiff < 300 && (touchEndTime - lastClickTime) > 300) {
|
1747 |
-
if (clickTimeout) clearTimeout(clickTimeout);
|
1748 |
-
clickTimeout = setTimeout(function () {
|
1749 |
-
if (!s) return;
|
1750 |
-
if (s.params.paginationHide && s.paginationContainer.length > 0 && !$(e.target).hasClass(s.params.bulletClass)) {
|
1751 |
-
s.paginationContainer.toggleClass(s.params.paginationHiddenClass);
|
1752 |
-
}
|
1753 |
-
s.emit('onClick', s, e);
|
1754 |
-
}, 300);
|
1755 |
-
|
1756 |
-
}
|
1757 |
-
if (timeDiff < 300 && (touchEndTime - lastClickTime) < 300) {
|
1758 |
-
if (clickTimeout) clearTimeout(clickTimeout);
|
1759 |
-
s.emit('onDoubleTap', s, e);
|
1760 |
-
}
|
1761 |
-
}
|
1762 |
-
|
1763 |
-
lastClickTime = Date.now();
|
1764 |
-
setTimeout(function () {
|
1765 |
-
if (s) s.allowClick = true;
|
1766 |
-
}, 0);
|
1767 |
-
|
1768 |
-
if (!isTouched || !isMoved || !s.swipeDirection || s.touches.diff === 0 || currentTranslate === startTranslate) {
|
1769 |
-
isTouched = isMoved = false;
|
1770 |
-
return;
|
1771 |
-
}
|
1772 |
-
isTouched = isMoved = false;
|
1773 |
-
|
1774 |
-
var currentPos;
|
1775 |
-
if (s.params.followFinger) {
|
1776 |
-
currentPos = s.rtl ? s.translate : -s.translate;
|
1777 |
-
}
|
1778 |
-
else {
|
1779 |
-
currentPos = -currentTranslate;
|
1780 |
-
}
|
1781 |
-
if (s.params.freeMode) {
|
1782 |
-
if (currentPos < -s.minTranslate()) {
|
1783 |
-
s.slideTo(s.activeIndex);
|
1784 |
-
return;
|
1785 |
-
}
|
1786 |
-
else if (currentPos > -s.maxTranslate()) {
|
1787 |
-
if (s.slides.length < s.snapGrid.length) {
|
1788 |
-
s.slideTo(s.snapGrid.length - 1);
|
1789 |
-
}
|
1790 |
-
else {
|
1791 |
-
s.slideTo(s.slides.length - 1);
|
1792 |
-
}
|
1793 |
-
return;
|
1794 |
-
}
|
1795 |
-
|
1796 |
-
if (s.params.freeModeMomentum) {
|
1797 |
-
if (velocities.length > 1) {
|
1798 |
-
var lastMoveEvent = velocities.pop(), velocityEvent = velocities.pop();
|
1799 |
-
|
1800 |
-
var distance = lastMoveEvent.position - velocityEvent.position;
|
1801 |
-
var time = lastMoveEvent.time - velocityEvent.time;
|
1802 |
-
s.velocity = distance / time;
|
1803 |
-
s.velocity = s.velocity / 2;
|
1804 |
-
if (Math.abs(s.velocity) < s.params.freeModeMinimumVelocity) {
|
1805 |
-
s.velocity = 0;
|
1806 |
-
}
|
1807 |
-
// this implies that the user stopped moving a finger then released.
|
1808 |
-
// There would be no events with distance zero, so the last event is stale.
|
1809 |
-
if (time > 150 || (new window.Date().getTime() - lastMoveEvent.time) > 300) {
|
1810 |
-
s.velocity = 0;
|
1811 |
-
}
|
1812 |
-
} else {
|
1813 |
-
s.velocity = 0;
|
1814 |
-
}
|
1815 |
-
s.velocity = s.velocity * s.params.freeModeMomentumVelocityRatio;
|
1816 |
-
|
1817 |
-
velocities.length = 0;
|
1818 |
-
var momentumDuration = 1000 * s.params.freeModeMomentumRatio;
|
1819 |
-
var momentumDistance = s.velocity * momentumDuration;
|
1820 |
-
|
1821 |
-
var newPosition = s.translate + momentumDistance;
|
1822 |
-
if (s.rtl) newPosition = - newPosition;
|
1823 |
-
var doBounce = false;
|
1824 |
-
var afterBouncePosition;
|
1825 |
-
var bounceAmount = Math.abs(s.velocity) * 20 * s.params.freeModeMomentumBounceRatio;
|
1826 |
-
if (newPosition < s.maxTranslate()) {
|
1827 |
-
if (s.params.freeModeMomentumBounce) {
|
1828 |
-
if (newPosition + s.maxTranslate() < -bounceAmount) {
|
1829 |
-
newPosition = s.maxTranslate() - bounceAmount;
|
1830 |
-
}
|
1831 |
-
afterBouncePosition = s.maxTranslate();
|
1832 |
-
doBounce = true;
|
1833 |
-
allowMomentumBounce = true;
|
1834 |
-
}
|
1835 |
-
else {
|
1836 |
-
newPosition = s.maxTranslate();
|
1837 |
-
}
|
1838 |
-
}
|
1839 |
-
else if (newPosition > s.minTranslate()) {
|
1840 |
-
if (s.params.freeModeMomentumBounce) {
|
1841 |
-
if (newPosition - s.minTranslate() > bounceAmount) {
|
1842 |
-
newPosition = s.minTranslate() + bounceAmount;
|
1843 |
-
}
|
1844 |
-
afterBouncePosition = s.minTranslate();
|
1845 |
-
doBounce = true;
|
1846 |
-
allowMomentumBounce = true;
|
1847 |
-
}
|
1848 |
-
else {
|
1849 |
-
newPosition = s.minTranslate();
|
1850 |
-
}
|
1851 |
-
}
|
1852 |
-
else if (s.params.freeModeSticky) {
|
1853 |
-
var j = 0,
|
1854 |
-
nextSlide;
|
1855 |
-
for (j = 0; j < s.snapGrid.length; j += 1) {
|
1856 |
-
if (s.snapGrid[j] > -newPosition) {
|
1857 |
-
nextSlide = j;
|
1858 |
-
break;
|
1859 |
-
}
|
1860 |
-
|
1861 |
-
}
|
1862 |
-
if (Math.abs(s.snapGrid[nextSlide] - newPosition) < Math.abs(s.snapGrid[nextSlide - 1] - newPosition) || s.swipeDirection === 'next') {
|
1863 |
-
newPosition = s.snapGrid[nextSlide];
|
1864 |
-
} else {
|
1865 |
-
newPosition = s.snapGrid[nextSlide - 1];
|
1866 |
-
}
|
1867 |
-
if (!s.rtl) newPosition = - newPosition;
|
1868 |
-
}
|
1869 |
-
//Fix duration
|
1870 |
-
if (s.velocity !== 0) {
|
1871 |
-
if (s.rtl) {
|
1872 |
-
momentumDuration = Math.abs((-newPosition - s.translate) / s.velocity);
|
1873 |
-
}
|
1874 |
-
else {
|
1875 |
-
momentumDuration = Math.abs((newPosition - s.translate) / s.velocity);
|
1876 |
-
}
|
1877 |
-
}
|
1878 |
-
else if (s.params.freeModeSticky) {
|
1879 |
-
s.slideReset();
|
1880 |
-
return;
|
1881 |
-
}
|
1882 |
-
|
1883 |
-
if (s.params.freeModeMomentumBounce && doBounce) {
|
1884 |
-
s.updateProgress(afterBouncePosition);
|
1885 |
-
s.setWrapperTransition(momentumDuration);
|
1886 |
-
s.setWrapperTranslate(newPosition);
|
1887 |
-
s.onTransitionStart();
|
1888 |
-
s.animating = true;
|
1889 |
-
s.wrapper.transitionEnd(function () {
|
1890 |
-
if (!s || !allowMomentumBounce) return;
|
1891 |
-
s.emit('onMomentumBounce', s);
|
1892 |
-
|
1893 |
-
s.setWrapperTransition(s.params.speed);
|
1894 |
-
s.setWrapperTranslate(afterBouncePosition);
|
1895 |
-
s.wrapper.transitionEnd(function () {
|
1896 |
-
if (!s) return;
|
1897 |
-
s.onTransitionEnd();
|
1898 |
-
});
|
1899 |
-
});
|
1900 |
-
} else if (s.velocity) {
|
1901 |
-
s.updateProgress(newPosition);
|
1902 |
-
s.setWrapperTransition(momentumDuration);
|
1903 |
-
s.setWrapperTranslate(newPosition);
|
1904 |
-
s.onTransitionStart();
|
1905 |
-
if (!s.animating) {
|
1906 |
-
s.animating = true;
|
1907 |
-
s.wrapper.transitionEnd(function () {
|
1908 |
-
if (!s) return;
|
1909 |
-
s.onTransitionEnd();
|
1910 |
-
});
|
1911 |
-
}
|
1912 |
-
|
1913 |
-
} else {
|
1914 |
-
s.updateProgress(newPosition);
|
1915 |
-
}
|
1916 |
-
|
1917 |
-
s.updateActiveIndex();
|
1918 |
-
}
|
1919 |
-
if (!s.params.freeModeMomentum || timeDiff >= s.params.longSwipesMs) {
|
1920 |
-
s.updateProgress();
|
1921 |
-
s.updateActiveIndex();
|
1922 |
-
}
|
1923 |
-
return;
|
1924 |
-
}
|
1925 |
-
|
1926 |
-
// Find current slide
|
1927 |
-
var i, stopIndex = 0, groupSize = s.slidesSizesGrid[0];
|
1928 |
-
for (i = 0; i < s.slidesGrid.length; i += s.params.slidesPerGroup) {
|
1929 |
-
if (typeof s.slidesGrid[i + s.params.slidesPerGroup] !== 'undefined') {
|
1930 |
-
if (currentPos >= s.slidesGrid[i] && currentPos < s.slidesGrid[i + s.params.slidesPerGroup]) {
|
1931 |
-
stopIndex = i;
|
1932 |
-
groupSize = s.slidesGrid[i + s.params.slidesPerGroup] - s.slidesGrid[i];
|
1933 |
-
}
|
1934 |
-
}
|
1935 |
-
else {
|
1936 |
-
if (currentPos >= s.slidesGrid[i]) {
|
1937 |
-
stopIndex = i;
|
1938 |
-
groupSize = s.slidesGrid[s.slidesGrid.length - 1] - s.slidesGrid[s.slidesGrid.length - 2];
|
1939 |
-
}
|
1940 |
-
}
|
1941 |
-
}
|
1942 |
-
|
1943 |
-
// Find current slide size
|
1944 |
-
var ratio = (currentPos - s.slidesGrid[stopIndex]) / groupSize;
|
1945 |
-
|
1946 |
-
if (timeDiff > s.params.longSwipesMs) {
|
1947 |
-
// Long touches
|
1948 |
-
if (!s.params.longSwipes) {
|
1949 |
-
s.slideTo(s.activeIndex);
|
1950 |
-
return;
|
1951 |
-
}
|
1952 |
-
if (s.swipeDirection === 'next') {
|
1953 |
-
if (ratio >= s.params.longSwipesRatio) s.slideTo(stopIndex + s.params.slidesPerGroup);
|
1954 |
-
else s.slideTo(stopIndex);
|
1955 |
-
|
1956 |
-
}
|
1957 |
-
if (s.swipeDirection === 'prev') {
|
1958 |
-
if (ratio > (1 - s.params.longSwipesRatio)) s.slideTo(stopIndex + s.params.slidesPerGroup);
|
1959 |
-
else s.slideTo(stopIndex);
|
1960 |
-
}
|
1961 |
-
}
|
1962 |
-
else {
|
1963 |
-
// Short swipes
|
1964 |
-
if (!s.params.shortSwipes) {
|
1965 |
-
s.slideTo(s.activeIndex);
|
1966 |
-
return;
|
1967 |
-
}
|
1968 |
-
if (s.swipeDirection === 'next') {
|
1969 |
-
s.slideTo(stopIndex + s.params.slidesPerGroup);
|
1970 |
-
|
1971 |
-
}
|
1972 |
-
if (s.swipeDirection === 'prev') {
|
1973 |
-
s.slideTo(stopIndex);
|
1974 |
-
}
|
1975 |
-
}
|
1976 |
-
};
|
1977 |
-
/*=========================
|
1978 |
-
Transitions
|
1979 |
-
===========================*/
|
1980 |
-
s._slideTo = function (slideIndex, speed) {
|
1981 |
-
return s.slideTo(slideIndex, speed, true, true);
|
1982 |
-
};
|
1983 |
-
s.slideTo = function (slideIndex, speed, runCallbacks, internal) {
|
1984 |
-
if (typeof runCallbacks === 'undefined') runCallbacks = true;
|
1985 |
-
if (typeof slideIndex === 'undefined') slideIndex = 0;
|
1986 |
-
if (slideIndex < 0) slideIndex = 0;
|
1987 |
-
s.snapIndex = Math.floor(slideIndex / s.params.slidesPerGroup);
|
1988 |
-
if (s.snapIndex >= s.snapGrid.length) s.snapIndex = s.snapGrid.length - 1;
|
1989 |
-
|
1990 |
-
var translate = - s.snapGrid[s.snapIndex];
|
1991 |
-
// Stop autoplay
|
1992 |
-
if (s.params.autoplay && s.autoplaying) {
|
1993 |
-
if (internal || !s.params.autoplayDisableOnInteraction) {
|
1994 |
-
s.pauseAutoplay(speed);
|
1995 |
-
}
|
1996 |
-
else {
|
1997 |
-
s.stopAutoplay();
|
1998 |
-
}
|
1999 |
-
}
|
2000 |
-
// Update progress
|
2001 |
-
s.updateProgress(translate);
|
2002 |
-
|
2003 |
-
// Normalize slideIndex
|
2004 |
-
if(s.params.normalizeSlideIndex){
|
2005 |
-
for (var i = 0; i < s.slidesGrid.length; i++) {
|
2006 |
-
if (- Math.floor(translate * 100) >= Math.floor(s.slidesGrid[i] * 100)) {
|
2007 |
-
slideIndex = i;
|
2008 |
-
}
|
2009 |
-
}
|
2010 |
-
}
|
2011 |
-
|
2012 |
-
// Directions locks
|
2013 |
-
if (!s.params.allowSwipeToNext && translate < s.translate && translate < s.minTranslate()) {
|
2014 |
-
return false;
|
2015 |
-
}
|
2016 |
-
if (!s.params.allowSwipeToPrev && translate > s.translate && translate > s.maxTranslate()) {
|
2017 |
-
if ((s.activeIndex || 0) !== slideIndex ) return false;
|
2018 |
-
}
|
2019 |
-
|
2020 |
-
// Update Index
|
2021 |
-
if (typeof speed === 'undefined') speed = s.params.speed;
|
2022 |
-
s.previousIndex = s.activeIndex || 0;
|
2023 |
-
s.activeIndex = slideIndex;
|
2024 |
-
s.updateRealIndex();
|
2025 |
-
if ((s.rtl && -translate === s.translate) || (!s.rtl && translate === s.translate)) {
|
2026 |
-
// Update Height
|
2027 |
-
if (s.params.autoHeight) {
|
2028 |
-
s.updateAutoHeight();
|
2029 |
-
}
|
2030 |
-
s.updateClasses();
|
2031 |
-
if (s.params.effect !== 'slide') {
|
2032 |
-
s.setWrapperTranslate(translate);
|
2033 |
-
}
|
2034 |
-
return false;
|
2035 |
-
}
|
2036 |
-
s.updateClasses();
|
2037 |
-
s.onTransitionStart(runCallbacks);
|
2038 |
-
|
2039 |
-
if (speed === 0 || s.browser.lteIE9) {
|
2040 |
-
s.setWrapperTranslate(translate);
|
2041 |
-
s.setWrapperTransition(0);
|
2042 |
-
s.onTransitionEnd(runCallbacks);
|
2043 |
-
}
|
2044 |
-
else {
|
2045 |
-
s.setWrapperTranslate(translate);
|
2046 |
-
s.setWrapperTransition(speed);
|
2047 |
-
if (!s.animating) {
|
2048 |
-
s.animating = true;
|
2049 |
-
s.wrapper.transitionEnd(function () {
|
2050 |
-
if (!s) return;
|
2051 |
-
s.onTransitionEnd(runCallbacks);
|
2052 |
-
});
|
2053 |
-
}
|
2054 |
-
|
2055 |
-
}
|
2056 |
-
|
2057 |
-
return true;
|
2058 |
-
};
|
2059 |
-
|
2060 |
-
s.onTransitionStart = function (runCallbacks) {
|
2061 |
-
if (typeof runCallbacks === 'undefined') runCallbacks = true;
|
2062 |
-
if (s.params.autoHeight) {
|
2063 |
-
s.updateAutoHeight();
|
2064 |
-
}
|
2065 |
-
if (s.lazy) s.lazy.onTransitionStart();
|
2066 |
-
if (runCallbacks) {
|
2067 |
-
s.emit('onTransitionStart', s);
|
2068 |
-
if (s.activeIndex !== s.previousIndex) {
|
2069 |
-
s.emit('onSlideChangeStart', s);
|
2070 |
-
if (s.activeIndex > s.previousIndex) {
|
2071 |
-
s.emit('onSlideNextStart', s);
|
2072 |
-
}
|
2073 |
-
else {
|
2074 |
-
s.emit('onSlidePrevStart', s);
|
2075 |
-
}
|
2076 |
-
}
|
2077 |
-
|
2078 |
-
}
|
2079 |
-
};
|
2080 |
-
s.onTransitionEnd = function (runCallbacks) {
|
2081 |
-
s.animating = false;
|
2082 |
-
s.setWrapperTransition(0);
|
2083 |
-
if (typeof runCallbacks === 'undefined') runCallbacks = true;
|
2084 |
-
if (s.lazy) s.lazy.onTransitionEnd();
|
2085 |
-
if (runCallbacks) {
|
2086 |
-
s.emit('onTransitionEnd', s);
|
2087 |
-
if (s.activeIndex !== s.previousIndex) {
|
2088 |
-
s.emit('onSlideChangeEnd', s);
|
2089 |
-
if (s.activeIndex > s.previousIndex) {
|
2090 |
-
s.emit('onSlideNextEnd', s);
|
2091 |
-
}
|
2092 |
-
else {
|
2093 |
-
s.emit('onSlidePrevEnd', s);
|
2094 |
-
}
|
2095 |
-
}
|
2096 |
-
}
|
2097 |
-
if (s.params.history && s.history) {
|
2098 |
-
s.history.setHistory(s.params.history, s.activeIndex);
|
2099 |
-
}
|
2100 |
-
if (s.params.hashnav && s.hashnav) {
|
2101 |
-
s.hashnav.setHash();
|
2102 |
-
}
|
2103 |
-
|
2104 |
-
};
|
2105 |
-
s.slideNext = function (runCallbacks, speed, internal) {
|
2106 |
-
if (s.params.loop) {
|
2107 |
-
if (s.animating) return false;
|
2108 |
-
s.fixLoop();
|
2109 |
-
var clientLeft = s.container[0].clientLeft;
|
2110 |
-
return s.slideTo(s.activeIndex + s.params.slidesPerGroup, speed, runCallbacks, internal);
|
2111 |
-
}
|
2112 |
-
else return s.slideTo(s.activeIndex + s.params.slidesPerGroup, speed, runCallbacks, internal);
|
2113 |
-
};
|
2114 |
-
s._slideNext = function (speed) {
|
2115 |
-
return s.slideNext(true, speed, true);
|
2116 |
-
};
|
2117 |
-
s.slidePrev = function (runCallbacks, speed, internal) {
|
2118 |
-
if (s.params.loop) {
|
2119 |
-
if (s.animating) return false;
|
2120 |
-
s.fixLoop();
|
2121 |
-
var clientLeft = s.container[0].clientLeft;
|
2122 |
-
return s.slideTo(s.activeIndex - 1, speed, runCallbacks, internal);
|
2123 |
-
}
|
2124 |
-
else return s.slideTo(s.activeIndex - 1, speed, runCallbacks, internal);
|
2125 |
-
};
|
2126 |
-
s._slidePrev = function (speed) {
|
2127 |
-
return s.slidePrev(true, speed, true);
|
2128 |
-
};
|
2129 |
-
s.slideReset = function (runCallbacks, speed, internal) {
|
2130 |
-
return s.slideTo(s.activeIndex, speed, runCallbacks);
|
2131 |
-
};
|
2132 |
-
|
2133 |
-
s.disableTouchControl = function () {
|
2134 |
-
s.params.onlyExternal = true;
|
2135 |
-
return true;
|
2136 |
-
};
|
2137 |
-
s.enableTouchControl = function () {
|
2138 |
-
s.params.onlyExternal = false;
|
2139 |
-
return true;
|
2140 |
-
};
|
2141 |
-
|
2142 |
-
/*=========================
|
2143 |
-
Translate/transition helpers
|
2144 |
-
===========================*/
|
2145 |
-
s.setWrapperTransition = function (duration, byController) {
|
2146 |
-
s.wrapper.transition(duration);
|
2147 |
-
if (s.params.effect !== 'slide' && s.effects[s.params.effect]) {
|
2148 |
-
s.effects[s.params.effect].setTransition(duration);
|
2149 |
-
}
|
2150 |
-
if (s.params.parallax && s.parallax) {
|
2151 |
-
s.parallax.setTransition(duration);
|
2152 |
-
}
|
2153 |
-
if (s.params.scrollbar && s.scrollbar) {
|
2154 |
-
s.scrollbar.setTransition(duration);
|
2155 |
-
}
|
2156 |
-
if (s.params.control && s.controller) {
|
2157 |
-
s.controller.setTransition(duration, byController);
|
2158 |
-
}
|
2159 |
-
s.emit('onSetTransition', s, duration);
|
2160 |
-
};
|
2161 |
-
s.setWrapperTranslate = function (translate, updateActiveIndex, byController) {
|
2162 |
-
var x = 0, y = 0, z = 0;
|
2163 |
-
if (s.isHorizontal()) {
|
2164 |
-
x = s.rtl ? -translate : translate;
|
2165 |
-
}
|
2166 |
-
else {
|
2167 |
-
y = translate;
|
2168 |
-
}
|
2169 |
-
|
2170 |
-
if (s.params.roundLengths) {
|
2171 |
-
x = round(x);
|
2172 |
-
y = round(y);
|
2173 |
-
}
|
2174 |
-
|
2175 |
-
if (!s.params.virtualTranslate) {
|
2176 |
-
if (s.support.transforms3d) s.wrapper.transform('translate3d(' + x + 'px, ' + y + 'px, ' + z + 'px)');
|
2177 |
-
else s.wrapper.transform('translate(' + x + 'px, ' + y + 'px)');
|
2178 |
-
}
|
2179 |
-
|
2180 |
-
s.translate = s.isHorizontal() ? x : y;
|
2181 |
-
|
2182 |
-
// Check if we need to update progress
|
2183 |
-
var progress;
|
2184 |
-
var translatesDiff = s.maxTranslate() - s.minTranslate();
|
2185 |
-
if (translatesDiff === 0) {
|
2186 |
-
progress = 0;
|
2187 |
-
}
|
2188 |
-
else {
|
2189 |
-
progress = (translate - s.minTranslate()) / (translatesDiff);
|
2190 |
-
}
|
2191 |
-
if (progress !== s.progress) {
|
2192 |
-
s.updateProgress(translate);
|
2193 |
-
}
|
2194 |
-
|
2195 |
-
if (updateActiveIndex) s.updateActiveIndex();
|
2196 |
-
if (s.params.effect !== 'slide' && s.effects[s.params.effect]) {
|
2197 |
-
s.effects[s.params.effect].setTranslate(s.translate);
|
2198 |
-
}
|
2199 |
-
if (s.params.parallax && s.parallax) {
|
2200 |
-
s.parallax.setTranslate(s.translate);
|
2201 |
-
}
|
2202 |
-
if (s.params.scrollbar && s.scrollbar) {
|
2203 |
-
s.scrollbar.setTranslate(s.translate);
|
2204 |
-
}
|
2205 |
-
if (s.params.control && s.controller) {
|
2206 |
-
s.controller.setTranslate(s.translate, byController);
|
2207 |
-
}
|
2208 |
-
s.emit('onSetTranslate', s, s.translate);
|
2209 |
-
};
|
2210 |
-
|
2211 |
-
s.getTranslate = function (el, axis) {
|
2212 |
-
var matrix, curTransform, curStyle, transformMatrix;
|
2213 |
-
|
2214 |
-
// automatic axis detection
|
2215 |
-
if (typeof axis === 'undefined') {
|
2216 |
-
axis = 'x';
|
2217 |
-
}
|
2218 |
-
|
2219 |
-
if (s.params.virtualTranslate) {
|
2220 |
-
return s.rtl ? -s.translate : s.translate;
|
2221 |
-
}
|
2222 |
-
|
2223 |
-
curStyle = window.getComputedStyle(el, null);
|
2224 |
-
if (window.WebKitCSSMatrix) {
|
2225 |
-
curTransform = curStyle.transform || curStyle.webkitTransform;
|
2226 |
-
if (curTransform.split(',').length > 6) {
|
2227 |
-
curTransform = curTransform.split(', ').map(function(a){
|
2228 |
-
return a.replace(',','.');
|
2229 |
-
}).join(', ');
|
2230 |
-
}
|
2231 |
-
// Some old versions of Webkit choke when 'none' is passed; pass
|
2232 |
-
// empty string instead in this case
|
2233 |
-
transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);
|
2234 |
-
}
|
2235 |
-
else {
|
2236 |
-
transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
|
2237 |
-
matrix = transformMatrix.toString().split(',');
|
2238 |
-
}
|
2239 |
-
|
2240 |
-
if (axis === 'x') {
|
2241 |
-
//Latest Chrome and webkits Fix
|
2242 |
-
if (window.WebKitCSSMatrix)
|
2243 |
-
curTransform = transformMatrix.m41;
|
2244 |
-
//Crazy IE10 Matrix
|
2245 |
-
else if (matrix.length === 16)
|
2246 |
-
curTransform = parseFloat(matrix[12]);
|
2247 |
-
//Normal Browsers
|
2248 |
-
else
|
2249 |
-
curTransform = parseFloat(matrix[4]);
|
2250 |
-
}
|
2251 |
-
if (axis === 'y') {
|
2252 |
-
//Latest Chrome and webkits Fix
|
2253 |
-
if (window.WebKitCSSMatrix)
|
2254 |
-
curTransform = transformMatrix.m42;
|
2255 |
-
//Crazy IE10 Matrix
|
2256 |
-
else if (matrix.length === 16)
|
2257 |
-
curTransform = parseFloat(matrix[13]);
|
2258 |
-
//Normal Browsers
|
2259 |
-
else
|
2260 |
-
curTransform = parseFloat(matrix[5]);
|
2261 |
-
}
|
2262 |
-
if (s.rtl && curTransform) curTransform = -curTransform;
|
2263 |
-
return curTransform || 0;
|
2264 |
-
};
|
2265 |
-
s.getWrapperTranslate = function (axis) {
|
2266 |
-
if (typeof axis === 'undefined') {
|
2267 |
-
axis = s.isHorizontal() ? 'x' : 'y';
|
2268 |
-
}
|
2269 |
-
return s.getTranslate(s.wrapper[0], axis);
|
2270 |
-
};
|
2271 |
-
|
2272 |
-
/*=========================
|
2273 |
-
Observer
|
2274 |
-
===========================*/
|
2275 |
-
s.observers = [];
|
2276 |
-
function initObserver(target, options) {
|
2277 |
-
options = options || {};
|
2278 |
-
// create an observer instance
|
2279 |
-
var ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;
|
2280 |
-
var observer = new ObserverFunc(function (mutations) {
|
2281 |
-
mutations.forEach(function (mutation) {
|
2282 |
-
s.onResize(true);
|
2283 |
-
s.emit('onObserverUpdate', s, mutation);
|
2284 |
-
});
|
2285 |
-
});
|
2286 |
-
|
2287 |
-
observer.observe(target, {
|
2288 |
-
attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
|
2289 |
-
childList: typeof options.childList === 'undefined' ? true : options.childList,
|
2290 |
-
characterData: typeof options.characterData === 'undefined' ? true : options.characterData
|
2291 |
-
});
|
2292 |
-
|
2293 |
-
s.observers.push(observer);
|
2294 |
-
}
|
2295 |
-
s.initObservers = function () {
|
2296 |
-
if (s.params.observeParents) {
|
2297 |
-
var containerParents = s.container.parents();
|
2298 |
-
for (var i = 0; i < containerParents.length; i++) {
|
2299 |
-
initObserver(containerParents[i]);
|
2300 |
-
}
|
2301 |
-
}
|
2302 |
-
|
2303 |
-
// Observe container
|
2304 |
-
initObserver(s.container[0], {childList: false});
|
2305 |
-
|
2306 |
-
// Observe wrapper
|
2307 |
-
initObserver(s.wrapper[0], {attributes: false});
|
2308 |
-
};
|
2309 |
-
s.disconnectObservers = function () {
|
2310 |
-
for (var i = 0; i < s.observers.length; i++) {
|
2311 |
-
s.observers[i].disconnect();
|
2312 |
-
}
|
2313 |
-
s.observers = [];
|
2314 |
-
};
|
2315 |
-
/*=========================
|
2316 |
-
Loop
|
2317 |
-
===========================*/
|
2318 |
-
// Create looped slides
|
2319 |
-
s.createLoop = function () {
|
2320 |
-
// Remove duplicated slides
|
2321 |
-
s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove();
|
2322 |
-
|
2323 |
-
var slides = s.wrapper.children('.' + s.params.slideClass);
|
2324 |
-
|
2325 |
-
if(s.params.slidesPerView === 'auto' && !s.params.loopedSlides) s.params.loopedSlides = slides.length;
|
2326 |
-
|
2327 |
-
s.loopedSlides = parseInt(s.params.loopedSlides || s.params.slidesPerView, 10);
|
2328 |
-
s.loopedSlides = s.loopedSlides + s.params.loopAdditionalSlides;
|
2329 |
-
if (s.loopedSlides > slides.length) {
|
2330 |
-
s.loopedSlides = slides.length;
|
2331 |
-
}
|
2332 |
-
|
2333 |
-
var prependSlides = [], appendSlides = [], i;
|
2334 |
-
slides.each(function (index, el) {
|
2335 |
-
var slide = $(this);
|
2336 |
-
if (index < s.loopedSlides) appendSlides.push(el);
|
2337 |
-
if (index < slides.length && index >= slides.length - s.loopedSlides) prependSlides.push(el);
|
2338 |
-
slide.attr('data-swiper-slide-index', index);
|
2339 |
-
});
|
2340 |
-
for (i = 0; i < appendSlides.length; i++) {
|
2341 |
-
s.wrapper.append($(appendSlides[i].cloneNode(true)).addClass(s.params.slideDuplicateClass));
|
2342 |
-
}
|
2343 |
-
for (i = prependSlides.length - 1; i >= 0; i--) {
|
2344 |
-
s.wrapper.prepend($(prependSlides[i].cloneNode(true)).addClass(s.params.slideDuplicateClass));
|
2345 |
-
}
|
2346 |
-
};
|
2347 |
-
s.destroyLoop = function () {
|
2348 |
-
s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove();
|
2349 |
-
s.slides.removeAttr('data-swiper-slide-index');
|
2350 |
-
};
|
2351 |
-
s.reLoop = function (updatePosition) {
|
2352 |
-
var oldIndex = s.activeIndex - s.loopedSlides;
|
2353 |
-
s.destroyLoop();
|
2354 |
-
s.createLoop();
|
2355 |
-
s.updateSlidesSize();
|
2356 |
-
if (updatePosition) {
|
2357 |
-
s.slideTo(oldIndex + s.loopedSlides, 0, false);
|
2358 |
-
}
|
2359 |
-
|
2360 |
-
};
|
2361 |
-
s.fixLoop = function () {
|
2362 |
-
var newIndex;
|
2363 |
-
//Fix For Negative Oversliding
|
2364 |
-
if (s.activeIndex < s.loopedSlides) {
|
2365 |
-
newIndex = s.slides.length - s.loopedSlides * 3 + s.activeIndex;
|
2366 |
-
newIndex = newIndex + s.loopedSlides;
|
2367 |
-
s.slideTo(newIndex, 0, false, true);
|
2368 |
-
}
|
2369 |
-
//Fix For Positive Oversliding
|
2370 |
-
else if ((s.params.slidesPerView === 'auto' && s.activeIndex >= s.loopedSlides * 2) || (s.activeIndex > s.slides.length - s.params.slidesPerView * 2)) {
|
2371 |
-
newIndex = -s.slides.length + s.activeIndex + s.loopedSlides;
|
2372 |
-
newIndex = newIndex + s.loopedSlides;
|
2373 |
-
s.slideTo(newIndex, 0, false, true);
|
2374 |
-
}
|
2375 |
-
};
|
2376 |
-
/*=========================
|
2377 |
-
Append/Prepend/Remove Slides
|
2378 |
-
===========================*/
|
2379 |
-
s.appendSlide = function (slides) {
|
2380 |
-
if (s.params.loop) {
|
2381 |
-
s.destroyLoop();
|
2382 |
-
}
|
2383 |
-
if (typeof slides === 'object' && slides.length) {
|
2384 |
-
for (var i = 0; i < slides.length; i++) {
|
2385 |
-
if (slides[i]) s.wrapper.append(slides[i]);
|
2386 |
-
}
|
2387 |
-
}
|
2388 |
-
else {
|
2389 |
-
s.wrapper.append(slides);
|
2390 |
-
}
|
2391 |
-
if (s.params.loop) {
|
2392 |
-
s.createLoop();
|
2393 |
-
}
|
2394 |
-
if (!(s.params.observer && s.support.observer)) {
|
2395 |
-
s.update(true);
|
2396 |
-
}
|
2397 |
-
};
|
2398 |
-
s.prependSlide = function (slides) {
|
2399 |
-
if (s.params.loop) {
|
2400 |
-
s.destroyLoop();
|
2401 |
-
}
|
2402 |
-
var newActiveIndex = s.activeIndex + 1;
|
2403 |
-
if (typeof slides === 'object' && slides.length) {
|
2404 |
-
for (var i = 0; i < slides.length; i++) {
|
2405 |
-
if (slides[i]) s.wrapper.prepend(slides[i]);
|
2406 |
-
}
|
2407 |
-
newActiveIndex = s.activeIndex + slides.length;
|
2408 |
-
}
|
2409 |
-
else {
|
2410 |
-
s.wrapper.prepend(slides);
|
2411 |
-
}
|
2412 |
-
if (s.params.loop) {
|
2413 |
-
s.createLoop();
|
2414 |
-
}
|
2415 |
-
if (!(s.params.observer && s.support.observer)) {
|
2416 |
-
s.update(true);
|
2417 |
-
}
|
2418 |
-
s.slideTo(newActiveIndex, 0, false);
|
2419 |
-
};
|
2420 |
-
s.removeSlide = function (slidesIndexes) {
|
2421 |
-
if (s.params.loop) {
|
2422 |
-
s.destroyLoop();
|
2423 |
-
s.slides = s.wrapper.children('.' + s.params.slideClass);
|
2424 |
-
}
|
2425 |
-
var newActiveIndex = s.activeIndex,
|
2426 |
-
indexToRemove;
|
2427 |
-
if (typeof slidesIndexes === 'object' && slidesIndexes.length) {
|
2428 |
-
for (var i = 0; i < slidesIndexes.length; i++) {
|
2429 |
-
indexToRemove = slidesIndexes[i];
|
2430 |
-
if (s.slides[indexToRemove]) s.slides.eq(indexToRemove).remove();
|
2431 |
-
if (indexToRemove < newActiveIndex) newActiveIndex--;
|
2432 |
-
}
|
2433 |
-
newActiveIndex = Math.max(newActiveIndex, 0);
|
2434 |
-
}
|
2435 |
-
else {
|
2436 |
-
indexToRemove = slidesIndexes;
|
2437 |
-
if (s.slides[indexToRemove]) s.slides.eq(indexToRemove).remove();
|
2438 |
-
if (indexToRemove < newActiveIndex) newActiveIndex--;
|
2439 |
-
newActiveIndex = Math.max(newActiveIndex, 0);
|
2440 |
-
}
|
2441 |
-
|
2442 |
-
if (s.params.loop) {
|
2443 |
-
s.createLoop();
|
2444 |
-
}
|
2445 |
-
|
2446 |
-
if (!(s.params.observer && s.support.observer)) {
|
2447 |
-
s.update(true);
|
2448 |
-
}
|
2449 |
-
if (s.params.loop) {
|
2450 |
-
s.slideTo(newActiveIndex + s.loopedSlides, 0, false);
|
2451 |
-
}
|
2452 |
-
else {
|
2453 |
-
s.slideTo(newActiveIndex, 0, false);
|
2454 |
-
}
|
2455 |
-
|
2456 |
-
};
|
2457 |
-
s.removeAllSlides = function () {
|
2458 |
-
var slidesIndexes = [];
|
2459 |
-
for (var i = 0; i < s.slides.length; i++) {
|
2460 |
-
slidesIndexes.push(i);
|
2461 |
-
}
|
2462 |
-
s.removeSlide(slidesIndexes);
|
2463 |
-
};
|
2464 |
-
|
2465 |
-
|
2466 |
-
/*=========================
|
2467 |
-
Effects
|
2468 |
-
===========================*/
|
2469 |
-
s.effects = {
|
2470 |
-
fade: {
|
2471 |
-
setTranslate: function () {
|
2472 |
-
for (var i = 0; i < s.slides.length; i++) {
|
2473 |
-
var slide = s.slides.eq(i);
|
2474 |
-
var offset = slide[0].swiperSlideOffset;
|
2475 |
-
var tx = -offset;
|
2476 |
-
if (!s.params.virtualTranslate) tx = tx - s.translate;
|
2477 |
-
var ty = 0;
|
2478 |
-
if (!s.isHorizontal()) {
|
2479 |
-
ty = tx;
|
2480 |
-
tx = 0;
|
2481 |
-
}
|
2482 |
-
var slideOpacity = s.params.fade.crossFade ?
|
2483 |
-
Math.max(1 - Math.abs(slide[0].progress), 0) :
|
2484 |
-
1 + Math.min(Math.max(slide[0].progress, -1), 0);
|
2485 |
-
slide
|
2486 |
-
.css({
|
2487 |
-
opacity: slideOpacity
|
2488 |
-
})
|
2489 |
-
.transform('translate3d(' + tx + 'px, ' + ty + 'px, 0px)');
|
2490 |
-
|
2491 |
-
}
|
2492 |
-
|
2493 |
-
},
|
2494 |
-
setTransition: function (duration) {
|
2495 |
-
s.slides.transition(duration);
|
2496 |
-
if (s.params.virtualTranslate && duration !== 0) {
|
2497 |
-
var eventTriggered = false;
|
2498 |
-
s.slides.transitionEnd(function () {
|
2499 |
-
if (eventTriggered) return;
|
2500 |
-
if (!s) return;
|
2501 |
-
eventTriggered = true;
|
2502 |
-
s.animating = false;
|
2503 |
-
var triggerEvents = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'];
|
2504 |
-
for (var i = 0; i < triggerEvents.length; i++) {
|
2505 |
-
s.wrapper.trigger(triggerEvents[i]);
|
2506 |
-
}
|
2507 |
-
});
|
2508 |
-
}
|
2509 |
-
}
|
2510 |
-
},
|
2511 |
-
flip: {
|
2512 |
-
setTranslate: function () {
|
2513 |
-
for (var i = 0; i < s.slides.length; i++) {
|
2514 |
-
var slide = s.slides.eq(i);
|
2515 |
-
var progress = slide[0].progress;
|
2516 |
-
if (s.params.flip.limitRotation) {
|
2517 |
-
progress = Math.max(Math.min(slide[0].progress, 1), -1);
|
2518 |
-
}
|
2519 |
-
var offset = slide[0].swiperSlideOffset;
|
2520 |
-
var rotate = -180 * progress,
|
2521 |
-
rotateY = rotate,
|
2522 |
-
rotateX = 0,
|
2523 |
-
tx = -offset,
|
2524 |
-
ty = 0;
|
2525 |
-
if (!s.isHorizontal()) {
|
2526 |
-
ty = tx;
|
2527 |
-
tx = 0;
|
2528 |
-
rotateX = -rotateY;
|
2529 |
-
rotateY = 0;
|
2530 |
-
}
|
2531 |
-
else if (s.rtl) {
|
2532 |
-
rotateY = -rotateY;
|
2533 |
-
}
|
2534 |
-
|
2535 |
-
slide[0].style.zIndex = -Math.abs(Math.round(progress)) + s.slides.length;
|
2536 |
-
|
2537 |
-
if (s.params.flip.slideShadows) {
|
2538 |
-
//Set shadows
|
2539 |
-
var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');
|
2540 |
-
var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');
|
2541 |
-
if (shadowBefore.length === 0) {
|
2542 |
-
shadowBefore = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '"></div>');
|
2543 |
-
slide.append(shadowBefore);
|
2544 |
-
}
|
2545 |
-
if (shadowAfter.length === 0) {
|
2546 |
-
shadowAfter = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '"></div>');
|
2547 |
-
slide.append(shadowAfter);
|
2548 |
-
}
|
2549 |
-
if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0);
|
2550 |
-
if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0);
|
2551 |
-
}
|
2552 |
-
|
2553 |
-
slide
|
2554 |
-
.transform('translate3d(' + tx + 'px, ' + ty + 'px, 0px) rotateX(' + rotateX + 'deg) rotateY(' + rotateY + 'deg)');
|
2555 |
-
}
|
2556 |
-
},
|
2557 |
-
setTransition: function (duration) {
|
2558 |
-
s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
|
2559 |
-
if (s.params.virtualTranslate && duration !== 0) {
|
2560 |
-
var eventTriggered = false;
|
2561 |
-
s.slides.eq(s.activeIndex).transitionEnd(function () {
|
2562 |
-
if (eventTriggered) return;
|
2563 |
-
if (!s) return;
|
2564 |
-
if (!$(this).hasClass(s.params.slideActiveClass)) return;
|
2565 |
-
eventTriggered = true;
|
2566 |
-
s.animating = false;
|
2567 |
-
var triggerEvents = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'];
|
2568 |
-
for (var i = 0; i < triggerEvents.length; i++) {
|
2569 |
-
s.wrapper.trigger(triggerEvents[i]);
|
2570 |
-
}
|
2571 |
-
});
|
2572 |
-
}
|
2573 |
-
}
|
2574 |
-
},
|
2575 |
-
cube: {
|
2576 |
-
setTranslate: function () {
|
2577 |
-
var wrapperRotate = 0, cubeShadow;
|
2578 |
-
if (s.params.cube.shadow) {
|
2579 |
-
if (s.isHorizontal()) {
|
2580 |
-
cubeShadow = s.wrapper.find('.swiper-cube-shadow');
|
2581 |
-
if (cubeShadow.length === 0) {
|
2582 |
-
cubeShadow = $('<div class="swiper-cube-shadow"></div>');
|
2583 |
-
s.wrapper.append(cubeShadow);
|
2584 |
-
}
|
2585 |
-
cubeShadow.css({height: s.width + 'px'});
|
2586 |
-
}
|
2587 |
-
else {
|
2588 |
-
cubeShadow = s.container.find('.swiper-cube-shadow');
|
2589 |
-
if (cubeShadow.length === 0) {
|
2590 |
-
cubeShadow = $('<div class="swiper-cube-shadow"></div>');
|
2591 |
-
s.container.append(cubeShadow);
|
2592 |
-
}
|
2593 |
-
}
|
2594 |
-
}
|
2595 |
-
for (var i = 0; i < s.slides.length; i++) {
|
2596 |
-
var slide = s.slides.eq(i);
|
2597 |
-
var slideAngle = i * 90;
|
2598 |
-
var round = Math.floor(slideAngle / 360);
|
2599 |
-
if (s.rtl) {
|
2600 |
-
slideAngle = -slideAngle;
|
2601 |
-
round = Math.floor(-slideAngle / 360);
|
2602 |
-
}
|
2603 |
-
var progress = Math.max(Math.min(slide[0].progress, 1), -1);
|
2604 |
-
var tx = 0, ty = 0, tz = 0;
|
2605 |
-
if (i % 4 === 0) {
|
2606 |
-
tx = - round * 4 * s.size;
|
2607 |
-
tz = 0;
|
2608 |
-
}
|
2609 |
-
else if ((i - 1) % 4 === 0) {
|
2610 |
-
tx = 0;
|
2611 |
-
tz = - round * 4 * s.size;
|
2612 |
-
}
|
2613 |
-
else if ((i - 2) % 4 === 0) {
|
2614 |
-
tx = s.size + round * 4 * s.size;
|
2615 |
-
tz = s.size;
|
2616 |
-
}
|
2617 |
-
else if ((i - 3) % 4 === 0) {
|
2618 |
-
tx = - s.size;
|
2619 |
-
tz = 3 * s.size + s.size * 4 * round;
|
2620 |
-
}
|
2621 |
-
if (s.rtl) {
|
2622 |
-
tx = -tx;
|
2623 |
-
}
|
2624 |
-
|
2625 |
-
if (!s.isHorizontal()) {
|
2626 |
-
ty = tx;
|
2627 |
-
tx = 0;
|
2628 |
-
}
|
2629 |
-
|
2630 |
-
var transform = 'rotateX(' + (s.isHorizontal() ? 0 : -slideAngle) + 'deg) rotateY(' + (s.isHorizontal() ? slideAngle : 0) + 'deg) translate3d(' + tx + 'px, ' + ty + 'px, ' + tz + 'px)';
|
2631 |
-
if (progress <= 1 && progress > -1) {
|
2632 |
-
wrapperRotate = i * 90 + progress * 90;
|
2633 |
-
if (s.rtl) wrapperRotate = -i * 90 - progress * 90;
|
2634 |
-
}
|
2635 |
-
slide.transform(transform);
|
2636 |
-
if (s.params.cube.slideShadows) {
|
2637 |
-
//Set shadows
|
2638 |
-
var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');
|
2639 |
-
var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');
|
2640 |
-
if (shadowBefore.length === 0) {
|
2641 |
-
shadowBefore = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '"></div>');
|
2642 |
-
slide.append(shadowBefore);
|
2643 |
-
}
|
2644 |
-
if (shadowAfter.length === 0) {
|
2645 |
-
shadowAfter = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '"></div>');
|
2646 |
-
slide.append(shadowAfter);
|
2647 |
-
}
|
2648 |
-
if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0);
|
2649 |
-
if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0);
|
2650 |
-
}
|
2651 |
-
}
|
2652 |
-
s.wrapper.css({
|
2653 |
-
'-webkit-transform-origin': '50% 50% -' + (s.size / 2) + 'px',
|
2654 |
-
'-moz-transform-origin': '50% 50% -' + (s.size / 2) + 'px',
|
2655 |
-
'-ms-transform-origin': '50% 50% -' + (s.size / 2) + 'px',
|
2656 |
-
'transform-origin': '50% 50% -' + (s.size / 2) + 'px'
|
2657 |
-
});
|
2658 |
-
|
2659 |
-
if (s.params.cube.shadow) {
|
2660 |
-
if (s.isHorizontal()) {
|
2661 |
-
cubeShadow.transform('translate3d(0px, ' + (s.width / 2 + s.params.cube.shadowOffset) + 'px, ' + (-s.width / 2) + 'px) rotateX(90deg) rotateZ(0deg) scale(' + (s.params.cube.shadowScale) + ')');
|
2662 |
-
}
|
2663 |
-
else {
|
2664 |
-
var shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90;
|
2665 |
-
var multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2);
|
2666 |
-
var scale1 = s.params.cube.shadowScale,
|
2667 |
-
scale2 = s.params.cube.shadowScale / multiplier,
|
2668 |
-
offset = s.params.cube.shadowOffset;
|
2669 |
-
cubeShadow.transform('scale3d(' + scale1 + ', 1, ' + scale2 + ') translate3d(0px, ' + (s.height / 2 + offset) + 'px, ' + (-s.height / 2 / scale2) + 'px) rotateX(-90deg)');
|
2670 |
-
}
|
2671 |
-
}
|
2672 |
-
var zFactor = (s.isSafari || s.isUiWebView) ? (-s.size / 2) : 0;
|
2673 |
-
s.wrapper.transform('translate3d(0px,0,' + zFactor + 'px) rotateX(' + (s.isHorizontal() ? 0 : wrapperRotate) + 'deg) rotateY(' + (s.isHorizontal() ? -wrapperRotate : 0) + 'deg)');
|
2674 |
-
},
|
2675 |
-
setTransition: function (duration) {
|
2676 |
-
s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
|
2677 |
-
if (s.params.cube.shadow && !s.isHorizontal()) {
|
2678 |
-
s.container.find('.swiper-cube-shadow').transition(duration);
|
2679 |
-
}
|
2680 |
-
}
|
2681 |
-
},
|
2682 |
-
coverflow: {
|
2683 |
-
setTranslate: function () {
|
2684 |
-
var transform = s.translate;
|
2685 |
-
var center = s.isHorizontal() ? -transform + s.width / 2 : -transform + s.height / 2;
|
2686 |
-
var rotate = s.isHorizontal() ? s.params.coverflow.rotate: -s.params.coverflow.rotate;
|
2687 |
-
var translate = s.params.coverflow.depth;
|
2688 |
-
//Each slide offset from center
|
2689 |
-
for (var i = 0, length = s.slides.length; i < length; i++) {
|
2690 |
-
var slide = s.slides.eq(i);
|
2691 |
-
var slideSize = s.slidesSizesGrid[i];
|
2692 |
-
var slideOffset = slide[0].swiperSlideOffset;
|
2693 |
-
var offsetMultiplier = (center - slideOffset - slideSize / 2) / slideSize * s.params.coverflow.modifier;
|
2694 |
-
|
2695 |
-
var rotateY = s.isHorizontal() ? rotate * offsetMultiplier : 0;
|
2696 |
-
var rotateX = s.isHorizontal() ? 0 : rotate * offsetMultiplier;
|
2697 |
-
// var rotateZ = 0
|
2698 |
-
var translateZ = -translate * Math.abs(offsetMultiplier);
|
2699 |
-
|
2700 |
-
var translateY = s.isHorizontal() ? 0 : s.params.coverflow.stretch * (offsetMultiplier);
|
2701 |
-
var translateX = s.isHorizontal() ? s.params.coverflow.stretch * (offsetMultiplier) : 0;
|
2702 |
-
|
2703 |
-
//Fix for ultra small values
|
2704 |
-
if (Math.abs(translateX) < 0.001) translateX = 0;
|
2705 |
-
if (Math.abs(translateY) < 0.001) translateY = 0;
|
2706 |
-
if (Math.abs(translateZ) < 0.001) translateZ = 0;
|
2707 |
-
if (Math.abs(rotateY) < 0.001) rotateY = 0;
|
2708 |
-
if (Math.abs(rotateX) < 0.001) rotateX = 0;
|
2709 |
-
|
2710 |
-
var slideTransform = 'translate3d(' + translateX + 'px,' + translateY + 'px,' + translateZ + 'px) rotateX(' + rotateX + 'deg) rotateY(' + rotateY + 'deg)';
|
2711 |
-
|
2712 |
-
slide.transform(slideTransform);
|
2713 |
-
slide[0].style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1;
|
2714 |
-
if (s.params.coverflow.slideShadows) {
|
2715 |
-
//Set shadows
|
2716 |
-
var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');
|
2717 |
-
var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');
|
2718 |
-
if (shadowBefore.length === 0) {
|
2719 |
-
shadowBefore = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '"></div>');
|
2720 |
-
slide.append(shadowBefore);
|
2721 |
-
}
|
2722 |
-
if (shadowAfter.length === 0) {
|
2723 |
-
shadowAfter = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '"></div>');
|
2724 |
-
slide.append(shadowAfter);
|
2725 |
-
}
|
2726 |
-
if (shadowBefore.length) shadowBefore[0].style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0;
|
2727 |
-
if (shadowAfter.length) shadowAfter[0].style.opacity = (-offsetMultiplier) > 0 ? -offsetMultiplier : 0;
|
2728 |
-
}
|
2729 |
-
}
|
2730 |
-
|
2731 |
-
//Set correct perspective for IE10
|
2732 |
-
if (s.browser.ie) {
|
2733 |
-
var ws = s.wrapper[0].style;
|
2734 |
-
ws.perspectiveOrigin = center + 'px 50%';
|
2735 |
-
}
|
2736 |
-
},
|
2737 |
-
setTransition: function (duration) {
|
2738 |
-
s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
|
2739 |
-
}
|
2740 |
-
}
|
2741 |
-
};
|
2742 |
-
|
2743 |
-
/*=========================
|
2744 |
-
Images Lazy Loading
|
2745 |
-
===========================*/
|
2746 |
-
s.lazy = {
|
2747 |
-
initialImageLoaded: false,
|
2748 |
-
loadImageInSlide: function (index, loadInDuplicate) {
|
2749 |
-
if (typeof index === 'undefined') return;
|
2750 |
-
if (typeof loadInDuplicate === 'undefined') loadInDuplicate = true;
|
2751 |
-
if (s.slides.length === 0) return;
|
2752 |
-
|
2753 |
-
var slide = s.slides.eq(index);
|
2754 |
-
var img = slide.find('.' + s.params.lazyLoadingClass + ':not(.' + s.params.lazyStatusLoadedClass + '):not(.' + s.params.lazyStatusLoadingClass + ')');
|
2755 |
-
if (slide.hasClass(s.params.lazyLoadingClass) && !slide.hasClass(s.params.lazyStatusLoadedClass) && !slide.hasClass(s.params.lazyStatusLoadingClass)) {
|
2756 |
-
img = img.add(slide[0]);
|
2757 |
-
}
|
2758 |
-
if (img.length === 0) return;
|
2759 |
-
|
2760 |
-
img.each(function () {
|
2761 |
-
var _img = $(this);
|
2762 |
-
_img.addClass(s.params.lazyStatusLoadingClass);
|
2763 |
-
var background = _img.attr('data-background');
|
2764 |
-
var src = _img.attr('data-src'),
|
2765 |
-
srcset = _img.attr('data-srcset'),
|
2766 |
-
sizes = _img.attr('data-sizes');
|
2767 |
-
s.loadImage(_img[0], (src || background), srcset, sizes, false, function () {
|
2768 |
-
if (background) {
|
2769 |
-
_img.css('background-image', 'url("' + background + '")');
|
2770 |
-
_img.removeAttr('data-background');
|
2771 |
-
}
|
2772 |
-
else {
|
2773 |
-
if (srcset) {
|
2774 |
-
_img.attr('srcset', srcset);
|
2775 |
-
_img.removeAttr('data-srcset');
|
2776 |
-
}
|
2777 |
-
if (sizes) {
|
2778 |
-
_img.attr('sizes', sizes);
|
2779 |
-
_img.removeAttr('data-sizes');
|
2780 |
-
}
|
2781 |
-
if (src) {
|
2782 |
-
_img.attr('src', src);
|
2783 |
-
_img.removeAttr('data-src');
|
2784 |
-
}
|
2785 |
-
|
2786 |
-
}
|
2787 |
-
|
2788 |
-
_img.addClass(s.params.lazyStatusLoadedClass).removeClass(s.params.lazyStatusLoadingClass);
|
2789 |
-
slide.find('.' + s.params.lazyPreloaderClass + ', .' + s.params.preloaderClass).remove();
|
2790 |
-
if (s.params.loop && loadInDuplicate) {
|
2791 |
-
var slideOriginalIndex = slide.attr('data-swiper-slide-index');
|
2792 |
-
if (slide.hasClass(s.params.slideDuplicateClass)) {
|
2793 |
-
var originalSlide = s.wrapper.children('[data-swiper-slide-index="' + slideOriginalIndex + '"]:not(.' + s.params.slideDuplicateClass + ')');
|
2794 |
-
s.lazy.loadImageInSlide(originalSlide.index(), false);
|
2795 |
-
}
|
2796 |
-
else {
|
2797 |
-
var duplicatedSlide = s.wrapper.children('.' + s.params.slideDuplicateClass + '[data-swiper-slide-index="' + slideOriginalIndex + '"]');
|
2798 |
-
s.lazy.loadImageInSlide(duplicatedSlide.index(), false);
|
2799 |
-
}
|
2800 |
-
}
|
2801 |
-
s.emit('onLazyImageReady', s, slide[0], _img[0]);
|
2802 |
-
});
|
2803 |
-
|
2804 |
-
s.emit('onLazyImageLoad', s, slide[0], _img[0]);
|
2805 |
-
});
|
2806 |
-
|
2807 |
-
},
|
2808 |
-
load: function () {
|
2809 |
-
var i;
|
2810 |
-
var slidesPerView = s.params.slidesPerView;
|
2811 |
-
if (slidesPerView === 'auto') {
|
2812 |
-
slidesPerView = 0;
|
2813 |
-
}
|
2814 |
-
if (!s.lazy.initialImageLoaded) s.lazy.initialImageLoaded = true;
|
2815 |
-
if (s.params.watchSlidesVisibility) {
|
2816 |
-
s.wrapper.children('.' + s.params.slideVisibleClass).each(function () {
|
2817 |
-
s.lazy.loadImageInSlide($(this).index());
|
2818 |
-
});
|
2819 |
-
}
|
2820 |
-
else {
|
2821 |
-
if (slidesPerView > 1) {
|
2822 |
-
for (i = s.activeIndex; i < s.activeIndex + slidesPerView ; i++) {
|
2823 |
-
if (s.slides[i]) s.lazy.loadImageInSlide(i);
|
2824 |
-
}
|
2825 |
-
}
|
2826 |
-
else {
|
2827 |
-
s.lazy.loadImageInSlide(s.activeIndex);
|
2828 |
-
}
|
2829 |
-
}
|
2830 |
-
if (s.params.lazyLoadingInPrevNext) {
|
2831 |
-
if (slidesPerView > 1 || (s.params.lazyLoadingInPrevNextAmount && s.params.lazyLoadingInPrevNextAmount > 1)) {
|
2832 |
-
var amount = s.params.lazyLoadingInPrevNextAmount;
|
2833 |
-
var spv = slidesPerView;
|
2834 |
-
var maxIndex = Math.min(s.activeIndex + spv + Math.max(amount, spv), s.slides.length);
|
2835 |
-
var minIndex = Math.max(s.activeIndex - Math.max(spv, amount), 0);
|
2836 |
-
// Next Slides
|
2837 |
-
for (i = s.activeIndex + slidesPerView; i < maxIndex; i++) {
|
2838 |
-
if (s.slides[i]) s.lazy.loadImageInSlide(i);
|
2839 |
-
}
|
2840 |
-
// Prev Slides
|
2841 |
-
for (i = minIndex; i < s.activeIndex ; i++) {
|
2842 |
-
if (s.slides[i]) s.lazy.loadImageInSlide(i);
|
2843 |
-
}
|
2844 |
-
}
|
2845 |
-
else {
|
2846 |
-
var nextSlide = s.wrapper.children('.' + s.params.slideNextClass);
|
2847 |
-
if (nextSlide.length > 0) s.lazy.loadImageInSlide(nextSlide.index());
|
2848 |
-
|
2849 |
-
var prevSlide = s.wrapper.children('.' + s.params.slidePrevClass);
|
2850 |
-
if (prevSlide.length > 0) s.lazy.loadImageInSlide(prevSlide.index());
|
2851 |
-
}
|
2852 |
-
}
|
2853 |
-
},
|
2854 |
-
onTransitionStart: function () {
|
2855 |
-
if (s.params.lazyLoading) {
|
2856 |
-
if (s.params.lazyLoadingOnTransitionStart || (!s.params.lazyLoadingOnTransitionStart && !s.lazy.initialImageLoaded)) {
|
2857 |
-
s.lazy.load();
|
2858 |
-
}
|
2859 |
-
}
|
2860 |
-
},
|
2861 |
-
onTransitionEnd: function () {
|
2862 |
-
if (s.params.lazyLoading && !s.params.lazyLoadingOnTransitionStart) {
|
2863 |
-
s.lazy.load();
|
2864 |
-
}
|
2865 |
-
}
|
2866 |
-
};
|
2867 |
-
|
2868 |
-
|
2869 |
-
/*=========================
|
2870 |
-
Scrollbar
|
2871 |
-
===========================*/
|
2872 |
-
s.scrollbar = {
|
2873 |
-
isTouched: false,
|
2874 |
-
setDragPosition: function (e) {
|
2875 |
-
var sb = s.scrollbar;
|
2876 |
-
var x = 0, y = 0;
|
2877 |
-
var translate;
|
2878 |
-
var pointerPosition = s.isHorizontal() ?
|
2879 |
-
((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].pageX : e.pageX || e.clientX) :
|
2880 |
-
((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].pageY : e.pageY || e.clientY) ;
|
2881 |
-
var position = (pointerPosition) - sb.track.offset()[s.isHorizontal() ? 'left' : 'top'] - sb.dragSize / 2;
|
2882 |
-
var positionMin = -s.minTranslate() * sb.moveDivider;
|
2883 |
-
var positionMax = -s.maxTranslate() * sb.moveDivider;
|
2884 |
-
if (position < positionMin) {
|
2885 |
-
position = positionMin;
|
2886 |
-
}
|
2887 |
-
else if (position > positionMax) {
|
2888 |
-
position = positionMax;
|
2889 |
-
}
|
2890 |
-
position = -position / sb.moveDivider;
|
2891 |
-
s.updateProgress(position);
|
2892 |
-
s.setWrapperTranslate(position, true);
|
2893 |
-
},
|
2894 |
-
dragStart: function (e) {
|
2895 |
-
var sb = s.scrollbar;
|
2896 |
-
sb.isTouched = true;
|
2897 |
-
e.preventDefault();
|
2898 |
-
e.stopPropagation();
|
2899 |
-
|
2900 |
-
sb.setDragPosition(e);
|
2901 |
-
clearTimeout(sb.dragTimeout);
|
2902 |
-
|
2903 |
-
sb.track.transition(0);
|
2904 |
-
if (s.params.scrollbarHide) {
|
2905 |
-
sb.track.css('opacity', 1);
|
2906 |
-
}
|
2907 |
-
s.wrapper.transition(100);
|
2908 |
-
sb.drag.transition(100);
|
2909 |
-
s.emit('onScrollbarDragStart', s);
|
2910 |
-
},
|
2911 |
-
dragMove: function (e) {
|
2912 |
-
var sb = s.scrollbar;
|
2913 |
-
if (!sb.isTouched) return;
|
2914 |
-
if (e.preventDefault) e.preventDefault();
|
2915 |
-
else e.returnValue = false;
|
2916 |
-
sb.setDragPosition(e);
|
2917 |
-
s.wrapper.transition(0);
|
2918 |
-
sb.track.transition(0);
|
2919 |
-
sb.drag.transition(0);
|
2920 |
-
s.emit('onScrollbarDragMove', s);
|
2921 |
-
},
|
2922 |
-
dragEnd: function (e) {
|
2923 |
-
var sb = s.scrollbar;
|
2924 |
-
if (!sb.isTouched) return;
|
2925 |
-
sb.isTouched = false;
|
2926 |
-
if (s.params.scrollbarHide) {
|
2927 |
-
clearTimeout(sb.dragTimeout);
|
2928 |
-
sb.dragTimeout = setTimeout(function () {
|
2929 |
-
sb.track.css('opacity', 0);
|
2930 |
-
sb.track.transition(400);
|
2931 |
-
}, 1000);
|
2932 |
-
|
2933 |
-
}
|
2934 |
-
s.emit('onScrollbarDragEnd', s);
|
2935 |
-
if (s.params.scrollbarSnapOnRelease) {
|
2936 |
-
s.slideReset();
|
2937 |
-
}
|
2938 |
-
},
|
2939 |
-
draggableEvents: (function () {
|
2940 |
-
if ((s.params.simulateTouch === false && !s.support.touch)) return s.touchEventsDesktop;
|
2941 |
-
else return s.touchEvents;
|
2942 |
-
})(),
|
2943 |
-
enableDraggable: function () {
|
2944 |
-
var sb = s.scrollbar;
|
2945 |
-
var target = s.support.touch ? sb.track : document;
|
2946 |
-
$(sb.track).on(sb.draggableEvents.start, sb.dragStart);
|
2947 |
-
$(target).on(sb.draggableEvents.move, sb.dragMove);
|
2948 |
-
$(target).on(sb.draggableEvents.end, sb.dragEnd);
|
2949 |
-
},
|
2950 |
-
disableDraggable: function () {
|
2951 |
-
var sb = s.scrollbar;
|
2952 |
-
var target = s.support.touch ? sb.track : document;
|
2953 |
-
$(sb.track).off(s.draggableEvents.start, sb.dragStart);
|
2954 |
-
$(target).off(s.draggableEvents.move, sb.dragMove);
|
2955 |
-
$(target).off(s.draggableEvents.end, sb.dragEnd);
|
2956 |
-
},
|
2957 |
-
set: function () {
|
2958 |
-
if (!s.params.scrollbar) return;
|
2959 |
-
var sb = s.scrollbar;
|
2960 |
-
sb.track = $(s.params.scrollbar);
|
2961 |
-
if (s.params.uniqueNavElements && typeof s.params.scrollbar === 'string' && sb.track.length > 1 && s.container.find(s.params.scrollbar).length === 1) {
|
2962 |
-
sb.track = s.container.find(s.params.scrollbar);
|
2963 |
-
}
|
2964 |
-
sb.drag = sb.track.find('.swiper-scrollbar-drag');
|
2965 |
-
if (sb.drag.length === 0) {
|
2966 |
-
sb.drag = $('<div class="swiper-scrollbar-drag"></div>');
|
2967 |
-
sb.track.append(sb.drag);
|
2968 |
-
}
|
2969 |
-
sb.drag[0].style.width = '';
|
2970 |
-
sb.drag[0].style.height = '';
|
2971 |
-
sb.trackSize = s.isHorizontal() ? sb.track[0].offsetWidth : sb.track[0].offsetHeight;
|
2972 |
-
|
2973 |
-
sb.divider = s.size / s.virtualSize;
|
2974 |
-
sb.moveDivider = sb.divider * (sb.trackSize / s.size);
|
2975 |
-
sb.dragSize = sb.trackSize * sb.divider;
|
2976 |
-
|
2977 |
-
if (s.isHorizontal()) {
|
2978 |
-
sb.drag[0].style.width = sb.dragSize + 'px';
|
2979 |
-
}
|
2980 |
-
else {
|
2981 |
-
sb.drag[0].style.height = sb.dragSize + 'px';
|
2982 |
-
}
|
2983 |
-
|
2984 |
-
if (sb.divider >= 1) {
|
2985 |
-
sb.track[0].style.display = 'none';
|
2986 |
-
}
|
2987 |
-
else {
|
2988 |
-
sb.track[0].style.display = '';
|
2989 |
-
}
|
2990 |
-
if (s.params.scrollbarHide) {
|
2991 |
-
sb.track[0].style.opacity = 0;
|
2992 |
-
}
|
2993 |
-
},
|
2994 |
-
setTranslate: function () {
|
2995 |
-
if (!s.params.scrollbar) return;
|
2996 |
-
var diff;
|
2997 |
-
var sb = s.scrollbar;
|
2998 |
-
var translate = s.translate || 0;
|
2999 |
-
var newPos;
|
3000 |
-
|
3001 |
-
var newSize = sb.dragSize;
|
3002 |
-
newPos = (sb.trackSize - sb.dragSize) * s.progress;
|
3003 |
-
if (s.rtl && s.isHorizontal()) {
|
3004 |
-
newPos = -newPos;
|
3005 |
-
if (newPos > 0) {
|
3006 |
-
newSize = sb.dragSize - newPos;
|
3007 |
-
newPos = 0;
|
3008 |
-
}
|
3009 |
-
else if (-newPos + sb.dragSize > sb.trackSize) {
|
3010 |
-
newSize = sb.trackSize + newPos;
|
3011 |
-
}
|
3012 |
-
}
|
3013 |
-
else {
|
3014 |
-
if (newPos < 0) {
|
3015 |
-
newSize = sb.dragSize + newPos;
|
3016 |
-
newPos = 0;
|
3017 |
-
}
|
3018 |
-
else if (newPos + sb.dragSize > sb.trackSize) {
|
3019 |
-
newSize = sb.trackSize - newPos;
|
3020 |
-
}
|
3021 |
-
}
|
3022 |
-
if (s.isHorizontal()) {
|
3023 |
-
if (s.support.transforms3d) {
|
3024 |
-
sb.drag.transform('translate3d(' + (newPos) + 'px, 0, 0)');
|
3025 |
-
}
|
3026 |
-
else {
|
3027 |
-
sb.drag.transform('translateX(' + (newPos) + 'px)');
|
3028 |
-
}
|
3029 |
-
sb.drag[0].style.width = newSize + 'px';
|
3030 |
-
}
|
3031 |
-
else {
|
3032 |
-
if (s.support.transforms3d) {
|
3033 |
-
sb.drag.transform('translate3d(0px, ' + (newPos) + 'px, 0)');
|
3034 |
-
}
|
3035 |
-
else {
|
3036 |
-
sb.drag.transform('translateY(' + (newPos) + 'px)');
|
3037 |
-
}
|
3038 |
-
sb.drag[0].style.height = newSize + 'px';
|
3039 |
-
}
|
3040 |
-
if (s.params.scrollbarHide) {
|
3041 |
-
clearTimeout(sb.timeout);
|
3042 |
-
sb.track[0].style.opacity = 1;
|
3043 |
-
sb.timeout = setTimeout(function () {
|
3044 |
-
sb.track[0].style.opacity = 0;
|
3045 |
-
sb.track.transition(400);
|
3046 |
-
}, 1000);
|
3047 |
-
}
|
3048 |
-
},
|
3049 |
-
setTransition: function (duration) {
|
3050 |
-
if (!s.params.scrollbar) return;
|
3051 |
-
s.scrollbar.drag.transition(duration);
|
3052 |
-
}
|
3053 |
-
};
|
3054 |
-
|
3055 |
-
/*=========================
|
3056 |
-
Controller
|
3057 |
-
===========================*/
|
3058 |
-
s.controller = {
|
3059 |
-
LinearSpline: function (x, y) {
|
3060 |
-
this.x = x;
|
3061 |
-
this.y = y;
|
3062 |
-
this.lastIndex = x.length - 1;
|
3063 |
-
// Given an x value (x2), return the expected y2 value:
|
3064 |
-
// (x1,y1) is the known point before given value,
|
3065 |
-
// (x3,y3) is the known point after given value.
|
3066 |
-
var i1, i3;
|
3067 |
-
var l = this.x.length;
|
3068 |
-
|
3069 |
-
this.interpolate = function (x2) {
|
3070 |
-
if (!x2) return 0;
|
3071 |
-
|
3072 |
-
// Get the indexes of x1 and x3 (the array indexes before and after given x2):
|
3073 |
-
i3 = binarySearch(this.x, x2);
|
3074 |
-
i1 = i3 - 1;
|
3075 |
-
|
3076 |
-
// We have our indexes i1 & i3, so we can calculate already:
|
3077 |
-
// y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1
|
3078 |
-
return ((x2 - this.x[i1]) * (this.y[i3] - this.y[i1])) / (this.x[i3] - this.x[i1]) + this.y[i1];
|
3079 |
-
};
|
3080 |
-
|
3081 |
-
var binarySearch = (function() {
|
3082 |
-
var maxIndex, minIndex, guess;
|
3083 |
-
return function(array, val) {
|
3084 |
-
minIndex = -1;
|
3085 |
-
maxIndex = array.length;
|
3086 |
-
while (maxIndex - minIndex > 1)
|
3087 |
-
if (array[guess = maxIndex + minIndex >> 1] <= val) {
|
3088 |
-
minIndex = guess;
|
3089 |
-
} else {
|
3090 |
-
maxIndex = guess;
|
3091 |
-
}
|
3092 |
-
return maxIndex;
|
3093 |
-
};
|
3094 |
-
})();
|
3095 |
-
},
|
3096 |
-
//xxx: for now i will just save one spline function to to
|
3097 |
-
getInterpolateFunction: function(c){
|
3098 |
-
if(!s.controller.spline) s.controller.spline = s.params.loop ?
|
3099 |
-
new s.controller.LinearSpline(s.slidesGrid, c.slidesGrid) :
|
3100 |
-
new s.controller.LinearSpline(s.snapGrid, c.snapGrid);
|
3101 |
-
},
|
3102 |
-
setTranslate: function (translate, byController) {
|
3103 |
-
var controlled = s.params.control;
|
3104 |
-
var multiplier, controlledTranslate;
|
3105 |
-
function setControlledTranslate(c) {
|
3106 |
-
// this will create an Interpolate function based on the snapGrids
|
3107 |
-
// x is the Grid of the scrolled scroller and y will be the controlled scroller
|
3108 |
-
// it makes sense to create this only once and recall it for the interpolation
|
3109 |
-
// the function does a lot of value caching for performance
|
3110 |
-
translate = c.rtl && c.params.direction === 'horizontal' ? -s.translate : s.translate;
|
3111 |
-
if (s.params.controlBy === 'slide') {
|
3112 |
-
s.controller.getInterpolateFunction(c);
|
3113 |
-
// i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid
|
3114 |
-
// but it did not work out
|
3115 |
-
controlledTranslate = -s.controller.spline.interpolate(-translate);
|
3116 |
-
}
|
3117 |
-
|
3118 |
-
if(!controlledTranslate || s.params.controlBy === 'container'){
|
3119 |
-
multiplier = (c.maxTranslate() - c.minTranslate()) / (s.maxTranslate() - s.minTranslate());
|
3120 |
-
controlledTranslate = (translate - s.minTranslate()) * multiplier + c.minTranslate();
|
3121 |
-
}
|
3122 |
-
|
3123 |
-
if (s.params.controlInverse) {
|
3124 |
-
controlledTranslate = c.maxTranslate() - controlledTranslate;
|
3125 |
-
}
|
3126 |
-
c.updateProgress(controlledTranslate);
|
3127 |
-
c.setWrapperTranslate(controlledTranslate, false, s);
|
3128 |
-
c.updateActiveIndex();
|
3129 |
-
}
|
3130 |
-
if (s.isArray(controlled)) {
|
3131 |
-
for (var i = 0; i < controlled.length; i++) {
|
3132 |
-
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
|
3133 |
-
setControlledTranslate(controlled[i]);
|
3134 |
-
}
|
3135 |
-
}
|
3136 |
-
}
|
3137 |
-
else if (controlled instanceof Swiper && byController !== controlled) {
|
3138 |
-
|
3139 |
-
setControlledTranslate(controlled);
|
3140 |
-
}
|
3141 |
-
},
|
3142 |
-
setTransition: function (duration, byController) {
|
3143 |
-
var controlled = s.params.control;
|
3144 |
-
var i;
|
3145 |
-
function setControlledTransition(c) {
|
3146 |
-
c.setWrapperTransition(duration, s);
|
3147 |
-
if (duration !== 0) {
|
3148 |
-
c.onTransitionStart();
|
3149 |
-
c.wrapper.transitionEnd(function(){
|
3150 |
-
if (!controlled) return;
|
3151 |
-
if (c.params.loop && s.params.controlBy === 'slide') {
|
3152 |
-
c.fixLoop();
|
3153 |
-
}
|
3154 |
-
c.onTransitionEnd();
|
3155 |
-
|
3156 |
-
});
|
3157 |
-
}
|
3158 |
-
}
|
3159 |
-
if (s.isArray(controlled)) {
|
3160 |
-
for (i = 0; i < controlled.length; i++) {
|
3161 |
-
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
|
3162 |
-
setControlledTransition(controlled[i]);
|
3163 |
-
}
|
3164 |
-
}
|
3165 |
-
}
|
3166 |
-
else if (controlled instanceof Swiper && byController !== controlled) {
|
3167 |
-
setControlledTransition(controlled);
|
3168 |
-
}
|
3169 |
-
}
|
3170 |
-
};
|
3171 |
-
|
3172 |
-
/*=========================
|
3173 |
-
Hash Navigation
|
3174 |
-
===========================*/
|
3175 |
-
s.hashnav = {
|
3176 |
-
onHashCange: function (e, a) {
|
3177 |
-
var newHash = document.location.hash.replace('#', '');
|
3178 |
-
var activeSlideHash = s.slides.eq(s.activeIndex).attr('data-hash');
|
3179 |
-
if (newHash !== activeSlideHash) {
|
3180 |
-
s.slideTo(s.wrapper.children('.' + s.params.slideClass + '[data-hash="' + (newHash) + '"]').index());
|
3181 |
-
}
|
3182 |
-
},
|
3183 |
-
attachEvents: function (detach) {
|
3184 |
-
var action = detach ? 'off' : 'on';
|
3185 |
-
$(window)[action]('hashchange', s.hashnav.onHashCange);
|
3186 |
-
},
|
3187 |
-
setHash: function () {
|
3188 |
-
if (!s.hashnav.initialized || !s.params.hashnav) return;
|
3189 |
-
if (s.params.replaceState && window.history && window.history.replaceState) {
|
3190 |
-
window.history.replaceState(null, null, ('#' + s.slides.eq(s.activeIndex).attr('data-hash') || ''));
|
3191 |
-
} else {
|
3192 |
-
var slide = s.slides.eq(s.activeIndex);
|
3193 |
-
var hash = slide.attr('data-hash') || slide.attr('data-history');
|
3194 |
-
document.location.hash = hash || '';
|
3195 |
-
}
|
3196 |
-
},
|
3197 |
-
init: function () {
|
3198 |
-
if (!s.params.hashnav || s.params.history) return;
|
3199 |
-
s.hashnav.initialized = true;
|
3200 |
-
var hash = document.location.hash.replace('#', '');
|
3201 |
-
if (!hash) return;
|
3202 |
-
var speed = 0;
|
3203 |
-
for (var i = 0, length = s.slides.length; i < length; i++) {
|
3204 |
-
var slide = s.slides.eq(i);
|
3205 |
-
var slideHash = slide.attr('data-hash') || slide.attr('data-history');
|
3206 |
-
if (slideHash === hash && !slide.hasClass(s.params.slideDuplicateClass)) {
|
3207 |
-
var index = slide.index();
|
3208 |
-
s.slideTo(index, speed, s.params.runCallbacksOnInit, true);
|
3209 |
-
}
|
3210 |
-
}
|
3211 |
-
if (s.params.hashnavWatchState) s.hashnav.attachEvents();
|
3212 |
-
},
|
3213 |
-
destroy: function () {
|
3214 |
-
if (s.params.hashnavWatchState) s.hashnav.attachEvents(true);
|
3215 |
-
}
|
3216 |
-
};
|
3217 |
-
|
3218 |
-
/*=========================
|
3219 |
-
History Api with fallback to Hashnav
|
3220 |
-
===========================*/
|
3221 |
-
s.history = {
|
3222 |
-
init: function () {
|
3223 |
-
if (!s.params.history) return;
|
3224 |
-
if (!window.history || !window.history.pushState) {
|
3225 |
-
s.params.history = false;
|
3226 |
-
s.params.hashnav = true;
|
3227 |
-
return;
|
3228 |
-
}
|
3229 |
-
s.history.initialized = true;
|
3230 |
-
this.paths = this.getPathValues();
|
3231 |
-
if (!this.paths.key && !this.paths.value) return;
|
3232 |
-
this.scrollToSlide(0, this.paths.value, s.params.runCallbacksOnInit);
|
3233 |
-
if (!s.params.replaceState) {
|
3234 |
-
window.addEventListener('popstate', this.setHistoryPopState);
|
3235 |
-
}
|
3236 |
-
},
|
3237 |
-
setHistoryPopState: function() {
|
3238 |
-
s.history.paths = s.history.getPathValues();
|
3239 |
-
s.history.scrollToSlide(s.params.speed, s.history.paths.value, false);
|
3240 |
-
},
|
3241 |
-
getPathValues: function() {
|
3242 |
-
var pathArray = window.location.pathname.slice(1).split('/');
|
3243 |
-
var total = pathArray.length;
|
3244 |
-
var key = pathArray[total - 2];
|
3245 |
-
var value = pathArray[total - 1];
|
3246 |
-
return { key: key, value: value };
|
3247 |
-
},
|
3248 |
-
setHistory: function (key, index) {
|
3249 |
-
if (!s.history.initialized || !s.params.history) return;
|
3250 |
-
var slide = s.slides.eq(index);
|
3251 |
-
var value = this.slugify(slide.attr('data-history'));
|
3252 |
-
if (!window.location.pathname.includes(key)) {
|
3253 |
-
value = key + '/' + value;
|
3254 |
-
}
|
3255 |
-
if (s.params.replaceState) {
|
3256 |
-
window.history.replaceState(null, null, value);
|
3257 |
-
} else {
|
3258 |
-
window.history.pushState(null, null, value);
|
3259 |
-
}
|
3260 |
-
},
|
3261 |
-
slugify: function(text) {
|
3262 |
-
return text.toString().toLowerCase()
|
3263 |
-
.replace(/\s+/g, '-')
|
3264 |
-
.replace(/[^\w\-]+/g, '')
|
3265 |
-
.replace(/\-\-+/g, '-')
|
3266 |
-
.replace(/^-+/, '')
|
3267 |
-
.replace(/-+$/, '');
|
3268 |
-
},
|
3269 |
-
scrollToSlide: function(speed, value, runCallbacks) {
|
3270 |
-
if (value) {
|
3271 |
-
for (var i = 0, length = s.slides.length; i < length; i++) {
|
3272 |
-
var slide = s.slides.eq(i);
|
3273 |
-
var slideHistory = this.slugify(slide.attr('data-history'));
|
3274 |
-
if (slideHistory === value && !slide.hasClass(s.params.slideDuplicateClass)) {
|
3275 |
-
var index = slide.index();
|
3276 |
-
s.slideTo(index, speed, runCallbacks);
|
3277 |
-
}
|
3278 |
-
}
|
3279 |
-
} else {
|
3280 |
-
s.slideTo(0, speed, runCallbacks);
|
3281 |
-
}
|
3282 |
-
}
|
3283 |
-
};
|
3284 |
-
|
3285 |
-
/*=========================
|
3286 |
-
Keyboard Control
|
3287 |
-
===========================*/
|
3288 |
-
function handleKeyboard(e) {
|
3289 |
-
if (e.originalEvent) e = e.originalEvent; //jquery fix
|
3290 |
-
var kc = e.keyCode || e.charCode;
|
3291 |
-
// Directions locks
|
3292 |
-
if (!s.params.allowSwipeToNext && (s.isHorizontal() && kc === 39 || !s.isHorizontal() && kc === 40)) {
|
3293 |
-
return false;
|
3294 |
-
}
|
3295 |
-
if (!s.params.allowSwipeToPrev && (s.isHorizontal() && kc === 37 || !s.isHorizontal() && kc === 38)) {
|
3296 |
-
return false;
|
3297 |
-
}
|
3298 |
-
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
|
3299 |
-
return;
|
3300 |
-
}
|
3301 |
-
if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
|
3302 |
-
return;
|
3303 |
-
}
|
3304 |
-
if (kc === 37 || kc === 39 || kc === 38 || kc === 40) {
|
3305 |
-
var inView = false;
|
3306 |
-
//Check that swiper should be inside of visible area of window
|
3307 |
-
if (s.container.parents('.' + s.params.slideClass).length > 0 && s.container.parents('.' + s.params.slideActiveClass).length === 0) {
|
3308 |
-
return;
|
3309 |
-
}
|
3310 |
-
var windowScroll = {
|
3311 |
-
left: window.pageXOffset,
|
3312 |
-
top: window.pageYOffset
|
3313 |
-
};
|
3314 |
-
var windowWidth = window.innerWidth;
|
3315 |
-
var windowHeight = window.innerHeight;
|
3316 |
-
var swiperOffset = s.container.offset();
|
3317 |
-
if (s.rtl) swiperOffset.left = swiperOffset.left - s.container[0].scrollLeft;
|
3318 |
-
var swiperCoord = [
|
3319 |
-
[swiperOffset.left, swiperOffset.top],
|
3320 |
-
[swiperOffset.left + s.width, swiperOffset.top],
|
3321 |
-
[swiperOffset.left, swiperOffset.top + s.height],
|
3322 |
-
[swiperOffset.left + s.width, swiperOffset.top + s.height]
|
3323 |
-
];
|
3324 |
-
for (var i = 0; i < swiperCoord.length; i++) {
|
3325 |
-
var point = swiperCoord[i];
|
3326 |
-
if (
|
3327 |
-
point[0] >= windowScroll.left && point[0] <= windowScroll.left + windowWidth &&
|
3328 |
-
point[1] >= windowScroll.top && point[1] <= windowScroll.top + windowHeight
|
3329 |
-
) {
|
3330 |
-
inView = true;
|
3331 |
-
}
|
3332 |
-
|
3333 |
-
}
|
3334 |
-
if (!inView) return;
|
3335 |
-
}
|
3336 |
-
if (s.isHorizontal()) {
|
3337 |
-
if (kc === 37 || kc === 39) {
|
3338 |
-
if (e.preventDefault) e.preventDefault();
|
3339 |
-
else e.returnValue = false;
|
3340 |
-
}
|
3341 |
-
if ((kc === 39 && !s.rtl) || (kc === 37 && s.rtl)) s.slideNext();
|
3342 |
-
if ((kc === 37 && !s.rtl) || (kc === 39 && s.rtl)) s.slidePrev();
|
3343 |
-
}
|
3344 |
-
else {
|
3345 |
-
if (kc === 38 || kc === 40) {
|
3346 |
-
if (e.preventDefault) e.preventDefault();
|
3347 |
-
else e.returnValue = false;
|
3348 |
-
}
|
3349 |
-
if (kc === 40) s.slideNext();
|
3350 |
-
if (kc === 38) s.slidePrev();
|
3351 |
-
}
|
3352 |
-
}
|
3353 |
-
s.disableKeyboardControl = function () {
|
3354 |
-
s.params.keyboardControl = false;
|
3355 |
-
$(document).off('keydown', handleKeyboard);
|
3356 |
-
};
|
3357 |
-
s.enableKeyboardControl = function () {
|
3358 |
-
s.params.keyboardControl = true;
|
3359 |
-
$(document).on('keydown', handleKeyboard);
|
3360 |
-
};
|
3361 |
-
|
3362 |
-
|
3363 |
-
/*=========================
|
3364 |
-
Mousewheel Control
|
3365 |
-
===========================*/
|
3366 |
-
s.mousewheel = {
|
3367 |
-
event: false,
|
3368 |
-
lastScrollTime: (new window.Date()).getTime()
|
3369 |
-
};
|
3370 |
-
if (s.params.mousewheelControl) {
|
3371 |
-
/**
|
3372 |
-
* The best combination if you prefer spinX + spinY normalization. It favors
|
3373 |
-
* the older DOMMouseScroll for Firefox, as FF does not include wheelDelta with
|
3374 |
-
* 'wheel' event, making spin speed determination impossible.
|
3375 |
-
*/
|
3376 |
-
s.mousewheel.event = (navigator.userAgent.indexOf('firefox') > -1) ?
|
3377 |
-
'DOMMouseScroll' :
|
3378 |
-
isEventSupported() ?
|
3379 |
-
'wheel' : 'mousewheel';
|
3380 |
-
}
|
3381 |
-
|
3382 |
-
function isEventSupported() {
|
3383 |
-
var eventName = 'onwheel';
|
3384 |
-
var isSupported = eventName in document;
|
3385 |
-
|
3386 |
-
if (!isSupported) {
|
3387 |
-
var element = document.createElement('div');
|
3388 |
-
element.setAttribute(eventName, 'return;');
|
3389 |
-
isSupported = typeof element[eventName] === 'function';
|
3390 |
-
}
|
3391 |
-
|
3392 |
-
if (!isSupported &&
|
3393 |
-
document.implementation &&
|
3394 |
-
document.implementation.hasFeature &&
|
3395 |
-
// always returns true in newer browsers as per the standard.
|
3396 |
-
// @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
|
3397 |
-
document.implementation.hasFeature('', '') !== true ) {
|
3398 |
-
// This is the only way to test support for the `wheel` event in IE9+.
|
3399 |
-
isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
|
3400 |
-
}
|
3401 |
-
|
3402 |
-
return isSupported;
|
3403 |
-
}
|
3404 |
-
|
3405 |
-
function handleMousewheel(e) {
|
3406 |
-
if (e.originalEvent) e = e.originalEvent; //jquery fix
|
3407 |
-
var delta = 0;
|
3408 |
-
var rtlFactor = s.rtl ? -1 : 1;
|
3409 |
-
|
3410 |
-
var data = normalizeWheel( e );
|
3411 |
-
|
3412 |
-
if (s.params.mousewheelForceToAxis) {
|
3413 |
-
if (s.isHorizontal()) {
|
3414 |
-
if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = data.pixelX * rtlFactor;
|
3415 |
-
else return;
|
3416 |
-
}
|
3417 |
-
else {
|
3418 |
-
if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = data.pixelY;
|
3419 |
-
else return;
|
3420 |
-
}
|
3421 |
-
}
|
3422 |
-
else {
|
3423 |
-
delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? - data.pixelX * rtlFactor : - data.pixelY;
|
3424 |
-
}
|
3425 |
-
|
3426 |
-
if (delta === 0) return;
|
3427 |
-
|
3428 |
-
if (s.params.mousewheelInvert) delta = -delta;
|
3429 |
-
|
3430 |
-
if (!s.params.freeMode) {
|
3431 |
-
if ((new window.Date()).getTime() - s.mousewheel.lastScrollTime > 60) {
|
3432 |
-
if (delta < 0) {
|
3433 |
-
if ((!s.isEnd || s.params.loop) && !s.animating) {
|
3434 |
-
s.slideNext();
|
3435 |
-
s.emit('onScroll', s, e);
|
3436 |
-
}
|
3437 |
-
else if (s.params.mousewheelReleaseOnEdges) return true;
|
3438 |
-
}
|
3439 |
-
else {
|
3440 |
-
if ((!s.isBeginning || s.params.loop) && !s.animating) {
|
3441 |
-
s.slidePrev();
|
3442 |
-
s.emit('onScroll', s, e);
|
3443 |
-
}
|
3444 |
-
else if (s.params.mousewheelReleaseOnEdges) return true;
|
3445 |
-
}
|
3446 |
-
}
|
3447 |
-
s.mousewheel.lastScrollTime = (new window.Date()).getTime();
|
3448 |
-
|
3449 |
-
}
|
3450 |
-
else {
|
3451 |
-
//Freemode or scrollContainer:
|
3452 |
-
var position = s.getWrapperTranslate() + delta * s.params.mousewheelSensitivity;
|
3453 |
-
var wasBeginning = s.isBeginning,
|
3454 |
-
wasEnd = s.isEnd;
|
3455 |
-
|
3456 |
-
if (position >= s.minTranslate()) position = s.minTranslate();
|
3457 |
-
if (position <= s.maxTranslate()) position = s.maxTranslate();
|
3458 |
-
|
3459 |
-
s.setWrapperTransition(0);
|
3460 |
-
s.setWrapperTranslate(position);
|
3461 |
-
s.updateProgress();
|
3462 |
-
s.updateActiveIndex();
|
3463 |
-
|
3464 |
-
if (!wasBeginning && s.isBeginning || !wasEnd && s.isEnd) {
|
3465 |
-
s.updateClasses();
|
3466 |
-
}
|
3467 |
-
|
3468 |
-
if (s.params.freeModeSticky) {
|
3469 |
-
clearTimeout(s.mousewheel.timeout);
|
3470 |
-
s.mousewheel.timeout = setTimeout(function () {
|
3471 |
-
s.slideReset();
|
3472 |
-
}, 300);
|
3473 |
-
}
|
3474 |
-
else {
|
3475 |
-
if (s.params.lazyLoading && s.lazy) {
|
3476 |
-
s.lazy.load();
|
3477 |
-
}
|
3478 |
-
}
|
3479 |
-
// Emit event
|
3480 |
-
s.emit('onScroll', s, e);
|
3481 |
-
|
3482 |
-
// Stop autoplay
|
3483 |
-
if (s.params.autoplay && s.params.autoplayDisableOnInteraction) s.stopAutoplay();
|
3484 |
-
|
3485 |
-
// Return page scroll on edge positions
|
3486 |
-
if (position === 0 || position === s.maxTranslate()) return;
|
3487 |
-
}
|
3488 |
-
|
3489 |
-
if (e.preventDefault) e.preventDefault();
|
3490 |
-
else e.returnValue = false;
|
3491 |
-
return false;
|
3492 |
-
}
|
3493 |
-
s.disableMousewheelControl = function () {
|
3494 |
-
if (!s.mousewheel.event) return false;
|
3495 |
-
var target = s.container;
|
3496 |
-
if (s.params.mousewheelEventsTarged !== 'container') {
|
3497 |
-
target = $(s.params.mousewheelEventsTarged);
|
3498 |
-
}
|
3499 |
-
target.off(s.mousewheel.event, handleMousewheel);
|
3500 |
-
return true;
|
3501 |
-
};
|
3502 |
-
|
3503 |
-
s.enableMousewheelControl = function () {
|
3504 |
-
if (!s.mousewheel.event) return false;
|
3505 |
-
var target = s.container;
|
3506 |
-
if (s.params.mousewheelEventsTarged !== 'container') {
|
3507 |
-
target = $(s.params.mousewheelEventsTarged);
|
3508 |
-
}
|
3509 |
-
target.on(s.mousewheel.event, handleMousewheel);
|
3510 |
-
return true;
|
3511 |
-
};
|
3512 |
-
|
3513 |
-
/**
|
3514 |
-
* Mouse wheel (and 2-finger trackpad) support on the web sucks. It is
|
3515 |
-
* complicated, thus this doc is long and (hopefully) detailed enough to answer
|
3516 |
-
* your questions.
|
3517 |
-
*
|
3518 |
-
* If you need to react to the mouse wheel in a predictable way, this code is
|
3519 |
-
* like your bestest friend. * hugs *
|
3520 |
-
*
|
3521 |
-
* As of today, there are 4 DOM event types you can listen to:
|
3522 |
-
*
|
3523 |
-
* 'wheel' -- Chrome(31+), FF(17+), IE(9+)
|
3524 |
-
* 'mousewheel' -- Chrome, IE(6+), Opera, Safari
|
3525 |
-
* 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother!
|
3526 |
-
* 'DOMMouseScroll' -- FF(0.9.7+) since 2003
|
3527 |
-
*
|
3528 |
-
* So what to do? The is the best:
|
3529 |
-
*
|
3530 |
-
* normalizeWheel.getEventType();
|
3531 |
-
*
|
3532 |
-
* In your event callback, use this code to get sane interpretation of the
|
3533 |
-
* deltas. This code will return an object with properties:
|
3534 |
-
*
|
3535 |
-
* spinX -- normalized spin speed (use for zoom) - x plane
|
3536 |
-
* spinY -- " - y plane
|
3537 |
-
* pixelX -- normalized distance (to pixels) - x plane
|
3538 |
-
* pixelY -- " - y plane
|
3539 |
-
*
|
3540 |
-
* Wheel values are provided by the browser assuming you are using the wheel to
|
3541 |
-
* scroll a web page by a number of lines or pixels (or pages). Values can vary
|
3542 |
-
* significantly on different platforms and browsers, forgetting that you can
|
3543 |
-
* scroll at different speeds. Some devices (like trackpads) emit more events
|
3544 |
-
* at smaller increments with fine granularity, and some emit massive jumps with
|
3545 |
-
* linear speed or acceleration.
|
3546 |
-
*
|
3547 |
-
* This code does its best to normalize the deltas for you:
|
3548 |
-
*
|
3549 |
-
* - spin is trying to normalize how far the wheel was spun (or trackpad
|
3550 |
-
* dragged). This is super useful for zoom support where you want to
|
3551 |
-
* throw away the chunky scroll steps on the PC and make those equal to
|
3552 |
-
* the slow and smooth tiny steps on the Mac. Key data: This code tries to
|
3553 |
-
* resolve a single slow step on a wheel to 1.
|
3554 |
-
*
|
3555 |
-
* - pixel is normalizing the desired scroll delta in pixel units. You'll
|
3556 |
-
* get the crazy differences between browsers, but at least it'll be in
|
3557 |
-
* pixels!
|
3558 |
-
*
|
3559 |
-
* - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This
|
3560 |
-
* should translate to positive value zooming IN, negative zooming OUT.
|
3561 |
-
* This matches the newer 'wheel' event.
|
3562 |
-
*
|
3563 |
-
* Why are there spinX, spinY (or pixels)?
|
3564 |
-
*
|
3565 |
-
* - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn
|
3566 |
-
* with a mouse. It results in side-scrolling in the browser by default.
|
3567 |
-
*
|
3568 |
-
* - spinY is what you expect -- it's the classic axis of a mouse wheel.
|
3569 |
-
*
|
3570 |
-
* - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and
|
3571 |
-
* probably is by browsers in conjunction with fancy 3D controllers .. but
|
3572 |
-
* you know.
|
3573 |
-
*
|
3574 |
-
* Implementation info:
|
3575 |
-
*
|
3576 |
-
* Examples of 'wheel' event if you scroll slowly (down) by one step with an
|
3577 |
-
* average mouse:
|
3578 |
-
*
|
3579 |
-
* OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120)
|
3580 |
-
* OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12)
|
3581 |
-
* OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A)
|
3582 |
-
* Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120)
|
3583 |
-
* Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120)
|
3584 |
-
*
|
3585 |
-
* On the trackpad:
|
3586 |
-
*
|
3587 |
-
* OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6)
|
3588 |
-
* OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A)
|
3589 |
-
*
|
3590 |
-
* On other/older browsers.. it's more complicated as there can be multiple and
|
3591 |
-
* also missing delta values.
|
3592 |
-
*
|
3593 |
-
* The 'wheel' event is more standard:
|
3594 |
-
*
|
3595 |
-
* http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents
|
3596 |
-
*
|
3597 |
-
* The basics is that it includes a unit, deltaMode (pixels, lines, pages), and
|
3598 |
-
* deltaX, deltaY and deltaZ. Some browsers provide other values to maintain
|
3599 |
-
* backward compatibility with older events. Those other values help us
|
3600 |
-
* better normalize spin speed. Example of what the browsers provide:
|
3601 |
-
*
|
3602 |
-
* | event.wheelDelta | event.detail
|
3603 |
-
* ------------------+------------------+--------------
|
3604 |
-
* Safari v5/OS X | -120 | 0
|
3605 |
-
* Safari v5/Win7 | -120 | 0
|
3606 |
-
* Chrome v17/OS X | -120 | 0
|
3607 |
-
* Chrome v17/Win7 | -120 | 0
|
3608 |
-
* IE9/Win7 | -120 | undefined
|
3609 |
-
* Firefox v4/OS X | undefined | 1
|
3610 |
-
* Firefox v4/Win7 | undefined | 3
|
3611 |
-
*
|
3612 |
-
*/
|
3613 |
-
function normalizeWheel( /*object*/ event ) /*object*/ {
|
3614 |
-
// Reasonable defaults
|
3615 |
-
var PIXEL_STEP = 10;
|
3616 |
-
var LINE_HEIGHT = 40;
|
3617 |
-
var PAGE_HEIGHT = 800;
|
3618 |
-
|
3619 |
-
var sX = 0, sY = 0, // spinX, spinY
|
3620 |
-
pX = 0, pY = 0; // pixelX, pixelY
|
3621 |
-
|
3622 |
-
// Legacy
|
3623 |
-
if( 'detail' in event ) {
|
3624 |
-
sY = event.detail;
|
3625 |
-
}
|
3626 |
-
if( 'wheelDelta' in event ) {
|
3627 |
-
sY = -event.wheelDelta / 120;
|
3628 |
-
}
|
3629 |
-
if( 'wheelDeltaY' in event ) {
|
3630 |
-
sY = -event.wheelDeltaY / 120;
|
3631 |
-
}
|
3632 |
-
if( 'wheelDeltaX' in event ) {
|
3633 |
-
sX = -event.wheelDeltaX / 120;
|
3634 |
-
}
|
3635 |
-
|
3636 |
-
// side scrolling on FF with DOMMouseScroll
|
3637 |
-
if( 'axis' in event && event.axis === event.HORIZONTAL_AXIS ) {
|
3638 |
-
sX = sY;
|
3639 |
-
sY = 0;
|
3640 |
-
}
|
3641 |
-
|
3642 |
-
pX = sX * PIXEL_STEP;
|
3643 |
-
pY = sY * PIXEL_STEP;
|
3644 |
-
|
3645 |
-
if( 'deltaY' in event ) {
|
3646 |
-
pY = event.deltaY;
|
3647 |
-
}
|
3648 |
-
if( 'deltaX' in event ) {
|
3649 |
-
pX = event.deltaX;
|
3650 |
-
}
|
3651 |
-
|
3652 |
-
if( (pX || pY) && event.deltaMode ) {
|
3653 |
-
if( event.deltaMode === 1 ) { // delta in LINE units
|
3654 |
-
pX *= LINE_HEIGHT;
|
3655 |
-
pY *= LINE_HEIGHT;
|
3656 |
-
} else { // delta in PAGE units
|
3657 |
-
pX *= PAGE_HEIGHT;
|
3658 |
-
pY *= PAGE_HEIGHT;
|
3659 |
-
}
|
3660 |
-
}
|
3661 |
-
|
3662 |
-
// Fall-back if spin cannot be determined
|
3663 |
-
if( pX && !sX ) {
|
3664 |
-
sX = (pX < 1) ? -1 : 1;
|
3665 |
-
}
|
3666 |
-
if( pY && !sY ) {
|
3667 |
-
sY = (pY < 1) ? -1 : 1;
|
3668 |
-
}
|
3669 |
-
|
3670 |
-
return {
|
3671 |
-
spinX: sX,
|
3672 |
-
spinY: sY,
|
3673 |
-
pixelX: pX,
|
3674 |
-
pixelY: pY
|
3675 |
-
};
|
3676 |
-
}
|
3677 |
-
|
3678 |
-
/*=========================
|
3679 |
-
Parallax
|
3680 |
-
===========================*/
|
3681 |
-
function setParallaxTransform(el, progress) {
|
3682 |
-
el = $(el);
|
3683 |
-
var p, pX, pY;
|
3684 |
-
var rtlFactor = s.rtl ? -1 : 1;
|
3685 |
-
|
3686 |
-
p = el.attr('data-swiper-parallax') || '0';
|
3687 |
-
pX = el.attr('data-swiper-parallax-x');
|
3688 |
-
pY = el.attr('data-swiper-parallax-y');
|
3689 |
-
if (pX || pY) {
|
3690 |
-
pX = pX || '0';
|
3691 |
-
pY = pY || '0';
|
3692 |
-
}
|
3693 |
-
else {
|
3694 |
-
if (s.isHorizontal()) {
|
3695 |
-
pX = p;
|
3696 |
-
pY = '0';
|
3697 |
-
}
|
3698 |
-
else {
|
3699 |
-
pY = p;
|
3700 |
-
pX = '0';
|
3701 |
-
}
|
3702 |
-
}
|
3703 |
-
|
3704 |
-
if ((pX).indexOf('%') >= 0) {
|
3705 |
-
pX = parseInt(pX, 10) * progress * rtlFactor + '%';
|
3706 |
-
}
|
3707 |
-
else {
|
3708 |
-
pX = pX * progress * rtlFactor + 'px' ;
|
3709 |
-
}
|
3710 |
-
if ((pY).indexOf('%') >= 0) {
|
3711 |
-
pY = parseInt(pY, 10) * progress + '%';
|
3712 |
-
}
|
3713 |
-
else {
|
3714 |
-
pY = pY * progress + 'px' ;
|
3715 |
-
}
|
3716 |
-
|
3717 |
-
el.transform('translate3d(' + pX + ', ' + pY + ',0px)');
|
3718 |
-
}
|
3719 |
-
s.parallax = {
|
3720 |
-
setTranslate: function () {
|
3721 |
-
s.container.children('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function(){
|
3722 |
-
setParallaxTransform(this, s.progress);
|
3723 |
-
|
3724 |
-
});
|
3725 |
-
s.slides.each(function () {
|
3726 |
-
var slide = $(this);
|
3727 |
-
slide.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function () {
|
3728 |
-
var progress = Math.min(Math.max(slide[0].progress, -1), 1);
|
3729 |
-
setParallaxTransform(this, progress);
|
3730 |
-
});
|
3731 |
-
});
|
3732 |
-
},
|
3733 |
-
setTransition: function (duration) {
|
3734 |
-
if (typeof duration === 'undefined') duration = s.params.speed;
|
3735 |
-
s.container.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function(){
|
3736 |
-
var el = $(this);
|
3737 |
-
var parallaxDuration = parseInt(el.attr('data-swiper-parallax-duration'), 10) || duration;
|
3738 |
-
if (duration === 0) parallaxDuration = 0;
|
3739 |
-
el.transition(parallaxDuration);
|
3740 |
-
});
|
3741 |
-
}
|
3742 |
-
};
|
3743 |
-
|
3744 |
-
|
3745 |
-
/*=========================
|
3746 |
-
Zoom
|
3747 |
-
===========================*/
|
3748 |
-
s.zoom = {
|
3749 |
-
// "Global" Props
|
3750 |
-
scale: 1,
|
3751 |
-
currentScale: 1,
|
3752 |
-
isScaling: false,
|
3753 |
-
gesture: {
|
3754 |
-
slide: undefined,
|
3755 |
-
slideWidth: undefined,
|
3756 |
-
slideHeight: undefined,
|
3757 |
-
image: undefined,
|
3758 |
-
imageWrap: undefined,
|
3759 |
-
zoomMax: s.params.zoomMax
|
3760 |
-
},
|
3761 |
-
image: {
|
3762 |
-
isTouched: undefined,
|
3763 |
-
isMoved: undefined,
|
3764 |
-
currentX: undefined,
|
3765 |
-
currentY: undefined,
|
3766 |
-
minX: undefined,
|
3767 |
-
minY: undefined,
|
3768 |
-
maxX: undefined,
|
3769 |
-
maxY: undefined,
|
3770 |
-
width: undefined,
|
3771 |
-
height: undefined,
|
3772 |
-
startX: undefined,
|
3773 |
-
startY: undefined,
|
3774 |
-
touchesStart: {},
|
3775 |
-
touchesCurrent: {}
|
3776 |
-
},
|
3777 |
-
velocity: {
|
3778 |
-
x: undefined,
|
3779 |
-
y: undefined,
|
3780 |
-
prevPositionX: undefined,
|
3781 |
-
prevPositionY: undefined,
|
3782 |
-
prevTime: undefined
|
3783 |
-
},
|
3784 |
-
// Calc Scale From Multi-touches
|
3785 |
-
getDistanceBetweenTouches: function (e) {
|
3786 |
-
if (e.targetTouches.length < 2) return 1;
|
3787 |
-
var x1 = e.targetTouches[0].pageX,
|
3788 |
-
y1 = e.targetTouches[0].pageY,
|
3789 |
-
x2 = e.targetTouches[1].pageX,
|
3790 |
-
y2 = e.targetTouches[1].pageY;
|
3791 |
-
var distance = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
|
3792 |
-
return distance;
|
3793 |
-
},
|
3794 |
-
// Events
|
3795 |
-
onGestureStart: function (e) {
|
3796 |
-
var z = s.zoom;
|
3797 |
-
if (!s.support.gestures) {
|
3798 |
-
if (e.type !== 'touchstart' || e.type === 'touchstart' && e.targetTouches.length < 2) {
|
3799 |
-
return;
|
3800 |
-
}
|
3801 |
-
z.gesture.scaleStart = z.getDistanceBetweenTouches(e);
|
3802 |
-
}
|
3803 |
-
if (!z.gesture.slide || !z.gesture.slide.length) {
|
3804 |
-
z.gesture.slide = $(this);
|
3805 |
-
if (z.gesture.slide.length === 0) z.gesture.slide = s.slides.eq(s.activeIndex);
|
3806 |
-
z.gesture.image = z.gesture.slide.find('img, svg, canvas');
|
3807 |
-
z.gesture.imageWrap = z.gesture.image.parent('.' + s.params.zoomContainerClass);
|
3808 |
-
z.gesture.zoomMax = z.gesture.imageWrap.attr('data-swiper-zoom') || s.params.zoomMax ;
|
3809 |
-
if (z.gesture.imageWrap.length === 0) {
|
3810 |
-
z.gesture.image = undefined;
|
3811 |
-
return;
|
3812 |
-
}
|
3813 |
-
}
|
3814 |
-
z.gesture.image.transition(0);
|
3815 |
-
z.isScaling = true;
|
3816 |
-
},
|
3817 |
-
onGestureChange: function (e) {
|
3818 |
-
var z = s.zoom;
|
3819 |
-
if (!s.support.gestures) {
|
3820 |
-
if (e.type !== 'touchmove' || e.type === 'touchmove' && e.targetTouches.length < 2) {
|
3821 |
-
return;
|
3822 |
-
}
|
3823 |
-
z.gesture.scaleMove = z.getDistanceBetweenTouches(e);
|
3824 |
-
}
|
3825 |
-
if (!z.gesture.image || z.gesture.image.length === 0) return;
|
3826 |
-
if (s.support.gestures) {
|
3827 |
-
z.scale = e.scale * z.currentScale;
|
3828 |
-
}
|
3829 |
-
else {
|
3830 |
-
z.scale = (z.gesture.scaleMove / z.gesture.scaleStart) * z.currentScale;
|
3831 |
-
}
|
3832 |
-
if (z.scale > z.gesture.zoomMax) {
|
3833 |
-
z.scale = z.gesture.zoomMax - 1 + Math.pow((z.scale - z.gesture.zoomMax + 1), 0.5);
|
3834 |
-
}
|
3835 |
-
if (z.scale < s.params.zoomMin) {
|
3836 |
-
z.scale = s.params.zoomMin + 1 - Math.pow((s.params.zoomMin - z.scale + 1), 0.5);
|
3837 |
-
}
|
3838 |
-
z.gesture.image.transform('translate3d(0,0,0) scale(' + z.scale + ')');
|
3839 |
-
},
|
3840 |
-
onGestureEnd: function (e) {
|
3841 |
-
var z = s.zoom;
|
3842 |
-
if (!s.support.gestures) {
|
3843 |
-
if (e.type !== 'touchend' || e.type === 'touchend' && e.changedTouches.length < 2) {
|
3844 |
-
return;
|
3845 |
-
}
|
3846 |
-
}
|
3847 |
-
if (!z.gesture.image || z.gesture.image.length === 0) return;
|
3848 |
-
z.scale = Math.max(Math.min(z.scale, z.gesture.zoomMax), s.params.zoomMin);
|
3849 |
-
z.gesture.image.transition(s.params.speed).transform('translate3d(0,0,0) scale(' + z.scale + ')');
|
3850 |
-
z.currentScale = z.scale;
|
3851 |
-
z.isScaling = false;
|
3852 |
-
if (z.scale === 1) z.gesture.slide = undefined;
|
3853 |
-
},
|
3854 |
-
onTouchStart: function (s, e) {
|
3855 |
-
var z = s.zoom;
|
3856 |
-
if (!z.gesture.image || z.gesture.image.length === 0) return;
|
3857 |
-
if (z.image.isTouched) return;
|
3858 |
-
if (s.device.os === 'android') e.preventDefault();
|
3859 |
-
z.image.isTouched = true;
|
3860 |
-
z.image.touchesStart.x = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
|
3861 |
-
z.image.touchesStart.y = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
|
3862 |
-
},
|
3863 |
-
onTouchMove: function (e) {
|
3864 |
-
var z = s.zoom;
|
3865 |
-
if (!z.gesture.image || z.gesture.image.length === 0) return;
|
3866 |
-
s.allowClick = false;
|
3867 |
-
if (!z.image.isTouched || !z.gesture.slide) return;
|
3868 |
-
|
3869 |
-
if (!z.image.isMoved) {
|
3870 |
-
z.image.width = z.gesture.image[0].offsetWidth;
|
3871 |
-
z.image.height = z.gesture.image[0].offsetHeight;
|
3872 |
-
z.image.startX = s.getTranslate(z.gesture.imageWrap[0], 'x') || 0;
|
3873 |
-
z.image.startY = s.getTranslate(z.gesture.imageWrap[0], 'y') || 0;
|
3874 |
-
z.gesture.slideWidth = z.gesture.slide[0].offsetWidth;
|
3875 |
-
z.gesture.slideHeight = z.gesture.slide[0].offsetHeight;
|
3876 |
-
z.gesture.imageWrap.transition(0);
|
3877 |
-
}
|
3878 |
-
// Define if we need image drag
|
3879 |
-
var scaledWidth = z.image.width * z.scale;
|
3880 |
-
var scaledHeight = z.image.height * z.scale;
|
3881 |
-
|
3882 |
-
if (scaledWidth < z.gesture.slideWidth && scaledHeight < z.gesture.slideHeight) return;
|
3883 |
-
|
3884 |
-
z.image.minX = Math.min((z.gesture.slideWidth / 2 - scaledWidth / 2), 0);
|
3885 |
-
z.image.maxX = -z.image.minX;
|
3886 |
-
z.image.minY = Math.min((z.gesture.slideHeight / 2 - scaledHeight / 2), 0);
|
3887 |
-
z.image.maxY = -z.image.minY;
|
3888 |
-
|
3889 |
-
z.image.touchesCurrent.x = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
|
3890 |
-
z.image.touchesCurrent.y = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
|
3891 |
-
|
3892 |
-
if (!z.image.isMoved && !z.isScaling) {
|
3893 |
-
if (s.isHorizontal() &&
|
3894 |
-
(Math.floor(z.image.minX) === Math.floor(z.image.startX) && z.image.touchesCurrent.x < z.image.touchesStart.x) ||
|
3895 |
-
(Math.floor(z.image.maxX) === Math.floor(z.image.startX) && z.image.touchesCurrent.x > z.image.touchesStart.x)
|
3896 |
-
) {
|
3897 |
-
z.image.isTouched = false;
|
3898 |
-
return;
|
3899 |
-
}
|
3900 |
-
else if (!s.isHorizontal() &&
|
3901 |
-
(Math.floor(z.image.minY) === Math.floor(z.image.startY) && z.image.touchesCurrent.y < z.image.touchesStart.y) ||
|
3902 |
-
(Math.floor(z.image.maxY) === Math.floor(z.image.startY) && z.image.touchesCurrent.y > z.image.touchesStart.y)
|
3903 |
-
) {
|
3904 |
-
z.image.isTouched = false;
|
3905 |
-
return;
|
3906 |
-
}
|
3907 |
-
}
|
3908 |
-
e.preventDefault();
|
3909 |
-
e.stopPropagation();
|
3910 |
-
|
3911 |
-
z.image.isMoved = true;
|
3912 |
-
z.image.currentX = z.image.touchesCurrent.x - z.image.touchesStart.x + z.image.startX;
|
3913 |
-
z.image.currentY = z.image.touchesCurrent.y - z.image.touchesStart.y + z.image.startY;
|
3914 |
-
|
3915 |
-
if (z.image.currentX < z.image.minX) {
|
3916 |
-
z.image.currentX = z.image.minX + 1 - Math.pow((z.image.minX - z.image.currentX + 1), 0.8);
|
3917 |
-
}
|
3918 |
-
if (z.image.currentX > z.image.maxX) {
|
3919 |
-
z.image.currentX = z.image.maxX - 1 + Math.pow((z.image.currentX - z.image.maxX + 1), 0.8);
|
3920 |
-
}
|
3921 |
-
|
3922 |
-
if (z.image.currentY < z.image.minY) {
|
3923 |
-
z.image.currentY = z.image.minY + 1 - Math.pow((z.image.minY - z.image.currentY + 1), 0.8);
|
3924 |
-
}
|
3925 |
-
if (z.image.currentY > z.image.maxY) {
|
3926 |
-
z.image.currentY = z.image.maxY - 1 + Math.pow((z.image.currentY - z.image.maxY + 1), 0.8);
|
3927 |
-
}
|
3928 |
-
|
3929 |
-
//Velocity
|
3930 |
-
if (!z.velocity.prevPositionX) z.velocity.prevPositionX = z.image.touchesCurrent.x;
|
3931 |
-
if (!z.velocity.prevPositionY) z.velocity.prevPositionY = z.image.touchesCurrent.y;
|
3932 |
-
if (!z.velocity.prevTime) z.velocity.prevTime = Date.now();
|
3933 |
-
z.velocity.x = (z.image.touchesCurrent.x - z.velocity.prevPositionX) / (Date.now() - z.velocity.prevTime) / 2;
|
3934 |
-
z.velocity.y = (z.image.touchesCurrent.y - z.velocity.prevPositionY) / (Date.now() - z.velocity.prevTime) / 2;
|
3935 |
-
if (Math.abs(z.image.touchesCurrent.x - z.velocity.prevPositionX) < 2) z.velocity.x = 0;
|
3936 |
-
if (Math.abs(z.image.touchesCurrent.y - z.velocity.prevPositionY) < 2) z.velocity.y = 0;
|
3937 |
-
z.velocity.prevPositionX = z.image.touchesCurrent.x;
|
3938 |
-
z.velocity.prevPositionY = z.image.touchesCurrent.y;
|
3939 |
-
z.velocity.prevTime = Date.now();
|
3940 |
-
|
3941 |
-
z.gesture.imageWrap.transform('translate3d(' + z.image.currentX + 'px, ' + z.image.currentY + 'px,0)');
|
3942 |
-
},
|
3943 |
-
onTouchEnd: function (s, e) {
|
3944 |
-
var z = s.zoom;
|
3945 |
-
if (!z.gesture.image || z.gesture.image.length === 0) return;
|
3946 |
-
if (!z.image.isTouched || !z.image.isMoved) {
|
3947 |
-
z.image.isTouched = false;
|
3948 |
-
z.image.isMoved = false;
|
3949 |
-
return;
|
3950 |
-
}
|
3951 |
-
z.image.isTouched = false;
|
3952 |
-
z.image.isMoved = false;
|
3953 |
-
var momentumDurationX = 300;
|
3954 |
-
var momentumDurationY = 300;
|
3955 |
-
var momentumDistanceX = z.velocity.x * momentumDurationX;
|
3956 |
-
var newPositionX = z.image.currentX + momentumDistanceX;
|
3957 |
-
var momentumDistanceY = z.velocity.y * momentumDurationY;
|
3958 |
-
var newPositionY = z.image.currentY + momentumDistanceY;
|
3959 |
-
|
3960 |
-
//Fix duration
|
3961 |
-
if (z.velocity.x !== 0) momentumDurationX = Math.abs((newPositionX - z.image.currentX) / z.velocity.x);
|
3962 |
-
if (z.velocity.y !== 0) momentumDurationY = Math.abs((newPositionY - z.image.currentY) / z.velocity.y);
|
3963 |
-
var momentumDuration = Math.max(momentumDurationX, momentumDurationY);
|
3964 |
-
|
3965 |
-
z.image.currentX = newPositionX;
|
3966 |
-
z.image.currentY = newPositionY;
|
3967 |
-
|
3968 |
-
// Define if we need image drag
|
3969 |
-
var scaledWidth = z.image.width * z.scale;
|
3970 |
-
var scaledHeight = z.image.height * z.scale;
|
3971 |
-
z.image.minX = Math.min((z.gesture.slideWidth / 2 - scaledWidth / 2), 0);
|
3972 |
-
z.image.maxX = -z.image.minX;
|
3973 |
-
z.image.minY = Math.min((z.gesture.slideHeight / 2 - scaledHeight / 2), 0);
|
3974 |
-
z.image.maxY = -z.image.minY;
|
3975 |
-
z.image.currentX = Math.max(Math.min(z.image.currentX, z.image.maxX), z.image.minX);
|
3976 |
-
z.image.currentY = Math.max(Math.min(z.image.currentY, z.image.maxY), z.image.minY);
|
3977 |
-
|
3978 |
-
z.gesture.imageWrap.transition(momentumDuration).transform('translate3d(' + z.image.currentX + 'px, ' + z.image.currentY + 'px,0)');
|
3979 |
-
},
|
3980 |
-
onTransitionEnd: function (s) {
|
3981 |
-
var z = s.zoom;
|
3982 |
-
if (z.gesture.slide && s.previousIndex !== s.activeIndex) {
|
3983 |
-
z.gesture.image.transform('translate3d(0,0,0) scale(1)');
|
3984 |
-
z.gesture.imageWrap.transform('translate3d(0,0,0)');
|
3985 |
-
z.gesture.slide = z.gesture.image = z.gesture.imageWrap = undefined;
|
3986 |
-
z.scale = z.currentScale = 1;
|
3987 |
-
}
|
3988 |
-
},
|
3989 |
-
// Toggle Zoom
|
3990 |
-
toggleZoom: function (s, e) {
|
3991 |
-
var z = s.zoom;
|
3992 |
-
if (!z.gesture.slide) {
|
3993 |
-
z.gesture.slide = s.clickedSlide ? $(s.clickedSlide) : s.slides.eq(s.activeIndex);
|
3994 |
-
z.gesture.image = z.gesture.slide.find('img, svg, canvas');
|
3995 |
-
z.gesture.imageWrap = z.gesture.image.parent('.' + s.params.zoomContainerClass);
|
3996 |
-
}
|
3997 |
-
if (!z.gesture.image || z.gesture.image.length === 0) return;
|
3998 |
-
|
3999 |
-
var touchX, touchY, offsetX, offsetY, diffX, diffY, translateX, translateY, imageWidth, imageHeight, scaledWidth, scaledHeight, translateMinX, translateMinY, translateMaxX, translateMaxY, slideWidth, slideHeight;
|
4000 |
-
|
4001 |
-
if (typeof z.image.touchesStart.x === 'undefined' && e) {
|
4002 |
-
touchX = e.type === 'touchend' ? e.changedTouches[0].pageX : e.pageX;
|
4003 |
-
touchY = e.type === 'touchend' ? e.changedTouches[0].pageY : e.pageY;
|
4004 |
-
}
|
4005 |
-
else {
|
4006 |
-
touchX = z.image.touchesStart.x;
|
4007 |
-
touchY = z.image.touchesStart.y;
|
4008 |
-
}
|
4009 |
-
|
4010 |
-
if (z.scale && z.scale !== 1) {
|
4011 |
-
// Zoom Out
|
4012 |
-
z.scale = z.currentScale = 1;
|
4013 |
-
z.gesture.imageWrap.transition(300).transform('translate3d(0,0,0)');
|
4014 |
-
z.gesture.image.transition(300).transform('translate3d(0,0,0) scale(1)');
|
4015 |
-
z.gesture.slide = undefined;
|
4016 |
-
}
|
4017 |
-
else {
|
4018 |
-
// Zoom In
|
4019 |
-
z.scale = z.currentScale = z.gesture.imageWrap.attr('data-swiper-zoom') || s.params.zoomMax;
|
4020 |
-
if (e) {
|
4021 |
-
slideWidth = z.gesture.slide[0].offsetWidth;
|
4022 |
-
slideHeight = z.gesture.slide[0].offsetHeight;
|
4023 |
-
offsetX = z.gesture.slide.offset().left;
|
4024 |
-
offsetY = z.gesture.slide.offset().top;
|
4025 |
-
diffX = offsetX + slideWidth/2 - touchX;
|
4026 |
-
diffY = offsetY + slideHeight/2 - touchY;
|
4027 |
-
|
4028 |
-
imageWidth = z.gesture.image[0].offsetWidth;
|
4029 |
-
imageHeight = z.gesture.image[0].offsetHeight;
|
4030 |
-
scaledWidth = imageWidth * z.scale;
|
4031 |
-
scaledHeight = imageHeight * z.scale;
|
4032 |
-
|
4033 |
-
translateMinX = Math.min((slideWidth / 2 - scaledWidth / 2), 0);
|
4034 |
-
translateMinY = Math.min((slideHeight / 2 - scaledHeight / 2), 0);
|
4035 |
-
translateMaxX = -translateMinX;
|
4036 |
-
translateMaxY = -translateMinY;
|
4037 |
-
|
4038 |
-
translateX = diffX * z.scale;
|
4039 |
-
translateY = diffY * z.scale;
|
4040 |
-
|
4041 |
-
if (translateX < translateMinX) {
|
4042 |
-
translateX = translateMinX;
|
4043 |
-
}
|
4044 |
-
if (translateX > translateMaxX) {
|
4045 |
-
translateX = translateMaxX;
|
4046 |
-
}
|
4047 |
-
|
4048 |
-
if (translateY < translateMinY) {
|
4049 |
-
translateY = translateMinY;
|
4050 |
-
}
|
4051 |
-
if (translateY > translateMaxY) {
|
4052 |
-
translateY = translateMaxY;
|
4053 |
-
}
|
4054 |
-
}
|
4055 |
-
else {
|
4056 |
-
translateX = 0;
|
4057 |
-
translateY = 0;
|
4058 |
-
}
|
4059 |
-
z.gesture.imageWrap.transition(300).transform('translate3d(' + translateX + 'px, ' + translateY + 'px,0)');
|
4060 |
-
z.gesture.image.transition(300).transform('translate3d(0,0,0) scale(' + z.scale + ')');
|
4061 |
-
}
|
4062 |
-
},
|
4063 |
-
// Attach/Detach Events
|
4064 |
-
attachEvents: function (detach) {
|
4065 |
-
var action = detach ? 'off' : 'on';
|
4066 |
-
|
4067 |
-
if (s.params.zoom) {
|
4068 |
-
var target = s.slides;
|
4069 |
-
var passiveListener = s.touchEvents.start === 'touchstart' && s.support.passiveListener && s.params.passiveListeners ? {passive: true, capture: false} : false;
|
4070 |
-
// Scale image
|
4071 |
-
if (s.support.gestures) {
|
4072 |
-
s.slides[action]('gesturestart', s.zoom.onGestureStart, passiveListener);
|
4073 |
-
s.slides[action]('gesturechange', s.zoom.onGestureChange, passiveListener);
|
4074 |
-
s.slides[action]('gestureend', s.zoom.onGestureEnd, passiveListener);
|
4075 |
-
}
|
4076 |
-
else if (s.touchEvents.start === 'touchstart') {
|
4077 |
-
s.slides[action](s.touchEvents.start, s.zoom.onGestureStart, passiveListener);
|
4078 |
-
s.slides[action](s.touchEvents.move, s.zoom.onGestureChange, passiveListener);
|
4079 |
-
s.slides[action](s.touchEvents.end, s.zoom.onGestureEnd, passiveListener);
|
4080 |
-
}
|
4081 |
-
|
4082 |
-
// Move image
|
4083 |
-
s[action]('touchStart', s.zoom.onTouchStart);
|
4084 |
-
s.slides.each(function (index, slide){
|
4085 |
-
if ($(slide).find('.' + s.params.zoomContainerClass).length > 0) {
|
4086 |
-
$(slide)[action](s.touchEvents.move, s.zoom.onTouchMove);
|
4087 |
-
}
|
4088 |
-
});
|
4089 |
-
s[action]('touchEnd', s.zoom.onTouchEnd);
|
4090 |
-
|
4091 |
-
// Scale Out
|
4092 |
-
s[action]('transitionEnd', s.zoom.onTransitionEnd);
|
4093 |
-
if (s.params.zoomToggle) {
|
4094 |
-
s.on('doubleTap', s.zoom.toggleZoom);
|
4095 |
-
}
|
4096 |
-
}
|
4097 |
-
},
|
4098 |
-
init: function () {
|
4099 |
-
s.zoom.attachEvents();
|
4100 |
-
},
|
4101 |
-
destroy: function () {
|
4102 |
-
s.zoom.attachEvents(true);
|
4103 |
-
}
|
4104 |
-
};
|
4105 |
-
|
4106 |
-
/*=========================
|
4107 |
-
Plugins API. Collect all and init all plugins
|
4108 |
-
===========================*/
|
4109 |
-
s._plugins = [];
|
4110 |
-
for (var plugin in s.plugins) {
|
4111 |
-
var p = s.plugins[plugin](s, s.params[plugin]);
|
4112 |
-
if (p) s._plugins.push(p);
|
4113 |
-
}
|
4114 |
-
// Method to call all plugins event/method
|
4115 |
-
s.callPlugins = function (eventName) {
|
4116 |
-
for (var i = 0; i < s._plugins.length; i++) {
|
4117 |
-
if (eventName in s._plugins[i]) {
|
4118 |
-
s._plugins[i][eventName](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
|
4119 |
-
}
|
4120 |
-
}
|
4121 |
-
};
|
4122 |
-
|
4123 |
-
/*=========================
|
4124 |
-
Events/Callbacks/Plugins Emitter
|
4125 |
-
===========================*/
|
4126 |
-
function normalizeEventName (eventName) {
|
4127 |
-
if (eventName.indexOf('on') !== 0) {
|
4128 |
-
if (eventName[0] !== eventName[0].toUpperCase()) {
|
4129 |
-
eventName = 'on' + eventName[0].toUpperCase() + eventName.substring(1);
|
4130 |
-
}
|
4131 |
-
else {
|
4132 |
-
eventName = 'on' + eventName;
|
4133 |
-
}
|
4134 |
-
}
|
4135 |
-
return eventName;
|
4136 |
-
}
|
4137 |
-
s.emitterEventListeners = {
|
4138 |
-
|
4139 |
-
};
|
4140 |
-
s.emit = function (eventName) {
|
4141 |
-
// Trigger callbacks
|
4142 |
-
if (s.params[eventName]) {
|
4143 |
-
s.params[eventName](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
|
4144 |
-
}
|
4145 |
-
var i;
|
4146 |
-
// Trigger events
|
4147 |
-
if (s.emitterEventListeners[eventName]) {
|
4148 |
-
for (i = 0; i < s.emitterEventListeners[eventName].length; i++) {
|
4149 |
-
s.emitterEventListeners[eventName][i](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
|
4150 |
-
}
|
4151 |
-
}
|
4152 |
-
// Trigger plugins
|
4153 |
-
if (s.callPlugins) s.callPlugins(eventName, arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
|
4154 |
-
};
|
4155 |
-
s.on = function (eventName, handler) {
|
4156 |
-
eventName = normalizeEventName(eventName);
|
4157 |
-
if (!s.emitterEventListeners[eventName]) s.emitterEventListeners[eventName] = [];
|
4158 |
-
s.emitterEventListeners[eventName].push(handler);
|
4159 |
-
return s;
|
4160 |
-
};
|
4161 |
-
s.off = function (eventName, handler) {
|
4162 |
-
var i;
|
4163 |
-
eventName = normalizeEventName(eventName);
|
4164 |
-
if (typeof handler === 'undefined') {
|
4165 |
-
// Remove all handlers for such event
|
4166 |
-
s.emitterEventListeners[eventName] = [];
|
4167 |
-
return s;
|
4168 |
-
}
|
4169 |
-
if (!s.emitterEventListeners[eventName] || s.emitterEventListeners[eventName].length === 0) return;
|
4170 |
-
for (i = 0; i < s.emitterEventListeners[eventName].length; i++) {
|
4171 |
-
if(s.emitterEventListeners[eventName][i] === handler) s.emitterEventListeners[eventName].splice(i, 1);
|
4172 |
-
}
|
4173 |
-
return s;
|
4174 |
-
};
|
4175 |
-
s.once = function (eventName, handler) {
|
4176 |
-
eventName = normalizeEventName(eventName);
|
4177 |
-
var _handler = function () {
|
4178 |
-
handler(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);
|
4179 |
-
s.off(eventName, _handler);
|
4180 |
-
};
|
4181 |
-
s.on(eventName, _handler);
|
4182 |
-
return s;
|
4183 |
-
};
|
4184 |
-
|
4185 |
-
// Accessibility tools
|
4186 |
-
s.a11y = {
|
4187 |
-
makeFocusable: function ($el) {
|
4188 |
-
$el.attr('tabIndex', '0');
|
4189 |
-
return $el;
|
4190 |
-
},
|
4191 |
-
addRole: function ($el, role) {
|
4192 |
-
$el.attr('role', role);
|
4193 |
-
return $el;
|
4194 |
-
},
|
4195 |
-
|
4196 |
-
addLabel: function ($el, label) {
|
4197 |
-
$el.attr('aria-label', label);
|
4198 |
-
return $el;
|
4199 |
-
},
|
4200 |
-
|
4201 |
-
disable: function ($el) {
|
4202 |
-
$el.attr('aria-disabled', true);
|
4203 |
-
return $el;
|
4204 |
-
},
|
4205 |
-
|
4206 |
-
enable: function ($el) {
|
4207 |
-
$el.attr('aria-disabled', false);
|
4208 |
-
return $el;
|
4209 |
-
},
|
4210 |
-
|
4211 |
-
onEnterKey: function (event) {
|
4212 |
-
if (event.keyCode !== 13) return;
|
4213 |
-
if ($(event.target).is(s.params.nextButton)) {
|
4214 |
-
s.onClickNext(event);
|
4215 |
-
if (s.isEnd) {
|
4216 |
-
s.a11y.notify(s.params.lastSlideMessage);
|
4217 |
-
}
|
4218 |
-
else {
|
4219 |
-
s.a11y.notify(s.params.nextSlideMessage);
|
4220 |
-
}
|
4221 |
-
}
|
4222 |
-
else if ($(event.target).is(s.params.prevButton)) {
|
4223 |
-
s.onClickPrev(event);
|
4224 |
-
if (s.isBeginning) {
|
4225 |
-
s.a11y.notify(s.params.firstSlideMessage);
|
4226 |
-
}
|
4227 |
-
else {
|
4228 |
-
s.a11y.notify(s.params.prevSlideMessage);
|
4229 |
-
}
|
4230 |
-
}
|
4231 |
-
if ($(event.target).is('.' + s.params.bulletClass)) {
|
4232 |
-
$(event.target)[0].click();
|
4233 |
-
}
|
4234 |
-
},
|
4235 |
-
|
4236 |
-
liveRegion: $('<span class="' + s.params.notificationClass + '" aria-live="assertive" aria-atomic="true"></span>'),
|
4237 |
-
|
4238 |
-
notify: function (message) {
|
4239 |
-
var notification = s.a11y.liveRegion;
|
4240 |
-
if (notification.length === 0) return;
|
4241 |
-
notification.html('');
|
4242 |
-
notification.html(message);
|
4243 |
-
},
|
4244 |
-
init: function () {
|
4245 |
-
// Setup accessibility
|
4246 |
-
if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
|
4247 |
-
s.a11y.makeFocusable(s.nextButton);
|
4248 |
-
s.a11y.addRole(s.nextButton, 'button');
|
4249 |
-
s.a11y.addLabel(s.nextButton, s.params.nextSlideMessage);
|
4250 |
-
}
|
4251 |
-
if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
|
4252 |
-
s.a11y.makeFocusable(s.prevButton);
|
4253 |
-
s.a11y.addRole(s.prevButton, 'button');
|
4254 |
-
s.a11y.addLabel(s.prevButton, s.params.prevSlideMessage);
|
4255 |
-
}
|
4256 |
-
|
4257 |
-
$(s.container).append(s.a11y.liveRegion);
|
4258 |
-
},
|
4259 |
-
initPagination: function () {
|
4260 |
-
if (s.params.pagination && s.params.paginationClickable && s.bullets && s.bullets.length) {
|
4261 |
-
s.bullets.each(function () {
|
4262 |
-
var bullet = $(this);
|
4263 |
-
s.a11y.makeFocusable(bullet);
|
4264 |
-
s.a11y.addRole(bullet, 'button');
|
4265 |
-
s.a11y.addLabel(bullet, s.params.paginationBulletMessage.replace(/{{index}}/, bullet.index() + 1));
|
4266 |
-
});
|
4267 |
-
}
|
4268 |
-
},
|
4269 |
-
destroy: function () {
|
4270 |
-
if (s.a11y.liveRegion && s.a11y.liveRegion.length > 0) s.a11y.liveRegion.remove();
|
4271 |
-
}
|
4272 |
-
};
|
4273 |
-
|
4274 |
-
|
4275 |
-
/*=========================
|
4276 |
-
Init/Destroy
|
4277 |
-
===========================*/
|
4278 |
-
s.init = function () {
|
4279 |
-
if (s.params.loop) s.createLoop();
|
4280 |
-
s.updateContainerSize();
|
4281 |
-
s.updateSlidesSize();
|
4282 |
-
s.updatePagination();
|
4283 |
-
if (s.params.scrollbar && s.scrollbar) {
|
4284 |
-
s.scrollbar.set();
|
4285 |
-
if (s.params.scrollbarDraggable) {
|
4286 |
-
s.scrollbar.enableDraggable();
|
4287 |
-
}
|
4288 |
-
}
|
4289 |
-
if (s.params.effect !== 'slide' && s.effects[s.params.effect]) {
|
4290 |
-
if (!s.params.loop) s.updateProgress();
|
4291 |
-
s.effects[s.params.effect].setTranslate();
|
4292 |
-
}
|
4293 |
-
if (s.params.loop) {
|
4294 |
-
s.slideTo(s.params.initialSlide + s.loopedSlides, 0, s.params.runCallbacksOnInit);
|
4295 |
-
}
|
4296 |
-
else {
|
4297 |
-
s.slideTo(s.params.initialSlide, 0, s.params.runCallbacksOnInit);
|
4298 |
-
if (s.params.initialSlide === 0) {
|
4299 |
-
if (s.parallax && s.params.parallax) s.parallax.setTranslate();
|
4300 |
-
if (s.lazy && s.params.lazyLoading) {
|
4301 |
-
s.lazy.load();
|
4302 |
-
s.lazy.initialImageLoaded = true;
|
4303 |
-
}
|
4304 |
-
}
|
4305 |
-
}
|
4306 |
-
s.attachEvents();
|
4307 |
-
if (s.params.observer && s.support.observer) {
|
4308 |
-
s.initObservers();
|
4309 |
-
}
|
4310 |
-
if (s.params.preloadImages && !s.params.lazyLoading) {
|
4311 |
-
s.preloadImages();
|
4312 |
-
}
|
4313 |
-
if (s.params.zoom && s.zoom) {
|
4314 |
-
s.zoom.init();
|
4315 |
-
}
|
4316 |
-
if (s.params.autoplay) {
|
4317 |
-
s.startAutoplay();
|
4318 |
-
}
|
4319 |
-
if (s.params.keyboardControl) {
|
4320 |
-
if (s.enableKeyboardControl) s.enableKeyboardControl();
|
4321 |
-
}
|
4322 |
-
if (s.params.mousewheelControl) {
|
4323 |
-
if (s.enableMousewheelControl) s.enableMousewheelControl();
|
4324 |
-
}
|
4325 |
-
// Deprecated hashnavReplaceState changed to replaceState for use in hashnav and history
|
4326 |
-
if (s.params.hashnavReplaceState) {
|
4327 |
-
s.params.replaceState = s.params.hashnavReplaceState;
|
4328 |
-
}
|
4329 |
-
if (s.params.history) {
|
4330 |
-
if (s.history) s.history.init();
|
4331 |
-
}
|
4332 |
-
if (s.params.hashnav) {
|
4333 |
-
if (s.hashnav) s.hashnav.init();
|
4334 |
-
}
|
4335 |
-
if (s.params.a11y && s.a11y) s.a11y.init();
|
4336 |
-
s.emit('onInit', s);
|
4337 |
-
};
|
4338 |
-
|
4339 |
-
// Cleanup dynamic styles
|
4340 |
-
s.cleanupStyles = function () {
|
4341 |
-
// Container
|
4342 |
-
s.container.removeClass(s.classNames.join(' ')).removeAttr('style');
|
4343 |
-
|
4344 |
-
// Wrapper
|
4345 |
-
s.wrapper.removeAttr('style');
|
4346 |
-
|
4347 |
-
// Slides
|
4348 |
-
if (s.slides && s.slides.length) {
|
4349 |
-
s.slides
|
4350 |
-
.removeClass([
|
4351 |
-
s.params.slideVisibleClass,
|
4352 |
-
s.params.slideActiveClass,
|
4353 |
-
s.params.slideNextClass,
|
4354 |
-
s.params.slidePrevClass
|
4355 |
-
].join(' '))
|
4356 |
-
.removeAttr('style')
|
4357 |
-
.removeAttr('data-swiper-column')
|
4358 |
-
.removeAttr('data-swiper-row');
|
4359 |
-
}
|
4360 |
-
|
4361 |
-
// Pagination/Bullets
|
4362 |
-
if (s.paginationContainer && s.paginationContainer.length) {
|
4363 |
-
s.paginationContainer.removeClass(s.params.paginationHiddenClass);
|
4364 |
-
}
|
4365 |
-
if (s.bullets && s.bullets.length) {
|
4366 |
-
s.bullets.removeClass(s.params.bulletActiveClass);
|
4367 |
-
}
|
4368 |
-
|
4369 |
-
// Buttons
|
4370 |
-
if (s.params.prevButton) $(s.params.prevButton).removeClass(s.params.buttonDisabledClass);
|
4371 |
-
if (s.params.nextButton) $(s.params.nextButton).removeClass(s.params.buttonDisabledClass);
|
4372 |
-
|
4373 |
-
// Scrollbar
|
4374 |
-
if (s.params.scrollbar && s.scrollbar) {
|
4375 |
-
if (s.scrollbar.track && s.scrollbar.track.length) s.scrollbar.track.removeAttr('style');
|
4376 |
-
if (s.scrollbar.drag && s.scrollbar.drag.length) s.scrollbar.drag.removeAttr('style');
|
4377 |
-
}
|
4378 |
-
};
|
4379 |
-
|
4380 |
-
// Destroy
|
4381 |
-
s.destroy = function (deleteInstance, cleanupStyles) {
|
4382 |
-
// Detach evebts
|
4383 |
-
s.detachEvents();
|
4384 |
-
// Stop autoplay
|
4385 |
-
s.stopAutoplay();
|
4386 |
-
// Disable draggable
|
4387 |
-
if (s.params.scrollbar && s.scrollbar) {
|
4388 |
-
if (s.params.scrollbarDraggable) {
|
4389 |
-
s.scrollbar.disableDraggable();
|
4390 |
-
}
|
4391 |
-
}
|
4392 |
-
// Destroy loop
|
4393 |
-
if (s.params.loop) {
|
4394 |
-
s.destroyLoop();
|
4395 |
-
}
|
4396 |
-
// Cleanup styles
|
4397 |
-
if (cleanupStyles) {
|
4398 |
-
s.cleanupStyles();
|
4399 |
-
}
|
4400 |
-
// Disconnect observer
|
4401 |
-
s.disconnectObservers();
|
4402 |
-
|
4403 |
-
// Destroy zoom
|
4404 |
-
if (s.params.zoom && s.zoom) {
|
4405 |
-
s.zoom.destroy();
|
4406 |
-
}
|
4407 |
-
// Disable keyboard/mousewheel
|
4408 |
-
if (s.params.keyboardControl) {
|
4409 |
-
if (s.disableKeyboardControl) s.disableKeyboardControl();
|
4410 |
-
}
|
4411 |
-
if (s.params.mousewheelControl) {
|
4412 |
-
if (s.disableMousewheelControl) s.disableMousewheelControl();
|
4413 |
-
}
|
4414 |
-
// Disable a11y
|
4415 |
-
if (s.params.a11y && s.a11y) s.a11y.destroy();
|
4416 |
-
// Delete history popstate
|
4417 |
-
if (s.params.history && !s.params.replaceState) {
|
4418 |
-
window.removeEventListener('popstate', s.history.setHistoryPopState);
|
4419 |
-
}
|
4420 |
-
if (s.params.hashnav && s.hashnav) {
|
4421 |
-
s.hashnav.destroy();
|
4422 |
-
}
|
4423 |
-
// Destroy callback
|
4424 |
-
s.emit('onDestroy');
|
4425 |
-
// Delete instance
|
4426 |
-
if (deleteInstance !== false) s = null;
|
4427 |
-
};
|
4428 |
-
|
4429 |
-
s.init();
|
4430 |
-
|
4431 |
-
|
4432 |
-
|
4433 |
-
// Return swiper instance
|
4434 |
-
return s;
|
4435 |
-
};
|
4436 |
-
|
4437 |
-
|
4438 |
-
/*==================================================
|
4439 |
-
Prototype
|
4440 |
-
====================================================*/
|
4441 |
-
Swiper.prototype = {
|
4442 |
-
isSafari: (function () {
|
4443 |
-
var ua = navigator.userAgent.toLowerCase();
|
4444 |
-
return (ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0);
|
4445 |
-
})(),
|
4446 |
-
isUiWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent),
|
4447 |
-
isArray: function (arr) {
|
4448 |
-
return Object.prototype.toString.apply(arr) === '[object Array]';
|
4449 |
-
},
|
4450 |
-
/*==================================================
|
4451 |
-
Browser
|
4452 |
-
====================================================*/
|
4453 |
-
browser: {
|
4454 |
-
ie: window.navigator.pointerEnabled || window.navigator.msPointerEnabled,
|
4455 |
-
ieTouch: (window.navigator.msPointerEnabled && window.navigator.msMaxTouchPoints > 1) || (window.navigator.pointerEnabled && window.navigator.maxTouchPoints > 1),
|
4456 |
-
lteIE9: (function() {
|
4457 |
-
// create temporary DIV
|
4458 |
-
var div = document.createElement('div');
|
4459 |
-
// add content to tmp DIV which is wrapped into the IE HTML conditional statement
|
4460 |
-
div.innerHTML = '<!--[if lte IE 9]><i></i><![endif]-->';
|
4461 |
-
// return true / false value based on what will browser render
|
4462 |
-
return div.getElementsByTagName('i').length === 1;
|
4463 |
-
})()
|
4464 |
-
},
|
4465 |
-
/*==================================================
|
4466 |
-
Devices
|
4467 |
-
====================================================*/
|
4468 |
-
device: (function () {
|
4469 |
-
var ua = navigator.userAgent;
|
4470 |
-
var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
|
4471 |
-
var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
|
4472 |
-
var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
|
4473 |
-
var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/);
|
4474 |
-
return {
|
4475 |
-
ios: ipad || iphone || ipod,
|
4476 |
-
android: android
|
4477 |
-
};
|
4478 |
-
})(),
|
4479 |
-
/*==================================================
|
4480 |
-
Feature Detection
|
4481 |
-
====================================================*/
|
4482 |
-
support: {
|
4483 |
-
touch : (window.Modernizr && Modernizr.touch === true) || (function () {
|
4484 |
-
return !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch);
|
4485 |
-
})(),
|
4486 |
-
|
4487 |
-
transforms3d : (window.Modernizr && Modernizr.csstransforms3d === true) || (function () {
|
4488 |
-
var div = document.createElement('div').style;
|
4489 |
-
return ('webkitPerspective' in div || 'MozPerspective' in div || 'OPerspective' in div || 'MsPerspective' in div || 'perspective' in div);
|
4490 |
-
})(),
|
4491 |
-
|
4492 |
-
flexbox: (function () {
|
4493 |
-
var div = document.createElement('div').style;
|
4494 |
-
var styles = ('alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient').split(' ');
|
4495 |
-
for (var i = 0; i < styles.length; i++) {
|
4496 |
-
if (styles[i] in div) return true;
|
4497 |
-
}
|
4498 |
-
})(),
|
4499 |
-
|
4500 |
-
observer: (function () {
|
4501 |
-
return ('MutationObserver' in window || 'WebkitMutationObserver' in window);
|
4502 |
-
})(),
|
4503 |
-
|
4504 |
-
passiveListener: (function () {
|
4505 |
-
var supportsPassive = false;
|
4506 |
-
try {
|
4507 |
-
var opts = Object.defineProperty({}, 'passive', {
|
4508 |
-
get: function() {
|
4509 |
-
supportsPassive = true;
|
4510 |
-
}
|
4511 |
-
});
|
4512 |
-
window.addEventListener('testPassiveListener', null, opts);
|
4513 |
-
} catch (e) {}
|
4514 |
-
return supportsPassive;
|
4515 |
-
})(),
|
4516 |
-
|
4517 |
-
gestures: (function () {
|
4518 |
-
return 'ongesturestart' in window;
|
4519 |
-
})()
|
4520 |
-
},
|
4521 |
-
/*==================================================
|
4522 |
-
Plugins
|
4523 |
-
====================================================*/
|
4524 |
-
plugins: {}
|
4525 |
-
};
|
4526 |
-
|
4527 |
-
|
4528 |
-
/*===========================
|
4529 |
-
Get Dom libraries
|
4530 |
-
===========================*/
|
4531 |
-
var swiperDomPlugins = ['jQuery', 'Zepto', 'Dom7'];
|
4532 |
-
for (var i = 0; i < swiperDomPlugins.length; i++) {
|
4533 |
-
if (window[swiperDomPlugins[i]]) {
|
4534 |
-
addLibraryPlugin(window[swiperDomPlugins[i]]);
|
4535 |
-
}
|
4536 |
-
}
|
4537 |
-
// Required DOM Plugins
|
4538 |
-
var domLib;
|
4539 |
-
if (typeof Dom7 === 'undefined') {
|
4540 |
-
domLib = window.Dom7 || window.Zepto || window.jQuery;
|
4541 |
-
}
|
4542 |
-
else {
|
4543 |
-
domLib = Dom7;
|
4544 |
-
}
|
4545 |
-
|
4546 |
-
/*===========================
|
4547 |
-
Add .swiper plugin from Dom libraries
|
4548 |
-
===========================*/
|
4549 |
-
function addLibraryPlugin(lib) {
|
4550 |
-
lib.fn.swiper = function (params) {
|
4551 |
-
var firstInstance;
|
4552 |
-
lib(this).each(function () {
|
4553 |
-
var s = new Swiper(this, params);
|
4554 |
-
if (!firstInstance) firstInstance = s;
|
4555 |
-
});
|
4556 |
-
return firstInstance;
|
4557 |
-
};
|
4558 |
-
}
|
4559 |
-
|
4560 |
-
if (domLib) {
|
4561 |
-
if (!('transitionEnd' in domLib.fn)) {
|
4562 |
-
domLib.fn.transitionEnd = function (callback) {
|
4563 |
-
var events = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'],
|
4564 |
-
i, j, dom = this;
|
4565 |
-
function fireCallBack(e) {
|
4566 |
-
/*jshint validthis:true */
|
4567 |
-
if (e.target !== this) return;
|
4568 |
-
callback.call(this, e);
|
4569 |
-
for (i = 0; i < events.length; i++) {
|
4570 |
-
dom.off(events[i], fireCallBack);
|
4571 |
-
}
|
4572 |
-
}
|
4573 |
-
if (callback) {
|
4574 |
-
for (i = 0; i < events.length; i++) {
|
4575 |
-
dom.on(events[i], fireCallBack);
|
4576 |
-
}
|
4577 |
-
}
|
4578 |
-
return this;
|
4579 |
-
};
|
4580 |
-
}
|
4581 |
-
if (!('transform' in domLib.fn)) {
|
4582 |
-
domLib.fn.transform = function (transform) {
|
4583 |
-
for (var i = 0; i < this.length; i++) {
|
4584 |
-
var elStyle = this[i].style;
|
4585 |
-
elStyle.webkitTransform = elStyle.MsTransform = elStyle.msTransform = elStyle.MozTransform = elStyle.OTransform = elStyle.transform = transform;
|
4586 |
-
}
|
4587 |
-
return this;
|
4588 |
-
};
|
4589 |
-
}
|
4590 |
-
if (!('transition' in domLib.fn)) {
|
4591 |
-
domLib.fn.transition = function (duration) {
|
4592 |
-
if (typeof duration !== 'string') {
|
4593 |
-
duration = duration + 'ms';
|
4594 |
-
}
|
4595 |
-
for (var i = 0; i < this.length; i++) {
|
4596 |
-
var elStyle = this[i].style;
|
4597 |
-
elStyle.webkitTransitionDuration = elStyle.MsTransitionDuration = elStyle.msTransitionDuration = elStyle.MozTransitionDuration = elStyle.OTransitionDuration = elStyle.transitionDuration = duration;
|
4598 |
-
}
|
4599 |
-
return this;
|
4600 |
-
};
|
4601 |
-
}
|
4602 |
-
if (!('outerWidth' in domLib.fn)) {
|
4603 |
-
domLib.fn.outerWidth = function (includeMargins) {
|
4604 |
-
if (this.length > 0) {
|
4605 |
-
if (includeMargins)
|
4606 |
-
return this[0].offsetWidth + parseFloat(this.css('margin-right')) + parseFloat(this.css('margin-left'));
|
4607 |
-
else
|
4608 |
-
return this[0].offsetWidth;
|
4609 |
-
}
|
4610 |
-
else return null;
|
4611 |
-
};
|
4612 |
-
}
|
4613 |
-
}
|
4614 |
-
|
4615 |
-
window.Swiper = Swiper;
|
4616 |
-
})();
|
4617 |
-
/*===========================
|
4618 |
-
Swiper AMD Export
|
4619 |
-
===========================*/
|
4620 |
-
if (typeof(module) !== 'undefined')
|
4621 |
-
{
|
4622 |
-
module.exports = window.Swiper;
|
4623 |
-
}
|
4624 |
-
else if (typeof define === 'function' && define.amd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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/swiper/swiper.jquery.min.js
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Swiper 3.4.0
|
3 |
-
* Most modern mobile touch slider and framework with hardware accelerated transitions
|
4 |
-
*
|
5 |
-
* http://www.idangero.us/swiper/
|
6 |
-
*
|
7 |
-
* Copyright 2016, Vladimir Kharlampidi
|
8 |
-
* The iDangero.us
|
9 |
-
* http://www.idangero.us/
|
10 |
-
*
|
11 |
-
* Licensed under MIT
|
12 |
-
*
|
13 |
-
* Released on: October 16, 2016
|
14 |
-
*/
|
15 |
-
!function(){"use strict";function e(e){e.fn.swiper=function(a){var s;return e(this).each(function(){var e=new t(this,a);s||(s=e)}),s}}var a,t=function(e,s){function i(e){return Math.floor(e)}function n(){var e=b.params.autoplay,a=b.slides.eq(b.activeIndex);a.attr("data-swiper-autoplay")&&(e=a.attr("data-swiper-autoplay")||b.params.autoplay),b.autoplayTimeoutId=setTimeout(function(){b.params.loop?(b.fixLoop(),b._slideNext(),b.emit("onAutoplay",b)):b.isEnd?s.autoplayStopOnLast?b.stopAutoplay():(b._slideTo(0),b.emit("onAutoplay",b)):(b._slideNext(),b.emit("onAutoplay",b))},e)}function o(e,t){var s=a(e.target);if(!s.is(t))if("string"==typeof t)s=s.parents(t);else if(t.nodeType){var r;return s.parents().each(function(e,a){a===t&&(r=t)}),r?t:void 0}if(0!==s.length)return s[0]}function l(e,a){a=a||{};var t=window.MutationObserver||window.WebkitMutationObserver,s=new t(function(e){e.forEach(function(e){b.onResize(!0),b.emit("onObserverUpdate",b,e)})});s.observe(e,{attributes:"undefined"==typeof a.attributes||a.attributes,childList:"undefined"==typeof a.childList||a.childList,characterData:"undefined"==typeof a.characterData||a.characterData}),b.observers.push(s)}function p(e){e.originalEvent&&(e=e.originalEvent);var a=e.keyCode||e.charCode;if(!b.params.allowSwipeToNext&&(b.isHorizontal()&&39===a||!b.isHorizontal()&&40===a))return!1;if(!b.params.allowSwipeToPrev&&(b.isHorizontal()&&37===a||!b.isHorizontal()&&38===a))return!1;if(!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey||document.activeElement&&document.activeElement.nodeName&&("input"===document.activeElement.nodeName.toLowerCase()||"textarea"===document.activeElement.nodeName.toLowerCase()))){if(37===a||39===a||38===a||40===a){var t=!1;if(b.container.parents("."+b.params.slideClass).length>0&&0===b.container.parents("."+b.params.slideActiveClass).length)return;var s={left:window.pageXOffset,top:window.pageYOffset},r=window.innerWidth,i=window.innerHeight,n=b.container.offset();b.rtl&&(n.left=n.left-b.container[0].scrollLeft);for(var o=[[n.left,n.top],[n.left+b.width,n.top],[n.left,n.top+b.height],[n.left+b.width,n.top+b.height]],l=0;l<o.length;l++){var p=o[l];p[0]>=s.left&&p[0]<=s.left+r&&p[1]>=s.top&&p[1]<=s.top+i&&(t=!0)}if(!t)return}b.isHorizontal()?(37!==a&&39!==a||(e.preventDefault?e.preventDefault():e.returnValue=!1),(39===a&&!b.rtl||37===a&&b.rtl)&&b.slideNext(),(37===a&&!b.rtl||39===a&&b.rtl)&&b.slidePrev()):(38!==a&&40!==a||(e.preventDefault?e.preventDefault():e.returnValue=!1),40===a&&b.slideNext(),38===a&&b.slidePrev())}}function d(){var e="onwheel",a=e in document;if(!a){var t=document.createElement("div");t.setAttribute(e,"return;"),a="function"==typeof t[e]}return!a&&document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0&&(a=document.implementation.hasFeature("Events.wheel","3.0")),a}function u(e){e.originalEvent&&(e=e.originalEvent);var a=0,t=b.rtl?-1:1,s=m(e);if(b.params.mousewheelForceToAxis)if(b.isHorizontal()){if(!(Math.abs(s.pixelX)>Math.abs(s.pixelY)))return;a=s.pixelX*t}else{if(!(Math.abs(s.pixelY)>Math.abs(s.pixelX)))return;a=s.pixelY}else a=Math.abs(s.pixelX)>Math.abs(s.pixelY)?-s.pixelX*t:-s.pixelY;if(0!==a){if(b.params.mousewheelInvert&&(a=-a),b.params.freeMode){var r=b.getWrapperTranslate()+a*b.params.mousewheelSensitivity,i=b.isBeginning,n=b.isEnd;if(r>=b.minTranslate()&&(r=b.minTranslate()),r<=b.maxTranslate()&&(r=b.maxTranslate()),b.setWrapperTransition(0),b.setWrapperTranslate(r),b.updateProgress(),b.updateActiveIndex(),(!i&&b.isBeginning||!n&&b.isEnd)&&b.updateClasses(),b.params.freeModeSticky?(clearTimeout(b.mousewheel.timeout),b.mousewheel.timeout=setTimeout(function(){b.slideReset()},300)):b.params.lazyLoading&&b.lazy&&b.lazy.load(),b.emit("onScroll",b,e),b.params.autoplay&&b.params.autoplayDisableOnInteraction&&b.stopAutoplay(),0===r||r===b.maxTranslate())return}else{if((new window.Date).getTime()-b.mousewheel.lastScrollTime>60)if(a<0)if(b.isEnd&&!b.params.loop||b.animating){if(b.params.mousewheelReleaseOnEdges)return!0}else b.slideNext(),b.emit("onScroll",b,e);else if(b.isBeginning&&!b.params.loop||b.animating){if(b.params.mousewheelReleaseOnEdges)return!0}else b.slidePrev(),b.emit("onScroll",b,e);b.mousewheel.lastScrollTime=(new window.Date).getTime()}return e.preventDefault?e.preventDefault():e.returnValue=!1,!1}}function m(e){var a=10,t=40,s=800,r=0,i=0,n=0,o=0;return"detail"in e&&(i=e.detail),"wheelDelta"in e&&(i=-e.wheelDelta/120),"wheelDeltaY"in e&&(i=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(r=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(r=i,i=0),n=r*a,o=i*a,"deltaY"in e&&(o=e.deltaY),"deltaX"in e&&(n=e.deltaX),(n||o)&&e.deltaMode&&(1===e.deltaMode?(n*=t,o*=t):(n*=s,o*=s)),n&&!r&&(r=n<1?-1:1),o&&!i&&(i=o<1?-1:1),{spinX:r,spinY:i,pixelX:n,pixelY:o}}function c(e,t){e=a(e);var s,r,i,n=b.rtl?-1:1;s=e.attr("data-swiper-parallax")||"0",r=e.attr("data-swiper-parallax-x"),i=e.attr("data-swiper-parallax-y"),r||i?(r=r||"0",i=i||"0"):b.isHorizontal()?(r=s,i="0"):(i=s,r="0"),r=r.indexOf("%")>=0?parseInt(r,10)*t*n+"%":r*t*n+"px",i=i.indexOf("%")>=0?parseInt(i,10)*t+"%":i*t+"px",e.transform("translate3d("+r+", "+i+",0px)")}function g(e){return 0!==e.indexOf("on")&&(e=e[0]!==e[0].toUpperCase()?"on"+e[0].toUpperCase()+e.substring(1):"on"+e),e}if(!(this instanceof t))return new t(e,s);var h={direction:"horizontal",touchEventsTarget:"container",initialSlide:0,speed:300,autoplay:!1,autoplayDisableOnInteraction:!0,autoplayStopOnLast:!1,iOSEdgeSwipeDetection:!1,iOSEdgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:!1,freeModeMinimumVelocity:.02,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",coverflow:{rotate:50,stretch:0,depth:100,modifier:1,slideShadows:!0},flip:{slideShadows:!0,limitRotation:!0},cube:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94},fade:{crossFade:!1},parallax:!1,zoom:!1,zoomMax:3,zoomMin:1,zoomToggle:!0,scrollbar:null,scrollbarHide:!0,scrollbarDraggable:!1,scrollbarSnapOnRelease:!1,keyboardControl:!1,mousewheelControl:!1,mousewheelReleaseOnEdges:!1,mousewheelInvert:!1,mousewheelForceToAxis:!1,mousewheelSensitivity:1,mousewheelEventsTarged:"container",hashnav:!1,hashnavWatchState:!1,history:!1,replaceState:!1,breakpoints:void 0,spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,centeredSlides:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,onlyExternal:!1,threshold:0,touchMoveStopPropagation:!0,touchReleaseOnEdges:!1,uniqueNavElements:!0,pagination:null,paginationElement:"span",paginationClickable:!1,paginationHide:!1,paginationBulletRender:null,paginationProgressRender:null,paginationFractionRender:null,paginationCustomRender:null,paginationType:"bullets",resistance:!0,resistanceRatio:.85,nextButton:null,prevButton:null,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,lazyLoading:!1,lazyLoadingInPrevNext:!1,lazyLoadingInPrevNextAmount:1,lazyLoadingOnTransitionStart:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,control:void 0,controlInverse:!1,controlBy:"slide",normalizeSlideIndex:!0,allowSwipeToPrev:!0,allowSwipeToNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",passiveListeners:!0,containerModifierClass:"swiper-container-",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideDuplicateActiveClass:"swiper-slide-duplicate-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slideDuplicateNextClass:"swiper-slide-duplicate-next",slidePrevClass:"swiper-slide-prev",slideDuplicatePrevClass:"swiper-slide-duplicate-prev",wrapperClass:"swiper-wrapper",bulletClass:"swiper-pagination-bullet",bulletActiveClass:"swiper-pagination-bullet-active",buttonDisabledClass:"swiper-button-disabled",paginationCurrentClass:"swiper-pagination-current",paginationTotalClass:"swiper-pagination-total",paginationHiddenClass:"swiper-pagination-hidden",paginationProgressbarClass:"swiper-pagination-progressbar",paginationClickableClass:"swiper-pagination-clickable",paginationModifierClass:"swiper-pagination-",lazyLoadingClass:"swiper-lazy",lazyStatusLoadingClass:"swiper-lazy-loading",lazyStatusLoadedClass:"swiper-lazy-loaded",lazyPreloaderClass:"swiper-lazy-preloader",notificationClass:"swiper-notification",preloaderClass:"preloader",zoomContainerClass:"swiper-zoom-container",observer:!1,observeParents:!1,a11y:!1,prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",runCallbacksOnInit:!0},f=s&&s.virtualTranslate;s=s||{};var v={};for(var w in s)if("object"!=typeof s[w]||null===s[w]||(s[w].nodeType||s[w]===window||s[w]===document||"undefined"!=typeof Dom7&&s[w]instanceof Dom7||"undefined"!=typeof jQuery&&s[w]instanceof jQuery))v[w]=s[w];else{v[w]={};for(var y in s[w])v[w][y]=s[w][y]}for(var x in h)if("undefined"==typeof s[x])s[x]=h[x];else if("object"==typeof s[x])for(var T in h[x])"undefined"==typeof s[x][T]&&(s[x][T]=h[x][T]);var b=this;if(b.params=s,b.originalParams=v,b.classNames=[],"undefined"!=typeof a&&"undefined"!=typeof Dom7&&(a=Dom7),("undefined"!=typeof a||(a="undefined"==typeof Dom7?window.Dom7||window.Zepto||window.jQuery:Dom7))&&(b.$=a,b.currentBreakpoint=void 0,b.getActiveBreakpoint=function(){if(!b.params.breakpoints)return!1;var e,a=!1,t=[];for(e in b.params.breakpoints)b.params.breakpoints.hasOwnProperty(e)&&t.push(e);t.sort(function(e,a){return parseInt(e,10)>parseInt(a,10)});for(var s=0;s<t.length;s++)e=t[s],e>=window.innerWidth&&!a&&(a=e);return a||"max"},b.setBreakpoint=function(){var e=b.getActiveBreakpoint();if(e&&b.currentBreakpoint!==e){var a=e in b.params.breakpoints?b.params.breakpoints[e]:b.originalParams,t=b.params.loop&&a.slidesPerView!==b.params.slidesPerView;for(var s in a)b.params[s]=a[s];b.currentBreakpoint=e,t&&b.destroyLoop&&b.reLoop(!0)}},b.params.breakpoints&&b.setBreakpoint(),b.container=a(e),0!==b.container.length)){if(b.container.length>1){var C=[];return b.container.each(function(){C.push(new t(this,s))}),C}b.container[0].swiper=b,b.container.data("swiper",b),b.classNames.push(b.params.containerModifierClass+b.params.direction),b.params.freeMode&&b.classNames.push(b.params.containerModifierClass+"free-mode"),b.support.flexbox||(b.classNames.push(b.params.containerModifierClass+"no-flexbox"),b.params.slidesPerColumn=1),b.params.autoHeight&&b.classNames.push(b.params.containerModifierClass+"autoheight"),(b.params.parallax||b.params.watchSlidesVisibility)&&(b.params.watchSlidesProgress=!0),b.params.touchReleaseOnEdges&&(b.params.resistanceRatio=0),["cube","coverflow","flip"].indexOf(b.params.effect)>=0&&(b.support.transforms3d?(b.params.watchSlidesProgress=!0,b.classNames.push(b.params.containerModifierClass+"3d")):b.params.effect="slide"),"slide"!==b.params.effect&&b.classNames.push(b.params.containerModifierClass+b.params.effect),"cube"===b.params.effect&&(b.params.resistanceRatio=0,b.params.slidesPerView=1,b.params.slidesPerColumn=1,b.params.slidesPerGroup=1,b.params.centeredSlides=!1,b.params.spaceBetween=0,b.params.virtualTranslate=!0,b.params.setWrapperSize=!1),"fade"!==b.params.effect&&"flip"!==b.params.effect||(b.params.slidesPerView=1,b.params.slidesPerColumn=1,b.params.slidesPerGroup=1,b.params.watchSlidesProgress=!0,b.params.spaceBetween=0,b.params.setWrapperSize=!1,"undefined"==typeof f&&(b.params.virtualTranslate=!0)),b.params.grabCursor&&b.support.touch&&(b.params.grabCursor=!1),b.wrapper=b.container.children("."+b.params.wrapperClass),b.params.pagination&&(b.paginationContainer=a(b.params.pagination),b.params.uniqueNavElements&&"string"==typeof b.params.pagination&&b.paginationContainer.length>1&&1===b.container.find(b.params.pagination).length&&(b.paginationContainer=b.container.find(b.params.pagination)),"bullets"===b.params.paginationType&&b.params.paginationClickable?b.paginationContainer.addClass(b.params.paginationModifierClass+"clickable"):b.params.paginationClickable=!1,b.paginationContainer.addClass(b.params.paginationModifierClass+b.params.paginationType)),(b.params.nextButton||b.params.prevButton)&&(b.params.nextButton&&(b.nextButton=a(b.params.nextButton),b.params.uniqueNavElements&&"string"==typeof b.params.nextButton&&b.nextButton.length>1&&1===b.container.find(b.params.nextButton).length&&(b.nextButton=b.container.find(b.params.nextButton))),b.params.prevButton&&(b.prevButton=a(b.params.prevButton),b.params.uniqueNavElements&&"string"==typeof b.params.prevButton&&b.prevButton.length>1&&1===b.container.find(b.params.prevButton).length&&(b.prevButton=b.container.find(b.params.prevButton)))),b.isHorizontal=function(){return"horizontal"===b.params.direction},b.rtl=b.isHorizontal()&&("rtl"===b.container[0].dir.toLowerCase()||"rtl"===b.container.css("direction")),b.rtl&&b.classNames.push(b.params.containerModifierClass+"rtl"),b.rtl&&(b.wrongRTL="-webkit-box"===b.wrapper.css("display")),b.params.slidesPerColumn>1&&b.classNames.push(b.params.containerModifierClass+"multirow"),b.device.android&&b.classNames.push(b.params.containerModifierClass+"android"),b.container.addClass(b.classNames.join(" ")),b.translate=0,b.progress=0,b.velocity=0,b.lockSwipeToNext=function(){b.params.allowSwipeToNext=!1,b.params.allowSwipeToPrev===!1&&b.params.grabCursor&&b.unsetGrabCursor()},b.lockSwipeToPrev=function(){b.params.allowSwipeToPrev=!1,b.params.allowSwipeToNext===!1&&b.params.grabCursor&&b.unsetGrabCursor()},b.lockSwipes=function(){b.params.allowSwipeToNext=b.params.allowSwipeToPrev=!1,b.params.grabCursor&&b.unsetGrabCursor()},b.unlockSwipeToNext=function(){b.params.allowSwipeToNext=!0,b.params.allowSwipeToPrev===!0&&b.params.grabCursor&&b.setGrabCursor()},b.unlockSwipeToPrev=function(){b.params.allowSwipeToPrev=!0,b.params.allowSwipeToNext===!0&&b.params.grabCursor&&b.setGrabCursor()},b.unlockSwipes=function(){b.params.allowSwipeToNext=b.params.allowSwipeToPrev=!0,b.params.grabCursor&&b.setGrabCursor()},b.setGrabCursor=function(e){b.container[0].style.cursor="move",b.container[0].style.cursor=e?"-webkit-grabbing":"-webkit-grab",b.container[0].style.cursor=e?"-moz-grabbin":"-moz-grab",b.container[0].style.cursor=e?"grabbing":"grab"},b.unsetGrabCursor=function(){b.container[0].style.cursor=""},b.params.grabCursor&&b.setGrabCursor(),b.imagesToLoad=[],b.imagesLoaded=0,b.loadImage=function(e,a,t,s,r,i){function n(){i&&i()}var o;e.complete&&r?n():a?(o=new window.Image,o.onload=n,o.onerror=n,s&&(o.sizes=s),t&&(o.srcset=t),a&&(o.src=a)):n()},b.preloadImages=function(){function e(){"undefined"!=typeof b&&null!==b&&(void 0!==b.imagesLoaded&&b.imagesLoaded++,b.imagesLoaded===b.imagesToLoad.length&&(b.params.updateOnImagesReady&&b.update(),b.emit("onImagesReady",b)))}b.imagesToLoad=b.container.find("img");for(var a=0;a<b.imagesToLoad.length;a++)b.loadImage(b.imagesToLoad[a],b.imagesToLoad[a].currentSrc||b.imagesToLoad[a].getAttribute("src"),b.imagesToLoad[a].srcset||b.imagesToLoad[a].getAttribute("srcset"),b.imagesToLoad[a].sizes||b.imagesToLoad[a].getAttribute("sizes"),!0,e)},b.autoplayTimeoutId=void 0,b.autoplaying=!1,b.autoplayPaused=!1,b.startAutoplay=function(){return"undefined"==typeof b.autoplayTimeoutId&&(!!b.params.autoplay&&(!b.autoplaying&&(b.autoplaying=!0,b.emit("onAutoplayStart",b),void n())))},b.stopAutoplay=function(e){b.autoplayTimeoutId&&(b.autoplayTimeoutId&&clearTimeout(b.autoplayTimeoutId),b.autoplaying=!1,b.autoplayTimeoutId=void 0,b.emit("onAutoplayStop",b))},b.pauseAutoplay=function(e){b.autoplayPaused||(b.autoplayTimeoutId&&clearTimeout(b.autoplayTimeoutId),b.autoplayPaused=!0,0===e?(b.autoplayPaused=!1,n()):b.wrapper.transitionEnd(function(){b&&(b.autoplayPaused=!1,b.autoplaying?n():b.stopAutoplay())}))},b.minTranslate=function(){return-b.snapGrid[0]},b.maxTranslate=function(){return-b.snapGrid[b.snapGrid.length-1]},b.updateAutoHeight=function(){var e=[],a=0;if("auto"!==b.params.slidesPerView&&b.params.slidesPerView>1)for(r=0;r<Math.ceil(b.params.slidesPerView);r++){var t=b.activeIndex+r;if(t>b.slides.length)break;e.push(b.slides.eq(t)[0])}else e.push(b.slides.eq(b.activeIndex)[0]);for(r=0;r<e.length;r++)if("undefined"!=typeof e[r]){var s=e[r].offsetHeight;a=s>a?s:a}a&&b.wrapper.css("height",a+"px")},b.updateContainerSize=function(){var e,a;e="undefined"!=typeof b.params.width?b.params.width:b.container[0].clientWidth,a="undefined"!=typeof b.params.height?b.params.height:b.container[0].clientHeight,0===e&&b.isHorizontal()||0===a&&!b.isHorizontal()||(e=e-parseInt(b.container.css("padding-left"),10)-parseInt(b.container.css("padding-right"),10),a=a-parseInt(b.container.css("padding-top"),10)-parseInt(b.container.css("padding-bottom"),10),b.width=e,b.height=a,b.size=b.isHorizontal()?b.width:b.height)},b.updateSlidesSize=function(){b.slides=b.wrapper.children("."+b.params.slideClass),b.snapGrid=[],b.slidesGrid=[],b.slidesSizesGrid=[];var e,a=b.params.spaceBetween,t=-b.params.slidesOffsetBefore,s=0,r=0;if("undefined"!=typeof b.size){"string"==typeof a&&a.indexOf("%")>=0&&(a=parseFloat(a.replace("%",""))/100*b.size),b.virtualSize=-a,b.rtl?b.slides.css({marginLeft:"",marginTop:""}):b.slides.css({marginRight:"",marginBottom:""});var n;b.params.slidesPerColumn>1&&(n=Math.floor(b.slides.length/b.params.slidesPerColumn)===b.slides.length/b.params.slidesPerColumn?b.slides.length:Math.ceil(b.slides.length/b.params.slidesPerColumn)*b.params.slidesPerColumn,"auto"!==b.params.slidesPerView&&"row"===b.params.slidesPerColumnFill&&(n=Math.max(n,b.params.slidesPerView*b.params.slidesPerColumn)));var o,l=b.params.slidesPerColumn,p=n/l,d=p-(b.params.slidesPerColumn*p-b.slides.length);for(e=0;e<b.slides.length;e++){o=0;var u=b.slides.eq(e);if(b.params.slidesPerColumn>1){var m,c,g;"column"===b.params.slidesPerColumnFill?(c=Math.floor(e/l),g=e-c*l,(c>d||c===d&&g===l-1)&&++g>=l&&(g=0,c++),m=c+g*n/l,u.css({"-webkit-box-ordinal-group":m,"-moz-box-ordinal-group":m,"-ms-flex-order":m,"-webkit-order":m,order:m})):(g=Math.floor(e/p),c=e-g*p),u.css("margin-"+(b.isHorizontal()?"top":"left"),0!==g&&b.params.spaceBetween&&b.params.spaceBetween+"px").attr("data-swiper-column",c).attr("data-swiper-row",g)}"none"!==u.css("display")&&("auto"===b.params.slidesPerView?(o=b.isHorizontal()?u.outerWidth(!0):u.outerHeight(!0),b.params.roundLengths&&(o=i(o))):(o=(b.size-(b.params.slidesPerView-1)*a)/b.params.slidesPerView,b.params.roundLengths&&(o=i(o)),b.isHorizontal()?b.slides[e].style.width=o+"px":b.slides[e].style.height=o+"px"),b.slides[e].swiperSlideSize=o,b.slidesSizesGrid.push(o),b.params.centeredSlides?(t=t+o/2+s/2+a,0===e&&(t=t-b.size/2-a),Math.abs(t)<.001&&(t=0),r%b.params.slidesPerGroup===0&&b.snapGrid.push(t),b.slidesGrid.push(t)):(r%b.params.slidesPerGroup===0&&b.snapGrid.push(t),b.slidesGrid.push(t),t=t+o+a),b.virtualSize+=o+a,s=o,r++)}b.virtualSize=Math.max(b.virtualSize,b.size)+b.params.slidesOffsetAfter;var h;if(b.rtl&&b.wrongRTL&&("slide"===b.params.effect||"coverflow"===b.params.effect)&&b.wrapper.css({width:b.virtualSize+b.params.spaceBetween+"px"}),b.support.flexbox&&!b.params.setWrapperSize||(b.isHorizontal()?b.wrapper.css({width:b.virtualSize+b.params.spaceBetween+"px"}):b.wrapper.css({height:b.virtualSize+b.params.spaceBetween+"px"})),b.params.slidesPerColumn>1&&(b.virtualSize=(o+b.params.spaceBetween)*n,b.virtualSize=Math.ceil(b.virtualSize/b.params.slidesPerColumn)-b.params.spaceBetween,b.isHorizontal()?b.wrapper.css({width:b.virtualSize+b.params.spaceBetween+"px"}):b.wrapper.css({height:b.virtualSize+b.params.spaceBetween+"px"}),b.params.centeredSlides)){for(h=[],e=0;e<b.snapGrid.length;e++)b.snapGrid[e]<b.virtualSize+b.snapGrid[0]&&h.push(b.snapGrid[e]);b.snapGrid=h}if(!b.params.centeredSlides){for(h=[],e=0;e<b.snapGrid.length;e++)b.snapGrid[e]<=b.virtualSize-b.size&&h.push(b.snapGrid[e]);b.snapGrid=h,Math.floor(b.virtualSize-b.size)-Math.floor(b.snapGrid[b.snapGrid.length-1])>1&&b.snapGrid.push(b.virtualSize-b.size)}0===b.snapGrid.length&&(b.snapGrid=[0]),0!==b.params.spaceBetween&&(b.isHorizontal()?b.rtl?b.slides.css({marginLeft:a+"px"}):b.slides.css({marginRight:a+"px"}):b.slides.css({marginBottom:a+"px"})),b.params.watchSlidesProgress&&b.updateSlidesOffset()}},b.updateSlidesOffset=function(){for(var e=0;e<b.slides.length;e++)b.slides[e].swiperSlideOffset=b.isHorizontal()?b.slides[e].offsetLeft:b.slides[e].offsetTop},b.updateSlidesProgress=function(e){if("undefined"==typeof e&&(e=b.translate||0),0!==b.slides.length){"undefined"==typeof b.slides[0].swiperSlideOffset&&b.updateSlidesOffset();var a=-e;b.rtl&&(a=e),b.slides.removeClass(b.params.slideVisibleClass);for(var t=0;t<b.slides.length;t++){var s=b.slides[t],r=(a+(b.params.centeredSlides?b.minTranslate():0)-s.swiperSlideOffset)/(s.swiperSlideSize+b.params.spaceBetween);if(b.params.watchSlidesVisibility){var i=-(a-s.swiperSlideOffset),n=i+b.slidesSizesGrid[t],o=i>=0&&i<b.size||n>0&&n<=b.size||i<=0&&n>=b.size;o&&b.slides.eq(t).addClass(b.params.slideVisibleClass)}s.progress=b.rtl?-r:r}}},b.updateProgress=function(e){"undefined"==typeof e&&(e=b.translate||0);var a=b.maxTranslate()-b.minTranslate(),t=b.isBeginning,s=b.isEnd;0===a?(b.progress=0,b.isBeginning=b.isEnd=!0):(b.progress=(e-b.minTranslate())/a,b.isBeginning=b.progress<=0,b.isEnd=b.progress>=1),b.isBeginning&&!t&&b.emit("onReachBeginning",b),b.isEnd&&!s&&b.emit("onReachEnd",b),b.params.watchSlidesProgress&&b.updateSlidesProgress(e),b.emit("onProgress",b,b.progress)},b.updateActiveIndex=function(){var e,a,t,s=b.rtl?b.translate:-b.translate;for(a=0;a<b.slidesGrid.length;a++)"undefined"!=typeof b.slidesGrid[a+1]?s>=b.slidesGrid[a]&&s<b.slidesGrid[a+1]-(b.slidesGrid[a+1]-b.slidesGrid[a])/2?e=a:s>=b.slidesGrid[a]&&s<b.slidesGrid[a+1]&&(e=a+1):s>=b.slidesGrid[a]&&(e=a);b.params.normalizeSlideIndex&&(e<0||"undefined"==typeof e)&&(e=0),t=Math.floor(e/b.params.slidesPerGroup),t>=b.snapGrid.length&&(t=b.snapGrid.length-1),e!==b.activeIndex&&(b.snapIndex=t,b.previousIndex=b.activeIndex,b.activeIndex=e,b.updateClasses(),b.updateRealIndex())},b.updateRealIndex=function(){b.realIndex=b.slides.eq(b.activeIndex).attr("data-swiper-slide-index")||b.activeIndex},b.updateClasses=function(){b.slides.removeClass(b.params.slideActiveClass+" "+b.params.slideNextClass+" "+b.params.slidePrevClass+" "+b.params.slideDuplicateActiveClass+" "+b.params.slideDuplicateNextClass+" "+b.params.slideDuplicatePrevClass);var e=b.slides.eq(b.activeIndex);e.addClass(b.params.slideActiveClass),s.loop&&(e.hasClass(b.params.slideDuplicateClass)?b.wrapper.children("."+b.params.slideClass+":not(."+b.params.slideDuplicateClass+')[data-swiper-slide-index="'+b.realIndex+'"]').addClass(b.params.slideDuplicateActiveClass):b.wrapper.children("."+b.params.slideClass+"."+b.params.slideDuplicateClass+'[data-swiper-slide-index="'+b.realIndex+'"]').addClass(b.params.slideDuplicateActiveClass));var t=e.next("."+b.params.slideClass).addClass(b.params.slideNextClass);b.params.loop&&0===t.length&&(t=b.slides.eq(0),t.addClass(b.params.slideNextClass));var r=e.prev("."+b.params.slideClass).addClass(b.params.slidePrevClass);if(b.params.loop&&0===r.length&&(r=b.slides.eq(-1),r.addClass(b.params.slidePrevClass)),s.loop&&(t.hasClass(b.params.slideDuplicateClass)?b.wrapper.children("."+b.params.slideClass+":not(."+b.params.slideDuplicateClass+')[data-swiper-slide-index="'+t.attr("data-swiper-slide-index")+'"]').addClass(b.params.slideDuplicateNextClass):b.wrapper.children("."+b.params.slideClass+"."+b.params.slideDuplicateClass+'[data-swiper-slide-index="'+t.attr("data-swiper-slide-index")+'"]').addClass(b.params.slideDuplicateNextClass),r.hasClass(b.params.slideDuplicateClass)?b.wrapper.children("."+b.params.slideClass+":not(."+b.params.slideDuplicateClass+')[data-swiper-slide-index="'+r.attr("data-swiper-slide-index")+'"]').addClass(b.params.slideDuplicatePrevClass):b.wrapper.children("."+b.params.slideClass+"."+b.params.slideDuplicateClass+'[data-swiper-slide-index="'+r.attr("data-swiper-slide-index")+'"]').addClass(b.params.slideDuplicatePrevClass)),b.paginationContainer&&b.paginationContainer.length>0){var i,n=b.params.loop?Math.ceil((b.slides.length-2*b.loopedSlides)/b.params.slidesPerGroup):b.snapGrid.length;if(b.params.loop?(i=Math.ceil((b.activeIndex-b.loopedSlides)/b.params.slidesPerGroup),i>b.slides.length-1-2*b.loopedSlides&&(i-=b.slides.length-2*b.loopedSlides),i>n-1&&(i-=n),i<0&&"bullets"!==b.params.paginationType&&(i=n+i)):i="undefined"!=typeof b.snapIndex?b.snapIndex:b.activeIndex||0,"bullets"===b.params.paginationType&&b.bullets&&b.bullets.length>0&&(b.bullets.removeClass(b.params.bulletActiveClass),b.paginationContainer.length>1?b.bullets.each(function(){a(this).index()===i&&a(this).addClass(b.params.bulletActiveClass)}):b.bullets.eq(i).addClass(b.params.bulletActiveClass)),"fraction"===b.params.paginationType&&(b.paginationContainer.find("."+b.params.paginationCurrentClass).text(i+1),b.paginationContainer.find("."+b.params.paginationTotalClass).text(n)),"progress"===b.params.paginationType){var o=(i+1)/n,l=o,p=1;b.isHorizontal()||(p=o,l=1),b.paginationContainer.find("."+b.params.paginationProgressbarClass).transform("translate3d(0,0,0) scaleX("+l+") scaleY("+p+")").transition(b.params.speed)}"custom"===b.params.paginationType&&b.params.paginationCustomRender&&(b.paginationContainer.html(b.params.paginationCustomRender(b,i+1,n)),b.emit("onPaginationRendered",b,b.paginationContainer[0]))}b.params.loop||(b.params.prevButton&&b.prevButton&&b.prevButton.length>0&&(b.isBeginning?(b.prevButton.addClass(b.params.buttonDisabledClass),b.params.a11y&&b.a11y&&b.a11y.disable(b.prevButton)):(b.prevButton.removeClass(b.params.buttonDisabledClass),b.params.a11y&&b.a11y&&b.a11y.enable(b.prevButton))),b.params.nextButton&&b.nextButton&&b.nextButton.length>0&&(b.isEnd?(b.nextButton.addClass(b.params.buttonDisabledClass),b.params.a11y&&b.a11y&&b.a11y.disable(b.nextButton)):(b.nextButton.removeClass(b.params.buttonDisabledClass),b.params.a11y&&b.a11y&&b.a11y.enable(b.nextButton))))},b.updatePagination=function(){if(b.params.pagination&&b.paginationContainer&&b.paginationContainer.length>0){var e="";if("bullets"===b.params.paginationType){for(var a=b.params.loop?Math.ceil((b.slides.length-2*b.loopedSlides)/b.params.slidesPerGroup):b.snapGrid.length,t=0;t<a;t++)e+=b.params.paginationBulletRender?b.params.paginationBulletRender(b,t,b.params.bulletClass):"<"+b.params.paginationElement+' class="'+b.params.bulletClass+'"></'+b.params.paginationElement+">";b.paginationContainer.html(e),b.bullets=b.paginationContainer.find("."+b.params.bulletClass),b.params.paginationClickable&&b.params.a11y&&b.a11y&&b.a11y.initPagination()}"fraction"===b.params.paginationType&&(e=b.params.paginationFractionRender?b.params.paginationFractionRender(b,b.params.paginationCurrentClass,b.params.paginationTotalClass):'<span class="'+b.params.paginationCurrentClass+'"></span> / <span class="'+b.params.paginationTotalClass+'"></span>',b.paginationContainer.html(e)),"progress"===b.params.paginationType&&(e=b.params.paginationProgressRender?b.params.paginationProgressRender(b,b.params.paginationProgressbarClass):'<span class="'+b.params.paginationProgressbarClass+'"></span>',b.paginationContainer.html(e)),"custom"!==b.params.paginationType&&b.emit("onPaginationRendered",b,b.paginationContainer[0])}},b.update=function(e){function a(){b.rtl?-b.translate:b.translate;s=Math.min(Math.max(b.translate,b.maxTranslate()),b.minTranslate()),b.setWrapperTranslate(s),b.updateActiveIndex(),b.updateClasses()}if(b.updateContainerSize(),b.updateSlidesSize(),b.updateProgress(),b.updatePagination(),b.updateClasses(),b.params.scrollbar&&b.scrollbar&&b.scrollbar.set(),e){var t,s;b.controller&&b.controller.spline&&(b.controller.spline=void 0),b.params.freeMode?(a(),b.params.autoHeight&&b.updateAutoHeight()):(t=("auto"===b.params.slidesPerView||b.params.slidesPerView>1)&&b.isEnd&&!b.params.centeredSlides?b.slideTo(b.slides.length-1,0,!1,!0):b.slideTo(b.activeIndex,0,!1,!0),t||a())}else b.params.autoHeight&&b.updateAutoHeight()},b.onResize=function(e){b.params.breakpoints&&b.setBreakpoint();var a=b.params.allowSwipeToPrev,t=b.params.allowSwipeToNext;b.params.allowSwipeToPrev=b.params.allowSwipeToNext=!0,b.updateContainerSize(),b.updateSlidesSize(),("auto"===b.params.slidesPerView||b.params.freeMode||e)&&b.updatePagination(),b.params.scrollbar&&b.scrollbar&&b.scrollbar.set(),b.controller&&b.controller.spline&&(b.controller.spline=void 0);var s=!1;if(b.params.freeMode){var r=Math.min(Math.max(b.translate,b.maxTranslate()),b.minTranslate());b.setWrapperTranslate(r),b.updateActiveIndex(),b.updateClasses(),b.params.autoHeight&&b.updateAutoHeight()}else b.updateClasses(),s=("auto"===b.params.slidesPerView||b.params.slidesPerView>1)&&b.isEnd&&!b.params.centeredSlides?b.slideTo(b.slides.length-1,0,!1,!0):b.slideTo(b.activeIndex,0,!1,!0);b.params.lazyLoading&&!s&&b.lazy&&b.lazy.load(),b.params.allowSwipeToPrev=a,b.params.allowSwipeToNext=t},b.touchEventsDesktop={start:"mousedown",move:"mousemove",end:"mouseup"},window.navigator.pointerEnabled?b.touchEventsDesktop={start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled&&(b.touchEventsDesktop={start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}),b.touchEvents={start:b.support.touch||!b.params.simulateTouch?"touchstart":b.touchEventsDesktop.start,move:b.support.touch||!b.params.simulateTouch?"touchmove":b.touchEventsDesktop.move,end:b.support.touch||!b.params.simulateTouch?"touchend":b.touchEventsDesktop.end},(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&("container"===b.params.touchEventsTarget?b.container:b.wrapper).addClass("swiper-wp8-"+b.params.direction),b.initEvents=function(e){var a=e?"off":"on",t=e?"removeEventListener":"addEventListener",r="container"===b.params.touchEventsTarget?b.container[0]:b.wrapper[0],i=b.support.touch?r:document,n=!!b.params.nested;if(b.browser.ie)r[t](b.touchEvents.start,b.onTouchStart,!1),i[t](b.touchEvents.move,b.onTouchMove,n),i[t](b.touchEvents.end,b.onTouchEnd,!1);else{if(b.support.touch){var o=!("touchstart"!==b.touchEvents.start||!b.support.passiveListener||!b.params.passiveListeners)&&{passive:!0,capture:!1};r[t](b.touchEvents.start,b.onTouchStart,o),r[t](b.touchEvents.move,b.onTouchMove,n),r[t](b.touchEvents.end,b.onTouchEnd,o)}(s.simulateTouch&&!b.device.ios&&!b.device.android||s.simulateTouch&&!b.support.touch&&b.device.ios)&&(r[t]("mousedown",b.onTouchStart,!1),document[t]("mousemove",b.onTouchMove,n),document[t]("mouseup",b.onTouchEnd,!1))}window[t]("resize",b.onResize),b.params.nextButton&&b.nextButton&&b.nextButton.length>0&&(b.nextButton[a]("click",b.onClickNext),b.params.a11y&&b.a11y&&b.nextButton[a]("keydown",b.a11y.onEnterKey)),b.params.prevButton&&b.prevButton&&b.prevButton.length>0&&(b.prevButton[a]("click",b.onClickPrev),b.params.a11y&&b.a11y&&b.prevButton[a]("keydown",b.a11y.onEnterKey)),b.params.pagination&&b.params.paginationClickable&&(b.paginationContainer[a]("click","."+b.params.bulletClass,b.onClickIndex),b.params.a11y&&b.a11y&&b.paginationContainer[a]("keydown","."+b.params.bulletClass,b.a11y.onEnterKey)),(b.params.preventClicks||b.params.preventClicksPropagation)&&r[t]("click",b.preventClicks,!0)},b.attachEvents=function(){b.initEvents()},b.detachEvents=function(){b.initEvents(!0)},b.allowClick=!0,b.preventClicks=function(e){b.allowClick||(b.params.preventClicks&&e.preventDefault(),b.params.preventClicksPropagation&&b.animating&&(e.stopPropagation(),e.stopImmediatePropagation()))},b.onClickNext=function(e){e.preventDefault(),b.isEnd&&!b.params.loop||b.slideNext()},b.onClickPrev=function(e){e.preventDefault(),b.isBeginning&&!b.params.loop||b.slidePrev();
|
16 |
-
},b.onClickIndex=function(e){e.preventDefault();var t=a(this).index()*b.params.slidesPerGroup;b.params.loop&&(t+=b.loopedSlides),b.slideTo(t)},b.updateClickedSlide=function(e){var t=o(e,"."+b.params.slideClass),s=!1;if(t)for(var r=0;r<b.slides.length;r++)b.slides[r]===t&&(s=!0);if(!t||!s)return b.clickedSlide=void 0,void(b.clickedIndex=void 0);if(b.clickedSlide=t,b.clickedIndex=a(t).index(),b.params.slideToClickedSlide&&void 0!==b.clickedIndex&&b.clickedIndex!==b.activeIndex){var i,n=b.clickedIndex;if(b.params.loop){if(b.animating)return;i=a(b.clickedSlide).attr("data-swiper-slide-index"),b.params.centeredSlides?n<b.loopedSlides-b.params.slidesPerView/2||n>b.slides.length-b.loopedSlides+b.params.slidesPerView/2?(b.fixLoop(),n=b.wrapper.children("."+b.params.slideClass+'[data-swiper-slide-index="'+i+'"]:not(.'+b.params.slideDuplicateClass+")").eq(0).index(),setTimeout(function(){b.slideTo(n)},0)):b.slideTo(n):n>b.slides.length-b.params.slidesPerView?(b.fixLoop(),n=b.wrapper.children("."+b.params.slideClass+'[data-swiper-slide-index="'+i+'"]:not(.'+b.params.slideDuplicateClass+")").eq(0).index(),setTimeout(function(){b.slideTo(n)},0)):b.slideTo(n)}else b.slideTo(n)}};var S,z,M,P,E,I,k,D,L,B,H="input, select, textarea, button, video",G=Date.now(),X=[];b.animating=!1,b.touches={startX:0,startY:0,currentX:0,currentY:0,diff:0};var Y,A;b.onTouchStart=function(e){if(e.originalEvent&&(e=e.originalEvent),Y="touchstart"===e.type,Y||!("which"in e)||3!==e.which){if(b.params.noSwiping&&o(e,"."+b.params.noSwipingClass))return void(b.allowClick=!0);if(!b.params.swipeHandler||o(e,b.params.swipeHandler)){var t=b.touches.currentX="touchstart"===e.type?e.targetTouches[0].pageX:e.pageX,s=b.touches.currentY="touchstart"===e.type?e.targetTouches[0].pageY:e.pageY;if(!(b.device.ios&&b.params.iOSEdgeSwipeDetection&&t<=b.params.iOSEdgeSwipeThreshold)){if(S=!0,z=!1,M=!0,E=void 0,A=void 0,b.touches.startX=t,b.touches.startY=s,P=Date.now(),b.allowClick=!0,b.updateContainerSize(),b.swipeDirection=void 0,b.params.threshold>0&&(D=!1),"touchstart"!==e.type){var r=!0;a(e.target).is(H)&&(r=!1),document.activeElement&&a(document.activeElement).is(H)&&document.activeElement.blur(),r&&e.preventDefault()}b.emit("onTouchStart",b,e)}}}},b.onTouchMove=function(e){if(e.originalEvent&&(e=e.originalEvent),!Y||"mousemove"!==e.type){if(e.preventedByNestedSwiper)return b.touches.startX="touchmove"===e.type?e.targetTouches[0].pageX:e.pageX,void(b.touches.startY="touchmove"===e.type?e.targetTouches[0].pageY:e.pageY);if(b.params.onlyExternal)return b.allowClick=!1,void(S&&(b.touches.startX=b.touches.currentX="touchmove"===e.type?e.targetTouches[0].pageX:e.pageX,b.touches.startY=b.touches.currentY="touchmove"===e.type?e.targetTouches[0].pageY:e.pageY,P=Date.now()));if(Y&&b.params.touchReleaseOnEdges&&!b.params.loop)if(b.isHorizontal()){if(b.touches.currentX<b.touches.startX&&b.translate<=b.maxTranslate()||b.touches.currentX>b.touches.startX&&b.translate>=b.minTranslate())return}else if(b.touches.currentY<b.touches.startY&&b.translate<=b.maxTranslate()||b.touches.currentY>b.touches.startY&&b.translate>=b.minTranslate())return;if(Y&&document.activeElement&&e.target===document.activeElement&&a(e.target).is(H))return z=!0,void(b.allowClick=!1);if(M&&b.emit("onTouchMove",b,e),!(e.targetTouches&&e.targetTouches.length>1)){if(b.touches.currentX="touchmove"===e.type?e.targetTouches[0].pageX:e.pageX,b.touches.currentY="touchmove"===e.type?e.targetTouches[0].pageY:e.pageY,"undefined"==typeof E){var t;b.isHorizontal()&&b.touches.currentY===b.touches.startY||!b.isHorizontal()&&b.touches.currentX!==b.touches.startX?E=!1:(t=180*Math.atan2(Math.abs(b.touches.currentY-b.touches.startY),Math.abs(b.touches.currentX-b.touches.startX))/Math.PI,E=b.isHorizontal()?t>b.params.touchAngle:90-t>b.params.touchAngle)}if(E&&b.emit("onTouchMoveOpposite",b,e),"undefined"==typeof A&&b.browser.ieTouch&&(b.touches.currentX===b.touches.startX&&b.touches.currentY===b.touches.startY||(A=!0)),S){if(E)return void(S=!1);if(A||!b.browser.ieTouch){b.allowClick=!1,b.emit("onSliderMove",b,e),e.preventDefault(),b.params.touchMoveStopPropagation&&!b.params.nested&&e.stopPropagation(),z||(s.loop&&b.fixLoop(),k=b.getWrapperTranslate(),b.setWrapperTransition(0),b.animating&&b.wrapper.trigger("webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd msTransitionEnd"),b.params.autoplay&&b.autoplaying&&(b.params.autoplayDisableOnInteraction?b.stopAutoplay():b.pauseAutoplay()),B=!1,!b.params.grabCursor||b.params.allowSwipeToNext!==!0&&b.params.allowSwipeToPrev!==!0||b.setGrabCursor(!0)),z=!0;var r=b.touches.diff=b.isHorizontal()?b.touches.currentX-b.touches.startX:b.touches.currentY-b.touches.startY;r*=b.params.touchRatio,b.rtl&&(r=-r),b.swipeDirection=r>0?"prev":"next",I=r+k;var i=!0;if(r>0&&I>b.minTranslate()?(i=!1,b.params.resistance&&(I=b.minTranslate()-1+Math.pow(-b.minTranslate()+k+r,b.params.resistanceRatio))):r<0&&I<b.maxTranslate()&&(i=!1,b.params.resistance&&(I=b.maxTranslate()+1-Math.pow(b.maxTranslate()-k-r,b.params.resistanceRatio))),i&&(e.preventedByNestedSwiper=!0),!b.params.allowSwipeToNext&&"next"===b.swipeDirection&&I<k&&(I=k),!b.params.allowSwipeToPrev&&"prev"===b.swipeDirection&&I>k&&(I=k),b.params.threshold>0){if(!(Math.abs(r)>b.params.threshold||D))return void(I=k);if(!D)return D=!0,b.touches.startX=b.touches.currentX,b.touches.startY=b.touches.currentY,I=k,void(b.touches.diff=b.isHorizontal()?b.touches.currentX-b.touches.startX:b.touches.currentY-b.touches.startY)}b.params.followFinger&&((b.params.freeMode||b.params.watchSlidesProgress)&&b.updateActiveIndex(),b.params.freeMode&&(0===X.length&&X.push({position:b.touches[b.isHorizontal()?"startX":"startY"],time:P}),X.push({position:b.touches[b.isHorizontal()?"currentX":"currentY"],time:(new window.Date).getTime()})),b.updateProgress(I),b.setWrapperTranslate(I))}}}}},b.onTouchEnd=function(e){if(e.originalEvent&&(e=e.originalEvent),M&&b.emit("onTouchEnd",b,e),M=!1,S){b.params.grabCursor&&z&&S&&(b.params.allowSwipeToNext===!0||b.params.allowSwipeToPrev===!0)&&b.setGrabCursor(!1);var t=Date.now(),s=t-P;if(b.allowClick&&(b.updateClickedSlide(e),b.emit("onTap",b,e),s<300&&t-G>300&&(L&&clearTimeout(L),L=setTimeout(function(){b&&(b.params.paginationHide&&b.paginationContainer.length>0&&!a(e.target).hasClass(b.params.bulletClass)&&b.paginationContainer.toggleClass(b.params.paginationHiddenClass),b.emit("onClick",b,e))},300)),s<300&&t-G<300&&(L&&clearTimeout(L),b.emit("onDoubleTap",b,e))),G=Date.now(),setTimeout(function(){b&&(b.allowClick=!0)},0),!S||!z||!b.swipeDirection||0===b.touches.diff||I===k)return void(S=z=!1);S=z=!1;var r;if(r=b.params.followFinger?b.rtl?b.translate:-b.translate:-I,b.params.freeMode){if(r<-b.minTranslate())return void b.slideTo(b.activeIndex);if(r>-b.maxTranslate())return void(b.slides.length<b.snapGrid.length?b.slideTo(b.snapGrid.length-1):b.slideTo(b.slides.length-1));if(b.params.freeModeMomentum){if(X.length>1){var i=X.pop(),n=X.pop(),o=i.position-n.position,l=i.time-n.time;b.velocity=o/l,b.velocity=b.velocity/2,Math.abs(b.velocity)<b.params.freeModeMinimumVelocity&&(b.velocity=0),(l>150||(new window.Date).getTime()-i.time>300)&&(b.velocity=0)}else b.velocity=0;b.velocity=b.velocity*b.params.freeModeMomentumVelocityRatio,X.length=0;var p=1e3*b.params.freeModeMomentumRatio,d=b.velocity*p,u=b.translate+d;b.rtl&&(u=-u);var m,c=!1,g=20*Math.abs(b.velocity)*b.params.freeModeMomentumBounceRatio;if(u<b.maxTranslate())b.params.freeModeMomentumBounce?(u+b.maxTranslate()<-g&&(u=b.maxTranslate()-g),m=b.maxTranslate(),c=!0,B=!0):u=b.maxTranslate();else if(u>b.minTranslate())b.params.freeModeMomentumBounce?(u-b.minTranslate()>g&&(u=b.minTranslate()+g),m=b.minTranslate(),c=!0,B=!0):u=b.minTranslate();else if(b.params.freeModeSticky){var h,f=0;for(f=0;f<b.snapGrid.length;f+=1)if(b.snapGrid[f]>-u){h=f;break}u=Math.abs(b.snapGrid[h]-u)<Math.abs(b.snapGrid[h-1]-u)||"next"===b.swipeDirection?b.snapGrid[h]:b.snapGrid[h-1],b.rtl||(u=-u)}if(0!==b.velocity)p=b.rtl?Math.abs((-u-b.translate)/b.velocity):Math.abs((u-b.translate)/b.velocity);else if(b.params.freeModeSticky)return void b.slideReset();b.params.freeModeMomentumBounce&&c?(b.updateProgress(m),b.setWrapperTransition(p),b.setWrapperTranslate(u),b.onTransitionStart(),b.animating=!0,b.wrapper.transitionEnd(function(){b&&B&&(b.emit("onMomentumBounce",b),b.setWrapperTransition(b.params.speed),b.setWrapperTranslate(m),b.wrapper.transitionEnd(function(){b&&b.onTransitionEnd()}))})):b.velocity?(b.updateProgress(u),b.setWrapperTransition(p),b.setWrapperTranslate(u),b.onTransitionStart(),b.animating||(b.animating=!0,b.wrapper.transitionEnd(function(){b&&b.onTransitionEnd()}))):b.updateProgress(u),b.updateActiveIndex()}return void((!b.params.freeModeMomentum||s>=b.params.longSwipesMs)&&(b.updateProgress(),b.updateActiveIndex()))}var v,w=0,y=b.slidesSizesGrid[0];for(v=0;v<b.slidesGrid.length;v+=b.params.slidesPerGroup)"undefined"!=typeof b.slidesGrid[v+b.params.slidesPerGroup]?r>=b.slidesGrid[v]&&r<b.slidesGrid[v+b.params.slidesPerGroup]&&(w=v,y=b.slidesGrid[v+b.params.slidesPerGroup]-b.slidesGrid[v]):r>=b.slidesGrid[v]&&(w=v,y=b.slidesGrid[b.slidesGrid.length-1]-b.slidesGrid[b.slidesGrid.length-2]);var x=(r-b.slidesGrid[w])/y;if(s>b.params.longSwipesMs){if(!b.params.longSwipes)return void b.slideTo(b.activeIndex);"next"===b.swipeDirection&&(x>=b.params.longSwipesRatio?b.slideTo(w+b.params.slidesPerGroup):b.slideTo(w)),"prev"===b.swipeDirection&&(x>1-b.params.longSwipesRatio?b.slideTo(w+b.params.slidesPerGroup):b.slideTo(w))}else{if(!b.params.shortSwipes)return void b.slideTo(b.activeIndex);"next"===b.swipeDirection&&b.slideTo(w+b.params.slidesPerGroup),"prev"===b.swipeDirection&&b.slideTo(w)}}},b._slideTo=function(e,a){return b.slideTo(e,a,!0,!0)},b.slideTo=function(e,a,t,s){"undefined"==typeof t&&(t=!0),"undefined"==typeof e&&(e=0),e<0&&(e=0),b.snapIndex=Math.floor(e/b.params.slidesPerGroup),b.snapIndex>=b.snapGrid.length&&(b.snapIndex=b.snapGrid.length-1);var r=-b.snapGrid[b.snapIndex];if(b.params.autoplay&&b.autoplaying&&(s||!b.params.autoplayDisableOnInteraction?b.pauseAutoplay(a):b.stopAutoplay()),b.updateProgress(r),b.params.normalizeSlideIndex)for(var i=0;i<b.slidesGrid.length;i++)-Math.floor(100*r)>=Math.floor(100*b.slidesGrid[i])&&(e=i);return!(!b.params.allowSwipeToNext&&r<b.translate&&r<b.minTranslate())&&(!(!b.params.allowSwipeToPrev&&r>b.translate&&r>b.maxTranslate()&&(b.activeIndex||0)!==e)&&("undefined"==typeof a&&(a=b.params.speed),b.previousIndex=b.activeIndex||0,b.activeIndex=e,b.updateRealIndex(),b.rtl&&-r===b.translate||!b.rtl&&r===b.translate?(b.params.autoHeight&&b.updateAutoHeight(),b.updateClasses(),"slide"!==b.params.effect&&b.setWrapperTranslate(r),!1):(b.updateClasses(),b.onTransitionStart(t),0===a||b.browser.lteIE9?(b.setWrapperTranslate(r),b.setWrapperTransition(0),b.onTransitionEnd(t)):(b.setWrapperTranslate(r),b.setWrapperTransition(a),b.animating||(b.animating=!0,b.wrapper.transitionEnd(function(){b&&b.onTransitionEnd(t)}))),!0)))},b.onTransitionStart=function(e){"undefined"==typeof e&&(e=!0),b.params.autoHeight&&b.updateAutoHeight(),b.lazy&&b.lazy.onTransitionStart(),e&&(b.emit("onTransitionStart",b),b.activeIndex!==b.previousIndex&&(b.emit("onSlideChangeStart",b),b.activeIndex>b.previousIndex?b.emit("onSlideNextStart",b):b.emit("onSlidePrevStart",b)))},b.onTransitionEnd=function(e){b.animating=!1,b.setWrapperTransition(0),"undefined"==typeof e&&(e=!0),b.lazy&&b.lazy.onTransitionEnd(),e&&(b.emit("onTransitionEnd",b),b.activeIndex!==b.previousIndex&&(b.emit("onSlideChangeEnd",b),b.activeIndex>b.previousIndex?b.emit("onSlideNextEnd",b):b.emit("onSlidePrevEnd",b))),b.params.history&&b.history&&b.history.setHistory(b.params.history,b.activeIndex),b.params.hashnav&&b.hashnav&&b.hashnav.setHash()},b.slideNext=function(e,a,t){if(b.params.loop){if(b.animating)return!1;b.fixLoop();b.container[0].clientLeft;return b.slideTo(b.activeIndex+b.params.slidesPerGroup,a,e,t)}return b.slideTo(b.activeIndex+b.params.slidesPerGroup,a,e,t)},b._slideNext=function(e){return b.slideNext(!0,e,!0)},b.slidePrev=function(e,a,t){if(b.params.loop){if(b.animating)return!1;b.fixLoop();b.container[0].clientLeft;return b.slideTo(b.activeIndex-1,a,e,t)}return b.slideTo(b.activeIndex-1,a,e,t)},b._slidePrev=function(e){return b.slidePrev(!0,e,!0)},b.slideReset=function(e,a,t){return b.slideTo(b.activeIndex,a,e)},b.disableTouchControl=function(){return b.params.onlyExternal=!0,!0},b.enableTouchControl=function(){return b.params.onlyExternal=!1,!0},b.setWrapperTransition=function(e,a){b.wrapper.transition(e),"slide"!==b.params.effect&&b.effects[b.params.effect]&&b.effects[b.params.effect].setTransition(e),b.params.parallax&&b.parallax&&b.parallax.setTransition(e),b.params.scrollbar&&b.scrollbar&&b.scrollbar.setTransition(e),b.params.control&&b.controller&&b.controller.setTransition(e,a),b.emit("onSetTransition",b,e)},b.setWrapperTranslate=function(e,a,t){var s=0,r=0,n=0;b.isHorizontal()?s=b.rtl?-e:e:r=e,b.params.roundLengths&&(s=i(s),r=i(r)),b.params.virtualTranslate||(b.support.transforms3d?b.wrapper.transform("translate3d("+s+"px, "+r+"px, "+n+"px)"):b.wrapper.transform("translate("+s+"px, "+r+"px)")),b.translate=b.isHorizontal()?s:r;var o,l=b.maxTranslate()-b.minTranslate();o=0===l?0:(e-b.minTranslate())/l,o!==b.progress&&b.updateProgress(e),a&&b.updateActiveIndex(),"slide"!==b.params.effect&&b.effects[b.params.effect]&&b.effects[b.params.effect].setTranslate(b.translate),b.params.parallax&&b.parallax&&b.parallax.setTranslate(b.translate),b.params.scrollbar&&b.scrollbar&&b.scrollbar.setTranslate(b.translate),b.params.control&&b.controller&&b.controller.setTranslate(b.translate,t),b.emit("onSetTranslate",b,b.translate)},b.getTranslate=function(e,a){var t,s,r,i;return"undefined"==typeof a&&(a="x"),b.params.virtualTranslate?b.rtl?-b.translate:b.translate:(r=window.getComputedStyle(e,null),window.WebKitCSSMatrix?(s=r.transform||r.webkitTransform,s.split(",").length>6&&(s=s.split(", ").map(function(e){return e.replace(",",".")}).join(", ")),i=new window.WebKitCSSMatrix("none"===s?"":s)):(i=r.MozTransform||r.OTransform||r.MsTransform||r.msTransform||r.transform||r.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),t=i.toString().split(",")),"x"===a&&(s=window.WebKitCSSMatrix?i.m41:16===t.length?parseFloat(t[12]):parseFloat(t[4])),"y"===a&&(s=window.WebKitCSSMatrix?i.m42:16===t.length?parseFloat(t[13]):parseFloat(t[5])),b.rtl&&s&&(s=-s),s||0)},b.getWrapperTranslate=function(e){return"undefined"==typeof e&&(e=b.isHorizontal()?"x":"y"),b.getTranslate(b.wrapper[0],e)},b.observers=[],b.initObservers=function(){if(b.params.observeParents)for(var e=b.container.parents(),a=0;a<e.length;a++)l(e[a]);l(b.container[0],{childList:!1}),l(b.wrapper[0],{attributes:!1})},b.disconnectObservers=function(){for(var e=0;e<b.observers.length;e++)b.observers[e].disconnect();b.observers=[]},b.createLoop=function(){b.wrapper.children("."+b.params.slideClass+"."+b.params.slideDuplicateClass).remove();var e=b.wrapper.children("."+b.params.slideClass);"auto"!==b.params.slidesPerView||b.params.loopedSlides||(b.params.loopedSlides=e.length),b.loopedSlides=parseInt(b.params.loopedSlides||b.params.slidesPerView,10),b.loopedSlides=b.loopedSlides+b.params.loopAdditionalSlides,b.loopedSlides>e.length&&(b.loopedSlides=e.length);var t,s=[],r=[];for(e.each(function(t,i){var n=a(this);t<b.loopedSlides&&r.push(i),t<e.length&&t>=e.length-b.loopedSlides&&s.push(i),n.attr("data-swiper-slide-index",t)}),t=0;t<r.length;t++)b.wrapper.append(a(r[t].cloneNode(!0)).addClass(b.params.slideDuplicateClass));for(t=s.length-1;t>=0;t--)b.wrapper.prepend(a(s[t].cloneNode(!0)).addClass(b.params.slideDuplicateClass))},b.destroyLoop=function(){b.wrapper.children("."+b.params.slideClass+"."+b.params.slideDuplicateClass).remove(),b.slides.removeAttr("data-swiper-slide-index")},b.reLoop=function(e){var a=b.activeIndex-b.loopedSlides;b.destroyLoop(),b.createLoop(),b.updateSlidesSize(),e&&b.slideTo(a+b.loopedSlides,0,!1)},b.fixLoop=function(){var e;b.activeIndex<b.loopedSlides?(e=b.slides.length-3*b.loopedSlides+b.activeIndex,e+=b.loopedSlides,b.slideTo(e,0,!1,!0)):("auto"===b.params.slidesPerView&&b.activeIndex>=2*b.loopedSlides||b.activeIndex>b.slides.length-2*b.params.slidesPerView)&&(e=-b.slides.length+b.activeIndex+b.loopedSlides,e+=b.loopedSlides,b.slideTo(e,0,!1,!0))},b.appendSlide=function(e){if(b.params.loop&&b.destroyLoop(),"object"==typeof e&&e.length)for(var a=0;a<e.length;a++)e[a]&&b.wrapper.append(e[a]);else b.wrapper.append(e);b.params.loop&&b.createLoop(),b.params.observer&&b.support.observer||b.update(!0)},b.prependSlide=function(e){b.params.loop&&b.destroyLoop();var a=b.activeIndex+1;if("object"==typeof e&&e.length){for(var t=0;t<e.length;t++)e[t]&&b.wrapper.prepend(e[t]);a=b.activeIndex+e.length}else b.wrapper.prepend(e);b.params.loop&&b.createLoop(),b.params.observer&&b.support.observer||b.update(!0),b.slideTo(a,0,!1)},b.removeSlide=function(e){b.params.loop&&(b.destroyLoop(),b.slides=b.wrapper.children("."+b.params.slideClass));var a,t=b.activeIndex;if("object"==typeof e&&e.length){for(var s=0;s<e.length;s++)a=e[s],b.slides[a]&&b.slides.eq(a).remove(),a<t&&t--;t=Math.max(t,0)}else a=e,b.slides[a]&&b.slides.eq(a).remove(),a<t&&t--,t=Math.max(t,0);b.params.loop&&b.createLoop(),b.params.observer&&b.support.observer||b.update(!0),b.params.loop?b.slideTo(t+b.loopedSlides,0,!1):b.slideTo(t,0,!1)},b.removeAllSlides=function(){for(var e=[],a=0;a<b.slides.length;a++)e.push(a);b.removeSlide(e)},b.effects={fade:{setTranslate:function(){for(var e=0;e<b.slides.length;e++){var a=b.slides.eq(e),t=a[0].swiperSlideOffset,s=-t;b.params.virtualTranslate||(s-=b.translate);var r=0;b.isHorizontal()||(r=s,s=0);var i=b.params.fade.crossFade?Math.max(1-Math.abs(a[0].progress),0):1+Math.min(Math.max(a[0].progress,-1),0);a.css({opacity:i}).transform("translate3d("+s+"px, "+r+"px, 0px)")}},setTransition:function(e){if(b.slides.transition(e),b.params.virtualTranslate&&0!==e){var a=!1;b.slides.transitionEnd(function(){if(!a&&b){a=!0,b.animating=!1;for(var e=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],t=0;t<e.length;t++)b.wrapper.trigger(e[t])}})}}},flip:{setTranslate:function(){for(var e=0;e<b.slides.length;e++){var t=b.slides.eq(e),s=t[0].progress;b.params.flip.limitRotation&&(s=Math.max(Math.min(t[0].progress,1),-1));var r=t[0].swiperSlideOffset,i=-180*s,n=i,o=0,l=-r,p=0;if(b.isHorizontal()?b.rtl&&(n=-n):(p=l,l=0,o=-n,n=0),t[0].style.zIndex=-Math.abs(Math.round(s))+b.slides.length,b.params.flip.slideShadows){var d=b.isHorizontal()?t.find(".swiper-slide-shadow-left"):t.find(".swiper-slide-shadow-top"),u=b.isHorizontal()?t.find(".swiper-slide-shadow-right"):t.find(".swiper-slide-shadow-bottom");0===d.length&&(d=a('<div class="swiper-slide-shadow-'+(b.isHorizontal()?"left":"top")+'"></div>'),t.append(d)),0===u.length&&(u=a('<div class="swiper-slide-shadow-'+(b.isHorizontal()?"right":"bottom")+'"></div>'),t.append(u)),d.length&&(d[0].style.opacity=Math.max(-s,0)),u.length&&(u[0].style.opacity=Math.max(s,0))}t.transform("translate3d("+l+"px, "+p+"px, 0px) rotateX("+o+"deg) rotateY("+n+"deg)")}},setTransition:function(e){if(b.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),b.params.virtualTranslate&&0!==e){var t=!1;b.slides.eq(b.activeIndex).transitionEnd(function(){if(!t&&b&&a(this).hasClass(b.params.slideActiveClass)){t=!0,b.animating=!1;for(var e=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],s=0;s<e.length;s++)b.wrapper.trigger(e[s])}})}}},cube:{setTranslate:function(){var e,t=0;b.params.cube.shadow&&(b.isHorizontal()?(e=b.wrapper.find(".swiper-cube-shadow"),0===e.length&&(e=a('<div class="swiper-cube-shadow"></div>'),b.wrapper.append(e)),e.css({height:b.width+"px"})):(e=b.container.find(".swiper-cube-shadow"),0===e.length&&(e=a('<div class="swiper-cube-shadow"></div>'),b.container.append(e))));for(var s=0;s<b.slides.length;s++){var r=b.slides.eq(s),i=90*s,n=Math.floor(i/360);b.rtl&&(i=-i,n=Math.floor(-i/360));var o=Math.max(Math.min(r[0].progress,1),-1),l=0,p=0,d=0;s%4===0?(l=4*-n*b.size,d=0):(s-1)%4===0?(l=0,d=4*-n*b.size):(s-2)%4===0?(l=b.size+4*n*b.size,d=b.size):(s-3)%4===0&&(l=-b.size,d=3*b.size+4*b.size*n),b.rtl&&(l=-l),b.isHorizontal()||(p=l,l=0);var u="rotateX("+(b.isHorizontal()?0:-i)+"deg) rotateY("+(b.isHorizontal()?i:0)+"deg) translate3d("+l+"px, "+p+"px, "+d+"px)";if(o<=1&&o>-1&&(t=90*s+90*o,b.rtl&&(t=90*-s-90*o)),r.transform(u),b.params.cube.slideShadows){var m=b.isHorizontal()?r.find(".swiper-slide-shadow-left"):r.find(".swiper-slide-shadow-top"),c=b.isHorizontal()?r.find(".swiper-slide-shadow-right"):r.find(".swiper-slide-shadow-bottom");0===m.length&&(m=a('<div class="swiper-slide-shadow-'+(b.isHorizontal()?"left":"top")+'"></div>'),r.append(m)),0===c.length&&(c=a('<div class="swiper-slide-shadow-'+(b.isHorizontal()?"right":"bottom")+'"></div>'),r.append(c)),m.length&&(m[0].style.opacity=Math.max(-o,0)),c.length&&(c[0].style.opacity=Math.max(o,0))}}if(b.wrapper.css({"-webkit-transform-origin":"50% 50% -"+b.size/2+"px","-moz-transform-origin":"50% 50% -"+b.size/2+"px","-ms-transform-origin":"50% 50% -"+b.size/2+"px","transform-origin":"50% 50% -"+b.size/2+"px"}),b.params.cube.shadow)if(b.isHorizontal())e.transform("translate3d(0px, "+(b.width/2+b.params.cube.shadowOffset)+"px, "+-b.width/2+"px) rotateX(90deg) rotateZ(0deg) scale("+b.params.cube.shadowScale+")");else{var g=Math.abs(t)-90*Math.floor(Math.abs(t)/90),h=1.5-(Math.sin(2*g*Math.PI/360)/2+Math.cos(2*g*Math.PI/360)/2),f=b.params.cube.shadowScale,v=b.params.cube.shadowScale/h,w=b.params.cube.shadowOffset;e.transform("scale3d("+f+", 1, "+v+") translate3d(0px, "+(b.height/2+w)+"px, "+-b.height/2/v+"px) rotateX(-90deg)")}var y=b.isSafari||b.isUiWebView?-b.size/2:0;b.wrapper.transform("translate3d(0px,0,"+y+"px) rotateX("+(b.isHorizontal()?0:t)+"deg) rotateY("+(b.isHorizontal()?-t:0)+"deg)")},setTransition:function(e){b.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),b.params.cube.shadow&&!b.isHorizontal()&&b.container.find(".swiper-cube-shadow").transition(e)}},coverflow:{setTranslate:function(){for(var e=b.translate,t=b.isHorizontal()?-e+b.width/2:-e+b.height/2,s=b.isHorizontal()?b.params.coverflow.rotate:-b.params.coverflow.rotate,r=b.params.coverflow.depth,i=0,n=b.slides.length;i<n;i++){var o=b.slides.eq(i),l=b.slidesSizesGrid[i],p=o[0].swiperSlideOffset,d=(t-p-l/2)/l*b.params.coverflow.modifier,u=b.isHorizontal()?s*d:0,m=b.isHorizontal()?0:s*d,c=-r*Math.abs(d),g=b.isHorizontal()?0:b.params.coverflow.stretch*d,h=b.isHorizontal()?b.params.coverflow.stretch*d:0;Math.abs(h)<.001&&(h=0),Math.abs(g)<.001&&(g=0),Math.abs(c)<.001&&(c=0),Math.abs(u)<.001&&(u=0),Math.abs(m)<.001&&(m=0);var f="translate3d("+h+"px,"+g+"px,"+c+"px) rotateX("+m+"deg) rotateY("+u+"deg)";if(o.transform(f),o[0].style.zIndex=-Math.abs(Math.round(d))+1,b.params.coverflow.slideShadows){var v=b.isHorizontal()?o.find(".swiper-slide-shadow-left"):o.find(".swiper-slide-shadow-top"),w=b.isHorizontal()?o.find(".swiper-slide-shadow-right"):o.find(".swiper-slide-shadow-bottom");0===v.length&&(v=a('<div class="swiper-slide-shadow-'+(b.isHorizontal()?"left":"top")+'"></div>'),o.append(v)),0===w.length&&(w=a('<div class="swiper-slide-shadow-'+(b.isHorizontal()?"right":"bottom")+'"></div>'),o.append(w)),v.length&&(v[0].style.opacity=d>0?d:0),w.length&&(w[0].style.opacity=-d>0?-d:0)}}if(b.browser.ie){var y=b.wrapper[0].style;y.perspectiveOrigin=t+"px 50%"}},setTransition:function(e){b.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e)}}},b.lazy={initialImageLoaded:!1,loadImageInSlide:function(e,t){if("undefined"!=typeof e&&("undefined"==typeof t&&(t=!0),0!==b.slides.length)){var s=b.slides.eq(e),r=s.find("."+b.params.lazyLoadingClass+":not(."+b.params.lazyStatusLoadedClass+"):not(."+b.params.lazyStatusLoadingClass+")");!s.hasClass(b.params.lazyLoadingClass)||s.hasClass(b.params.lazyStatusLoadedClass)||s.hasClass(b.params.lazyStatusLoadingClass)||(r=r.add(s[0])),0!==r.length&&r.each(function(){var e=a(this);e.addClass(b.params.lazyStatusLoadingClass);var r=e.attr("data-background"),i=e.attr("data-src"),n=e.attr("data-srcset"),o=e.attr("data-sizes");b.loadImage(e[0],i||r,n,o,!1,function(){if(r?(e.css("background-image",'url("'+r+'")'),e.removeAttr("data-background")):(n&&(e.attr("srcset",n),e.removeAttr("data-srcset")),o&&(e.attr("sizes",o),e.removeAttr("data-sizes")),i&&(e.attr("src",i),e.removeAttr("data-src"))),e.addClass(b.params.lazyStatusLoadedClass).removeClass(b.params.lazyStatusLoadingClass),s.find("."+b.params.lazyPreloaderClass+", ."+b.params.preloaderClass).remove(),b.params.loop&&t){var a=s.attr("data-swiper-slide-index");if(s.hasClass(b.params.slideDuplicateClass)){var l=b.wrapper.children('[data-swiper-slide-index="'+a+'"]:not(.'+b.params.slideDuplicateClass+")");b.lazy.loadImageInSlide(l.index(),!1)}else{var p=b.wrapper.children("."+b.params.slideDuplicateClass+'[data-swiper-slide-index="'+a+'"]');b.lazy.loadImageInSlide(p.index(),!1)}}b.emit("onLazyImageReady",b,s[0],e[0])}),b.emit("onLazyImageLoad",b,s[0],e[0])})}},load:function(){var e,t=b.params.slidesPerView;if("auto"===t&&(t=0),b.lazy.initialImageLoaded||(b.lazy.initialImageLoaded=!0),b.params.watchSlidesVisibility)b.wrapper.children("."+b.params.slideVisibleClass).each(function(){b.lazy.loadImageInSlide(a(this).index())});else if(t>1)for(e=b.activeIndex;e<b.activeIndex+t;e++)b.slides[e]&&b.lazy.loadImageInSlide(e);else b.lazy.loadImageInSlide(b.activeIndex);if(b.params.lazyLoadingInPrevNext)if(t>1||b.params.lazyLoadingInPrevNextAmount&&b.params.lazyLoadingInPrevNextAmount>1){var s=b.params.lazyLoadingInPrevNextAmount,r=t,i=Math.min(b.activeIndex+r+Math.max(s,r),b.slides.length),n=Math.max(b.activeIndex-Math.max(r,s),0);for(e=b.activeIndex+t;e<i;e++)b.slides[e]&&b.lazy.loadImageInSlide(e);for(e=n;e<b.activeIndex;e++)b.slides[e]&&b.lazy.loadImageInSlide(e)}else{var o=b.wrapper.children("."+b.params.slideNextClass);o.length>0&&b.lazy.loadImageInSlide(o.index());var l=b.wrapper.children("."+b.params.slidePrevClass);l.length>0&&b.lazy.loadImageInSlide(l.index())}},onTransitionStart:function(){b.params.lazyLoading&&(b.params.lazyLoadingOnTransitionStart||!b.params.lazyLoadingOnTransitionStart&&!b.lazy.initialImageLoaded)&&b.lazy.load()},onTransitionEnd:function(){b.params.lazyLoading&&!b.params.lazyLoadingOnTransitionStart&&b.lazy.load()}},b.scrollbar={isTouched:!1,setDragPosition:function(e){var a=b.scrollbar,t=b.isHorizontal()?"touchstart"===e.type||"touchmove"===e.type?e.targetTouches[0].pageX:e.pageX||e.clientX:"touchstart"===e.type||"touchmove"===e.type?e.targetTouches[0].pageY:e.pageY||e.clientY,s=t-a.track.offset()[b.isHorizontal()?"left":"top"]-a.dragSize/2,r=-b.minTranslate()*a.moveDivider,i=-b.maxTranslate()*a.moveDivider;s<r?s=r:s>i&&(s=i),s=-s/a.moveDivider,b.updateProgress(s),b.setWrapperTranslate(s,!0)},dragStart:function(e){var a=b.scrollbar;a.isTouched=!0,e.preventDefault(),e.stopPropagation(),a.setDragPosition(e),clearTimeout(a.dragTimeout),a.track.transition(0),b.params.scrollbarHide&&a.track.css("opacity",1),b.wrapper.transition(100),a.drag.transition(100),b.emit("onScrollbarDragStart",b)},dragMove:function(e){var a=b.scrollbar;a.isTouched&&(e.preventDefault?e.preventDefault():e.returnValue=!1,a.setDragPosition(e),b.wrapper.transition(0),a.track.transition(0),a.drag.transition(0),b.emit("onScrollbarDragMove",b))},dragEnd:function(e){var a=b.scrollbar;a.isTouched&&(a.isTouched=!1,b.params.scrollbarHide&&(clearTimeout(a.dragTimeout),a.dragTimeout=setTimeout(function(){a.track.css("opacity",0),a.track.transition(400)},1e3)),b.emit("onScrollbarDragEnd",b),b.params.scrollbarSnapOnRelease&&b.slideReset())},draggableEvents:function(){return b.params.simulateTouch!==!1||b.support.touch?b.touchEvents:b.touchEventsDesktop}(),enableDraggable:function(){var e=b.scrollbar,t=b.support.touch?e.track:document;a(e.track).on(e.draggableEvents.start,e.dragStart),a(t).on(e.draggableEvents.move,e.dragMove),a(t).on(e.draggableEvents.end,e.dragEnd)},disableDraggable:function(){var e=b.scrollbar,t=b.support.touch?e.track:document;a(e.track).off(b.draggableEvents.start,e.dragStart),a(t).off(b.draggableEvents.move,e.dragMove),a(t).off(b.draggableEvents.end,e.dragEnd)},set:function(){if(b.params.scrollbar){var e=b.scrollbar;e.track=a(b.params.scrollbar),b.params.uniqueNavElements&&"string"==typeof b.params.scrollbar&&e.track.length>1&&1===b.container.find(b.params.scrollbar).length&&(e.track=b.container.find(b.params.scrollbar)),e.drag=e.track.find(".swiper-scrollbar-drag"),0===e.drag.length&&(e.drag=a('<div class="swiper-scrollbar-drag"></div>'),e.track.append(e.drag)),e.drag[0].style.width="",e.drag[0].style.height="",e.trackSize=b.isHorizontal()?e.track[0].offsetWidth:e.track[0].offsetHeight,e.divider=b.size/b.virtualSize,e.moveDivider=e.divider*(e.trackSize/b.size),e.dragSize=e.trackSize*e.divider,b.isHorizontal()?e.drag[0].style.width=e.dragSize+"px":e.drag[0].style.height=e.dragSize+"px",e.divider>=1?e.track[0].style.display="none":e.track[0].style.display="",b.params.scrollbarHide&&(e.track[0].style.opacity=0)}},setTranslate:function(){if(b.params.scrollbar){var e,a=b.scrollbar,t=(b.translate||0,a.dragSize);e=(a.trackSize-a.dragSize)*b.progress,b.rtl&&b.isHorizontal()?(e=-e,e>0?(t=a.dragSize-e,e=0):-e+a.dragSize>a.trackSize&&(t=a.trackSize+e)):e<0?(t=a.dragSize+e,e=0):e+a.dragSize>a.trackSize&&(t=a.trackSize-e),b.isHorizontal()?(b.support.transforms3d?a.drag.transform("translate3d("+e+"px, 0, 0)"):a.drag.transform("translateX("+e+"px)"),a.drag[0].style.width=t+"px"):(b.support.transforms3d?a.drag.transform("translate3d(0px, "+e+"px, 0)"):a.drag.transform("translateY("+e+"px)"),a.drag[0].style.height=t+"px"),b.params.scrollbarHide&&(clearTimeout(a.timeout),a.track[0].style.opacity=1,a.timeout=setTimeout(function(){a.track[0].style.opacity=0,a.track.transition(400)},1e3))}},setTransition:function(e){b.params.scrollbar&&b.scrollbar.drag.transition(e)}},b.controller={LinearSpline:function(e,a){this.x=e,this.y=a,this.lastIndex=e.length-1;var t,s;this.x.length;this.interpolate=function(e){return e?(s=r(this.x,e),t=s-1,(e-this.x[t])*(this.y[s]-this.y[t])/(this.x[s]-this.x[t])+this.y[t]):0};var r=function(){var e,a,t;return function(s,r){for(a=-1,e=s.length;e-a>1;)s[t=e+a>>1]<=r?a=t:e=t;return e}}()},getInterpolateFunction:function(e){b.controller.spline||(b.controller.spline=b.params.loop?new b.controller.LinearSpline(b.slidesGrid,e.slidesGrid):new b.controller.LinearSpline(b.snapGrid,e.snapGrid))},setTranslate:function(e,a){function s(a){e=a.rtl&&"horizontal"===a.params.direction?-b.translate:b.translate,"slide"===b.params.controlBy&&(b.controller.getInterpolateFunction(a),i=-b.controller.spline.interpolate(-e)),i&&"container"!==b.params.controlBy||(r=(a.maxTranslate()-a.minTranslate())/(b.maxTranslate()-b.minTranslate()),i=(e-b.minTranslate())*r+a.minTranslate()),b.params.controlInverse&&(i=a.maxTranslate()-i),a.updateProgress(i),a.setWrapperTranslate(i,!1,b),a.updateActiveIndex()}var r,i,n=b.params.control;if(b.isArray(n))for(var o=0;o<n.length;o++)n[o]!==a&&n[o]instanceof t&&s(n[o]);else n instanceof t&&a!==n&&s(n)},setTransition:function(e,a){function s(a){a.setWrapperTransition(e,b),0!==e&&(a.onTransitionStart(),a.wrapper.transitionEnd(function(){i&&(a.params.loop&&"slide"===b.params.controlBy&&a.fixLoop(),a.onTransitionEnd())}))}var r,i=b.params.control;if(b.isArray(i))for(r=0;r<i.length;r++)i[r]!==a&&i[r]instanceof t&&s(i[r]);else i instanceof t&&a!==i&&s(i)}},b.hashnav={onHashCange:function(e,a){var t=document.location.hash.replace("#",""),s=b.slides.eq(b.activeIndex).attr("data-hash");t!==s&&b.slideTo(b.wrapper.children("."+b.params.slideClass+'[data-hash="'+t+'"]').index());
|
17 |
-
},attachEvents:function(e){var t=e?"off":"on";a(window)[t]("hashchange",b.hashnav.onHashCange)},setHash:function(){if(b.hashnav.initialized&&b.params.hashnav)if(b.params.replaceState&&window.history&&window.history.replaceState)window.history.replaceState(null,null,"#"+b.slides.eq(b.activeIndex).attr("data-hash")||"");else{var e=b.slides.eq(b.activeIndex),a=e.attr("data-hash")||e.attr("data-history");document.location.hash=a||""}},init:function(){if(b.params.hashnav&&!b.params.history){b.hashnav.initialized=!0;var e=document.location.hash.replace("#","");if(e){for(var a=0,t=0,s=b.slides.length;t<s;t++){var r=b.slides.eq(t),i=r.attr("data-hash")||r.attr("data-history");if(i===e&&!r.hasClass(b.params.slideDuplicateClass)){var n=r.index();b.slideTo(n,a,b.params.runCallbacksOnInit,!0)}}b.params.hashnavWatchState&&b.hashnav.attachEvents()}}},destroy:function(){b.params.hashnavWatchState&&b.hashnav.attachEvents(!0)}},b.history={init:function(){if(b.params.history){if(!window.history||!window.history.pushState)return b.params.history=!1,void(b.params.hashnav=!0);b.history.initialized=!0,this.paths=this.getPathValues(),(this.paths.key||this.paths.value)&&(this.scrollToSlide(0,this.paths.value,b.params.runCallbacksOnInit),b.params.replaceState||window.addEventListener("popstate",this.setHistoryPopState))}},setHistoryPopState:function(){b.history.paths=b.history.getPathValues(),b.history.scrollToSlide(b.params.speed,b.history.paths.value,!1)},getPathValues:function(){var e=window.location.pathname.slice(1).split("/"),a=e.length,t=e[a-2],s=e[a-1];return{key:t,value:s}},setHistory:function(e,a){if(b.history.initialized&&b.params.history){var t=b.slides.eq(a),s=this.slugify(t.attr("data-history"));window.location.pathname.includes(e)||(s=e+"/"+s),b.params.replaceState?window.history.replaceState(null,null,s):window.history.pushState(null,null,s)}},slugify:function(e){return e.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},scrollToSlide:function(e,a,t){if(a)for(var s=0,r=b.slides.length;s<r;s++){var i=b.slides.eq(s),n=this.slugify(i.attr("data-history"));if(n===a&&!i.hasClass(b.params.slideDuplicateClass)){var o=i.index();b.slideTo(o,e,t)}}else b.slideTo(0,e,t)}},b.disableKeyboardControl=function(){b.params.keyboardControl=!1,a(document).off("keydown",p)},b.enableKeyboardControl=function(){b.params.keyboardControl=!0,a(document).on("keydown",p)},b.mousewheel={event:!1,lastScrollTime:(new window.Date).getTime()},b.params.mousewheelControl&&(b.mousewheel.event=navigator.userAgent.indexOf("firefox")>-1?"DOMMouseScroll":d()?"wheel":"mousewheel"),b.disableMousewheelControl=function(){if(!b.mousewheel.event)return!1;var e=b.container;return"container"!==b.params.mousewheelEventsTarged&&(e=a(b.params.mousewheelEventsTarged)),e.off(b.mousewheel.event,u),!0},b.enableMousewheelControl=function(){if(!b.mousewheel.event)return!1;var e=b.container;return"container"!==b.params.mousewheelEventsTarged&&(e=a(b.params.mousewheelEventsTarged)),e.on(b.mousewheel.event,u),!0},b.parallax={setTranslate:function(){b.container.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){c(this,b.progress)}),b.slides.each(function(){var e=a(this);e.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){var a=Math.min(Math.max(e[0].progress,-1),1);c(this,a)})})},setTransition:function(e){"undefined"==typeof e&&(e=b.params.speed),b.container.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){var t=a(this),s=parseInt(t.attr("data-swiper-parallax-duration"),10)||e;0===e&&(s=0),t.transition(s)})}},b.zoom={scale:1,currentScale:1,isScaling:!1,gesture:{slide:void 0,slideWidth:void 0,slideHeight:void 0,image:void 0,imageWrap:void 0,zoomMax:b.params.zoomMax},image:{isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},velocity:{x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0},getDistanceBetweenTouches:function(e){if(e.targetTouches.length<2)return 1;var a=e.targetTouches[0].pageX,t=e.targetTouches[0].pageY,s=e.targetTouches[1].pageX,r=e.targetTouches[1].pageY,i=Math.sqrt(Math.pow(s-a,2)+Math.pow(r-t,2));return i},onGestureStart:function(e){var t=b.zoom;if(!b.support.gestures){if("touchstart"!==e.type||"touchstart"===e.type&&e.targetTouches.length<2)return;t.gesture.scaleStart=t.getDistanceBetweenTouches(e)}return t.gesture.slide&&t.gesture.slide.length||(t.gesture.slide=a(this),0===t.gesture.slide.length&&(t.gesture.slide=b.slides.eq(b.activeIndex)),t.gesture.image=t.gesture.slide.find("img, svg, canvas"),t.gesture.imageWrap=t.gesture.image.parent("."+b.params.zoomContainerClass),t.gesture.zoomMax=t.gesture.imageWrap.attr("data-swiper-zoom")||b.params.zoomMax,0!==t.gesture.imageWrap.length)?(t.gesture.image.transition(0),void(t.isScaling=!0)):void(t.gesture.image=void 0)},onGestureChange:function(e){var a=b.zoom;if(!b.support.gestures){if("touchmove"!==e.type||"touchmove"===e.type&&e.targetTouches.length<2)return;a.gesture.scaleMove=a.getDistanceBetweenTouches(e)}a.gesture.image&&0!==a.gesture.image.length&&(b.support.gestures?a.scale=e.scale*a.currentScale:a.scale=a.gesture.scaleMove/a.gesture.scaleStart*a.currentScale,a.scale>a.gesture.zoomMax&&(a.scale=a.gesture.zoomMax-1+Math.pow(a.scale-a.gesture.zoomMax+1,.5)),a.scale<b.params.zoomMin&&(a.scale=b.params.zoomMin+1-Math.pow(b.params.zoomMin-a.scale+1,.5)),a.gesture.image.transform("translate3d(0,0,0) scale("+a.scale+")"))},onGestureEnd:function(e){var a=b.zoom;!b.support.gestures&&("touchend"!==e.type||"touchend"===e.type&&e.changedTouches.length<2)||a.gesture.image&&0!==a.gesture.image.length&&(a.scale=Math.max(Math.min(a.scale,a.gesture.zoomMax),b.params.zoomMin),a.gesture.image.transition(b.params.speed).transform("translate3d(0,0,0) scale("+a.scale+")"),a.currentScale=a.scale,a.isScaling=!1,1===a.scale&&(a.gesture.slide=void 0))},onTouchStart:function(e,a){var t=e.zoom;t.gesture.image&&0!==t.gesture.image.length&&(t.image.isTouched||("android"===e.device.os&&a.preventDefault(),t.image.isTouched=!0,t.image.touchesStart.x="touchstart"===a.type?a.targetTouches[0].pageX:a.pageX,t.image.touchesStart.y="touchstart"===a.type?a.targetTouches[0].pageY:a.pageY))},onTouchMove:function(e){var a=b.zoom;if(a.gesture.image&&0!==a.gesture.image.length&&(b.allowClick=!1,a.image.isTouched&&a.gesture.slide)){a.image.isMoved||(a.image.width=a.gesture.image[0].offsetWidth,a.image.height=a.gesture.image[0].offsetHeight,a.image.startX=b.getTranslate(a.gesture.imageWrap[0],"x")||0,a.image.startY=b.getTranslate(a.gesture.imageWrap[0],"y")||0,a.gesture.slideWidth=a.gesture.slide[0].offsetWidth,a.gesture.slideHeight=a.gesture.slide[0].offsetHeight,a.gesture.imageWrap.transition(0));var t=a.image.width*a.scale,s=a.image.height*a.scale;if(!(t<a.gesture.slideWidth&&s<a.gesture.slideHeight)){if(a.image.minX=Math.min(a.gesture.slideWidth/2-t/2,0),a.image.maxX=-a.image.minX,a.image.minY=Math.min(a.gesture.slideHeight/2-s/2,0),a.image.maxY=-a.image.minY,a.image.touchesCurrent.x="touchmove"===e.type?e.targetTouches[0].pageX:e.pageX,a.image.touchesCurrent.y="touchmove"===e.type?e.targetTouches[0].pageY:e.pageY,!a.image.isMoved&&!a.isScaling){if(b.isHorizontal()&&Math.floor(a.image.minX)===Math.floor(a.image.startX)&&a.image.touchesCurrent.x<a.image.touchesStart.x||Math.floor(a.image.maxX)===Math.floor(a.image.startX)&&a.image.touchesCurrent.x>a.image.touchesStart.x)return void(a.image.isTouched=!1);if(!b.isHorizontal()&&Math.floor(a.image.minY)===Math.floor(a.image.startY)&&a.image.touchesCurrent.y<a.image.touchesStart.y||Math.floor(a.image.maxY)===Math.floor(a.image.startY)&&a.image.touchesCurrent.y>a.image.touchesStart.y)return void(a.image.isTouched=!1)}e.preventDefault(),e.stopPropagation(),a.image.isMoved=!0,a.image.currentX=a.image.touchesCurrent.x-a.image.touchesStart.x+a.image.startX,a.image.currentY=a.image.touchesCurrent.y-a.image.touchesStart.y+a.image.startY,a.image.currentX<a.image.minX&&(a.image.currentX=a.image.minX+1-Math.pow(a.image.minX-a.image.currentX+1,.8)),a.image.currentX>a.image.maxX&&(a.image.currentX=a.image.maxX-1+Math.pow(a.image.currentX-a.image.maxX+1,.8)),a.image.currentY<a.image.minY&&(a.image.currentY=a.image.minY+1-Math.pow(a.image.minY-a.image.currentY+1,.8)),a.image.currentY>a.image.maxY&&(a.image.currentY=a.image.maxY-1+Math.pow(a.image.currentY-a.image.maxY+1,.8)),a.velocity.prevPositionX||(a.velocity.prevPositionX=a.image.touchesCurrent.x),a.velocity.prevPositionY||(a.velocity.prevPositionY=a.image.touchesCurrent.y),a.velocity.prevTime||(a.velocity.prevTime=Date.now()),a.velocity.x=(a.image.touchesCurrent.x-a.velocity.prevPositionX)/(Date.now()-a.velocity.prevTime)/2,a.velocity.y=(a.image.touchesCurrent.y-a.velocity.prevPositionY)/(Date.now()-a.velocity.prevTime)/2,Math.abs(a.image.touchesCurrent.x-a.velocity.prevPositionX)<2&&(a.velocity.x=0),Math.abs(a.image.touchesCurrent.y-a.velocity.prevPositionY)<2&&(a.velocity.y=0),a.velocity.prevPositionX=a.image.touchesCurrent.x,a.velocity.prevPositionY=a.image.touchesCurrent.y,a.velocity.prevTime=Date.now(),a.gesture.imageWrap.transform("translate3d("+a.image.currentX+"px, "+a.image.currentY+"px,0)")}}},onTouchEnd:function(e,a){var t=e.zoom;if(t.gesture.image&&0!==t.gesture.image.length){if(!t.image.isTouched||!t.image.isMoved)return t.image.isTouched=!1,void(t.image.isMoved=!1);t.image.isTouched=!1,t.image.isMoved=!1;var s=300,r=300,i=t.velocity.x*s,n=t.image.currentX+i,o=t.velocity.y*r,l=t.image.currentY+o;0!==t.velocity.x&&(s=Math.abs((n-t.image.currentX)/t.velocity.x)),0!==t.velocity.y&&(r=Math.abs((l-t.image.currentY)/t.velocity.y));var p=Math.max(s,r);t.image.currentX=n,t.image.currentY=l;var d=t.image.width*t.scale,u=t.image.height*t.scale;t.image.minX=Math.min(t.gesture.slideWidth/2-d/2,0),t.image.maxX=-t.image.minX,t.image.minY=Math.min(t.gesture.slideHeight/2-u/2,0),t.image.maxY=-t.image.minY,t.image.currentX=Math.max(Math.min(t.image.currentX,t.image.maxX),t.image.minX),t.image.currentY=Math.max(Math.min(t.image.currentY,t.image.maxY),t.image.minY),t.gesture.imageWrap.transition(p).transform("translate3d("+t.image.currentX+"px, "+t.image.currentY+"px,0)")}},onTransitionEnd:function(e){var a=e.zoom;a.gesture.slide&&e.previousIndex!==e.activeIndex&&(a.gesture.image.transform("translate3d(0,0,0) scale(1)"),a.gesture.imageWrap.transform("translate3d(0,0,0)"),a.gesture.slide=a.gesture.image=a.gesture.imageWrap=void 0,a.scale=a.currentScale=1)},toggleZoom:function(e,t){var s=e.zoom;if(s.gesture.slide||(s.gesture.slide=e.clickedSlide?a(e.clickedSlide):e.slides.eq(e.activeIndex),s.gesture.image=s.gesture.slide.find("img, svg, canvas"),s.gesture.imageWrap=s.gesture.image.parent("."+e.params.zoomContainerClass)),s.gesture.image&&0!==s.gesture.image.length){var r,i,n,o,l,p,d,u,m,c,g,h,f,v,w,y,x,T;"undefined"==typeof s.image.touchesStart.x&&t?(r="touchend"===t.type?t.changedTouches[0].pageX:t.pageX,i="touchend"===t.type?t.changedTouches[0].pageY:t.pageY):(r=s.image.touchesStart.x,i=s.image.touchesStart.y),s.scale&&1!==s.scale?(s.scale=s.currentScale=1,s.gesture.imageWrap.transition(300).transform("translate3d(0,0,0)"),s.gesture.image.transition(300).transform("translate3d(0,0,0) scale(1)"),s.gesture.slide=void 0):(s.scale=s.currentScale=s.gesture.imageWrap.attr("data-swiper-zoom")||e.params.zoomMax,t?(x=s.gesture.slide[0].offsetWidth,T=s.gesture.slide[0].offsetHeight,n=s.gesture.slide.offset().left,o=s.gesture.slide.offset().top,l=n+x/2-r,p=o+T/2-i,m=s.gesture.image[0].offsetWidth,c=s.gesture.image[0].offsetHeight,g=m*s.scale,h=c*s.scale,f=Math.min(x/2-g/2,0),v=Math.min(T/2-h/2,0),w=-f,y=-v,d=l*s.scale,u=p*s.scale,d<f&&(d=f),d>w&&(d=w),u<v&&(u=v),u>y&&(u=y)):(d=0,u=0),s.gesture.imageWrap.transition(300).transform("translate3d("+d+"px, "+u+"px,0)"),s.gesture.image.transition(300).transform("translate3d(0,0,0) scale("+s.scale+")"))}},attachEvents:function(e){var t=e?"off":"on";if(b.params.zoom){var s=(b.slides,!("touchstart"!==b.touchEvents.start||!b.support.passiveListener||!b.params.passiveListeners)&&{passive:!0,capture:!1});b.support.gestures?(b.slides[t]("gesturestart",b.zoom.onGestureStart,s),b.slides[t]("gesturechange",b.zoom.onGestureChange,s),b.slides[t]("gestureend",b.zoom.onGestureEnd,s)):"touchstart"===b.touchEvents.start&&(b.slides[t](b.touchEvents.start,b.zoom.onGestureStart,s),b.slides[t](b.touchEvents.move,b.zoom.onGestureChange,s),b.slides[t](b.touchEvents.end,b.zoom.onGestureEnd,s)),b[t]("touchStart",b.zoom.onTouchStart),b.slides.each(function(e,s){a(s).find("."+b.params.zoomContainerClass).length>0&&a(s)[t](b.touchEvents.move,b.zoom.onTouchMove)}),b[t]("touchEnd",b.zoom.onTouchEnd),b[t]("transitionEnd",b.zoom.onTransitionEnd),b.params.zoomToggle&&b.on("doubleTap",b.zoom.toggleZoom)}},init:function(){b.zoom.attachEvents()},destroy:function(){b.zoom.attachEvents(!0)}},b._plugins=[];for(var O in b.plugins){var W=b.plugins[O](b,b.params[O]);W&&b._plugins.push(W)}return b.callPlugins=function(e){for(var a=0;a<b._plugins.length;a++)e in b._plugins[a]&&b._plugins[a][e](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},b.emitterEventListeners={},b.emit=function(e){b.params[e]&&b.params[e](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]);var a;if(b.emitterEventListeners[e])for(a=0;a<b.emitterEventListeners[e].length;a++)b.emitterEventListeners[e][a](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]);b.callPlugins&&b.callPlugins(e,arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},b.on=function(e,a){return e=g(e),b.emitterEventListeners[e]||(b.emitterEventListeners[e]=[]),b.emitterEventListeners[e].push(a),b},b.off=function(e,a){var t;if(e=g(e),"undefined"==typeof a)return b.emitterEventListeners[e]=[],b;if(b.emitterEventListeners[e]&&0!==b.emitterEventListeners[e].length){for(t=0;t<b.emitterEventListeners[e].length;t++)b.emitterEventListeners[e][t]===a&&b.emitterEventListeners[e].splice(t,1);return b}},b.once=function(e,a){e=g(e);var t=function(){a(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]),b.off(e,t)};return b.on(e,t),b},b.a11y={makeFocusable:function(e){return e.attr("tabIndex","0"),e},addRole:function(e,a){return e.attr("role",a),e},addLabel:function(e,a){return e.attr("aria-label",a),e},disable:function(e){return e.attr("aria-disabled",!0),e},enable:function(e){return e.attr("aria-disabled",!1),e},onEnterKey:function(e){13===e.keyCode&&(a(e.target).is(b.params.nextButton)?(b.onClickNext(e),b.isEnd?b.a11y.notify(b.params.lastSlideMessage):b.a11y.notify(b.params.nextSlideMessage)):a(e.target).is(b.params.prevButton)&&(b.onClickPrev(e),b.isBeginning?b.a11y.notify(b.params.firstSlideMessage):b.a11y.notify(b.params.prevSlideMessage)),a(e.target).is("."+b.params.bulletClass)&&a(e.target)[0].click())},liveRegion:a('<span class="'+b.params.notificationClass+'" aria-live="assertive" aria-atomic="true"></span>'),notify:function(e){var a=b.a11y.liveRegion;0!==a.length&&(a.html(""),a.html(e))},init:function(){b.params.nextButton&&b.nextButton&&b.nextButton.length>0&&(b.a11y.makeFocusable(b.nextButton),b.a11y.addRole(b.nextButton,"button"),b.a11y.addLabel(b.nextButton,b.params.nextSlideMessage)),b.params.prevButton&&b.prevButton&&b.prevButton.length>0&&(b.a11y.makeFocusable(b.prevButton),b.a11y.addRole(b.prevButton,"button"),b.a11y.addLabel(b.prevButton,b.params.prevSlideMessage)),a(b.container).append(b.a11y.liveRegion)},initPagination:function(){b.params.pagination&&b.params.paginationClickable&&b.bullets&&b.bullets.length&&b.bullets.each(function(){var e=a(this);b.a11y.makeFocusable(e),b.a11y.addRole(e,"button"),b.a11y.addLabel(e,b.params.paginationBulletMessage.replace(/{{index}}/,e.index()+1))})},destroy:function(){b.a11y.liveRegion&&b.a11y.liveRegion.length>0&&b.a11y.liveRegion.remove()}},b.init=function(){b.params.loop&&b.createLoop(),b.updateContainerSize(),b.updateSlidesSize(),b.updatePagination(),b.params.scrollbar&&b.scrollbar&&(b.scrollbar.set(),b.params.scrollbarDraggable&&b.scrollbar.enableDraggable()),"slide"!==b.params.effect&&b.effects[b.params.effect]&&(b.params.loop||b.updateProgress(),b.effects[b.params.effect].setTranslate()),b.params.loop?b.slideTo(b.params.initialSlide+b.loopedSlides,0,b.params.runCallbacksOnInit):(b.slideTo(b.params.initialSlide,0,b.params.runCallbacksOnInit),0===b.params.initialSlide&&(b.parallax&&b.params.parallax&&b.parallax.setTranslate(),b.lazy&&b.params.lazyLoading&&(b.lazy.load(),b.lazy.initialImageLoaded=!0))),b.attachEvents(),b.params.observer&&b.support.observer&&b.initObservers(),b.params.preloadImages&&!b.params.lazyLoading&&b.preloadImages(),b.params.zoom&&b.zoom&&b.zoom.init(),b.params.autoplay&&b.startAutoplay(),b.params.keyboardControl&&b.enableKeyboardControl&&b.enableKeyboardControl(),b.params.mousewheelControl&&b.enableMousewheelControl&&b.enableMousewheelControl(),b.params.hashnavReplaceState&&(b.params.replaceState=b.params.hashnavReplaceState),b.params.history&&b.history&&b.history.init(),b.params.hashnav&&b.hashnav&&b.hashnav.init(),b.params.a11y&&b.a11y&&b.a11y.init(),b.emit("onInit",b)},b.cleanupStyles=function(){b.container.removeClass(b.classNames.join(" ")).removeAttr("style"),b.wrapper.removeAttr("style"),b.slides&&b.slides.length&&b.slides.removeClass([b.params.slideVisibleClass,b.params.slideActiveClass,b.params.slideNextClass,b.params.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-column").removeAttr("data-swiper-row"),b.paginationContainer&&b.paginationContainer.length&&b.paginationContainer.removeClass(b.params.paginationHiddenClass),b.bullets&&b.bullets.length&&b.bullets.removeClass(b.params.bulletActiveClass),b.params.prevButton&&a(b.params.prevButton).removeClass(b.params.buttonDisabledClass),b.params.nextButton&&a(b.params.nextButton).removeClass(b.params.buttonDisabledClass),b.params.scrollbar&&b.scrollbar&&(b.scrollbar.track&&b.scrollbar.track.length&&b.scrollbar.track.removeAttr("style"),b.scrollbar.drag&&b.scrollbar.drag.length&&b.scrollbar.drag.removeAttr("style"))},b.destroy=function(e,a){b.detachEvents(),b.stopAutoplay(),b.params.scrollbar&&b.scrollbar&&b.params.scrollbarDraggable&&b.scrollbar.disableDraggable(),b.params.loop&&b.destroyLoop(),a&&b.cleanupStyles(),b.disconnectObservers(),b.params.zoom&&b.zoom&&b.zoom.destroy(),b.params.keyboardControl&&b.disableKeyboardControl&&b.disableKeyboardControl(),b.params.mousewheelControl&&b.disableMousewheelControl&&b.disableMousewheelControl(),b.params.a11y&&b.a11y&&b.a11y.destroy(),b.params.history&&!b.params.replaceState&&window.removeEventListener("popstate",b.history.setHistoryPopState),b.params.hashnav&&b.hashnav&&b.hashnav.destroy(),b.emit("onDestroy"),e!==!1&&(b=null)},b.init(),b}};t.prototype={isSafari:function(){var e=navigator.userAgent.toLowerCase();return e.indexOf("safari")>=0&&e.indexOf("chrome")<0&&e.indexOf("android")<0}(),isUiWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent),isArray:function(e){return"[object Array]"===Object.prototype.toString.apply(e)},browser:{ie:window.navigator.pointerEnabled||window.navigator.msPointerEnabled,ieTouch:window.navigator.msPointerEnabled&&window.navigator.msMaxTouchPoints>1||window.navigator.pointerEnabled&&window.navigator.maxTouchPoints>1,lteIE9:function(){var e=document.createElement("div");return e.innerHTML="<!--[if lte IE 9]><i></i><![endif]-->",1===e.getElementsByTagName("i").length}()},device:function(){var e=navigator.userAgent,a=e.match(/(Android);?[\s\/]+([\d.]+)?/),t=e.match(/(iPad).*OS\s([\d_]+)/),s=e.match(/(iPod)(.*OS\s([\d_]+))?/),r=!t&&e.match(/(iPhone\sOS)\s([\d_]+)/);return{ios:t||r||s,android:a}}(),support:{touch:window.Modernizr&&Modernizr.touch===!0||function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}(),transforms3d:window.Modernizr&&Modernizr.csstransforms3d===!0||function(){var e=document.createElement("div").style;return"webkitPerspective"in e||"MozPerspective"in e||"OPerspective"in e||"MsPerspective"in e||"perspective"in e}(),flexbox:function(){for(var e=document.createElement("div").style,a="alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient".split(" "),t=0;t<a.length;t++)if(a[t]in e)return!0}(),observer:function(){return"MutationObserver"in window||"WebkitMutationObserver"in window}(),passiveListener:function(){var e=!1;try{var a=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveListener",null,a)}catch(e){}return e}(),gestures:function(){return"ongesturestart"in window}()},plugins:{}};for(var s=["jQuery","Zepto","Dom7"],r=0;r<s.length;r++)window[s[r]]&&e(window[s[r]]);var i;i="undefined"==typeof Dom7?window.Dom7||window.Zepto||window.jQuery:Dom7,i&&("transitionEnd"in i.fn||(i.fn.transitionEnd=function(e){function a(i){if(i.target===this)for(e.call(this,i),t=0;t<s.length;t++)r.off(s[t],a)}var t,s=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],r=this;if(e)for(t=0;t<s.length;t++)r.on(s[t],a);return this}),"transform"in i.fn||(i.fn.transform=function(e){for(var a=0;a<this.length;a++){var t=this[a].style;t.webkitTransform=t.MsTransform=t.msTransform=t.MozTransform=t.OTransform=t.transform=e}return this}),"transition"in i.fn||(i.fn.transition=function(e){"string"!=typeof e&&(e+="ms");for(var a=0;a<this.length;a++){var t=this[a].style;t.webkitTransitionDuration=t.MsTransitionDuration=t.msTransitionDuration=t.MozTransitionDuration=t.OTransitionDuration=t.transitionDuration=e}return this}),"outerWidth"in i.fn||(i.fn.outerWidth=function(e){return this.length>0?e?this[0].offsetWidth+parseFloat(this.css("margin-right"))+parseFloat(this.css("margin-left")):this[0].offsetWidth:null})),window.Swiper=t}(),"undefined"!=typeof module?module.exports=window.Swiper:"function"==typeof define&&define.amd&&define([],function(){"use strict";return window.Swiper});
|
18 |
-
//# sourceMappingURL=maps/swiper.jquery.min.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/swiper/swiper.js
ADDED
@@ -0,0 +1,8662 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Swiper 5.3.6
|
3 |
+
* Most modern mobile touch slider and framework with hardware accelerated transitions
|
4 |
+
* http://swiperjs.com
|
5 |
+
*
|
6 |
+
* Copyright 2014-2020 Vladimir Kharlampidi
|
7 |
+
*
|
8 |
+
* Released under the MIT License
|
9 |
+
*
|
10 |
+
* Released on: February 29, 2020
|
11 |
+
*/
|
12 |
+
|
13 |
+
(function (global, factory) {
|
14 |
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
15 |
+
typeof define === 'function' && define.amd ? define(factory) :
|
16 |
+
(global = global || self, global.Swiper = factory());
|
17 |
+
}(this, function () { 'use strict';
|
18 |
+
|
19 |
+
/**
|
20 |
+
* SSR Window 1.0.1
|
21 |
+
* Better handling for window object in SSR environment
|
22 |
+
* https://github.com/nolimits4web/ssr-window
|
23 |
+
*
|
24 |
+
* Copyright 2018, Vladimir Kharlampidi
|
25 |
+
*
|
26 |
+
* Licensed under MIT
|
27 |
+
*
|
28 |
+
* Released on: July 18, 2018
|
29 |
+
*/
|
30 |
+
var doc = (typeof document === 'undefined') ? {
|
31 |
+
body: {},
|
32 |
+
addEventListener: function addEventListener() {},
|
33 |
+
removeEventListener: function removeEventListener() {},
|
34 |
+
activeElement: {
|
35 |
+
blur: function blur() {},
|
36 |
+
nodeName: '',
|
37 |
+
},
|
38 |
+
querySelector: function querySelector() {
|
39 |
+
return null;
|
40 |
+
},
|
41 |
+
querySelectorAll: function querySelectorAll() {
|
42 |
+
return [];
|
43 |
+
},
|
44 |
+
getElementById: function getElementById() {
|
45 |
+
return null;
|
46 |
+
},
|
47 |
+
createEvent: function createEvent() {
|
48 |
+
return {
|
49 |
+
initEvent: function initEvent() {},
|
50 |
+
};
|
51 |
+
},
|
52 |
+
createElement: function createElement() {
|
53 |
+
return {
|
54 |
+
children: [],
|
55 |
+
childNodes: [],
|
56 |
+
style: {},
|
57 |
+
setAttribute: function setAttribute() {},
|
58 |
+
getElementsByTagName: function getElementsByTagName() {
|
59 |
+
return [];
|
60 |
+
},
|
61 |
+
};
|
62 |
+
},
|
63 |
+
location: { hash: '' },
|
64 |
+
} : document; // eslint-disable-line
|
65 |
+
|
66 |
+
var win = (typeof window === 'undefined') ? {
|
67 |
+
document: doc,
|
68 |
+
navigator: {
|
69 |
+
userAgent: '',
|
70 |
+
},
|
71 |
+
location: {},
|
72 |
+
history: {},
|
73 |
+
CustomEvent: function CustomEvent() {
|
74 |
+
return this;
|
75 |
+
},
|
76 |
+
addEventListener: function addEventListener() {},
|
77 |
+
removeEventListener: function removeEventListener() {},
|
78 |
+
getComputedStyle: function getComputedStyle() {
|
79 |
+
return {
|
80 |
+
getPropertyValue: function getPropertyValue() {
|
81 |
+
return '';
|
82 |
+
},
|
83 |
+
};
|
84 |
+
},
|
85 |
+
Image: function Image() {},
|
86 |
+
Date: function Date() {},
|
87 |
+
screen: {},
|
88 |
+
setTimeout: function setTimeout() {},
|
89 |
+
clearTimeout: function clearTimeout() {},
|
90 |
+
} : window; // eslint-disable-line
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Dom7 2.1.3
|
94 |
+
* Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API
|
95 |
+
* http://framework7.io/docs/dom.html
|
96 |
+
*
|
97 |
+
* Copyright 2019, Vladimir Kharlampidi
|
98 |
+
* The iDangero.us
|
99 |
+
* http://www.idangero.us/
|
100 |
+
*
|
101 |
+
* Licensed under MIT
|
102 |
+
*
|
103 |
+
* Released on: February 11, 2019
|
104 |
+
*/
|
105 |
+
|
106 |
+
var Dom7 = function Dom7(arr) {
|
107 |
+
var self = this;
|
108 |
+
// Create array-like object
|
109 |
+
for (var i = 0; i < arr.length; i += 1) {
|
110 |
+
self[i] = arr[i];
|
111 |
+
}
|
112 |
+
self.length = arr.length;
|
113 |
+
// Return collection with methods
|
114 |
+
return this;
|
115 |
+
};
|
116 |
+
|
117 |
+
function $(selector, context) {
|
118 |
+
var arr = [];
|
119 |
+
var i = 0;
|
120 |
+
if (selector && !context) {
|
121 |
+
if (selector instanceof Dom7) {
|
122 |
+
return selector;
|
123 |
+
}
|
124 |
+
}
|
125 |
+
if (selector) {
|
126 |
+
// String
|
127 |
+
if (typeof selector === 'string') {
|
128 |
+
var els;
|
129 |
+
var tempParent;
|
130 |
+
var html = selector.trim();
|
131 |
+
if (html.indexOf('<') >= 0 && html.indexOf('>') >= 0) {
|
132 |
+
var toCreate = 'div';
|
133 |
+
if (html.indexOf('<li') === 0) { toCreate = 'ul'; }
|
134 |
+
if (html.indexOf('<tr') === 0) { toCreate = 'tbody'; }
|
135 |
+
if (html.indexOf('<td') === 0 || html.indexOf('<th') === 0) { toCreate = 'tr'; }
|
136 |
+
if (html.indexOf('<tbody') === 0) { toCreate = 'table'; }
|
137 |
+
if (html.indexOf('<option') === 0) { toCreate = 'select'; }
|
138 |
+
tempParent = doc.createElement(toCreate);
|
139 |
+
tempParent.innerHTML = html;
|
140 |
+
for (i = 0; i < tempParent.childNodes.length; i += 1) {
|
141 |
+
arr.push(tempParent.childNodes[i]);
|
142 |
+
}
|
143 |
+
} else {
|
144 |
+
if (!context && selector[0] === '#' && !selector.match(/[ .<>:~]/)) {
|
145 |
+
// Pure ID selector
|
146 |
+
els = [doc.getElementById(selector.trim().split('#')[1])];
|
147 |
+
} else {
|
148 |
+
// Other selectors
|
149 |
+
els = (context || doc).querySelectorAll(selector.trim());
|
150 |
+
}
|
151 |
+
for (i = 0; i < els.length; i += 1) {
|
152 |
+
if (els[i]) { arr.push(els[i]); }
|
153 |
+
}
|
154 |
+
}
|
155 |
+
} else if (selector.nodeType || selector === win || selector === doc) {
|
156 |
+
// Node/element
|
157 |
+
arr.push(selector);
|
158 |
+
} else if (selector.length > 0 && selector[0].nodeType) {
|
159 |
+
// Array of elements or instance of Dom
|
160 |
+
for (i = 0; i < selector.length; i += 1) {
|
161 |
+
arr.push(selector[i]);
|
162 |
+
}
|
163 |
+
}
|
164 |
+
}
|
165 |
+
return new Dom7(arr);
|
166 |
+
}
|
167 |
+
|
168 |
+
$.fn = Dom7.prototype;
|
169 |
+
$.Class = Dom7;
|
170 |
+
$.Dom7 = Dom7;
|
171 |
+
|
172 |
+
function unique(arr) {
|
173 |
+
var uniqueArray = [];
|
174 |
+
for (var i = 0; i < arr.length; i += 1) {
|
175 |
+
if (uniqueArray.indexOf(arr[i]) === -1) { uniqueArray.push(arr[i]); }
|
176 |
+
}
|
177 |
+
return uniqueArray;
|
178 |
+
}
|
179 |
+
|
180 |
+
// Classes and attributes
|
181 |
+
function addClass(className) {
|
182 |
+
if (typeof className === 'undefined') {
|
183 |
+
return this;
|
184 |
+
}
|
185 |
+
var classes = className.split(' ');
|
186 |
+
for (var i = 0; i < classes.length; i += 1) {
|
187 |
+
for (var j = 0; j < this.length; j += 1) {
|
188 |
+
if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') { this[j].classList.add(classes[i]); }
|
189 |
+
}
|
190 |
+
}
|
191 |
+
return this;
|
192 |
+
}
|
193 |
+
function removeClass(className) {
|
194 |
+
var classes = className.split(' ');
|
195 |
+
for (var i = 0; i < classes.length; i += 1) {
|
196 |
+
for (var j = 0; j < this.length; j += 1) {
|
197 |
+
if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') { this[j].classList.remove(classes[i]); }
|
198 |
+
}
|
199 |
+
}
|
200 |
+
return this;
|
201 |
+
}
|
202 |
+
function hasClass(className) {
|
203 |
+
if (!this[0]) { return false; }
|
204 |
+
return this[0].classList.contains(className);
|
205 |
+
}
|
206 |
+
function toggleClass(className) {
|
207 |
+
var classes = className.split(' ');
|
208 |
+
for (var i = 0; i < classes.length; i += 1) {
|
209 |
+
for (var j = 0; j < this.length; j += 1) {
|
210 |
+
if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') { this[j].classList.toggle(classes[i]); }
|
211 |
+
}
|
212 |
+
}
|
213 |
+
return this;
|
214 |
+
}
|
215 |
+
function attr(attrs, value) {
|
216 |
+
var arguments$1 = arguments;
|
217 |
+
|
218 |
+
if (arguments.length === 1 && typeof attrs === 'string') {
|
219 |
+
// Get attr
|
220 |
+
if (this[0]) { return this[0].getAttribute(attrs); }
|
221 |
+
return undefined;
|
222 |
+
}
|
223 |
+
|
224 |
+
// Set attrs
|
225 |
+
for (var i = 0; i < this.length; i += 1) {
|
226 |
+
if (arguments$1.length === 2) {
|
227 |
+
// String
|
228 |
+
this[i].setAttribute(attrs, value);
|
229 |
+
} else {
|
230 |
+
// Object
|
231 |
+
// eslint-disable-next-line
|
232 |
+
for (var attrName in attrs) {
|
233 |
+
this[i][attrName] = attrs[attrName];
|
234 |
+
this[i].setAttribute(attrName, attrs[attrName]);
|
235 |
+
}
|
236 |
+
}
|
237 |
+
}
|
238 |
+
return this;
|
239 |
+
}
|
240 |
+
// eslint-disable-next-line
|
241 |
+
function removeAttr(attr) {
|
242 |
+
for (var i = 0; i < this.length; i += 1) {
|
243 |
+
this[i].removeAttribute(attr);
|
244 |
+
}
|
245 |
+
return this;
|
246 |
+
}
|
247 |
+
function data(key, value) {
|
248 |
+
var el;
|
249 |
+
if (typeof value === 'undefined') {
|
250 |
+
el = this[0];
|
251 |
+
// Get value
|
252 |
+
if (el) {
|
253 |
+
if (el.dom7ElementDataStorage && (key in el.dom7ElementDataStorage)) {
|
254 |
+
return el.dom7ElementDataStorage[key];
|
255 |
+
}
|
256 |
+
|
257 |
+
var dataKey = el.getAttribute(("data-" + key));
|
258 |
+
if (dataKey) {
|
259 |
+
return dataKey;
|
260 |
+
}
|
261 |
+
return undefined;
|
262 |
+
}
|
263 |
+
return undefined;
|
264 |
+
}
|
265 |
+
|
266 |
+
// Set value
|
267 |
+
for (var i = 0; i < this.length; i += 1) {
|
268 |
+
el = this[i];
|
269 |
+
if (!el.dom7ElementDataStorage) { el.dom7ElementDataStorage = {}; }
|
270 |
+
el.dom7ElementDataStorage[key] = value;
|
271 |
+
}
|
272 |
+
return this;
|
273 |
+
}
|
274 |
+
// Transforms
|
275 |
+
// eslint-disable-next-line
|
276 |
+
function transform(transform) {
|
277 |
+
for (var i = 0; i < this.length; i += 1) {
|
278 |
+
var elStyle = this[i].style;
|
279 |
+
elStyle.webkitTransform = transform;
|
280 |
+
elStyle.transform = transform;
|
281 |
+
}
|
282 |
+
return this;
|
283 |
+
}
|
284 |
+
function transition(duration) {
|
285 |
+
if (typeof duration !== 'string') {
|
286 |
+
duration = duration + "ms"; // eslint-disable-line
|
287 |
+
}
|
288 |
+
for (var i = 0; i < this.length; i += 1) {
|
289 |
+
var elStyle = this[i].style;
|
290 |
+
elStyle.webkitTransitionDuration = duration;
|
291 |
+
elStyle.transitionDuration = duration;
|
292 |
+
}
|
293 |
+
return this;
|
294 |
+
}
|
295 |
+
// Events
|
296 |
+
function on() {
|
297 |
+
var assign;
|
298 |
+
|
299 |
+
var args = [], len = arguments.length;
|
300 |
+
while ( len-- ) args[ len ] = arguments[ len ];
|
301 |
+
var eventType = args[0];
|
302 |
+
var targetSelector = args[1];
|
303 |
+
var listener = args[2];
|
304 |
+
var capture = args[3];
|
305 |
+
if (typeof args[1] === 'function') {
|
306 |
+
(assign = args, eventType = assign[0], listener = assign[1], capture = assign[2]);
|
307 |
+
targetSelector = undefined;
|
308 |
+
}
|
309 |
+
if (!capture) { capture = false; }
|
310 |
+
|
311 |
+
function handleLiveEvent(e) {
|
312 |
+
var target = e.target;
|
313 |
+
if (!target) { return; }
|
314 |
+
var eventData = e.target.dom7EventData || [];
|
315 |
+
if (eventData.indexOf(e) < 0) {
|
316 |
+
eventData.unshift(e);
|
317 |
+
}
|
318 |
+
if ($(target).is(targetSelector)) { listener.apply(target, eventData); }
|
319 |
+
else {
|
320 |
+
var parents = $(target).parents(); // eslint-disable-line
|
321 |
+
for (var k = 0; k < parents.length; k += 1) {
|
322 |
+
if ($(parents[k]).is(targetSelector)) { listener.apply(parents[k], eventData); }
|
323 |
+
}
|
324 |
+
}
|
325 |
+
}
|
326 |
+
function handleEvent(e) {
|
327 |
+
var eventData = e && e.target ? e.target.dom7EventData || [] : [];
|
328 |
+
if (eventData.indexOf(e) < 0) {
|
329 |
+
eventData.unshift(e);
|
330 |
+
}
|
331 |
+
listener.apply(this, eventData);
|
332 |
+
}
|
333 |
+
var events = eventType.split(' ');
|
334 |
+
var j;
|
335 |
+
for (var i = 0; i < this.length; i += 1) {
|
336 |
+
var el = this[i];
|
337 |
+
if (!targetSelector) {
|
338 |
+
for (j = 0; j < events.length; j += 1) {
|
339 |
+
var event = events[j];
|
340 |
+
if (!el.dom7Listeners) { el.dom7Listeners = {}; }
|
341 |
+
if (!el.dom7Listeners[event]) { el.dom7Listeners[event] = []; }
|
342 |
+
el.dom7Listeners[event].push({
|
343 |
+
listener: listener,
|
344 |
+
proxyListener: handleEvent,
|
345 |
+
});
|
346 |
+
el.addEventListener(event, handleEvent, capture);
|
347 |
+
}
|
348 |
+
} else {
|
349 |
+
// Live events
|
350 |
+
for (j = 0; j < events.length; j += 1) {
|
351 |
+
var event$1 = events[j];
|
352 |
+
if (!el.dom7LiveListeners) { el.dom7LiveListeners = {}; }
|
353 |
+
if (!el.dom7LiveListeners[event$1]) { el.dom7LiveListeners[event$1] = []; }
|
354 |
+
el.dom7LiveListeners[event$1].push({
|
355 |
+
listener: listener,
|
356 |
+
proxyListener: handleLiveEvent,
|
357 |
+
});
|
358 |
+
el.addEventListener(event$1, handleLiveEvent, capture);
|
359 |
+
}
|
360 |
+
}
|
361 |
+
}
|
362 |
+
return this;
|
363 |
+
}
|
364 |
+
function off() {
|
365 |
+
var assign;
|
366 |
+
|
367 |
+
var args = [], len = arguments.length;
|
368 |
+
while ( len-- ) args[ len ] = arguments[ len ];
|
369 |
+
var eventType = args[0];
|
370 |
+
var targetSelector = args[1];
|
371 |
+
var listener = args[2];
|
372 |
+
var capture = args[3];
|
373 |
+
if (typeof args[1] === 'function') {
|
374 |
+
(assign = args, eventType = assign[0], listener = assign[1], capture = assign[2]);
|
375 |
+
targetSelector = undefined;
|
376 |
+
}
|
377 |
+
if (!capture) { capture = false; }
|
378 |
+
|
379 |
+
var events = eventType.split(' ');
|
380 |
+
for (var i = 0; i < events.length; i += 1) {
|
381 |
+
var event = events[i];
|
382 |
+
for (var j = 0; j < this.length; j += 1) {
|
383 |
+
var el = this[j];
|
384 |
+
var handlers = (void 0);
|
385 |
+
if (!targetSelector && el.dom7Listeners) {
|
386 |
+
handlers = el.dom7Listeners[event];
|
387 |
+
} else if (targetSelector && el.dom7LiveListeners) {
|
388 |
+
handlers = el.dom7LiveListeners[event];
|
389 |
+
}
|
390 |
+
if (handlers && handlers.length) {
|
391 |
+
for (var k = handlers.length - 1; k >= 0; k -= 1) {
|
392 |
+
var handler = handlers[k];
|
393 |
+
if (listener && handler.listener === listener) {
|
394 |
+
el.removeEventListener(event, handler.proxyListener, capture);
|
395 |
+
handlers.splice(k, 1);
|
396 |
+
} else if (listener && handler.listener && handler.listener.dom7proxy && handler.listener.dom7proxy === listener) {
|
397 |
+
el.removeEventListener(event, handler.proxyListener, capture);
|
398 |
+
handlers.splice(k, 1);
|
399 |
+
} else if (!listener) {
|
400 |
+
el.removeEventListener(event, handler.proxyListener, capture);
|
401 |
+
handlers.splice(k, 1);
|
402 |
+
}
|
403 |
+
}
|
404 |
+
}
|
405 |
+
}
|
406 |
+
}
|
407 |
+
return this;
|
408 |
+
}
|
409 |
+
function trigger() {
|
410 |
+
var args = [], len = arguments.length;
|
411 |
+
while ( len-- ) args[ len ] = arguments[ len ];
|
412 |
+
|
413 |
+
var events = args[0].split(' ');
|
414 |
+
var eventData = args[1];
|
415 |
+
for (var i = 0; i < events.length; i += 1) {
|
416 |
+
var event = events[i];
|
417 |
+
for (var j = 0; j < this.length; j += 1) {
|
418 |
+
var el = this[j];
|
419 |
+
var evt = (void 0);
|
420 |
+
try {
|
421 |
+
evt = new win.CustomEvent(event, {
|
422 |
+
detail: eventData,
|
423 |
+
bubbles: true,
|
424 |
+
cancelable: true,
|
425 |
+
});
|
426 |
+
} catch (e) {
|
427 |
+
evt = doc.createEvent('Event');
|
428 |
+
evt.initEvent(event, true, true);
|
429 |
+
evt.detail = eventData;
|
430 |
+
}
|
431 |
+
// eslint-disable-next-line
|
432 |
+
el.dom7EventData = args.filter(function (data, dataIndex) { return dataIndex > 0; });
|
433 |
+
el.dispatchEvent(evt);
|
434 |
+
el.dom7EventData = [];
|
435 |
+
delete el.dom7EventData;
|
436 |
+
}
|
437 |
+
}
|
438 |
+
return this;
|
439 |
+
}
|
440 |
+
function transitionEnd(callback) {
|
441 |
+
var events = ['webkitTransitionEnd', 'transitionend'];
|
442 |
+
var dom = this;
|
443 |
+
var i;
|
444 |
+
function fireCallBack(e) {
|
445 |
+
/* jshint validthis:true */
|
446 |
+
if (e.target !== this) { return; }
|
447 |
+
callback.call(this, e);
|
448 |
+
for (i = 0; i < events.length; i += 1) {
|
449 |
+
dom.off(events[i], fireCallBack);
|
450 |
+
}
|
451 |
+
}
|
452 |
+
if (callback) {
|
453 |
+
for (i = 0; i < events.length; i += 1) {
|
454 |
+
dom.on(events[i], fireCallBack);
|
455 |
+
}
|
456 |
+
}
|
457 |
+
return this;
|
458 |
+
}
|
459 |
+
function outerWidth(includeMargins) {
|
460 |
+
if (this.length > 0) {
|
461 |
+
if (includeMargins) {
|
462 |
+
// eslint-disable-next-line
|
463 |
+
var styles = this.styles();
|
464 |
+
return this[0].offsetWidth + parseFloat(styles.getPropertyValue('margin-right')) + parseFloat(styles.getPropertyValue('margin-left'));
|
465 |
+
}
|
466 |
+
return this[0].offsetWidth;
|
467 |
+
}
|
468 |
+
return null;
|
469 |
+
}
|
470 |
+
function outerHeight(includeMargins) {
|
471 |
+
if (this.length > 0) {
|
472 |
+
if (includeMargins) {
|
473 |
+
// eslint-disable-next-line
|
474 |
+
var styles = this.styles();
|
475 |
+
return this[0].offsetHeight + parseFloat(styles.getPropertyValue('margin-top')) + parseFloat(styles.getPropertyValue('margin-bottom'));
|
476 |
+
}
|
477 |
+
return this[0].offsetHeight;
|
478 |
+
}
|
479 |
+
return null;
|
480 |
+
}
|
481 |
+
function offset() {
|
482 |
+
if (this.length > 0) {
|
483 |
+
var el = this[0];
|
484 |
+
var box = el.getBoundingClientRect();
|
485 |
+
var body = doc.body;
|
486 |
+
var clientTop = el.clientTop || body.clientTop || 0;
|
487 |
+
var clientLeft = el.clientLeft || body.clientLeft || 0;
|
488 |
+
var scrollTop = el === win ? win.scrollY : el.scrollTop;
|
489 |
+
var scrollLeft = el === win ? win.scrollX : el.scrollLeft;
|
490 |
+
return {
|
491 |
+
top: (box.top + scrollTop) - clientTop,
|
492 |
+
left: (box.left + scrollLeft) - clientLeft,
|
493 |
+
};
|
494 |
+
}
|
495 |
+
|
496 |
+
return null;
|
497 |
+
}
|
498 |
+
function styles() {
|
499 |
+
if (this[0]) { return win.getComputedStyle(this[0], null); }
|
500 |
+
return {};
|
501 |
+
}
|
502 |
+
function css(props, value) {
|
503 |
+
var i;
|
504 |
+
if (arguments.length === 1) {
|
505 |
+
if (typeof props === 'string') {
|
506 |
+
if (this[0]) { return win.getComputedStyle(this[0], null).getPropertyValue(props); }
|
507 |
+
} else {
|
508 |
+
for (i = 0; i < this.length; i += 1) {
|
509 |
+
// eslint-disable-next-line
|
510 |
+
for (var prop in props) {
|
511 |
+
this[i].style[prop] = props[prop];
|
512 |
+
}
|
513 |
+
}
|
514 |
+
return this;
|
515 |
+
}
|
516 |
+
}
|
517 |
+
if (arguments.length === 2 && typeof props === 'string') {
|
518 |
+
for (i = 0; i < this.length; i += 1) {
|
519 |
+
this[i].style[props] = value;
|
520 |
+
}
|
521 |
+
return this;
|
522 |
+
}
|
523 |
+
return this;
|
524 |
+
}
|
525 |
+
// Iterate over the collection passing elements to `callback`
|
526 |
+
function each(callback) {
|
527 |
+
// Don't bother continuing without a callback
|
528 |
+
if (!callback) { return this; }
|
529 |
+
// Iterate over the current collection
|
530 |
+
for (var i = 0; i < this.length; i += 1) {
|
531 |
+
// If the callback returns false
|
532 |
+
if (callback.call(this[i], i, this[i]) === false) {
|
533 |
+
// End the loop early
|
534 |
+
return this;
|
535 |
+
}
|
536 |
+
}
|
537 |
+
// Return `this` to allow chained DOM operations
|
538 |
+
return this;
|
539 |
+
}
|
540 |
+
function filter(callback) {
|
541 |
+
var matchedItems = [];
|
542 |
+
var dom = this;
|
543 |
+
for (var i = 0; i < dom.length; i += 1) {
|
544 |
+
if (callback.call(dom[i], i, dom[i])) { matchedItems.push(dom[i]); }
|
545 |
+
}
|
546 |
+
return new Dom7(matchedItems);
|
547 |
+
}
|
548 |
+
// eslint-disable-next-line
|
549 |
+
function html(html) {
|
550 |
+
if (typeof html === 'undefined') {
|
551 |
+
return this[0] ? this[0].innerHTML : undefined;
|
552 |
+
}
|
553 |
+
|
554 |
+
for (var i = 0; i < this.length; i += 1) {
|
555 |
+
this[i].innerHTML = html;
|
556 |
+
}
|
557 |
+
return this;
|
558 |
+
}
|
559 |
+
// eslint-disable-next-line
|
560 |
+
function text(text) {
|
561 |
+
if (typeof text === 'undefined') {
|
562 |
+
if (this[0]) {
|
563 |
+
return this[0].textContent.trim();
|
564 |
+
}
|
565 |
+
return null;
|
566 |
+
}
|
567 |
+
|
568 |
+
for (var i = 0; i < this.length; i += 1) {
|
569 |
+
this[i].textContent = text;
|
570 |
+
}
|
571 |
+
return this;
|
572 |
+
}
|
573 |
+
function is(selector) {
|
574 |
+
var el = this[0];
|
575 |
+
var compareWith;
|
576 |
+
var i;
|
577 |
+
if (!el || typeof selector === 'undefined') { return false; }
|
578 |
+
if (typeof selector === 'string') {
|
579 |
+
if (el.matches) { return el.matches(selector); }
|
580 |
+
else if (el.webkitMatchesSelector) { return el.webkitMatchesSelector(selector); }
|
581 |
+
else if (el.msMatchesSelector) { return el.msMatchesSelector(selector); }
|
582 |
+
|
583 |
+
compareWith = $(selector);
|
584 |
+
for (i = 0; i < compareWith.length; i += 1) {
|
585 |
+
if (compareWith[i] === el) { return true; }
|
586 |
+
}
|
587 |
+
return false;
|
588 |
+
} else if (selector === doc) { return el === doc; }
|
589 |
+
else if (selector === win) { return el === win; }
|
590 |
+
|
591 |
+
if (selector.nodeType || selector instanceof Dom7) {
|
592 |
+
compareWith = selector.nodeType ? [selector] : selector;
|
593 |
+
for (i = 0; i < compareWith.length; i += 1) {
|
594 |
+
if (compareWith[i] === el) { return true; }
|
595 |
+
}
|
596 |
+
return false;
|
597 |
+
}
|
598 |
+
return false;
|
599 |
+
}
|
600 |
+
function index() {
|
601 |
+
var child = this[0];
|
602 |
+
var i;
|
603 |
+
if (child) {
|
604 |
+
i = 0;
|
605 |
+
// eslint-disable-next-line
|
606 |
+
while ((child = child.previousSibling) !== null) {
|
607 |
+
if (child.nodeType === 1) { i += 1; }
|
608 |
+
}
|
609 |
+
return i;
|
610 |
+
}
|
611 |
+
return undefined;
|
612 |
+
}
|
613 |
+
// eslint-disable-next-line
|
614 |
+
function eq(index) {
|
615 |
+
if (typeof index === 'undefined') { return this; }
|
616 |
+
var length = this.length;
|
617 |
+
var returnIndex;
|
618 |
+
if (index > length - 1) {
|
619 |
+
return new Dom7([]);
|
620 |
+
}
|
621 |
+
if (index < 0) {
|
622 |
+
returnIndex = length + index;
|
623 |
+
if (returnIndex < 0) { return new Dom7([]); }
|
624 |
+
return new Dom7([this[returnIndex]]);
|
625 |
+
}
|
626 |
+
return new Dom7([this[index]]);
|
627 |
+
}
|
628 |
+
function append() {
|
629 |
+
var args = [], len = arguments.length;
|
630 |
+
while ( len-- ) args[ len ] = arguments[ len ];
|
631 |
+
|
632 |
+
var newChild;
|
633 |
+
|
634 |
+
for (var k = 0; k < args.length; k += 1) {
|
635 |
+
newChild = args[k];
|
636 |
+
for (var i = 0; i < this.length; i += 1) {
|
637 |
+
if (typeof newChild === 'string') {
|
638 |
+
var tempDiv = doc.createElement('div');
|
639 |
+
tempDiv.innerHTML = newChild;
|
640 |
+
while (tempDiv.firstChild) {
|
641 |
+
this[i].appendChild(tempDiv.firstChild);
|
642 |
+
}
|
643 |
+
} else if (newChild instanceof Dom7) {
|
644 |
+
for (var j = 0; j < newChild.length; j += 1) {
|
645 |
+
this[i].appendChild(newChild[j]);
|
646 |
+
}
|
647 |
+
} else {
|
648 |
+
this[i].appendChild(newChild);
|
649 |
+
}
|
650 |
+
}
|
651 |
+
}
|
652 |
+
|
653 |
+
return this;
|
654 |
+
}
|
655 |
+
function prepend(newChild) {
|
656 |
+
var i;
|
657 |
+
var j;
|
658 |
+
for (i = 0; i < this.length; i += 1) {
|
659 |
+
if (typeof newChild === 'string') {
|
660 |
+
var tempDiv = doc.createElement('div');
|
661 |
+
tempDiv.innerHTML = newChild;
|
662 |
+
for (j = tempDiv.childNodes.length - 1; j >= 0; j -= 1) {
|
663 |
+
this[i].insertBefore(tempDiv.childNodes[j], this[i].childNodes[0]);
|
664 |
+
}
|
665 |
+
} else if (newChild instanceof Dom7) {
|
666 |
+
for (j = 0; j < newChild.length; j += 1) {
|
667 |
+
this[i].insertBefore(newChild[j], this[i].childNodes[0]);
|
668 |
+
}
|
669 |
+
} else {
|
670 |
+
this[i].insertBefore(newChild, this[i].childNodes[0]);
|
671 |
+
}
|
672 |
+
}
|
673 |
+
return this;
|
674 |
+
}
|
675 |
+
function next(selector) {
|
676 |
+
if (this.length > 0) {
|
677 |
+
if (selector) {
|
678 |
+
if (this[0].nextElementSibling && $(this[0].nextElementSibling).is(selector)) {
|
679 |
+
return new Dom7([this[0].nextElementSibling]);
|
680 |
+
}
|
681 |
+
return new Dom7([]);
|
682 |
+
}
|
683 |
+
|
684 |
+
if (this[0].nextElementSibling) { return new Dom7([this[0].nextElementSibling]); }
|
685 |
+
return new Dom7([]);
|
686 |
+
}
|
687 |
+
return new Dom7([]);
|
688 |
+
}
|
689 |
+
function nextAll(selector) {
|
690 |
+
var nextEls = [];
|
691 |
+
var el = this[0];
|
692 |
+
if (!el) { return new Dom7([]); }
|
693 |
+
while (el.nextElementSibling) {
|
694 |
+
var next = el.nextElementSibling; // eslint-disable-line
|
695 |
+
if (selector) {
|
696 |
+
if ($(next).is(selector)) { nextEls.push(next); }
|
697 |
+
} else { nextEls.push(next); }
|
698 |
+
el = next;
|
699 |
+
}
|
700 |
+
return new Dom7(nextEls);
|
701 |
+
}
|
702 |
+
function prev(selector) {
|
703 |
+
if (this.length > 0) {
|
704 |
+
var el = this[0];
|
705 |
+
if (selector) {
|
706 |
+
if (el.previousElementSibling && $(el.previousElementSibling).is(selector)) {
|
707 |
+
return new Dom7([el.previousElementSibling]);
|
708 |
+
}
|
709 |
+
return new Dom7([]);
|
710 |
+
}
|
711 |
+
|
712 |
+
if (el.previousElementSibling) { return new Dom7([el.previousElementSibling]); }
|
713 |
+
return new Dom7([]);
|
714 |
+
}
|
715 |
+
return new Dom7([]);
|
716 |
+
}
|
717 |
+
function prevAll(selector) {
|
718 |
+
var prevEls = [];
|
719 |
+
var el = this[0];
|
720 |
+
if (!el) { return new Dom7([]); }
|
721 |
+
while (el.previousElementSibling) {
|
722 |
+
var prev = el.previousElementSibling; // eslint-disable-line
|
723 |
+
if (selector) {
|
724 |
+
if ($(prev).is(selector)) { prevEls.push(prev); }
|
725 |
+
} else { prevEls.push(prev); }
|
726 |
+
el = prev;
|
727 |
+
}
|
728 |
+
return new Dom7(prevEls);
|
729 |
+
}
|
730 |
+
function parent(selector) {
|
731 |
+
var parents = []; // eslint-disable-line
|
732 |
+
for (var i = 0; i < this.length; i += 1) {
|
733 |
+
if (this[i].parentNode !== null) {
|
734 |
+
if (selector) {
|
735 |
+
if ($(this[i].parentNode).is(selector)) { parents.push(this[i].parentNode); }
|
736 |
+
} else {
|
737 |
+
parents.push(this[i].parentNode);
|
738 |
+
}
|
739 |
+
}
|
740 |
+
}
|
741 |
+
return $(unique(parents));
|
742 |
+
}
|
743 |
+
function parents(selector) {
|
744 |
+
var parents = []; // eslint-disable-line
|
745 |
+
for (var i = 0; i < this.length; i += 1) {
|
746 |
+
var parent = this[i].parentNode; // eslint-disable-line
|
747 |
+
while (parent) {
|
748 |
+
if (selector) {
|
749 |
+
if ($(parent).is(selector)) { parents.push(parent); }
|
750 |
+
} else {
|
751 |
+
parents.push(parent);
|
752 |
+
}
|
753 |
+
parent = parent.parentNode;
|
754 |
+
}
|
755 |
+
}
|
756 |
+
return $(unique(parents));
|
757 |
+
}
|
758 |
+
function closest(selector) {
|
759 |
+
var closest = this; // eslint-disable-line
|
760 |
+
if (typeof selector === 'undefined') {
|
761 |
+
return new Dom7([]);
|
762 |
+
}
|
763 |
+
if (!closest.is(selector)) {
|
764 |
+
closest = closest.parents(selector).eq(0);
|
765 |
+
}
|
766 |
+
return closest;
|
767 |
+
}
|
768 |
+
function find(selector) {
|
769 |
+
var foundElements = [];
|
770 |
+
for (var i = 0; i < this.length; i += 1) {
|
771 |
+
var found = this[i].querySelectorAll(selector);
|
772 |
+
for (var j = 0; j < found.length; j += 1) {
|
773 |
+
foundElements.push(found[j]);
|
774 |
+
}
|
775 |
+
}
|
776 |
+
return new Dom7(foundElements);
|
777 |
+
}
|
778 |
+
function children(selector) {
|
779 |
+
var children = []; // eslint-disable-line
|
780 |
+
for (var i = 0; i < this.length; i += 1) {
|
781 |
+
var childNodes = this[i].childNodes;
|
782 |
+
|
783 |
+
for (var j = 0; j < childNodes.length; j += 1) {
|
784 |
+
if (!selector) {
|
785 |
+
if (childNodes[j].nodeType === 1) { children.push(childNodes[j]); }
|
786 |
+
} else if (childNodes[j].nodeType === 1 && $(childNodes[j]).is(selector)) {
|
787 |
+
children.push(childNodes[j]);
|
788 |
+
}
|
789 |
+
}
|
790 |
+
}
|
791 |
+
return new Dom7(unique(children));
|
792 |
+
}
|
793 |
+
function remove() {
|
794 |
+
for (var i = 0; i < this.length; i += 1) {
|
795 |
+
if (this[i].parentNode) { this[i].parentNode.removeChild(this[i]); }
|
796 |
+
}
|
797 |
+
return this;
|
798 |
+
}
|
799 |
+
function add() {
|
800 |
+
var args = [], len = arguments.length;
|
801 |
+
while ( len-- ) args[ len ] = arguments[ len ];
|
802 |
+
|
803 |
+
var dom = this;
|
804 |
+
var i;
|
805 |
+
var j;
|
806 |
+
for (i = 0; i < args.length; i += 1) {
|
807 |
+
var toAdd = $(args[i]);
|
808 |
+
for (j = 0; j < toAdd.length; j += 1) {
|
809 |
+
dom[dom.length] = toAdd[j];
|
810 |
+
dom.length += 1;
|
811 |
+
}
|
812 |
+
}
|
813 |
+
return dom;
|
814 |
+
}
|
815 |
+
|
816 |
+
var Methods = {
|
817 |
+
addClass: addClass,
|
818 |
+
removeClass: removeClass,
|
819 |
+
hasClass: hasClass,
|
820 |
+
toggleClass: toggleClass,
|
821 |
+
attr: attr,
|
822 |
+
removeAttr: removeAttr,
|
823 |
+
data: data,
|
824 |
+
transform: transform,
|
825 |
+
transition: transition,
|
826 |
+
on: on,
|
827 |
+
off: off,
|
828 |
+
trigger: trigger,
|
829 |
+
transitionEnd: transitionEnd,
|
830 |
+
outerWidth: outerWidth,
|
831 |
+
outerHeight: outerHeight,
|
832 |
+
offset: offset,
|
833 |
+
css: css,
|
834 |
+
each: each,
|
835 |
+
html: html,
|
836 |
+
text: text,
|
837 |
+
is: is,
|
838 |
+
index: index,
|
839 |
+
eq: eq,
|
840 |
+
append: append,
|
841 |
+
prepend: prepend,
|
842 |
+
next: next,
|
843 |
+
nextAll: nextAll,
|
844 |
+
prev: prev,
|
845 |
+
prevAll: prevAll,
|
846 |
+
parent: parent,
|
847 |
+
parents: parents,
|
848 |
+
closest: closest,
|
849 |
+
find: find,
|
850 |
+
children: children,
|
851 |
+
filter: filter,
|
852 |
+
remove: remove,
|
853 |
+
add: add,
|
854 |
+
styles: styles,
|
855 |
+
};
|
856 |
+
|
857 |
+
Object.keys(Methods).forEach(function (methodName) {
|
858 |
+
$.fn[methodName] = $.fn[methodName] || Methods[methodName];
|
859 |
+
});
|
860 |
+
|
861 |
+
var Utils = {
|
862 |
+
deleteProps: function deleteProps(obj) {
|
863 |
+
var object = obj;
|
864 |
+
Object.keys(object).forEach(function (key) {
|
865 |
+
try {
|
866 |
+
object[key] = null;
|
867 |
+
} catch (e) {
|
868 |
+
// no getter for object
|
869 |
+
}
|
870 |
+
try {
|
871 |
+
delete object[key];
|
872 |
+
} catch (e) {
|
873 |
+
// something got wrong
|
874 |
+
}
|
875 |
+
});
|
876 |
+
},
|
877 |
+
nextTick: function nextTick(callback, delay) {
|
878 |
+
if ( delay === void 0 ) delay = 0;
|
879 |
+
|
880 |
+
return setTimeout(callback, delay);
|
881 |
+
},
|
882 |
+
now: function now() {
|
883 |
+
return Date.now();
|
884 |
+
},
|
885 |
+
getTranslate: function getTranslate(el, axis) {
|
886 |
+
if ( axis === void 0 ) axis = 'x';
|
887 |
+
|
888 |
+
var matrix;
|
889 |
+
var curTransform;
|
890 |
+
var transformMatrix;
|
891 |
+
|
892 |
+
var curStyle = win.getComputedStyle(el, null);
|
893 |
+
|
894 |
+
if (win.WebKitCSSMatrix) {
|
895 |
+
curTransform = curStyle.transform || curStyle.webkitTransform;
|
896 |
+
if (curTransform.split(',').length > 6) {
|
897 |
+
curTransform = curTransform.split(', ').map(function (a) { return a.replace(',', '.'); }).join(', ');
|
898 |
+
}
|
899 |
+
// Some old versions of Webkit choke when 'none' is passed; pass
|
900 |
+
// empty string instead in this case
|
901 |
+
transformMatrix = new win.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);
|
902 |
+
} else {
|
903 |
+
transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
|
904 |
+
matrix = transformMatrix.toString().split(',');
|
905 |
+
}
|
906 |
+
|
907 |
+
if (axis === 'x') {
|
908 |
+
// Latest Chrome and webkits Fix
|
909 |
+
if (win.WebKitCSSMatrix) { curTransform = transformMatrix.m41; }
|
910 |
+
// Crazy IE10 Matrix
|
911 |
+
else if (matrix.length === 16) { curTransform = parseFloat(matrix[12]); }
|
912 |
+
// Normal Browsers
|
913 |
+
else { curTransform = parseFloat(matrix[4]); }
|
914 |
+
}
|
915 |
+
if (axis === 'y') {
|
916 |
+
// Latest Chrome and webkits Fix
|
917 |
+
if (win.WebKitCSSMatrix) { curTransform = transformMatrix.m42; }
|
918 |
+
// Crazy IE10 Matrix
|
919 |
+
else if (matrix.length === 16) { curTransform = parseFloat(matrix[13]); }
|
920 |
+
// Normal Browsers
|
921 |
+
else { curTransform = parseFloat(matrix[5]); }
|
922 |
+
}
|
923 |
+
return curTransform || 0;
|
924 |
+
},
|
925 |
+
parseUrlQuery: function parseUrlQuery(url) {
|
926 |
+
var query = {};
|
927 |
+
var urlToParse = url || win.location.href;
|
928 |
+
var i;
|
929 |
+
var params;
|
930 |
+
var param;
|
931 |
+
var length;
|
932 |
+
if (typeof urlToParse === 'string' && urlToParse.length) {
|
933 |
+
urlToParse = urlToParse.indexOf('?') > -1 ? urlToParse.replace(/\S*\?/, '') : '';
|
934 |
+
params = urlToParse.split('&').filter(function (paramsPart) { return paramsPart !== ''; });
|
935 |
+
length = params.length;
|
936 |
+
|
937 |
+
for (i = 0; i < length; i += 1) {
|
938 |
+
param = params[i].replace(/#\S+/g, '').split('=');
|
939 |
+
query[decodeURIComponent(param[0])] = typeof param[1] === 'undefined' ? undefined : decodeURIComponent(param[1]) || '';
|
940 |
+
}
|
941 |
+
}
|
942 |
+
return query;
|
943 |
+
},
|
944 |
+
isObject: function isObject(o) {
|
945 |
+
return typeof o === 'object' && o !== null && o.constructor && o.constructor === Object;
|
946 |
+
},
|
947 |
+
extend: function extend() {
|
948 |
+
var args = [], len$1 = arguments.length;
|
949 |
+
while ( len$1-- ) args[ len$1 ] = arguments[ len$1 ];
|
950 |
+
|
951 |
+
var to = Object(args[0]);
|
952 |
+
for (var i = 1; i < args.length; i += 1) {
|
953 |
+
var nextSource = args[i];
|
954 |
+
if (nextSource !== undefined && nextSource !== null) {
|
955 |
+
var keysArray = Object.keys(Object(nextSource));
|
956 |
+
for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
|
957 |
+
var nextKey = keysArray[nextIndex];
|
958 |
+
var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
959 |
+
if (desc !== undefined && desc.enumerable) {
|
960 |
+
if (Utils.isObject(to[nextKey]) && Utils.isObject(nextSource[nextKey])) {
|
961 |
+
Utils.extend(to[nextKey], nextSource[nextKey]);
|
962 |
+
} else if (!Utils.isObject(to[nextKey]) && Utils.isObject(nextSource[nextKey])) {
|
963 |
+
to[nextKey] = {};
|
964 |
+
Utils.extend(to[nextKey], nextSource[nextKey]);
|
965 |
+
} else {
|
966 |
+
to[nextKey] = nextSource[nextKey];
|
967 |
+
}
|
968 |
+
}
|
969 |
+
}
|
970 |
+
}
|
971 |
+
}
|
972 |
+
return to;
|
973 |
+
},
|
974 |
+
};
|
975 |
+
|
976 |
+
var Support = (function Support() {
|
977 |
+
return {
|
978 |
+
touch: (win.Modernizr && win.Modernizr.touch === true) || (function checkTouch() {
|
979 |
+
return !!((win.navigator.maxTouchPoints > 0) || ('ontouchstart' in win) || (win.DocumentTouch && doc instanceof win.DocumentTouch));
|
980 |
+
}()),
|
981 |
+
|
982 |
+
pointerEvents: !!win.PointerEvent && ('maxTouchPoints' in win.navigator) && win.navigator.maxTouchPoints > 0,
|
983 |
+
|
984 |
+
observer: (function checkObserver() {
|
985 |
+
return ('MutationObserver' in win || 'WebkitMutationObserver' in win);
|
986 |
+
}()),
|
987 |
+
|
988 |
+
passiveListener: (function checkPassiveListener() {
|
989 |
+
var supportsPassive = false;
|
990 |
+
try {
|
991 |
+
var opts = Object.defineProperty({}, 'passive', {
|
992 |
+
// eslint-disable-next-line
|
993 |
+
get: function get() {
|
994 |
+
supportsPassive = true;
|
995 |
+
},
|
996 |
+
});
|
997 |
+
win.addEventListener('testPassiveListener', null, opts);
|
998 |
+
} catch (e) {
|
999 |
+
// No support
|
1000 |
+
}
|
1001 |
+
return supportsPassive;
|
1002 |
+
}()),
|
1003 |
+
|
1004 |
+
gestures: (function checkGestures() {
|
1005 |
+
return 'ongesturestart' in win;
|
1006 |
+
}()),
|
1007 |
+
};
|
1008 |
+
}());
|
1009 |
+
|
1010 |
+
var SwiperClass = function SwiperClass(params) {
|
1011 |
+
if ( params === void 0 ) params = {};
|
1012 |
+
|
1013 |
+
var self = this;
|
1014 |
+
self.params = params;
|
1015 |
+
|
1016 |
+
// Events
|
1017 |
+
self.eventsListeners = {};
|
1018 |
+
|
1019 |
+
if (self.params && self.params.on) {
|
1020 |
+
Object.keys(self.params.on).forEach(function (eventName) {
|
1021 |
+
self.on(eventName, self.params.on[eventName]);
|
1022 |
+
});
|
1023 |
+
}
|
1024 |
+
};
|
1025 |
+
|
1026 |
+
var staticAccessors = { components: { configurable: true } };
|
1027 |
+
|
1028 |
+
SwiperClass.prototype.on = function on (events, handler, priority) {
|
1029 |
+
var self = this;
|
1030 |
+
if (typeof handler !== 'function') { return self; }
|
1031 |
+
var method = priority ? 'unshift' : 'push';
|
1032 |
+
events.split(' ').forEach(function (event) {
|
1033 |
+
if (!self.eventsListeners[event]) { self.eventsListeners[event] = []; }
|
1034 |
+
self.eventsListeners[event][method](handler);
|
1035 |
+
});
|
1036 |
+
return self;
|
1037 |
+
};
|
1038 |
+
|
1039 |
+
SwiperClass.prototype.once = function once (events, handler, priority) {
|
1040 |
+
var self = this;
|
1041 |
+
if (typeof handler !== 'function') { return self; }
|
1042 |
+
function onceHandler() {
|
1043 |
+
var args = [], len = arguments.length;
|
1044 |
+
while ( len-- ) args[ len ] = arguments[ len ];
|
1045 |
+
|
1046 |
+
self.off(events, onceHandler);
|
1047 |
+
if (onceHandler.f7proxy) {
|
1048 |
+
delete onceHandler.f7proxy;
|
1049 |
+
}
|
1050 |
+
handler.apply(self, args);
|
1051 |
+
}
|
1052 |
+
onceHandler.f7proxy = handler;
|
1053 |
+
return self.on(events, onceHandler, priority);
|
1054 |
+
};
|
1055 |
+
|
1056 |
+
SwiperClass.prototype.off = function off (events, handler) {
|
1057 |
+
var self = this;
|
1058 |
+
if (!self.eventsListeners) { return self; }
|
1059 |
+
events.split(' ').forEach(function (event) {
|
1060 |
+
if (typeof handler === 'undefined') {
|
1061 |
+
self.eventsListeners[event] = [];
|
1062 |
+
} else if (self.eventsListeners[event] && self.eventsListeners[event].length) {
|
1063 |
+
self.eventsListeners[event].forEach(function (eventHandler, index) {
|
1064 |
+
if (eventHandler === handler || (eventHandler.f7proxy && eventHandler.f7proxy === handler)) {
|
1065 |
+
self.eventsListeners[event].splice(index, 1);
|
1066 |
+
}
|
1067 |
+
});
|
1068 |
+
}
|
1069 |
+
});
|
1070 |
+
return self;
|
1071 |
+
};
|
1072 |
+
|
1073 |
+
SwiperClass.prototype.emit = function emit () {
|
1074 |
+
var args = [], len = arguments.length;
|
1075 |
+
while ( len-- ) args[ len ] = arguments[ len ];
|
1076 |
+
|
1077 |
+
var self = this;
|
1078 |
+
if (!self.eventsListeners) { return self; }
|
1079 |
+
var events;
|
1080 |
+
var data;
|
1081 |
+
var context;
|
1082 |
+
if (typeof args[0] === 'string' || Array.isArray(args[0])) {
|
1083 |
+
events = args[0];
|
1084 |
+
data = args.slice(1, args.length);
|
1085 |
+
context = self;
|
1086 |
+
} else {
|
1087 |
+
events = args[0].events;
|
1088 |
+
data = args[0].data;
|
1089 |
+
context = args[0].context || self;
|
1090 |
+
}
|
1091 |
+
var eventsArray = Array.isArray(events) ? events : events.split(' ');
|
1092 |
+
eventsArray.forEach(function (event) {
|
1093 |
+
if (self.eventsListeners && self.eventsListeners[event]) {
|
1094 |
+
var handlers = [];
|
1095 |
+
self.eventsListeners[event].forEach(function (eventHandler) {
|
1096 |
+
handlers.push(eventHandler);
|
1097 |
+
});
|
1098 |
+
handlers.forEach(function (eventHandler) {
|
1099 |
+
eventHandler.apply(context, data);
|
1100 |
+
});
|
1101 |
+
}
|
1102 |
+
});
|
1103 |
+
return self;
|
1104 |
+
};
|
1105 |
+
|
1106 |
+
SwiperClass.prototype.useModulesParams = function useModulesParams (instanceParams) {
|
1107 |
+
var instance = this;
|
1108 |
+
if (!instance.modules) { return; }
|
1109 |
+
Object.keys(instance.modules).forEach(function (moduleName) {
|
1110 |
+
var module = instance.modules[moduleName];
|
1111 |
+
// Extend params
|
1112 |
+
if (module.params) {
|
1113 |
+
Utils.extend(instanceParams, module.params);
|
1114 |
+
}
|
1115 |
+
});
|
1116 |
+
};
|
1117 |
+
|
1118 |
+
SwiperClass.prototype.useModules = function useModules (modulesParams) {
|
1119 |
+
if ( modulesParams === void 0 ) modulesParams = {};
|
1120 |
+
|
1121 |
+
var instance = this;
|
1122 |
+
if (!instance.modules) { return; }
|
1123 |
+
Object.keys(instance.modules).forEach(function (moduleName) {
|
1124 |
+
var module = instance.modules[moduleName];
|
1125 |
+
var moduleParams = modulesParams[moduleName] || {};
|
1126 |
+
// Extend instance methods and props
|
1127 |
+
if (module.instance) {
|
1128 |
+
Object.keys(module.instance).forEach(function (modulePropName) {
|
1129 |
+
var moduleProp = module.instance[modulePropName];
|
1130 |
+
if (typeof moduleProp === 'function') {
|
1131 |
+
instance[modulePropName] = moduleProp.bind(instance);
|
1132 |
+
} else {
|
1133 |
+
instance[modulePropName] = moduleProp;
|
1134 |
+
}
|
1135 |
+
});
|
1136 |
+
}
|
1137 |
+
// Add event listeners
|
1138 |
+
if (module.on && instance.on) {
|
1139 |
+
Object.keys(module.on).forEach(function (moduleEventName) {
|
1140 |
+
instance.on(moduleEventName, module.on[moduleEventName]);
|
1141 |
+
});
|
1142 |
+
}
|
1143 |
+
|
1144 |
+
// Module create callback
|
1145 |
+
if (module.create) {
|
1146 |
+
module.create.bind(instance)(moduleParams);
|
1147 |
+
}
|
1148 |
+
});
|
1149 |
+
};
|
1150 |
+
|
1151 |
+
staticAccessors.components.set = function (components) {
|
1152 |
+
var Class = this;
|
1153 |
+
if (!Class.use) { return; }
|
1154 |
+
Class.use(components);
|
1155 |
+
};
|
1156 |
+
|
1157 |
+
SwiperClass.installModule = function installModule (module) {
|
1158 |
+
var params = [], len = arguments.length - 1;
|
1159 |
+
while ( len-- > 0 ) params[ len ] = arguments[ len + 1 ];
|
1160 |
+
|
1161 |
+
var Class = this;
|
1162 |
+
if (!Class.prototype.modules) { Class.prototype.modules = {}; }
|
1163 |
+
var name = module.name || (((Object.keys(Class.prototype.modules).length) + "_" + (Utils.now())));
|
1164 |
+
Class.prototype.modules[name] = module;
|
1165 |
+
// Prototype
|
1166 |
+
if (module.proto) {
|
1167 |
+
Object.keys(module.proto).forEach(function (key) {
|
1168 |
+
Class.prototype[key] = module.proto[key];
|
1169 |
+
});
|
1170 |
+
}
|
1171 |
+
// Class
|
1172 |
+
if (module.static) {
|
1173 |
+
Object.keys(module.static).forEach(function (key) {
|
1174 |
+
Class[key] = module.static[key];
|
1175 |
+
});
|
1176 |
+
}
|
1177 |
+
// Callback
|
1178 |
+
if (module.install) {
|
1179 |
+
module.install.apply(Class, params);
|
1180 |
+
}
|
1181 |
+
return Class;
|
1182 |
+
};
|
1183 |
+
|
1184 |
+
SwiperClass.use = function use (module) {
|
1185 |
+
var params = [], len = arguments.length - 1;
|
1186 |
+
while ( len-- > 0 ) params[ len ] = arguments[ len + 1 ];
|
1187 |
+
|
1188 |
+
var Class = this;
|
1189 |
+
if (Array.isArray(module)) {
|
1190 |
+
module.forEach(function (m) { return Class.installModule(m); });
|
1191 |
+
return Class;
|
1192 |
+
}
|
1193 |
+
return Class.installModule.apply(Class, [ module ].concat( params ));
|
1194 |
+
};
|
1195 |
+
|
1196 |
+
Object.defineProperties( SwiperClass, staticAccessors );
|
1197 |
+
|
1198 |
+
function updateSize () {
|
1199 |
+
var swiper = this;
|
1200 |
+
var width;
|
1201 |
+
var height;
|
1202 |
+
var $el = swiper.$el;
|
1203 |
+
if (typeof swiper.params.width !== 'undefined') {
|
1204 |
+
width = swiper.params.width;
|
1205 |
+
} else {
|
1206 |
+
width = $el[0].clientWidth;
|
1207 |
+
}
|
1208 |
+
if (typeof swiper.params.height !== 'undefined') {
|
1209 |
+
height = swiper.params.height;
|
1210 |
+
} else {
|
1211 |
+
height = $el[0].clientHeight;
|
1212 |
+
}
|
1213 |
+
if ((width === 0 && swiper.isHorizontal()) || (height === 0 && swiper.isVertical())) {
|
1214 |
+
return;
|
1215 |
+
}
|
1216 |
+
|
1217 |
+
// Subtract paddings
|
1218 |
+
width = width - parseInt($el.css('padding-left'), 10) - parseInt($el.css('padding-right'), 10);
|
1219 |
+
height = height - parseInt($el.css('padding-top'), 10) - parseInt($el.css('padding-bottom'), 10);
|
1220 |
+
|
1221 |
+
Utils.extend(swiper, {
|
1222 |
+
width: width,
|
1223 |
+
height: height,
|
1224 |
+
size: swiper.isHorizontal() ? width : height,
|
1225 |
+
});
|
1226 |
+
}
|
1227 |
+
|
1228 |
+
function updateSlides () {
|
1229 |
+
var swiper = this;
|
1230 |
+
var params = swiper.params;
|
1231 |
+
|
1232 |
+
var $wrapperEl = swiper.$wrapperEl;
|
1233 |
+
var swiperSize = swiper.size;
|
1234 |
+
var rtl = swiper.rtlTranslate;
|
1235 |
+
var wrongRTL = swiper.wrongRTL;
|
1236 |
+
var isVirtual = swiper.virtual && params.virtual.enabled;
|
1237 |
+
var previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;
|
1238 |
+
var slides = $wrapperEl.children(("." + (swiper.params.slideClass)));
|
1239 |
+
var slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;
|
1240 |
+
var snapGrid = [];
|
1241 |
+
var slidesGrid = [];
|
1242 |
+
var slidesSizesGrid = [];
|
1243 |
+
|
1244 |
+
function slidesForMargin(slideIndex) {
|
1245 |
+
if (!params.cssMode) { return true; }
|
1246 |
+
if (slideIndex === slides.length - 1) {
|
1247 |
+
return false;
|
1248 |
+
}
|
1249 |
+
return true;
|
1250 |
+
}
|
1251 |
+
|
1252 |
+
var offsetBefore = params.slidesOffsetBefore;
|
1253 |
+
if (typeof offsetBefore === 'function') {
|
1254 |
+
offsetBefore = params.slidesOffsetBefore.call(swiper);
|
1255 |
+
}
|
1256 |
+
|
1257 |
+
var offsetAfter = params.slidesOffsetAfter;
|
1258 |
+
if (typeof offsetAfter === 'function') {
|
1259 |
+
offsetAfter = params.slidesOffsetAfter.call(swiper);
|
1260 |
+
}
|
1261 |
+
|
1262 |
+
var previousSnapGridLength = swiper.snapGrid.length;
|
1263 |
+
var previousSlidesGridLength = swiper.snapGrid.length;
|
1264 |
+
|
1265 |
+
var spaceBetween = params.spaceBetween;
|
1266 |
+
var slidePosition = -offsetBefore;
|
1267 |
+
var prevSlideSize = 0;
|
1268 |
+
var index = 0;
|
1269 |
+
if (typeof swiperSize === 'undefined') {
|
1270 |
+
return;
|
1271 |
+
}
|
1272 |
+
if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
|
1273 |
+
spaceBetween = (parseFloat(spaceBetween.replace('%', '')) / 100) * swiperSize;
|
1274 |
+
}
|
1275 |
+
|
1276 |
+
swiper.virtualSize = -spaceBetween;
|
1277 |
+
|
1278 |
+
// reset margins
|
1279 |
+
if (rtl) { slides.css({ marginLeft: '', marginTop: '' }); }
|
1280 |
+
else { slides.css({ marginRight: '', marginBottom: '' }); }
|
1281 |
+
|
1282 |
+
var slidesNumberEvenToRows;
|
1283 |
+
if (params.slidesPerColumn > 1) {
|
1284 |
+
if (Math.floor(slidesLength / params.slidesPerColumn) === slidesLength / swiper.params.slidesPerColumn) {
|
1285 |
+
slidesNumberEvenToRows = slidesLength;
|
1286 |
+
} else {
|
1287 |
+
slidesNumberEvenToRows = Math.ceil(slidesLength / params.slidesPerColumn) * params.slidesPerColumn;
|
1288 |
+
}
|
1289 |
+
if (params.slidesPerView !== 'auto' && params.slidesPerColumnFill === 'row') {
|
1290 |
+
slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, params.slidesPerView * params.slidesPerColumn);
|
1291 |
+
}
|
1292 |
+
}
|
1293 |
+
|
1294 |
+
// Calc slides
|
1295 |
+
var slideSize;
|
1296 |
+
var slidesPerColumn = params.slidesPerColumn;
|
1297 |
+
var slidesPerRow = slidesNumberEvenToRows / slidesPerColumn;
|
1298 |
+
var numFullColumns = Math.floor(slidesLength / params.slidesPerColumn);
|
1299 |
+
for (var i = 0; i < slidesLength; i += 1) {
|
1300 |
+
slideSize = 0;
|
1301 |
+
var slide = slides.eq(i);
|
1302 |
+
if (params.slidesPerColumn > 1) {
|
1303 |
+
// Set slides order
|
1304 |
+
var newSlideOrderIndex = (void 0);
|
1305 |
+
var column = (void 0);
|
1306 |
+
var row = (void 0);
|
1307 |
+
if (params.slidesPerColumnFill === 'row' && params.slidesPerGroup > 1) {
|
1308 |
+
var groupIndex = Math.floor(i / (params.slidesPerGroup * params.slidesPerColumn));
|
1309 |
+
var slideIndexInGroup = i - params.slidesPerColumn * params.slidesPerGroup * groupIndex;
|
1310 |
+
var columnsInGroup = groupIndex === 0
|
1311 |
+
? params.slidesPerGroup
|
1312 |
+
: Math.min(Math.ceil((slidesLength - groupIndex * slidesPerColumn * params.slidesPerGroup) / slidesPerColumn), params.slidesPerGroup);
|
1313 |
+
row = Math.floor(slideIndexInGroup / columnsInGroup);
|
1314 |
+
column = (slideIndexInGroup - row * columnsInGroup) + groupIndex * params.slidesPerGroup;
|
1315 |
+
|
1316 |
+
newSlideOrderIndex = column + ((row * slidesNumberEvenToRows) / slidesPerColumn);
|
1317 |
+
slide
|
1318 |
+
.css({
|
1319 |
+
'-webkit-box-ordinal-group': newSlideOrderIndex,
|
1320 |
+
'-moz-box-ordinal-group': newSlideOrderIndex,
|
1321 |
+
'-ms-flex-order': newSlideOrderIndex,
|
1322 |
+
'-webkit-order': newSlideOrderIndex,
|
1323 |
+
order: newSlideOrderIndex,
|
1324 |
+
});
|
1325 |
+
} else if (params.slidesPerColumnFill === 'column') {
|
1326 |
+
column = Math.floor(i / slidesPerColumn);
|
1327 |
+
row = i - (column * slidesPerColumn);
|
1328 |
+
if (column > numFullColumns || (column === numFullColumns && row === slidesPerColumn - 1)) {
|
1329 |
+
row += 1;
|
1330 |
+
if (row >= slidesPerColumn) {
|
1331 |
+
row = 0;
|
1332 |
+
column += 1;
|
1333 |
+
}
|
1334 |
+
}
|
1335 |
+
} else {
|
1336 |
+
row = Math.floor(i / slidesPerRow);
|
1337 |
+
column = i - (row * slidesPerRow);
|
1338 |
+
}
|
1339 |
+
slide.css(
|
1340 |
+
("margin-" + (swiper.isHorizontal() ? 'top' : 'left')),
|
1341 |
+
(row !== 0 && params.spaceBetween) && (((params.spaceBetween) + "px"))
|
1342 |
+
);
|
1343 |
+
}
|
1344 |
+
if (slide.css('display') === 'none') { continue; } // eslint-disable-line
|
1345 |
+
|
1346 |
+
if (params.slidesPerView === 'auto') {
|
1347 |
+
var slideStyles = win.getComputedStyle(slide[0], null);
|
1348 |
+
var currentTransform = slide[0].style.transform;
|
1349 |
+
var currentWebKitTransform = slide[0].style.webkitTransform;
|
1350 |
+
if (currentTransform) {
|
1351 |
+
slide[0].style.transform = 'none';
|
1352 |
+
}
|
1353 |
+
if (currentWebKitTransform) {
|
1354 |
+
slide[0].style.webkitTransform = 'none';
|
1355 |
+
}
|
1356 |
+
if (params.roundLengths) {
|
1357 |
+
slideSize = swiper.isHorizontal()
|
1358 |
+
? slide.outerWidth(true)
|
1359 |
+
: slide.outerHeight(true);
|
1360 |
+
} else {
|
1361 |
+
// eslint-disable-next-line
|
1362 |
+
if (swiper.isHorizontal()) {
|
1363 |
+
var width = parseFloat(slideStyles.getPropertyValue('width'));
|
1364 |
+
var paddingLeft = parseFloat(slideStyles.getPropertyValue('padding-left'));
|
1365 |
+
var paddingRight = parseFloat(slideStyles.getPropertyValue('padding-right'));
|
1366 |
+
var marginLeft = parseFloat(slideStyles.getPropertyValue('margin-left'));
|
1367 |
+
var marginRight = parseFloat(slideStyles.getPropertyValue('margin-right'));
|
1368 |
+
var boxSizing = slideStyles.getPropertyValue('box-sizing');
|
1369 |
+
if (boxSizing && boxSizing === 'border-box') {
|
1370 |
+
slideSize = width + marginLeft + marginRight;
|
1371 |
+
} else {
|
1372 |
+
slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight;
|
1373 |
+
}
|
1374 |
+
} else {
|
1375 |
+
var height = parseFloat(slideStyles.getPropertyValue('height'));
|
1376 |
+
var paddingTop = parseFloat(slideStyles.getPropertyValue('padding-top'));
|
1377 |
+
var paddingBottom = parseFloat(slideStyles.getPropertyValue('padding-bottom'));
|
1378 |
+
var marginTop = parseFloat(slideStyles.getPropertyValue('margin-top'));
|
1379 |
+
var marginBottom = parseFloat(slideStyles.getPropertyValue('margin-bottom'));
|
1380 |
+
var boxSizing$1 = slideStyles.getPropertyValue('box-sizing');
|
1381 |
+
if (boxSizing$1 && boxSizing$1 === 'border-box') {
|
1382 |
+
slideSize = height + marginTop + marginBottom;
|
1383 |
+
} else {
|
1384 |
+
slideSize = height + paddingTop + paddingBottom + marginTop + marginBottom;
|
1385 |
+
}
|
1386 |
+
}
|
1387 |
+
}
|
1388 |
+
if (currentTransform) {
|
1389 |
+
slide[0].style.transform = currentTransform;
|
1390 |
+
}
|
1391 |
+
if (currentWebKitTransform) {
|
1392 |
+
slide[0].style.webkitTransform = currentWebKitTransform;
|
1393 |
+
}
|
1394 |
+
if (params.roundLengths) { slideSize = Math.floor(slideSize); }
|
1395 |
+
} else {
|
1396 |
+
slideSize = (swiperSize - ((params.slidesPerView - 1) * spaceBetween)) / params.slidesPerView;
|
1397 |
+
if (params.roundLengths) { slideSize = Math.floor(slideSize); }
|
1398 |
+
|
1399 |
+
if (slides[i]) {
|
1400 |
+
if (swiper.isHorizontal()) {
|
1401 |
+
slides[i].style.width = slideSize + "px";
|
1402 |
+
} else {
|
1403 |
+
slides[i].style.height = slideSize + "px";
|
1404 |
+
}
|
1405 |
+
}
|
1406 |
+
}
|
1407 |
+
if (slides[i]) {
|
1408 |
+
slides[i].swiperSlideSize = slideSize;
|
1409 |
+
}
|
1410 |
+
slidesSizesGrid.push(slideSize);
|
1411 |
+
|
1412 |
+
|
1413 |
+
if (params.centeredSlides) {
|
1414 |
+
slidePosition = slidePosition + (slideSize / 2) + (prevSlideSize / 2) + spaceBetween;
|
1415 |
+
if (prevSlideSize === 0 && i !== 0) { slidePosition = slidePosition - (swiperSize / 2) - spaceBetween; }
|
1416 |
+
if (i === 0) { slidePosition = slidePosition - (swiperSize / 2) - spaceBetween; }
|
1417 |
+
if (Math.abs(slidePosition) < 1 / 1000) { slidePosition = 0; }
|
1418 |
+
if (params.roundLengths) { slidePosition = Math.floor(slidePosition); }
|
1419 |
+
if ((index) % params.slidesPerGroup === 0) { snapGrid.push(slidePosition); }
|
1420 |
+
slidesGrid.push(slidePosition);
|
1421 |
+
} else {
|
1422 |
+
if (params.roundLengths) { slidePosition = Math.floor(slidePosition); }
|
1423 |
+
if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) { snapGrid.push(slidePosition); }
|
1424 |
+
slidesGrid.push(slidePosition);
|
1425 |
+
slidePosition = slidePosition + slideSize + spaceBetween;
|
1426 |
+
}
|
1427 |
+
|
1428 |
+
swiper.virtualSize += slideSize + spaceBetween;
|
1429 |
+
|
1430 |
+
prevSlideSize = slideSize;
|
1431 |
+
|
1432 |
+
index += 1;
|
1433 |
+
}
|
1434 |
+
swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter;
|
1435 |
+
var newSlidesGrid;
|
1436 |
+
|
1437 |
+
if (
|
1438 |
+
rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) {
|
1439 |
+
$wrapperEl.css({ width: ((swiper.virtualSize + params.spaceBetween) + "px") });
|
1440 |
+
}
|
1441 |
+
if (params.setWrapperSize) {
|
1442 |
+
if (swiper.isHorizontal()) { $wrapperEl.css({ width: ((swiper.virtualSize + params.spaceBetween) + "px") }); }
|
1443 |
+
else { $wrapperEl.css({ height: ((swiper.virtualSize + params.spaceBetween) + "px") }); }
|
1444 |
+
}
|
1445 |
+
|
1446 |
+
if (params.slidesPerColumn > 1) {
|
1447 |
+
swiper.virtualSize = (slideSize + params.spaceBetween) * slidesNumberEvenToRows;
|
1448 |
+
swiper.virtualSize = Math.ceil(swiper.virtualSize / params.slidesPerColumn) - params.spaceBetween;
|
1449 |
+
if (swiper.isHorizontal()) { $wrapperEl.css({ width: ((swiper.virtualSize + params.spaceBetween) + "px") }); }
|
1450 |
+
else { $wrapperEl.css({ height: ((swiper.virtualSize + params.spaceBetween) + "px") }); }
|
1451 |
+
if (params.centeredSlides) {
|
1452 |
+
newSlidesGrid = [];
|
1453 |
+
for (var i$1 = 0; i$1 < snapGrid.length; i$1 += 1) {
|
1454 |
+
var slidesGridItem = snapGrid[i$1];
|
1455 |
+
if (params.roundLengths) { slidesGridItem = Math.floor(slidesGridItem); }
|
1456 |
+
if (snapGrid[i$1] < swiper.virtualSize + snapGrid[0]) { newSlidesGrid.push(slidesGridItem); }
|
1457 |
+
}
|
1458 |
+
snapGrid = newSlidesGrid;
|
1459 |
+
}
|
1460 |
+
}
|
1461 |
+
|
1462 |
+
// Remove last grid elements depending on width
|
1463 |
+
if (!params.centeredSlides) {
|
1464 |
+
newSlidesGrid = [];
|
1465 |
+
for (var i$2 = 0; i$2 < snapGrid.length; i$2 += 1) {
|
1466 |
+
var slidesGridItem$1 = snapGrid[i$2];
|
1467 |
+
if (params.roundLengths) { slidesGridItem$1 = Math.floor(slidesGridItem$1); }
|
1468 |
+
if (snapGrid[i$2] <= swiper.virtualSize - swiperSize) {
|
1469 |
+
newSlidesGrid.push(slidesGridItem$1);
|
1470 |
+
}
|
1471 |
+
}
|
1472 |
+
snapGrid = newSlidesGrid;
|
1473 |
+
if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {
|
1474 |
+
snapGrid.push(swiper.virtualSize - swiperSize);
|
1475 |
+
}
|
1476 |
+
}
|
1477 |
+
if (snapGrid.length === 0) { snapGrid = [0]; }
|
1478 |
+
|
1479 |
+
if (params.spaceBetween !== 0) {
|
1480 |
+
if (swiper.isHorizontal()) {
|
1481 |
+
if (rtl) { slides.filter(slidesForMargin).css({ marginLeft: (spaceBetween + "px") }); }
|
1482 |
+
else { slides.filter(slidesForMargin).css({ marginRight: (spaceBetween + "px") }); }
|
1483 |
+
} else { slides.filter(slidesForMargin).css({ marginBottom: (spaceBetween + "px") }); }
|
1484 |
+
}
|
1485 |
+
|
1486 |
+
if (params.centeredSlides && params.centeredSlidesBounds) {
|
1487 |
+
var allSlidesSize = 0;
|
1488 |
+
slidesSizesGrid.forEach(function (slideSizeValue) {
|
1489 |
+
allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0);
|
1490 |
+
});
|
1491 |
+
allSlidesSize -= params.spaceBetween;
|
1492 |
+
var maxSnap = allSlidesSize - swiperSize;
|
1493 |
+
snapGrid = snapGrid.map(function (snap) {
|
1494 |
+
if (snap < 0) { return -offsetBefore; }
|
1495 |
+
if (snap > maxSnap) { return maxSnap + offsetAfter; }
|
1496 |
+
return snap;
|
1497 |
+
});
|
1498 |
+
}
|
1499 |
+
|
1500 |
+
if (params.centerInsufficientSlides) {
|
1501 |
+
var allSlidesSize$1 = 0;
|
1502 |
+
slidesSizesGrid.forEach(function (slideSizeValue) {
|
1503 |
+
allSlidesSize$1 += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0);
|
1504 |
+
});
|
1505 |
+
allSlidesSize$1 -= params.spaceBetween;
|
1506 |
+
if (allSlidesSize$1 < swiperSize) {
|
1507 |
+
var allSlidesOffset = (swiperSize - allSlidesSize$1) / 2;
|
1508 |
+
snapGrid.forEach(function (snap, snapIndex) {
|
1509 |
+
snapGrid[snapIndex] = snap - allSlidesOffset;
|
1510 |
+
});
|
1511 |
+
slidesGrid.forEach(function (snap, snapIndex) {
|
1512 |
+
slidesGrid[snapIndex] = snap + allSlidesOffset;
|
1513 |
+
});
|
1514 |
+
}
|
1515 |
+
}
|
1516 |
+
|
1517 |
+
Utils.extend(swiper, {
|
1518 |
+
slides: slides,
|
1519 |
+
snapGrid: snapGrid,
|
1520 |
+
slidesGrid: slidesGrid,
|
1521 |
+
slidesSizesGrid: slidesSizesGrid,
|
1522 |
+
});
|
1523 |
+
|
1524 |
+
if (slidesLength !== previousSlidesLength) {
|
1525 |
+
swiper.emit('slidesLengthChange');
|
1526 |
+
}
|
1527 |
+
if (snapGrid.length !== previousSnapGridLength) {
|
1528 |
+
if (swiper.params.watchOverflow) { swiper.checkOverflow(); }
|
1529 |
+
swiper.emit('snapGridLengthChange');
|
1530 |
+
}
|
1531 |
+
if (slidesGrid.length !== previousSlidesGridLength) {
|
1532 |
+
swiper.emit('slidesGridLengthChange');
|
1533 |
+
}
|
1534 |
+
|
1535 |
+
if (params.watchSlidesProgress || params.watchSlidesVisibility) {
|
1536 |
+
swiper.updateSlidesOffset();
|
1537 |
+
}
|
1538 |
+
}
|
1539 |
+
|
1540 |
+
function updateAutoHeight (speed) {
|
1541 |
+
var swiper = this;
|
1542 |
+
var activeSlides = [];
|
1543 |
+
var newHeight = 0;
|
1544 |
+
var i;
|
1545 |
+
if (typeof speed === 'number') {
|
1546 |
+
swiper.setTransition(speed);
|
1547 |
+
} else if (speed === true) {
|
1548 |
+
swiper.setTransition(swiper.params.speed);
|
1549 |
+
}
|
1550 |
+
// Find slides currently in view
|
1551 |
+
if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) {
|
1552 |
+
if (swiper.params.centeredSlides) { activeSlides.push.apply(activeSlides, swiper.visibleSlides); }
|
1553 |
+
else {
|
1554 |
+
for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) {
|
1555 |
+
var index = swiper.activeIndex + i;
|
1556 |
+
if (index > swiper.slides.length) { break; }
|
1557 |
+
activeSlides.push(swiper.slides.eq(index)[0]);
|
1558 |
+
}
|
1559 |
+
}
|
1560 |
+
} else {
|
1561 |
+
activeSlides.push(swiper.slides.eq(swiper.activeIndex)[0]);
|
1562 |
+
}
|
1563 |
+
|
1564 |
+
// Find new height from highest slide in view
|
1565 |
+
for (i = 0; i < activeSlides.length; i += 1) {
|
1566 |
+
if (typeof activeSlides[i] !== 'undefined') {
|
1567 |
+
var height = activeSlides[i].offsetHeight;
|
1568 |
+
newHeight = height > newHeight ? height : newHeight;
|
1569 |
+
}
|
1570 |
+
}
|
1571 |
+
|
1572 |
+
// Update Height
|
1573 |
+
if (newHeight) { swiper.$wrapperEl.css('height', (newHeight + "px")); }
|
1574 |
+
}
|
1575 |
+
|
1576 |
+
function updateSlidesOffset () {
|
1577 |
+
var swiper = this;
|
1578 |
+
var slides = swiper.slides;
|
1579 |
+
for (var i = 0; i < slides.length; i += 1) {
|
1580 |
+
slides[i].swiperSlideOffset = swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop;
|
1581 |
+
}
|
1582 |
+
}
|
1583 |
+
|
1584 |
+
function updateSlidesProgress (translate) {
|
1585 |
+
if ( translate === void 0 ) translate = (this && this.translate) || 0;
|
1586 |
+
|
1587 |
+
var swiper = this;
|
1588 |
+
var params = swiper.params;
|
1589 |
+
|
1590 |
+
var slides = swiper.slides;
|
1591 |
+
var rtl = swiper.rtlTranslate;
|
1592 |
+
|
1593 |
+
if (slides.length === 0) { return; }
|
1594 |
+
if (typeof slides[0].swiperSlideOffset === 'undefined') { swiper.updateSlidesOffset(); }
|
1595 |
+
|
1596 |
+
var offsetCenter = -translate;
|
1597 |
+
if (rtl) { offsetCenter = translate; }
|
1598 |
+
|
1599 |
+
// Visible Slides
|
1600 |
+
slides.removeClass(params.slideVisibleClass);
|
1601 |
+
|
1602 |
+
swiper.visibleSlidesIndexes = [];
|
1603 |
+
swiper.visibleSlides = [];
|
1604 |
+
|
1605 |
+
for (var i = 0; i < slides.length; i += 1) {
|
1606 |
+
var slide = slides[i];
|
1607 |
+
var slideProgress = (
|
1608 |
+
(offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0)) - slide.swiperSlideOffset
|
1609 |
+
) / (slide.swiperSlideSize + params.spaceBetween);
|
1610 |
+
if (params.watchSlidesVisibility || (params.centeredSlides && params.autoHeight)) {
|
1611 |
+
var slideBefore = -(offsetCenter - slide.swiperSlideOffset);
|
1612 |
+
var slideAfter = slideBefore + swiper.slidesSizesGrid[i];
|
1613 |
+
var isVisible = (slideBefore >= 0 && slideBefore < swiper.size - 1)
|
1614 |
+
|| (slideAfter > 1 && slideAfter <= swiper.size)
|
1615 |
+
|| (slideBefore <= 0 && slideAfter >= swiper.size);
|
1616 |
+
if (isVisible) {
|
1617 |
+
swiper.visibleSlides.push(slide);
|
1618 |
+
swiper.visibleSlidesIndexes.push(i);
|
1619 |
+
slides.eq(i).addClass(params.slideVisibleClass);
|
1620 |
+
}
|
1621 |
+
}
|
1622 |
+
slide.progress = rtl ? -slideProgress : slideProgress;
|
1623 |
+
}
|
1624 |
+
swiper.visibleSlides = $(swiper.visibleSlides);
|
1625 |
+
}
|
1626 |
+
|
1627 |
+
function updateProgress (translate) {
|
1628 |
+
var swiper = this;
|
1629 |
+
if (typeof translate === 'undefined') {
|
1630 |
+
var multiplier = swiper.rtlTranslate ? -1 : 1;
|
1631 |
+
// eslint-disable-next-line
|
1632 |
+
translate = (swiper && swiper.translate && (swiper.translate * multiplier)) || 0;
|
1633 |
+
}
|
1634 |
+
var params = swiper.params;
|
1635 |
+
var translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
|
1636 |
+
var progress = swiper.progress;
|
1637 |
+
var isBeginning = swiper.isBeginning;
|
1638 |
+
var isEnd = swiper.isEnd;
|
1639 |
+
var wasBeginning = isBeginning;
|
1640 |
+
var wasEnd = isEnd;
|
1641 |
+
if (translatesDiff === 0) {
|
1642 |
+
progress = 0;
|
1643 |
+
isBeginning = true;
|
1644 |
+
isEnd = true;
|
1645 |
+
} else {
|
1646 |
+
progress = (translate - swiper.minTranslate()) / (translatesDiff);
|
1647 |
+
isBeginning = progress <= 0;
|
1648 |
+
isEnd = progress >= 1;
|
1649 |
+
}
|
1650 |
+
Utils.extend(swiper, {
|
1651 |
+
progress: progress,
|
1652 |
+
isBeginning: isBeginning,
|
1653 |
+
isEnd: isEnd,
|
1654 |
+
});
|
1655 |
+
|
1656 |
+
if (params.watchSlidesProgress || params.watchSlidesVisibility || (params.centeredSlides && params.autoHeight)) { swiper.updateSlidesProgress(translate); }
|
1657 |
+
|
1658 |
+
if (isBeginning && !wasBeginning) {
|
1659 |
+
swiper.emit('reachBeginning toEdge');
|
1660 |
+
}
|
1661 |
+
if (isEnd && !wasEnd) {
|
1662 |
+
swiper.emit('reachEnd toEdge');
|
1663 |
+
}
|
1664 |
+
if ((wasBeginning && !isBeginning) || (wasEnd && !isEnd)) {
|
1665 |
+
swiper.emit('fromEdge');
|
1666 |
+
}
|
1667 |
+
|
1668 |
+
swiper.emit('progress', progress);
|
1669 |
+
}
|
1670 |
+
|
1671 |
+
function updateSlidesClasses () {
|
1672 |
+
var swiper = this;
|
1673 |
+
|
1674 |
+
var slides = swiper.slides;
|
1675 |
+
var params = swiper.params;
|
1676 |
+
var $wrapperEl = swiper.$wrapperEl;
|
1677 |
+
var activeIndex = swiper.activeIndex;
|
1678 |
+
var realIndex = swiper.realIndex;
|
1679 |
+
var isVirtual = swiper.virtual && params.virtual.enabled;
|
1680 |
+
|
1681 |
+
slides.removeClass(((params.slideActiveClass) + " " + (params.slideNextClass) + " " + (params.slidePrevClass) + " " + (params.slideDuplicateActiveClass) + " " + (params.slideDuplicateNextClass) + " " + (params.slideDuplicatePrevClass)));
|
1682 |
+
|
1683 |
+
var activeSlide;
|
1684 |
+
if (isVirtual) {
|
1685 |
+
activeSlide = swiper.$wrapperEl.find(("." + (params.slideClass) + "[data-swiper-slide-index=\"" + activeIndex + "\"]"));
|
1686 |
+
} else {
|
1687 |
+
activeSlide = slides.eq(activeIndex);
|
1688 |
+
}
|
1689 |
+
|
1690 |
+
// Active classes
|
1691 |
+
activeSlide.addClass(params.slideActiveClass);
|
1692 |
+
|
1693 |
+
if (params.loop) {
|
1694 |
+
// Duplicate to all looped slides
|
1695 |
+
if (activeSlide.hasClass(params.slideDuplicateClass)) {
|
1696 |
+
$wrapperEl
|
1697 |
+
.children(("." + (params.slideClass) + ":not(." + (params.slideDuplicateClass) + ")[data-swiper-slide-index=\"" + realIndex + "\"]"))
|
1698 |
+
.addClass(params.slideDuplicateActiveClass);
|
1699 |
+
} else {
|
1700 |
+
$wrapperEl
|
1701 |
+
.children(("." + (params.slideClass) + "." + (params.slideDuplicateClass) + "[data-swiper-slide-index=\"" + realIndex + "\"]"))
|
1702 |
+
.addClass(params.slideDuplicateActiveClass);
|
1703 |
+
}
|
1704 |
+
}
|
1705 |
+
// Next Slide
|
1706 |
+
var nextSlide = activeSlide.nextAll(("." + (params.slideClass))).eq(0).addClass(params.slideNextClass);
|
1707 |
+
if (params.loop && nextSlide.length === 0) {
|
1708 |
+
nextSlide = slides.eq(0);
|
1709 |
+
nextSlide.addClass(params.slideNextClass);
|
1710 |
+
}
|
1711 |
+
// Prev Slide
|
1712 |
+
var prevSlide = activeSlide.prevAll(("." + (params.slideClass))).eq(0).addClass(params.slidePrevClass);
|
1713 |
+
if (params.loop && prevSlide.length === 0) {
|
1714 |
+
prevSlide = slides.eq(-1);
|
1715 |
+
prevSlide.addClass(params.slidePrevClass);
|
1716 |
+
}
|
1717 |
+
if (params.loop) {
|
1718 |
+
// Duplicate to all looped slides
|
1719 |
+
if (nextSlide.hasClass(params.slideDuplicateClass)) {
|
1720 |
+
$wrapperEl
|
1721 |
+
.children(("." + (params.slideClass) + ":not(." + (params.slideDuplicateClass) + ")[data-swiper-slide-index=\"" + (nextSlide.attr('data-swiper-slide-index')) + "\"]"))
|
1722 |
+
.addClass(params.slideDuplicateNextClass);
|
1723 |
+
} else {
|
1724 |
+
$wrapperEl
|
1725 |
+
.children(("." + (params.slideClass) + "." + (params.slideDuplicateClass) + "[data-swiper-slide-index=\"" + (nextSlide.attr('data-swiper-slide-index')) + "\"]"))
|
1726 |
+
.addClass(params.slideDuplicateNextClass);
|
1727 |
+
}
|
1728 |
+
if (prevSlide.hasClass(params.slideDuplicateClass)) {
|
1729 |
+
$wrapperEl
|
1730 |
+
.children(("." + (params.slideClass) + ":not(." + (params.slideDuplicateClass) + ")[data-swiper-slide-index=\"" + (prevSlide.attr('data-swiper-slide-index')) + "\"]"))
|
1731 |
+
.addClass(params.slideDuplicatePrevClass);
|
1732 |
+
} else {
|
1733 |
+
$wrapperEl
|
1734 |
+
.children(("." + (params.slideClass) + "." + (params.slideDuplicateClass) + "[data-swiper-slide-index=\"" + (prevSlide.attr('data-swiper-slide-index')) + "\"]"))
|
1735 |
+
.addClass(params.slideDuplicatePrevClass);
|
1736 |
+
}
|
1737 |
+
}
|
1738 |
+
}
|
1739 |
+
|
1740 |
+
function updateActiveIndex (newActiveIndex) {
|
1741 |
+
var swiper = this;
|
1742 |
+
var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
|
1743 |
+
var slidesGrid = swiper.slidesGrid;
|
1744 |
+
var snapGrid = swiper.snapGrid;
|
1745 |
+
var params = swiper.params;
|
1746 |
+
var previousIndex = swiper.activeIndex;
|
1747 |
+
var previousRealIndex = swiper.realIndex;
|
1748 |
+
var previousSnapIndex = swiper.snapIndex;
|
1749 |
+
var activeIndex = newActiveIndex;
|
1750 |
+
var snapIndex;
|
1751 |
+
if (typeof activeIndex === 'undefined') {
|
1752 |
+
for (var i = 0; i < slidesGrid.length; i += 1) {
|
1753 |
+
if (typeof slidesGrid[i + 1] !== 'undefined') {
|
1754 |
+
if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - ((slidesGrid[i + 1] - slidesGrid[i]) / 2)) {
|
1755 |
+
activeIndex = i;
|
1756 |
+
} else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) {
|
1757 |
+
activeIndex = i + 1;
|
1758 |
+
}
|
1759 |
+
} else if (translate >= slidesGrid[i]) {
|
1760 |
+
activeIndex = i;
|
1761 |
+
}
|
1762 |
+
}
|
1763 |
+
// Normalize slideIndex
|
1764 |
+
if (params.normalizeSlideIndex) {
|
1765 |
+
if (activeIndex < 0 || typeof activeIndex === 'undefined') { activeIndex = 0; }
|
1766 |
+
}
|
1767 |
+
}
|
1768 |
+
if (snapGrid.indexOf(translate) >= 0) {
|
1769 |
+
snapIndex = snapGrid.indexOf(translate);
|
1770 |
+
} else {
|
1771 |
+
var skip = Math.min(params.slidesPerGroupSkip, activeIndex);
|
1772 |
+
snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);
|
1773 |
+
}
|
1774 |
+
if (snapIndex >= snapGrid.length) { snapIndex = snapGrid.length - 1; }
|
1775 |
+
if (activeIndex === previousIndex) {
|
1776 |
+
if (snapIndex !== previousSnapIndex) {
|
1777 |
+
swiper.snapIndex = snapIndex;
|
1778 |
+
swiper.emit('snapIndexChange');
|
1779 |
+
}
|
1780 |
+
return;
|
1781 |
+
}
|
1782 |
+
|
1783 |
+
// Get real index
|
1784 |
+
var realIndex = parseInt(swiper.slides.eq(activeIndex).attr('data-swiper-slide-index') || activeIndex, 10);
|
1785 |
+
|
1786 |
+
Utils.extend(swiper, {
|
1787 |
+
snapIndex: snapIndex,
|
1788 |
+
realIndex: realIndex,
|
1789 |
+
previousIndex: previousIndex,
|
1790 |
+
activeIndex: activeIndex,
|
1791 |
+
});
|
1792 |
+
swiper.emit('activeIndexChange');
|
1793 |
+
swiper.emit('snapIndexChange');
|
1794 |
+
if (previousRealIndex !== realIndex) {
|
1795 |
+
swiper.emit('realIndexChange');
|
1796 |
+
}
|
1797 |
+
if (swiper.initialized || swiper.runCallbacksOnInit) {
|
1798 |
+
swiper.emit('slideChange');
|
1799 |
+
}
|
1800 |
+
}
|
1801 |
+
|
1802 |
+
function updateClickedSlide (e) {
|
1803 |
+
var swiper = this;
|
1804 |
+
var params = swiper.params;
|
1805 |
+
var slide = $(e.target).closest(("." + (params.slideClass)))[0];
|
1806 |
+
var slideFound = false;
|
1807 |
+
if (slide) {
|
1808 |
+
for (var i = 0; i < swiper.slides.length; i += 1) {
|
1809 |
+
if (swiper.slides[i] === slide) { slideFound = true; }
|
1810 |
+
}
|
1811 |
+
}
|
1812 |
+
|
1813 |
+
if (slide && slideFound) {
|
1814 |
+
swiper.clickedSlide = slide;
|
1815 |
+
if (swiper.virtual && swiper.params.virtual.enabled) {
|
1816 |
+
swiper.clickedIndex = parseInt($(slide).attr('data-swiper-slide-index'), 10);
|
1817 |
+
} else {
|
1818 |
+
swiper.clickedIndex = $(slide).index();
|
1819 |
+
}
|
1820 |
+
} else {
|
1821 |
+
swiper.clickedSlide = undefined;
|
1822 |
+
swiper.clickedIndex = undefined;
|
1823 |
+
return;
|
1824 |
+
}
|
1825 |
+
if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) {
|
1826 |
+
swiper.slideToClickedSlide();
|
1827 |
+
}
|
1828 |
+
}
|
1829 |
+
|
1830 |
+
var update = {
|
1831 |
+
updateSize: updateSize,
|
1832 |
+
updateSlides: updateSlides,
|
1833 |
+
updateAutoHeight: updateAutoHeight,
|
1834 |
+
updateSlidesOffset: updateSlidesOffset,
|
1835 |
+
updateSlidesProgress: updateSlidesProgress,
|
1836 |
+
updateProgress: updateProgress,
|
1837 |
+
updateSlidesClasses: updateSlidesClasses,
|
1838 |
+
updateActiveIndex: updateActiveIndex,
|
1839 |
+
updateClickedSlide: updateClickedSlide,
|
1840 |
+
};
|
1841 |
+
|
1842 |
+
function getTranslate (axis) {
|
1843 |
+
if ( axis === void 0 ) axis = this.isHorizontal() ? 'x' : 'y';
|
1844 |
+
|
1845 |
+
var swiper = this;
|
1846 |
+
|
1847 |
+
var params = swiper.params;
|
1848 |
+
var rtl = swiper.rtlTranslate;
|
1849 |
+
var translate = swiper.translate;
|
1850 |
+
var $wrapperEl = swiper.$wrapperEl;
|
1851 |
+
|
1852 |
+
if (params.virtualTranslate) {
|
1853 |
+
return rtl ? -translate : translate;
|
1854 |
+
}
|
1855 |
+
if (params.cssMode) {
|
1856 |
+
return translate;
|
1857 |
+
}
|
1858 |
+
|
1859 |
+
var currentTranslate = Utils.getTranslate($wrapperEl[0], axis);
|
1860 |
+
if (rtl) { currentTranslate = -currentTranslate; }
|
1861 |
+
|
1862 |
+
return currentTranslate || 0;
|
1863 |
+
}
|
1864 |
+
|
1865 |
+
function setTranslate (translate, byController) {
|
1866 |
+
var swiper = this;
|
1867 |
+
var rtl = swiper.rtlTranslate;
|
1868 |
+
var params = swiper.params;
|
1869 |
+
var $wrapperEl = swiper.$wrapperEl;
|
1870 |
+
var wrapperEl = swiper.wrapperEl;
|
1871 |
+
var progress = swiper.progress;
|
1872 |
+
var x = 0;
|
1873 |
+
var y = 0;
|
1874 |
+
var z = 0;
|
1875 |
+
|
1876 |
+
if (swiper.isHorizontal()) {
|
1877 |
+
x = rtl ? -translate : translate;
|
1878 |
+
} else {
|
1879 |
+
y = translate;
|
1880 |
+
}
|
1881 |
+
|
1882 |
+
if (params.roundLengths) {
|
1883 |
+
x = Math.floor(x);
|
1884 |
+
y = Math.floor(y);
|
1885 |
+
}
|
1886 |
+
|
1887 |
+
if (params.cssMode) {
|
1888 |
+
wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y;
|
1889 |
+
} else if (!params.virtualTranslate) {
|
1890 |
+
$wrapperEl.transform(("translate3d(" + x + "px, " + y + "px, " + z + "px)"));
|
1891 |
+
}
|
1892 |
+
swiper.previousTranslate = swiper.translate;
|
1893 |
+
swiper.translate = swiper.isHorizontal() ? x : y;
|
1894 |
+
|
1895 |
+
// Check if we need to update progress
|
1896 |
+
var newProgress;
|
1897 |
+
var translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
|
1898 |
+
if (translatesDiff === 0) {
|
1899 |
+
newProgress = 0;
|
1900 |
+
} else {
|
1901 |
+
newProgress = (translate - swiper.minTranslate()) / (translatesDiff);
|
1902 |
+
}
|
1903 |
+
if (newProgress !== progress) {
|
1904 |
+
swiper.updateProgress(translate);
|
1905 |
+
}
|
1906 |
+
|
1907 |
+
swiper.emit('setTranslate', swiper.translate, byController);
|
1908 |
+
}
|
1909 |
+
|
1910 |
+
function minTranslate () {
|
1911 |
+
return (-this.snapGrid[0]);
|
1912 |
+
}
|
1913 |
+
|
1914 |
+
function maxTranslate () {
|
1915 |
+
return (-this.snapGrid[this.snapGrid.length - 1]);
|
1916 |
+
}
|
1917 |
+
|
1918 |
+
function translateTo (translate, speed, runCallbacks, translateBounds, internal) {
|
1919 |
+
var obj;
|
1920 |
+
|
1921 |
+
if ( translate === void 0 ) translate = 0;
|
1922 |
+
if ( speed === void 0 ) speed = this.params.speed;
|
1923 |
+
if ( runCallbacks === void 0 ) runCallbacks = true;
|
1924 |
+
if ( translateBounds === void 0 ) translateBounds = true;
|
1925 |
+
var swiper = this;
|
1926 |
+
|
1927 |
+
var params = swiper.params;
|
1928 |
+
var wrapperEl = swiper.wrapperEl;
|
1929 |
+
|
1930 |
+
if (swiper.animating && params.preventInteractionOnTransition) {
|
1931 |
+
return false;
|
1932 |
+
}
|
1933 |
+
|
1934 |
+
var minTranslate = swiper.minTranslate();
|
1935 |
+
var maxTranslate = swiper.maxTranslate();
|
1936 |
+
var newTranslate;
|
1937 |
+
if (translateBounds && translate > minTranslate) { newTranslate = minTranslate; }
|
1938 |
+
else if (translateBounds && translate < maxTranslate) { newTranslate = maxTranslate; }
|
1939 |
+
else { newTranslate = translate; }
|
1940 |
+
|
1941 |
+
// Update progress
|
1942 |
+
swiper.updateProgress(newTranslate);
|
1943 |
+
|
1944 |
+
if (params.cssMode) {
|
1945 |
+
var isH = swiper.isHorizontal();
|
1946 |
+
if (speed === 0) {
|
1947 |
+
wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;
|
1948 |
+
} else {
|
1949 |
+
// eslint-disable-next-line
|
1950 |
+
if (wrapperEl.scrollTo) {
|
1951 |
+
wrapperEl.scrollTo(( obj = {}, obj[isH ? 'left' : 'top'] = -newTranslate, obj.behavior = 'smooth', obj ));
|
1952 |
+
} else {
|
1953 |
+
wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;
|
1954 |
+
}
|
1955 |
+
}
|
1956 |
+
return true;
|
1957 |
+
}
|
1958 |
+
|
1959 |
+
if (speed === 0) {
|
1960 |
+
swiper.setTransition(0);
|
1961 |
+
swiper.setTranslate(newTranslate);
|
1962 |
+
if (runCallbacks) {
|
1963 |
+
swiper.emit('beforeTransitionStart', speed, internal);
|
1964 |
+
swiper.emit('transitionEnd');
|
1965 |
+
}
|
1966 |
+
} else {
|
1967 |
+
swiper.setTransition(speed);
|
1968 |
+
swiper.setTranslate(newTranslate);
|
1969 |
+
if (runCallbacks) {
|
1970 |
+
swiper.emit('beforeTransitionStart', speed, internal);
|
1971 |
+
swiper.emit('transitionStart');
|
1972 |
+
}
|
1973 |
+
if (!swiper.animating) {
|
1974 |
+
swiper.animating = true;
|
1975 |
+
if (!swiper.onTranslateToWrapperTransitionEnd) {
|
1976 |
+
swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) {
|
1977 |
+
if (!swiper || swiper.destroyed) { return; }
|
1978 |
+
if (e.target !== this) { return; }
|
1979 |
+
swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
|
1980 |
+
swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd);
|
1981 |
+
swiper.onTranslateToWrapperTransitionEnd = null;
|
1982 |
+
delete swiper.onTranslateToWrapperTransitionEnd;
|
1983 |
+
if (runCallbacks) {
|
1984 |
+
swiper.emit('transitionEnd');
|
1985 |
+
}
|
1986 |
+
};
|
1987 |
+
}
|
1988 |
+
swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
|
1989 |
+
swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd);
|
1990 |
+
}
|
1991 |
+
}
|
1992 |
+
|
1993 |
+
return true;
|
1994 |
+
}
|
1995 |
+
|
1996 |
+
var translate = {
|
1997 |
+
getTranslate: getTranslate,
|
1998 |
+
setTranslate: setTranslate,
|
1999 |
+
minTranslate: minTranslate,
|
2000 |
+
maxTranslate: maxTranslate,
|
2001 |
+
translateTo: translateTo,
|
2002 |
+
};
|
2003 |
+
|
2004 |
+
function setTransition (duration, byController) {
|
2005 |
+
var swiper = this;
|
2006 |
+
|
2007 |
+
if (!swiper.params.cssMode) {
|
2008 |
+
swiper.$wrapperEl.transition(duration);
|
2009 |
+
}
|
2010 |
+
|
2011 |
+
swiper.emit('setTransition', duration, byController);
|
2012 |
+
}
|
2013 |
+
|
2014 |
+
function transitionStart (runCallbacks, direction) {
|
2015 |
+
if ( runCallbacks === void 0 ) runCallbacks = true;
|
2016 |
+
|
2017 |
+
var swiper = this;
|
2018 |
+
var activeIndex = swiper.activeIndex;
|
2019 |
+
var params = swiper.params;
|
2020 |
+
var previousIndex = swiper.previousIndex;
|
2021 |
+
if (params.cssMode) { return; }
|
2022 |
+
if (params.autoHeight) {
|
2023 |
+
swiper.updateAutoHeight();
|
2024 |
+
}
|
2025 |
+
|
2026 |
+
var dir = direction;
|
2027 |
+
if (!dir) {
|
2028 |
+
if (activeIndex > previousIndex) { dir = 'next'; }
|
2029 |
+
else if (activeIndex < previousIndex) { dir = 'prev'; }
|
2030 |
+
else { dir = 'reset'; }
|
2031 |
+
}
|
2032 |
+
|
2033 |
+
swiper.emit('transitionStart');
|
2034 |
+
|
2035 |
+
if (runCallbacks && activeIndex !== previousIndex) {
|
2036 |
+
if (dir === 'reset') {
|
2037 |
+
swiper.emit('slideResetTransitionStart');
|
2038 |
+
return;
|
2039 |
+
}
|
2040 |
+
swiper.emit('slideChangeTransitionStart');
|
2041 |
+
if (dir === 'next') {
|
2042 |
+
swiper.emit('slideNextTransitionStart');
|
2043 |
+
} else {
|
2044 |
+
swiper.emit('slidePrevTransitionStart');
|
2045 |
+
}
|
2046 |
+
}
|
2047 |
+
}
|
2048 |
+
|
2049 |
+
function transitionEnd$1 (runCallbacks, direction) {
|
2050 |
+
if ( runCallbacks === void 0 ) runCallbacks = true;
|
2051 |
+
|
2052 |
+
var swiper = this;
|
2053 |
+
var activeIndex = swiper.activeIndex;
|
2054 |
+
var previousIndex = swiper.previousIndex;
|
2055 |
+
var params = swiper.params;
|
2056 |
+
swiper.animating = false;
|
2057 |
+
if (params.cssMode) { return; }
|
2058 |
+
swiper.setTransition(0);
|
2059 |
+
|
2060 |
+
var dir = direction;
|
2061 |
+
if (!dir) {
|
2062 |
+
if (activeIndex > previousIndex) { dir = 'next'; }
|
2063 |
+
else if (activeIndex < previousIndex) { dir = 'prev'; }
|
2064 |
+
else { dir = 'reset'; }
|
2065 |
+
}
|
2066 |
+
|
2067 |
+
swiper.emit('transitionEnd');
|
2068 |
+
|
2069 |
+
if (runCallbacks && activeIndex !== previousIndex) {
|
2070 |
+
if (dir === 'reset') {
|
2071 |
+
swiper.emit('slideResetTransitionEnd');
|
2072 |
+
return;
|
2073 |
+
}
|
2074 |
+
swiper.emit('slideChangeTransitionEnd');
|
2075 |
+
if (dir === 'next') {
|
2076 |
+
swiper.emit('slideNextTransitionEnd');
|
2077 |
+
} else {
|
2078 |
+
swiper.emit('slidePrevTransitionEnd');
|
2079 |
+
}
|
2080 |
+
}
|
2081 |
+
}
|
2082 |
+
|
2083 |
+
var transition$1 = {
|
2084 |
+
setTransition: setTransition,
|
2085 |
+
transitionStart: transitionStart,
|
2086 |
+
transitionEnd: transitionEnd$1,
|
2087 |
+
};
|
2088 |
+
|
2089 |
+
function slideTo (index, speed, runCallbacks, internal) {
|
2090 |
+
var obj;
|
2091 |
+
|
2092 |
+
if ( index === void 0 ) index = 0;
|
2093 |
+
if ( speed === void 0 ) speed = this.params.speed;
|
2094 |
+
if ( runCallbacks === void 0 ) runCallbacks = true;
|
2095 |
+
var swiper = this;
|
2096 |
+
var slideIndex = index;
|
2097 |
+
if (slideIndex < 0) { slideIndex = 0; }
|
2098 |
+
|
2099 |
+
var params = swiper.params;
|
2100 |
+
var snapGrid = swiper.snapGrid;
|
2101 |
+
var slidesGrid = swiper.slidesGrid;
|
2102 |
+
var previousIndex = swiper.previousIndex;
|
2103 |
+
var activeIndex = swiper.activeIndex;
|
2104 |
+
var rtl = swiper.rtlTranslate;
|
2105 |
+
var wrapperEl = swiper.wrapperEl;
|
2106 |
+
if (swiper.animating && params.preventInteractionOnTransition) {
|
2107 |
+
return false;
|
2108 |
+
}
|
2109 |
+
|
2110 |
+
var skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
|
2111 |
+
var snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
|
2112 |
+
if (snapIndex >= snapGrid.length) { snapIndex = snapGrid.length - 1; }
|
2113 |
+
|
2114 |
+
if ((activeIndex || params.initialSlide || 0) === (previousIndex || 0) && runCallbacks) {
|
2115 |
+
swiper.emit('beforeSlideChangeStart');
|
2116 |
+
}
|
2117 |
+
|
2118 |
+
var translate = -snapGrid[snapIndex];
|
2119 |
+
|
2120 |
+
// Update progress
|
2121 |
+
swiper.updateProgress(translate);
|
2122 |
+
|
2123 |
+
// Normalize slideIndex
|
2124 |
+
if (params.normalizeSlideIndex) {
|
2125 |
+
for (var i = 0; i < slidesGrid.length; i += 1) {
|
2126 |
+
if (-Math.floor(translate * 100) >= Math.floor(slidesGrid[i] * 100)) {
|
2127 |
+
slideIndex = i;
|
2128 |
+
}
|
2129 |
+
}
|
2130 |
+
}
|
2131 |
+
// Directions locks
|
2132 |
+
if (swiper.initialized && slideIndex !== activeIndex) {
|
2133 |
+
if (!swiper.allowSlideNext && translate < swiper.translate && translate < swiper.minTranslate()) {
|
2134 |
+
return false;
|
2135 |
+
}
|
2136 |
+
if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) {
|
2137 |
+
if ((activeIndex || 0) !== slideIndex) { return false; }
|
2138 |
+
}
|
2139 |
+
}
|
2140 |
+
|
2141 |
+
var direction;
|
2142 |
+
if (slideIndex > activeIndex) { direction = 'next'; }
|
2143 |
+
else if (slideIndex < activeIndex) { direction = 'prev'; }
|
2144 |
+
else { direction = 'reset'; }
|
2145 |
+
|
2146 |
+
|
2147 |
+
// Update Index
|
2148 |
+
if ((rtl && -translate === swiper.translate) || (!rtl && translate === swiper.translate)) {
|
2149 |
+
swiper.updateActiveIndex(slideIndex);
|
2150 |
+
// Update Height
|
2151 |
+
if (params.autoHeight) {
|
2152 |
+
swiper.updateAutoHeight();
|
2153 |
+
}
|
2154 |
+
swiper.updateSlidesClasses();
|
2155 |
+
if (params.effect !== 'slide') {
|
2156 |
+
swiper.setTranslate(translate);
|
2157 |
+
}
|
2158 |
+
if (direction !== 'reset') {
|
2159 |
+
swiper.transitionStart(runCallbacks, direction);
|
2160 |
+
swiper.transitionEnd(runCallbacks, direction);
|
2161 |
+
}
|
2162 |
+
return false;
|
2163 |
+
}
|
2164 |
+
if (params.cssMode) {
|
2165 |
+
var isH = swiper.isHorizontal();
|
2166 |
+
if (speed === 0) {
|
2167 |
+
wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -translate;
|
2168 |
+
} else {
|
2169 |
+
// eslint-disable-next-line
|
2170 |
+
if (wrapperEl.scrollTo) {
|
2171 |
+
wrapperEl.scrollTo(( obj = {}, obj[isH ? 'left' : 'top'] = -translate, obj.behavior = 'smooth', obj ));
|
2172 |
+
} else {
|
2173 |
+
wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -translate;
|
2174 |
+
}
|
2175 |
+
}
|
2176 |
+
return true;
|
2177 |
+
}
|
2178 |
+
|
2179 |
+
if (speed === 0) {
|
2180 |
+
swiper.setTransition(0);
|
2181 |
+
swiper.setTranslate(translate);
|
2182 |
+
swiper.updateActiveIndex(slideIndex);
|
2183 |
+
swiper.updateSlidesClasses();
|
2184 |
+
swiper.emit('beforeTransitionStart', speed, internal);
|
2185 |
+
swiper.transitionStart(runCallbacks, direction);
|
2186 |
+
swiper.transitionEnd(runCallbacks, direction);
|
2187 |
+
} else {
|
2188 |
+
swiper.setTransition(speed);
|
2189 |
+
swiper.setTranslate(translate);
|
2190 |
+
swiper.updateActiveIndex(slideIndex);
|
2191 |
+
swiper.updateSlidesClasses();
|
2192 |
+
swiper.emit('beforeTransitionStart', speed, internal);
|
2193 |
+
swiper.transitionStart(runCallbacks, direction);
|
2194 |
+
if (!swiper.animating) {
|
2195 |
+
swiper.animating = true;
|
2196 |
+
if (!swiper.onSlideToWrapperTransitionEnd) {
|
2197 |
+
swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) {
|
2198 |
+
if (!swiper || swiper.destroyed) { return; }
|
2199 |
+
if (e.target !== this) { return; }
|
2200 |
+
swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
|
2201 |
+
swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);
|
2202 |
+
swiper.onSlideToWrapperTransitionEnd = null;
|
2203 |
+
delete swiper.onSlideToWrapperTransitionEnd;
|
2204 |
+
swiper.transitionEnd(runCallbacks, direction);
|
2205 |
+
};
|
2206 |
+
}
|
2207 |
+
swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
|
2208 |
+
swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);
|
2209 |
+
}
|
2210 |
+
}
|
2211 |
+
|
2212 |
+
return true;
|
2213 |
+
}
|
2214 |
+
|
2215 |
+
function slideToLoop (index, speed, runCallbacks, internal) {
|
2216 |
+
if ( index === void 0 ) index = 0;
|
2217 |
+
if ( speed === void 0 ) speed = this.params.speed;
|
2218 |
+
if ( runCallbacks === void 0 ) runCallbacks = true;
|
2219 |
+
|
2220 |
+
var swiper = this;
|
2221 |
+
var newIndex = index;
|
2222 |
+
if (swiper.params.loop) {
|
2223 |
+
newIndex += swiper.loopedSlides;
|
2224 |
+
}
|
2225 |
+
|
2226 |
+
return swiper.slideTo(newIndex, speed, runCallbacks, internal);
|
2227 |
+
}
|
2228 |
+
|
2229 |
+
/* eslint no-unused-vars: "off" */
|
2230 |
+
function slideNext (speed, runCallbacks, internal) {
|
2231 |
+
if ( speed === void 0 ) speed = this.params.speed;
|
2232 |
+
if ( runCallbacks === void 0 ) runCallbacks = true;
|
2233 |
+
|
2234 |
+
var swiper = this;
|
2235 |
+
var params = swiper.params;
|
2236 |
+
var animating = swiper.animating;
|
2237 |
+
var increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup;
|
2238 |
+
if (params.loop) {
|
2239 |
+
if (animating) { return false; }
|
2240 |
+
swiper.loopFix();
|
2241 |
+
// eslint-disable-next-line
|
2242 |
+
swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
|
2243 |
+
}
|
2244 |
+
return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);
|
2245 |
+
}
|
2246 |
+
|
2247 |
+
/* eslint no-unused-vars: "off" */
|
2248 |
+
function slidePrev (speed, runCallbacks, internal) {
|
2249 |
+
if ( speed === void 0 ) speed = this.params.speed;
|
2250 |
+
if ( runCallbacks === void 0 ) runCallbacks = true;
|
2251 |
+
|
2252 |
+
var swiper = this;
|
2253 |
+
var params = swiper.params;
|
2254 |
+
var animating = swiper.animating;
|
2255 |
+
var snapGrid = swiper.snapGrid;
|
2256 |
+
var slidesGrid = swiper.slidesGrid;
|
2257 |
+
var rtlTranslate = swiper.rtlTranslate;
|
2258 |
+
|
2259 |
+
if (params.loop) {
|
2260 |
+
if (animating) { return false; }
|
2261 |
+
swiper.loopFix();
|
2262 |
+
// eslint-disable-next-line
|
2263 |
+
swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
|
2264 |
+
}
|
2265 |
+
var translate = rtlTranslate ? swiper.translate : -swiper.translate;
|
2266 |
+
function normalize(val) {
|
2267 |
+
if (val < 0) { return -Math.floor(Math.abs(val)); }
|
2268 |
+
return Math.floor(val);
|
2269 |
+
}
|
2270 |
+
var normalizedTranslate = normalize(translate);
|
2271 |
+
var normalizedSnapGrid = snapGrid.map(function (val) { return normalize(val); });
|
2272 |
+
var normalizedSlidesGrid = slidesGrid.map(function (val) { return normalize(val); });
|
2273 |
+
|
2274 |
+
var currentSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate)];
|
2275 |
+
var prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
|
2276 |
+
if (typeof prevSnap === 'undefined' && params.cssMode) {
|
2277 |
+
snapGrid.forEach(function (snap) {
|
2278 |
+
if (!prevSnap && normalizedTranslate >= snap) { prevSnap = snap; }
|
2279 |
+
});
|
2280 |
+
}
|
2281 |
+
var prevIndex;
|
2282 |
+
if (typeof prevSnap !== 'undefined') {
|
2283 |
+
prevIndex = slidesGrid.indexOf(prevSnap);
|
2284 |
+
if (prevIndex < 0) { prevIndex = swiper.activeIndex - 1; }
|
2285 |
+
}
|
2286 |
+
return swiper.slideTo(prevIndex, speed, runCallbacks, internal);
|
2287 |
+
}
|
2288 |
+
|
2289 |
+
/* eslint no-unused-vars: "off" */
|
2290 |
+
function slideReset (speed, runCallbacks, internal) {
|
2291 |
+
if ( speed === void 0 ) speed = this.params.speed;
|
2292 |
+
if ( runCallbacks === void 0 ) runCallbacks = true;
|
2293 |
+
|
2294 |
+
var swiper = this;
|
2295 |
+
return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
|
2296 |
+
}
|
2297 |
+
|
2298 |
+
/* eslint no-unused-vars: "off" */
|
2299 |
+
function slideToClosest (speed, runCallbacks, internal, threshold) {
|
2300 |
+
if ( speed === void 0 ) speed = this.params.speed;
|
2301 |
+
if ( runCallbacks === void 0 ) runCallbacks = true;
|
2302 |
+
if ( threshold === void 0 ) threshold = 0.5;
|
2303 |
+
|
2304 |
+
var swiper = this;
|
2305 |
+
var index = swiper.activeIndex;
|
2306 |
+
var skip = Math.min(swiper.params.slidesPerGroupSkip, index);
|
2307 |
+
var snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
|
2308 |
+
|
2309 |
+
var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
|
2310 |
+
|
2311 |
+
if (translate >= swiper.snapGrid[snapIndex]) {
|
2312 |
+
// The current translate is on or after the current snap index, so the choice
|
2313 |
+
// is between the current index and the one after it.
|
2314 |
+
var currentSnap = swiper.snapGrid[snapIndex];
|
2315 |
+
var nextSnap = swiper.snapGrid[snapIndex + 1];
|
2316 |
+
if ((translate - currentSnap) > (nextSnap - currentSnap) * threshold) {
|
2317 |
+
index += swiper.params.slidesPerGroup;
|
2318 |
+
}
|
2319 |
+
} else {
|
2320 |
+
// The current translate is before the current snap index, so the choice
|
2321 |
+
// is between the current index and the one before it.
|
2322 |
+
var prevSnap = swiper.snapGrid[snapIndex - 1];
|
2323 |
+
var currentSnap$1 = swiper.snapGrid[snapIndex];
|
2324 |
+
if ((translate - prevSnap) <= (currentSnap$1 - prevSnap) * threshold) {
|
2325 |
+
index -= swiper.params.slidesPerGroup;
|
2326 |
+
}
|
2327 |
+
}
|
2328 |
+
index = Math.max(index, 0);
|
2329 |
+
index = Math.min(index, swiper.slidesGrid.length - 1);
|
2330 |
+
|
2331 |
+
return swiper.slideTo(index, speed, runCallbacks, internal);
|
2332 |
+
}
|
2333 |
+
|
2334 |
+
function slideToClickedSlide () {
|
2335 |
+
var swiper = this;
|
2336 |
+
var params = swiper.params;
|
2337 |
+
var $wrapperEl = swiper.$wrapperEl;
|
2338 |
+
|
2339 |
+
var slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;
|
2340 |
+
var slideToIndex = swiper.clickedIndex;
|
2341 |
+
var realIndex;
|
2342 |
+
if (params.loop) {
|
2343 |
+
if (swiper.animating) { return; }
|
2344 |
+
realIndex = parseInt($(swiper.clickedSlide).attr('data-swiper-slide-index'), 10);
|
2345 |
+
if (params.centeredSlides) {
|
2346 |
+
if (
|
2347 |
+
(slideToIndex < swiper.loopedSlides - (slidesPerView / 2))
|
2348 |
+
|| (slideToIndex > (swiper.slides.length - swiper.loopedSlides) + (slidesPerView / 2))
|
2349 |
+
) {
|
2350 |
+
swiper.loopFix();
|
2351 |
+
slideToIndex = $wrapperEl
|
2352 |
+
.children(("." + (params.slideClass) + "[data-swiper-slide-index=\"" + realIndex + "\"]:not(." + (params.slideDuplicateClass) + ")"))
|
2353 |
+
.eq(0)
|
2354 |
+
.index();
|
2355 |
+
|
2356 |
+
Utils.nextTick(function () {
|
2357 |
+
swiper.slideTo(slideToIndex);
|
2358 |
+
});
|
2359 |
+
} else {
|
2360 |
+
swiper.slideTo(slideToIndex);
|
2361 |
+
}
|
2362 |
+
} else if (slideToIndex > swiper.slides.length - slidesPerView) {
|
2363 |
+
swiper.loopFix();
|
2364 |
+
slideToIndex = $wrapperEl
|
2365 |
+
.children(("." + (params.slideClass) + "[data-swiper-slide-index=\"" + realIndex + "\"]:not(." + (params.slideDuplicateClass) + ")"))
|
2366 |
+
.eq(0)
|
2367 |
+
.index();
|
2368 |
+
|
2369 |
+
Utils.nextTick(function () {
|
2370 |
+
swiper.slideTo(slideToIndex);
|
2371 |
+
});
|
2372 |
+
} else {
|
2373 |
+
swiper.slideTo(slideToIndex);
|
2374 |
+
}
|
2375 |
+
} else {
|
2376 |
+
swiper.slideTo(slideToIndex);
|
2377 |
+
}
|
2378 |
+
}
|
2379 |
+
|
2380 |
+
var slide = {
|
2381 |
+
slideTo: slideTo,
|
2382 |
+
slideToLoop: slideToLoop,
|
2383 |
+
slideNext: slideNext,
|
2384 |
+
slidePrev: slidePrev,
|
2385 |
+
slideReset: slideReset,
|
2386 |
+
slideToClosest: slideToClosest,
|
2387 |
+
slideToClickedSlide: slideToClickedSlide,
|
2388 |
+
};
|
2389 |
+
|
2390 |
+
function loopCreate () {
|
2391 |
+
var swiper = this;
|
2392 |
+
var params = swiper.params;
|
2393 |
+
var $wrapperEl = swiper.$wrapperEl;
|
2394 |
+
// Remove duplicated slides
|
2395 |
+
$wrapperEl.children(("." + (params.slideClass) + "." + (params.slideDuplicateClass))).remove();
|
2396 |
+
|
2397 |
+
var slides = $wrapperEl.children(("." + (params.slideClass)));
|
2398 |
+
|
2399 |
+
if (params.loopFillGroupWithBlank) {
|
2400 |
+
var blankSlidesNum = params.slidesPerGroup - (slides.length % params.slidesPerGroup);
|
2401 |
+
if (blankSlidesNum !== params.slidesPerGroup) {
|
2402 |
+
for (var i = 0; i < blankSlidesNum; i += 1) {
|
2403 |
+
var blankNode = $(doc.createElement('div')).addClass(((params.slideClass) + " " + (params.slideBlankClass)));
|
2404 |
+
$wrapperEl.append(blankNode);
|
2405 |
+
}
|
2406 |
+
slides = $wrapperEl.children(("." + (params.slideClass)));
|
2407 |
+
}
|
2408 |
+
}
|
2409 |
+
|
2410 |
+
if (params.slidesPerView === 'auto' && !params.loopedSlides) { params.loopedSlides = slides.length; }
|
2411 |
+
|
2412 |
+
swiper.loopedSlides = Math.ceil(parseFloat(params.loopedSlides || params.slidesPerView, 10));
|
2413 |
+
swiper.loopedSlides += params.loopAdditionalSlides;
|
2414 |
+
if (swiper.loopedSlides > slides.length) {
|
2415 |
+
swiper.loopedSlides = slides.length;
|
2416 |
+
}
|
2417 |
+
|
2418 |
+
var prependSlides = [];
|
2419 |
+
var appendSlides = [];
|
2420 |
+
slides.each(function (index, el) {
|
2421 |
+
var slide = $(el);
|
2422 |
+
if (index < swiper.loopedSlides) { appendSlides.push(el); }
|
2423 |
+
if (index < slides.length && index >= slides.length - swiper.loopedSlides) { prependSlides.push(el); }
|
2424 |
+
slide.attr('data-swiper-slide-index', index);
|
2425 |
+
});
|
2426 |
+
for (var i$1 = 0; i$1 < appendSlides.length; i$1 += 1) {
|
2427 |
+
$wrapperEl.append($(appendSlides[i$1].cloneNode(true)).addClass(params.slideDuplicateClass));
|
2428 |
+
}
|
2429 |
+
for (var i$2 = prependSlides.length - 1; i$2 >= 0; i$2 -= 1) {
|
2430 |
+
$wrapperEl.prepend($(prependSlides[i$2].cloneNode(true)).addClass(params.slideDuplicateClass));
|
2431 |
+
}
|
2432 |
+
}
|
2433 |
+
|
2434 |
+
function loopFix () {
|
2435 |
+
var swiper = this;
|
2436 |
+
|
2437 |
+
swiper.emit('beforeLoopFix');
|
2438 |
+
|
2439 |
+
var activeIndex = swiper.activeIndex;
|
2440 |
+
var slides = swiper.slides;
|
2441 |
+
var loopedSlides = swiper.loopedSlides;
|
2442 |
+
var allowSlidePrev = swiper.allowSlidePrev;
|
2443 |
+
var allowSlideNext = swiper.allowSlideNext;
|
2444 |
+
var snapGrid = swiper.snapGrid;
|
2445 |
+
var rtl = swiper.rtlTranslate;
|
2446 |
+
var newIndex;
|
2447 |
+
swiper.allowSlidePrev = true;
|
2448 |
+
swiper.allowSlideNext = true;
|
2449 |
+
|
2450 |
+
var snapTranslate = -snapGrid[activeIndex];
|
2451 |
+
var diff = snapTranslate - swiper.getTranslate();
|
2452 |
+
|
2453 |
+
// Fix For Negative Oversliding
|
2454 |
+
if (activeIndex < loopedSlides) {
|
2455 |
+
newIndex = (slides.length - (loopedSlides * 3)) + activeIndex;
|
2456 |
+
newIndex += loopedSlides;
|
2457 |
+
var slideChanged = swiper.slideTo(newIndex, 0, false, true);
|
2458 |
+
if (slideChanged && diff !== 0) {
|
2459 |
+
swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
|
2460 |
+
}
|
2461 |
+
} else if (activeIndex >= slides.length - loopedSlides) {
|
2462 |
+
// Fix For Positive Oversliding
|
2463 |
+
newIndex = -slides.length + activeIndex + loopedSlides;
|
2464 |
+
newIndex += loopedSlides;
|
2465 |
+
var slideChanged$1 = swiper.slideTo(newIndex, 0, false, true);
|
2466 |
+
if (slideChanged$1 && diff !== 0) {
|
2467 |
+
swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
|
2468 |
+
}
|
2469 |
+
}
|
2470 |
+
swiper.allowSlidePrev = allowSlidePrev;
|
2471 |
+
swiper.allowSlideNext = allowSlideNext;
|
2472 |
+
|
2473 |
+
swiper.emit('loopFix');
|
2474 |
+
}
|
2475 |
+
|
2476 |
+
function loopDestroy () {
|
2477 |
+
var swiper = this;
|
2478 |
+
var $wrapperEl = swiper.$wrapperEl;
|
2479 |
+
var params = swiper.params;
|
2480 |
+
var slides = swiper.slides;
|
2481 |
+
$wrapperEl.children(("." + (params.slideClass) + "." + (params.slideDuplicateClass) + ",." + (params.slideClass) + "." + (params.slideBlankClass))).remove();
|
2482 |
+
slides.removeAttr('data-swiper-slide-index');
|
2483 |
+
}
|
2484 |
+
|
2485 |
+
var loop = {
|
2486 |
+
loopCreate: loopCreate,
|
2487 |
+
loopFix: loopFix,
|
2488 |
+
loopDestroy: loopDestroy,
|
2489 |
+
};
|
2490 |
+
|
2491 |
+
function setGrabCursor (moving) {
|
2492 |
+
var swiper = this;
|
2493 |
+
if (Support.touch || !swiper.params.simulateTouch || (swiper.params.watchOverflow && swiper.isLocked) || swiper.params.cssMode) { return; }
|
2494 |
+
var el = swiper.el;
|
2495 |
+
el.style.cursor = 'move';
|
2496 |
+
el.style.cursor = moving ? '-webkit-grabbing' : '-webkit-grab';
|
2497 |
+
el.style.cursor = moving ? '-moz-grabbin' : '-moz-grab';
|
2498 |
+
el.style.cursor = moving ? 'grabbing' : 'grab';
|
2499 |
+
}
|
2500 |
+
|
2501 |
+
function unsetGrabCursor () {
|
2502 |
+
var swiper = this;
|
2503 |
+
if (Support.touch || (swiper.params.watchOverflow && swiper.isLocked) || swiper.params.cssMode) { return; }
|
2504 |
+
swiper.el.style.cursor = '';
|
2505 |
+
}
|
2506 |
+
|
2507 |
+
var grabCursor = {
|
2508 |
+
setGrabCursor: setGrabCursor,
|
2509 |
+
unsetGrabCursor: unsetGrabCursor,
|
2510 |
+
};
|
2511 |
+
|
2512 |
+
function appendSlide (slides) {
|
2513 |
+
var swiper = this;
|
2514 |
+
var $wrapperEl = swiper.$wrapperEl;
|
2515 |
+
var params = swiper.params;
|
2516 |
+
if (params.loop) {
|
2517 |
+
swiper.loopDestroy();
|
2518 |
+
}
|
2519 |
+
if (typeof slides === 'object' && 'length' in slides) {
|
2520 |
+
for (var i = 0; i < slides.length; i += 1) {
|
2521 |
+
if (slides[i]) { $wrapperEl.append(slides[i]); }
|
2522 |
+
}
|
2523 |
+
} else {
|
2524 |
+
$wrapperEl.append(slides);
|
2525 |
+
}
|
2526 |
+
if (params.loop) {
|
2527 |
+
swiper.loopCreate();
|
2528 |
+
}
|
2529 |
+
if (!(params.observer && Support.observer)) {
|
2530 |
+
swiper.update();
|
2531 |
+
}
|
2532 |
+
}
|
2533 |
+
|
2534 |
+
function prependSlide (slides) {
|
2535 |
+
var swiper = this;
|
2536 |
+
var params = swiper.params;
|
2537 |
+
var $wrapperEl = swiper.$wrapperEl;
|
2538 |
+
var activeIndex = swiper.activeIndex;
|
2539 |
+
|
2540 |
+
if (params.loop) {
|
2541 |
+
swiper.loopDestroy();
|
2542 |
+
}
|
2543 |
+
var newActiveIndex = activeIndex + 1;
|
2544 |
+
if (typeof slides === 'object' && 'length' in slides) {
|
2545 |
+
for (var i = 0; i < slides.length; i += 1) {
|
2546 |
+
if (slides[i]) { $wrapperEl.prepend(slides[i]); }
|
2547 |
+
}
|
2548 |
+
newActiveIndex = activeIndex + slides.length;
|
2549 |
+
} else {
|
2550 |
+
$wrapperEl.prepend(slides);
|
2551 |
+
}
|
2552 |
+
if (params.loop) {
|
2553 |
+
swiper.loopCreate();
|
2554 |
+
}
|
2555 |
+
if (!(params.observer && Support.observer)) {
|
2556 |
+
swiper.update();
|
2557 |
+
}
|
2558 |
+
swiper.slideTo(newActiveIndex, 0, false);
|
2559 |
+
}
|
2560 |
+
|
2561 |
+
function addSlide (index, slides) {
|
2562 |
+
var swiper = this;
|
2563 |
+
var $wrapperEl = swiper.$wrapperEl;
|
2564 |
+
var params = swiper.params;
|
2565 |
+
var activeIndex = swiper.activeIndex;
|
2566 |
+
var activeIndexBuffer = activeIndex;
|
2567 |
+
if (params.loop) {
|
2568 |
+
activeIndexBuffer -= swiper.loopedSlides;
|
2569 |
+
swiper.loopDestroy();
|
2570 |
+
swiper.slides = $wrapperEl.children(("." + (params.slideClass)));
|
2571 |
+
}
|
2572 |
+
var baseLength = swiper.slides.length;
|
2573 |
+
if (index <= 0) {
|
2574 |
+
swiper.prependSlide(slides);
|
2575 |
+
return;
|
2576 |
+
}
|
2577 |
+
if (index >= baseLength) {
|
2578 |
+
swiper.appendSlide(slides);
|
2579 |
+
return;
|
2580 |
+
}
|
2581 |
+
var newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + 1 : activeIndexBuffer;
|
2582 |
+
|
2583 |
+
var slidesBuffer = [];
|
2584 |
+
for (var i = baseLength - 1; i >= index; i -= 1) {
|
2585 |
+
var currentSlide = swiper.slides.eq(i);
|
2586 |
+
currentSlide.remove();
|
2587 |
+
slidesBuffer.unshift(currentSlide);
|
2588 |
+
}
|
2589 |
+
|
2590 |
+
if (typeof slides === 'object' && 'length' in slides) {
|
2591 |
+
for (var i$1 = 0; i$1 < slides.length; i$1 += 1) {
|
2592 |
+
if (slides[i$1]) { $wrapperEl.append(slides[i$1]); }
|
2593 |
+
}
|
2594 |
+
newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + slides.length : activeIndexBuffer;
|
2595 |
+
} else {
|
2596 |
+
$wrapperEl.append(slides);
|
2597 |
+
}
|
2598 |
+
|
2599 |
+
for (var i$2 = 0; i$2 < slidesBuffer.length; i$2 += 1) {
|
2600 |
+
$wrapperEl.append(slidesBuffer[i$2]);
|
2601 |
+
}
|
2602 |
+
|
2603 |
+
if (params.loop) {
|
2604 |
+
swiper.loopCreate();
|
2605 |
+
}
|
2606 |
+
if (!(params.observer && Support.observer)) {
|
2607 |
+
swiper.update();
|
2608 |
+
}
|
2609 |
+
if (params.loop) {
|
2610 |
+
swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);
|
2611 |
+
} else {
|
2612 |
+
swiper.slideTo(newActiveIndex, 0, false);
|
2613 |
+
}
|
2614 |
+
}
|
2615 |
+
|
2616 |
+
function removeSlide (slidesIndexes) {
|
2617 |
+
var swiper = this;
|
2618 |
+
var params = swiper.params;
|
2619 |
+
var $wrapperEl = swiper.$wrapperEl;
|
2620 |
+
var activeIndex = swiper.activeIndex;
|
2621 |
+
|
2622 |
+
var activeIndexBuffer = activeIndex;
|
2623 |
+
if (params.loop) {
|
2624 |
+
activeIndexBuffer -= swiper.loopedSlides;
|
2625 |
+
swiper.loopDestroy();
|
2626 |
+
swiper.slides = $wrapperEl.children(("." + (params.slideClass)));
|
2627 |
+
}
|
2628 |
+
var newActiveIndex = activeIndexBuffer;
|
2629 |
+
var indexToRemove;
|
2630 |
+
|
2631 |
+
if (typeof slidesIndexes === 'object' && 'length' in slidesIndexes) {
|
2632 |
+
for (var i = 0; i < slidesIndexes.length; i += 1) {
|
2633 |
+
indexToRemove = slidesIndexes[i];
|
2634 |
+
if (swiper.slides[indexToRemove]) { swiper.slides.eq(indexToRemove).remove(); }
|
2635 |
+
if (indexToRemove < newActiveIndex) { newActiveIndex -= 1; }
|
2636 |
+
}
|
2637 |
+
newActiveIndex = Math.max(newActiveIndex, 0);
|
2638 |
+
} else {
|
2639 |
+
indexToRemove = slidesIndexes;
|
2640 |
+
if (swiper.slides[indexToRemove]) { swiper.slides.eq(indexToRemove).remove(); }
|
2641 |
+
if (indexToRemove < newActiveIndex) { newActiveIndex -= 1; }
|
2642 |
+
newActiveIndex = Math.max(newActiveIndex, 0);
|
2643 |
+
}
|
2644 |
+
|
2645 |
+
if (params.loop) {
|
2646 |
+
swiper.loopCreate();
|
2647 |
+
}
|
2648 |
+
|
2649 |
+
if (!(params.observer && Support.observer)) {
|
2650 |
+
swiper.update();
|
2651 |
+
}
|
2652 |
+
if (params.loop) {
|
2653 |
+
swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);
|
2654 |
+
} else {
|
2655 |
+
swiper.slideTo(newActiveIndex, 0, false);
|
2656 |
+
}
|
2657 |
+
}
|
2658 |
+
|
2659 |
+
function removeAllSlides () {
|
2660 |
+
var swiper = this;
|
2661 |
+
|
2662 |
+
var slidesIndexes = [];
|
2663 |
+
for (var i = 0; i < swiper.slides.length; i += 1) {
|
2664 |
+
slidesIndexes.push(i);
|
2665 |
+
}
|
2666 |
+
swiper.removeSlide(slidesIndexes);
|
2667 |
+
}
|
2668 |
+
|
2669 |
+
var manipulation = {
|
2670 |
+
appendSlide: appendSlide,
|
2671 |
+
prependSlide: prependSlide,
|
2672 |
+
addSlide: addSlide,
|
2673 |
+
removeSlide: removeSlide,
|
2674 |
+
removeAllSlides: removeAllSlides,
|
2675 |
+
};
|
2676 |
+
|
2677 |
+
var Device = (function Device() {
|
2678 |
+
var platform = win.navigator.platform;
|
2679 |
+
var ua = win.navigator.userAgent;
|
2680 |
+
|
2681 |
+
var device = {
|
2682 |
+
ios: false,
|
2683 |
+
android: false,
|
2684 |
+
androidChrome: false,
|
2685 |
+
desktop: false,
|
2686 |
+
iphone: false,
|
2687 |
+
ipod: false,
|
2688 |
+
ipad: false,
|
2689 |
+
edge: false,
|
2690 |
+
ie: false,
|
2691 |
+
firefox: false,
|
2692 |
+
macos: false,
|
2693 |
+
windows: false,
|
2694 |
+
cordova: !!(win.cordova || win.phonegap),
|
2695 |
+
phonegap: !!(win.cordova || win.phonegap),
|
2696 |
+
electron: false,
|
2697 |
+
};
|
2698 |
+
|
2699 |
+
var screenWidth = win.screen.width;
|
2700 |
+
var screenHeight = win.screen.height;
|
2701 |
+
|
2702 |
+
var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line
|
2703 |
+
var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
|
2704 |
+
var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
|
2705 |
+
var iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
|
2706 |
+
var ie = ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;
|
2707 |
+
var edge = ua.indexOf('Edge/') >= 0;
|
2708 |
+
var firefox = ua.indexOf('Gecko/') >= 0 && ua.indexOf('Firefox/') >= 0;
|
2709 |
+
var windows = platform === 'Win32';
|
2710 |
+
var electron = ua.toLowerCase().indexOf('electron') >= 0;
|
2711 |
+
var macos = platform === 'MacIntel';
|
2712 |
+
|
2713 |
+
// iPadOs 13 fix
|
2714 |
+
if (!ipad
|
2715 |
+
&& macos
|
2716 |
+
&& Support.touch
|
2717 |
+
&& (
|
2718 |
+
(screenWidth === 1024 && screenHeight === 1366) // Pro 12.9
|
2719 |
+
|| (screenWidth === 834 && screenHeight === 1194) // Pro 11
|
2720 |
+
|| (screenWidth === 834 && screenHeight === 1112) // Pro 10.5
|
2721 |
+
|| (screenWidth === 768 && screenHeight === 1024) // other
|
2722 |
+
)
|
2723 |
+
) {
|
2724 |
+
ipad = ua.match(/(Version)\/([\d.]+)/);
|
2725 |
+
macos = false;
|
2726 |
+
}
|
2727 |
+
|
2728 |
+
device.ie = ie;
|
2729 |
+
device.edge = edge;
|
2730 |
+
device.firefox = firefox;
|
2731 |
+
|
2732 |
+
// Android
|
2733 |
+
if (android && !windows) {
|
2734 |
+
device.os = 'android';
|
2735 |
+
device.osVersion = android[2];
|
2736 |
+
device.android = true;
|
2737 |
+
device.androidChrome = ua.toLowerCase().indexOf('chrome') >= 0;
|
2738 |
+
}
|
2739 |
+
if (ipad || iphone || ipod) {
|
2740 |
+
device.os = 'ios';
|
2741 |
+
device.ios = true;
|
2742 |
+
}
|
2743 |
+
// iOS
|
2744 |
+
if (iphone && !ipod) {
|
2745 |
+
device.osVersion = iphone[2].replace(/_/g, '.');
|
2746 |
+
device.iphone = true;
|
2747 |
+
}
|
2748 |
+
if (ipad) {
|
2749 |
+
device.osVersion = ipad[2].replace(/_/g, '.');
|
2750 |
+
device.ipad = true;
|
2751 |
+
}
|
2752 |
+
if (ipod) {
|
2753 |
+
device.osVersion = ipod[3] ? ipod[3].replace(/_/g, '.') : null;
|
2754 |
+
device.ipod = true;
|
2755 |
+
}
|
2756 |
+
// iOS 8+ changed UA
|
2757 |
+
if (device.ios && device.osVersion && ua.indexOf('Version/') >= 0) {
|
2758 |
+
if (device.osVersion.split('.')[0] === '10') {
|
2759 |
+
device.osVersion = ua.toLowerCase().split('version/')[1].split(' ')[0];
|
2760 |
+
}
|
2761 |
+
}
|
2762 |
+
|
2763 |
+
// Webview
|
2764 |
+
device.webView = !!((iphone || ipad || ipod) && (ua.match(/.*AppleWebKit(?!.*Safari)/i) || win.navigator.standalone))
|
2765 |
+
|| (win.matchMedia && win.matchMedia('(display-mode: standalone)').matches);
|
2766 |
+
device.webview = device.webView;
|
2767 |
+
device.standalone = device.webView;
|
2768 |
+
|
2769 |
+
// Desktop
|
2770 |
+
device.desktop = !(device.ios || device.android) || electron;
|
2771 |
+
if (device.desktop) {
|
2772 |
+
device.electron = electron;
|
2773 |
+
device.macos = macos;
|
2774 |
+
device.windows = windows;
|
2775 |
+
if (device.macos) {
|
2776 |
+
device.os = 'macos';
|
2777 |
+
}
|
2778 |
+
if (device.windows) {
|
2779 |
+
device.os = 'windows';
|
2780 |
+
}
|
2781 |
+
}
|
2782 |
+
|
2783 |
+
// Pixel Ratio
|
2784 |
+
device.pixelRatio = win.devicePixelRatio || 1;
|
2785 |
+
|
2786 |
+
// Export object
|
2787 |
+
return device;
|
2788 |
+
}());
|
2789 |
+
|
2790 |
+
function onTouchStart (event) {
|
2791 |
+
var swiper = this;
|
2792 |
+
var data = swiper.touchEventsData;
|
2793 |
+
var params = swiper.params;
|
2794 |
+
var touches = swiper.touches;
|
2795 |
+
|
2796 |
+
if (swiper.animating && params.preventInteractionOnTransition) {
|
2797 |
+
return;
|
2798 |
+
}
|
2799 |
+
var e = event;
|
2800 |
+
if (e.originalEvent) { e = e.originalEvent; }
|
2801 |
+
var $targetEl = $(e.target);
|
2802 |
+
|
2803 |
+
if (params.touchEventsTarget === 'wrapper') {
|
2804 |
+
if (!$targetEl.closest(swiper.wrapperEl).length) { return; }
|
2805 |
+
}
|
2806 |
+
data.isTouchEvent = e.type === 'touchstart';
|
2807 |
+
if (!data.isTouchEvent && 'which' in e && e.which === 3) { return; }
|
2808 |
+
if (!data.isTouchEvent && 'button' in e && e.button > 0) { return; }
|
2809 |
+
if (data.isTouched && data.isMoved) { return; }
|
2810 |
+
if (params.noSwiping && $targetEl.closest(params.noSwipingSelector ? params.noSwipingSelector : ("." + (params.noSwipingClass)))[0]) {
|
2811 |
+
swiper.allowClick = true;
|
2812 |
+
return;
|
2813 |
+
}
|
2814 |
+
if (params.swipeHandler) {
|
2815 |
+
if (!$targetEl.closest(params.swipeHandler)[0]) { return; }
|
2816 |
+
}
|
2817 |
+
|
2818 |
+
touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
|
2819 |
+
touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
|
2820 |
+
var startX = touches.currentX;
|
2821 |
+
var startY = touches.currentY;
|
2822 |
+
|
2823 |
+
// Do NOT start if iOS edge swipe is detected. Otherwise iOS app (UIWebView) cannot swipe-to-go-back anymore
|
2824 |
+
|
2825 |
+
var edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;
|
2826 |
+
var edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;
|
2827 |
+
if (
|
2828 |
+
edgeSwipeDetection
|
2829 |
+
&& ((startX <= edgeSwipeThreshold)
|
2830 |
+
|| (startX >= win.screen.width - edgeSwipeThreshold))
|
2831 |
+
) {
|
2832 |
+
return;
|
2833 |
+
}
|
2834 |
+
|
2835 |
+
Utils.extend(data, {
|
2836 |
+
isTouched: true,
|
2837 |
+
isMoved: false,
|
2838 |
+
allowTouchCallbacks: true,
|
2839 |
+
isScrolling: undefined,
|
2840 |
+
startMoving: undefined,
|
2841 |
+
});
|
2842 |
+
|
2843 |
+
touches.startX = startX;
|
2844 |
+
touches.startY = startY;
|
2845 |
+
data.touchStartTime = Utils.now();
|
2846 |
+
swiper.allowClick = true;
|
2847 |
+
swiper.updateSize();
|
2848 |
+
swiper.swipeDirection = undefined;
|
2849 |
+
if (params.threshold > 0) { data.allowThresholdMove = false; }
|
2850 |
+
if (e.type !== 'touchstart') {
|
2851 |
+
var preventDefault = true;
|
2852 |
+
if ($targetEl.is(data.formElements)) { preventDefault = false; }
|
2853 |
+
if (
|
2854 |
+
doc.activeElement
|
2855 |
+
&& $(doc.activeElement).is(data.formElements)
|
2856 |
+
&& doc.activeElement !== $targetEl[0]
|
2857 |
+
) {
|
2858 |
+
doc.activeElement.blur();
|
2859 |
+
}
|
2860 |
+
|
2861 |
+
var shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
|
2862 |
+
if (params.touchStartForcePreventDefault || shouldPreventDefault) {
|
2863 |
+
e.preventDefault();
|
2864 |
+
}
|
2865 |
+
}
|
2866 |
+
swiper.emit('touchStart', e);
|
2867 |
+
}
|
2868 |
+
|
2869 |
+
function onTouchMove (event) {
|
2870 |
+
var swiper = this;
|
2871 |
+
var data = swiper.touchEventsData;
|
2872 |
+
var params = swiper.params;
|
2873 |
+
var touches = swiper.touches;
|
2874 |
+
var rtl = swiper.rtlTranslate;
|
2875 |
+
var e = event;
|
2876 |
+
if (e.originalEvent) { e = e.originalEvent; }
|
2877 |
+
if (!data.isTouched) {
|
2878 |
+
if (data.startMoving && data.isScrolling) {
|
2879 |
+
swiper.emit('touchMoveOpposite', e);
|
2880 |
+
}
|
2881 |
+
return;
|
2882 |
+
}
|
2883 |
+
if (data.isTouchEvent && e.type === 'mousemove') { return; }
|
2884 |
+
var targetTouch = e.type === 'touchmove' && e.targetTouches && (e.targetTouches[0] || e.changedTouches[0]);
|
2885 |
+
var pageX = e.type === 'touchmove' ? targetTouch.pageX : e.pageX;
|
2886 |
+
var pageY = e.type === 'touchmove' ? targetTouch.pageY : e.pageY;
|
2887 |
+
if (e.preventedByNestedSwiper) {
|
2888 |
+
touches.startX = pageX;
|
2889 |
+
touches.startY = pageY;
|
2890 |
+
return;
|
2891 |
+
}
|
2892 |
+
if (!swiper.allowTouchMove) {
|
2893 |
+
// isMoved = true;
|
2894 |
+
swiper.allowClick = false;
|
2895 |
+
if (data.isTouched) {
|
2896 |
+
Utils.extend(touches, {
|
2897 |
+
startX: pageX,
|
2898 |
+
startY: pageY,
|
2899 |
+
currentX: pageX,
|
2900 |
+
currentY: pageY,
|
2901 |
+
});
|
2902 |
+
data.touchStartTime = Utils.now();
|
2903 |
+
}
|
2904 |
+
return;
|
2905 |
+
}
|
2906 |
+
if (data.isTouchEvent && params.touchReleaseOnEdges && !params.loop) {
|
2907 |
+
if (swiper.isVertical()) {
|
2908 |
+
// Vertical
|
2909 |
+
if (
|
2910 |
+
(pageY < touches.startY && swiper.translate <= swiper.maxTranslate())
|
2911 |
+
|| (pageY > touches.startY && swiper.translate >= swiper.minTranslate())
|
2912 |
+
) {
|
2913 |
+
data.isTouched = false;
|
2914 |
+
data.isMoved = false;
|
2915 |
+
return;
|
2916 |
+
}
|
2917 |
+
} else if (
|
2918 |
+
(pageX < touches.startX && swiper.translate <= swiper.maxTranslate())
|
2919 |
+
|| (pageX > touches.startX && swiper.translate >= swiper.minTranslate())
|
2920 |
+
) {
|
2921 |
+
return;
|
2922 |
+
}
|
2923 |
+
}
|
2924 |
+
if (data.isTouchEvent && doc.activeElement) {
|
2925 |
+
if (e.target === doc.activeElement && $(e.target).is(data.formElements)) {
|
2926 |
+
data.isMoved = true;
|
2927 |
+
swiper.allowClick = false;
|
2928 |
+
return;
|
2929 |
+
}
|
2930 |
+
}
|
2931 |
+
if (data.allowTouchCallbacks) {
|
2932 |
+
swiper.emit('touchMove', e);
|
2933 |
+
}
|
2934 |
+
if (e.targetTouches && e.targetTouches.length > 1) { return; }
|
2935 |
+
|
2936 |
+
touches.currentX = pageX;
|
2937 |
+
touches.currentY = pageY;
|
2938 |
+
|
2939 |
+
var diffX = touches.currentX - touches.startX;
|
2940 |
+
var diffY = touches.currentY - touches.startY;
|
2941 |
+
if (swiper.params.threshold && Math.sqrt((Math.pow( diffX, 2 )) + (Math.pow( diffY, 2 ))) < swiper.params.threshold) { return; }
|
2942 |
+
|
2943 |
+
if (typeof data.isScrolling === 'undefined') {
|
2944 |
+
var touchAngle;
|
2945 |
+
if ((swiper.isHorizontal() && touches.currentY === touches.startY) || (swiper.isVertical() && touches.currentX === touches.startX)) {
|
2946 |
+
data.isScrolling = false;
|
2947 |
+
} else {
|
2948 |
+
// eslint-disable-next-line
|
2949 |
+
if ((diffX * diffX) + (diffY * diffY) >= 25) {
|
2950 |
+
touchAngle = (Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180) / Math.PI;
|
2951 |
+
data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : (90 - touchAngle > params.touchAngle);
|
2952 |
+
}
|
2953 |
+
}
|
2954 |
+
}
|
2955 |
+
if (data.isScrolling) {
|
2956 |
+
swiper.emit('touchMoveOpposite', e);
|
2957 |
+
}
|
2958 |
+
if (typeof data.startMoving === 'undefined') {
|
2959 |
+
if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {
|
2960 |
+
data.startMoving = true;
|
2961 |
+
}
|
2962 |
+
}
|
2963 |
+
if (data.isScrolling) {
|
2964 |
+
data.isTouched = false;
|
2965 |
+
return;
|
2966 |
+
}
|
2967 |
+
if (!data.startMoving) {
|
2968 |
+
return;
|
2969 |
+
}
|
2970 |
+
swiper.allowClick = false;
|
2971 |
+
if (!params.cssMode) {
|
2972 |
+
e.preventDefault();
|
2973 |
+
}
|
2974 |
+
if (params.touchMoveStopPropagation && !params.nested) {
|
2975 |
+
e.stopPropagation();
|
2976 |
+
}
|
2977 |
+
|
2978 |
+
if (!data.isMoved) {
|
2979 |
+
if (params.loop) {
|
2980 |
+
swiper.loopFix();
|
2981 |
+
}
|
2982 |
+
data.startTranslate = swiper.getTranslate();
|
2983 |
+
swiper.setTransition(0);
|
2984 |
+
if (swiper.animating) {
|
2985 |
+
swiper.$wrapperEl.trigger('webkitTransitionEnd transitionend');
|
2986 |
+
}
|
2987 |
+
data.allowMomentumBounce = false;
|
2988 |
+
// Grab Cursor
|
2989 |
+
if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
|
2990 |
+
swiper.setGrabCursor(true);
|
2991 |
+
}
|
2992 |
+
swiper.emit('sliderFirstMove', e);
|
2993 |
+
}
|
2994 |
+
swiper.emit('sliderMove', e);
|
2995 |
+
data.isMoved = true;
|
2996 |
+
|
2997 |
+
var diff = swiper.isHorizontal() ? diffX : diffY;
|
2998 |
+
touches.diff = diff;
|
2999 |
+
|
3000 |
+
diff *= params.touchRatio;
|
3001 |
+
if (rtl) { diff = -diff; }
|
3002 |
+
|
3003 |
+
swiper.swipeDirection = diff > 0 ? 'prev' : 'next';
|
3004 |
+
data.currentTranslate = diff + data.startTranslate;
|
3005 |
+
|
3006 |
+
var disableParentSwiper = true;
|
3007 |
+
var resistanceRatio = params.resistanceRatio;
|
3008 |
+
if (params.touchReleaseOnEdges) {
|
3009 |
+
resistanceRatio = 0;
|
3010 |
+
}
|
3011 |
+
if ((diff > 0 && data.currentTranslate > swiper.minTranslate())) {
|
3012 |
+
disableParentSwiper = false;
|
3013 |
+
if (params.resistance) { data.currentTranslate = (swiper.minTranslate() - 1) + (Math.pow( (-swiper.minTranslate() + data.startTranslate + diff), resistanceRatio )); }
|
3014 |
+
} else if (diff < 0 && data.currentTranslate < swiper.maxTranslate()) {
|
3015 |
+
disableParentSwiper = false;
|
3016 |
+
if (params.resistance) { data.currentTranslate = (swiper.maxTranslate() + 1) - (Math.pow( (swiper.maxTranslate() - data.startTranslate - diff), resistanceRatio )); }
|
3017 |
+
}
|
3018 |
+
|
3019 |
+
if (disableParentSwiper) {
|
3020 |
+
e.preventedByNestedSwiper = true;
|
3021 |
+
}
|
3022 |
+
|
3023 |
+
// Directions locks
|
3024 |
+
if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) {
|
3025 |
+
data.currentTranslate = data.startTranslate;
|
3026 |
+
}
|
3027 |
+
if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) {
|
3028 |
+
data.currentTranslate = data.startTranslate;
|
3029 |
+
}
|
3030 |
+
|
3031 |
+
|
3032 |
+
// Threshold
|
3033 |
+
if (params.threshold > 0) {
|
3034 |
+
if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {
|
3035 |
+
if (!data.allowThresholdMove) {
|
3036 |
+
data.allowThresholdMove = true;
|
3037 |
+
touches.startX = touches.currentX;
|
3038 |
+
touches.startY = touches.currentY;
|
3039 |
+
data.currentTranslate = data.startTranslate;
|
3040 |
+
touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY;
|
3041 |
+
return;
|
3042 |
+
}
|
3043 |
+
} else {
|
3044 |
+
data.currentTranslate = data.startTranslate;
|
3045 |
+
return;
|
3046 |
+
}
|
3047 |
+
}
|
3048 |
+
|
3049 |
+
if (!params.followFinger || params.cssMode) { return; }
|
3050 |
+
|
3051 |
+
// Update active index in free mode
|
3052 |
+
if (params.freeMode || params.watchSlidesProgress || params.watchSlidesVisibility) {
|
3053 |
+
swiper.updateActiveIndex();
|
3054 |
+
swiper.updateSlidesClasses();
|
3055 |
+
}
|
3056 |
+
if (params.freeMode) {
|
3057 |
+
// Velocity
|
3058 |
+
if (data.velocities.length === 0) {
|
3059 |
+
data.velocities.push({
|
3060 |
+
position: touches[swiper.isHorizontal() ? 'startX' : 'startY'],
|
3061 |
+
time: data.touchStartTime,
|
3062 |
+
});
|
3063 |
+
}
|
3064 |
+
data.velocities.push({
|
3065 |
+
position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'],
|
3066 |
+
time: Utils.now(),
|
3067 |
+
});
|
3068 |
+
}
|
3069 |
+
// Update progress
|
3070 |
+
swiper.updateProgress(data.currentTranslate);
|
3071 |
+
// Update translate
|
3072 |
+
swiper.setTranslate(data.currentTranslate);
|
3073 |
+
}
|
3074 |
+
|
3075 |
+
function onTouchEnd (event) {
|
3076 |
+
var swiper = this;
|
3077 |
+
var data = swiper.touchEventsData;
|
3078 |
+
|
3079 |
+
var params = swiper.params;
|
3080 |
+
var touches = swiper.touches;
|
3081 |
+
var rtl = swiper.rtlTranslate;
|
3082 |
+
var $wrapperEl = swiper.$wrapperEl;
|
3083 |
+
var slidesGrid = swiper.slidesGrid;
|
3084 |
+
var snapGrid = swiper.snapGrid;
|
3085 |
+
var e = event;
|
3086 |
+
if (e.originalEvent) { e = e.originalEvent; }
|
3087 |
+
if (data.allowTouchCallbacks) {
|
3088 |
+
swiper.emit('touchEnd', e);
|
3089 |
+
}
|
3090 |
+
data.allowTouchCallbacks = false;
|
3091 |
+
if (!data.isTouched) {
|
3092 |
+
if (data.isMoved && params.grabCursor) {
|
3093 |
+
swiper.setGrabCursor(false);
|
3094 |
+
}
|
3095 |
+
data.isMoved = false;
|
3096 |
+
data.startMoving = false;
|
3097 |
+
return;
|
3098 |
+
}
|
3099 |
+
// Return Grab Cursor
|
3100 |
+
if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
|
3101 |
+
swiper.setGrabCursor(false);
|
3102 |
+
}
|
3103 |
+
|
3104 |
+
// Time diff
|
3105 |
+
var touchEndTime = Utils.now();
|
3106 |
+
var timeDiff = touchEndTime - data.touchStartTime;
|
3107 |
+
|
3108 |
+
// Tap, doubleTap, Click
|
3109 |
+
if (swiper.allowClick) {
|
3110 |
+
swiper.updateClickedSlide(e);
|
3111 |
+
swiper.emit('tap click', e);
|
3112 |
+
if (timeDiff < 300 && (touchEndTime - data.lastClickTime) < 300) {
|
3113 |
+
swiper.emit('doubleTap doubleClick', e);
|
3114 |
+
}
|
3115 |
+
}
|
3116 |
+
|
3117 |
+
data.lastClickTime = Utils.now();
|
3118 |
+
Utils.nextTick(function () {
|
3119 |
+
if (!swiper.destroyed) { swiper.allowClick = true; }
|
3120 |
+
});
|
3121 |
+
|
3122 |
+
if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {
|
3123 |
+
data.isTouched = false;
|
3124 |
+
data.isMoved = false;
|
3125 |
+
data.startMoving = false;
|
3126 |
+
return;
|
3127 |
+
}
|
3128 |
+
data.isTouched = false;
|
3129 |
+
data.isMoved = false;
|
3130 |
+
data.startMoving = false;
|
3131 |
+
|
3132 |
+
var currentPos;
|
3133 |
+
if (params.followFinger) {
|
3134 |
+
currentPos = rtl ? swiper.translate : -swiper.translate;
|
3135 |
+
} else {
|
3136 |
+
currentPos = -data.currentTranslate;
|
3137 |
+
}
|
3138 |
+
|
3139 |
+
if (params.cssMode) {
|
3140 |
+
return;
|
3141 |
+
}
|
3142 |
+
|
3143 |
+
if (params.freeMode) {
|
3144 |
+
if (currentPos < -swiper.minTranslate()) {
|
3145 |
+
swiper.slideTo(swiper.activeIndex);
|
3146 |
+
return;
|
3147 |
+
}
|
3148 |
+
if (currentPos > -swiper.maxTranslate()) {
|
3149 |
+
if (swiper.slides.length < snapGrid.length) {
|
3150 |
+
swiper.slideTo(snapGrid.length - 1);
|
3151 |
+
} else {
|
3152 |
+
swiper.slideTo(swiper.slides.length - 1);
|
3153 |
+
}
|
3154 |
+
return;
|
3155 |
+
}
|
3156 |
+
|
3157 |
+
if (params.freeModeMomentum) {
|
3158 |
+
if (data.velocities.length > 1) {
|
3159 |
+
var lastMoveEvent = data.velocities.pop();
|
3160 |
+
var velocityEvent = data.velocities.pop();
|
3161 |
+
|
3162 |
+
var distance = lastMoveEvent.position - velocityEvent.position;
|
3163 |
+
var time = lastMoveEvent.time - velocityEvent.time;
|
3164 |
+
swiper.velocity = distance / time;
|
3165 |
+
swiper.velocity /= 2;
|
3166 |
+
if (Math.abs(swiper.velocity) < params.freeModeMinimumVelocity) {
|
3167 |
+
swiper.velocity = 0;
|
3168 |
+
}
|
3169 |
+
// this implies that the user stopped moving a finger then released.
|
3170 |
+
// There would be no events with distance zero, so the last event is stale.
|
3171 |
+
if (time > 150 || (Utils.now() - lastMoveEvent.time) > 300) {
|
3172 |
+
swiper.velocity = 0;
|
3173 |
+
}
|
3174 |
+
} else {
|
3175 |
+
swiper.velocity = 0;
|
3176 |
+
}
|
3177 |
+
swiper.velocity *= params.freeModeMomentumVelocityRatio;
|
3178 |
+
|
3179 |
+
data.velocities.length = 0;
|
3180 |
+
var momentumDuration = 1000 * params.freeModeMomentumRatio;
|
3181 |
+
var momentumDistance = swiper.velocity * momentumDuration;
|
3182 |
+
|
3183 |
+
var newPosition = swiper.translate + momentumDistance;
|
3184 |
+
if (rtl) { newPosition = -newPosition; }
|
3185 |
+
|
3186 |
+
var doBounce = false;
|
3187 |
+
var afterBouncePosition;
|
3188 |
+
var bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeModeMomentumBounceRatio;
|
3189 |
+
var needsLoopFix;
|
3190 |
+
if (newPosition < swiper.maxTranslate()) {
|
3191 |
+
if (params.freeModeMomentumBounce) {
|
3192 |
+
if (newPosition + swiper.maxTranslate() < -bounceAmount) {
|
3193 |
+
newPosition = swiper.maxTranslate() - bounceAmount;
|
3194 |
+
}
|
3195 |
+
afterBouncePosition = swiper.maxTranslate();
|
3196 |
+
doBounce = true;
|
3197 |
+
data.allowMomentumBounce = true;
|
3198 |
+
} else {
|
3199 |
+
newPosition = swiper.maxTranslate();
|
3200 |
+
}
|
3201 |
+
if (params.loop && params.centeredSlides) { needsLoopFix = true; }
|
3202 |
+
} else if (newPosition > swiper.minTranslate()) {
|
3203 |
+
if (params.freeModeMomentumBounce) {
|
3204 |
+
if (newPosition - swiper.minTranslate() > bounceAmount) {
|
3205 |
+
newPosition = swiper.minTranslate() + bounceAmount;
|
3206 |
+
}
|
3207 |
+
afterBouncePosition = swiper.minTranslate();
|
3208 |
+
doBounce = true;
|
3209 |
+
data.allowMomentumBounce = true;
|
3210 |
+
} else {
|
3211 |
+
newPosition = swiper.minTranslate();
|
3212 |
+
}
|
3213 |
+
if (params.loop && params.centeredSlides) { needsLoopFix = true; }
|
3214 |
+
} else if (params.freeModeSticky) {
|
3215 |
+
var nextSlide;
|
3216 |
+
for (var j = 0; j < snapGrid.length; j += 1) {
|
3217 |
+
if (snapGrid[j] > -newPosition) {
|
3218 |
+
nextSlide = j;
|
3219 |
+
break;
|
3220 |
+
}
|
3221 |
+
}
|
3222 |
+
|
3223 |
+
if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') {
|
3224 |
+
newPosition = snapGrid[nextSlide];
|
3225 |
+
} else {
|
3226 |
+
newPosition = snapGrid[nextSlide - 1];
|
3227 |
+
}
|
3228 |
+
newPosition = -newPosition;
|
3229 |
+
}
|
3230 |
+
if (needsLoopFix) {
|
3231 |
+
swiper.once('transitionEnd', function () {
|
3232 |
+
swiper.loopFix();
|
3233 |
+
});
|
3234 |
+
}
|
3235 |
+
// Fix duration
|
3236 |
+
if (swiper.velocity !== 0) {
|
3237 |
+
if (rtl) {
|
3238 |
+
momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity);
|
3239 |
+
} else {
|
3240 |
+
momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity);
|
3241 |
+
}
|
3242 |
+
if (params.freeModeSticky) {
|
3243 |
+
// If freeModeSticky is active and the user ends a swipe with a slow-velocity
|
3244 |
+
// event, then durations can be 20+ seconds to slide one (or zero!) slides.
|
3245 |
+
// It's easy to see this when simulating touch with mouse events. To fix this,
|
3246 |
+
// limit single-slide swipes to the default slide duration. This also has the
|
3247 |
+
// nice side effect of matching slide speed if the user stopped moving before
|
3248 |
+
// lifting finger or mouse vs. moving slowly before lifting the finger/mouse.
|
3249 |
+
// For faster swipes, also apply limits (albeit higher ones).
|
3250 |
+
var moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate);
|
3251 |
+
var currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex];
|
3252 |
+
if (moveDistance < currentSlideSize) {
|
3253 |
+
momentumDuration = params.speed;
|
3254 |
+
} else if (moveDistance < 2 * currentSlideSize) {
|
3255 |
+
momentumDuration = params.speed * 1.5;
|
3256 |
+
} else {
|
3257 |
+
momentumDuration = params.speed * 2.5;
|
3258 |
+
}
|
3259 |
+
}
|
3260 |
+
} else if (params.freeModeSticky) {
|
3261 |
+
swiper.slideToClosest();
|
3262 |
+
return;
|
3263 |
+
}
|
3264 |
+
|
3265 |
+
if (params.freeModeMomentumBounce && doBounce) {
|
3266 |
+
swiper.updateProgress(afterBouncePosition);
|
3267 |
+
swiper.setTransition(momentumDuration);
|
3268 |
+
swiper.setTranslate(newPosition);
|
3269 |
+
swiper.transitionStart(true, swiper.swipeDirection);
|
3270 |
+
swiper.animating = true;
|
3271 |
+
$wrapperEl.transitionEnd(function () {
|
3272 |
+
if (!swiper || swiper.destroyed || !data.allowMomentumBounce) { return; }
|
3273 |
+
swiper.emit('momentumBounce');
|
3274 |
+
|
3275 |
+
swiper.setTransition(params.speed);
|
3276 |
+
swiper.setTranslate(afterBouncePosition);
|
3277 |
+
$wrapperEl.transitionEnd(function () {
|
3278 |
+
if (!swiper || swiper.destroyed) { return; }
|
3279 |
+
swiper.transitionEnd();
|
3280 |
+
});
|
3281 |
+
});
|
3282 |
+
} else if (swiper.velocity) {
|
3283 |
+
swiper.updateProgress(newPosition);
|
3284 |
+
swiper.setTransition(momentumDuration);
|
3285 |
+
swiper.setTranslate(newPosition);
|
3286 |
+
swiper.transitionStart(true, swiper.swipeDirection);
|
3287 |
+
if (!swiper.animating) {
|
3288 |
+
swiper.animating = true;
|
3289 |
+
$wrapperEl.transitionEnd(function () {
|
3290 |
+
if (!swiper || swiper.destroyed) { return; }
|
3291 |
+
swiper.transitionEnd();
|
3292 |
+
});
|
3293 |
+
}
|
3294 |
+
} else {
|
3295 |
+
swiper.updateProgress(newPosition);
|
3296 |
+
}
|
3297 |
+
|
3298 |
+
swiper.updateActiveIndex();
|
3299 |
+
swiper.updateSlidesClasses();
|
3300 |
+
} else if (params.freeModeSticky) {
|
3301 |
+
swiper.slideToClosest();
|
3302 |
+
return;
|
3303 |
+
}
|
3304 |
+
|
3305 |
+
if (!params.freeModeMomentum || timeDiff >= params.longSwipesMs) {
|
3306 |
+
swiper.updateProgress();
|
3307 |
+
swiper.updateActiveIndex();
|
3308 |
+
swiper.updateSlidesClasses();
|
3309 |
+
}
|
3310 |
+
return;
|
3311 |
+
}
|
3312 |
+
|
3313 |
+
// Find current slide
|
3314 |
+
var stopIndex = 0;
|
3315 |
+
var groupSize = swiper.slidesSizesGrid[0];
|
3316 |
+
for (var i = 0; i < slidesGrid.length; i += (i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup)) {
|
3317 |
+
var increment$1 = (i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup);
|
3318 |
+
if (typeof slidesGrid[i + increment$1] !== 'undefined') {
|
3319 |
+
if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment$1]) {
|
3320 |
+
stopIndex = i;
|
3321 |
+
groupSize = slidesGrid[i + increment$1] - slidesGrid[i];
|
3322 |
+
}
|
3323 |
+
} else if (currentPos >= slidesGrid[i]) {
|
3324 |
+
stopIndex = i;
|
3325 |
+
groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];
|
3326 |
+
}
|
3327 |
+
}
|
3328 |
+
|
3329 |
+
// Find current slide size
|
3330 |
+
var ratio = (currentPos - slidesGrid[stopIndex]) / groupSize;
|
3331 |
+
var increment = (stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup);
|
3332 |
+
|
3333 |
+
if (timeDiff > params.longSwipesMs) {
|
3334 |
+
// Long touches
|
3335 |
+
if (!params.longSwipes) {
|
3336 |
+
swiper.slideTo(swiper.activeIndex);
|
3337 |
+
return;
|
3338 |
+
}
|
3339 |
+
if (swiper.swipeDirection === 'next') {
|
3340 |
+
if (ratio >= params.longSwipesRatio) { swiper.slideTo(stopIndex + increment); }
|
3341 |
+
else { swiper.slideTo(stopIndex); }
|
3342 |
+
}
|
3343 |
+
if (swiper.swipeDirection === 'prev') {
|
3344 |
+
if (ratio > (1 - params.longSwipesRatio)) { swiper.slideTo(stopIndex + increment); }
|
3345 |
+
else { swiper.slideTo(stopIndex); }
|
3346 |
+
}
|
3347 |
+
} else {
|
3348 |
+
// Short swipes
|
3349 |
+
if (!params.shortSwipes) {
|
3350 |
+
swiper.slideTo(swiper.activeIndex);
|
3351 |
+
return;
|
3352 |
+
}
|
3353 |
+
var isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl);
|
3354 |
+
if (!isNavButtonTarget) {
|
3355 |
+
if (swiper.swipeDirection === 'next') {
|
3356 |
+
swiper.slideTo(stopIndex + increment);
|
3357 |
+
}
|
3358 |
+
if (swiper.swipeDirection === 'prev') {
|
3359 |
+
swiper.slideTo(stopIndex);
|
3360 |
+
}
|
3361 |
+
} else if (e.target === swiper.navigation.nextEl) {
|
3362 |
+
swiper.slideTo(stopIndex + increment);
|
3363 |
+
} else {
|
3364 |
+
swiper.slideTo(stopIndex);
|
3365 |
+
}
|
3366 |
+
}
|
3367 |
+
}
|
3368 |
+
|
3369 |
+
function onResize () {
|
3370 |
+
var swiper = this;
|
3371 |
+
|
3372 |
+
var params = swiper.params;
|
3373 |
+
var el = swiper.el;
|
3374 |
+
|
3375 |
+
if (el && el.offsetWidth === 0) { return; }
|
3376 |
+
|
3377 |
+
// Breakpoints
|
3378 |
+
if (params.breakpoints) {
|
3379 |
+
swiper.setBreakpoint();
|
3380 |
+
}
|
3381 |
+
|
3382 |
+
// Save locks
|
3383 |
+
var allowSlideNext = swiper.allowSlideNext;
|
3384 |
+
var allowSlidePrev = swiper.allowSlidePrev;
|
3385 |
+
var snapGrid = swiper.snapGrid;
|
3386 |
+
|
3387 |
+
// Disable locks on resize
|
3388 |
+
swiper.allowSlideNext = true;
|
3389 |
+
swiper.allowSlidePrev = true;
|
3390 |
+
|
3391 |
+
swiper.updateSize();
|
3392 |
+
swiper.updateSlides();
|
3393 |
+
|
3394 |
+
swiper.updateSlidesClasses();
|
3395 |
+
if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) {
|
3396 |
+
swiper.slideTo(swiper.slides.length - 1, 0, false, true);
|
3397 |
+
} else {
|
3398 |
+
swiper.slideTo(swiper.activeIndex, 0, false, true);
|
3399 |
+
}
|
3400 |
+
|
3401 |
+
if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
|
3402 |
+
swiper.autoplay.run();
|
3403 |
+
}
|
3404 |
+
// Return locks after resize
|
3405 |
+
swiper.allowSlidePrev = allowSlidePrev;
|
3406 |
+
swiper.allowSlideNext = allowSlideNext;
|
3407 |
+
|
3408 |
+
if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) {
|
3409 |
+
swiper.checkOverflow();
|
3410 |
+
}
|
3411 |
+
}
|
3412 |
+
|
3413 |
+
function onClick (e) {
|
3414 |
+
var swiper = this;
|
3415 |
+
if (!swiper.allowClick) {
|
3416 |
+
if (swiper.params.preventClicks) { e.preventDefault(); }
|
3417 |
+
if (swiper.params.preventClicksPropagation && swiper.animating) {
|
3418 |
+
e.stopPropagation();
|
3419 |
+
e.stopImmediatePropagation();
|
3420 |
+
}
|
3421 |
+
}
|
3422 |
+
}
|
3423 |
+
|
3424 |
+
function onScroll () {
|
3425 |
+
var swiper = this;
|
3426 |
+
var wrapperEl = swiper.wrapperEl;
|
3427 |
+
swiper.previousTranslate = swiper.translate;
|
3428 |
+
swiper.translate = swiper.isHorizontal() ? -wrapperEl.scrollLeft : -wrapperEl.scrollTop;
|
3429 |
+
// eslint-disable-next-line
|
3430 |
+
if (swiper.translate === -0) { swiper.translate = 0; }
|
3431 |
+
|
3432 |
+
swiper.updateActiveIndex();
|
3433 |
+
swiper.updateSlidesClasses();
|
3434 |
+
|
3435 |
+
var newProgress;
|
3436 |
+
var translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
|
3437 |
+
if (translatesDiff === 0) {
|
3438 |
+
newProgress = 0;
|
3439 |
+
} else {
|
3440 |
+
newProgress = (swiper.translate - swiper.minTranslate()) / (translatesDiff);
|
3441 |
+
}
|
3442 |
+
if (newProgress !== swiper.progress) {
|
3443 |
+
swiper.updateProgress(swiper.translate);
|
3444 |
+
}
|
3445 |
+
|
3446 |
+
swiper.emit('setTranslate', swiper.translate, false);
|
3447 |
+
}
|
3448 |
+
|
3449 |
+
var dummyEventAttached = false;
|
3450 |
+
function dummyEventListener() {}
|
3451 |
+
|
3452 |
+
function attachEvents() {
|
3453 |
+
var swiper = this;
|
3454 |
+
var params = swiper.params;
|
3455 |
+
var touchEvents = swiper.touchEvents;
|
3456 |
+
var el = swiper.el;
|
3457 |
+
var wrapperEl = swiper.wrapperEl;
|
3458 |
+
|
3459 |
+
swiper.onTouchStart = onTouchStart.bind(swiper);
|
3460 |
+
swiper.onTouchMove = onTouchMove.bind(swiper);
|
3461 |
+
swiper.onTouchEnd = onTouchEnd.bind(swiper);
|
3462 |
+
if (params.cssMode) {
|
3463 |
+
swiper.onScroll = onScroll.bind(swiper);
|
3464 |
+
}
|
3465 |
+
|
3466 |
+
swiper.onClick = onClick.bind(swiper);
|
3467 |
+
|
3468 |
+
var capture = !!params.nested;
|
3469 |
+
|
3470 |
+
// Touch Events
|
3471 |
+
if (!Support.touch && Support.pointerEvents) {
|
3472 |
+
el.addEventListener(touchEvents.start, swiper.onTouchStart, false);
|
3473 |
+
doc.addEventListener(touchEvents.move, swiper.onTouchMove, capture);
|
3474 |
+
doc.addEventListener(touchEvents.end, swiper.onTouchEnd, false);
|
3475 |
+
} else {
|
3476 |
+
if (Support.touch) {
|
3477 |
+
var passiveListener = touchEvents.start === 'touchstart' && Support.passiveListener && params.passiveListeners ? { passive: true, capture: false } : false;
|
3478 |
+
el.addEventListener(touchEvents.start, swiper.onTouchStart, passiveListener);
|
3479 |
+
el.addEventListener(touchEvents.move, swiper.onTouchMove, Support.passiveListener ? { passive: false, capture: capture } : capture);
|
3480 |
+
el.addEventListener(touchEvents.end, swiper.onTouchEnd, passiveListener);
|
3481 |
+
if (touchEvents.cancel) {
|
3482 |
+
el.addEventListener(touchEvents.cancel, swiper.onTouchEnd, passiveListener);
|
3483 |
+
}
|
3484 |
+
if (!dummyEventAttached) {
|
3485 |
+
doc.addEventListener('touchstart', dummyEventListener);
|
3486 |
+
dummyEventAttached = true;
|
3487 |
+
}
|
3488 |
+
}
|
3489 |
+
if ((params.simulateTouch && !Device.ios && !Device.android) || (params.simulateTouch && !Support.touch && Device.ios)) {
|
3490 |
+
el.addEventListener('mousedown', swiper.onTouchStart, false);
|
3491 |
+
doc.addEventListener('mousemove', swiper.onTouchMove, capture);
|
3492 |
+
doc.addEventListener('mouseup', swiper.onTouchEnd, false);
|
3493 |
+
}
|
3494 |
+
}
|
3495 |
+
// Prevent Links Clicks
|
3496 |
+
if (params.preventClicks || params.preventClicksPropagation) {
|
3497 |
+
el.addEventListener('click', swiper.onClick, true);
|
3498 |
+
}
|
3499 |
+
if (params.cssMode) {
|
3500 |
+
wrapperEl.addEventListener('scroll', swiper.onScroll);
|
3501 |
+
}
|
3502 |
+
|
3503 |
+
// Resize handler
|
3504 |
+
if (params.updateOnWindowResize) {
|
3505 |
+
swiper.on((Device.ios || Device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate'), onResize, true);
|
3506 |
+
} else {
|
3507 |
+
swiper.on('observerUpdate', onResize, true);
|
3508 |
+
}
|
3509 |
+
}
|
3510 |
+
|
3511 |
+
function detachEvents() {
|
3512 |
+
var swiper = this;
|
3513 |
+
|
3514 |
+
var params = swiper.params;
|
3515 |
+
var touchEvents = swiper.touchEvents;
|
3516 |
+
var el = swiper.el;
|
3517 |
+
var wrapperEl = swiper.wrapperEl;
|
3518 |
+
|
3519 |
+
var capture = !!params.nested;
|
3520 |
+
|
3521 |
+
// Touch Events
|
3522 |
+
if (!Support.touch && Support.pointerEvents) {
|
3523 |
+
el.removeEventListener(touchEvents.start, swiper.onTouchStart, false);
|
3524 |
+
doc.removeEventListener(touchEvents.move, swiper.onTouchMove, capture);
|
3525 |
+
doc.removeEventListener(touchEvents.end, swiper.onTouchEnd, false);
|
3526 |
+
} else {
|
3527 |
+
if (Support.touch) {
|
3528 |
+
var passiveListener = touchEvents.start === 'onTouchStart' && Support.passiveListener && params.passiveListeners ? { passive: true, capture: false } : false;
|
3529 |
+
el.removeEventListener(touchEvents.start, swiper.onTouchStart, passiveListener);
|
3530 |
+
el.removeEventListener(touchEvents.move, swiper.onTouchMove, capture);
|
3531 |
+
el.removeEventListener(touchEvents.end, swiper.onTouchEnd, passiveListener);
|
3532 |
+
if (touchEvents.cancel) {
|
3533 |
+
el.removeEventListener(touchEvents.cancel, swiper.onTouchEnd, passiveListener);
|
3534 |
+
}
|
3535 |
+
}
|
3536 |
+
if ((params.simulateTouch && !Device.ios && !Device.android) || (params.simulateTouch && !Support.touch && Device.ios)) {
|
3537 |
+
el.removeEventListener('mousedown', swiper.onTouchStart, false);
|
3538 |
+
doc.removeEventListener('mousemove', swiper.onTouchMove, capture);
|
3539 |
+
doc.removeEventListener('mouseup', swiper.onTouchEnd, false);
|
3540 |
+
}
|
3541 |
+
}
|
3542 |
+
// Prevent Links Clicks
|
3543 |
+
if (params.preventClicks || params.preventClicksPropagation) {
|
3544 |
+
el.removeEventListener('click', swiper.onClick, true);
|
3545 |
+
}
|
3546 |
+
|
3547 |
+
if (params.cssMode) {
|
3548 |
+
wrapperEl.removeEventListener('scroll', swiper.onScroll);
|
3549 |
+
}
|
3550 |
+
|
3551 |
+
// Resize handler
|
3552 |
+
swiper.off((Device.ios || Device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate'), onResize);
|
3553 |
+
}
|
3554 |
+
|
3555 |
+
var events = {
|
3556 |
+
attachEvents: attachEvents,
|
3557 |
+
detachEvents: detachEvents,
|
3558 |
+
};
|
3559 |
+
|
3560 |
+
function setBreakpoint () {
|
3561 |
+
var swiper = this;
|
3562 |
+
var activeIndex = swiper.activeIndex;
|
3563 |
+
var initialized = swiper.initialized;
|
3564 |
+
var loopedSlides = swiper.loopedSlides; if ( loopedSlides === void 0 ) loopedSlides = 0;
|
3565 |
+
var params = swiper.params;
|
3566 |
+
var $el = swiper.$el;
|
3567 |
+
var breakpoints = params.breakpoints;
|
3568 |
+
if (!breakpoints || (breakpoints && Object.keys(breakpoints).length === 0)) { return; }
|
3569 |
+
|
3570 |
+
// Get breakpoint for window width and update parameters
|
3571 |
+
var breakpoint = swiper.getBreakpoint(breakpoints);
|
3572 |
+
|
3573 |
+
if (breakpoint && swiper.currentBreakpoint !== breakpoint) {
|
3574 |
+
var breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
|
3575 |
+
if (breakpointOnlyParams) {
|
3576 |
+
['slidesPerView', 'spaceBetween', 'slidesPerGroup', 'slidesPerGroupSkip', 'slidesPerColumn'].forEach(function (param) {
|
3577 |
+
var paramValue = breakpointOnlyParams[param];
|
3578 |
+
if (typeof paramValue === 'undefined') { return; }
|
3579 |
+
if (param === 'slidesPerView' && (paramValue === 'AUTO' || paramValue === 'auto')) {
|
3580 |
+
breakpointOnlyParams[param] = 'auto';
|
3581 |
+
} else if (param === 'slidesPerView') {
|
3582 |
+
breakpointOnlyParams[param] = parseFloat(paramValue);
|
3583 |
+
} else {
|
3584 |
+
breakpointOnlyParams[param] = parseInt(paramValue, 10);
|
3585 |
+
}
|
3586 |
+
});
|
3587 |
+
}
|
3588 |
+
|
3589 |
+
var breakpointParams = breakpointOnlyParams || swiper.originalParams;
|
3590 |
+
var wasMultiRow = params.slidesPerColumn > 1;
|
3591 |
+
var isMultiRow = breakpointParams.slidesPerColumn > 1;
|
3592 |
+
if (wasMultiRow && !isMultiRow) {
|
3593 |
+
$el.removeClass(((params.containerModifierClass) + "multirow " + (params.containerModifierClass) + "multirow-column"));
|
3594 |
+
} else if (!wasMultiRow && isMultiRow) {
|
3595 |
+
$el.addClass(((params.containerModifierClass) + "multirow"));
|
3596 |
+
if (breakpointParams.slidesPerColumnFill === 'column') {
|
3597 |
+
$el.addClass(((params.containerModifierClass) + "multirow-column"));
|
3598 |
+
}
|
3599 |
+
}
|
3600 |
+
|
3601 |
+
var directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction;
|
3602 |
+
var needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged);
|
3603 |
+
|
3604 |
+
if (directionChanged && initialized) {
|
3605 |
+
swiper.changeDirection();
|
3606 |
+
}
|
3607 |
+
|
3608 |
+
Utils.extend(swiper.params, breakpointParams);
|
3609 |
+
|
3610 |
+
Utils.extend(swiper, {
|
3611 |
+
allowTouchMove: swiper.params.allowTouchMove,
|
3612 |
+
allowSlideNext: swiper.params.allowSlideNext,
|
3613 |
+
allowSlidePrev: swiper.params.allowSlidePrev,
|
3614 |
+
});
|
3615 |
+
|
3616 |
+
swiper.currentBreakpoint = breakpoint;
|
3617 |
+
|
3618 |
+
if (needsReLoop && initialized) {
|
3619 |
+
swiper.loopDestroy();
|
3620 |
+
swiper.loopCreate();
|
3621 |
+
swiper.updateSlides();
|
3622 |
+
swiper.slideTo((activeIndex - loopedSlides) + swiper.loopedSlides, 0, false);
|
3623 |
+
}
|
3624 |
+
|
3625 |
+
swiper.emit('breakpoint', breakpointParams);
|
3626 |
+
}
|
3627 |
+
}
|
3628 |
+
|
3629 |
+
function getBreakpoint (breakpoints) {
|
3630 |
+
// Get breakpoint for window width
|
3631 |
+
if (!breakpoints) { return undefined; }
|
3632 |
+
var breakpoint = false;
|
3633 |
+
|
3634 |
+
var points = Object.keys(breakpoints).map(function (point) {
|
3635 |
+
if (typeof point === 'string' && point.indexOf('@') === 0) {
|
3636 |
+
var minRatio = parseFloat(point.substr(1));
|
3637 |
+
var value = win.innerHeight * minRatio;
|
3638 |
+
return { value: value, point: point };
|
3639 |
+
}
|
3640 |
+
return { value: point, point: point };
|
3641 |
+
});
|
3642 |
+
|
3643 |
+
points.sort(function (a, b) { return parseInt(a.value, 10) - parseInt(b.value, 10); });
|
3644 |
+
for (var i = 0; i < points.length; i += 1) {
|
3645 |
+
var ref = points[i];
|
3646 |
+
var point = ref.point;
|
3647 |
+
var value = ref.value;
|
3648 |
+
if (value <= win.innerWidth) {
|
3649 |
+
breakpoint = point;
|
3650 |
+
}
|
3651 |
+
}
|
3652 |
+
return breakpoint || 'max';
|
3653 |
+
}
|
3654 |
+
|
3655 |
+
var breakpoints = { setBreakpoint: setBreakpoint, getBreakpoint: getBreakpoint };
|
3656 |
+
|
3657 |
+
function addClasses () {
|
3658 |
+
var swiper = this;
|
3659 |
+
var classNames = swiper.classNames;
|
3660 |
+
var params = swiper.params;
|
3661 |
+
var rtl = swiper.rtl;
|
3662 |
+
var $el = swiper.$el;
|
3663 |
+
var suffixes = [];
|
3664 |
+
|
3665 |
+
suffixes.push('initialized');
|
3666 |
+
suffixes.push(params.direction);
|
3667 |
+
|
3668 |
+
if (params.freeMode) {
|
3669 |
+
suffixes.push('free-mode');
|
3670 |
+
}
|
3671 |
+
if (params.autoHeight) {
|
3672 |
+
suffixes.push('autoheight');
|
3673 |
+
}
|
3674 |
+
if (rtl) {
|
3675 |
+
suffixes.push('rtl');
|
3676 |
+
}
|
3677 |
+
if (params.slidesPerColumn > 1) {
|
3678 |
+
suffixes.push('multirow');
|
3679 |
+
if (params.slidesPerColumnFill === 'column') {
|
3680 |
+
suffixes.push('multirow-column');
|
3681 |
+
}
|
3682 |
+
}
|
3683 |
+
if (Device.android) {
|
3684 |
+
suffixes.push('android');
|
3685 |
+
}
|
3686 |
+
if (Device.ios) {
|
3687 |
+
suffixes.push('ios');
|
3688 |
+
}
|
3689 |
+
|
3690 |
+
if (params.cssMode) {
|
3691 |
+
suffixes.push('css-mode');
|
3692 |
+
}
|
3693 |
+
|
3694 |
+
suffixes.forEach(function (suffix) {
|
3695 |
+
classNames.push(params.containerModifierClass + suffix);
|
3696 |
+
});
|
3697 |
+
|
3698 |
+
$el.addClass(classNames.join(' '));
|
3699 |
+
}
|
3700 |
+
|
3701 |
+
function removeClasses () {
|
3702 |
+
var swiper = this;
|
3703 |
+
var $el = swiper.$el;
|
3704 |
+
var classNames = swiper.classNames;
|
3705 |
+
|
3706 |
+
$el.removeClass(classNames.join(' '));
|
3707 |
+
}
|
3708 |
+
|
3709 |
+
var classes = { addClasses: addClasses, removeClasses: removeClasses };
|
3710 |
+
|
3711 |
+
function loadImage (imageEl, src, srcset, sizes, checkForComplete, callback) {
|
3712 |
+
var image;
|
3713 |
+
function onReady() {
|
3714 |
+
if (callback) { callback(); }
|
3715 |
+
}
|
3716 |
+
if (!imageEl.complete || !checkForComplete) {
|
3717 |
+
if (src) {
|
3718 |
+
image = new win.Image();
|
3719 |
+
image.onload = onReady;
|
3720 |
+
image.onerror = onReady;
|
3721 |
+
if (sizes) {
|
3722 |
+
image.sizes = sizes;
|
3723 |
+
}
|
3724 |
+
if (srcset) {
|
3725 |
+
image.srcset = srcset;
|
3726 |
+
}
|
3727 |
+
if (src) {
|
3728 |
+
image.src = src;
|
3729 |
+
}
|
3730 |
+
} else {
|
3731 |
+
onReady();
|
3732 |
+
}
|
3733 |
+
} else {
|
3734 |
+
// image already loaded...
|
3735 |
+
onReady();
|
3736 |
+
}
|
3737 |
+
}
|
3738 |
+
|
3739 |
+
function preloadImages () {
|
3740 |
+
var swiper = this;
|
3741 |
+
swiper.imagesToLoad = swiper.$el.find('img');
|
3742 |
+
function onReady() {
|
3743 |
+
if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper.destroyed) { return; }
|
3744 |
+
if (swiper.imagesLoaded !== undefined) { swiper.imagesLoaded += 1; }
|
3745 |
+
if (swiper.imagesLoaded === swiper.imagesToLoad.length) {
|
3746 |
+
if (swiper.params.updateOnImagesReady) { swiper.update(); }
|
3747 |
+
swiper.emit('imagesReady');
|
3748 |
+
}
|
3749 |
+
}
|
3750 |
+
for (var i = 0; i < swiper.imagesToLoad.length; i += 1) {
|
3751 |
+
var imageEl = swiper.imagesToLoad[i];
|
3752 |
+
swiper.loadImage(
|
3753 |
+
imageEl,
|
3754 |
+
imageEl.currentSrc || imageEl.getAttribute('src'),
|
3755 |
+
imageEl.srcset || imageEl.getAttribute('srcset'),
|
3756 |
+
imageEl.sizes || imageEl.getAttribute('sizes'),
|
3757 |
+
true,
|
3758 |
+
onReady
|
3759 |
+
);
|
3760 |
+
}
|
3761 |
+
}
|
3762 |
+
|
3763 |
+
var images = {
|
3764 |
+
loadImage: loadImage,
|
3765 |
+
preloadImages: preloadImages,
|
3766 |
+
};
|
3767 |
+
|
3768 |
+
function checkOverflow() {
|
3769 |
+
var swiper = this;
|
3770 |
+
var params = swiper.params;
|
3771 |
+
var wasLocked = swiper.isLocked;
|
3772 |
+
var lastSlidePosition = swiper.slides.length > 0 && (params.slidesOffsetBefore + (params.spaceBetween * (swiper.slides.length - 1)) + ((swiper.slides[0]).offsetWidth) * swiper.slides.length);
|
3773 |
+
|
3774 |
+
if (params.slidesOffsetBefore && params.slidesOffsetAfter && lastSlidePosition) {
|
3775 |
+
swiper.isLocked = lastSlidePosition <= swiper.size;
|
3776 |
+
} else {
|
3777 |
+
swiper.isLocked = swiper.snapGrid.length === 1;
|
3778 |
+
}
|
3779 |
+
|
3780 |
+
swiper.allowSlideNext = !swiper.isLocked;
|
3781 |
+
swiper.allowSlidePrev = !swiper.isLocked;
|
3782 |
+
|
3783 |
+
// events
|
3784 |
+
if (wasLocked !== swiper.isLocked) { swiper.emit(swiper.isLocked ? 'lock' : 'unlock'); }
|
3785 |
+
|
3786 |
+
if (wasLocked && wasLocked !== swiper.isLocked) {
|
3787 |
+
swiper.isEnd = false;
|
3788 |
+
swiper.navigation.update();
|
3789 |
+
}
|
3790 |
+
}
|
3791 |
+
|
3792 |
+
var checkOverflow$1 = { checkOverflow: checkOverflow };
|
3793 |
+
|
3794 |
+
var defaults = {
|
3795 |
+
init: true,
|
3796 |
+
direction: 'horizontal',
|
3797 |
+
touchEventsTarget: 'container',
|
3798 |
+
initialSlide: 0,
|
3799 |
+
speed: 300,
|
3800 |
+
cssMode: false,
|
3801 |
+
updateOnWindowResize: true,
|
3802 |
+
//
|
3803 |
+
preventInteractionOnTransition: false,
|
3804 |
+
|
3805 |
+
// To support iOS's swipe-to-go-back gesture (when being used in-app, with UIWebView).
|
3806 |
+
edgeSwipeDetection: false,
|
3807 |
+
edgeSwipeThreshold: 20,
|
3808 |
+
|
3809 |
+
// Free mode
|
3810 |
+
freeMode: false,
|
3811 |
+
freeModeMomentum: true,
|
3812 |
+
freeModeMomentumRatio: 1,
|
3813 |
+
freeModeMomentumBounce: true,
|
3814 |
+
freeModeMomentumBounceRatio: 1,
|
3815 |
+
freeModeMomentumVelocityRatio: 1,
|
3816 |
+
freeModeSticky: false,
|
3817 |
+
freeModeMinimumVelocity: 0.02,
|
3818 |
+
|
3819 |
+
// Autoheight
|
3820 |
+
autoHeight: false,
|
3821 |
+
|
3822 |
+
// Set wrapper width
|
3823 |
+
setWrapperSize: false,
|
3824 |
+
|
3825 |
+
// Virtual Translate
|
3826 |
+
virtualTranslate: false,
|
3827 |
+
|
3828 |
+
// Effects
|
3829 |
+
effect: 'slide', // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'
|
3830 |
+
|
3831 |
+
// Breakpoints
|
3832 |
+
breakpoints: undefined,
|
3833 |
+
|
3834 |
+
// Slides grid
|
3835 |
+
spaceBetween: 0,
|
3836 |
+
slidesPerView: 1,
|
3837 |
+
slidesPerColumn: 1,
|
3838 |
+
slidesPerColumnFill: 'column',
|
3839 |
+
slidesPerGroup: 1,
|
3840 |
+
slidesPerGroupSkip: 0,
|
3841 |
+
centeredSlides: false,
|
3842 |
+
centeredSlidesBounds: false,
|
3843 |
+
slidesOffsetBefore: 0, // in px
|
3844 |
+
slidesOffsetAfter: 0, // in px
|
3845 |
+
normalizeSlideIndex: true,
|
3846 |
+
centerInsufficientSlides: false,
|
3847 |
+
|
3848 |
+
// Disable swiper and hide navigation when container not overflow
|
3849 |
+
watchOverflow: false,
|
3850 |
+
|
3851 |
+
// Round length
|
3852 |
+
roundLengths: false,
|
3853 |
+
|
3854 |
+
// Touches
|
3855 |
+
touchRatio: 1,
|
3856 |
+
touchAngle: 45,
|
3857 |
+
simulateTouch: true,
|
3858 |
+
shortSwipes: true,
|
3859 |
+
longSwipes: true,
|
3860 |
+
longSwipesRatio: 0.5,
|
3861 |
+
longSwipesMs: 300,
|
3862 |
+
followFinger: true,
|
3863 |
+
allowTouchMove: true,
|
3864 |
+
threshold: 0,
|
3865 |
+
touchMoveStopPropagation: false,
|
3866 |
+
touchStartPreventDefault: true,
|
3867 |
+
touchStartForcePreventDefault: false,
|
3868 |
+
touchReleaseOnEdges: false,
|
3869 |
+
|
3870 |
+
// Unique Navigation Elements
|
3871 |
+
uniqueNavElements: true,
|
3872 |
+
|
3873 |
+
// Resistance
|
3874 |
+
resistance: true,
|
3875 |
+
resistanceRatio: 0.85,
|
3876 |
+
|
3877 |
+
// Progress
|
3878 |
+
watchSlidesProgress: false,
|
3879 |
+
watchSlidesVisibility: false,
|
3880 |
+
|
3881 |
+
// Cursor
|
3882 |
+
grabCursor: false,
|
3883 |
+
|
3884 |
+
// Clicks
|
3885 |
+
preventClicks: true,
|
3886 |
+
preventClicksPropagation: true,
|
3887 |
+
slideToClickedSlide: false,
|
3888 |
+
|
3889 |
+
// Images
|
3890 |
+
preloadImages: true,
|
3891 |
+
updateOnImagesReady: true,
|
3892 |
+
|
3893 |
+
// loop
|
3894 |
+
loop: false,
|
3895 |
+
loopAdditionalSlides: 0,
|
3896 |
+
loopedSlides: null,
|
3897 |
+
loopFillGroupWithBlank: false,
|
3898 |
+
|
3899 |
+
// Swiping/no swiping
|
3900 |
+
allowSlidePrev: true,
|
3901 |
+
allowSlideNext: true,
|
3902 |
+
swipeHandler: null, // '.swipe-handler',
|
3903 |
+
noSwiping: true,
|
3904 |
+
noSwipingClass: 'swiper-no-swiping',
|
3905 |
+
noSwipingSelector: null,
|
3906 |
+
|
3907 |
+
// Passive Listeners
|
3908 |
+
passiveListeners: true,
|
3909 |
+
|
3910 |
+
// NS
|
3911 |
+
containerModifierClass: 'swiper-container-', // NEW
|
3912 |
+
slideClass: 'swiper-slide',
|
3913 |
+
slideBlankClass: 'swiper-slide-invisible-blank',
|
3914 |
+
slideActiveClass: 'swiper-slide-active',
|
3915 |
+
slideDuplicateActiveClass: 'swiper-slide-duplicate-active',
|
3916 |
+
slideVisibleClass: 'swiper-slide-visible',
|
3917 |
+
slideDuplicateClass: 'swiper-slide-duplicate',
|
3918 |
+
slideNextClass: 'swiper-slide-next',
|
3919 |
+
slideDuplicateNextClass: 'swiper-slide-duplicate-next',
|
3920 |
+
slidePrevClass: 'swiper-slide-prev',
|
3921 |
+
slideDuplicatePrevClass: 'swiper-slide-duplicate-prev',
|
3922 |
+
wrapperClass: 'swiper-wrapper',
|
3923 |
+
|
3924 |
+
// Callbacks
|
3925 |
+
runCallbacksOnInit: true,
|
3926 |
+
};
|
3927 |
+
|
3928 |
+
/* eslint no-param-reassign: "off" */
|
3929 |
+
|
3930 |
+
var prototypes = {
|
3931 |
+
update: update,
|
3932 |
+
translate: translate,
|
3933 |
+
transition: transition$1,
|
3934 |
+
slide: slide,
|
3935 |
+
loop: loop,
|
3936 |
+
grabCursor: grabCursor,
|
3937 |
+
manipulation: manipulation,
|
3938 |
+
events: events,
|
3939 |
+
breakpoints: breakpoints,
|
3940 |
+
checkOverflow: checkOverflow$1,
|
3941 |
+
classes: classes,
|
3942 |
+
images: images,
|
3943 |
+
};
|
3944 |
+
|
3945 |
+
var extendedDefaults = {};
|
3946 |
+
|
3947 |
+
var Swiper = /*@__PURE__*/(function (SwiperClass) {
|
3948 |
+
function Swiper() {
|
3949 |
+
var assign;
|
3950 |
+
|
3951 |
+
var args = [], len = arguments.length;
|
3952 |
+
while ( len-- ) args[ len ] = arguments[ len ];
|
3953 |
+
var el;
|
3954 |
+
var params;
|
3955 |
+
if (args.length === 1 && args[0].constructor && args[0].constructor === Object) {
|
3956 |
+
params = args[0];
|
3957 |
+
} else {
|
3958 |
+
(assign = args, el = assign[0], params = assign[1]);
|
3959 |
+
}
|
3960 |
+
if (!params) { params = {}; }
|
3961 |
+
|
3962 |
+
params = Utils.extend({}, params);
|
3963 |
+
if (el && !params.el) { params.el = el; }
|
3964 |
+
|
3965 |
+
SwiperClass.call(this, params);
|
3966 |
+
|
3967 |
+
Object.keys(prototypes).forEach(function (prototypeGroup) {
|
3968 |
+
Object.keys(prototypes[prototypeGroup]).forEach(function (protoMethod) {
|
3969 |
+
if (!Swiper.prototype[protoMethod]) {
|
3970 |
+
Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod];
|
3971 |
+
}
|
3972 |
+
});
|
3973 |
+
});
|
3974 |
+
|
3975 |
+
// Swiper Instance
|
3976 |
+
var swiper = this;
|
3977 |
+
if (typeof swiper.modules === 'undefined') {
|
3978 |
+
swiper.modules = {};
|
3979 |
+
}
|
3980 |
+
Object.keys(swiper.modules).forEach(function (moduleName) {
|
3981 |
+
var module = swiper.modules[moduleName];
|
3982 |
+
if (module.params) {
|
3983 |
+
var moduleParamName = Object.keys(module.params)[0];
|
3984 |
+
var moduleParams = module.params[moduleParamName];
|
3985 |
+
if (typeof moduleParams !== 'object' || moduleParams === null) { return; }
|
3986 |
+
if (!(moduleParamName in params && 'enabled' in moduleParams)) { return; }
|
3987 |
+
if (params[moduleParamName] === true) {
|
3988 |
+
params[moduleParamName] = { enabled: true };
|
3989 |
+
}
|
3990 |
+
if (
|
3991 |
+
typeof params[moduleParamName] === 'object'
|
3992 |
+
&& !('enabled' in params[moduleParamName])
|
3993 |
+
) {
|
3994 |
+
params[moduleParamName].enabled = true;
|
3995 |
+
}
|
3996 |
+
if (!params[moduleParamName]) { params[moduleParamName] = { enabled: false }; }
|
3997 |
+
}
|
3998 |
+
});
|
3999 |
+
|
4000 |
+
// Extend defaults with modules params
|
4001 |
+
var swiperParams = Utils.extend({}, defaults);
|
4002 |
+
swiper.useModulesParams(swiperParams);
|
4003 |
+
|
4004 |
+
// Extend defaults with passed params
|
4005 |
+
swiper.params = Utils.extend({}, swiperParams, extendedDefaults, params);
|
4006 |
+
swiper.originalParams = Utils.extend({}, swiper.params);
|
4007 |
+
swiper.passedParams = Utils.extend({}, params);
|
4008 |
+
|
4009 |
+
// Save Dom lib
|
4010 |
+
swiper.$ = $;
|
4011 |
+
|
4012 |
+
// Find el
|
4013 |
+
var $el = $(swiper.params.el);
|
4014 |
+
el = $el[0];
|
4015 |
+
|
4016 |
+
if (!el) {
|
4017 |
+
return undefined;
|
4018 |
+
}
|
4019 |
+
|
4020 |
+
if ($el.length > 1) {
|
4021 |
+
var swipers = [];
|
4022 |
+
$el.each(function (index, containerEl) {
|
4023 |
+
var newParams = Utils.extend({}, params, { el: containerEl });
|
4024 |
+
swipers.push(new Swiper(newParams));
|
4025 |
+
});
|
4026 |
+
return swipers;
|
4027 |
+
}
|
4028 |
+
|
4029 |
+
el.swiper = swiper;
|
4030 |
+
$el.data('swiper', swiper);
|
4031 |
+
|
4032 |
+
// Find Wrapper
|
4033 |
+
var $wrapperEl;
|
4034 |
+
if (el && el.shadowRoot && el.shadowRoot.querySelector) {
|
4035 |
+
$wrapperEl = $(el.shadowRoot.querySelector(("." + (swiper.params.wrapperClass))));
|
4036 |
+
// Children needs to return slot items
|
4037 |
+
$wrapperEl.children = function (options) { return $el.children(options); };
|
4038 |
+
} else {
|
4039 |
+
$wrapperEl = $el.children(("." + (swiper.params.wrapperClass)));
|
4040 |
+
}
|
4041 |
+
// Extend Swiper
|
4042 |
+
Utils.extend(swiper, {
|
4043 |
+
$el: $el,
|
4044 |
+
el: el,
|
4045 |
+
$wrapperEl: $wrapperEl,
|
4046 |
+
wrapperEl: $wrapperEl[0],
|
4047 |
+
|
4048 |
+
// Classes
|
4049 |
+
classNames: [],
|
4050 |
+
|
4051 |
+
// Slides
|
4052 |
+
slides: $(),
|
4053 |
+
slidesGrid: [],
|
4054 |
+
snapGrid: [],
|
4055 |
+
slidesSizesGrid: [],
|
4056 |
+
|
4057 |
+
// isDirection
|
4058 |
+
isHorizontal: function isHorizontal() {
|
4059 |
+
return swiper.params.direction === 'horizontal';
|
4060 |
+
},
|
4061 |
+
isVertical: function isVertical() {
|
4062 |
+
return swiper.params.direction === 'vertical';
|
4063 |
+
},
|
4064 |
+
// RTL
|
4065 |
+
rtl: (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'),
|
4066 |
+
rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'),
|
4067 |
+
wrongRTL: $wrapperEl.css('display') === '-webkit-box',
|
4068 |
+
|
4069 |
+
// Indexes
|
4070 |
+
activeIndex: 0,
|
4071 |
+
realIndex: 0,
|
4072 |
+
|
4073 |
+
//
|
4074 |
+
isBeginning: true,
|
4075 |
+
isEnd: false,
|
4076 |
+
|
4077 |
+
// Props
|
4078 |
+
translate: 0,
|
4079 |
+
previousTranslate: 0,
|
4080 |
+
progress: 0,
|
4081 |
+
velocity: 0,
|
4082 |
+
animating: false,
|
4083 |
+
|
4084 |
+
// Locks
|
4085 |
+
allowSlideNext: swiper.params.allowSlideNext,
|
4086 |
+
allowSlidePrev: swiper.params.allowSlidePrev,
|
4087 |
+
|
4088 |
+
// Touch Events
|
4089 |
+
touchEvents: (function touchEvents() {
|
4090 |
+
var touch = ['touchstart', 'touchmove', 'touchend', 'touchcancel'];
|
4091 |
+
var desktop = ['mousedown', 'mousemove', 'mouseup'];
|
4092 |
+
if (Support.pointerEvents) {
|
4093 |
+
desktop = ['pointerdown', 'pointermove', 'pointerup'];
|
4094 |
+
}
|
4095 |
+
swiper.touchEventsTouch = {
|
4096 |
+
start: touch[0],
|
4097 |
+
move: touch[1],
|
4098 |
+
end: touch[2],
|
4099 |
+
cancel: touch[3],
|
4100 |
+
};
|
4101 |
+
swiper.touchEventsDesktop = {
|
4102 |
+
start: desktop[0],
|
4103 |
+
move: desktop[1],
|
4104 |
+
end: desktop[2],
|
4105 |
+
};
|
4106 |
+
return Support.touch || !swiper.params.simulateTouch ? swiper.touchEventsTouch : swiper.touchEventsDesktop;
|
4107 |
+
}()),
|
4108 |
+
touchEventsData: {
|
4109 |
+
isTouched: undefined,
|
4110 |
+
isMoved: undefined,
|
4111 |
+
allowTouchCallbacks: undefined,
|
4112 |
+
touchStartTime: undefined,
|
4113 |
+
isScrolling: undefined,
|
4114 |
+
currentTranslate: undefined,
|
4115 |
+
startTranslate: undefined,
|
4116 |
+
allowThresholdMove: undefined,
|
4117 |
+
// Form elements to match
|
4118 |
+
formElements: 'input, select, option, textarea, button, video, label',
|
4119 |
+
// Last click time
|
4120 |
+
lastClickTime: Utils.now(),
|
4121 |
+
clickTimeout: undefined,
|
4122 |
+
// Velocities
|
4123 |
+
velocities: [],
|
4124 |
+
allowMomentumBounce: undefined,
|
4125 |
+
isTouchEvent: undefined,
|
4126 |
+
startMoving: undefined,
|
4127 |
+
},
|
4128 |
+
|
4129 |
+
// Clicks
|
4130 |
+
allowClick: true,
|
4131 |
+
|
4132 |
+
// Touches
|
4133 |
+
allowTouchMove: swiper.params.allowTouchMove,
|
4134 |
+
|
4135 |
+
touches: {
|
4136 |
+
startX: 0,
|
4137 |
+
startY: 0,
|
4138 |
+
currentX: 0,
|
4139 |
+
currentY: 0,
|
4140 |
+
diff: 0,
|
4141 |
+
},
|
4142 |
+
|
4143 |
+
// Images
|
4144 |
+
imagesToLoad: [],
|
4145 |
+
imagesLoaded: 0,
|
4146 |
+
|
4147 |
+
});
|
4148 |
+
|
4149 |
+
// Install Modules
|
4150 |
+
swiper.useModules();
|
4151 |
+
|
4152 |
+
// Init
|
4153 |
+
if (swiper.params.init) {
|
4154 |
+
swiper.init();
|
4155 |
+
}
|
4156 |
+
|
4157 |
+
// Return app instance
|
4158 |
+
return swiper;
|
4159 |
+
}
|
4160 |
+
|
4161 |
+
if ( SwiperClass ) Swiper.__proto__ = SwiperClass;
|
4162 |
+
Swiper.prototype = Object.create( SwiperClass && SwiperClass.prototype );
|
4163 |
+
Swiper.prototype.constructor = Swiper;
|
4164 |
+
|
4165 |
+
var staticAccessors = { extendedDefaults: { configurable: true },defaults: { configurable: true },Class: { configurable: true },$: { configurable: true } };
|
4166 |
+
|
4167 |
+
Swiper.prototype.slidesPerViewDynamic = function slidesPerViewDynamic () {
|
4168 |
+
var swiper = this;
|
4169 |
+
var params = swiper.params;
|
4170 |
+
var slides = swiper.slides;
|
4171 |
+
var slidesGrid = swiper.slidesGrid;
|
4172 |
+
var swiperSize = swiper.size;
|
4173 |
+
var activeIndex = swiper.activeIndex;
|
4174 |
+
var spv = 1;
|
4175 |
+
if (params.centeredSlides) {
|
4176 |
+
var slideSize = slides[activeIndex].swiperSlideSize;
|
4177 |
+
var breakLoop;
|
4178 |
+
for (var i = activeIndex + 1; i < slides.length; i += 1) {
|
4179 |
+
if (slides[i] && !breakLoop) {
|
4180 |
+
slideSize += slides[i].swiperSlideSize;
|
4181 |
+
spv += 1;
|
4182 |
+
if (slideSize > swiperSize) { breakLoop = true; }
|
4183 |
+
}
|
4184 |
+
}
|
4185 |
+
for (var i$1 = activeIndex - 1; i$1 >= 0; i$1 -= 1) {
|
4186 |
+
if (slides[i$1] && !breakLoop) {
|
4187 |
+
slideSize += slides[i$1].swiperSlideSize;
|
4188 |
+
spv += 1;
|
4189 |
+
if (slideSize > swiperSize) { breakLoop = true; }
|
4190 |
+
}
|
4191 |
+
}
|
4192 |
+
} else {
|
4193 |
+
for (var i$2 = activeIndex + 1; i$2 < slides.length; i$2 += 1) {
|
4194 |
+
if (slidesGrid[i$2] - slidesGrid[activeIndex] < swiperSize) {
|
4195 |
+
spv += 1;
|
4196 |
+
}
|
4197 |
+
}
|
4198 |
+
}
|
4199 |
+
return spv;
|
4200 |
+
};
|
4201 |
+
|
4202 |
+
Swiper.prototype.update = function update () {
|
4203 |
+
var swiper = this;
|
4204 |
+
if (!swiper || swiper.destroyed) { return; }
|
4205 |
+
var snapGrid = swiper.snapGrid;
|
4206 |
+
var params = swiper.params;
|
4207 |
+
// Breakpoints
|
4208 |
+
if (params.breakpoints) {
|
4209 |
+
swiper.setBreakpoint();
|
4210 |
+
}
|
4211 |
+
swiper.updateSize();
|
4212 |
+
swiper.updateSlides();
|
4213 |
+
swiper.updateProgress();
|
4214 |
+
swiper.updateSlidesClasses();
|
4215 |
+
|
4216 |
+
function setTranslate() {
|
4217 |
+
var translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate;
|
4218 |
+
var newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate());
|
4219 |
+
swiper.setTranslate(newTranslate);
|
4220 |
+
swiper.updateActiveIndex();
|
4221 |
+
swiper.updateSlidesClasses();
|
4222 |
+
}
|
4223 |
+
var translated;
|
4224 |
+
if (swiper.params.freeMode) {
|
4225 |
+
setTranslate();
|
4226 |
+
if (swiper.params.autoHeight) {
|
4227 |
+
swiper.updateAutoHeight();
|
4228 |
+
}
|
4229 |
+
} else {
|
4230 |
+
if ((swiper.params.slidesPerView === 'auto' || swiper.params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) {
|
4231 |
+
translated = swiper.slideTo(swiper.slides.length - 1, 0, false, true);
|
4232 |
+
} else {
|
4233 |
+
translated = swiper.slideTo(swiper.activeIndex, 0, false, true);
|
4234 |
+
}
|
4235 |
+
if (!translated) {
|
4236 |
+
setTranslate();
|
4237 |
+
}
|
4238 |
+
}
|
4239 |
+
if (params.watchOverflow && snapGrid !== swiper.snapGrid) {
|
4240 |
+
swiper.checkOverflow();
|
4241 |
+
}
|
4242 |
+
swiper.emit('update');
|
4243 |
+
};
|
4244 |
+
|
4245 |
+
Swiper.prototype.changeDirection = function changeDirection (newDirection, needUpdate) {
|
4246 |
+
if ( needUpdate === void 0 ) needUpdate = true;
|
4247 |
+
|
4248 |
+
var swiper = this;
|
4249 |
+
var currentDirection = swiper.params.direction;
|
4250 |
+
if (!newDirection) {
|
4251 |
+
// eslint-disable-next-line
|
4252 |
+
newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal';
|
4253 |
+
}
|
4254 |
+
if ((newDirection === currentDirection) || (newDirection !== 'horizontal' && newDirection !== 'vertical')) {
|
4255 |
+
return swiper;
|
4256 |
+
}
|
4257 |
+
|
4258 |
+
swiper.$el
|
4259 |
+
.removeClass(("" + (swiper.params.containerModifierClass) + currentDirection))
|
4260 |
+
.addClass(("" + (swiper.params.containerModifierClass) + newDirection));
|
4261 |
+
|
4262 |
+
swiper.params.direction = newDirection;
|
4263 |
+
|
4264 |
+
swiper.slides.each(function (slideIndex, slideEl) {
|
4265 |
+
if (newDirection === 'vertical') {
|
4266 |
+
slideEl.style.width = '';
|
4267 |
+
} else {
|
4268 |
+
slideEl.style.height = '';
|
4269 |
+
}
|
4270 |
+
});
|
4271 |
+
|
4272 |
+
swiper.emit('changeDirection');
|
4273 |
+
if (needUpdate) { swiper.update(); }
|
4274 |
+
|
4275 |
+
return swiper;
|
4276 |
+
};
|
4277 |
+
|
4278 |
+
Swiper.prototype.init = function init () {
|
4279 |
+
var swiper = this;
|
4280 |
+
if (swiper.initialized) { return; }
|
4281 |
+
|
4282 |
+
swiper.emit('beforeInit');
|
4283 |
+
|
4284 |
+
// Set breakpoint
|
4285 |
+
if (swiper.params.breakpoints) {
|
4286 |
+
swiper.setBreakpoint();
|
4287 |
+
}
|
4288 |
+
|
4289 |
+
// Add Classes
|
4290 |
+
swiper.addClasses();
|
4291 |
+
|
4292 |
+
// Create loop
|
4293 |
+
if (swiper.params.loop) {
|
4294 |
+
swiper.loopCreate();
|
4295 |
+
}
|
4296 |
+
|
4297 |
+
// Update size
|
4298 |
+
swiper.updateSize();
|
4299 |
+
|
4300 |
+
// Update slides
|
4301 |
+
swiper.updateSlides();
|
4302 |
+
|
4303 |
+
if (swiper.params.watchOverflow) {
|
4304 |
+
swiper.checkOverflow();
|
4305 |
+
}
|
4306 |
+
|
4307 |
+
// Set Grab Cursor
|
4308 |
+
if (swiper.params.grabCursor) {
|
4309 |
+
swiper.setGrabCursor();
|
4310 |
+
}
|
4311 |
+
|
4312 |
+
if (swiper.params.preloadImages) {
|
4313 |
+
swiper.preloadImages();
|
4314 |
+
}
|
4315 |
+
|
4316 |
+
// Slide To Initial Slide
|
4317 |
+
if (swiper.params.loop) {
|
4318 |
+
swiper.slideTo(swiper.params.initialSlide + swiper.loopedSlides, 0, swiper.params.runCallbacksOnInit);
|
4319 |
+
} else {
|
4320 |
+
swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit);
|
4321 |
+
}
|
4322 |
+
|
4323 |
+
// Attach events
|
4324 |
+
swiper.attachEvents();
|
4325 |
+
|
4326 |
+
// Init Flag
|
4327 |
+
swiper.initialized = true;
|
4328 |
+
|
4329 |
+
// Emit
|
4330 |
+
swiper.emit('init');
|
4331 |
+
};
|
4332 |
+
|
4333 |
+
Swiper.prototype.destroy = function destroy (deleteInstance, cleanStyles) {
|
4334 |
+
if ( deleteInstance === void 0 ) deleteInstance = true;
|
4335 |
+
if ( cleanStyles === void 0 ) cleanStyles = true;
|
4336 |
+
|
4337 |
+
var swiper = this;
|
4338 |
+
var params = swiper.params;
|
4339 |
+
var $el = swiper.$el;
|
4340 |
+
var $wrapperEl = swiper.$wrapperEl;
|
4341 |
+
var slides = swiper.slides;
|
4342 |
+
|
4343 |
+
if (typeof swiper.params === 'undefined' || swiper.destroyed) {
|
4344 |
+
return null;
|
4345 |
+
}
|
4346 |
+
|
4347 |
+
swiper.emit('beforeDestroy');
|
4348 |
+
|
4349 |
+
// Init Flag
|
4350 |
+
swiper.initialized = false;
|
4351 |
+
|
4352 |
+
// Detach events
|
4353 |
+
swiper.detachEvents();
|
4354 |
+
|
4355 |
+
// Destroy loop
|
4356 |
+
if (params.loop) {
|
4357 |
+
swiper.loopDestroy();
|
4358 |
+
}
|
4359 |
+
|
4360 |
+
// Cleanup styles
|
4361 |
+
if (cleanStyles) {
|
4362 |
+
swiper.removeClasses();
|
4363 |
+
$el.removeAttr('style');
|
4364 |
+
$wrapperEl.removeAttr('style');
|
4365 |
+
if (slides && slides.length) {
|
4366 |
+
slides
|
4367 |
+
.removeClass([
|
4368 |
+
params.slideVisibleClass,
|
4369 |
+
params.slideActiveClass,
|
4370 |
+
params.slideNextClass,
|
4371 |
+
params.slidePrevClass ].join(' '))
|
4372 |
+
.removeAttr('style')
|
4373 |
+
.removeAttr('data-swiper-slide-index');
|
4374 |
+
}
|
4375 |
+
}
|
4376 |
+
|
4377 |
+
swiper.emit('destroy');
|
4378 |
+
|
4379 |
+
// Detach emitter events
|
4380 |
+
Object.keys(swiper.eventsListeners).forEach(function (eventName) {
|
4381 |
+
swiper.off(eventName);
|
4382 |
+
});
|
4383 |
+
|
4384 |
+
if (deleteInstance !== false) {
|
4385 |
+
swiper.$el[0].swiper = null;
|
4386 |
+
swiper.$el.data('swiper', null);
|
4387 |
+
Utils.deleteProps(swiper);
|
4388 |
+
}
|
4389 |
+
swiper.destroyed = true;
|
4390 |
+
|
4391 |
+
return null;
|
4392 |
+
};
|
4393 |
+
|
4394 |
+
Swiper.extendDefaults = function extendDefaults (newDefaults) {
|
4395 |
+
Utils.extend(extendedDefaults, newDefaults);
|
4396 |
+
};
|
4397 |
+
|
4398 |
+
staticAccessors.extendedDefaults.get = function () {
|
4399 |
+
return extendedDefaults;
|
4400 |
+
};
|
4401 |
+
|
4402 |
+
staticAccessors.defaults.get = function () {
|
4403 |
+
return defaults;
|
4404 |
+
};
|
4405 |
+
|
4406 |
+
staticAccessors.Class.get = function () {
|
4407 |
+
return SwiperClass;
|
4408 |
+
};
|
4409 |
+
|
4410 |
+
staticAccessors.$.get = function () {
|
4411 |
+
return $;
|
4412 |
+
};
|
4413 |
+
|
4414 |
+
Object.defineProperties( Swiper, staticAccessors );
|
4415 |
+
|
4416 |
+
return Swiper;
|
4417 |
+
}(SwiperClass));
|
4418 |
+
|
4419 |
+
var Device$1 = {
|
4420 |
+
name: 'device',
|
4421 |
+
proto: {
|
4422 |
+
device: Device,
|
4423 |
+
},
|
4424 |
+
static: {
|
4425 |
+
device: Device,
|
4426 |
+
},
|
4427 |
+
};
|
4428 |
+
|
4429 |
+
var Support$1 = {
|
4430 |
+
name: 'support',
|
4431 |
+
proto: {
|
4432 |
+
support: Support,
|
4433 |
+
},
|
4434 |
+
static: {
|
4435 |
+
support: Support,
|
4436 |
+
},
|
4437 |
+
};
|
4438 |
+
|
4439 |
+
var Browser = (function Browser() {
|
4440 |
+
function isSafari() {
|
4441 |
+
var ua = win.navigator.userAgent.toLowerCase();
|
4442 |
+
return (ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0);
|
4443 |
+
}
|
4444 |
+
return {
|
4445 |
+
isEdge: !!win.navigator.userAgent.match(/Edge/g),
|
4446 |
+
isSafari: isSafari(),
|
4447 |
+
isUiWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(win.navigator.userAgent),
|
4448 |
+
};
|
4449 |
+
}());
|
4450 |
+
|
4451 |
+
var Browser$1 = {
|
4452 |
+
name: 'browser',
|
4453 |
+
proto: {
|
4454 |
+
browser: Browser,
|
4455 |
+
},
|
4456 |
+
static: {
|
4457 |
+
browser: Browser,
|
4458 |
+
},
|
4459 |
+
};
|
4460 |
+
|
4461 |
+
var Resize = {
|
4462 |
+
name: 'resize',
|
4463 |
+
create: function create() {
|
4464 |
+
var swiper = this;
|
4465 |
+
Utils.extend(swiper, {
|
4466 |
+
resize: {
|
4467 |
+
resizeHandler: function resizeHandler() {
|
4468 |
+
if (!swiper || swiper.destroyed || !swiper.initialized) { return; }
|
4469 |
+
swiper.emit('beforeResize');
|
4470 |
+
swiper.emit('resize');
|
4471 |
+
},
|
4472 |
+
orientationChangeHandler: function orientationChangeHandler() {
|
4473 |
+
if (!swiper || swiper.destroyed || !swiper.initialized) { return; }
|
4474 |
+
swiper.emit('orientationchange');
|
4475 |
+
},
|
4476 |
+
},
|
4477 |
+
});
|
4478 |
+
},
|
4479 |
+
on: {
|
4480 |
+
init: function init() {
|
4481 |
+
var swiper = this;
|
4482 |
+
// Emit resize
|
4483 |
+
win.addEventListener('resize', swiper.resize.resizeHandler);
|
4484 |
+
|
4485 |
+
// Emit orientationchange
|
4486 |
+
win.addEventListener('orientationchange', swiper.resize.orientationChangeHandler);
|
4487 |
+
},
|
4488 |
+
destroy: function destroy() {
|
4489 |
+
var swiper = this;
|
4490 |
+
win.removeEventListener('resize', swiper.resize.resizeHandler);
|
4491 |
+
win.removeEventListener('orientationchange', swiper.resize.orientationChangeHandler);
|
4492 |
+
},
|
4493 |
+
},
|
4494 |
+
};
|
4495 |
+
|
4496 |
+
var Observer = {
|
4497 |
+
func: win.MutationObserver || win.WebkitMutationObserver,
|
4498 |
+
attach: function attach(target, options) {
|
4499 |
+
if ( options === void 0 ) options = {};
|
4500 |
+
|
4501 |
+
var swiper = this;
|
4502 |
+
|
4503 |
+
var ObserverFunc = Observer.func;
|
4504 |
+
var observer = new ObserverFunc(function (mutations) {
|
4505 |
+
// The observerUpdate event should only be triggered
|
4506 |
+
// once despite the number of mutations. Additional
|
4507 |
+
// triggers are redundant and are very costly
|
4508 |
+
if (mutations.length === 1) {
|
4509 |
+
swiper.emit('observerUpdate', mutations[0]);
|
4510 |
+
return;
|
4511 |
+
}
|
4512 |
+
var observerUpdate = function observerUpdate() {
|
4513 |
+
swiper.emit('observerUpdate', mutations[0]);
|
4514 |
+
};
|
4515 |
+
|
4516 |
+
if (win.requestAnimationFrame) {
|
4517 |
+
win.requestAnimationFrame(observerUpdate);
|
4518 |
+
} else {
|
4519 |
+
win.setTimeout(observerUpdate, 0);
|
4520 |
+
}
|
4521 |
+
});
|
4522 |
+
|
4523 |
+
observer.observe(target, {
|
4524 |
+
attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
|
4525 |
+
childList: typeof options.childList === 'undefined' ? true : options.childList,
|
4526 |
+
characterData: typeof options.characterData === 'undefined' ? true : options.characterData,
|
4527 |
+
});
|
4528 |
+
|
4529 |
+
swiper.observer.observers.push(observer);
|
4530 |
+
},
|
4531 |
+
init: function init() {
|
4532 |
+
var swiper = this;
|
4533 |
+
if (!Support.observer || !swiper.params.observer) { return; }
|
4534 |
+
if (swiper.params.observeParents) {
|
4535 |
+
var containerParents = swiper.$el.parents();
|
4536 |
+
for (var i = 0; i < containerParents.length; i += 1) {
|
4537 |
+
swiper.observer.attach(containerParents[i]);
|
4538 |
+
}
|
4539 |
+
}
|
4540 |
+
// Observe container
|
4541 |
+
swiper.observer.attach(swiper.$el[0], { childList: swiper.params.observeSlideChildren });
|
4542 |
+
|
4543 |
+
// Observe wrapper
|
4544 |
+
swiper.observer.attach(swiper.$wrapperEl[0], { attributes: false });
|
4545 |
+
},
|
4546 |
+
destroy: function destroy() {
|
4547 |
+
var swiper = this;
|
4548 |
+
swiper.observer.observers.forEach(function (observer) {
|
4549 |
+
observer.disconnect();
|
4550 |
+
});
|
4551 |
+
swiper.observer.observers = [];
|
4552 |
+
},
|
4553 |
+
};
|
4554 |
+
|
4555 |
+
var Observer$1 = {
|
4556 |
+
name: 'observer',
|
4557 |
+
params: {
|
4558 |
+
observer: false,
|
4559 |
+
observeParents: false,
|
4560 |
+
observeSlideChildren: false,
|
4561 |
+
},
|
4562 |
+
create: function create() {
|
4563 |
+
var swiper = this;
|
4564 |
+
Utils.extend(swiper, {
|
4565 |
+
observer: {
|
4566 |
+
init: Observer.init.bind(swiper),
|
4567 |
+
attach: Observer.attach.bind(swiper),
|
4568 |
+
destroy: Observer.destroy.bind(swiper),
|
4569 |
+
observers: [],
|
4570 |
+
},
|
4571 |
+
});
|
4572 |
+
},
|
4573 |
+
on: {
|
4574 |
+
init: function init() {
|
4575 |
+
var swiper = this;
|
4576 |
+
swiper.observer.init();
|
4577 |
+
},
|
4578 |
+
destroy: function destroy() {
|
4579 |
+
var swiper = this;
|
4580 |
+
swiper.observer.destroy();
|
4581 |
+
},
|
4582 |
+
},
|
4583 |
+
};
|
4584 |
+
|
4585 |
+
var Virtual = {
|
4586 |
+
update: function update(force) {
|
4587 |
+
var swiper = this;
|
4588 |
+
var ref = swiper.params;
|
4589 |
+
var slidesPerView = ref.slidesPerView;
|
4590 |
+
var slidesPerGroup = ref.slidesPerGroup;
|
4591 |
+
var centeredSlides = ref.centeredSlides;
|
4592 |
+
var ref$1 = swiper.params.virtual;
|
4593 |
+
var addSlidesBefore = ref$1.addSlidesBefore;
|
4594 |
+
var addSlidesAfter = ref$1.addSlidesAfter;
|
4595 |
+
var ref$2 = swiper.virtual;
|
4596 |
+
var previousFrom = ref$2.from;
|
4597 |
+
var previousTo = ref$2.to;
|
4598 |
+
var slides = ref$2.slides;
|
4599 |
+
var previousSlidesGrid = ref$2.slidesGrid;
|
4600 |
+
var renderSlide = ref$2.renderSlide;
|
4601 |
+
var previousOffset = ref$2.offset;
|
4602 |
+
swiper.updateActiveIndex();
|
4603 |
+
var activeIndex = swiper.activeIndex || 0;
|
4604 |
+
|
4605 |
+
var offsetProp;
|
4606 |
+
if (swiper.rtlTranslate) { offsetProp = 'right'; }
|
4607 |
+
else { offsetProp = swiper.isHorizontal() ? 'left' : 'top'; }
|
4608 |
+
|
4609 |
+
var slidesAfter;
|
4610 |
+
var slidesBefore;
|
4611 |
+
if (centeredSlides) {
|
4612 |
+
slidesAfter = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesBefore;
|
4613 |
+
slidesBefore = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesAfter;
|
4614 |
+
} else {
|
4615 |
+
slidesAfter = slidesPerView + (slidesPerGroup - 1) + addSlidesBefore;
|
4616 |
+
slidesBefore = slidesPerGroup + addSlidesAfter;
|
4617 |
+
}
|
4618 |
+
var from = Math.max((activeIndex || 0) - slidesBefore, 0);
|
4619 |
+
var to = Math.min((activeIndex || 0) + slidesAfter, slides.length - 1);
|
4620 |
+
var offset = (swiper.slidesGrid[from] || 0) - (swiper.slidesGrid[0] || 0);
|
4621 |
+
|
4622 |
+
Utils.extend(swiper.virtual, {
|
4623 |
+
from: from,
|
4624 |
+
to: to,
|
4625 |
+
offset: offset,
|
4626 |
+
slidesGrid: swiper.slidesGrid,
|
4627 |
+
});
|
4628 |
+
|
4629 |
+
function onRendered() {
|
4630 |
+
swiper.updateSlides();
|
4631 |
+
swiper.updateProgress();
|
4632 |
+
swiper.updateSlidesClasses();
|
4633 |
+
if (swiper.lazy && swiper.params.lazy.enabled) {
|
4634 |
+
swiper.lazy.load();
|
4635 |
+
}
|
4636 |
+
}
|
4637 |
+
|
4638 |
+
if (previousFrom === from && previousTo === to && !force) {
|
4639 |
+
if (swiper.slidesGrid !== previousSlidesGrid && offset !== previousOffset) {
|
4640 |
+
swiper.slides.css(offsetProp, (offset + "px"));
|
4641 |
+
}
|
4642 |
+
swiper.updateProgress();
|
4643 |
+
return;
|
4644 |
+
}
|
4645 |
+
if (swiper.params.virtual.renderExternal) {
|
4646 |
+
swiper.params.virtual.renderExternal.call(swiper, {
|
4647 |
+
offset: offset,
|
4648 |
+
from: from,
|
4649 |
+
to: to,
|
4650 |
+
slides: (function getSlides() {
|
4651 |
+
var slidesToRender = [];
|
4652 |
+
for (var i = from; i <= to; i += 1) {
|
4653 |
+
slidesToRender.push(slides[i]);
|
4654 |
+
}
|
4655 |
+
return slidesToRender;
|
4656 |
+
}()),
|
4657 |
+
});
|
4658 |
+
onRendered();
|
4659 |
+
return;
|
4660 |
+
}
|
4661 |
+
var prependIndexes = [];
|
4662 |
+
var appendIndexes = [];
|
4663 |
+
if (force) {
|
4664 |
+
swiper.$wrapperEl.find(("." + (swiper.params.slideClass))).remove();
|
4665 |
+
} else {
|
4666 |
+
for (var i = previousFrom; i <= previousTo; i += 1) {
|
4667 |
+
if (i < from || i > to) {
|
4668 |
+
swiper.$wrapperEl.find(("." + (swiper.params.slideClass) + "[data-swiper-slide-index=\"" + i + "\"]")).remove();
|
4669 |
+
}
|
4670 |
+
}
|
4671 |
+
}
|
4672 |
+
for (var i$1 = 0; i$1 < slides.length; i$1 += 1) {
|
4673 |
+
if (i$1 >= from && i$1 <= to) {
|
4674 |
+
if (typeof previousTo === 'undefined' || force) {
|
4675 |
+
appendIndexes.push(i$1);
|
4676 |
+
} else {
|
4677 |
+
if (i$1 > previousTo) { appendIndexes.push(i$1); }
|
4678 |
+
if (i$1 < previousFrom) { prependIndexes.push(i$1); }
|
4679 |
+
}
|
4680 |
+
}
|
4681 |
+
}
|
4682 |
+
appendIndexes.forEach(function (index) {
|
4683 |
+
swiper.$wrapperEl.append(renderSlide(slides[index], index));
|
4684 |
+
});
|
4685 |
+
prependIndexes.sort(function (a, b) { return b - a; }).forEach(function (index) {
|
4686 |
+
swiper.$wrapperEl.prepend(renderSlide(slides[index], index));
|
4687 |
+
});
|
4688 |
+
swiper.$wrapperEl.children('.swiper-slide').css(offsetProp, (offset + "px"));
|
4689 |
+
onRendered();
|
4690 |
+
},
|
4691 |
+
renderSlide: function renderSlide(slide, index) {
|
4692 |
+
var swiper = this;
|
4693 |
+
var params = swiper.params.virtual;
|
4694 |
+
if (params.cache && swiper.virtual.cache[index]) {
|
4695 |
+
return swiper.virtual.cache[index];
|
4696 |
+
}
|
4697 |
+
var $slideEl = params.renderSlide
|
4698 |
+
? $(params.renderSlide.call(swiper, slide, index))
|
4699 |
+
: $(("<div class=\"" + (swiper.params.slideClass) + "\" data-swiper-slide-index=\"" + index + "\">" + slide + "</div>"));
|
4700 |
+
if (!$slideEl.attr('data-swiper-slide-index')) { $slideEl.attr('data-swiper-slide-index', index); }
|
4701 |
+
if (params.cache) { swiper.virtual.cache[index] = $slideEl; }
|
4702 |
+
return $slideEl;
|
4703 |
+
},
|
4704 |
+
appendSlide: function appendSlide(slides) {
|
4705 |
+
var swiper = this;
|
4706 |
+
if (typeof slides === 'object' && 'length' in slides) {
|
4707 |
+
for (var i = 0; i < slides.length; i += 1) {
|
4708 |
+
if (slides[i]) { swiper.virtual.slides.push(slides[i]); }
|
4709 |
+
}
|
4710 |
+
} else {
|
4711 |
+
swiper.virtual.slides.push(slides);
|
4712 |
+
}
|
4713 |
+
swiper.virtual.update(true);
|
4714 |
+
},
|
4715 |
+
prependSlide: function prependSlide(slides) {
|
4716 |
+
var swiper = this;
|
4717 |
+
var activeIndex = swiper.activeIndex;
|
4718 |
+
var newActiveIndex = activeIndex + 1;
|
4719 |
+
var numberOfNewSlides = 1;
|
4720 |
+
|
4721 |
+
if (Array.isArray(slides)) {
|
4722 |
+
for (var i = 0; i < slides.length; i += 1) {
|
4723 |
+
if (slides[i]) { swiper.virtual.slides.unshift(slides[i]); }
|
4724 |
+
}
|
4725 |
+
newActiveIndex = activeIndex + slides.length;
|
4726 |
+
numberOfNewSlides = slides.length;
|
4727 |
+
} else {
|
4728 |
+
swiper.virtual.slides.unshift(slides);
|
4729 |
+
}
|
4730 |
+
if (swiper.params.virtual.cache) {
|
4731 |
+
var cache = swiper.virtual.cache;
|
4732 |
+
var newCache = {};
|
4733 |
+
Object.keys(cache).forEach(function (cachedIndex) {
|
4734 |
+
var $cachedEl = cache[cachedIndex];
|
4735 |
+
var cachedElIndex = $cachedEl.attr('data-swiper-slide-index');
|
4736 |
+
if (cachedElIndex) {
|
4737 |
+
$cachedEl.attr('data-swiper-slide-index', parseInt(cachedElIndex, 10) + 1);
|
4738 |
+
}
|
4739 |
+
newCache[parseInt(cachedIndex, 10) + numberOfNewSlides] = $cachedEl;
|
4740 |
+
});
|
4741 |
+
swiper.virtual.cache = newCache;
|
4742 |
+
}
|
4743 |
+
swiper.virtual.update(true);
|
4744 |
+
swiper.slideTo(newActiveIndex, 0);
|
4745 |
+
},
|
4746 |
+
removeSlide: function removeSlide(slidesIndexes) {
|
4747 |
+
var swiper = this;
|
4748 |
+
if (typeof slidesIndexes === 'undefined' || slidesIndexes === null) { return; }
|
4749 |
+
var activeIndex = swiper.activeIndex;
|
4750 |
+
if (Array.isArray(slidesIndexes)) {
|
4751 |
+
for (var i = slidesIndexes.length - 1; i >= 0; i -= 1) {
|
4752 |
+
swiper.virtual.slides.splice(slidesIndexes[i], 1);
|
4753 |
+
if (swiper.params.virtual.cache) {
|
4754 |
+
delete swiper.virtual.cache[slidesIndexes[i]];
|
4755 |
+
}
|
4756 |
+
if (slidesIndexes[i] < activeIndex) { activeIndex -= 1; }
|
4757 |
+
activeIndex = Math.max(activeIndex, 0);
|
4758 |
+
}
|
4759 |
+
} else {
|
4760 |
+
swiper.virtual.slides.splice(slidesIndexes, 1);
|
4761 |
+
if (swiper.params.virtual.cache) {
|
4762 |
+
delete swiper.virtual.cache[slidesIndexes];
|
4763 |
+
}
|
4764 |
+
if (slidesIndexes < activeIndex) { activeIndex -= 1; }
|
4765 |
+
activeIndex = Math.max(activeIndex, 0);
|
4766 |
+
}
|
4767 |
+
swiper.virtual.update(true);
|
4768 |
+
swiper.slideTo(activeIndex, 0);
|
4769 |
+
},
|
4770 |
+
removeAllSlides: function removeAllSlides() {
|
4771 |
+
var swiper = this;
|
4772 |
+
swiper.virtual.slides = [];
|
4773 |
+
if (swiper.params.virtual.cache) {
|
4774 |
+
swiper.virtual.cache = {};
|
4775 |
+
}
|
4776 |
+
swiper.virtual.update(true);
|
4777 |
+
swiper.slideTo(0, 0);
|
4778 |
+
},
|
4779 |
+
};
|
4780 |
+
|
4781 |
+
var Virtual$1 = {
|
4782 |
+
name: 'virtual',
|
4783 |
+
params: {
|
4784 |
+
virtual: {
|
4785 |
+
enabled: false,
|
4786 |
+
slides: [],
|
4787 |
+
cache: true,
|
4788 |
+
renderSlide: null,
|
4789 |
+
renderExternal: null,
|
4790 |
+
addSlidesBefore: 0,
|
4791 |
+
addSlidesAfter: 0,
|
4792 |
+
},
|
4793 |
+
},
|
4794 |
+
create: function create() {
|
4795 |
+
var swiper = this;
|
4796 |
+
Utils.extend(swiper, {
|
4797 |
+
virtual: {
|
4798 |
+
update: Virtual.update.bind(swiper),
|
4799 |
+
appendSlide: Virtual.appendSlide.bind(swiper),
|
4800 |
+
prependSlide: Virtual.prependSlide.bind(swiper),
|
4801 |
+
removeSlide: Virtual.removeSlide.bind(swiper),
|
4802 |
+
removeAllSlides: Virtual.removeAllSlides.bind(swiper),
|
4803 |
+
renderSlide: Virtual.renderSlide.bind(swiper),
|
4804 |
+
slides: swiper.params.virtual.slides,
|
4805 |
+
cache: {},
|
4806 |
+
},
|
4807 |
+
});
|
4808 |
+
},
|
4809 |
+
on: {
|
4810 |
+
beforeInit: function beforeInit() {
|
4811 |
+
var swiper = this;
|
4812 |
+
if (!swiper.params.virtual.enabled) { return; }
|
4813 |
+
swiper.classNames.push(((swiper.params.containerModifierClass) + "virtual"));
|
4814 |
+
var overwriteParams = {
|
4815 |
+
watchSlidesProgress: true,
|
4816 |
+
};
|
4817 |
+
Utils.extend(swiper.params, overwriteParams);
|
4818 |
+
Utils.extend(swiper.originalParams, overwriteParams);
|
4819 |
+
|
4820 |
+
if (!swiper.params.initialSlide) {
|
4821 |
+
swiper.virtual.update();
|
4822 |
+
}
|
4823 |
+
},
|
4824 |
+
setTranslate: function setTranslate() {
|
4825 |
+
var swiper = this;
|
4826 |
+
if (!swiper.params.virtual.enabled) { return; }
|
4827 |
+
swiper.virtual.update();
|
4828 |
+
},
|
4829 |
+
},
|
4830 |
+
};
|
4831 |
+
|
4832 |
+
var Keyboard = {
|
4833 |
+
handle: function handle(event) {
|
4834 |
+
var swiper = this;
|
4835 |
+
var rtl = swiper.rtlTranslate;
|
4836 |
+
var e = event;
|
4837 |
+
if (e.originalEvent) { e = e.originalEvent; } // jquery fix
|
4838 |
+
var kc = e.keyCode || e.charCode;
|
4839 |
+
// Directions locks
|
4840 |
+
if (!swiper.allowSlideNext && ((swiper.isHorizontal() && kc === 39) || (swiper.isVertical() && kc === 40) || kc === 34)) {
|
4841 |
+
return false;
|
4842 |
+
}
|
4843 |
+
if (!swiper.allowSlidePrev && ((swiper.isHorizontal() && kc === 37) || (swiper.isVertical() && kc === 38) || kc === 33)) {
|
4844 |
+
return false;
|
4845 |
+
}
|
4846 |
+
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
|
4847 |
+
return undefined;
|
4848 |
+
}
|
4849 |
+
if (doc.activeElement && doc.activeElement.nodeName && (doc.activeElement.nodeName.toLowerCase() === 'input' || doc.activeElement.nodeName.toLowerCase() === 'textarea')) {
|
4850 |
+
return undefined;
|
4851 |
+
}
|
4852 |
+
if (swiper.params.keyboard.onlyInViewport && (kc === 33 || kc === 34 || kc === 37 || kc === 39 || kc === 38 || kc === 40)) {
|
4853 |
+
var inView = false;
|
4854 |
+
// Check that swiper should be inside of visible area of window
|
4855 |
+
if (swiper.$el.parents(("." + (swiper.params.slideClass))).length > 0 && swiper.$el.parents(("." + (swiper.params.slideActiveClass))).length === 0) {
|
4856 |
+
return undefined;
|
4857 |
+
}
|
4858 |
+
var windowWidth = win.innerWidth;
|
4859 |
+
var windowHeight = win.innerHeight;
|
4860 |
+
var swiperOffset = swiper.$el.offset();
|
4861 |
+
if (rtl) { swiperOffset.left -= swiper.$el[0].scrollLeft; }
|
4862 |
+
var swiperCoord = [
|
4863 |
+
[swiperOffset.left, swiperOffset.top],
|
4864 |
+
[swiperOffset.left + swiper.width, swiperOffset.top],
|
4865 |
+
[swiperOffset.left, swiperOffset.top + swiper.height],
|
4866 |
+
[swiperOffset.left + swiper.width, swiperOffset.top + swiper.height] ];
|
4867 |
+
for (var i = 0; i < swiperCoord.length; i += 1) {
|
4868 |
+
var point = swiperCoord[i];
|
4869 |
+
if (
|
4870 |
+
point[0] >= 0 && point[0] <= windowWidth
|
4871 |
+
&& point[1] >= 0 && point[1] <= windowHeight
|
4872 |
+
) {
|
4873 |
+
inView = true;
|
4874 |
+
}
|
4875 |
+
}
|
4876 |
+
if (!inView) { return undefined; }
|
4877 |
+
}
|
4878 |
+
if (swiper.isHorizontal()) {
|
4879 |
+
if (kc === 33 || kc === 34 || kc === 37 || kc === 39) {
|
4880 |
+
if (e.preventDefault) { e.preventDefault(); }
|
4881 |
+
else { e.returnValue = false; }
|
4882 |
+
}
|
4883 |
+
if (((kc === 34 || kc === 39) && !rtl) || ((kc === 33 || kc === 37) && rtl)) { swiper.slideNext(); }
|
4884 |
+
if (((kc === 33 || kc === 37) && !rtl) || ((kc === 34 || kc === 39) && rtl)) { swiper.slidePrev(); }
|
4885 |
+
} else {
|
4886 |
+
if (kc === 33 || kc === 34 || kc === 38 || kc === 40) {
|
4887 |
+
if (e.preventDefault) { e.preventDefault(); }
|
4888 |
+
else { e.returnValue = false; }
|
4889 |
+
}
|
4890 |
+
if (kc === 34 || kc === 40) { swiper.slideNext(); }
|
4891 |
+
if (kc === 33 || kc === 38) { swiper.slidePrev(); }
|
4892 |
+
}
|
4893 |
+
swiper.emit('keyPress', kc);
|
4894 |
+
return undefined;
|
4895 |
+
},
|
4896 |
+
enable: function enable() {
|
4897 |
+
var swiper = this;
|
4898 |
+
if (swiper.keyboard.enabled) { return; }
|
4899 |
+
$(doc).on('keydown', swiper.keyboard.handle);
|
4900 |
+
swiper.keyboard.enabled = true;
|
4901 |
+
},
|
4902 |
+
disable: function disable() {
|
4903 |
+
var swiper = this;
|
4904 |
+
if (!swiper.keyboard.enabled) { return; }
|
4905 |
+
$(doc).off('keydown', swiper.keyboard.handle);
|
4906 |
+
swiper.keyboard.enabled = false;
|
4907 |
+
},
|
4908 |
+
};
|
4909 |
+
|
4910 |
+
var Keyboard$1 = {
|
4911 |
+
name: 'keyboard',
|
4912 |
+
params: {
|
4913 |
+
keyboard: {
|
4914 |
+
enabled: false,
|
4915 |
+
onlyInViewport: true,
|
4916 |
+
},
|
4917 |
+
},
|
4918 |
+
create: function create() {
|
4919 |
+
var swiper = this;
|
4920 |
+
Utils.extend(swiper, {
|
4921 |
+
keyboard: {
|
4922 |
+
enabled: false,
|
4923 |
+
enable: Keyboard.enable.bind(swiper),
|
4924 |
+
disable: Keyboard.disable.bind(swiper),
|
4925 |
+
handle: Keyboard.handle.bind(swiper),
|
4926 |
+
},
|
4927 |
+
});
|
4928 |
+
},
|
4929 |
+
on: {
|
4930 |
+
init: function init() {
|
4931 |
+
var swiper = this;
|
4932 |
+
if (swiper.params.keyboard.enabled) {
|
4933 |
+
swiper.keyboard.enable();
|
4934 |
+
}
|
4935 |
+
},
|
4936 |
+
destroy: function destroy() {
|
4937 |
+
var swiper = this;
|
4938 |
+
if (swiper.keyboard.enabled) {
|
4939 |
+
swiper.keyboard.disable();
|
4940 |
+
}
|
4941 |
+
},
|
4942 |
+
},
|
4943 |
+
};
|
4944 |
+
|
4945 |
+
function isEventSupported() {
|
4946 |
+
var eventName = 'onwheel';
|
4947 |
+
var isSupported = eventName in doc;
|
4948 |
+
|
4949 |
+
if (!isSupported) {
|
4950 |
+
var element = doc.createElement('div');
|
4951 |
+
element.setAttribute(eventName, 'return;');
|
4952 |
+
isSupported = typeof element[eventName] === 'function';
|
4953 |
+
}
|
4954 |
+
|
4955 |
+
if (!isSupported
|
4956 |
+
&& doc.implementation
|
4957 |
+
&& doc.implementation.hasFeature
|
4958 |
+
// always returns true in newer browsers as per the standard.
|
4959 |
+
// @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
|
4960 |
+
&& doc.implementation.hasFeature('', '') !== true
|
4961 |
+
) {
|
4962 |
+
// This is the only way to test support for the `wheel` event in IE9+.
|
4963 |
+
isSupported = doc.implementation.hasFeature('Events.wheel', '3.0');
|
4964 |
+
}
|
4965 |
+
|
4966 |
+
return isSupported;
|
4967 |
+
}
|
4968 |
+
var Mousewheel = {
|
4969 |
+
lastScrollTime: Utils.now(),
|
4970 |
+
lastEventBeforeSnap: undefined,
|
4971 |
+
recentWheelEvents: [],
|
4972 |
+
event: function event() {
|
4973 |
+
if (win.navigator.userAgent.indexOf('firefox') > -1) { return 'DOMMouseScroll'; }
|
4974 |
+
return isEventSupported() ? 'wheel' : 'mousewheel';
|
4975 |
+
},
|
4976 |
+
normalize: function normalize(e) {
|
4977 |
+
// Reasonable defaults
|
4978 |
+
var PIXEL_STEP = 10;
|
4979 |
+
var LINE_HEIGHT = 40;
|
4980 |
+
var PAGE_HEIGHT = 800;
|
4981 |
+
|
4982 |
+
var sX = 0;
|
4983 |
+
var sY = 0; // spinX, spinY
|
4984 |
+
var pX = 0;
|
4985 |
+
var pY = 0; // pixelX, pixelY
|
4986 |
+
|
4987 |
+
// Legacy
|
4988 |
+
if ('detail' in e) {
|
4989 |
+
sY = e.detail;
|
4990 |
+
}
|
4991 |
+
if ('wheelDelta' in e) {
|
4992 |
+
sY = -e.wheelDelta / 120;
|
4993 |
+
}
|
4994 |
+
if ('wheelDeltaY' in e) {
|
4995 |
+
sY = -e.wheelDeltaY / 120;
|
4996 |
+
}
|
4997 |
+
if ('wheelDeltaX' in e) {
|
4998 |
+
sX = -e.wheelDeltaX / 120;
|
4999 |
+
}
|
5000 |
+
|
5001 |
+
// side scrolling on FF with DOMMouseScroll
|
5002 |
+
if ('axis' in e && e.axis === e.HORIZONTAL_AXIS) {
|
5003 |
+
sX = sY;
|
5004 |
+
sY = 0;
|
5005 |
+
}
|
5006 |
+
|
5007 |
+
pX = sX * PIXEL_STEP;
|
5008 |
+
pY = sY * PIXEL_STEP;
|
5009 |
+
|
5010 |
+
if ('deltaY' in e) {
|
5011 |
+
pY = e.deltaY;
|
5012 |
+
}
|
5013 |
+
if ('deltaX' in e) {
|
5014 |
+
pX = e.deltaX;
|
5015 |
+
}
|
5016 |
+
|
5017 |
+
if (e.shiftKey && !pX) { // if user scrolls with shift he wants horizontal scroll
|
5018 |
+
pX = pY;
|
5019 |
+
pY = 0;
|
5020 |
+
}
|
5021 |
+
|
5022 |
+
if ((pX || pY) && e.deltaMode) {
|
5023 |
+
if (e.deltaMode === 1) { // delta in LINE units
|
5024 |
+
pX *= LINE_HEIGHT;
|
5025 |
+
pY *= LINE_HEIGHT;
|
5026 |
+
} else { // delta in PAGE units
|
5027 |
+
pX *= PAGE_HEIGHT;
|
5028 |
+
pY *= PAGE_HEIGHT;
|
5029 |
+
}
|
5030 |
+
}
|
5031 |
+
|
5032 |
+
// Fall-back if spin cannot be determined
|
5033 |
+
if (pX && !sX) {
|
5034 |
+
sX = (pX < 1) ? -1 : 1;
|
5035 |
+
}
|
5036 |
+
if (pY && !sY) {
|
5037 |
+
sY = (pY < 1) ? -1 : 1;
|
5038 |
+
}
|
5039 |
+
|
5040 |
+
return {
|
5041 |
+
spinX: sX,
|
5042 |
+
spinY: sY,
|
5043 |
+
pixelX: pX,
|
5044 |
+
pixelY: pY,
|
5045 |
+
};
|
5046 |
+
},
|
5047 |
+
handleMouseEnter: function handleMouseEnter() {
|
5048 |
+
var swiper = this;
|
5049 |
+
swiper.mouseEntered = true;
|
5050 |
+
},
|
5051 |
+
handleMouseLeave: function handleMouseLeave() {
|
5052 |
+
var swiper = this;
|
5053 |
+
swiper.mouseEntered = false;
|
5054 |
+
},
|
5055 |
+
handle: function handle(event) {
|
5056 |
+
var e = event;
|
5057 |
+
var swiper = this;
|
5058 |
+
var params = swiper.params.mousewheel;
|
5059 |
+
|
5060 |
+
if (swiper.params.cssMode) {
|
5061 |
+
e.preventDefault();
|
5062 |
+
}
|
5063 |
+
|
5064 |
+
var target = swiper.$el;
|
5065 |
+
if (swiper.params.mousewheel.eventsTarged !== 'container') {
|
5066 |
+
target = $(swiper.params.mousewheel.eventsTarged);
|
5067 |
+
}
|
5068 |
+
if (!swiper.mouseEntered && !target[0].contains(e.target) && !params.releaseOnEdges) { return true; }
|
5069 |
+
|
5070 |
+
if (e.originalEvent) { e = e.originalEvent; } // jquery fix
|
5071 |
+
var delta = 0;
|
5072 |
+
var rtlFactor = swiper.rtlTranslate ? -1 : 1;
|
5073 |
+
|
5074 |
+
var data = Mousewheel.normalize(e);
|
5075 |
+
|
5076 |
+
if (params.forceToAxis) {
|
5077 |
+
if (swiper.isHorizontal()) {
|
5078 |
+
if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) { delta = data.pixelX * rtlFactor; }
|
5079 |
+
else { return true; }
|
5080 |
+
} else if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) { delta = data.pixelY; }
|
5081 |
+
else { return true; }
|
5082 |
+
} else {
|
5083 |
+
delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? -data.pixelX * rtlFactor : -data.pixelY;
|
5084 |
+
}
|
5085 |
+
|
5086 |
+
if (delta === 0) { return true; }
|
5087 |
+
|
5088 |
+
if (params.invert) { delta = -delta; }
|
5089 |
+
|
5090 |
+
if (!swiper.params.freeMode) {
|
5091 |
+
// Register the new event in a variable which stores the relevant data
|
5092 |
+
var newEvent = {
|
5093 |
+
time: Utils.now(),
|
5094 |
+
delta: Math.abs(delta),
|
5095 |
+
direction: Math.sign(delta),
|
5096 |
+
raw: event,
|
5097 |
+
};
|
5098 |
+
|
5099 |
+
// Keep the most recent events
|
5100 |
+
var recentWheelEvents = swiper.mousewheel.recentWheelEvents;
|
5101 |
+
if (recentWheelEvents.length >= 2) {
|
5102 |
+
recentWheelEvents.shift(); // only store the last N events
|
5103 |
+
}
|
5104 |
+
var prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined;
|
5105 |
+
recentWheelEvents.push(newEvent);
|
5106 |
+
|
5107 |
+
// If there is at least one previous recorded event:
|
5108 |
+
// If direction has changed or
|
5109 |
+
// if the scroll is quicker than the previous one:
|
5110 |
+
// Animate the slider.
|
5111 |
+
// Else (this is the first time the wheel is moved):
|
5112 |
+
// Animate the slider.
|
5113 |
+
if (prevEvent) {
|
5114 |
+
if (newEvent.direction !== prevEvent.direction || newEvent.delta > prevEvent.delta) {
|
5115 |
+
swiper.mousewheel.animateSlider(newEvent);
|
5116 |
+
}
|
5117 |
+
} else {
|
5118 |
+
swiper.mousewheel.animateSlider(newEvent);
|
5119 |
+
}
|
5120 |
+
|
5121 |
+
// If it's time to release the scroll:
|
5122 |
+
// Return now so you don't hit the preventDefault.
|
5123 |
+
if (swiper.mousewheel.releaseScroll(newEvent)) {
|
5124 |
+
return true;
|
5125 |
+
}
|
5126 |
+
} else {
|
5127 |
+
// Freemode or scrollContainer:
|
5128 |
+
|
5129 |
+
// If we recently snapped after a momentum scroll, then ignore wheel events
|
5130 |
+
// to give time for the deceleration to finish. Stop ignoring after 500 msecs
|
5131 |
+
// or if it's a new scroll (larger delta or inverse sign as last event before
|
5132 |
+
// an end-of-momentum snap).
|
5133 |
+
var newEvent$1 = { time: Utils.now(), delta: Math.abs(delta), direction: Math.sign(delta) };
|
5134 |
+
var ref = swiper.mousewheel;
|
5135 |
+
var lastEventBeforeSnap = ref.lastEventBeforeSnap;
|
5136 |
+
var ignoreWheelEvents = lastEventBeforeSnap
|
5137 |
+
&& newEvent$1.time < lastEventBeforeSnap.time + 500
|
5138 |
+
&& newEvent$1.delta <= lastEventBeforeSnap.delta
|
5139 |
+
&& newEvent$1.direction === lastEventBeforeSnap.direction;
|
5140 |
+
if (!ignoreWheelEvents) {
|
5141 |
+
swiper.mousewheel.lastEventBeforeSnap = undefined;
|
5142 |
+
|
5143 |
+
if (swiper.params.loop) {
|
5144 |
+
swiper.loopFix();
|
5145 |
+
}
|
5146 |
+
var position = swiper.getTranslate() + (delta * params.sensitivity);
|
5147 |
+
var wasBeginning = swiper.isBeginning;
|
5148 |
+
var wasEnd = swiper.isEnd;
|
5149 |
+
|
5150 |
+
if (position >= swiper.minTranslate()) { position = swiper.minTranslate(); }
|
5151 |
+
if (position <= swiper.maxTranslate()) { position = swiper.maxTranslate(); }
|
5152 |
+
|
5153 |
+
swiper.setTransition(0);
|
5154 |
+
swiper.setTranslate(position);
|
5155 |
+
swiper.updateProgress();
|
5156 |
+
swiper.updateActiveIndex();
|
5157 |
+
swiper.updateSlidesClasses();
|
5158 |
+
|
5159 |
+
if ((!wasBeginning && swiper.isBeginning) || (!wasEnd && swiper.isEnd)) {
|
5160 |
+
swiper.updateSlidesClasses();
|
5161 |
+
}
|
5162 |
+
|
5163 |
+
if (swiper.params.freeModeSticky) {
|
5164 |
+
// When wheel scrolling starts with sticky (aka snap) enabled, then detect
|
5165 |
+
// the end of a momentum scroll by storing recent (N=15?) wheel events.
|
5166 |
+
// 1. do all N events have decreasing or same (absolute value) delta?
|
5167 |
+
// 2. did all N events arrive in the last M (M=500?) msecs?
|
5168 |
+
// 3. does the earliest event have an (absolute value) delta that's
|
5169 |
+
// at least P (P=1?) larger than the most recent event's delta?
|
5170 |
+
// 4. does the latest event have a delta that's smaller than Q (Q=6?) pixels?
|
5171 |
+
// If 1-4 are "yes" then we're near the end of a momuntum scroll deceleration.
|
5172 |
+
// Snap immediately and ignore remaining wheel events in this scroll.
|
5173 |
+
// See comment above for "remaining wheel events in this scroll" determination.
|
5174 |
+
// If 1-4 aren't satisfied, then wait to snap until 500ms after the last event.
|
5175 |
+
clearTimeout(swiper.mousewheel.timeout);
|
5176 |
+
swiper.mousewheel.timeout = undefined;
|
5177 |
+
var recentWheelEvents$1 = swiper.mousewheel.recentWheelEvents;
|
5178 |
+
if (recentWheelEvents$1.length >= 15) {
|
5179 |
+
recentWheelEvents$1.shift(); // only store the last N events
|
5180 |
+
}
|
5181 |
+
var prevEvent$1 = recentWheelEvents$1.length ? recentWheelEvents$1[recentWheelEvents$1.length - 1] : undefined;
|
5182 |
+
var firstEvent = recentWheelEvents$1[0];
|
5183 |
+
recentWheelEvents$1.push(newEvent$1);
|
5184 |
+
if (prevEvent$1 && (newEvent$1.delta > prevEvent$1.delta || newEvent$1.direction !== prevEvent$1.direction)) {
|
5185 |
+
// Increasing or reverse-sign delta means the user started scrolling again. Clear the wheel event log.
|
5186 |
+
recentWheelEvents$1.splice(0);
|
5187 |
+
} else if (recentWheelEvents$1.length >= 15
|
5188 |
+
&& newEvent$1.time - firstEvent.time < 500
|
5189 |
+
&& firstEvent.delta - newEvent$1.delta >= 1
|
5190 |
+
&& newEvent$1.delta <= 6
|
5191 |
+
) {
|
5192 |
+
// We're at the end of the deceleration of a momentum scroll, so there's no need
|
5193 |
+
// to wait for more events. Snap ASAP on the next tick.
|
5194 |
+
// Also, because there's some remaining momentum we'll bias the snap in the
|
5195 |
+
// direction of the ongoing scroll because it's better UX for the scroll to snap
|
5196 |
+
// in the same direction as the scroll instead of reversing to snap. Therefore,
|
5197 |
+
// if it's already scrolled more than 20% in the current direction, keep going.
|
5198 |
+
var snapToThreshold = delta > 0 ? 0.8 : 0.2;
|
5199 |
+
swiper.mousewheel.lastEventBeforeSnap = newEvent$1;
|
5200 |
+
recentWheelEvents$1.splice(0);
|
5201 |
+
swiper.mousewheel.timeout = Utils.nextTick(function () {
|
5202 |
+
swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold);
|
5203 |
+
}, 0); // no delay; move on next tick
|
5204 |
+
}
|
5205 |
+
if (!swiper.mousewheel.timeout) {
|
5206 |
+
// if we get here, then we haven't detected the end of a momentum scroll, so
|
5207 |
+
// we'll consider a scroll "complete" when there haven't been any wheel events
|
5208 |
+
// for 500ms.
|
5209 |
+
swiper.mousewheel.timeout = Utils.nextTick(function () {
|
5210 |
+
var snapToThreshold = 0.5;
|
5211 |
+
swiper.mousewheel.lastEventBeforeSnap = newEvent$1;
|
5212 |
+
recentWheelEvents$1.splice(0);
|
5213 |
+
swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold);
|
5214 |
+
}, 500);
|
5215 |
+
}
|
5216 |
+
}
|
5217 |
+
|
5218 |
+
// Emit event
|
5219 |
+
if (!ignoreWheelEvents) { swiper.emit('scroll', e); }
|
5220 |
+
|
5221 |
+
// Stop autoplay
|
5222 |
+
if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) { swiper.autoplay.stop(); }
|
5223 |
+
// Return page scroll on edge positions
|
5224 |
+
if (position === swiper.minTranslate() || position === swiper.maxTranslate()) { return true; }
|
5225 |
+
}
|
5226 |
+
}
|
5227 |
+
|
5228 |
+
if (e.preventDefault) { e.preventDefault(); }
|
5229 |
+
else { e.returnValue = false; }
|
5230 |
+
return false;
|
5231 |
+
},
|
5232 |
+
animateSlider: function animateSlider(newEvent) {
|
5233 |
+
var swiper = this;
|
5234 |
+
// If the movement is NOT big enough and
|
5235 |
+
// if the last time the user scrolled was too close to the current one (avoid continuously triggering the slider):
|
5236 |
+
// Don't go any further (avoid insignificant scroll movement).
|
5237 |
+
if (newEvent.delta >= 6 && Utils.now() - swiper.mousewheel.lastScrollTime < 60) {
|
5238 |
+
// Return false as a default
|
5239 |
+
return true;
|
5240 |
+
}
|
5241 |
+
// If user is scrolling towards the end:
|
5242 |
+
// If the slider hasn't hit the latest slide or
|
5243 |
+
// if the slider is a loop and
|
5244 |
+
// if the slider isn't moving right now:
|
5245 |
+
// Go to next slide and
|
5246 |
+
// emit a scroll event.
|
5247 |
+
// Else (the user is scrolling towards the beginning) and
|
5248 |
+
// if the slider hasn't hit the first slide or
|
5249 |
+
// if the slider is a loop and
|
5250 |
+
// if the slider isn't moving right now:
|
5251 |
+
// Go to prev slide and
|
5252 |
+
// emit a scroll event.
|
5253 |
+
if (newEvent.direction < 0) {
|
5254 |
+
if ((!swiper.isEnd || swiper.params.loop) && !swiper.animating) {
|
5255 |
+
swiper.slideNext();
|
5256 |
+
swiper.emit('scroll', newEvent.raw);
|
5257 |
+
}
|
5258 |
+
} else if ((!swiper.isBeginning || swiper.params.loop) && !swiper.animating) {
|
5259 |
+
swiper.slidePrev();
|
5260 |
+
swiper.emit('scroll', newEvent.raw);
|
5261 |
+
}
|
5262 |
+
// If you got here is because an animation has been triggered so store the current time
|
5263 |
+
swiper.mousewheel.lastScrollTime = (new win.Date()).getTime();
|
5264 |
+
// Return false as a default
|
5265 |
+
return false;
|
5266 |
+
},
|
5267 |
+
releaseScroll: function releaseScroll(newEvent) {
|
5268 |
+
var swiper = this;
|
5269 |
+
var params = swiper.params.mousewheel;
|
5270 |
+
if (newEvent.direction < 0) {
|
5271 |
+
if (swiper.isEnd && !swiper.params.loop && params.releaseOnEdges) {
|
5272 |
+
// Return true to animate scroll on edges
|
5273 |
+
return true;
|
5274 |
+
}
|
5275 |
+
} else if (swiper.isBeginning && !swiper.params.loop && params.releaseOnEdges) {
|
5276 |
+
// Return true to animate scroll on edges
|
5277 |
+
return true;
|
5278 |
+
}
|
5279 |
+
return false;
|
5280 |
+
},
|
5281 |
+
enable: function enable() {
|
5282 |
+
var swiper = this;
|
5283 |
+
var event = Mousewheel.event();
|
5284 |
+
if (swiper.params.cssMode) {
|
5285 |
+
swiper.wrapperEl.removeEventListener(event, swiper.mousewheel.handle);
|
5286 |
+
return true;
|
5287 |
+
}
|
5288 |
+
if (!event) { return false; }
|
5289 |
+
if (swiper.mousewheel.enabled) { return false; }
|
5290 |
+
var target = swiper.$el;
|
5291 |
+
if (swiper.params.mousewheel.eventsTarged !== 'container') {
|
5292 |
+
target = $(swiper.params.mousewheel.eventsTarged);
|
5293 |
+
}
|
5294 |
+
target.on('mouseenter', swiper.mousewheel.handleMouseEnter);
|
5295 |
+
target.on('mouseleave', swiper.mousewheel.handleMouseLeave);
|
5296 |
+
target.on(event, swiper.mousewheel.handle);
|
5297 |
+
swiper.mousewheel.enabled = true;
|
5298 |
+
return true;
|
5299 |
+
},
|
5300 |
+
disable: function disable() {
|
5301 |
+
var swiper = this;
|
5302 |
+
var event = Mousewheel.event();
|
5303 |
+
if (swiper.params.cssMode) {
|
5304 |
+
swiper.wrapperEl.addEventListener(event, swiper.mousewheel.handle);
|
5305 |
+
return true;
|
5306 |
+
}
|
5307 |
+
if (!event) { return false; }
|
5308 |
+
if (!swiper.mousewheel.enabled) { return false; }
|
5309 |
+
var target = swiper.$el;
|
5310 |
+
if (swiper.params.mousewheel.eventsTarged !== 'container') {
|
5311 |
+
target = $(swiper.params.mousewheel.eventsTarged);
|
5312 |
+
}
|
5313 |
+
target.off(event, swiper.mousewheel.handle);
|
5314 |
+
swiper.mousewheel.enabled = false;
|
5315 |
+
return true;
|
5316 |
+
},
|
5317 |
+
};
|
5318 |
+
|
5319 |
+
var Mousewheel$1 = {
|
5320 |
+
name: 'mousewheel',
|
5321 |
+
params: {
|
5322 |
+
mousewheel: {
|
5323 |
+
enabled: false,
|
5324 |
+
releaseOnEdges: false,
|
5325 |
+
invert: false,
|
5326 |
+
forceToAxis: false,
|
5327 |
+
sensitivity: 1,
|
5328 |
+
eventsTarged: 'container',
|
5329 |
+
},
|
5330 |
+
},
|
5331 |
+
create: function create() {
|
5332 |
+
var swiper = this;
|
5333 |
+
Utils.extend(swiper, {
|
5334 |
+
mousewheel: {
|
5335 |
+
enabled: false,
|
5336 |
+
enable: Mousewheel.enable.bind(swiper),
|
5337 |
+
disable: Mousewheel.disable.bind(swiper),
|
5338 |
+
handle: Mousewheel.handle.bind(swiper),
|
5339 |
+
handleMouseEnter: Mousewheel.handleMouseEnter.bind(swiper),
|
5340 |
+
handleMouseLeave: Mousewheel.handleMouseLeave.bind(swiper),
|
5341 |
+
animateSlider: Mousewheel.animateSlider.bind(swiper),
|
5342 |
+
releaseScroll: Mousewheel.releaseScroll.bind(swiper),
|
5343 |
+
lastScrollTime: Utils.now(),
|
5344 |
+
lastEventBeforeSnap: undefined,
|
5345 |
+
recentWheelEvents: [],
|
5346 |
+
},
|
5347 |
+
});
|
5348 |
+
},
|
5349 |
+
on: {
|
5350 |
+
init: function init() {
|
5351 |
+
var swiper = this;
|
5352 |
+
if (!swiper.params.mousewheel.enabled && swiper.params.cssMode) {
|
5353 |
+
swiper.mousewheel.disable();
|
5354 |
+
}
|
5355 |
+
if (swiper.params.mousewheel.enabled) { swiper.mousewheel.enable(); }
|
5356 |
+
},
|
5357 |
+
destroy: function destroy() {
|
5358 |
+
var swiper = this;
|
5359 |
+
if (swiper.params.cssMode) {
|
5360 |
+
swiper.mousewheel.enable();
|
5361 |
+
}
|
5362 |
+
if (swiper.mousewheel.enabled) { swiper.mousewheel.disable(); }
|
5363 |
+
},
|
5364 |
+
},
|
5365 |
+
};
|
5366 |
+
|
5367 |
+
var Navigation = {
|
5368 |
+
update: function update() {
|
5369 |
+
// Update Navigation Buttons
|
5370 |
+
var swiper = this;
|
5371 |
+
var params = swiper.params.navigation;
|
5372 |
+
|
5373 |
+
if (swiper.params.loop) { return; }
|
5374 |
+
var ref = swiper.navigation;
|
5375 |
+
var $nextEl = ref.$nextEl;
|
5376 |
+
var $prevEl = ref.$prevEl;
|
5377 |
+
|
5378 |
+
if ($prevEl && $prevEl.length > 0) {
|
5379 |
+
if (swiper.isBeginning) {
|
5380 |
+
$prevEl.addClass(params.disabledClass);
|
5381 |
+
} else {
|
5382 |
+
$prevEl.removeClass(params.disabledClass);
|
5383 |
+
}
|
5384 |
+
$prevEl[swiper.params.watchOverflow && swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);
|
5385 |
+
}
|
5386 |
+
if ($nextEl && $nextEl.length > 0) {
|
5387 |
+
if (swiper.isEnd) {
|
5388 |
+
$nextEl.addClass(params.disabledClass);
|
5389 |
+
} else {
|
5390 |
+
$nextEl.removeClass(params.disabledClass);
|
5391 |
+
}
|
5392 |
+
$nextEl[swiper.params.watchOverflow && swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);
|
5393 |
+
}
|
5394 |
+
},
|
5395 |
+
onPrevClick: function onPrevClick(e) {
|
5396 |
+
var swiper = this;
|
5397 |
+
e.preventDefault();
|
5398 |
+
if (swiper.isBeginning && !swiper.params.loop) { return; }
|
5399 |
+
swiper.slidePrev();
|
5400 |
+
},
|
5401 |
+
onNextClick: function onNextClick(e) {
|
5402 |
+
var swiper = this;
|
5403 |
+
e.preventDefault();
|
5404 |
+
if (swiper.isEnd && !swiper.params.loop) { return; }
|
5405 |
+
swiper.slideNext();
|
5406 |
+
},
|
5407 |
+
init: function init() {
|
5408 |
+
var swiper = this;
|
5409 |
+
var params = swiper.params.navigation;
|
5410 |
+
if (!(params.nextEl || params.prevEl)) { return; }
|
5411 |
+
|
5412 |
+
var $nextEl;
|
5413 |
+
var $prevEl;
|
5414 |
+
if (params.nextEl) {
|
5415 |
+
$nextEl = $(params.nextEl);
|
5416 |
+
if (
|
5417 |
+
swiper.params.uniqueNavElements
|
5418 |
+
&& typeof params.nextEl === 'string'
|
5419 |
+
&& $nextEl.length > 1
|
5420 |
+
&& swiper.$el.find(params.nextEl).length === 1
|
5421 |
+
) {
|
5422 |
+
$nextEl = swiper.$el.find(params.nextEl);
|
5423 |
+
}
|
5424 |
+
}
|
5425 |
+
if (params.prevEl) {
|
5426 |
+
$prevEl = $(params.prevEl);
|
5427 |
+
if (
|
5428 |
+
swiper.params.uniqueNavElements
|
5429 |
+
&& typeof params.prevEl === 'string'
|
5430 |
+
&& $prevEl.length > 1
|
5431 |
+
&& swiper.$el.find(params.prevEl).length === 1
|
5432 |
+
) {
|
5433 |
+
$prevEl = swiper.$el.find(params.prevEl);
|
5434 |
+
}
|
5435 |
+
}
|
5436 |
+
|
5437 |
+
if ($nextEl && $nextEl.length > 0) {
|
5438 |
+
$nextEl.on('click', swiper.navigation.onNextClick);
|
5439 |
+
}
|
5440 |
+
if ($prevEl && $prevEl.length > 0) {
|
5441 |
+
$prevEl.on('click', swiper.navigation.onPrevClick);
|
5442 |
+
}
|
5443 |
+
|
5444 |
+
Utils.extend(swiper.navigation, {
|
5445 |
+
$nextEl: $nextEl,
|
5446 |
+
nextEl: $nextEl && $nextEl[0],
|
5447 |
+
$prevEl: $prevEl,
|
5448 |
+
prevEl: $prevEl && $prevEl[0],
|
5449 |
+
});
|
5450 |
+
},
|
5451 |
+
destroy: function destroy() {
|
5452 |
+
var swiper = this;
|
5453 |
+
var ref = swiper.navigation;
|
5454 |
+
var $nextEl = ref.$nextEl;
|
5455 |
+
var $prevEl = ref.$prevEl;
|
5456 |
+
if ($nextEl && $nextEl.length) {
|
5457 |
+
$nextEl.off('click', swiper.navigation.onNextClick);
|
5458 |
+
$nextEl.removeClass(swiper.params.navigation.disabledClass);
|
5459 |
+
}
|
5460 |
+
if ($prevEl && $prevEl.length) {
|
5461 |
+
$prevEl.off('click', swiper.navigation.onPrevClick);
|
5462 |
+
$prevEl.removeClass(swiper.params.navigation.disabledClass);
|
5463 |
+
}
|
5464 |
+
},
|
5465 |
+
};
|
5466 |
+
|
5467 |
+
var Navigation$1 = {
|
5468 |
+
name: 'navigation',
|
5469 |
+
params: {
|
5470 |
+
navigation: {
|
5471 |
+
nextEl: null,
|
5472 |
+
prevEl: null,
|
5473 |
+
|
5474 |
+
hideOnClick: false,
|
5475 |
+
disabledClass: 'swiper-button-disabled',
|
5476 |
+
hiddenClass: 'swiper-button-hidden',
|
5477 |
+
lockClass: 'swiper-button-lock',
|
5478 |
+
},
|
5479 |
+
},
|
5480 |
+
create: function create() {
|
5481 |
+
var swiper = this;
|
5482 |
+
Utils.extend(swiper, {
|
5483 |
+
navigation: {
|
5484 |
+
init: Navigation.init.bind(swiper),
|
5485 |
+
update: Navigation.update.bind(swiper),
|
5486 |
+
destroy: Navigation.destroy.bind(swiper),
|
5487 |
+
onNextClick: Navigation.onNextClick.bind(swiper),
|
5488 |
+
onPrevClick: Navigation.onPrevClick.bind(swiper),
|
5489 |
+
},
|
5490 |
+
});
|
5491 |
+
},
|
5492 |
+
on: {
|
5493 |
+
init: function init() {
|
5494 |
+
var swiper = this;
|
5495 |
+
swiper.navigation.init();
|
5496 |
+
swiper.navigation.update();
|
5497 |
+
},
|
5498 |
+
toEdge: function toEdge() {
|
5499 |
+
var swiper = this;
|
5500 |
+
swiper.navigation.update();
|
5501 |
+
},
|
5502 |
+
fromEdge: function fromEdge() {
|
5503 |
+
var swiper = this;
|
5504 |
+
swiper.navigation.update();
|
5505 |
+
},
|
5506 |
+
destroy: function destroy() {
|
5507 |
+
var swiper = this;
|
5508 |
+
swiper.navigation.destroy();
|
5509 |
+
},
|
5510 |
+
click: function click(e) {
|
5511 |
+
var swiper = this;
|
5512 |
+
var ref = swiper.navigation;
|
5513 |
+
var $nextEl = ref.$nextEl;
|
5514 |
+
var $prevEl = ref.$prevEl;
|
5515 |
+
if (
|
5516 |
+
swiper.params.navigation.hideOnClick
|
5517 |
+
&& !$(e.target).is($prevEl)
|
5518 |
+
&& !$(e.target).is($nextEl)
|
5519 |
+
) {
|
5520 |
+
var isHidden;
|
5521 |
+
if ($nextEl) {
|
5522 |
+
isHidden = $nextEl.hasClass(swiper.params.navigation.hiddenClass);
|
5523 |
+
} else if ($prevEl) {
|
5524 |
+
isHidden = $prevEl.hasClass(swiper.params.navigation.hiddenClass);
|
5525 |
+
}
|
5526 |
+
if (isHidden === true) {
|
5527 |
+
swiper.emit('navigationShow', swiper);
|
5528 |
+
} else {
|
5529 |
+
swiper.emit('navigationHide', swiper);
|
5530 |
+
}
|
5531 |
+
if ($nextEl) {
|
5532 |
+
$nextEl.toggleClass(swiper.params.navigation.hiddenClass);
|
5533 |
+
}
|
5534 |
+
if ($prevEl) {
|
5535 |
+
$prevEl.toggleClass(swiper.params.navigation.hiddenClass);
|
5536 |
+
}
|
5537 |
+
}
|
5538 |
+
},
|
5539 |
+
},
|
5540 |
+
};
|
5541 |
+
|
5542 |
+
var Pagination = {
|
5543 |
+
update: function update() {
|
5544 |
+
// Render || Update Pagination bullets/items
|
5545 |
+
var swiper = this;
|
5546 |
+
var rtl = swiper.rtl;
|
5547 |
+
var params = swiper.params.pagination;
|
5548 |
+
if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) { return; }
|
5549 |
+
var slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
|
5550 |
+
var $el = swiper.pagination.$el;
|
5551 |
+
// Current/Total
|
5552 |
+
var current;
|
5553 |
+
var total = swiper.params.loop ? Math.ceil((slidesLength - (swiper.loopedSlides * 2)) / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
|
5554 |
+
if (swiper.params.loop) {
|
5555 |
+
current = Math.ceil((swiper.activeIndex - swiper.loopedSlides) / swiper.params.slidesPerGroup);
|
5556 |
+
if (current > slidesLength - 1 - (swiper.loopedSlides * 2)) {
|
5557 |
+
current -= (slidesLength - (swiper.loopedSlides * 2));
|
5558 |
+
}
|
5559 |
+
if (current > total - 1) { current -= total; }
|
5560 |
+
if (current < 0 && swiper.params.paginationType !== 'bullets') { current = total + current; }
|
5561 |
+
} else if (typeof swiper.snapIndex !== 'undefined') {
|
5562 |
+
current = swiper.snapIndex;
|
5563 |
+
} else {
|
5564 |
+
current = swiper.activeIndex || 0;
|
5565 |
+
}
|
5566 |
+
// Types
|
5567 |
+
if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) {
|
5568 |
+
var bullets = swiper.pagination.bullets;
|
5569 |
+
var firstIndex;
|
5570 |
+
var lastIndex;
|
5571 |
+
var midIndex;
|
5572 |
+
if (params.dynamicBullets) {
|
5573 |
+
swiper.pagination.bulletSize = bullets.eq(0)[swiper.isHorizontal() ? 'outerWidth' : 'outerHeight'](true);
|
5574 |
+
$el.css(swiper.isHorizontal() ? 'width' : 'height', ((swiper.pagination.bulletSize * (params.dynamicMainBullets + 4)) + "px"));
|
5575 |
+
if (params.dynamicMainBullets > 1 && swiper.previousIndex !== undefined) {
|
5576 |
+
swiper.pagination.dynamicBulletIndex += (current - swiper.previousIndex);
|
5577 |
+
if (swiper.pagination.dynamicBulletIndex > (params.dynamicMainBullets - 1)) {
|
5578 |
+
swiper.pagination.dynamicBulletIndex = params.dynamicMainBullets - 1;
|
5579 |
+
} else if (swiper.pagination.dynamicBulletIndex < 0) {
|
5580 |
+
swiper.pagination.dynamicBulletIndex = 0;
|
5581 |
+
}
|
5582 |
+
}
|
5583 |
+
firstIndex = current - swiper.pagination.dynamicBulletIndex;
|
5584 |
+
lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1);
|
5585 |
+
midIndex = (lastIndex + firstIndex) / 2;
|
5586 |
+
}
|
5587 |
+
bullets.removeClass(((params.bulletActiveClass) + " " + (params.bulletActiveClass) + "-next " + (params.bulletActiveClass) + "-next-next " + (params.bulletActiveClass) + "-prev " + (params.bulletActiveClass) + "-prev-prev " + (params.bulletActiveClass) + "-main"));
|
5588 |
+
if ($el.length > 1) {
|
5589 |
+
bullets.each(function (index, bullet) {
|
5590 |
+
var $bullet = $(bullet);
|
5591 |
+
var bulletIndex = $bullet.index();
|
5592 |
+
if (bulletIndex === current) {
|
5593 |
+
$bullet.addClass(params.bulletActiveClass);
|
5594 |
+
}
|
5595 |
+
if (params.dynamicBullets) {
|
5596 |
+
if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) {
|
5597 |
+
$bullet.addClass(((params.bulletActiveClass) + "-main"));
|
5598 |
+
}
|
5599 |
+
if (bulletIndex === firstIndex) {
|
5600 |
+
$bullet
|
5601 |
+
.prev()
|
5602 |
+
.addClass(((params.bulletActiveClass) + "-prev"))
|
5603 |
+
.prev()
|
5604 |
+
.addClass(((params.bulletActiveClass) + "-prev-prev"));
|
5605 |
+
}
|
5606 |
+
if (bulletIndex === lastIndex) {
|
5607 |
+
$bullet
|
5608 |
+
.next()
|
5609 |
+
.addClass(((params.bulletActiveClass) + "-next"))
|
5610 |
+
.next()
|
5611 |
+
.addClass(((params.bulletActiveClass) + "-next-next"));
|
5612 |
+
}
|
5613 |
+
}
|
5614 |
+
});
|
5615 |
+
} else {
|
5616 |
+
var $bullet = bullets.eq(current);
|
5617 |
+
var bulletIndex = $bullet.index();
|
5618 |
+
$bullet.addClass(params.bulletActiveClass);
|
5619 |
+
if (params.dynamicBullets) {
|
5620 |
+
var $firstDisplayedBullet = bullets.eq(firstIndex);
|
5621 |
+
var $lastDisplayedBullet = bullets.eq(lastIndex);
|
5622 |
+
for (var i = firstIndex; i <= lastIndex; i += 1) {
|
5623 |
+
bullets.eq(i).addClass(((params.bulletActiveClass) + "-main"));
|
5624 |
+
}
|
5625 |
+
if (swiper.params.loop) {
|
5626 |
+
if (bulletIndex >= bullets.length - params.dynamicMainBullets) {
|
5627 |
+
for (var i$1 = params.dynamicMainBullets; i$1 >= 0; i$1 -= 1) {
|
5628 |
+
bullets.eq(bullets.length - i$1).addClass(((params.bulletActiveClass) + "-main"));
|
5629 |
+
}
|
5630 |
+
bullets.eq(bullets.length - params.dynamicMainBullets - 1).addClass(((params.bulletActiveClass) + "-prev"));
|
5631 |
+
} else {
|
5632 |
+
$firstDisplayedBullet
|
5633 |
+
.prev()
|
5634 |
+
.addClass(((params.bulletActiveClass) + "-prev"))
|
5635 |
+
.prev()
|
5636 |
+
.addClass(((params.bulletActiveClass) + "-prev-prev"));
|
5637 |
+
$lastDisplayedBullet
|
5638 |
+
.next()
|
5639 |
+
.addClass(((params.bulletActiveClass) + "-next"))
|
5640 |
+
.next()
|
5641 |
+
.addClass(((params.bulletActiveClass) + "-next-next"));
|
5642 |
+
}
|
5643 |
+
} else {
|
5644 |
+
$firstDisplayedBullet
|
5645 |
+
.prev()
|
5646 |
+
.addClass(((params.bulletActiveClass) + "-prev"))
|
5647 |
+
.prev()
|
5648 |
+
.addClass(((params.bulletActiveClass) + "-prev-prev"));
|
5649 |
+
$lastDisplayedBullet
|
5650 |
+
.next()
|
5651 |
+
.addClass(((params.bulletActiveClass) + "-next"))
|
5652 |
+
.next()
|
5653 |
+
.addClass(((params.bulletActiveClass) + "-next-next"));
|
5654 |
+
}
|
5655 |
+
}
|
5656 |
+
}
|
5657 |
+
if (params.dynamicBullets) {
|
5658 |
+
var dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4);
|
5659 |
+
var bulletsOffset = (((swiper.pagination.bulletSize * dynamicBulletsLength) - (swiper.pagination.bulletSize)) / 2) - (midIndex * swiper.pagination.bulletSize);
|
5660 |
+
var offsetProp = rtl ? 'right' : 'left';
|
5661 |
+
bullets.css(swiper.isHorizontal() ? offsetProp : 'top', (bulletsOffset + "px"));
|
5662 |
+
}
|
5663 |
+
}
|
5664 |
+
if (params.type === 'fraction') {
|
5665 |
+
$el.find(("." + (params.currentClass))).text(params.formatFractionCurrent(current + 1));
|
5666 |
+
$el.find(("." + (params.totalClass))).text(params.formatFractionTotal(total));
|
5667 |
+
}
|
5668 |
+
if (params.type === 'progressbar') {
|
5669 |
+
var progressbarDirection;
|
5670 |
+
if (params.progressbarOpposite) {
|
5671 |
+
progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal';
|
5672 |
+
} else {
|
5673 |
+
progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical';
|
5674 |
+
}
|
5675 |
+
var scale = (current + 1) / total;
|
5676 |
+
var scaleX = 1;
|
5677 |
+
var scaleY = 1;
|
5678 |
+
if (progressbarDirection === 'horizontal') {
|
5679 |
+
scaleX = scale;
|
5680 |
+
} else {
|
5681 |
+
scaleY = scale;
|
5682 |
+
}
|
5683 |
+
$el.find(("." + (params.progressbarFillClass))).transform(("translate3d(0,0,0) scaleX(" + scaleX + ") scaleY(" + scaleY + ")")).transition(swiper.params.speed);
|
5684 |
+
}
|
5685 |
+
if (params.type === 'custom' && params.renderCustom) {
|
5686 |
+
$el.html(params.renderCustom(swiper, current + 1, total));
|
5687 |
+
swiper.emit('paginationRender', swiper, $el[0]);
|
5688 |
+
} else {
|
5689 |
+
swiper.emit('paginationUpdate', swiper, $el[0]);
|
5690 |
+
}
|
5691 |
+
$el[swiper.params.watchOverflow && swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);
|
5692 |
+
},
|
5693 |
+
render: function render() {
|
5694 |
+
// Render Container
|
5695 |
+
var swiper = this;
|
5696 |
+
var params = swiper.params.pagination;
|
5697 |
+
if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) { return; }
|
5698 |
+
var slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
|
5699 |
+
|
5700 |
+
var $el = swiper.pagination.$el;
|
5701 |
+
var paginationHTML = '';
|
5702 |
+
if (params.type === 'bullets') {
|
5703 |
+
var numberOfBullets = swiper.params.loop ? Math.ceil((slidesLength - (swiper.loopedSlides * 2)) / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
|
5704 |
+
for (var i = 0; i < numberOfBullets; i += 1) {
|
5705 |
+
if (params.renderBullet) {
|
5706 |
+
paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass);
|
5707 |
+
} else {
|
5708 |
+
paginationHTML += "<" + (params.bulletElement) + " class=\"" + (params.bulletClass) + "\"></" + (params.bulletElement) + ">";
|
5709 |
+
}
|
5710 |
+
}
|
5711 |
+
$el.html(paginationHTML);
|
5712 |
+
swiper.pagination.bullets = $el.find(("." + (params.bulletClass)));
|
5713 |
+
}
|
5714 |
+
if (params.type === 'fraction') {
|
5715 |
+
if (params.renderFraction) {
|
5716 |
+
paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass);
|
5717 |
+
} else {
|
5718 |
+
paginationHTML = "<span class=\"" + (params.currentClass) + "\"></span>"
|
5719 |
+
+ ' / '
|
5720 |
+
+ "<span class=\"" + (params.totalClass) + "\"></span>";
|
5721 |
+
}
|
5722 |
+
$el.html(paginationHTML);
|
5723 |
+
}
|
5724 |
+
if (params.type === 'progressbar') {
|
5725 |
+
if (params.renderProgressbar) {
|
5726 |
+
paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass);
|
5727 |
+
} else {
|
5728 |
+
paginationHTML = "<span class=\"" + (params.progressbarFillClass) + "\"></span>";
|
5729 |
+
}
|
5730 |
+
$el.html(paginationHTML);
|
5731 |
+
}
|
5732 |
+
if (params.type !== 'custom') {
|
5733 |
+
swiper.emit('paginationRender', swiper.pagination.$el[0]);
|
5734 |
+
}
|
5735 |
+
},
|
5736 |
+
init: function init() {
|
5737 |
+
var swiper = this;
|
5738 |
+
var params = swiper.params.pagination;
|
5739 |
+
if (!params.el) { return; }
|
5740 |
+
|
5741 |
+
var $el = $(params.el);
|
5742 |
+
if ($el.length === 0) { return; }
|
5743 |
+
|
5744 |
+
if (
|
5745 |
+
swiper.params.uniqueNavElements
|
5746 |
+
&& typeof params.el === 'string'
|
5747 |
+
&& $el.length > 1
|
5748 |
+
&& swiper.$el.find(params.el).length === 1
|
5749 |
+
) {
|
5750 |
+
$el = swiper.$el.find(params.el);
|
5751 |
+
}
|
5752 |
+
|
5753 |
+
if (params.type === 'bullets' && params.clickable) {
|
5754 |
+
$el.addClass(params.clickableClass);
|
5755 |
+
}
|
5756 |
+
|
5757 |
+
$el.addClass(params.modifierClass + params.type);
|
5758 |
+
|
5759 |
+
if (params.type === 'bullets' && params.dynamicBullets) {
|
5760 |
+
$el.addClass(("" + (params.modifierClass) + (params.type) + "-dynamic"));
|
5761 |
+
swiper.pagination.dynamicBulletIndex = 0;
|
5762 |
+
if (params.dynamicMainBullets < 1) {
|
5763 |
+
params.dynamicMainBullets = 1;
|
5764 |
+
}
|
5765 |
+
}
|
5766 |
+
if (params.type === 'progressbar' && params.progressbarOpposite) {
|
5767 |
+
$el.addClass(params.progressbarOppositeClass);
|
5768 |
+
}
|
5769 |
+
|
5770 |
+
if (params.clickable) {
|
5771 |
+
$el.on('click', ("." + (params.bulletClass)), function onClick(e) {
|
5772 |
+
e.preventDefault();
|
5773 |
+
var index = $(this).index() * swiper.params.slidesPerGroup;
|
5774 |
+
if (swiper.params.loop) { index += swiper.loopedSlides; }
|
5775 |
+
swiper.slideTo(index);
|
5776 |
+
});
|
5777 |
+
}
|
5778 |
+
|
5779 |
+
Utils.extend(swiper.pagination, {
|
5780 |
+
$el: $el,
|
5781 |
+
el: $el[0],
|
5782 |
+
});
|
5783 |
+
},
|
5784 |
+
destroy: function destroy() {
|
5785 |
+
var swiper = this;
|
5786 |
+
var params = swiper.params.pagination;
|
5787 |
+
if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) { return; }
|
5788 |
+
var $el = swiper.pagination.$el;
|
5789 |
+
|
5790 |
+
$el.removeClass(params.hiddenClass);
|
5791 |
+
$el.removeClass(params.modifierClass + params.type);
|
5792 |
+
if (swiper.pagination.bullets) { swiper.pagination.bullets.removeClass(params.bulletActiveClass); }
|
5793 |
+
if (params.clickable) {
|
5794 |
+
$el.off('click', ("." + (params.bulletClass)));
|
5795 |
+
}
|
5796 |
+
},
|
5797 |
+
};
|
5798 |
+
|
5799 |
+
var Pagination$1 = {
|
5800 |
+
name: 'pagination',
|
5801 |
+
params: {
|
5802 |
+
pagination: {
|
5803 |
+
el: null,
|
5804 |
+
bulletElement: 'span',
|
5805 |
+
clickable: false,
|
5806 |
+
hideOnClick: false,
|
5807 |
+
renderBullet: null,
|
5808 |
+
renderProgressbar: null,
|
5809 |
+
renderFraction: null,
|
5810 |
+
renderCustom: null,
|
5811 |
+
progressbarOpposite: false,
|
5812 |
+
type: 'bullets', // 'bullets' or 'progressbar' or 'fraction' or 'custom'
|
5813 |
+
dynamicBullets: false,
|
5814 |
+
dynamicMainBullets: 1,
|
5815 |
+
formatFractionCurrent: function (number) { return number; },
|
5816 |
+
formatFractionTotal: function (number) { return number; },
|
5817 |
+
bulletClass: 'swiper-pagination-bullet',
|
5818 |
+
bulletActiveClass: 'swiper-pagination-bullet-active',
|
5819 |
+
modifierClass: 'swiper-pagination-', // NEW
|
5820 |
+
currentClass: 'swiper-pagination-current',
|
5821 |
+
totalClass: 'swiper-pagination-total',
|
5822 |
+
hiddenClass: 'swiper-pagination-hidden',
|
5823 |
+
progressbarFillClass: 'swiper-pagination-progressbar-fill',
|
5824 |
+
progressbarOppositeClass: 'swiper-pagination-progressbar-opposite',
|
5825 |
+
clickableClass: 'swiper-pagination-clickable', // NEW
|
5826 |
+
lockClass: 'swiper-pagination-lock',
|
5827 |
+
},
|
5828 |
+
},
|
5829 |
+
create: function create() {
|
5830 |
+
var swiper = this;
|
5831 |
+
Utils.extend(swiper, {
|
5832 |
+
pagination: {
|
5833 |
+
init: Pagination.init.bind(swiper),
|
5834 |
+
render: Pagination.render.bind(swiper),
|
5835 |
+
update: Pagination.update.bind(swiper),
|
5836 |
+
destroy: Pagination.destroy.bind(swiper),
|
5837 |
+
dynamicBulletIndex: 0,
|
5838 |
+
},
|
5839 |
+
});
|
5840 |
+
},
|
5841 |
+
on: {
|
5842 |
+
init: function init() {
|
5843 |
+
var swiper = this;
|
5844 |
+
swiper.pagination.init();
|
5845 |
+
swiper.pagination.render();
|
5846 |
+
swiper.pagination.update();
|
5847 |
+
},
|
5848 |
+
activeIndexChange: function activeIndexChange() {
|
5849 |
+
var swiper = this;
|
5850 |
+
if (swiper.params.loop) {
|
5851 |
+
swiper.pagination.update();
|
5852 |
+
} else if (typeof swiper.snapIndex === 'undefined') {
|
5853 |
+
swiper.pagination.update();
|
5854 |
+
}
|
5855 |
+
},
|
5856 |
+
snapIndexChange: function snapIndexChange() {
|
5857 |
+
var swiper = this;
|
5858 |
+
if (!swiper.params.loop) {
|
5859 |
+
swiper.pagination.update();
|
5860 |
+
}
|
5861 |
+
},
|
5862 |
+
slidesLengthChange: function slidesLengthChange() {
|
5863 |
+
var swiper = this;
|
5864 |
+
if (swiper.params.loop) {
|
5865 |
+
swiper.pagination.render();
|
5866 |
+
swiper.pagination.update();
|
5867 |
+
}
|
5868 |
+
},
|
5869 |
+
snapGridLengthChange: function snapGridLengthChange() {
|
5870 |
+
var swiper = this;
|
5871 |
+
if (!swiper.params.loop) {
|
5872 |
+
swiper.pagination.render();
|
5873 |
+
swiper.pagination.update();
|
5874 |
+
}
|
5875 |
+
},
|
5876 |
+
destroy: function destroy() {
|
5877 |
+
var swiper = this;
|
5878 |
+
swiper.pagination.destroy();
|
5879 |
+
},
|
5880 |
+
click: function click(e) {
|
5881 |
+
var swiper = this;
|
5882 |
+
if (
|
5883 |
+
swiper.params.pagination.el
|
5884 |
+
&& swiper.params.pagination.hideOnClick
|
5885 |
+
&& swiper.pagination.$el.length > 0
|
5886 |
+
&& !$(e.target).hasClass(swiper.params.pagination.bulletClass)
|
5887 |
+
) {
|
5888 |
+
var isHidden = swiper.pagination.$el.hasClass(swiper.params.pagination.hiddenClass);
|
5889 |
+
if (isHidden === true) {
|
5890 |
+
swiper.emit('paginationShow', swiper);
|
5891 |
+
} else {
|
5892 |
+
swiper.emit('paginationHide', swiper);
|
5893 |
+
}
|
5894 |
+
swiper.pagination.$el.toggleClass(swiper.params.pagination.hiddenClass);
|
5895 |
+
}
|
5896 |
+
},
|
5897 |
+
},
|
5898 |
+
};
|
5899 |
+
|
5900 |
+
var Scrollbar = {
|
5901 |
+
setTranslate: function setTranslate() {
|
5902 |
+
var swiper = this;
|
5903 |
+
if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) { return; }
|
5904 |
+
var scrollbar = swiper.scrollbar;
|
5905 |
+
var rtl = swiper.rtlTranslate;
|
5906 |
+
var progress = swiper.progress;
|
5907 |
+
var dragSize = scrollbar.dragSize;
|
5908 |
+
var trackSize = scrollbar.trackSize;
|
5909 |
+
var $dragEl = scrollbar.$dragEl;
|
5910 |
+
var $el = scrollbar.$el;
|
5911 |
+
var params = swiper.params.scrollbar;
|
5912 |
+
|
5913 |
+
var newSize = dragSize;
|
5914 |
+
var newPos = (trackSize - dragSize) * progress;
|
5915 |
+
if (rtl) {
|
5916 |
+
newPos = -newPos;
|
5917 |
+
if (newPos > 0) {
|
5918 |
+
newSize = dragSize - newPos;
|
5919 |
+
newPos = 0;
|
5920 |
+
} else if (-newPos + dragSize > trackSize) {
|
5921 |
+
newSize = trackSize + newPos;
|
5922 |
+
}
|
5923 |
+
} else if (newPos < 0) {
|
5924 |
+
newSize = dragSize + newPos;
|
5925 |
+
newPos = 0;
|
5926 |
+
} else if (newPos + dragSize > trackSize) {
|
5927 |
+
newSize = trackSize - newPos;
|
5928 |
+
}
|
5929 |
+
if (swiper.isHorizontal()) {
|
5930 |
+
$dragEl.transform(("translate3d(" + newPos + "px, 0, 0)"));
|
5931 |
+
$dragEl[0].style.width = newSize + "px";
|
5932 |
+
} else {
|
5933 |
+
$dragEl.transform(("translate3d(0px, " + newPos + "px, 0)"));
|
5934 |
+
$dragEl[0].style.height = newSize + "px";
|
5935 |
+
}
|
5936 |
+
if (params.hide) {
|
5937 |
+
clearTimeout(swiper.scrollbar.timeout);
|
5938 |
+
$el[0].style.opacity = 1;
|
5939 |
+
swiper.scrollbar.timeout = setTimeout(function () {
|
5940 |
+
$el[0].style.opacity = 0;
|
5941 |
+
$el.transition(400);
|
5942 |
+
}, 1000);
|
5943 |
+
}
|
5944 |
+
},
|
5945 |
+
setTransition: function setTransition(duration) {
|
5946 |
+
var swiper = this;
|
5947 |
+
if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) { return; }
|
5948 |
+
swiper.scrollbar.$dragEl.transition(duration);
|
5949 |
+
},
|
5950 |
+
updateSize: function updateSize() {
|
5951 |
+
var swiper = this;
|
5952 |
+
if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) { return; }
|
5953 |
+
|
5954 |
+
var scrollbar = swiper.scrollbar;
|
5955 |
+
var $dragEl = scrollbar.$dragEl;
|
5956 |
+
var $el = scrollbar.$el;
|
5957 |
+
|
5958 |
+
$dragEl[0].style.width = '';
|
5959 |
+
$dragEl[0].style.height = '';
|
5960 |
+
var trackSize = swiper.isHorizontal() ? $el[0].offsetWidth : $el[0].offsetHeight;
|
5961 |
+
|
5962 |
+
var divider = swiper.size / swiper.virtualSize;
|
5963 |
+
var moveDivider = divider * (trackSize / swiper.size);
|
5964 |
+
var dragSize;
|
5965 |
+
if (swiper.params.scrollbar.dragSize === 'auto') {
|
5966 |
+
dragSize = trackSize * divider;
|
5967 |
+
} else {
|
5968 |
+
dragSize = parseInt(swiper.params.scrollbar.dragSize, 10);
|
5969 |
+
}
|
5970 |
+
|
5971 |
+
if (swiper.isHorizontal()) {
|
5972 |
+
$dragEl[0].style.width = dragSize + "px";
|
5973 |
+
} else {
|
5974 |
+
$dragEl[0].style.height = dragSize + "px";
|
5975 |
+
}
|
5976 |
+
|
5977 |
+
if (divider >= 1) {
|
5978 |
+
$el[0].style.display = 'none';
|
5979 |
+
} else {
|
5980 |
+
$el[0].style.display = '';
|
5981 |
+
}
|
5982 |
+
if (swiper.params.scrollbar.hide) {
|
5983 |
+
$el[0].style.opacity = 0;
|
5984 |
+
}
|
5985 |
+
Utils.extend(scrollbar, {
|
5986 |
+
trackSize: trackSize,
|
5987 |
+
divider: divider,
|
5988 |
+
moveDivider: moveDivider,
|
5989 |
+
dragSize: dragSize,
|
5990 |
+
});
|
5991 |
+
scrollbar.$el[swiper.params.watchOverflow && swiper.isLocked ? 'addClass' : 'removeClass'](swiper.params.scrollbar.lockClass);
|
5992 |
+
},
|
5993 |
+
getPointerPosition: function getPointerPosition(e) {
|
5994 |
+
var swiper = this;
|
5995 |
+
if (swiper.isHorizontal()) {
|
5996 |
+
return ((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].clientX : e.clientX);
|
5997 |
+
}
|
5998 |
+
return ((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].clientY : e.clientY);
|
5999 |
+
},
|
6000 |
+
setDragPosition: function setDragPosition(e) {
|
6001 |
+
var swiper = this;
|
6002 |
+
var scrollbar = swiper.scrollbar;
|
6003 |
+
var rtl = swiper.rtlTranslate;
|
6004 |
+
var $el = scrollbar.$el;
|
6005 |
+
var dragSize = scrollbar.dragSize;
|
6006 |
+
var trackSize = scrollbar.trackSize;
|
6007 |
+
var dragStartPos = scrollbar.dragStartPos;
|
6008 |
+
|
6009 |
+
var positionRatio;
|
6010 |
+
positionRatio = ((scrollbar.getPointerPosition(e)) - $el.offset()[swiper.isHorizontal() ? 'left' : 'top']
|
6011 |
+
- (dragStartPos !== null ? dragStartPos : dragSize / 2)) / (trackSize - dragSize);
|
6012 |
+
positionRatio = Math.max(Math.min(positionRatio, 1), 0);
|
6013 |
+
if (rtl) {
|
6014 |
+
positionRatio = 1 - positionRatio;
|
6015 |
+
}
|
6016 |
+
|
6017 |
+
var position = swiper.minTranslate() + ((swiper.maxTranslate() - swiper.minTranslate()) * positionRatio);
|
6018 |
+
|
6019 |
+
swiper.updateProgress(position);
|
6020 |
+
swiper.setTranslate(position);
|
6021 |
+
swiper.updateActiveIndex();
|
6022 |
+
swiper.updateSlidesClasses();
|
6023 |
+
},
|
6024 |
+
onDragStart: function onDragStart(e) {
|
6025 |
+
var swiper = this;
|
6026 |
+
var params = swiper.params.scrollbar;
|
6027 |
+
var scrollbar = swiper.scrollbar;
|
6028 |
+
var $wrapperEl = swiper.$wrapperEl;
|
6029 |
+
var $el = scrollbar.$el;
|
6030 |
+
var $dragEl = scrollbar.$dragEl;
|
6031 |
+
swiper.scrollbar.isTouched = true;
|
6032 |
+
swiper.scrollbar.dragStartPos = (e.target === $dragEl[0] || e.target === $dragEl)
|
6033 |
+
? scrollbar.getPointerPosition(e) - e.target.getBoundingClientRect()[swiper.isHorizontal() ? 'left' : 'top'] : null;
|
6034 |
+
e.preventDefault();
|
6035 |
+
e.stopPropagation();
|
6036 |
+
|
6037 |
+
$wrapperEl.transition(100);
|
6038 |
+
$dragEl.transition(100);
|
6039 |
+
scrollbar.setDragPosition(e);
|
6040 |
+
|
6041 |
+
clearTimeout(swiper.scrollbar.dragTimeout);
|
6042 |
+
|
6043 |
+
$el.transition(0);
|
6044 |
+
if (params.hide) {
|
6045 |
+
$el.css('opacity', 1);
|
6046 |
+
}
|
6047 |
+
if (swiper.params.cssMode) {
|
6048 |
+
swiper.$wrapperEl.css('scroll-snap-type', 'none');
|
6049 |
+
}
|
6050 |
+
swiper.emit('scrollbarDragStart', e);
|
6051 |
+
},
|
6052 |
+
onDragMove: function onDragMove(e) {
|
6053 |
+
var swiper = this;
|
6054 |
+
var scrollbar = swiper.scrollbar;
|
6055 |
+
var $wrapperEl = swiper.$wrapperEl;
|
6056 |
+
var $el = scrollbar.$el;
|
6057 |
+
var $dragEl = scrollbar.$dragEl;
|
6058 |
+
|
6059 |
+
if (!swiper.scrollbar.isTouched) { return; }
|
6060 |
+
if (e.preventDefault) { e.preventDefault(); }
|
6061 |
+
else { e.returnValue = false; }
|
6062 |
+
scrollbar.setDragPosition(e);
|
6063 |
+
$wrapperEl.transition(0);
|
6064 |
+
$el.transition(0);
|
6065 |
+
$dragEl.transition(0);
|
6066 |
+
swiper.emit('scrollbarDragMove', e);
|
6067 |
+
},
|
6068 |
+
onDragEnd: function onDragEnd(e) {
|
6069 |
+
var swiper = this;
|
6070 |
+
|
6071 |
+
var params = swiper.params.scrollbar;
|
6072 |
+
var scrollbar = swiper.scrollbar;
|
6073 |
+
var $wrapperEl = swiper.$wrapperEl;
|
6074 |
+
var $el = scrollbar.$el;
|
6075 |
+
|
6076 |
+
if (!swiper.scrollbar.isTouched) { return; }
|
6077 |
+
swiper.scrollbar.isTouched = false;
|
6078 |
+
if (swiper.params.cssMode) {
|
6079 |
+
swiper.$wrapperEl.css('scroll-snap-type', '');
|
6080 |
+
$wrapperEl.transition('');
|
6081 |
+
}
|
6082 |
+
if (params.hide) {
|
6083 |
+
clearTimeout(swiper.scrollbar.dragTimeout);
|
6084 |
+
swiper.scrollbar.dragTimeout = Utils.nextTick(function () {
|
6085 |
+
$el.css('opacity', 0);
|
6086 |
+
$el.transition(400);
|
6087 |
+
}, 1000);
|
6088 |
+
}
|
6089 |
+
swiper.emit('scrollbarDragEnd', e);
|
6090 |
+
if (params.snapOnRelease) {
|
6091 |
+
swiper.slideToClosest();
|
6092 |
+
}
|
6093 |
+
},
|
6094 |
+
enableDraggable: function enableDraggable() {
|
6095 |
+
var swiper = this;
|
6096 |
+
if (!swiper.params.scrollbar.el) { return; }
|
6097 |
+
var scrollbar = swiper.scrollbar;
|
6098 |
+
var touchEventsTouch = swiper.touchEventsTouch;
|
6099 |
+
var touchEventsDesktop = swiper.touchEventsDesktop;
|
6100 |
+
var params = swiper.params;
|
6101 |
+
var $el = scrollbar.$el;
|
6102 |
+
var target = $el[0];
|
6103 |
+
var activeListener = Support.passiveListener && params.passiveListeners ? { passive: false, capture: false } : false;
|
6104 |
+
var passiveListener = Support.passiveListener && params.passiveListeners ? { passive: true, capture: false } : false;
|
6105 |
+
if (!Support.touch) {
|
6106 |
+
target.addEventListener(touchEventsDesktop.start, swiper.scrollbar.onDragStart, activeListener);
|
6107 |
+
doc.addEventListener(touchEventsDesktop.move, swiper.scrollbar.onDragMove, activeListener);
|
6108 |
+
doc.addEventListener(touchEventsDesktop.end, swiper.scrollbar.onDragEnd, passiveListener);
|
6109 |
+
} else {
|
6110 |
+
target.addEventListener(touchEventsTouch.start, swiper.scrollbar.onDragStart, activeListener);
|
6111 |
+
target.addEventListener(touchEventsTouch.move, swiper.scrollbar.onDragMove, activeListener);
|
6112 |
+
target.addEventListener(touchEventsTouch.end, swiper.scrollbar.onDragEnd, passiveListener);
|
6113 |
+
}
|
6114 |
+
},
|
6115 |
+
disableDraggable: function disableDraggable() {
|
6116 |
+
var swiper = this;
|
6117 |
+
if (!swiper.params.scrollbar.el) { return; }
|
6118 |
+
var scrollbar = swiper.scrollbar;
|
6119 |
+
var touchEventsTouch = swiper.touchEventsTouch;
|
6120 |
+
var touchEventsDesktop = swiper.touchEventsDesktop;
|
6121 |
+
var params = swiper.params;
|
6122 |
+
var $el = scrollbar.$el;
|
6123 |
+
var target = $el[0];
|
6124 |
+
var activeListener = Support.passiveListener && params.passiveListeners ? { passive: false, capture: false } : false;
|
6125 |
+
var passiveListener = Support.passiveListener && params.passiveListeners ? { passive: true, capture: false } : false;
|
6126 |
+
if (!Support.touch) {
|
6127 |
+
target.removeEventListener(touchEventsDesktop.start, swiper.scrollbar.onDragStart, activeListener);
|
6128 |
+
doc.removeEventListener(touchEventsDesktop.move, swiper.scrollbar.onDragMove, activeListener);
|
6129 |
+
doc.removeEventListener(touchEventsDesktop.end, swiper.scrollbar.onDragEnd, passiveListener);
|
6130 |
+
} else {
|
6131 |
+
target.removeEventListener(touchEventsTouch.start, swiper.scrollbar.onDragStart, activeListener);
|
6132 |
+
target.removeEventListener(touchEventsTouch.move, swiper.scrollbar.onDragMove, activeListener);
|
6133 |
+
target.removeEventListener(touchEventsTouch.end, swiper.scrollbar.onDragEnd, passiveListener);
|
6134 |
+
}
|
6135 |
+
},
|
6136 |
+
init: function init() {
|
6137 |
+
var swiper = this;
|
6138 |
+
if (!swiper.params.scrollbar.el) { return; }
|
6139 |
+
var scrollbar = swiper.scrollbar;
|
6140 |
+
var $swiperEl = swiper.$el;
|
6141 |
+
var params = swiper.params.scrollbar;
|
6142 |
+
|
6143 |
+
var $el = $(params.el);
|
6144 |
+
if (swiper.params.uniqueNavElements && typeof params.el === 'string' && $el.length > 1 && $swiperEl.find(params.el).length === 1) {
|
6145 |
+
$el = $swiperEl.find(params.el);
|
6146 |
+
}
|
6147 |
+
|
6148 |
+
var $dragEl = $el.find(("." + (swiper.params.scrollbar.dragClass)));
|
6149 |
+
if ($dragEl.length === 0) {
|
6150 |
+
$dragEl = $(("<div class=\"" + (swiper.params.scrollbar.dragClass) + "\"></div>"));
|
6151 |
+
$el.append($dragEl);
|
6152 |
+
}
|
6153 |
+
|
6154 |
+
Utils.extend(scrollbar, {
|
6155 |
+
$el: $el,
|
6156 |
+
el: $el[0],
|
6157 |
+
$dragEl: $dragEl,
|
6158 |
+
dragEl: $dragEl[0],
|
6159 |
+
});
|
6160 |
+
|
6161 |
+
if (params.draggable) {
|
6162 |
+
scrollbar.enableDraggable();
|
6163 |
+
}
|
6164 |
+
},
|
6165 |
+
destroy: function destroy() {
|
6166 |
+
var swiper = this;
|
6167 |
+
swiper.scrollbar.disableDraggable();
|
6168 |
+
},
|
6169 |
+
};
|
6170 |
+
|
6171 |
+
var Scrollbar$1 = {
|
6172 |
+
name: 'scrollbar',
|
6173 |
+
params: {
|
6174 |
+
scrollbar: {
|
6175 |
+
el: null,
|
6176 |
+
dragSize: 'auto',
|
6177 |
+
hide: false,
|
6178 |
+
draggable: false,
|
6179 |
+
snapOnRelease: true,
|
6180 |
+
lockClass: 'swiper-scrollbar-lock',
|
6181 |
+
dragClass: 'swiper-scrollbar-drag',
|
6182 |
+
},
|
6183 |
+
},
|
6184 |
+
create: function create() {
|
6185 |
+
var swiper = this;
|
6186 |
+
Utils.extend(swiper, {
|
6187 |
+
scrollbar: {
|
6188 |
+
init: Scrollbar.init.bind(swiper),
|
6189 |
+
destroy: Scrollbar.destroy.bind(swiper),
|
6190 |
+
updateSize: Scrollbar.updateSize.bind(swiper),
|
6191 |
+
setTranslate: Scrollbar.setTranslate.bind(swiper),
|
6192 |
+
setTransition: Scrollbar.setTransition.bind(swiper),
|
6193 |
+
enableDraggable: Scrollbar.enableDraggable.bind(swiper),
|
6194 |
+
disableDraggable: Scrollbar.disableDraggable.bind(swiper),
|
6195 |
+
setDragPosition: Scrollbar.setDragPosition.bind(swiper),
|
6196 |
+
getPointerPosition: Scrollbar.getPointerPosition.bind(swiper),
|
6197 |
+
onDragStart: Scrollbar.onDragStart.bind(swiper),
|
6198 |
+
onDragMove: Scrollbar.onDragMove.bind(swiper),
|
6199 |
+
onDragEnd: Scrollbar.onDragEnd.bind(swiper),
|
6200 |
+
isTouched: false,
|
6201 |
+
timeout: null,
|
6202 |
+
dragTimeout: null,
|
6203 |
+
},
|
6204 |
+
});
|
6205 |
+
},
|
6206 |
+
on: {
|
6207 |
+
init: function init() {
|
6208 |
+
var swiper = this;
|
6209 |
+
swiper.scrollbar.init();
|
6210 |
+
swiper.scrollbar.updateSize();
|
6211 |
+
swiper.scrollbar.setTranslate();
|
6212 |
+
},
|
6213 |
+
update: function update() {
|
6214 |
+
var swiper = this;
|
6215 |
+
swiper.scrollbar.updateSize();
|
6216 |
+
},
|
6217 |
+
resize: function resize() {
|
6218 |
+
var swiper = this;
|
6219 |
+
swiper.scrollbar.updateSize();
|
6220 |
+
},
|
6221 |
+
observerUpdate: function observerUpdate() {
|
6222 |
+
var swiper = this;
|
6223 |
+
swiper.scrollbar.updateSize();
|
6224 |
+
},
|
6225 |
+
setTranslate: function setTranslate() {
|
6226 |
+
var swiper = this;
|
6227 |
+
swiper.scrollbar.setTranslate();
|
6228 |
+
},
|
6229 |
+
setTransition: function setTransition(duration) {
|
6230 |
+
var swiper = this;
|
6231 |
+
swiper.scrollbar.setTransition(duration);
|
6232 |
+
},
|
6233 |
+
destroy: function destroy() {
|
6234 |
+
var swiper = this;
|
6235 |
+
swiper.scrollbar.destroy();
|
6236 |
+
},
|
6237 |
+
},
|
6238 |
+
};
|
6239 |
+
|
6240 |
+
var Parallax = {
|
6241 |
+
setTransform: function setTransform(el, progress) {
|
6242 |
+
var swiper = this;
|
6243 |
+
var rtl = swiper.rtl;
|
6244 |
+
|
6245 |
+
var $el = $(el);
|
6246 |
+
var rtlFactor = rtl ? -1 : 1;
|
6247 |
+
|
6248 |
+
var p = $el.attr('data-swiper-parallax') || '0';
|
6249 |
+
var x = $el.attr('data-swiper-parallax-x');
|
6250 |
+
var y = $el.attr('data-swiper-parallax-y');
|
6251 |
+
var scale = $el.attr('data-swiper-parallax-scale');
|
6252 |
+
var opacity = $el.attr('data-swiper-parallax-opacity');
|
6253 |
+
|
6254 |
+
if (x || y) {
|
6255 |
+
x = x || '0';
|
6256 |
+
y = y || '0';
|
6257 |
+
} else if (swiper.isHorizontal()) {
|
6258 |
+
x = p;
|
6259 |
+
y = '0';
|
6260 |
+
} else {
|
6261 |
+
y = p;
|
6262 |
+
x = '0';
|
6263 |
+
}
|
6264 |
+
|
6265 |
+
if ((x).indexOf('%') >= 0) {
|
6266 |
+
x = (parseInt(x, 10) * progress * rtlFactor) + "%";
|
6267 |
+
} else {
|
6268 |
+
x = (x * progress * rtlFactor) + "px";
|
6269 |
+
}
|
6270 |
+
if ((y).indexOf('%') >= 0) {
|
6271 |
+
y = (parseInt(y, 10) * progress) + "%";
|
6272 |
+
} else {
|
6273 |
+
y = (y * progress) + "px";
|
6274 |
+
}
|
6275 |
+
|
6276 |
+
if (typeof opacity !== 'undefined' && opacity !== null) {
|
6277 |
+
var currentOpacity = opacity - ((opacity - 1) * (1 - Math.abs(progress)));
|
6278 |
+
$el[0].style.opacity = currentOpacity;
|
6279 |
+
}
|
6280 |
+
if (typeof scale === 'undefined' || scale === null) {
|
6281 |
+
$el.transform(("translate3d(" + x + ", " + y + ", 0px)"));
|
6282 |
+
} else {
|
6283 |
+
var currentScale = scale - ((scale - 1) * (1 - Math.abs(progress)));
|
6284 |
+
$el.transform(("translate3d(" + x + ", " + y + ", 0px) scale(" + currentScale + ")"));
|
6285 |
+
}
|
6286 |
+
},
|
6287 |
+
setTranslate: function setTranslate() {
|
6288 |
+
var swiper = this;
|
6289 |
+
var $el = swiper.$el;
|
6290 |
+
var slides = swiper.slides;
|
6291 |
+
var progress = swiper.progress;
|
6292 |
+
var snapGrid = swiper.snapGrid;
|
6293 |
+
$el.children('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]')
|
6294 |
+
.each(function (index, el) {
|
6295 |
+
swiper.parallax.setTransform(el, progress);
|
6296 |
+
});
|
6297 |
+
slides.each(function (slideIndex, slideEl) {
|
6298 |
+
var slideProgress = slideEl.progress;
|
6299 |
+
if (swiper.params.slidesPerGroup > 1 && swiper.params.slidesPerView !== 'auto') {
|
6300 |
+
slideProgress += Math.ceil(slideIndex / 2) - (progress * (snapGrid.length - 1));
|
6301 |
+
}
|
6302 |
+
slideProgress = Math.min(Math.max(slideProgress, -1), 1);
|
6303 |
+
$(slideEl).find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]')
|
6304 |
+
.each(function (index, el) {
|
6305 |
+
swiper.parallax.setTransform(el, slideProgress);
|
6306 |
+
});
|
6307 |
+
});
|
6308 |
+
},
|
6309 |
+
setTransition: function setTransition(duration) {
|
6310 |
+
if ( duration === void 0 ) duration = this.params.speed;
|
6311 |
+
|
6312 |
+
var swiper = this;
|
6313 |
+
var $el = swiper.$el;
|
6314 |
+
$el.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]')
|
6315 |
+
.each(function (index, parallaxEl) {
|
6316 |
+
var $parallaxEl = $(parallaxEl);
|
6317 |
+
var parallaxDuration = parseInt($parallaxEl.attr('data-swiper-parallax-duration'), 10) || duration;
|
6318 |
+
if (duration === 0) { parallaxDuration = 0; }
|
6319 |
+
$parallaxEl.transition(parallaxDuration);
|
6320 |
+
});
|
6321 |
+
},
|
6322 |
+
};
|
6323 |
+
|
6324 |
+
var Parallax$1 = {
|
6325 |
+
name: 'parallax',
|
6326 |
+
params: {
|
6327 |
+
parallax: {
|
6328 |
+
enabled: false,
|
6329 |
+
},
|
6330 |
+
},
|
6331 |
+
create: function create() {
|
6332 |
+
var swiper = this;
|
6333 |
+
Utils.extend(swiper, {
|
6334 |
+
parallax: {
|
6335 |
+
setTransform: Parallax.setTransform.bind(swiper),
|
6336 |
+
setTranslate: Parallax.setTranslate.bind(swiper),
|
6337 |
+
setTransition: Parallax.setTransition.bind(swiper),
|
6338 |
+
},
|
6339 |
+
});
|
6340 |
+
},
|
6341 |
+
on: {
|
6342 |
+
beforeInit: function beforeInit() {
|
6343 |
+
var swiper = this;
|
6344 |
+
if (!swiper.params.parallax.enabled) { return; }
|
6345 |
+
swiper.params.watchSlidesProgress = true;
|
6346 |
+
swiper.originalParams.watchSlidesProgress = true;
|
6347 |
+
},
|
6348 |
+
init: function init() {
|
6349 |
+
var swiper = this;
|
6350 |
+
if (!swiper.params.parallax.enabled) { return; }
|
6351 |
+
swiper.parallax.setTranslate();
|
6352 |
+
},
|
6353 |
+
setTranslate: function setTranslate() {
|
6354 |
+
var swiper = this;
|
6355 |
+
if (!swiper.params.parallax.enabled) { return; }
|
6356 |
+
swiper.parallax.setTranslate();
|
6357 |
+
},
|
6358 |
+
setTransition: function setTransition(duration) {
|
6359 |
+
var swiper = this;
|
6360 |
+
if (!swiper.params.parallax.enabled) { return; }
|
6361 |
+
swiper.parallax.setTransition(duration);
|
6362 |
+
},
|
6363 |
+
},
|
6364 |
+
};
|
6365 |
+
|
6366 |
+
var Zoom = {
|
6367 |
+
// Calc Scale From Multi-touches
|
6368 |
+
getDistanceBetweenTouches: function getDistanceBetweenTouches(e) {
|
6369 |
+
if (e.targetTouches.length < 2) { return 1; }
|
6370 |
+
var x1 = e.targetTouches[0].pageX;
|
6371 |
+
var y1 = e.targetTouches[0].pageY;
|
6372 |
+
var x2 = e.targetTouches[1].pageX;
|
6373 |
+
var y2 = e.targetTouches[1].pageY;
|
6374 |
+
var distance = Math.sqrt((Math.pow( (x2 - x1), 2 )) + (Math.pow( (y2 - y1), 2 )));
|
6375 |
+
return distance;
|
6376 |
+
},
|
6377 |
+
// Events
|
6378 |
+
onGestureStart: function onGestureStart(e) {
|
6379 |
+
var swiper = this;
|
6380 |
+
var params = swiper.params.zoom;
|
6381 |
+
var zoom = swiper.zoom;
|
6382 |
+
var gesture = zoom.gesture;
|
6383 |
+
zoom.fakeGestureTouched = false;
|
6384 |
+
zoom.fakeGestureMoved = false;
|
6385 |
+
if (!Support.gestures) {
|
6386 |
+
if (e.type !== 'touchstart' || (e.type === 'touchstart' && e.targetTouches.length < 2)) {
|
6387 |
+
return;
|
6388 |
+
}
|
6389 |
+
zoom.fakeGestureTouched = true;
|
6390 |
+
gesture.scaleStart = Zoom.getDistanceBetweenTouches(e);
|
6391 |
+
}
|
6392 |
+
if (!gesture.$slideEl || !gesture.$slideEl.length) {
|
6393 |
+
gesture.$slideEl = $(e.target).closest(("." + (swiper.params.slideClass)));
|
6394 |
+
if (gesture.$slideEl.length === 0) { gesture.$slideEl = swiper.slides.eq(swiper.activeIndex); }
|
6395 |
+
gesture.$imageEl = gesture.$slideEl.find('img, svg, canvas, picture, .swiper-zoom-target');
|
6396 |
+
gesture.$imageWrapEl = gesture.$imageEl.parent(("." + (params.containerClass)));
|
6397 |
+
gesture.maxRatio = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio;
|
6398 |
+
if (gesture.$imageWrapEl.length === 0) {
|
6399 |
+
gesture.$imageEl = undefined;
|
6400 |
+
return;
|
6401 |
+
}
|
6402 |
+
}
|
6403 |
+
gesture.$imageEl.transition(0);
|
6404 |
+
swiper.zoom.isScaling = true;
|
6405 |
+
},
|
6406 |
+
onGestureChange: function onGestureChange(e) {
|
6407 |
+
var swiper = this;
|
6408 |
+
var params = swiper.params.zoom;
|
6409 |
+
var zoom = swiper.zoom;
|
6410 |
+
var gesture = zoom.gesture;
|
6411 |
+
if (!Support.gestures) {
|
6412 |
+
if (e.type !== 'touchmove' || (e.type === 'touchmove' && e.targetTouches.length < 2)) {
|
6413 |
+
return;
|
6414 |
+
}
|
6415 |
+
zoom.fakeGestureMoved = true;
|
6416 |
+
gesture.scaleMove = Zoom.getDistanceBetweenTouches(e);
|
6417 |
+
}
|
6418 |
+
if (!gesture.$imageEl || gesture.$imageEl.length === 0) { return; }
|
6419 |
+
if (Support.gestures) {
|
6420 |
+
zoom.scale = e.scale * zoom.currentScale;
|
6421 |
+
} else {
|
6422 |
+
zoom.scale = (gesture.scaleMove / gesture.scaleStart) * zoom.currentScale;
|
6423 |
+
}
|
6424 |
+
if (zoom.scale > gesture.maxRatio) {
|
6425 |
+
zoom.scale = (gesture.maxRatio - 1) + (Math.pow( ((zoom.scale - gesture.maxRatio) + 1), 0.5 ));
|
6426 |
+
}
|
6427 |
+
if (zoom.scale < params.minRatio) {
|
6428 |
+
zoom.scale = (params.minRatio + 1) - (Math.pow( ((params.minRatio - zoom.scale) + 1), 0.5 ));
|
6429 |
+
}
|
6430 |
+
gesture.$imageEl.transform(("translate3d(0,0,0) scale(" + (zoom.scale) + ")"));
|
6431 |
+
},
|
6432 |
+
onGestureEnd: function onGestureEnd(e) {
|
6433 |
+
var swiper = this;
|
6434 |
+
var params = swiper.params.zoom;
|
6435 |
+
var zoom = swiper.zoom;
|
6436 |
+
var gesture = zoom.gesture;
|
6437 |
+
if (!Support.gestures) {
|
6438 |
+
if (!zoom.fakeGestureTouched || !zoom.fakeGestureMoved) {
|
6439 |
+
return;
|
6440 |
+
}
|
6441 |
+
if (e.type !== 'touchend' || (e.type === 'touchend' && e.changedTouches.length < 2 && !Device.android)) {
|
6442 |
+
return;
|
6443 |
+
}
|
6444 |
+
zoom.fakeGestureTouched = false;
|
6445 |
+
zoom.fakeGestureMoved = false;
|
6446 |
+
}
|
6447 |
+
if (!gesture.$imageEl || gesture.$imageEl.length === 0) { return; }
|
6448 |
+
zoom.scale = Math.max(Math.min(zoom.scale, gesture.maxRatio), params.minRatio);
|
6449 |
+
gesture.$imageEl.transition(swiper.params.speed).transform(("translate3d(0,0,0) scale(" + (zoom.scale) + ")"));
|
6450 |
+
zoom.currentScale = zoom.scale;
|
6451 |
+
zoom.isScaling = false;
|
6452 |
+
if (zoom.scale === 1) { gesture.$slideEl = undefined; }
|
6453 |
+
},
|
6454 |
+
onTouchStart: function onTouchStart(e) {
|
6455 |
+
var swiper = this;
|
6456 |
+
var zoom = swiper.zoom;
|
6457 |
+
var gesture = zoom.gesture;
|
6458 |
+
var image = zoom.image;
|
6459 |
+
if (!gesture.$imageEl || gesture.$imageEl.length === 0) { return; }
|
6460 |
+
if (image.isTouched) { return; }
|
6461 |
+
if (Device.android) { e.preventDefault(); }
|
6462 |
+
image.isTouched = true;
|
6463 |
+
image.touchesStart.x = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
|
6464 |
+
image.touchesStart.y = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
|
6465 |
+
},
|
6466 |
+
onTouchMove: function onTouchMove(e) {
|
6467 |
+
var swiper = this;
|
6468 |
+
var zoom = swiper.zoom;
|
6469 |
+
var gesture = zoom.gesture;
|
6470 |
+
var image = zoom.image;
|
6471 |
+
var velocity = zoom.velocity;
|
6472 |
+
if (!gesture.$imageEl || gesture.$imageEl.length === 0) { return; }
|
6473 |
+
swiper.allowClick = false;
|
6474 |
+
if (!image.isTouched || !gesture.$slideEl) { return; }
|
6475 |
+
|
6476 |
+
if (!image.isMoved) {
|
6477 |
+
image.width = gesture.$imageEl[0].offsetWidth;
|
6478 |
+
image.height = gesture.$imageEl[0].offsetHeight;
|
6479 |
+
image.startX = Utils.getTranslate(gesture.$imageWrapEl[0], 'x') || 0;
|
6480 |
+
image.startY = Utils.getTranslate(gesture.$imageWrapEl[0], 'y') || 0;
|
6481 |
+
gesture.slideWidth = gesture.$slideEl[0].offsetWidth;
|
6482 |
+
gesture.slideHeight = gesture.$slideEl[0].offsetHeight;
|
6483 |
+
gesture.$imageWrapEl.transition(0);
|
6484 |
+
if (swiper.rtl) {
|
6485 |
+
image.startX = -image.startX;
|
6486 |
+
image.startY = -image.startY;
|
6487 |
+
}
|
6488 |
+
}
|
6489 |
+
// Define if we need image drag
|
6490 |
+
var scaledWidth = image.width * zoom.scale;
|
6491 |
+
var scaledHeight = image.height * zoom.scale;
|
6492 |
+
|
6493 |
+
if (scaledWidth < gesture.slideWidth && scaledHeight < gesture.slideHeight) { return; }
|
6494 |
+
|
6495 |
+
image.minX = Math.min(((gesture.slideWidth / 2) - (scaledWidth / 2)), 0);
|
6496 |
+
image.maxX = -image.minX;
|
6497 |
+
image.minY = Math.min(((gesture.slideHeight / 2) - (scaledHeight / 2)), 0);
|
6498 |
+
image.maxY = -image.minY;
|
6499 |
+
|
6500 |
+
image.touchesCurrent.x = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
|
6501 |
+
image.touchesCurrent.y = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
|
6502 |
+
|
6503 |
+
if (!image.isMoved && !zoom.isScaling) {
|
6504 |
+
if (
|
6505 |
+
swiper.isHorizontal()
|
6506 |
+
&& (
|
6507 |
+
(Math.floor(image.minX) === Math.floor(image.startX) && image.touchesCurrent.x < image.touchesStart.x)
|
6508 |
+
|| (Math.floor(image.maxX) === Math.floor(image.startX) && image.touchesCurrent.x > image.touchesStart.x)
|
6509 |
+
)
|
6510 |
+
) {
|
6511 |
+
image.isTouched = false;
|
6512 |
+
return;
|
6513 |
+
} if (
|
6514 |
+
!swiper.isHorizontal()
|
6515 |
+
&& (
|
6516 |
+
(Math.floor(image.minY) === Math.floor(image.startY) && image.touchesCurrent.y < image.touchesStart.y)
|
6517 |
+
|| (Math.floor(image.maxY) === Math.floor(image.startY) && image.touchesCurrent.y > image.touchesStart.y)
|
6518 |
+
)
|
6519 |
+
) {
|
6520 |
+
image.isTouched = false;
|
6521 |
+
return;
|
6522 |
+
}
|
6523 |
+
}
|
6524 |
+
e.preventDefault();
|
6525 |
+
e.stopPropagation();
|
6526 |
+
|
6527 |
+
image.isMoved = true;
|
6528 |
+
image.currentX = (image.touchesCurrent.x - image.touchesStart.x) + image.startX;
|
6529 |
+
image.currentY = (image.touchesCurrent.y - image.touchesStart.y) + image.startY;
|
6530 |
+
|
6531 |
+
if (image.currentX < image.minX) {
|
6532 |
+
image.currentX = (image.minX + 1) - (Math.pow( ((image.minX - image.currentX) + 1), 0.8 ));
|
6533 |
+
}
|
6534 |
+
if (image.currentX > image.maxX) {
|
6535 |
+
image.currentX = (image.maxX - 1) + (Math.pow( ((image.currentX - image.maxX) + 1), 0.8 ));
|
6536 |
+
}
|
6537 |
+
|
6538 |
+
if (image.currentY < image.minY) {
|
6539 |
+
image.currentY = (image.minY + 1) - (Math.pow( ((image.minY - image.currentY) + 1), 0.8 ));
|
6540 |
+
}
|
6541 |
+
if (image.currentY > image.maxY) {
|
6542 |
+
image.currentY = (image.maxY - 1) + (Math.pow( ((image.currentY - image.maxY) + 1), 0.8 ));
|
6543 |
+
}
|
6544 |
+
|
6545 |
+
// Velocity
|
6546 |
+
if (!velocity.prevPositionX) { velocity.prevPositionX = image.touchesCurrent.x; }
|
6547 |
+
if (!velocity.prevPositionY) { velocity.prevPositionY = image.touchesCurrent.y; }
|
6548 |
+
if (!velocity.prevTime) { velocity.prevTime = Date.now(); }
|
6549 |
+
velocity.x = (image.touchesCurrent.x - velocity.prevPositionX) / (Date.now() - velocity.prevTime) / 2;
|
6550 |
+
velocity.y = (image.touchesCurrent.y - velocity.prevPositionY) / (Date.now() - velocity.prevTime) / 2;
|
6551 |
+
if (Math.abs(image.touchesCurrent.x - velocity.prevPositionX) < 2) { velocity.x = 0; }
|
6552 |
+
if (Math.abs(image.touchesCurrent.y - velocity.prevPositionY) < 2) { velocity.y = 0; }
|
6553 |
+
velocity.prevPositionX = image.touchesCurrent.x;
|
6554 |
+
velocity.prevPositionY = image.touchesCurrent.y;
|
6555 |
+
velocity.prevTime = Date.now();
|
6556 |
+
|
6557 |
+
gesture.$imageWrapEl.transform(("translate3d(" + (image.currentX) + "px, " + (image.currentY) + "px,0)"));
|
6558 |
+
},
|
6559 |
+
onTouchEnd: function onTouchEnd() {
|
6560 |
+
var swiper = this;
|
6561 |
+
var zoom = swiper.zoom;
|
6562 |
+
var gesture = zoom.gesture;
|
6563 |
+
var image = zoom.image;
|
6564 |
+
var velocity = zoom.velocity;
|
6565 |
+
if (!gesture.$imageEl || gesture.$imageEl.length === 0) { return; }
|
6566 |
+
if (!image.isTouched || !image.isMoved) {
|
6567 |
+
image.isTouched = false;
|
6568 |
+
image.isMoved = false;
|
6569 |
+
return;
|
6570 |
+
}
|
6571 |
+
image.isTouched = false;
|
6572 |
+
image.isMoved = false;
|
6573 |
+
var momentumDurationX = 300;
|
6574 |
+
var momentumDurationY = 300;
|
6575 |
+
var momentumDistanceX = velocity.x * momentumDurationX;
|
6576 |
+
var newPositionX = image.currentX + momentumDistanceX;
|
6577 |
+
var momentumDistanceY = velocity.y * momentumDurationY;
|
6578 |
+
var newPositionY = image.currentY + momentumDistanceY;
|
6579 |
+
|
6580 |
+
// Fix duration
|
6581 |
+
if (velocity.x !== 0) { momentumDurationX = Math.abs((newPositionX - image.currentX) / velocity.x); }
|
6582 |
+
if (velocity.y !== 0) { momentumDurationY = Math.abs((newPositionY - image.currentY) / velocity.y); }
|
6583 |
+
var momentumDuration = Math.max(momentumDurationX, momentumDurationY);
|
6584 |
+
|
6585 |
+
image.currentX = newPositionX;
|
6586 |
+
image.currentY = newPositionY;
|
6587 |
+
|
6588 |
+
// Define if we need image drag
|
6589 |
+
var scaledWidth = image.width * zoom.scale;
|
6590 |
+
var scaledHeight = image.height * zoom.scale;
|
6591 |
+
image.minX = Math.min(((gesture.slideWidth / 2) - (scaledWidth / 2)), 0);
|
6592 |
+
image.maxX = -image.minX;
|
6593 |
+
image.minY = Math.min(((gesture.slideHeight / 2) - (scaledHeight / 2)), 0);
|
6594 |
+
image.maxY = -image.minY;
|
6595 |
+
image.currentX = Math.max(Math.min(image.currentX, image.maxX), image.minX);
|
6596 |
+
image.currentY = Math.max(Math.min(image.currentY, image.maxY), image.minY);
|
6597 |
+
|
6598 |
+
gesture.$imageWrapEl.transition(momentumDuration).transform(("translate3d(" + (image.currentX) + "px, " + (image.currentY) + "px,0)"));
|
6599 |
+
},
|
6600 |
+
onTransitionEnd: function onTransitionEnd() {
|
6601 |
+
var swiper = this;
|
6602 |
+
var zoom = swiper.zoom;
|
6603 |
+
var gesture = zoom.gesture;
|
6604 |
+
if (gesture.$slideEl && swiper.previousIndex !== swiper.activeIndex) {
|
6605 |
+
gesture.$imageEl.transform('translate3d(0,0,0) scale(1)');
|
6606 |
+
gesture.$imageWrapEl.transform('translate3d(0,0,0)');
|
6607 |
+
|
6608 |
+
zoom.scale = 1;
|
6609 |
+
zoom.currentScale = 1;
|
6610 |
+
|
6611 |
+
gesture.$slideEl = undefined;
|
6612 |
+
gesture.$imageEl = undefined;
|
6613 |
+
gesture.$imageWrapEl = undefined;
|
6614 |
+
}
|
6615 |
+
},
|
6616 |
+
// Toggle Zoom
|
6617 |
+
toggle: function toggle(e) {
|
6618 |
+
var swiper = this;
|
6619 |
+
var zoom = swiper.zoom;
|
6620 |
+
|
6621 |
+
if (zoom.scale && zoom.scale !== 1) {
|
6622 |
+
// Zoom Out
|
6623 |
+
zoom.out();
|
6624 |
+
} else {
|
6625 |
+
// Zoom In
|
6626 |
+
zoom.in(e);
|
6627 |
+
}
|
6628 |
+
},
|
6629 |
+
in: function in$1(e) {
|
6630 |
+
var swiper = this;
|
6631 |
+
|
6632 |
+
var zoom = swiper.zoom;
|
6633 |
+
var params = swiper.params.zoom;
|
6634 |
+
var gesture = zoom.gesture;
|
6635 |
+
var image = zoom.image;
|
6636 |
+
|
6637 |
+
if (!gesture.$slideEl) {
|
6638 |
+
gesture.$slideEl = swiper.slides.eq(swiper.activeIndex);
|
6639 |
+
gesture.$imageEl = gesture.$slideEl.find('img, svg, canvas, picture, .swiper-zoom-target');
|
6640 |
+
gesture.$imageWrapEl = gesture.$imageEl.parent(("." + (params.containerClass)));
|
6641 |
+
}
|
6642 |
+
if (!gesture.$imageEl || gesture.$imageEl.length === 0) { return; }
|
6643 |
+
|
6644 |
+
gesture.$slideEl.addClass(("" + (params.zoomedSlideClass)));
|
6645 |
+
|
6646 |
+
var touchX;
|
6647 |
+
var touchY;
|
6648 |
+
var offsetX;
|
6649 |
+
var offsetY;
|
6650 |
+
var diffX;
|
6651 |
+
var diffY;
|
6652 |
+
var translateX;
|
6653 |
+
var translateY;
|
6654 |
+
var imageWidth;
|
6655 |
+
var imageHeight;
|
6656 |
+
var scaledWidth;
|
6657 |
+
var scaledHeight;
|
6658 |
+
var translateMinX;
|
6659 |
+
var translateMinY;
|
6660 |
+
var translateMaxX;
|
6661 |
+
var translateMaxY;
|
6662 |
+
var slideWidth;
|
6663 |
+
var slideHeight;
|
6664 |
+
|
6665 |
+
if (typeof image.touchesStart.x === 'undefined' && e) {
|
6666 |
+
touchX = e.type === 'touchend' ? e.changedTouches[0].pageX : e.pageX;
|
6667 |
+
touchY = e.type === 'touchend' ? e.changedTouches[0].pageY : e.pageY;
|
6668 |
+
} else {
|
6669 |
+
touchX = image.touchesStart.x;
|
6670 |
+
touchY = image.touchesStart.y;
|
6671 |
+
}
|
6672 |
+
|
6673 |
+
zoom.scale = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio;
|
6674 |
+
zoom.currentScale = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio;
|
6675 |
+
if (e) {
|
6676 |
+
slideWidth = gesture.$slideEl[0].offsetWidth;
|
6677 |
+
slideHeight = gesture.$slideEl[0].offsetHeight;
|
6678 |
+
offsetX = gesture.$slideEl.offset().left;
|
6679 |
+
offsetY = gesture.$slideEl.offset().top;
|
6680 |
+
diffX = (offsetX + (slideWidth / 2)) - touchX;
|
6681 |
+
diffY = (offsetY + (slideHeight / 2)) - touchY;
|
6682 |
+
|
6683 |
+
imageWidth = gesture.$imageEl[0].offsetWidth;
|
6684 |
+
imageHeight = gesture.$imageEl[0].offsetHeight;
|
6685 |
+
scaledWidth = imageWidth * zoom.scale;
|
6686 |
+
scaledHeight = imageHeight * zoom.scale;
|
6687 |
+
|
6688 |
+
translateMinX = Math.min(((slideWidth / 2) - (scaledWidth / 2)), 0);
|
6689 |
+
translateMinY = Math.min(((slideHeight / 2) - (scaledHeight / 2)), 0);
|
6690 |
+
translateMaxX = -translateMinX;
|
6691 |
+
translateMaxY = -translateMinY;
|
6692 |
+
|
6693 |
+
translateX = diffX * zoom.scale;
|
6694 |
+
translateY = diffY * zoom.scale;
|
6695 |
+
|
6696 |
+
if (translateX < translateMinX) {
|
6697 |
+
translateX = translateMinX;
|
6698 |
+
}
|
6699 |
+
if (translateX > translateMaxX) {
|
6700 |
+
translateX = translateMaxX;
|
6701 |
+
}
|
6702 |
+
|
6703 |
+
if (translateY < translateMinY) {
|
6704 |
+
translateY = translateMinY;
|
6705 |
+
}
|
6706 |
+
if (translateY > translateMaxY) {
|
6707 |
+
translateY = translateMaxY;
|
6708 |
+
}
|
6709 |
+
} else {
|
6710 |
+
translateX = 0;
|
6711 |
+
translateY = 0;
|
6712 |
+
}
|
6713 |
+
gesture.$imageWrapEl.transition(300).transform(("translate3d(" + translateX + "px, " + translateY + "px,0)"));
|
6714 |
+
gesture.$imageEl.transition(300).transform(("translate3d(0,0,0) scale(" + (zoom.scale) + ")"));
|
6715 |
+
},
|
6716 |
+
out: function out() {
|
6717 |
+
var swiper = this;
|
6718 |
+
|
6719 |
+
var zoom = swiper.zoom;
|
6720 |
+
var params = swiper.params.zoom;
|
6721 |
+
var gesture = zoom.gesture;
|
6722 |
+
|
6723 |
+
if (!gesture.$slideEl) {
|
6724 |
+
gesture.$slideEl = swiper.slides.eq(swiper.activeIndex);
|
6725 |
+
gesture.$imageEl = gesture.$slideEl.find('img, svg, canvas, picture, .swiper-zoom-target');
|
6726 |
+
gesture.$imageWrapEl = gesture.$imageEl.parent(("." + (params.containerClass)));
|
6727 |
+
}
|
6728 |
+
if (!gesture.$imageEl || gesture.$imageEl.length === 0) { return; }
|
6729 |
+
|
6730 |
+
zoom.scale = 1;
|
6731 |
+
zoom.currentScale = 1;
|
6732 |
+
gesture.$imageWrapEl.transition(300).transform('translate3d(0,0,0)');
|
6733 |
+
gesture.$imageEl.transition(300).transform('translate3d(0,0,0) scale(1)');
|
6734 |
+
gesture.$slideEl.removeClass(("" + (params.zoomedSlideClass)));
|
6735 |
+
gesture.$slideEl = undefined;
|
6736 |
+
},
|
6737 |
+
// Attach/Detach Events
|
6738 |
+
enable: function enable() {
|
6739 |
+
var swiper = this;
|
6740 |
+
var zoom = swiper.zoom;
|
6741 |
+
if (zoom.enabled) { return; }
|
6742 |
+
zoom.enabled = true;
|
6743 |
+
|
6744 |
+
var passiveListener = swiper.touchEvents.start === 'touchstart' && Support.passiveListener && swiper.params.passiveListeners ? { passive: true, capture: false } : false;
|
6745 |
+
var activeListenerWithCapture = Support.passiveListener ? { passive: false, capture: true } : true;
|
6746 |
+
|
6747 |
+
var slideSelector = "." + (swiper.params.slideClass);
|
6748 |
+
|
6749 |
+
// Scale image
|
6750 |
+
if (Support.gestures) {
|
6751 |
+
swiper.$wrapperEl.on('gesturestart', slideSelector, zoom.onGestureStart, passiveListener);
|
6752 |
+
swiper.$wrapperEl.on('gesturechange', slideSelector, zoom.onGestureChange, passiveListener);
|
6753 |
+
swiper.$wrapperEl.on('gestureend', slideSelector, zoom.onGestureEnd, passiveListener);
|
6754 |
+
} else if (swiper.touchEvents.start === 'touchstart') {
|
6755 |
+
swiper.$wrapperEl.on(swiper.touchEvents.start, slideSelector, zoom.onGestureStart, passiveListener);
|
6756 |
+
swiper.$wrapperEl.on(swiper.touchEvents.move, slideSelector, zoom.onGestureChange, activeListenerWithCapture);
|
6757 |
+
swiper.$wrapperEl.on(swiper.touchEvents.end, slideSelector, zoom.onGestureEnd, passiveListener);
|
6758 |
+
if (swiper.touchEvents.cancel) {
|
6759 |
+
swiper.$wrapperEl.on(swiper.touchEvents.cancel, slideSelector, zoom.onGestureEnd, passiveListener);
|
6760 |
+
}
|
6761 |
+
}
|
6762 |
+
|
6763 |
+
// Move image
|
6764 |
+
swiper.$wrapperEl.on(swiper.touchEvents.move, ("." + (swiper.params.zoom.containerClass)), zoom.onTouchMove, activeListenerWithCapture);
|
6765 |
+
},
|
6766 |
+
disable: function disable() {
|
6767 |
+
var swiper = this;
|
6768 |
+
var zoom = swiper.zoom;
|
6769 |
+
if (!zoom.enabled) { return; }
|
6770 |
+
|
6771 |
+
swiper.zoom.enabled = false;
|
6772 |
+
|
6773 |
+
var passiveListener = swiper.touchEvents.start === 'touchstart' && Support.passiveListener && swiper.params.passiveListeners ? { passive: true, capture: false } : false;
|
6774 |
+
var activeListenerWithCapture = Support.passiveListener ? { passive: false, capture: true } : true;
|
6775 |
+
|
6776 |
+
var slideSelector = "." + (swiper.params.slideClass);
|
6777 |
+
|
6778 |
+
// Scale image
|
6779 |
+
if (Support.gestures) {
|
6780 |
+
swiper.$wrapperEl.off('gesturestart', slideSelector, zoom.onGestureStart, passiveListener);
|
6781 |
+
swiper.$wrapperEl.off('gesturechange', slideSelector, zoom.onGestureChange, passiveListener);
|
6782 |
+
swiper.$wrapperEl.off('gestureend', slideSelector, zoom.onGestureEnd, passiveListener);
|
6783 |
+
} else if (swiper.touchEvents.start === 'touchstart') {
|
6784 |
+
swiper.$wrapperEl.off(swiper.touchEvents.start, slideSelector, zoom.onGestureStart, passiveListener);
|
6785 |
+
swiper.$wrapperEl.off(swiper.touchEvents.move, slideSelector, zoom.onGestureChange, activeListenerWithCapture);
|
6786 |
+
swiper.$wrapperEl.off(swiper.touchEvents.end, slideSelector, zoom.onGestureEnd, passiveListener);
|
6787 |
+
if (swiper.touchEvents.cancel) {
|
6788 |
+
swiper.$wrapperEl.off(swiper.touchEvents.cancel, slideSelector, zoom.onGestureEnd, passiveListener);
|
6789 |
+
}
|
6790 |
+
}
|
6791 |
+
|
6792 |
+
// Move image
|
6793 |
+
swiper.$wrapperEl.off(swiper.touchEvents.move, ("." + (swiper.params.zoom.containerClass)), zoom.onTouchMove, activeListenerWithCapture);
|
6794 |
+
},
|
6795 |
+
};
|
6796 |
+
|
6797 |
+
var Zoom$1 = {
|
6798 |
+
name: 'zoom',
|
6799 |
+
params: {
|
6800 |
+
zoom: {
|
6801 |
+
enabled: false,
|
6802 |
+
maxRatio: 3,
|
6803 |
+
minRatio: 1,
|
6804 |
+
toggle: true,
|
6805 |
+
containerClass: 'swiper-zoom-container',
|
6806 |
+
zoomedSlideClass: 'swiper-slide-zoomed',
|
6807 |
+
},
|
6808 |
+
},
|
6809 |
+
create: function create() {
|
6810 |
+
var swiper = this;
|
6811 |
+
var zoom = {
|
6812 |
+
enabled: false,
|
6813 |
+
scale: 1,
|
6814 |
+
currentScale: 1,
|
6815 |
+
isScaling: false,
|
6816 |
+
gesture: {
|
6817 |
+
$slideEl: undefined,
|
6818 |
+
slideWidth: undefined,
|
6819 |
+
slideHeight: undefined,
|
6820 |
+
$imageEl: undefined,
|
6821 |
+
$imageWrapEl: undefined,
|
6822 |
+
maxRatio: 3,
|
6823 |
+
},
|
6824 |
+
image: {
|
6825 |
+
isTouched: undefined,
|
6826 |
+
isMoved: undefined,
|
6827 |
+
currentX: undefined,
|
6828 |
+
currentY: undefined,
|
6829 |
+
minX: undefined,
|
6830 |
+
minY: undefined,
|
6831 |
+
maxX: undefined,
|
6832 |
+
maxY: undefined,
|
6833 |
+
width: undefined,
|
6834 |
+
height: undefined,
|
6835 |
+
startX: undefined,
|
6836 |
+
startY: undefined,
|
6837 |
+
touchesStart: {},
|
6838 |
+
touchesCurrent: {},
|
6839 |
+
},
|
6840 |
+
velocity: {
|
6841 |
+
x: undefined,
|
6842 |
+
y: undefined,
|
6843 |
+
prevPositionX: undefined,
|
6844 |
+
prevPositionY: undefined,
|
6845 |
+
prevTime: undefined,
|
6846 |
+
},
|
6847 |
+
};
|
6848 |
+
|
6849 |
+
('onGestureStart onGestureChange onGestureEnd onTouchStart onTouchMove onTouchEnd onTransitionEnd toggle enable disable in out').split(' ').forEach(function (methodName) {
|
6850 |
+
zoom[methodName] = Zoom[methodName].bind(swiper);
|
6851 |
+
});
|
6852 |
+
Utils.extend(swiper, {
|
6853 |
+
zoom: zoom,
|
6854 |
+
});
|
6855 |
+
|
6856 |
+
var scale = 1;
|
6857 |
+
Object.defineProperty(swiper.zoom, 'scale', {
|
6858 |
+
get: function get() {
|
6859 |
+
return scale;
|
6860 |
+
},
|
6861 |
+
set: function set(value) {
|
6862 |
+
if (scale !== value) {
|
6863 |
+
var imageEl = swiper.zoom.gesture.$imageEl ? swiper.zoom.gesture.$imageEl[0] : undefined;
|
6864 |
+
var slideEl = swiper.zoom.gesture.$slideEl ? swiper.zoom.gesture.$slideEl[0] : undefined;
|
6865 |
+
swiper.emit('zoomChange', value, imageEl, slideEl);
|
6866 |
+
}
|
6867 |
+
scale = value;
|
6868 |
+
},
|
6869 |
+
});
|
6870 |
+
},
|
6871 |
+
on: {
|
6872 |
+
init: function init() {
|
6873 |
+
var swiper = this;
|
6874 |
+
if (swiper.params.zoom.enabled) {
|
6875 |
+
swiper.zoom.enable();
|
6876 |
+
}
|
6877 |
+
},
|
6878 |
+
destroy: function destroy() {
|
6879 |
+
var swiper = this;
|
6880 |
+
swiper.zoom.disable();
|
6881 |
+
},
|
6882 |
+
touchStart: function touchStart(e) {
|
6883 |
+
var swiper = this;
|
6884 |
+
if (!swiper.zoom.enabled) { return; }
|
6885 |
+
swiper.zoom.onTouchStart(e);
|
6886 |
+
},
|
6887 |
+
touchEnd: function touchEnd(e) {
|
6888 |
+
var swiper = this;
|
6889 |
+
if (!swiper.zoom.enabled) { return; }
|
6890 |
+
swiper.zoom.onTouchEnd(e);
|
6891 |
+
},
|
6892 |
+
doubleTap: function doubleTap(e) {
|
6893 |
+
var swiper = this;
|
6894 |
+
if (swiper.params.zoom.enabled && swiper.zoom.enabled && swiper.params.zoom.toggle) {
|
6895 |
+
swiper.zoom.toggle(e);
|
6896 |
+
}
|
6897 |
+
},
|
6898 |
+
transitionEnd: function transitionEnd() {
|
6899 |
+
var swiper = this;
|
6900 |
+
if (swiper.zoom.enabled && swiper.params.zoom.enabled) {
|
6901 |
+
swiper.zoom.onTransitionEnd();
|
6902 |
+
}
|
6903 |
+
},
|
6904 |
+
slideChange: function slideChange() {
|
6905 |
+
var swiper = this;
|
6906 |
+
if (swiper.zoom.enabled && swiper.params.zoom.enabled && swiper.params.cssMode) {
|
6907 |
+
swiper.zoom.onTransitionEnd();
|
6908 |
+
}
|
6909 |
+
},
|
6910 |
+
},
|
6911 |
+
};
|
6912 |
+
|
6913 |
+
var Lazy = {
|
6914 |
+
loadInSlide: function loadInSlide(index, loadInDuplicate) {
|
6915 |
+
if ( loadInDuplicate === void 0 ) loadInDuplicate = true;
|
6916 |
+
|
6917 |
+
var swiper = this;
|
6918 |
+
var params = swiper.params.lazy;
|
6919 |
+
if (typeof index === 'undefined') { return; }
|
6920 |
+
if (swiper.slides.length === 0) { return; }
|
6921 |
+
var isVirtual = swiper.virtual && swiper.params.virtual.enabled;
|
6922 |
+
|
6923 |
+
var $slideEl = isVirtual
|
6924 |
+
? swiper.$wrapperEl.children(("." + (swiper.params.slideClass) + "[data-swiper-slide-index=\"" + index + "\"]"))
|
6925 |
+
: swiper.slides.eq(index);
|
6926 |
+
|
6927 |
+
var $images = $slideEl.find(("." + (params.elementClass) + ":not(." + (params.loadedClass) + "):not(." + (params.loadingClass) + ")"));
|
6928 |
+
if ($slideEl.hasClass(params.elementClass) && !$slideEl.hasClass(params.loadedClass) && !$slideEl.hasClass(params.loadingClass)) {
|
6929 |
+
$images = $images.add($slideEl[0]);
|
6930 |
+
}
|
6931 |
+
if ($images.length === 0) { return; }
|
6932 |
+
|
6933 |
+
$images.each(function (imageIndex, imageEl) {
|
6934 |
+
var $imageEl = $(imageEl);
|
6935 |
+
$imageEl.addClass(params.loadingClass);
|
6936 |
+
|
6937 |
+
var background = $imageEl.attr('data-background');
|
6938 |
+
var src = $imageEl.attr('data-src');
|
6939 |
+
var srcset = $imageEl.attr('data-srcset');
|
6940 |
+
var sizes = $imageEl.attr('data-sizes');
|
6941 |
+
|
6942 |
+
swiper.loadImage($imageEl[0], (src || background), srcset, sizes, false, function () {
|
6943 |
+
if (typeof swiper === 'undefined' || swiper === null || !swiper || (swiper && !swiper.params) || swiper.destroyed) { return; }
|
6944 |
+
if (background) {
|
6945 |
+
$imageEl.css('background-image', ("url(\"" + background + "\")"));
|
6946 |
+
$imageEl.removeAttr('data-background');
|
6947 |
+
} else {
|
6948 |
+
if (srcset) {
|
6949 |
+
$imageEl.attr('srcset', srcset);
|
6950 |
+
$imageEl.removeAttr('data-srcset');
|
6951 |
+
}
|
6952 |
+
if (sizes) {
|
6953 |
+
$imageEl.attr('sizes', sizes);
|
6954 |
+
$imageEl.removeAttr('data-sizes');
|
6955 |
+
}
|
6956 |
+
if (src) {
|
6957 |
+
$imageEl.attr('src', src);
|
6958 |
+
$imageEl.removeAttr('data-src');
|
6959 |
+
}
|
6960 |
+
}
|
6961 |
+
|
6962 |
+
$imageEl.addClass(params.loadedClass).removeClass(params.loadingClass);
|
6963 |
+
$slideEl.find(("." + (params.preloaderClass))).remove();
|
6964 |
+
if (swiper.params.loop && loadInDuplicate) {
|
6965 |
+
var slideOriginalIndex = $slideEl.attr('data-swiper-slide-index');
|
6966 |
+
if ($slideEl.hasClass(swiper.params.slideDuplicateClass)) {
|
6967 |
+
var originalSlide = swiper.$wrapperEl.children(("[data-swiper-slide-index=\"" + slideOriginalIndex + "\"]:not(." + (swiper.params.slideDuplicateClass) + ")"));
|
6968 |
+
swiper.lazy.loadInSlide(originalSlide.index(), false);
|
6969 |
+
} else {
|
6970 |
+
var duplicatedSlide = swiper.$wrapperEl.children(("." + (swiper.params.slideDuplicateClass) + "[data-swiper-slide-index=\"" + slideOriginalIndex + "\"]"));
|
6971 |
+
swiper.lazy.loadInSlide(duplicatedSlide.index(), false);
|
6972 |
+
}
|
6973 |
+
}
|
6974 |
+
swiper.emit('lazyImageReady', $slideEl[0], $imageEl[0]);
|
6975 |
+
if (swiper.params.autoHeight) {
|
6976 |
+
swiper.updateAutoHeight();
|
6977 |
+
}
|
6978 |
+
});
|
6979 |
+
|
6980 |
+
swiper.emit('lazyImageLoad', $slideEl[0], $imageEl[0]);
|
6981 |
+
});
|
6982 |
+
},
|
6983 |
+
load: function load() {
|
6984 |
+
var swiper = this;
|
6985 |
+
var $wrapperEl = swiper.$wrapperEl;
|
6986 |
+
var swiperParams = swiper.params;
|
6987 |
+
var slides = swiper.slides;
|
6988 |
+
var activeIndex = swiper.activeIndex;
|
6989 |
+
var isVirtual = swiper.virtual && swiperParams.virtual.enabled;
|
6990 |
+
var params = swiperParams.lazy;
|
6991 |
+
|
6992 |
+
var slidesPerView = swiperParams.slidesPerView;
|
6993 |
+
if (slidesPerView === 'auto') {
|
6994 |
+
slidesPerView = 0;
|
6995 |
+
}
|
6996 |
+
|
6997 |
+
function slideExist(index) {
|
6998 |
+
if (isVirtual) {
|
6999 |
+
if ($wrapperEl.children(("." + (swiperParams.slideClass) + "[data-swiper-slide-index=\"" + index + "\"]")).length) {
|
7000 |
+
return true;
|
7001 |
+
}
|
7002 |
+
} else if (slides[index]) { return true; }
|
7003 |
+
return false;
|
7004 |
+
}
|
7005 |
+
function slideIndex(slideEl) {
|
7006 |
+
if (isVirtual) {
|
7007 |
+
return $(slideEl).attr('data-swiper-slide-index');
|
7008 |
+
}
|
7009 |
+
return $(slideEl).index();
|
7010 |
+
}
|
7011 |
+
|
7012 |
+
if (!swiper.lazy.initialImageLoaded) { swiper.lazy.initialImageLoaded = true; }
|
7013 |
+
if (swiper.params.watchSlidesVisibility) {
|
7014 |
+
$wrapperEl.children(("." + (swiperParams.slideVisibleClass))).each(function (elIndex, slideEl) {
|
7015 |
+
var index = isVirtual ? $(slideEl).attr('data-swiper-slide-index') : $(slideEl).index();
|
7016 |
+
swiper.lazy.loadInSlide(index);
|
7017 |
+
});
|
7018 |
+
} else if (slidesPerView > 1) {
|
7019 |
+
for (var i = activeIndex; i < activeIndex + slidesPerView; i += 1) {
|
7020 |
+
if (slideExist(i)) { swiper.lazy.loadInSlide(i); }
|
7021 |
+
}
|
7022 |
+
} else {
|
7023 |
+
swiper.lazy.loadInSlide(activeIndex);
|
7024 |
+
}
|
7025 |
+
if (params.loadPrevNext) {
|
7026 |
+
if (slidesPerView > 1 || (params.loadPrevNextAmount && params.loadPrevNextAmount > 1)) {
|
7027 |
+
var amount = params.loadPrevNextAmount;
|
7028 |
+
var spv = slidesPerView;
|
7029 |
+
var maxIndex = Math.min(activeIndex + spv + Math.max(amount, spv), slides.length);
|
7030 |
+
var minIndex = Math.max(activeIndex - Math.max(spv, amount), 0);
|
7031 |
+
// Next Slides
|
7032 |
+
for (var i$1 = activeIndex + slidesPerView; i$1 < maxIndex; i$1 += 1) {
|
7033 |
+
if (slideExist(i$1)) { swiper.lazy.loadInSlide(i$1); }
|
7034 |
+
}
|
7035 |
+
// Prev Slides
|
7036 |
+
for (var i$2 = minIndex; i$2 < activeIndex; i$2 += 1) {
|
7037 |
+
if (slideExist(i$2)) { swiper.lazy.loadInSlide(i$2); }
|
7038 |
+
}
|
7039 |
+
} else {
|
7040 |
+
var nextSlide = $wrapperEl.children(("." + (swiperParams.slideNextClass)));
|
7041 |
+
if (nextSlide.length > 0) { swiper.lazy.loadInSlide(slideIndex(nextSlide)); }
|
7042 |
+
|
7043 |
+
var prevSlide = $wrapperEl.children(("." + (swiperParams.slidePrevClass)));
|
7044 |
+
if (prevSlide.length > 0) { swiper.lazy.loadInSlide(slideIndex(prevSlide)); }
|
7045 |
+
}
|
7046 |
+
}
|
7047 |
+
},
|
7048 |
+
};
|
7049 |
+
|
7050 |
+
var Lazy$1 = {
|
7051 |
+
name: 'lazy',
|
7052 |
+
params: {
|
7053 |
+
lazy: {
|
7054 |
+
enabled: false,
|
7055 |
+
loadPrevNext: false,
|
7056 |
+
loadPrevNextAmount: 1,
|
7057 |
+
loadOnTransitionStart: false,
|
7058 |
+
|
7059 |
+
elementClass: 'swiper-lazy',
|
7060 |
+
loadingClass: 'swiper-lazy-loading',
|
7061 |
+
loadedClass: 'swiper-lazy-loaded',
|
7062 |
+
preloaderClass: 'swiper-lazy-preloader',
|
7063 |
+
},
|
7064 |
+
},
|
7065 |
+
create: function create() {
|
7066 |
+
var swiper = this;
|
7067 |
+
Utils.extend(swiper, {
|
7068 |
+
lazy: {
|
7069 |
+
initialImageLoaded: false,
|
7070 |
+
load: Lazy.load.bind(swiper),
|
7071 |
+
loadInSlide: Lazy.loadInSlide.bind(swiper),
|
7072 |
+
},
|
7073 |
+
});
|
7074 |
+
},
|
7075 |
+
on: {
|
7076 |
+
beforeInit: function beforeInit() {
|
7077 |
+
var swiper = this;
|
7078 |
+
if (swiper.params.lazy.enabled && swiper.params.preloadImages) {
|
7079 |
+
swiper.params.preloadImages = false;
|
7080 |
+
}
|
7081 |
+
},
|
7082 |
+
init: function init() {
|
7083 |
+
var swiper = this;
|
7084 |
+
if (swiper.params.lazy.enabled && !swiper.params.loop && swiper.params.initialSlide === 0) {
|
7085 |
+
swiper.lazy.load();
|
7086 |
+
}
|
7087 |
+
},
|
7088 |
+
scroll: function scroll() {
|
7089 |
+
var swiper = this;
|
7090 |
+
if (swiper.params.freeMode && !swiper.params.freeModeSticky) {
|
7091 |
+
swiper.lazy.load();
|
7092 |
+
}
|
7093 |
+
},
|
7094 |
+
resize: function resize() {
|
7095 |
+
var swiper = this;
|
7096 |
+
if (swiper.params.lazy.enabled) {
|
7097 |
+
swiper.lazy.load();
|
7098 |
+
}
|
7099 |
+
},
|
7100 |
+
scrollbarDragMove: function scrollbarDragMove() {
|
7101 |
+
var swiper = this;
|
7102 |
+
if (swiper.params.lazy.enabled) {
|
7103 |
+
swiper.lazy.load();
|
7104 |
+
}
|
7105 |
+
},
|
7106 |
+
transitionStart: function transitionStart() {
|
7107 |
+
var swiper = this;
|
7108 |
+
if (swiper.params.lazy.enabled) {
|
7109 |
+
if (swiper.params.lazy.loadOnTransitionStart || (!swiper.params.lazy.loadOnTransitionStart && !swiper.lazy.initialImageLoaded)) {
|
7110 |
+
swiper.lazy.load();
|
7111 |
+
}
|
7112 |
+
}
|
7113 |
+
},
|
7114 |
+
transitionEnd: function transitionEnd() {
|
7115 |
+
var swiper = this;
|
7116 |
+
if (swiper.params.lazy.enabled && !swiper.params.lazy.loadOnTransitionStart) {
|
7117 |
+
swiper.lazy.load();
|
7118 |
+
}
|
7119 |
+
},
|
7120 |
+
slideChange: function slideChange() {
|
7121 |
+
var swiper = this;
|
7122 |
+
if (swiper.params.lazy.enabled && swiper.params.cssMode) {
|
7123 |
+
swiper.lazy.load();
|
7124 |
+
}
|
7125 |
+
},
|
7126 |
+
},
|
7127 |
+
};
|
7128 |
+
|
7129 |
+
/* eslint no-bitwise: ["error", { "allow": [">>"] }] */
|
7130 |
+
|
7131 |
+
var Controller = {
|
7132 |
+
LinearSpline: function LinearSpline(x, y) {
|
7133 |
+
var binarySearch = (function search() {
|
7134 |
+
var maxIndex;
|
7135 |
+
var minIndex;
|
7136 |
+
var guess;
|
7137 |
+
return function (array, val) {
|
7138 |
+
minIndex = -1;
|
7139 |
+
maxIndex = array.length;
|
7140 |
+
while (maxIndex - minIndex > 1) {
|
7141 |
+
guess = maxIndex + minIndex >> 1;
|
7142 |
+
if (array[guess] <= val) {
|
7143 |
+
minIndex = guess;
|
7144 |
+
} else {
|
7145 |
+
maxIndex = guess;
|
7146 |
+
}
|
7147 |
+
}
|
7148 |
+
return maxIndex;
|
7149 |
+
};
|
7150 |
+
}());
|
7151 |
+
this.x = x;
|
7152 |
+
this.y = y;
|
7153 |
+
this.lastIndex = x.length - 1;
|
7154 |
+
// Given an x value (x2), return the expected y2 value:
|
7155 |
+
// (x1,y1) is the known point before given value,
|
7156 |
+
// (x3,y3) is the known point after given value.
|
7157 |
+
var i1;
|
7158 |
+
var i3;
|
7159 |
+
|
7160 |
+
this.interpolate = function interpolate(x2) {
|
7161 |
+
if (!x2) { return 0; }
|
7162 |
+
|
7163 |
+
// Get the indexes of x1 and x3 (the array indexes before and after given x2):
|
7164 |
+
i3 = binarySearch(this.x, x2);
|
7165 |
+
i1 = i3 - 1;
|
7166 |
+
|
7167 |
+
// We have our indexes i1 & i3, so we can calculate already:
|
7168 |
+
// y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1
|
7169 |
+
return (((x2 - this.x[i1]) * (this.y[i3] - this.y[i1])) / (this.x[i3] - this.x[i1])) + this.y[i1];
|
7170 |
+
};
|
7171 |
+
return this;
|
7172 |
+
},
|
7173 |
+
// xxx: for now i will just save one spline function to to
|
7174 |
+
getInterpolateFunction: function getInterpolateFunction(c) {
|
7175 |
+
var swiper = this;
|
7176 |
+
if (!swiper.controller.spline) {
|
7177 |
+
swiper.controller.spline = swiper.params.loop
|
7178 |
+
? new Controller.LinearSpline(swiper.slidesGrid, c.slidesGrid)
|
7179 |
+
: new Controller.LinearSpline(swiper.snapGrid, c.snapGrid);
|
7180 |
+
}
|
7181 |
+
},
|
7182 |
+
setTranslate: function setTranslate(setTranslate$1, byController) {
|
7183 |
+
var swiper = this;
|
7184 |
+
var controlled = swiper.controller.control;
|
7185 |
+
var multiplier;
|
7186 |
+
var controlledTranslate;
|
7187 |
+
function setControlledTranslate(c) {
|
7188 |
+
// this will create an Interpolate function based on the snapGrids
|
7189 |
+
// x is the Grid of the scrolled scroller and y will be the controlled scroller
|
7190 |
+
// it makes sense to create this only once and recall it for the interpolation
|
7191 |
+
// the function does a lot of value caching for performance
|
7192 |
+
var translate = swiper.rtlTranslate ? -swiper.translate : swiper.translate;
|
7193 |
+
if (swiper.params.controller.by === 'slide') {
|
7194 |
+
swiper.controller.getInterpolateFunction(c);
|
7195 |
+
// i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid
|
7196 |
+
// but it did not work out
|
7197 |
+
controlledTranslate = -swiper.controller.spline.interpolate(-translate);
|
7198 |
+
}
|
7199 |
+
|
7200 |
+
if (!controlledTranslate || swiper.params.controller.by === 'container') {
|
7201 |
+
multiplier = (c.maxTranslate() - c.minTranslate()) / (swiper.maxTranslate() - swiper.minTranslate());
|
7202 |
+
controlledTranslate = ((translate - swiper.minTranslate()) * multiplier) + c.minTranslate();
|
7203 |
+
}
|
7204 |
+
|
7205 |
+
if (swiper.params.controller.inverse) {
|
7206 |
+
controlledTranslate = c.maxTranslate() - controlledTranslate;
|
7207 |
+
}
|
7208 |
+
c.updateProgress(controlledTranslate);
|
7209 |
+
c.setTranslate(controlledTranslate, swiper);
|
7210 |
+
c.updateActiveIndex();
|
7211 |
+
c.updateSlidesClasses();
|
7212 |
+
}
|
7213 |
+
if (Array.isArray(controlled)) {
|
7214 |
+
for (var i = 0; i < controlled.length; i += 1) {
|
7215 |
+
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
|
7216 |
+
setControlledTranslate(controlled[i]);
|
7217 |
+
}
|
7218 |
+
}
|
7219 |
+
} else if (controlled instanceof Swiper && byController !== controlled) {
|
7220 |
+
setControlledTranslate(controlled);
|
7221 |
+
}
|
7222 |
+
},
|
7223 |
+
setTransition: function setTransition(duration, byController) {
|
7224 |
+
var swiper = this;
|
7225 |
+
var controlled = swiper.controller.control;
|
7226 |
+
var i;
|
7227 |
+
function setControlledTransition(c) {
|
7228 |
+
c.setTransition(duration, swiper);
|
7229 |
+
if (duration !== 0) {
|
7230 |
+
c.transitionStart();
|
7231 |
+
if (c.params.autoHeight) {
|
7232 |
+
Utils.nextTick(function () {
|
7233 |
+
c.updateAutoHeight();
|
7234 |
+
});
|
7235 |
+
}
|
7236 |
+
c.$wrapperEl.transitionEnd(function () {
|
7237 |
+
if (!controlled) { return; }
|
7238 |
+
if (c.params.loop && swiper.params.controller.by === 'slide') {
|
7239 |
+
c.loopFix();
|
7240 |
+
}
|
7241 |
+
c.transitionEnd();
|
7242 |
+
});
|
7243 |
+
}
|
7244 |
+
}
|
7245 |
+
if (Array.isArray(controlled)) {
|
7246 |
+
for (i = 0; i < controlled.length; i += 1) {
|
7247 |
+
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
|
7248 |
+
setControlledTransition(controlled[i]);
|
7249 |
+
}
|
7250 |
+
}
|
7251 |
+
} else if (controlled instanceof Swiper && byController !== controlled) {
|
7252 |
+
setControlledTransition(controlled);
|
7253 |
+
}
|
7254 |
+
},
|
7255 |
+
};
|
7256 |
+
var Controller$1 = {
|
7257 |
+
name: 'controller',
|
7258 |
+
params: {
|
7259 |
+
controller: {
|
7260 |
+
control: undefined,
|
7261 |
+
inverse: false,
|
7262 |
+
by: 'slide', // or 'container'
|
7263 |
+
},
|
7264 |
+
},
|
7265 |
+
create: function create() {
|
7266 |
+
var swiper = this;
|
7267 |
+
Utils.extend(swiper, {
|
7268 |
+
controller: {
|
7269 |
+
control: swiper.params.controller.control,
|
7270 |
+
getInterpolateFunction: Controller.getInterpolateFunction.bind(swiper),
|
7271 |
+
setTranslate: Controller.setTranslate.bind(swiper),
|
7272 |
+
setTransition: Controller.setTransition.bind(swiper),
|
7273 |
+
},
|
7274 |
+
});
|
7275 |
+
},
|
7276 |
+
on: {
|
7277 |
+
update: function update() {
|
7278 |
+
var swiper = this;
|
7279 |
+
if (!swiper.controller.control) { return; }
|
7280 |
+
if (swiper.controller.spline) {
|
7281 |
+
swiper.controller.spline = undefined;
|
7282 |
+
delete swiper.controller.spline;
|
7283 |
+
}
|
7284 |
+
},
|
7285 |
+
resize: function resize() {
|
7286 |
+
var swiper = this;
|
7287 |
+
if (!swiper.controller.control) { return; }
|
7288 |
+
if (swiper.controller.spline) {
|
7289 |
+
swiper.controller.spline = undefined;
|
7290 |
+
delete swiper.controller.spline;
|
7291 |
+
}
|
7292 |
+
},
|
7293 |
+
observerUpdate: function observerUpdate() {
|
7294 |
+
var swiper = this;
|
7295 |
+
if (!swiper.controller.control) { return; }
|
7296 |
+
if (swiper.controller.spline) {
|
7297 |
+
swiper.controller.spline = undefined;
|
7298 |
+
delete swiper.controller.spline;
|
7299 |
+
}
|
7300 |
+
},
|
7301 |
+
setTranslate: function setTranslate(translate, byController) {
|
7302 |
+
var swiper = this;
|
7303 |
+
if (!swiper.controller.control) { return; }
|
7304 |
+
swiper.controller.setTranslate(translate, byController);
|
7305 |
+
},
|
7306 |
+
setTransition: function setTransition(duration, byController) {
|
7307 |
+
var swiper = this;
|
7308 |
+
if (!swiper.controller.control) { return; }
|
7309 |
+
swiper.controller.setTransition(duration, byController);
|
7310 |
+
},
|
7311 |
+
},
|
7312 |
+
};
|
7313 |
+
|
7314 |
+
var a11y = {
|
7315 |
+
makeElFocusable: function makeElFocusable($el) {
|
7316 |
+
$el.attr('tabIndex', '0');
|
7317 |
+
return $el;
|
7318 |
+
},
|
7319 |
+
addElRole: function addElRole($el, role) {
|
7320 |
+
$el.attr('role', role);
|
7321 |
+
return $el;
|
7322 |
+
},
|
7323 |
+
addElLabel: function addElLabel($el, label) {
|
7324 |
+
$el.attr('aria-label', label);
|
7325 |
+
return $el;
|
7326 |
+
},
|
7327 |
+
disableEl: function disableEl($el) {
|
7328 |
+
$el.attr('aria-disabled', true);
|
7329 |
+
return $el;
|
7330 |
+
},
|
7331 |
+
enableEl: function enableEl($el) {
|
7332 |
+
$el.attr('aria-disabled', false);
|
7333 |
+
return $el;
|
7334 |
+
},
|
7335 |
+
onEnterKey: function onEnterKey(e) {
|
7336 |
+
var swiper = this;
|
7337 |
+
var params = swiper.params.a11y;
|
7338 |
+
if (e.keyCode !== 13) { return; }
|
7339 |
+
var $targetEl = $(e.target);
|
7340 |
+
if (swiper.navigation && swiper.navigation.$nextEl && $targetEl.is(swiper.navigation.$nextEl)) {
|
7341 |
+
if (!(swiper.isEnd && !swiper.params.loop)) {
|
7342 |
+
swiper.slideNext();
|
7343 |
+
}
|
7344 |
+
if (swiper.isEnd) {
|
7345 |
+
swiper.a11y.notify(params.lastSlideMessage);
|
7346 |
+
} else {
|
7347 |
+
swiper.a11y.notify(params.nextSlideMessage);
|
7348 |
+
}
|
7349 |
+
}
|
7350 |
+
if (swiper.navigation && swiper.navigation.$prevEl && $targetEl.is(swiper.navigation.$prevEl)) {
|
7351 |
+
if (!(swiper.isBeginning && !swiper.params.loop)) {
|
7352 |
+
swiper.slidePrev();
|
7353 |
+
}
|
7354 |
+
if (swiper.isBeginning) {
|
7355 |
+
swiper.a11y.notify(params.firstSlideMessage);
|
7356 |
+
} else {
|
7357 |
+
swiper.a11y.notify(params.prevSlideMessage);
|
7358 |
+
}
|
7359 |
+
}
|
7360 |
+
if (swiper.pagination && $targetEl.is(("." + (swiper.params.pagination.bulletClass)))) {
|
7361 |
+
$targetEl[0].click();
|
7362 |
+
}
|
7363 |
+
},
|
7364 |
+
notify: function notify(message) {
|
7365 |
+
var swiper = this;
|
7366 |
+
var notification = swiper.a11y.liveRegion;
|
7367 |
+
if (notification.length === 0) { return; }
|
7368 |
+
notification.html('');
|
7369 |
+
notification.html(message);
|
7370 |
+
},
|
7371 |
+
updateNavigation: function updateNavigation() {
|
7372 |
+
var swiper = this;
|
7373 |
+
|
7374 |
+
if (swiper.params.loop || !swiper.navigation) { return; }
|
7375 |
+
var ref = swiper.navigation;
|
7376 |
+
var $nextEl = ref.$nextEl;
|
7377 |
+
var $prevEl = ref.$prevEl;
|
7378 |
+
|
7379 |
+
if ($prevEl && $prevEl.length > 0) {
|
7380 |
+
if (swiper.isBeginning) {
|
7381 |
+
swiper.a11y.disableEl($prevEl);
|
7382 |
+
} else {
|
7383 |
+
swiper.a11y.enableEl($prevEl);
|
7384 |
+
}
|
7385 |
+
}
|
7386 |
+
if ($nextEl && $nextEl.length > 0) {
|
7387 |
+
if (swiper.isEnd) {
|
7388 |
+
swiper.a11y.disableEl($nextEl);
|
7389 |
+
} else {
|
7390 |
+
swiper.a11y.enableEl($nextEl);
|
7391 |
+
}
|
7392 |
+
}
|
7393 |
+
},
|
7394 |
+
updatePagination: function updatePagination() {
|
7395 |
+
var swiper = this;
|
7396 |
+
var params = swiper.params.a11y;
|
7397 |
+
if (swiper.pagination && swiper.params.pagination.clickable && swiper.pagination.bullets && swiper.pagination.bullets.length) {
|
7398 |
+
swiper.pagination.bullets.each(function (bulletIndex, bulletEl) {
|
7399 |
+
var $bulletEl = $(bulletEl);
|
7400 |
+
swiper.a11y.makeElFocusable($bulletEl);
|
7401 |
+
swiper.a11y.addElRole($bulletEl, 'button');
|
7402 |
+
swiper.a11y.addElLabel($bulletEl, params.paginationBulletMessage.replace(/{{index}}/, $bulletEl.index() + 1));
|
7403 |
+
});
|
7404 |
+
}
|
7405 |
+
},
|
7406 |
+
init: function init() {
|
7407 |
+
var swiper = this;
|
7408 |
+
|
7409 |
+
swiper.$el.append(swiper.a11y.liveRegion);
|
7410 |
+
|
7411 |
+
// Navigation
|
7412 |
+
var params = swiper.params.a11y;
|
7413 |
+
var $nextEl;
|
7414 |
+
var $prevEl;
|
7415 |
+
if (swiper.navigation && swiper.navigation.$nextEl) {
|
7416 |
+
$nextEl = swiper.navigation.$nextEl;
|
7417 |
+
}
|
7418 |
+
if (swiper.navigation && swiper.navigation.$prevEl) {
|
7419 |
+
$prevEl = swiper.navigation.$prevEl;
|
7420 |
+
}
|
7421 |
+
if ($nextEl) {
|
7422 |
+
swiper.a11y.makeElFocusable($nextEl);
|
7423 |
+
swiper.a11y.addElRole($nextEl, 'button');
|
7424 |
+
swiper.a11y.addElLabel($nextEl, params.nextSlideMessage);
|
7425 |
+
$nextEl.on('keydown', swiper.a11y.onEnterKey);
|
7426 |
+
}
|
7427 |
+
if ($prevEl) {
|
7428 |
+
swiper.a11y.makeElFocusable($prevEl);
|
7429 |
+
swiper.a11y.addElRole($prevEl, 'button');
|
7430 |
+
swiper.a11y.addElLabel($prevEl, params.prevSlideMessage);
|
7431 |
+
$prevEl.on('keydown', swiper.a11y.onEnterKey);
|
7432 |
+
}
|
7433 |
+
|
7434 |
+
// Pagination
|
7435 |
+
if (swiper.pagination && swiper.params.pagination.clickable && swiper.pagination.bullets && swiper.pagination.bullets.length) {
|
7436 |
+
swiper.pagination.$el.on('keydown', ("." + (swiper.params.pagination.bulletClass)), swiper.a11y.onEnterKey);
|
7437 |
+
}
|
7438 |
+
},
|
7439 |
+
destroy: function destroy() {
|
7440 |
+
var swiper = this;
|
7441 |
+
if (swiper.a11y.liveRegion && swiper.a11y.liveRegion.length > 0) { swiper.a11y.liveRegion.remove(); }
|
7442 |
+
|
7443 |
+
var $nextEl;
|
7444 |
+
var $prevEl;
|
7445 |
+
if (swiper.navigation && swiper.navigation.$nextEl) {
|
7446 |
+
$nextEl = swiper.navigation.$nextEl;
|
7447 |
+
}
|
7448 |
+
if (swiper.navigation && swiper.navigation.$prevEl) {
|
7449 |
+
$prevEl = swiper.navigation.$prevEl;
|
7450 |
+
}
|
7451 |
+
if ($nextEl) {
|
7452 |
+
$nextEl.off('keydown', swiper.a11y.onEnterKey);
|
7453 |
+
}
|
7454 |
+
if ($prevEl) {
|
7455 |
+
$prevEl.off('keydown', swiper.a11y.onEnterKey);
|
7456 |
+
}
|
7457 |
+
|
7458 |
+
// Pagination
|
7459 |
+
if (swiper.pagination && swiper.params.pagination.clickable && swiper.pagination.bullets && swiper.pagination.bullets.length) {
|
7460 |
+
swiper.pagination.$el.off('keydown', ("." + (swiper.params.pagination.bulletClass)), swiper.a11y.onEnterKey);
|
7461 |
+
}
|
7462 |
+
},
|
7463 |
+
};
|
7464 |
+
var A11y = {
|
7465 |
+
name: 'a11y',
|
7466 |
+
params: {
|
7467 |
+
a11y: {
|
7468 |
+
enabled: true,
|
7469 |
+
notificationClass: 'swiper-notification',
|
7470 |
+
prevSlideMessage: 'Previous slide',
|
7471 |
+
nextSlideMessage: 'Next slide',
|
7472 |
+
firstSlideMessage: 'This is the first slide',
|
7473 |
+
lastSlideMessage: 'This is the last slide',
|
7474 |
+
paginationBulletMessage: 'Go to slide {{index}}',
|
7475 |
+
},
|
7476 |
+
},
|
7477 |
+
create: function create() {
|
7478 |
+
var swiper = this;
|
7479 |
+
Utils.extend(swiper, {
|
7480 |
+
a11y: {
|
7481 |
+
liveRegion: $(("<span class=\"" + (swiper.params.a11y.notificationClass) + "\" aria-live=\"assertive\" aria-atomic=\"true\"></span>")),
|
7482 |
+
},
|
7483 |
+
});
|
7484 |
+
Object.keys(a11y).forEach(function (methodName) {
|
7485 |
+
swiper.a11y[methodName] = a11y[methodName].bind(swiper);
|
7486 |
+
});
|
7487 |
+
},
|
7488 |
+
on: {
|
7489 |
+
init: function init() {
|
7490 |
+
var swiper = this;
|
7491 |
+
if (!swiper.params.a11y.enabled) { return; }
|
7492 |
+
swiper.a11y.init();
|
7493 |
+
swiper.a11y.updateNavigation();
|
7494 |
+
},
|
7495 |
+
toEdge: function toEdge() {
|
7496 |
+
var swiper = this;
|
7497 |
+
if (!swiper.params.a11y.enabled) { return; }
|
7498 |
+
swiper.a11y.updateNavigation();
|
7499 |
+
},
|
7500 |
+
fromEdge: function fromEdge() {
|
7501 |
+
var swiper = this;
|
7502 |
+
if (!swiper.params.a11y.enabled) { return; }
|
7503 |
+
swiper.a11y.updateNavigation();
|
7504 |
+
},
|
7505 |
+
paginationUpdate: function paginationUpdate() {
|
7506 |
+
var swiper = this;
|
7507 |
+
if (!swiper.params.a11y.enabled) { return; }
|
7508 |
+
swiper.a11y.updatePagination();
|
7509 |
+
},
|
7510 |
+
destroy: function destroy() {
|
7511 |
+
var swiper = this;
|
7512 |
+
if (!swiper.params.a11y.enabled) { return; }
|
7513 |
+
swiper.a11y.destroy();
|
7514 |
+
},
|
7515 |
+
},
|
7516 |
+
};
|
7517 |
+
|
7518 |
+
var History = {
|
7519 |
+
init: function init() {
|
7520 |
+
var swiper = this;
|
7521 |
+
if (!swiper.params.history) { return; }
|
7522 |
+
if (!win.history || !win.history.pushState) {
|
7523 |
+
swiper.params.history.enabled = false;
|
7524 |
+
swiper.params.hashNavigation.enabled = true;
|
7525 |
+
return;
|
7526 |
+
}
|
7527 |
+
var history = swiper.history;
|
7528 |
+
history.initialized = true;
|
7529 |
+
history.paths = History.getPathValues();
|
7530 |
+
if (!history.paths.key && !history.paths.value) { return; }
|
7531 |
+
history.scrollToSlide(0, history.paths.value, swiper.params.runCallbacksOnInit);
|
7532 |
+
if (!swiper.params.history.replaceState) {
|
7533 |
+
win.addEventListener('popstate', swiper.history.setHistoryPopState);
|
7534 |
+
}
|
7535 |
+
},
|
7536 |
+
destroy: function destroy() {
|
7537 |
+
var swiper = this;
|
7538 |
+
if (!swiper.params.history.replaceState) {
|
7539 |
+
win.removeEventListener('popstate', swiper.history.setHistoryPopState);
|
7540 |
+
}
|
7541 |
+
},
|
7542 |
+
setHistoryPopState: function setHistoryPopState() {
|
7543 |
+
var swiper = this;
|
7544 |
+
swiper.history.paths = History.getPathValues();
|
7545 |
+
swiper.history.scrollToSlide(swiper.params.speed, swiper.history.paths.value, false);
|
7546 |
+
},
|
7547 |
+
getPathValues: function getPathValues() {
|
7548 |
+
var pathArray = win.location.pathname.slice(1).split('/').filter(function (part) { return part !== ''; });
|
7549 |
+
var total = pathArray.length;
|
7550 |
+
var key = pathArray[total - 2];
|
7551 |
+
var value = pathArray[total - 1];
|
7552 |
+
return { key: key, value: value };
|
7553 |
+
},
|
7554 |
+
setHistory: function setHistory(key, index) {
|
7555 |
+
var swiper = this;
|
7556 |
+
if (!swiper.history.initialized || !swiper.params.history.enabled) { return; }
|
7557 |
+
var slide = swiper.slides.eq(index);
|
7558 |
+
var value = History.slugify(slide.attr('data-history'));
|
7559 |
+
if (!win.location.pathname.includes(key)) {
|
7560 |
+
value = key + "/" + value;
|
7561 |
+
}
|
7562 |
+
var currentState = win.history.state;
|
7563 |
+
if (currentState && currentState.value === value) {
|
7564 |
+
return;
|
7565 |
+
}
|
7566 |
+
if (swiper.params.history.replaceState) {
|
7567 |
+
win.history.replaceState({ value: value }, null, value);
|
7568 |
+
} else {
|
7569 |
+
win.history.pushState({ value: value }, null, value);
|
7570 |
+
}
|
7571 |
+
},
|
7572 |
+
slugify: function slugify(text) {
|
7573 |
+
return text.toString()
|
7574 |
+
.replace(/\s+/g, '-')
|
7575 |
+
.replace(/[^\w-]+/g, '')
|
7576 |
+
.replace(/--+/g, '-')
|
7577 |
+
.replace(/^-+/, '')
|
7578 |
+
.replace(/-+$/, '');
|
7579 |
+
},
|
7580 |
+
scrollToSlide: function scrollToSlide(speed, value, runCallbacks) {
|
7581 |
+
var swiper = this;
|
7582 |
+
if (value) {
|
7583 |
+
for (var i = 0, length = swiper.slides.length; i < length; i += 1) {
|
7584 |
+
var slide = swiper.slides.eq(i);
|
7585 |
+
var slideHistory = History.slugify(slide.attr('data-history'));
|
7586 |
+
if (slideHistory === value && !slide.hasClass(swiper.params.slideDuplicateClass)) {
|
7587 |
+
var index = slide.index();
|
7588 |
+
swiper.slideTo(index, speed, runCallbacks);
|
7589 |
+
}
|
7590 |
+
}
|
7591 |
+
} else {
|
7592 |
+
swiper.slideTo(0, speed, runCallbacks);
|
7593 |
+
}
|
7594 |
+
},
|
7595 |
+
};
|
7596 |
+
|
7597 |
+
var History$1 = {
|
7598 |
+
name: 'history',
|
7599 |
+
params: {
|
7600 |
+
history: {
|
7601 |
+
enabled: false,
|
7602 |
+
replaceState: false,
|
7603 |
+
key: 'slides',
|
7604 |
+
},
|
7605 |
+
},
|
7606 |
+
create: function create() {
|
7607 |
+
var swiper = this;
|
7608 |
+
Utils.extend(swiper, {
|
7609 |
+
history: {
|
7610 |
+
init: History.init.bind(swiper),
|
7611 |
+
setHistory: History.setHistory.bind(swiper),
|
7612 |
+
setHistoryPopState: History.setHistoryPopState.bind(swiper),
|
7613 |
+
scrollToSlide: History.scrollToSlide.bind(swiper),
|
7614 |
+
destroy: History.destroy.bind(swiper),
|
7615 |
+
},
|
7616 |
+
});
|
7617 |
+
},
|
7618 |
+
on: {
|
7619 |
+
init: function init() {
|
7620 |
+
var swiper = this;
|
7621 |
+
if (swiper.params.history.enabled) {
|
7622 |
+
swiper.history.init();
|
7623 |
+
}
|
7624 |
+
},
|
7625 |
+
destroy: function destroy() {
|
7626 |
+
var swiper = this;
|
7627 |
+
if (swiper.params.history.enabled) {
|
7628 |
+
swiper.history.destroy();
|
7629 |
+
}
|
7630 |
+
},
|
7631 |
+
transitionEnd: function transitionEnd() {
|
7632 |
+
var swiper = this;
|
7633 |
+
if (swiper.history.initialized) {
|
7634 |
+
swiper.history.setHistory(swiper.params.history.key, swiper.activeIndex);
|
7635 |
+
}
|
7636 |
+
},
|
7637 |
+
slideChange: function slideChange() {
|
7638 |
+
var swiper = this;
|
7639 |
+
if (swiper.history.initialized && swiper.params.cssMode) {
|
7640 |
+
swiper.history.setHistory(swiper.params.history.key, swiper.activeIndex);
|
7641 |
+
}
|
7642 |
+
},
|
7643 |
+
},
|
7644 |
+
};
|
7645 |
+
|
7646 |
+
var HashNavigation = {
|
7647 |
+
onHashCange: function onHashCange() {
|
7648 |
+
var swiper = this;
|
7649 |
+
var newHash = doc.location.hash.replace('#', '');
|
7650 |
+
var activeSlideHash = swiper.slides.eq(swiper.activeIndex).attr('data-hash');
|
7651 |
+
if (newHash !== activeSlideHash) {
|
7652 |
+
var newIndex = swiper.$wrapperEl.children(("." + (swiper.params.slideClass) + "[data-hash=\"" + newHash + "\"]")).index();
|
7653 |
+
if (typeof newIndex === 'undefined') { return; }
|
7654 |
+
swiper.slideTo(newIndex);
|
7655 |
+
}
|
7656 |
+
},
|
7657 |
+
setHash: function setHash() {
|
7658 |
+
var swiper = this;
|
7659 |
+
if (!swiper.hashNavigation.initialized || !swiper.params.hashNavigation.enabled) { return; }
|
7660 |
+
if (swiper.params.hashNavigation.replaceState && win.history && win.history.replaceState) {
|
7661 |
+
win.history.replaceState(null, null, (("#" + (swiper.slides.eq(swiper.activeIndex).attr('data-hash'))) || ''));
|
7662 |
+
} else {
|
7663 |
+
var slide = swiper.slides.eq(swiper.activeIndex);
|
7664 |
+
var hash = slide.attr('data-hash') || slide.attr('data-history');
|
7665 |
+
doc.location.hash = hash || '';
|
7666 |
+
}
|
7667 |
+
},
|
7668 |
+
init: function init() {
|
7669 |
+
var swiper = this;
|
7670 |
+
if (!swiper.params.hashNavigation.enabled || (swiper.params.history && swiper.params.history.enabled)) { return; }
|
7671 |
+
swiper.hashNavigation.initialized = true;
|
7672 |
+
var hash = doc.location.hash.replace('#', '');
|
7673 |
+
if (hash) {
|
7674 |
+
var speed = 0;
|
7675 |
+
for (var i = 0, length = swiper.slides.length; i < length; i += 1) {
|
7676 |
+
var slide = swiper.slides.eq(i);
|
7677 |
+
var slideHash = slide.attr('data-hash') || slide.attr('data-history');
|
7678 |
+
if (slideHash === hash && !slide.hasClass(swiper.params.slideDuplicateClass)) {
|
7679 |
+
var index = slide.index();
|
7680 |
+
swiper.slideTo(index, speed, swiper.params.runCallbacksOnInit, true);
|
7681 |
+
}
|
7682 |
+
}
|
7683 |
+
}
|
7684 |
+
if (swiper.params.hashNavigation.watchState) {
|
7685 |
+
$(win).on('hashchange', swiper.hashNavigation.onHashCange);
|
7686 |
+
}
|
7687 |
+
},
|
7688 |
+
destroy: function destroy() {
|
7689 |
+
var swiper = this;
|
7690 |
+
if (swiper.params.hashNavigation.watchState) {
|
7691 |
+
$(win).off('hashchange', swiper.hashNavigation.onHashCange);
|
7692 |
+
}
|
7693 |
+
},
|
7694 |
+
};
|
7695 |
+
var HashNavigation$1 = {
|
7696 |
+
name: 'hash-navigation',
|
7697 |
+
params: {
|
7698 |
+
hashNavigation: {
|
7699 |
+
enabled: false,
|
7700 |
+
replaceState: false,
|
7701 |
+
watchState: false,
|
7702 |
+
},
|
7703 |
+
},
|
7704 |
+
create: function create() {
|
7705 |
+
var swiper = this;
|
7706 |
+
Utils.extend(swiper, {
|
7707 |
+
hashNavigation: {
|
7708 |
+
initialized: false,
|
7709 |
+
init: HashNavigation.init.bind(swiper),
|
7710 |
+
destroy: HashNavigation.destroy.bind(swiper),
|
7711 |
+
setHash: HashNavigation.setHash.bind(swiper),
|
7712 |
+
onHashCange: HashNavigation.onHashCange.bind(swiper),
|
7713 |
+
},
|
7714 |
+
});
|
7715 |
+
},
|
7716 |
+
on: {
|
7717 |
+
init: function init() {
|
7718 |
+
var swiper = this;
|
7719 |
+
if (swiper.params.hashNavigation.enabled) {
|
7720 |
+
swiper.hashNavigation.init();
|
7721 |
+
}
|
7722 |
+
},
|
7723 |
+
destroy: function destroy() {
|
7724 |
+
var swiper = this;
|
7725 |
+
if (swiper.params.hashNavigation.enabled) {
|
7726 |
+
swiper.hashNavigation.destroy();
|
7727 |
+
}
|
7728 |
+
},
|
7729 |
+
transitionEnd: function transitionEnd() {
|
7730 |
+
var swiper = this;
|
7731 |
+
if (swiper.hashNavigation.initialized) {
|
7732 |
+
swiper.hashNavigation.setHash();
|
7733 |
+
}
|
7734 |
+
},
|
7735 |
+
slideChange: function slideChange() {
|
7736 |
+
var swiper = this;
|
7737 |
+
if (swiper.hashNavigation.initialized && swiper.params.cssMode) {
|
7738 |
+
swiper.hashNavigation.setHash();
|
7739 |
+
}
|
7740 |
+
},
|
7741 |
+
},
|
7742 |
+
};
|
7743 |
+
|
7744 |
+
/* eslint no-underscore-dangle: "off" */
|
7745 |
+
|
7746 |
+
var Autoplay = {
|
7747 |
+
run: function run() {
|
7748 |
+
var swiper = this;
|
7749 |
+
var $activeSlideEl = swiper.slides.eq(swiper.activeIndex);
|
7750 |
+
var delay = swiper.params.autoplay.delay;
|
7751 |
+
if ($activeSlideEl.attr('data-swiper-autoplay')) {
|
7752 |
+
delay = $activeSlideEl.attr('data-swiper-autoplay') || swiper.params.autoplay.delay;
|
7753 |
+
}
|
7754 |
+
clearTimeout(swiper.autoplay.timeout);
|
7755 |
+
swiper.autoplay.timeout = Utils.nextTick(function () {
|
7756 |
+
if (swiper.params.autoplay.reverseDirection) {
|
7757 |
+
if (swiper.params.loop) {
|
7758 |
+
swiper.loopFix();
|
7759 |
+
swiper.slidePrev(swiper.params.speed, true, true);
|
7760 |
+
swiper.emit('autoplay');
|
7761 |
+
} else if (!swiper.isBeginning) {
|
7762 |
+
swiper.slidePrev(swiper.params.speed, true, true);
|
7763 |
+
swiper.emit('autoplay');
|
7764 |
+
} else if (!swiper.params.autoplay.stopOnLastSlide) {
|
7765 |
+
swiper.slideTo(swiper.slides.length - 1, swiper.params.speed, true, true);
|
7766 |
+
swiper.emit('autoplay');
|
7767 |
+
} else {
|
7768 |
+
swiper.autoplay.stop();
|
7769 |
+
}
|
7770 |
+
} else if (swiper.params.loop) {
|
7771 |
+
swiper.loopFix();
|
7772 |
+
swiper.slideNext(swiper.params.speed, true, true);
|
7773 |
+
swiper.emit('autoplay');
|
7774 |
+
} else if (!swiper.isEnd) {
|
7775 |
+
swiper.slideNext(swiper.params.speed, true, true);
|
7776 |
+
swiper.emit('autoplay');
|
7777 |
+
} else if (!swiper.params.autoplay.stopOnLastSlide) {
|
7778 |
+
swiper.slideTo(0, swiper.params.speed, true, true);
|
7779 |
+
swiper.emit('autoplay');
|
7780 |
+
} else {
|
7781 |
+
swiper.autoplay.stop();
|
7782 |
+
}
|
7783 |
+
if (swiper.params.cssMode && swiper.autoplay.running) { swiper.autoplay.run(); }
|
7784 |
+
}, delay);
|
7785 |
+
},
|
7786 |
+
start: function start() {
|
7787 |
+
var swiper = this;
|
7788 |
+
if (typeof swiper.autoplay.timeout !== 'undefined') { return false; }
|
7789 |
+
if (swiper.autoplay.running) { return false; }
|
7790 |
+
swiper.autoplay.running = true;
|
7791 |
+
swiper.emit('autoplayStart');
|
7792 |
+
swiper.autoplay.run();
|
7793 |
+
return true;
|
7794 |
+
},
|
7795 |
+
stop: function stop() {
|
7796 |
+
var swiper = this;
|
7797 |
+
if (!swiper.autoplay.running) { return false; }
|
7798 |
+
if (typeof swiper.autoplay.timeout === 'undefined') { return false; }
|
7799 |
+
|
7800 |
+
if (swiper.autoplay.timeout) {
|
7801 |
+
clearTimeout(swiper.autoplay.timeout);
|
7802 |
+
swiper.autoplay.timeout = undefined;
|
7803 |
+
}
|
7804 |
+
swiper.autoplay.running = false;
|
7805 |
+
swiper.emit('autoplayStop');
|
7806 |
+
return true;
|
7807 |
+
},
|
7808 |
+
pause: function pause(speed) {
|
7809 |
+
var swiper = this;
|
7810 |
+
if (!swiper.autoplay.running) { return; }
|
7811 |
+
if (swiper.autoplay.paused) { return; }
|
7812 |
+
if (swiper.autoplay.timeout) { clearTimeout(swiper.autoplay.timeout); }
|
7813 |
+
swiper.autoplay.paused = true;
|
7814 |
+
if (speed === 0 || !swiper.params.autoplay.waitForTransition) {
|
7815 |
+
swiper.autoplay.paused = false;
|
7816 |
+
swiper.autoplay.run();
|
7817 |
+
} else {
|
7818 |
+
swiper.$wrapperEl[0].addEventListener('transitionend', swiper.autoplay.onTransitionEnd);
|
7819 |
+
swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.autoplay.onTransitionEnd);
|
7820 |
+
}
|
7821 |
+
},
|
7822 |
+
};
|
7823 |
+
|
7824 |
+
var Autoplay$1 = {
|
7825 |
+
name: 'autoplay',
|
7826 |
+
params: {
|
7827 |
+
autoplay: {
|
7828 |
+
enabled: false,
|
7829 |
+
delay: 3000,
|
7830 |
+
waitForTransition: true,
|
7831 |
+
disableOnInteraction: true,
|
7832 |
+
stopOnLastSlide: false,
|
7833 |
+
reverseDirection: false,
|
7834 |
+
},
|
7835 |
+
},
|
7836 |
+
create: function create() {
|
7837 |
+
var swiper = this;
|
7838 |
+
Utils.extend(swiper, {
|
7839 |
+
autoplay: {
|
7840 |
+
running: false,
|
7841 |
+
paused: false,
|
7842 |
+
run: Autoplay.run.bind(swiper),
|
7843 |
+
start: Autoplay.start.bind(swiper),
|
7844 |
+
stop: Autoplay.stop.bind(swiper),
|
7845 |
+
pause: Autoplay.pause.bind(swiper),
|
7846 |
+
onVisibilityChange: function onVisibilityChange() {
|
7847 |
+
if (document.visibilityState === 'hidden' && swiper.autoplay.running) {
|
7848 |
+
swiper.autoplay.pause();
|
7849 |
+
}
|
7850 |
+
if (document.visibilityState === 'visible' && swiper.autoplay.paused) {
|
7851 |
+
swiper.autoplay.run();
|
7852 |
+
swiper.autoplay.paused = false;
|
7853 |
+
}
|
7854 |
+
},
|
7855 |
+
onTransitionEnd: function onTransitionEnd(e) {
|
7856 |
+
if (!swiper || swiper.destroyed || !swiper.$wrapperEl) { return; }
|
7857 |
+
if (e.target !== this) { return; }
|
7858 |
+
swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.autoplay.onTransitionEnd);
|
7859 |
+
swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.autoplay.onTransitionEnd);
|
7860 |
+
swiper.autoplay.paused = false;
|
7861 |
+
if (!swiper.autoplay.running) {
|
7862 |
+
swiper.autoplay.stop();
|
7863 |
+
} else {
|
7864 |
+
swiper.autoplay.run();
|
7865 |
+
}
|
7866 |
+
},
|
7867 |
+
},
|
7868 |
+
});
|
7869 |
+
},
|
7870 |
+
on: {
|
7871 |
+
init: function init() {
|
7872 |
+
var swiper = this;
|
7873 |
+
if (swiper.params.autoplay.enabled) {
|
7874 |
+
swiper.autoplay.start();
|
7875 |
+
document.addEventListener('visibilitychange', swiper.autoplay.onVisibilityChange);
|
7876 |
+
}
|
7877 |
+
},
|
7878 |
+
beforeTransitionStart: function beforeTransitionStart(speed, internal) {
|
7879 |
+
var swiper = this;
|
7880 |
+
if (swiper.autoplay.running) {
|
7881 |
+
if (internal || !swiper.params.autoplay.disableOnInteraction) {
|
7882 |
+
swiper.autoplay.pause(speed);
|
7883 |
+
} else {
|
7884 |
+
swiper.autoplay.stop();
|
7885 |
+
}
|
7886 |
+
}
|
7887 |
+
},
|
7888 |
+
sliderFirstMove: function sliderFirstMove() {
|
7889 |
+
var swiper = this;
|
7890 |
+
if (swiper.autoplay.running) {
|
7891 |
+
if (swiper.params.autoplay.disableOnInteraction) {
|
7892 |
+
swiper.autoplay.stop();
|
7893 |
+
} else {
|
7894 |
+
swiper.autoplay.pause();
|
7895 |
+
}
|
7896 |
+
}
|
7897 |
+
},
|
7898 |
+
touchEnd: function touchEnd() {
|
7899 |
+
var swiper = this;
|
7900 |
+
if (swiper.params.cssMode && swiper.autoplay.paused && !swiper.params.autoplay.disableOnInteraction) {
|
7901 |
+
swiper.autoplay.run();
|
7902 |
+
}
|
7903 |
+
},
|
7904 |
+
destroy: function destroy() {
|
7905 |
+
var swiper = this;
|
7906 |
+
if (swiper.autoplay.running) {
|
7907 |
+
swiper.autoplay.stop();
|
7908 |
+
}
|
7909 |
+
document.removeEventListener('visibilitychange', swiper.autoplay.onVisibilityChange);
|
7910 |
+
},
|
7911 |
+
},
|
7912 |
+
};
|
7913 |
+
|
7914 |
+
var Fade = {
|
7915 |
+
setTranslate: function setTranslate() {
|
7916 |
+
var swiper = this;
|
7917 |
+
var slides = swiper.slides;
|
7918 |
+
for (var i = 0; i < slides.length; i += 1) {
|
7919 |
+
var $slideEl = swiper.slides.eq(i);
|
7920 |
+
var offset = $slideEl[0].swiperSlideOffset;
|
7921 |
+
var tx = -offset;
|
7922 |
+
if (!swiper.params.virtualTranslate) { tx -= swiper.translate; }
|
7923 |
+
var ty = 0;
|
7924 |
+
if (!swiper.isHorizontal()) {
|
7925 |
+
ty = tx;
|
7926 |
+
tx = 0;
|
7927 |
+
}
|
7928 |
+
var slideOpacity = swiper.params.fadeEffect.crossFade
|
7929 |
+
? Math.max(1 - Math.abs($slideEl[0].progress), 0)
|
7930 |
+
: 1 + Math.min(Math.max($slideEl[0].progress, -1), 0);
|
7931 |
+
$slideEl
|
7932 |
+
.css({
|
7933 |
+
opacity: slideOpacity,
|
7934 |
+
})
|
7935 |
+
.transform(("translate3d(" + tx + "px, " + ty + "px, 0px)"));
|
7936 |
+
}
|
7937 |
+
},
|
7938 |
+
setTransition: function setTransition(duration) {
|
7939 |
+
var swiper = this;
|
7940 |
+
var slides = swiper.slides;
|
7941 |
+
var $wrapperEl = swiper.$wrapperEl;
|
7942 |
+
slides.transition(duration);
|
7943 |
+
if (swiper.params.virtualTranslate && duration !== 0) {
|
7944 |
+
var eventTriggered = false;
|
7945 |
+
slides.transitionEnd(function () {
|
7946 |
+
if (eventTriggered) { return; }
|
7947 |
+
if (!swiper || swiper.destroyed) { return; }
|
7948 |
+
eventTriggered = true;
|
7949 |
+
swiper.animating = false;
|
7950 |
+
var triggerEvents = ['webkitTransitionEnd', 'transitionend'];
|
7951 |
+
for (var i = 0; i < triggerEvents.length; i += 1) {
|
7952 |
+
$wrapperEl.trigger(triggerEvents[i]);
|
7953 |
+
}
|
7954 |
+
});
|
7955 |
+
}
|
7956 |
+
},
|
7957 |
+
};
|
7958 |
+
|
7959 |
+
var EffectFade = {
|
7960 |
+
name: 'effect-fade',
|
7961 |
+
params: {
|
7962 |
+
fadeEffect: {
|
7963 |
+
crossFade: false,
|
7964 |
+
},
|
7965 |
+
},
|
7966 |
+
create: function create() {
|
7967 |
+
var swiper = this;
|
7968 |
+
Utils.extend(swiper, {
|
7969 |
+
fadeEffect: {
|
7970 |
+
setTranslate: Fade.setTranslate.bind(swiper),
|
7971 |
+
setTransition: Fade.setTransition.bind(swiper),
|
7972 |
+
},
|
7973 |
+
});
|
7974 |
+
},
|
7975 |
+
on: {
|
7976 |
+
beforeInit: function beforeInit() {
|
7977 |
+
var swiper = this;
|
7978 |
+
if (swiper.params.effect !== 'fade') { return; }
|
7979 |
+
swiper.classNames.push(((swiper.params.containerModifierClass) + "fade"));
|
7980 |
+
var overwriteParams = {
|
7981 |
+
slidesPerView: 1,
|
7982 |
+
slidesPerColumn: 1,
|
7983 |
+
slidesPerGroup: 1,
|
7984 |
+
watchSlidesProgress: true,
|
7985 |
+
spaceBetween: 0,
|
7986 |
+
virtualTranslate: true,
|
7987 |
+
};
|
7988 |
+
Utils.extend(swiper.params, overwriteParams);
|
7989 |
+
Utils.extend(swiper.originalParams, overwriteParams);
|
7990 |
+
},
|
7991 |
+
setTranslate: function setTranslate() {
|
7992 |
+
var swiper = this;
|
7993 |
+
if (swiper.params.effect !== 'fade') { return; }
|
7994 |
+
swiper.fadeEffect.setTranslate();
|
7995 |
+
},
|
7996 |
+
setTransition: function setTransition(duration) {
|
7997 |
+
var swiper = this;
|
7998 |
+
if (swiper.params.effect !== 'fade') { return; }
|
7999 |
+
swiper.fadeEffect.setTransition(duration);
|
8000 |
+
},
|
8001 |
+
},
|
8002 |
+
};
|
8003 |
+
|
8004 |
+
var Cube = {
|
8005 |
+
setTranslate: function setTranslate() {
|
8006 |
+
var swiper = this;
|
8007 |
+
var $el = swiper.$el;
|
8008 |
+
var $wrapperEl = swiper.$wrapperEl;
|
8009 |
+
var slides = swiper.slides;
|
8010 |
+
var swiperWidth = swiper.width;
|
8011 |
+
var swiperHeight = swiper.height;
|
8012 |
+
var rtl = swiper.rtlTranslate;
|
8013 |
+
var swiperSize = swiper.size;
|
8014 |
+
var params = swiper.params.cubeEffect;
|
8015 |
+
var isHorizontal = swiper.isHorizontal();
|
8016 |
+
var isVirtual = swiper.virtual && swiper.params.virtual.enabled;
|
8017 |
+
var wrapperRotate = 0;
|
8018 |
+
var $cubeShadowEl;
|
8019 |
+
if (params.shadow) {
|
8020 |
+
if (isHorizontal) {
|
8021 |
+
$cubeShadowEl = $wrapperEl.find('.swiper-cube-shadow');
|
8022 |
+
if ($cubeShadowEl.length === 0) {
|
8023 |
+
$cubeShadowEl = $('<div class="swiper-cube-shadow"></div>');
|
8024 |
+
$wrapperEl.append($cubeShadowEl);
|
8025 |
+
}
|
8026 |
+
$cubeShadowEl.css({ height: (swiperWidth + "px") });
|
8027 |
+
} else {
|
8028 |
+
$cubeShadowEl = $el.find('.swiper-cube-shadow');
|
8029 |
+
if ($cubeShadowEl.length === 0) {
|
8030 |
+
$cubeShadowEl = $('<div class="swiper-cube-shadow"></div>');
|
8031 |
+
$el.append($cubeShadowEl);
|
8032 |
+
}
|
8033 |
+
}
|
8034 |
+
}
|
8035 |
+
for (var i = 0; i < slides.length; i += 1) {
|
8036 |
+
var $slideEl = slides.eq(i);
|
8037 |
+
var slideIndex = i;
|
8038 |
+
if (isVirtual) {
|
8039 |
+
slideIndex = parseInt($slideEl.attr('data-swiper-slide-index'), 10);
|
8040 |
+
}
|
8041 |
+
var slideAngle = slideIndex * 90;
|
8042 |
+
var round = Math.floor(slideAngle / 360);
|
8043 |
+
if (rtl) {
|
8044 |
+
slideAngle = -slideAngle;
|
8045 |
+
round = Math.floor(-slideAngle / 360);
|
8046 |
+
}
|
8047 |
+
var progress = Math.max(Math.min($slideEl[0].progress, 1), -1);
|
8048 |
+
var tx = 0;
|
8049 |
+
var ty = 0;
|
8050 |
+
var tz = 0;
|
8051 |
+
if (slideIndex % 4 === 0) {
|
8052 |
+
tx = -round * 4 * swiperSize;
|
8053 |
+
tz = 0;
|
8054 |
+
} else if ((slideIndex - 1) % 4 === 0) {
|
8055 |
+
tx = 0;
|
8056 |
+
tz = -round * 4 * swiperSize;
|
8057 |
+
} else if ((slideIndex - 2) % 4 === 0) {
|
8058 |
+
tx = swiperSize + (round * 4 * swiperSize);
|
8059 |
+
tz = swiperSize;
|
8060 |
+
} else if ((slideIndex - 3) % 4 === 0) {
|
8061 |
+
tx = -swiperSize;
|
8062 |
+
tz = (3 * swiperSize) + (swiperSize * 4 * round);
|
8063 |
+
}
|
8064 |
+
if (rtl) {
|
8065 |
+
tx = -tx;
|
8066 |
+
}
|
8067 |
+
|
8068 |
+
if (!isHorizontal) {
|
8069 |
+
ty = tx;
|
8070 |
+
tx = 0;
|
8071 |
+
}
|
8072 |
+
|
8073 |
+
var transform = "rotateX(" + (isHorizontal ? 0 : -slideAngle) + "deg) rotateY(" + (isHorizontal ? slideAngle : 0) + "deg) translate3d(" + tx + "px, " + ty + "px, " + tz + "px)";
|
8074 |
+
if (progress <= 1 && progress > -1) {
|
8075 |
+
wrapperRotate = (slideIndex * 90) + (progress * 90);
|
8076 |
+
if (rtl) { wrapperRotate = (-slideIndex * 90) - (progress * 90); }
|
8077 |
+
}
|
8078 |
+
$slideEl.transform(transform);
|
8079 |
+
if (params.slideShadows) {
|
8080 |
+
// Set shadows
|
8081 |
+
var shadowBefore = isHorizontal ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top');
|
8082 |
+
var shadowAfter = isHorizontal ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom');
|
8083 |
+
if (shadowBefore.length === 0) {
|
8084 |
+
shadowBefore = $(("<div class=\"swiper-slide-shadow-" + (isHorizontal ? 'left' : 'top') + "\"></div>"));
|
8085 |
+
$slideEl.append(shadowBefore);
|
8086 |
+
}
|
8087 |
+
if (shadowAfter.length === 0) {
|
8088 |
+
shadowAfter = $(("<div class=\"swiper-slide-shadow-" + (isHorizontal ? 'right' : 'bottom') + "\"></div>"));
|
8089 |
+
$slideEl.append(shadowAfter);
|
8090 |
+
}
|
8091 |
+
if (shadowBefore.length) { shadowBefore[0].style.opacity = Math.max(-progress, 0); }
|
8092 |
+
if (shadowAfter.length) { shadowAfter[0].style.opacity = Math.max(progress, 0); }
|
8093 |
+
}
|
8094 |
+
}
|
8095 |
+
$wrapperEl.css({
|
8096 |
+
'-webkit-transform-origin': ("50% 50% -" + (swiperSize / 2) + "px"),
|
8097 |
+
'-moz-transform-origin': ("50% 50% -" + (swiperSize / 2) + "px"),
|
8098 |
+
'-ms-transform-origin': ("50% 50% -" + (swiperSize / 2) + "px"),
|
8099 |
+
'transform-origin': ("50% 50% -" + (swiperSize / 2) + "px"),
|
8100 |
+
});
|
8101 |
+
|
8102 |
+
if (params.shadow) {
|
8103 |
+
if (isHorizontal) {
|
8104 |
+
$cubeShadowEl.transform(("translate3d(0px, " + ((swiperWidth / 2) + params.shadowOffset) + "px, " + (-swiperWidth / 2) + "px) rotateX(90deg) rotateZ(0deg) scale(" + (params.shadowScale) + ")"));
|
8105 |
+
} else {
|
8106 |
+
var shadowAngle = Math.abs(wrapperRotate) - (Math.floor(Math.abs(wrapperRotate) / 90) * 90);
|
8107 |
+
var multiplier = 1.5 - (
|
8108 |
+
(Math.sin((shadowAngle * 2 * Math.PI) / 360) / 2)
|
8109 |
+
+ (Math.cos((shadowAngle * 2 * Math.PI) / 360) / 2)
|
8110 |
+
);
|
8111 |
+
var scale1 = params.shadowScale;
|
8112 |
+
var scale2 = params.shadowScale / multiplier;
|
8113 |
+
var offset = params.shadowOffset;
|
8114 |
+
$cubeShadowEl.transform(("scale3d(" + scale1 + ", 1, " + scale2 + ") translate3d(0px, " + ((swiperHeight / 2) + offset) + "px, " + (-swiperHeight / 2 / scale2) + "px) rotateX(-90deg)"));
|
8115 |
+
}
|
8116 |
+
}
|
8117 |
+
var zFactor = (Browser.isSafari || Browser.isUiWebView) ? (-swiperSize / 2) : 0;
|
8118 |
+
$wrapperEl
|
8119 |
+
.transform(("translate3d(0px,0," + zFactor + "px) rotateX(" + (swiper.isHorizontal() ? 0 : wrapperRotate) + "deg) rotateY(" + (swiper.isHorizontal() ? -wrapperRotate : 0) + "deg)"));
|
8120 |
+
},
|
8121 |
+
setTransition: function setTransition(duration) {
|
8122 |
+
var swiper = this;
|
8123 |
+
var $el = swiper.$el;
|
8124 |
+
var slides = swiper.slides;
|
8125 |
+
slides
|
8126 |
+
.transition(duration)
|
8127 |
+
.find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left')
|
8128 |
+
.transition(duration);
|
8129 |
+
if (swiper.params.cubeEffect.shadow && !swiper.isHorizontal()) {
|
8130 |
+
$el.find('.swiper-cube-shadow').transition(duration);
|
8131 |
+
}
|
8132 |
+
},
|
8133 |
+
};
|
8134 |
+
|
8135 |
+
var EffectCube = {
|
8136 |
+
name: 'effect-cube',
|
8137 |
+
params: {
|
8138 |
+
cubeEffect: {
|
8139 |
+
slideShadows: true,
|
8140 |
+
shadow: true,
|
8141 |
+
shadowOffset: 20,
|
8142 |
+
shadowScale: 0.94,
|
8143 |
+
},
|
8144 |
+
},
|
8145 |
+
create: function create() {
|
8146 |
+
var swiper = this;
|
8147 |
+
Utils.extend(swiper, {
|
8148 |
+
cubeEffect: {
|
8149 |
+
setTranslate: Cube.setTranslate.bind(swiper),
|
8150 |
+
setTransition: Cube.setTransition.bind(swiper),
|
8151 |
+
},
|
8152 |
+
});
|
8153 |
+
},
|
8154 |
+
on: {
|
8155 |
+
beforeInit: function beforeInit() {
|
8156 |
+
var swiper = this;
|
8157 |
+
if (swiper.params.effect !== 'cube') { return; }
|
8158 |
+
swiper.classNames.push(((swiper.params.containerModifierClass) + "cube"));
|
8159 |
+
swiper.classNames.push(((swiper.params.containerModifierClass) + "3d"));
|
8160 |
+
var overwriteParams = {
|
8161 |
+
slidesPerView: 1,
|
8162 |
+
slidesPerColumn: 1,
|
8163 |
+
slidesPerGroup: 1,
|
8164 |
+
watchSlidesProgress: true,
|
8165 |
+
resistanceRatio: 0,
|
8166 |
+
spaceBetween: 0,
|
8167 |
+
centeredSlides: false,
|
8168 |
+
virtualTranslate: true,
|
8169 |
+
};
|
8170 |
+
Utils.extend(swiper.params, overwriteParams);
|
8171 |
+
Utils.extend(swiper.originalParams, overwriteParams);
|
8172 |
+
},
|
8173 |
+
setTranslate: function setTranslate() {
|
8174 |
+
var swiper = this;
|
8175 |
+
if (swiper.params.effect !== 'cube') { return; }
|
8176 |
+
swiper.cubeEffect.setTranslate();
|
8177 |
+
},
|
8178 |
+
setTransition: function setTransition(duration) {
|
8179 |
+
var swiper = this;
|
8180 |
+
if (swiper.params.effect !== 'cube') { return; }
|
8181 |
+
swiper.cubeEffect.setTransition(duration);
|
8182 |
+
},
|
8183 |
+
},
|
8184 |
+
};
|
8185 |
+
|
8186 |
+
var Flip = {
|
8187 |
+
setTranslate: function setTranslate() {
|
8188 |
+
var swiper = this;
|
8189 |
+
var slides = swiper.slides;
|
8190 |
+
var rtl = swiper.rtlTranslate;
|
8191 |
+
for (var i = 0; i < slides.length; i += 1) {
|
8192 |
+
var $slideEl = slides.eq(i);
|
8193 |
+
var progress = $slideEl[0].progress;
|
8194 |
+
if (swiper.params.flipEffect.limitRotation) {
|
8195 |
+
progress = Math.max(Math.min($slideEl[0].progress, 1), -1);
|
8196 |
+
}
|
8197 |
+
var offset = $slideEl[0].swiperSlideOffset;
|
8198 |
+
var rotate = -180 * progress;
|
8199 |
+
var rotateY = rotate;
|
8200 |
+
var rotateX = 0;
|
8201 |
+
var tx = -offset;
|
8202 |
+
var ty = 0;
|
8203 |
+
if (!swiper.isHorizontal()) {
|
8204 |
+
ty = tx;
|
8205 |
+
tx = 0;
|
8206 |
+
rotateX = -rotateY;
|
8207 |
+
rotateY = 0;
|
8208 |
+
} else if (rtl) {
|
8209 |
+
rotateY = -rotateY;
|
8210 |
+
}
|
8211 |
+
|
8212 |
+
$slideEl[0].style.zIndex = -Math.abs(Math.round(progress)) + slides.length;
|
8213 |
+
|
8214 |
+
if (swiper.params.flipEffect.slideShadows) {
|
8215 |
+
// Set shadows
|
8216 |
+
var shadowBefore = swiper.isHorizontal() ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top');
|
8217 |
+
var shadowAfter = swiper.isHorizontal() ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom');
|
8218 |
+
if (shadowBefore.length === 0) {
|
8219 |
+
shadowBefore = $(("<div class=\"swiper-slide-shadow-" + (swiper.isHorizontal() ? 'left' : 'top') + "\"></div>"));
|
8220 |
+
$slideEl.append(shadowBefore);
|
8221 |
+
}
|
8222 |
+
if (shadowAfter.length === 0) {
|
8223 |
+
shadowAfter = $(("<div class=\"swiper-slide-shadow-" + (swiper.isHorizontal() ? 'right' : 'bottom') + "\"></div>"));
|
8224 |
+
$slideEl.append(shadowAfter);
|
8225 |
+
}
|
8226 |
+
if (shadowBefore.length) { shadowBefore[0].style.opacity = Math.max(-progress, 0); }
|
8227 |
+
if (shadowAfter.length) { shadowAfter[0].style.opacity = Math.max(progress, 0); }
|
8228 |
+
}
|
8229 |
+
$slideEl
|
8230 |
+
.transform(("translate3d(" + tx + "px, " + ty + "px, 0px) rotateX(" + rotateX + "deg) rotateY(" + rotateY + "deg)"));
|
8231 |
+
}
|
8232 |
+
},
|
8233 |
+
setTransition: function setTransition(duration) {
|
8234 |
+
var swiper = this;
|
8235 |
+
var slides = swiper.slides;
|
8236 |
+
var activeIndex = swiper.activeIndex;
|
8237 |
+
var $wrapperEl = swiper.$wrapperEl;
|
8238 |
+
slides
|
8239 |
+
.transition(duration)
|
8240 |
+
.find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left')
|
8241 |
+
.transition(duration);
|
8242 |
+
if (swiper.params.virtualTranslate && duration !== 0) {
|
8243 |
+
var eventTriggered = false;
|
8244 |
+
// eslint-disable-next-line
|
8245 |
+
slides.eq(activeIndex).transitionEnd(function onTransitionEnd() {
|
8246 |
+
if (eventTriggered) { return; }
|
8247 |
+
if (!swiper || swiper.destroyed) { return; }
|
8248 |
+
// if (!$(this).hasClass(swiper.params.slideActiveClass)) return;
|
8249 |
+
eventTriggered = true;
|
8250 |
+
swiper.animating = false;
|
8251 |
+
var triggerEvents = ['webkitTransitionEnd', 'transitionend'];
|
8252 |
+
for (var i = 0; i < triggerEvents.length; i += 1) {
|
8253 |
+
$wrapperEl.trigger(triggerEvents[i]);
|
8254 |
+
}
|
8255 |
+
});
|
8256 |
+
}
|
8257 |
+
},
|
8258 |
+
};
|
8259 |
+
|
8260 |
+
var EffectFlip = {
|
8261 |
+
name: 'effect-flip',
|
8262 |
+
params: {
|
8263 |
+
flipEffect: {
|
8264 |
+
slideShadows: true,
|
8265 |
+
limitRotation: true,
|
8266 |
+
},
|
8267 |
+
},
|
8268 |
+
create: function create() {
|
8269 |
+
var swiper = this;
|
8270 |
+
Utils.extend(swiper, {
|
8271 |
+
flipEffect: {
|
8272 |
+
setTranslate: Flip.setTranslate.bind(swiper),
|
8273 |
+
setTransition: Flip.setTransition.bind(swiper),
|
8274 |
+
},
|
8275 |
+
});
|
8276 |
+
},
|
8277 |
+
on: {
|
8278 |
+
beforeInit: function beforeInit() {
|
8279 |
+
var swiper = this;
|
8280 |
+
if (swiper.params.effect !== 'flip') { return; }
|
8281 |
+
swiper.classNames.push(((swiper.params.containerModifierClass) + "flip"));
|
8282 |
+
swiper.classNames.push(((swiper.params.containerModifierClass) + "3d"));
|
8283 |
+
var overwriteParams = {
|
8284 |
+
slidesPerView: 1,
|
8285 |
+
slidesPerColumn: 1,
|
8286 |
+
slidesPerGroup: 1,
|
8287 |
+
watchSlidesProgress: true,
|
8288 |
+
spaceBetween: 0,
|
8289 |
+
virtualTranslate: true,
|
8290 |
+
};
|
8291 |
+
Utils.extend(swiper.params, overwriteParams);
|
8292 |
+
Utils.extend(swiper.originalParams, overwriteParams);
|
8293 |
+
},
|
8294 |
+
setTranslate: function setTranslate() {
|
8295 |
+
var swiper = this;
|
8296 |
+
if (swiper.params.effect !== 'flip') { return; }
|
8297 |
+
swiper.flipEffect.setTranslate();
|
8298 |
+
},
|
8299 |
+
setTransition: function setTransition(duration) {
|
8300 |
+
var swiper = this;
|
8301 |
+
if (swiper.params.effect !== 'flip') { return; }
|
8302 |
+
swiper.flipEffect.setTransition(duration);
|
8303 |
+
},
|
8304 |
+
},
|
8305 |
+
};
|
8306 |
+
|
8307 |
+
var Coverflow = {
|
8308 |
+
setTranslate: function setTranslate() {
|
8309 |
+
var swiper = this;
|
8310 |
+
var swiperWidth = swiper.width;
|
8311 |
+
var swiperHeight = swiper.height;
|
8312 |
+
var slides = swiper.slides;
|
8313 |
+
var $wrapperEl = swiper.$wrapperEl;
|
8314 |
+
var slidesSizesGrid = swiper.slidesSizesGrid;
|
8315 |
+
var params = swiper.params.coverflowEffect;
|
8316 |
+
var isHorizontal = swiper.isHorizontal();
|
8317 |
+
var transform = swiper.translate;
|
8318 |
+
var center = isHorizontal ? -transform + (swiperWidth / 2) : -transform + (swiperHeight / 2);
|
8319 |
+
var rotate = isHorizontal ? params.rotate : -params.rotate;
|
8320 |
+
var translate = params.depth;
|
8321 |
+
// Each slide offset from center
|
8322 |
+
for (var i = 0, length = slides.length; i < length; i += 1) {
|
8323 |
+
var $slideEl = slides.eq(i);
|
8324 |
+
var slideSize = slidesSizesGrid[i];
|
8325 |
+
var slideOffset = $slideEl[0].swiperSlideOffset;
|
8326 |
+
var offsetMultiplier = ((center - slideOffset - (slideSize / 2)) / slideSize) * params.modifier;
|
8327 |
+
|
8328 |
+
var rotateY = isHorizontal ? rotate * offsetMultiplier : 0;
|
8329 |
+
var rotateX = isHorizontal ? 0 : rotate * offsetMultiplier;
|
8330 |
+
// var rotateZ = 0
|
8331 |
+
var translateZ = -translate * Math.abs(offsetMultiplier);
|
8332 |
+
|
8333 |
+
var stretch = params.stretch;
|
8334 |
+
// Allow percentage to make a relative stretch for responsive sliders
|
8335 |
+
if (typeof stretch === 'string' && stretch.indexOf('%') !== -1) {
|
8336 |
+
stretch = ((parseFloat(params.stretch) / 100) * slideSize);
|
8337 |
+
}
|
8338 |
+
var translateY = isHorizontal ? 0 : stretch * (offsetMultiplier);
|
8339 |
+
var translateX = isHorizontal ? stretch * (offsetMultiplier) : 0;
|
8340 |
+
|
8341 |
+
// Fix for ultra small values
|
8342 |
+
if (Math.abs(translateX) < 0.001) { translateX = 0; }
|
8343 |
+
if (Math.abs(translateY) < 0.001) { translateY = 0; }
|
8344 |
+
if (Math.abs(translateZ) < 0.001) { translateZ = 0; }
|
8345 |
+
if (Math.abs(rotateY) < 0.001) { rotateY = 0; }
|
8346 |
+
if (Math.abs(rotateX) < 0.001) { rotateX = 0; }
|
8347 |
+
|
8348 |
+
var slideTransform = "translate3d(" + translateX + "px," + translateY + "px," + translateZ + "px) rotateX(" + rotateX + "deg) rotateY(" + rotateY + "deg)";
|
8349 |
+
|
8350 |
+
$slideEl.transform(slideTransform);
|
8351 |
+
$slideEl[0].style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1;
|
8352 |
+
if (params.slideShadows) {
|
8353 |
+
// Set shadows
|
8354 |
+
var $shadowBeforeEl = isHorizontal ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top');
|
8355 |
+
var $shadowAfterEl = isHorizontal ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom');
|
8356 |
+
if ($shadowBeforeEl.length === 0) {
|
8357 |
+
$shadowBeforeEl = $(("<div class=\"swiper-slide-shadow-" + (isHorizontal ? 'left' : 'top') + "\"></div>"));
|
8358 |
+
$slideEl.append($shadowBeforeEl);
|
8359 |
+
}
|
8360 |
+
if ($shadowAfterEl.length === 0) {
|
8361 |
+
$shadowAfterEl = $(("<div class=\"swiper-slide-shadow-" + (isHorizontal ? 'right' : 'bottom') + "\"></div>"));
|
8362 |
+
$slideEl.append($shadowAfterEl);
|
8363 |
+
}
|
8364 |
+
if ($shadowBeforeEl.length) { $shadowBeforeEl[0].style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0; }
|
8365 |
+
if ($shadowAfterEl.length) { $shadowAfterEl[0].style.opacity = (-offsetMultiplier) > 0 ? -offsetMultiplier : 0; }
|
8366 |
+
}
|
8367 |
+
}
|
8368 |
+
|
8369 |
+
// Set correct perspective for IE10
|
8370 |
+
if (Support.pointerEvents || Support.prefixedPointerEvents) {
|
8371 |
+
var ws = $wrapperEl[0].style;
|
8372 |
+
ws.perspectiveOrigin = center + "px 50%";
|
8373 |
+
}
|
8374 |
+
},
|
8375 |
+
setTransition: function setTransition(duration) {
|
8376 |
+
var swiper = this;
|
8377 |
+
swiper.slides
|
8378 |
+
.transition(duration)
|
8379 |
+
.find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left')
|
8380 |
+
.transition(duration);
|
8381 |
+
},
|
8382 |
+
};
|
8383 |
+
|
8384 |
+
var EffectCoverflow = {
|
8385 |
+
name: 'effect-coverflow',
|
8386 |
+
params: {
|
8387 |
+
coverflowEffect: {
|
8388 |
+
rotate: 50,
|
8389 |
+
stretch: 0,
|
8390 |
+
depth: 100,
|
8391 |
+
modifier: 1,
|
8392 |
+
slideShadows: true,
|
8393 |
+
},
|
8394 |
+
},
|
8395 |
+
create: function create() {
|
8396 |
+
var swiper = this;
|
8397 |
+
Utils.extend(swiper, {
|
8398 |
+
coverflowEffect: {
|
8399 |
+
setTranslate: Coverflow.setTranslate.bind(swiper),
|
8400 |
+
setTransition: Coverflow.setTransition.bind(swiper),
|
8401 |
+
},
|
8402 |
+
});
|
8403 |
+
},
|
8404 |
+
on: {
|
8405 |
+
beforeInit: function beforeInit() {
|
8406 |
+
var swiper = this;
|
8407 |
+
if (swiper.params.effect !== 'coverflow') { return; }
|
8408 |
+
|
8409 |
+
swiper.classNames.push(((swiper.params.containerModifierClass) + "coverflow"));
|
8410 |
+
swiper.classNames.push(((swiper.params.containerModifierClass) + "3d"));
|
8411 |
+
|
8412 |
+
swiper.params.watchSlidesProgress = true;
|
8413 |
+
swiper.originalParams.watchSlidesProgress = true;
|
8414 |
+
},
|
8415 |
+
setTranslate: function setTranslate() {
|
8416 |
+
var swiper = this;
|
8417 |
+
if (swiper.params.effect !== 'coverflow') { return; }
|
8418 |
+
swiper.coverflowEffect.setTranslate();
|
8419 |
+
},
|
8420 |
+
setTransition: function setTransition(duration) {
|
8421 |
+
var swiper = this;
|
8422 |
+
if (swiper.params.effect !== 'coverflow') { return; }
|
8423 |
+
swiper.coverflowEffect.setTransition(duration);
|
8424 |
+
},
|
8425 |
+
},
|
8426 |
+
};
|
8427 |
+
|
8428 |
+
var Thumbs = {
|
8429 |
+
init: function init() {
|
8430 |
+
var swiper = this;
|
8431 |
+
var ref = swiper.params;
|
8432 |
+
var thumbsParams = ref.thumbs;
|
8433 |
+
var SwiperClass = swiper.constructor;
|
8434 |
+
if (thumbsParams.swiper instanceof SwiperClass) {
|
8435 |
+
swiper.thumbs.swiper = thumbsParams.swiper;
|
8436 |
+
Utils.extend(swiper.thumbs.swiper.originalParams, {
|
8437 |
+
watchSlidesProgress: true,
|
8438 |
+
slideToClickedSlide: false,
|
8439 |
+
});
|
8440 |
+
Utils.extend(swiper.thumbs.swiper.params, {
|
8441 |
+
watchSlidesProgress: true,
|
8442 |
+
slideToClickedSlide: false,
|
8443 |
+
});
|
8444 |
+
} else if (Utils.isObject(thumbsParams.swiper)) {
|
8445 |
+
swiper.thumbs.swiper = new SwiperClass(Utils.extend({}, thumbsParams.swiper, {
|
8446 |
+
watchSlidesVisibility: true,
|
8447 |
+
watchSlidesProgress: true,
|
8448 |
+
slideToClickedSlide: false,
|
8449 |
+
}));
|
8450 |
+
swiper.thumbs.swiperCreated = true;
|
8451 |
+
}
|
8452 |
+
swiper.thumbs.swiper.$el.addClass(swiper.params.thumbs.thumbsContainerClass);
|
8453 |
+
swiper.thumbs.swiper.on('tap', swiper.thumbs.onThumbClick);
|
8454 |
+
},
|
8455 |
+
onThumbClick: function onThumbClick() {
|
8456 |
+
var swiper = this;
|
8457 |
+
var thumbsSwiper = swiper.thumbs.swiper;
|
8458 |
+
if (!thumbsSwiper) { return; }
|
8459 |
+
var clickedIndex = thumbsSwiper.clickedIndex;
|
8460 |
+
var clickedSlide = thumbsSwiper.clickedSlide;
|
8461 |
+
if (clickedSlide && $(clickedSlide).hasClass(swiper.params.thumbs.slideThumbActiveClass)) { return; }
|
8462 |
+
if (typeof clickedIndex === 'undefined' || clickedIndex === null) { return; }
|
8463 |
+
var slideToIndex;
|
8464 |
+
if (thumbsSwiper.params.loop) {
|
8465 |
+
slideToIndex = parseInt($(thumbsSwiper.clickedSlide).attr('data-swiper-slide-index'), 10);
|
8466 |
+
} else {
|
8467 |
+
slideToIndex = clickedIndex;
|
8468 |
+
}
|
8469 |
+
if (swiper.params.loop) {
|
8470 |
+
var currentIndex = swiper.activeIndex;
|
8471 |
+
if (swiper.slides.eq(currentIndex).hasClass(swiper.params.slideDuplicateClass)) {
|
8472 |
+
swiper.loopFix();
|
8473 |
+
// eslint-disable-next-line
|
8474 |
+
swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
|
8475 |
+
currentIndex = swiper.activeIndex;
|
8476 |
+
}
|
8477 |
+
var prevIndex = swiper.slides.eq(currentIndex).prevAll(("[data-swiper-slide-index=\"" + slideToIndex + "\"]")).eq(0).index();
|
8478 |
+
var nextIndex = swiper.slides.eq(currentIndex).nextAll(("[data-swiper-slide-index=\"" + slideToIndex + "\"]")).eq(0).index();
|
8479 |
+
if (typeof prevIndex === 'undefined') { slideToIndex = nextIndex; }
|
8480 |
+
else if (typeof nextIndex === 'undefined') { slideToIndex = prevIndex; }
|
8481 |
+
else if (nextIndex - currentIndex < currentIndex - prevIndex) { slideToIndex = nextIndex; }
|
8482 |
+
else { slideToIndex = prevIndex; }
|
8483 |
+
}
|
8484 |
+
swiper.slideTo(slideToIndex);
|
8485 |
+
},
|
8486 |
+
update: function update(initial) {
|
8487 |
+
var swiper = this;
|
8488 |
+
var thumbsSwiper = swiper.thumbs.swiper;
|
8489 |
+
if (!thumbsSwiper) { return; }
|
8490 |
+
|
8491 |
+
var slidesPerView = thumbsSwiper.params.slidesPerView === 'auto'
|
8492 |
+
? thumbsSwiper.slidesPerViewDynamic()
|
8493 |
+
: thumbsSwiper.params.slidesPerView;
|
8494 |
+
|
8495 |
+
if (swiper.realIndex !== thumbsSwiper.realIndex) {
|
8496 |
+
var currentThumbsIndex = thumbsSwiper.activeIndex;
|
8497 |
+
var newThumbsIndex;
|
8498 |
+
if (thumbsSwiper.params.loop) {
|
8499 |
+
if (thumbsSwiper.slides.eq(currentThumbsIndex).hasClass(thumbsSwiper.params.slideDuplicateClass)) {
|
8500 |
+
thumbsSwiper.loopFix();
|
8501 |
+
// eslint-disable-next-line
|
8502 |
+
thumbsSwiper._clientLeft = thumbsSwiper.$wrapperEl[0].clientLeft;
|
8503 |
+
currentThumbsIndex = thumbsSwiper.activeIndex;
|
8504 |
+
}
|
8505 |
+
// Find actual thumbs index to slide to
|
8506 |
+
var prevThumbsIndex = thumbsSwiper.slides.eq(currentThumbsIndex).prevAll(("[data-swiper-slide-index=\"" + (swiper.realIndex) + "\"]")).eq(0).index();
|
8507 |
+
var nextThumbsIndex = thumbsSwiper.slides.eq(currentThumbsIndex).nextAll(("[data-swiper-slide-index=\"" + (swiper.realIndex) + "\"]")).eq(0).index();
|
8508 |
+
if (typeof prevThumbsIndex === 'undefined') { newThumbsIndex = nextThumbsIndex; }
|
8509 |
+
else if (typeof nextThumbsIndex === 'undefined') { newThumbsIndex = prevThumbsIndex; }
|
8510 |
+
else if (nextThumbsIndex - currentThumbsIndex === currentThumbsIndex - prevThumbsIndex) { newThumbsIndex = currentThumbsIndex; }
|
8511 |
+
else if (nextThumbsIndex - currentThumbsIndex < currentThumbsIndex - prevThumbsIndex) { newThumbsIndex = nextThumbsIndex; }
|
8512 |
+
else { newThumbsIndex = prevThumbsIndex; }
|
8513 |
+
} else {
|
8514 |
+
newThumbsIndex = swiper.realIndex;
|
8515 |
+
}
|
8516 |
+
if (thumbsSwiper.visibleSlidesIndexes && thumbsSwiper.visibleSlidesIndexes.indexOf(newThumbsIndex) < 0) {
|
8517 |
+
if (thumbsSwiper.params.centeredSlides) {
|
8518 |
+
if (newThumbsIndex > currentThumbsIndex) {
|
8519 |
+
newThumbsIndex = newThumbsIndex - Math.floor(slidesPerView / 2) + 1;
|
8520 |
+
} else {
|
8521 |
+
newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1;
|
8522 |
+
}
|
8523 |
+
} else if (newThumbsIndex > currentThumbsIndex) {
|
8524 |
+
newThumbsIndex = newThumbsIndex - slidesPerView + 1;
|
8525 |
+
}
|
8526 |
+
thumbsSwiper.slideTo(newThumbsIndex, initial ? 0 : undefined);
|
8527 |
+
}
|
8528 |
+
}
|
8529 |
+
|
8530 |
+
// Activate thumbs
|
8531 |
+
var thumbsToActivate = 1;
|
8532 |
+
var thumbActiveClass = swiper.params.thumbs.slideThumbActiveClass;
|
8533 |
+
|
8534 |
+
if (swiper.params.slidesPerView > 1 && !swiper.params.centeredSlides) {
|
8535 |
+
thumbsToActivate = swiper.params.slidesPerView;
|
8536 |
+
}
|
8537 |
+
|
8538 |
+
if (!swiper.params.thumbs.multipleActiveThumbs) {
|
8539 |
+
thumbsToActivate = 1;
|
8540 |
+
}
|
8541 |
+
|
8542 |
+
thumbsToActivate = Math.floor(thumbsToActivate);
|
8543 |
+
|
8544 |
+
thumbsSwiper.slides.removeClass(thumbActiveClass);
|
8545 |
+
if (thumbsSwiper.params.loop || (thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled)) {
|
8546 |
+
for (var i = 0; i < thumbsToActivate; i += 1) {
|
8547 |
+
thumbsSwiper.$wrapperEl.children(("[data-swiper-slide-index=\"" + (swiper.realIndex + i) + "\"]")).addClass(thumbActiveClass);
|
8548 |
+
}
|
8549 |
+
} else {
|
8550 |
+
for (var i$1 = 0; i$1 < thumbsToActivate; i$1 += 1) {
|
8551 |
+
thumbsSwiper.slides.eq(swiper.realIndex + i$1).addClass(thumbActiveClass);
|
8552 |
+
}
|
8553 |
+
}
|
8554 |
+
},
|
8555 |
+
};
|
8556 |
+
var Thumbs$1 = {
|
8557 |
+
name: 'thumbs',
|
8558 |
+
params: {
|
8559 |
+
thumbs: {
|
8560 |
+
multipleActiveThumbs: true,
|
8561 |
+
swiper: null,
|
8562 |
+
slideThumbActiveClass: 'swiper-slide-thumb-active',
|
8563 |
+
thumbsContainerClass: 'swiper-container-thumbs',
|
8564 |
+
},
|
8565 |
+
},
|
8566 |
+
create: function create() {
|
8567 |
+
var swiper = this;
|
8568 |
+
Utils.extend(swiper, {
|
8569 |
+
thumbs: {
|
8570 |
+
swiper: null,
|
8571 |
+
init: Thumbs.init.bind(swiper),
|
8572 |
+
update: Thumbs.update.bind(swiper),
|
8573 |
+
onThumbClick: Thumbs.onThumbClick.bind(swiper),
|
8574 |
+
},
|
8575 |
+
});
|
8576 |
+
},
|
8577 |
+
on: {
|
8578 |
+
beforeInit: function beforeInit() {
|
8579 |
+
var swiper = this;
|
8580 |
+
var ref = swiper.params;
|
8581 |
+
var thumbs = ref.thumbs;
|
8582 |
+
if (!thumbs || !thumbs.swiper) { return; }
|
8583 |
+
swiper.thumbs.init();
|
8584 |
+
swiper.thumbs.update(true);
|
8585 |
+
},
|
8586 |
+
slideChange: function slideChange() {
|
8587 |
+
var swiper = this;
|
8588 |
+
if (!swiper.thumbs.swiper) { return; }
|
8589 |
+
swiper.thumbs.update();
|
8590 |
+
},
|
8591 |
+
update: function update() {
|
8592 |
+
var swiper = this;
|
8593 |
+
if (!swiper.thumbs.swiper) { return; }
|
8594 |
+
swiper.thumbs.update();
|
8595 |
+
},
|
8596 |
+
resize: function resize() {
|
8597 |
+
var swiper = this;
|
8598 |
+
if (!swiper.thumbs.swiper) { return; }
|
8599 |
+
swiper.thumbs.update();
|
8600 |
+
},
|
8601 |
+
observerUpdate: function observerUpdate() {
|
8602 |
+
var swiper = this;
|
8603 |
+
if (!swiper.thumbs.swiper) { return; }
|
8604 |
+
swiper.thumbs.update();
|
8605 |
+
},
|
8606 |
+
setTransition: function setTransition(duration) {
|
8607 |
+
var swiper = this;
|
8608 |
+
var thumbsSwiper = swiper.thumbs.swiper;
|
8609 |
+
if (!thumbsSwiper) { return; }
|
8610 |
+
thumbsSwiper.setTransition(duration);
|
8611 |
+
},
|
8612 |
+
beforeDestroy: function beforeDestroy() {
|
8613 |
+
var swiper = this;
|
8614 |
+
var thumbsSwiper = swiper.thumbs.swiper;
|
8615 |
+
if (!thumbsSwiper) { return; }
|
8616 |
+
if (swiper.thumbs.swiperCreated && thumbsSwiper) {
|
8617 |
+
thumbsSwiper.destroy();
|
8618 |
+
}
|
8619 |
+
},
|
8620 |
+
},
|
8621 |
+
};
|
8622 |
+
|
8623 |
+
// Swiper Class
|
8624 |
+
|
8625 |
+
var components = [
|
8626 |
+
Device$1,
|
8627 |
+
Support$1,
|
8628 |
+
Browser$1,
|
8629 |
+
Resize,
|
8630 |
+
Observer$1,
|
8631 |
+
Virtual$1,
|
8632 |
+
Keyboard$1,
|
8633 |
+
Mousewheel$1,
|
8634 |
+
Navigation$1,
|
8635 |
+
Pagination$1,
|
8636 |
+
Scrollbar$1,
|
8637 |
+
Parallax$1,
|
8638 |
+
Zoom$1,
|
8639 |
+
Lazy$1,
|
8640 |
+
Controller$1,
|
8641 |
+
A11y,
|
8642 |
+
History$1,
|
8643 |
+
HashNavigation$1,
|
8644 |
+
Autoplay$1,
|
8645 |
+
EffectFade,
|
8646 |
+
EffectCube,
|
8647 |
+
EffectFlip,
|
8648 |
+
EffectCoverflow,
|
8649 |
+
Thumbs$1
|
8650 |
+
];
|
8651 |
+
|
8652 |
+
if (typeof Swiper.use === 'undefined') {
|
8653 |
+
Swiper.use = Swiper.Class.use;
|
8654 |
+
Swiper.installModule = Swiper.Class.installModule;
|
8655 |
+
}
|
8656 |
+
|
8657 |
+
Swiper.use(components);
|
8658 |
+
|
8659 |
+
return Swiper;
|
8660 |
+
|
8661 |
+
}));
|
8662 |
+
//# sourceMappingURL=swiper.js.map
|
assets/swiper/swiper.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"file":"swiper.js.map","sources":["~/ssr-window/dist/ssr-window.esm.js","~/dom7/dist/dom7.modular.js","../src/utils/dom.js","../src/utils/utils.js","../src/utils/support.js","../src/utils/class.js","../src/components/core/update/updateSize.js","../src/components/core/update/updateSlides.js","../src/components/core/update/updateAutoHeight.js","../src/components/core/update/updateSlidesOffset.js","../src/components/core/update/updateSlidesProgress.js","../src/components/core/update/updateProgress.js","../src/components/core/update/updateSlidesClasses.js","../src/components/core/update/updateActiveIndex.js","../src/components/core/update/updateClickedSlide.js","../src/components/core/update/index.js","../src/components/core/translate/getTranslate.js","../src/components/core/translate/setTranslate.js","../src/components/core/translate/minTranslate.js","../src/components/core/translate/maxTranslate.js","../src/components/core/translate/translateTo.js","../src/components/core/translate/index.js","../src/components/core/transition/setTransition.js","../src/components/core/transition/transitionStart.js","../src/components/core/transition/transitionEnd.js","../src/components/core/transition/index.js","../src/components/core/slide/slideTo.js","../src/components/core/slide/slideToLoop.js","../src/components/core/slide/slideNext.js","../src/components/core/slide/slidePrev.js","../src/components/core/slide/slideReset.js","../src/components/core/slide/slideToClosest.js","../src/components/core/slide/slideToClickedSlide.js","../src/components/core/slide/index.js","../src/components/core/loop/loopCreate.js","../src/components/core/loop/loopFix.js","../src/components/core/loop/loopDestroy.js","../src/components/core/loop/index.js","../src/components/core/grab-cursor/setGrabCursor.js","../src/components/core/grab-cursor/unsetGrabCursor.js","../src/components/core/grab-cursor/index.js","../src/components/core/manipulation/appendSlide.js","../src/components/core/manipulation/prependSlide.js","../src/components/core/manipulation/addSlide.js","../src/components/core/manipulation/removeSlide.js","../src/components/core/manipulation/removeAllSlides.js","../src/components/core/manipulation/index.js","../src/utils/device.js","../src/components/core/events/onTouchStart.js","../src/components/core/events/onTouchMove.js","../src/components/core/events/onTouchEnd.js","../src/components/core/events/onResize.js","../src/components/core/events/onClick.js","../src/components/core/events/onScroll.js","../src/components/core/events/index.js","../src/components/core/breakpoints/setBreakpoint.js","../src/components/core/breakpoints/getBreakpoint.js","../src/components/core/breakpoints/index.js","../src/components/core/classes/addClasses.js","../src/components/core/classes/removeClasses.js","../src/components/core/classes/index.js","../src/components/core/images/loadImage.js","../src/components/core/images/preloadImages.js","../src/components/core/images/index.js","../src/components/core/check-overflow/index.js","../src/components/core/defaults.js","../src/components/core/core-class.js","../src/modules/device/device.js","../src/modules/support/support.js","../src/utils/browser.js","../src/modules/browser/browser.js","../src/modules/resize/resize.js","../src/modules/observer/observer.js","../src/components/virtual/virtual.js","../src/components/keyboard/keyboard.js","../src/components/mousewheel/mousewheel.js","../src/components/navigation/navigation.js","../src/components/pagination/pagination.js","../src/components/scrollbar/scrollbar.js","../src/components/parallax/parallax.js","../src/components/zoom/zoom.js","../src/components/lazy/lazy.js","../src/components/controller/controller.js","../src/components/a11y/a11y.js","../src/components/history/history.js","../src/components/hash-navigation/hash-navigation.js","../src/components/autoplay/autoplay.js","../src/components/effect-fade/effect-fade.js","../src/components/effect-cube/effect-cube.js","../src/components/effect-flip/effect-flip.js","../src/components/effect-coverflow/effect-coverflow.js","../src/components/thumbs/thumbs.js","../src/swiper.js"],"sourcesContent":["/**\n * SSR Window 1.0.1\n * Better handling for window object in SSR environment\n * https://github.com/nolimits4web/ssr-window\n *\n * Copyright 2018, Vladimir Kharlampidi\n *\n * Licensed under MIT\n *\n * Released on: July 18, 2018\n */\nvar doc = (typeof document === 'undefined') ? {\n body: {},\n addEventListener: function addEventListener() {},\n removeEventListener: function removeEventListener() {},\n activeElement: {\n blur: function blur() {},\n nodeName: '',\n },\n querySelector: function querySelector() {\n return null;\n },\n querySelectorAll: function querySelectorAll() {\n return [];\n },\n getElementById: function getElementById() {\n return null;\n },\n createEvent: function createEvent() {\n return {\n initEvent: function initEvent() {},\n };\n },\n createElement: function createElement() {\n return {\n children: [],\n childNodes: [],\n style: {},\n setAttribute: function setAttribute() {},\n getElementsByTagName: function getElementsByTagName() {\n return [];\n },\n };\n },\n location: { hash: '' },\n} : document; // eslint-disable-line\n\nvar win = (typeof window === 'undefined') ? {\n document: doc,\n navigator: {\n userAgent: '',\n },\n location: {},\n history: {},\n CustomEvent: function CustomEvent() {\n return this;\n },\n addEventListener: function addEventListener() {},\n removeEventListener: function removeEventListener() {},\n getComputedStyle: function getComputedStyle() {\n return {\n getPropertyValue: function getPropertyValue() {\n return '';\n },\n };\n },\n Image: function Image() {},\n Date: function Date() {},\n screen: {},\n setTimeout: function setTimeout() {},\n clearTimeout: function clearTimeout() {},\n} : window; // eslint-disable-line\n\nexport { win as window, doc as document };\n","/**\n * Dom7 2.1.3\n * Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API\n * http://framework7.io/docs/dom.html\n *\n * Copyright 2019, Vladimir Kharlampidi\n * The iDangero.us\n * http://www.idangero.us/\n *\n * Licensed under MIT\n *\n * Released on: February 11, 2019\n */\nimport { document, window } from 'ssr-window';\n\nclass Dom7 {\n constructor(arr) {\n const self = this;\n // Create array-like object\n for (let i = 0; i < arr.length; i += 1) {\n self[i] = arr[i];\n }\n self.length = arr.length;\n // Return collection with methods\n return this;\n }\n}\n\nfunction $(selector, context) {\n const arr = [];\n let i = 0;\n if (selector && !context) {\n if (selector instanceof Dom7) {\n return selector;\n }\n }\n if (selector) {\n // String\n if (typeof selector === 'string') {\n let els;\n let tempParent;\n const html = selector.trim();\n if (html.indexOf('<') >= 0 && html.indexOf('>') >= 0) {\n let toCreate = 'div';\n if (html.indexOf('<li') === 0) toCreate = 'ul';\n if (html.indexOf('<tr') === 0) toCreate = 'tbody';\n if (html.indexOf('<td') === 0 || html.indexOf('<th') === 0) toCreate = 'tr';\n if (html.indexOf('<tbody') === 0) toCreate = 'table';\n if (html.indexOf('<option') === 0) toCreate = 'select';\n tempParent = document.createElement(toCreate);\n tempParent.innerHTML = html;\n for (i = 0; i < tempParent.childNodes.length; i += 1) {\n arr.push(tempParent.childNodes[i]);\n }\n } else {\n if (!context && selector[0] === '#' && !selector.match(/[ .<>:~]/)) {\n // Pure ID selector\n els = [document.getElementById(selector.trim().split('#')[1])];\n } else {\n // Other selectors\n els = (context || document).querySelectorAll(selector.trim());\n }\n for (i = 0; i < els.length; i += 1) {\n if (els[i]) arr.push(els[i]);\n }\n }\n } else if (selector.nodeType || selector === window || selector === document) {\n // Node/element\n arr.push(selector);\n } else if (selector.length > 0 && selector[0].nodeType) {\n // Array of elements or instance of Dom\n for (i = 0; i < selector.length; i += 1) {\n arr.push(selector[i]);\n }\n }\n }\n return new Dom7(arr);\n}\n\n$.fn = Dom7.prototype;\n$.Class = Dom7;\n$.Dom7 = Dom7;\n\nfunction unique(arr) {\n const uniqueArray = [];\n for (let i = 0; i < arr.length; i += 1) {\n if (uniqueArray.indexOf(arr[i]) === -1) uniqueArray.push(arr[i]);\n }\n return uniqueArray;\n}\nfunction toCamelCase(string) {\n return string.toLowerCase().replace(/-(.)/g, (match, group1) => group1.toUpperCase());\n}\n\nfunction requestAnimationFrame(callback) {\n if (window.requestAnimationFrame) return window.requestAnimationFrame(callback);\n else if (window.webkitRequestAnimationFrame) return window.webkitRequestAnimationFrame(callback);\n return window.setTimeout(callback, 1000 / 60);\n}\nfunction cancelAnimationFrame(id) {\n if (window.cancelAnimationFrame) return window.cancelAnimationFrame(id);\n else if (window.webkitCancelAnimationFrame) return window.webkitCancelAnimationFrame(id);\n return window.clearTimeout(id);\n}\n\n// Classes and attributes\nfunction addClass(className) {\n if (typeof className === 'undefined') {\n return this;\n }\n const classes = className.split(' ');\n for (let i = 0; i < classes.length; i += 1) {\n for (let j = 0; j < this.length; j += 1) {\n if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') this[j].classList.add(classes[i]);\n }\n }\n return this;\n}\nfunction removeClass(className) {\n const classes = className.split(' ');\n for (let i = 0; i < classes.length; i += 1) {\n for (let j = 0; j < this.length; j += 1) {\n if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') this[j].classList.remove(classes[i]);\n }\n }\n return this;\n}\nfunction hasClass(className) {\n if (!this[0]) return false;\n return this[0].classList.contains(className);\n}\nfunction toggleClass(className) {\n const classes = className.split(' ');\n for (let i = 0; i < classes.length; i += 1) {\n for (let j = 0; j < this.length; j += 1) {\n if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') this[j].classList.toggle(classes[i]);\n }\n }\n return this;\n}\nfunction attr(attrs, value) {\n if (arguments.length === 1 && typeof attrs === 'string') {\n // Get attr\n if (this[0]) return this[0].getAttribute(attrs);\n return undefined;\n }\n\n // Set attrs\n for (let i = 0; i < this.length; i += 1) {\n if (arguments.length === 2) {\n // String\n this[i].setAttribute(attrs, value);\n } else {\n // Object\n // eslint-disable-next-line\n for (const attrName in attrs) {\n this[i][attrName] = attrs[attrName];\n this[i].setAttribute(attrName, attrs[attrName]);\n }\n }\n }\n return this;\n}\n// eslint-disable-next-line\nfunction removeAttr(attr) {\n for (let i = 0; i < this.length; i += 1) {\n this[i].removeAttribute(attr);\n }\n return this;\n}\n// eslint-disable-next-line\nfunction prop(props, value) {\n if (arguments.length === 1 && typeof props === 'string') {\n // Get prop\n if (this[0]) return this[0][props];\n } else {\n // Set props\n for (let i = 0; i < this.length; i += 1) {\n if (arguments.length === 2) {\n // String\n this[i][props] = value;\n } else {\n // Object\n // eslint-disable-next-line\n for (const propName in props) {\n this[i][propName] = props[propName];\n }\n }\n }\n return this;\n }\n}\nfunction data(key, value) {\n let el;\n if (typeof value === 'undefined') {\n el = this[0];\n // Get value\n if (el) {\n if (el.dom7ElementDataStorage && (key in el.dom7ElementDataStorage)) {\n return el.dom7ElementDataStorage[key];\n }\n\n const dataKey = el.getAttribute(`data-${key}`);\n if (dataKey) {\n return dataKey;\n }\n return undefined;\n }\n return undefined;\n }\n\n // Set value\n for (let i = 0; i < this.length; i += 1) {\n el = this[i];\n if (!el.dom7ElementDataStorage) el.dom7ElementDataStorage = {};\n el.dom7ElementDataStorage[key] = value;\n }\n return this;\n}\nfunction removeData(key) {\n for (let i = 0; i < this.length; i += 1) {\n const el = this[i];\n if (el.dom7ElementDataStorage && el.dom7ElementDataStorage[key]) {\n el.dom7ElementDataStorage[key] = null;\n delete el.dom7ElementDataStorage[key];\n }\n }\n}\nfunction dataset() {\n const el = this[0];\n if (!el) return undefined;\n const dataset = {}; // eslint-disable-line\n if (el.dataset) {\n // eslint-disable-next-line\n for (const dataKey in el.dataset) {\n dataset[dataKey] = el.dataset[dataKey];\n }\n } else {\n for (let i = 0; i < el.attributes.length; i += 1) {\n // eslint-disable-next-line\n const attr = el.attributes[i];\n if (attr.name.indexOf('data-') >= 0) {\n dataset[toCamelCase(attr.name.split('data-')[1])] = attr.value;\n }\n }\n }\n // eslint-disable-next-line\n for (const key in dataset) {\n if (dataset[key] === 'false') dataset[key] = false;\n else if (dataset[key] === 'true') dataset[key] = true;\n else if (parseFloat(dataset[key]) === dataset[key] * 1) dataset[key] *= 1;\n }\n return dataset;\n}\nfunction val(value) {\n const dom = this;\n if (typeof value === 'undefined') {\n if (dom[0]) {\n if (dom[0].multiple && dom[0].nodeName.toLowerCase() === 'select') {\n const values = [];\n for (let i = 0; i < dom[0].selectedOptions.length; i += 1) {\n values.push(dom[0].selectedOptions[i].value);\n }\n return values;\n }\n return dom[0].value;\n }\n return undefined;\n }\n\n for (let i = 0; i < dom.length; i += 1) {\n const el = dom[i];\n if (Array.isArray(value) && el.multiple && el.nodeName.toLowerCase() === 'select') {\n for (let j = 0; j < el.options.length; j += 1) {\n el.options[j].selected = value.indexOf(el.options[j].value) >= 0;\n }\n } else {\n el.value = value;\n }\n }\n return dom;\n}\n// Transforms\n// eslint-disable-next-line\nfunction transform(transform) {\n for (let i = 0; i < this.length; i += 1) {\n const elStyle = this[i].style;\n elStyle.webkitTransform = transform;\n elStyle.transform = transform;\n }\n return this;\n}\nfunction transition(duration) {\n if (typeof duration !== 'string') {\n duration = `${duration}ms`; // eslint-disable-line\n }\n for (let i = 0; i < this.length; i += 1) {\n const elStyle = this[i].style;\n elStyle.webkitTransitionDuration = duration;\n elStyle.transitionDuration = duration;\n }\n return this;\n}\n// Events\nfunction on(...args) {\n let [eventType, targetSelector, listener, capture] = args;\n if (typeof args[1] === 'function') {\n [eventType, listener, capture] = args;\n targetSelector = undefined;\n }\n if (!capture) capture = false;\n\n function handleLiveEvent(e) {\n const target = e.target;\n if (!target) return;\n const eventData = e.target.dom7EventData || [];\n if (eventData.indexOf(e) < 0) {\n eventData.unshift(e);\n }\n if ($(target).is(targetSelector)) listener.apply(target, eventData);\n else {\n const parents = $(target).parents(); // eslint-disable-line\n for (let k = 0; k < parents.length; k += 1) {\n if ($(parents[k]).is(targetSelector)) listener.apply(parents[k], eventData);\n }\n }\n }\n function handleEvent(e) {\n const eventData = e && e.target ? e.target.dom7EventData || [] : [];\n if (eventData.indexOf(e) < 0) {\n eventData.unshift(e);\n }\n listener.apply(this, eventData);\n }\n const events = eventType.split(' ');\n let j;\n for (let i = 0; i < this.length; i += 1) {\n const el = this[i];\n if (!targetSelector) {\n for (j = 0; j < events.length; j += 1) {\n const event = events[j];\n if (!el.dom7Listeners) el.dom7Listeners = {};\n if (!el.dom7Listeners[event]) el.dom7Listeners[event] = [];\n el.dom7Listeners[event].push({\n listener,\n proxyListener: handleEvent,\n });\n el.addEventListener(event, handleEvent, capture);\n }\n } else {\n // Live events\n for (j = 0; j < events.length; j += 1) {\n const event = events[j];\n if (!el.dom7LiveListeners) el.dom7LiveListeners = {};\n if (!el.dom7LiveListeners[event]) el.dom7LiveListeners[event] = [];\n el.dom7LiveListeners[event].push({\n listener,\n proxyListener: handleLiveEvent,\n });\n el.addEventListener(event, handleLiveEvent, capture);\n }\n }\n }\n return this;\n}\nfunction off(...args) {\n let [eventType, targetSelector, listener, capture] = args;\n if (typeof args[1] === 'function') {\n [eventType, listener, capture] = args;\n targetSelector = undefined;\n }\n if (!capture) capture = false;\n\n const events = eventType.split(' ');\n for (let i = 0; i < events.length; i += 1) {\n const event = events[i];\n for (let j = 0; j < this.length; j += 1) {\n const el = this[j];\n let handlers;\n if (!targetSelector && el.dom7Listeners) {\n handlers = el.dom7Listeners[event];\n } else if (targetSelector && el.dom7LiveListeners) {\n handlers = el.dom7LiveListeners[event];\n }\n if (handlers && handlers.length) {\n for (let k = handlers.length - 1; k >= 0; k -= 1) {\n const handler = handlers[k];\n if (listener && handler.listener === listener) {\n el.removeEventListener(event, handler.proxyListener, capture);\n handlers.splice(k, 1);\n } else if (listener && handler.listener && handler.listener.dom7proxy && handler.listener.dom7proxy === listener) {\n el.removeEventListener(event, handler.proxyListener, capture);\n handlers.splice(k, 1);\n } else if (!listener) {\n el.removeEventListener(event, handler.proxyListener, capture);\n handlers.splice(k, 1);\n }\n }\n }\n }\n }\n return this;\n}\nfunction once(...args) {\n const dom = this;\n let [eventName, targetSelector, listener, capture] = args;\n if (typeof args[1] === 'function') {\n [eventName, listener, capture] = args;\n targetSelector = undefined;\n }\n function onceHandler(...eventArgs) {\n listener.apply(this, eventArgs);\n dom.off(eventName, targetSelector, onceHandler, capture);\n if (onceHandler.dom7proxy) {\n delete onceHandler.dom7proxy;\n }\n }\n onceHandler.dom7proxy = listener;\n return dom.on(eventName, targetSelector, onceHandler, capture);\n}\nfunction trigger(...args) {\n const events = args[0].split(' ');\n const eventData = args[1];\n for (let i = 0; i < events.length; i += 1) {\n const event = events[i];\n for (let j = 0; j < this.length; j += 1) {\n const el = this[j];\n let evt;\n try {\n evt = new window.CustomEvent(event, {\n detail: eventData,\n bubbles: true,\n cancelable: true,\n });\n } catch (e) {\n evt = document.createEvent('Event');\n evt.initEvent(event, true, true);\n evt.detail = eventData;\n }\n // eslint-disable-next-line\n el.dom7EventData = args.filter((data, dataIndex) => dataIndex > 0);\n el.dispatchEvent(evt);\n el.dom7EventData = [];\n delete el.dom7EventData;\n }\n }\n return this;\n}\nfunction transitionEnd(callback) {\n const events = ['webkitTransitionEnd', 'transitionend'];\n const dom = this;\n let i;\n function fireCallBack(e) {\n /* jshint validthis:true */\n if (e.target !== this) return;\n callback.call(this, e);\n for (i = 0; i < events.length; i += 1) {\n dom.off(events[i], fireCallBack);\n }\n }\n if (callback) {\n for (i = 0; i < events.length; i += 1) {\n dom.on(events[i], fireCallBack);\n }\n }\n return this;\n}\nfunction animationEnd(callback) {\n const events = ['webkitAnimationEnd', 'animationend'];\n const dom = this;\n let i;\n function fireCallBack(e) {\n if (e.target !== this) return;\n callback.call(this, e);\n for (i = 0; i < events.length; i += 1) {\n dom.off(events[i], fireCallBack);\n }\n }\n if (callback) {\n for (i = 0; i < events.length; i += 1) {\n dom.on(events[i], fireCallBack);\n }\n }\n return this;\n}\n// Sizing/Styles\nfunction width() {\n if (this[0] === window) {\n return window.innerWidth;\n }\n\n if (this.length > 0) {\n return parseFloat(this.css('width'));\n }\n\n return null;\n}\nfunction outerWidth(includeMargins) {\n if (this.length > 0) {\n if (includeMargins) {\n // eslint-disable-next-line\n const styles = this.styles();\n return this[0].offsetWidth + parseFloat(styles.getPropertyValue('margin-right')) + parseFloat(styles.getPropertyValue('margin-left'));\n }\n return this[0].offsetWidth;\n }\n return null;\n}\nfunction height() {\n if (this[0] === window) {\n return window.innerHeight;\n }\n\n if (this.length > 0) {\n return parseFloat(this.css('height'));\n }\n\n return null;\n}\nfunction outerHeight(includeMargins) {\n if (this.length > 0) {\n if (includeMargins) {\n // eslint-disable-next-line\n const styles = this.styles();\n return this[0].offsetHeight + parseFloat(styles.getPropertyValue('margin-top')) + parseFloat(styles.getPropertyValue('margin-bottom'));\n }\n return this[0].offsetHeight;\n }\n return null;\n}\nfunction offset() {\n if (this.length > 0) {\n const el = this[0];\n const box = el.getBoundingClientRect();\n const body = document.body;\n const clientTop = el.clientTop || body.clientTop || 0;\n const clientLeft = el.clientLeft || body.clientLeft || 0;\n const scrollTop = el === window ? window.scrollY : el.scrollTop;\n const scrollLeft = el === window ? window.scrollX : el.scrollLeft;\n return {\n top: (box.top + scrollTop) - clientTop,\n left: (box.left + scrollLeft) - clientLeft,\n };\n }\n\n return null;\n}\nfunction hide() {\n for (let i = 0; i < this.length; i += 1) {\n this[i].style.display = 'none';\n }\n return this;\n}\nfunction show() {\n for (let i = 0; i < this.length; i += 1) {\n const el = this[i];\n if (el.style.display === 'none') {\n el.style.display = '';\n }\n if (window.getComputedStyle(el, null).getPropertyValue('display') === 'none') {\n // Still not visible\n el.style.display = 'block';\n }\n }\n return this;\n}\nfunction styles() {\n if (this[0]) return window.getComputedStyle(this[0], null);\n return {};\n}\nfunction css(props, value) {\n let i;\n if (arguments.length === 1) {\n if (typeof props === 'string') {\n if (this[0]) return window.getComputedStyle(this[0], null).getPropertyValue(props);\n } else {\n for (i = 0; i < this.length; i += 1) {\n // eslint-disable-next-line\n for (let prop in props) {\n this[i].style[prop] = props[prop];\n }\n }\n return this;\n }\n }\n if (arguments.length === 2 && typeof props === 'string') {\n for (i = 0; i < this.length; i += 1) {\n this[i].style[props] = value;\n }\n return this;\n }\n return this;\n}\n\n// Dom manipulation\nfunction toArray() {\n const arr = [];\n for (let i = 0; i < this.length; i += 1) {\n arr.push(this[i]);\n }\n return arr;\n}\n// Iterate over the collection passing elements to `callback`\nfunction each(callback) {\n // Don't bother continuing without a callback\n if (!callback) return this;\n // Iterate over the current collection\n for (let i = 0; i < this.length; i += 1) {\n // If the callback returns false\n if (callback.call(this[i], i, this[i]) === false) {\n // End the loop early\n return this;\n }\n }\n // Return `this` to allow chained DOM operations\n return this;\n}\nfunction forEach(callback) {\n // Don't bother continuing without a callback\n if (!callback) return this;\n // Iterate over the current collection\n for (let i = 0; i < this.length; i += 1) {\n // If the callback returns false\n if (callback.call(this[i], this[i], i) === false) {\n // End the loop early\n return this;\n }\n }\n // Return `this` to allow chained DOM operations\n return this;\n}\nfunction filter(callback) {\n const matchedItems = [];\n const dom = this;\n for (let i = 0; i < dom.length; i += 1) {\n if (callback.call(dom[i], i, dom[i])) matchedItems.push(dom[i]);\n }\n return new Dom7(matchedItems);\n}\nfunction map(callback) {\n const modifiedItems = [];\n const dom = this;\n for (let i = 0; i < dom.length; i += 1) {\n modifiedItems.push(callback.call(dom[i], i, dom[i]));\n }\n return new Dom7(modifiedItems);\n}\n// eslint-disable-next-line\nfunction html(html) {\n if (typeof html === 'undefined') {\n return this[0] ? this[0].innerHTML : undefined;\n }\n\n for (let i = 0; i < this.length; i += 1) {\n this[i].innerHTML = html;\n }\n return this;\n}\n// eslint-disable-next-line\nfunction text(text) {\n if (typeof text === 'undefined') {\n if (this[0]) {\n return this[0].textContent.trim();\n }\n return null;\n }\n\n for (let i = 0; i < this.length; i += 1) {\n this[i].textContent = text;\n }\n return this;\n}\nfunction is(selector) {\n const el = this[0];\n let compareWith;\n let i;\n if (!el || typeof selector === 'undefined') return false;\n if (typeof selector === 'string') {\n if (el.matches) return el.matches(selector);\n else if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector);\n else if (el.msMatchesSelector) return el.msMatchesSelector(selector);\n\n compareWith = $(selector);\n for (i = 0; i < compareWith.length; i += 1) {\n if (compareWith[i] === el) return true;\n }\n return false;\n } else if (selector === document) return el === document;\n else if (selector === window) return el === window;\n\n if (selector.nodeType || selector instanceof Dom7) {\n compareWith = selector.nodeType ? [selector] : selector;\n for (i = 0; i < compareWith.length; i += 1) {\n if (compareWith[i] === el) return true;\n }\n return false;\n }\n return false;\n}\nfunction indexOf(el) {\n for (let i = 0; i < this.length; i += 1) {\n if (this[i] === el) return i;\n }\n return -1;\n}\nfunction index() {\n let child = this[0];\n let i;\n if (child) {\n i = 0;\n // eslint-disable-next-line\n while ((child = child.previousSibling) !== null) {\n if (child.nodeType === 1) i += 1;\n }\n return i;\n }\n return undefined;\n}\n// eslint-disable-next-line\nfunction eq(index) {\n if (typeof index === 'undefined') return this;\n const length = this.length;\n let returnIndex;\n if (index > length - 1) {\n return new Dom7([]);\n }\n if (index < 0) {\n returnIndex = length + index;\n if (returnIndex < 0) return new Dom7([]);\n return new Dom7([this[returnIndex]]);\n }\n return new Dom7([this[index]]);\n}\nfunction append(...args) {\n let newChild;\n\n for (let k = 0; k < args.length; k += 1) {\n newChild = args[k];\n for (let i = 0; i < this.length; i += 1) {\n if (typeof newChild === 'string') {\n const tempDiv = document.createElement('div');\n tempDiv.innerHTML = newChild;\n while (tempDiv.firstChild) {\n this[i].appendChild(tempDiv.firstChild);\n }\n } else if (newChild instanceof Dom7) {\n for (let j = 0; j < newChild.length; j += 1) {\n this[i].appendChild(newChild[j]);\n }\n } else {\n this[i].appendChild(newChild);\n }\n }\n }\n\n return this;\n}\n// eslint-disable-next-line\nfunction appendTo(parent) {\n $(parent).append(this);\n return this;\n}\nfunction prepend(newChild) {\n let i;\n let j;\n for (i = 0; i < this.length; i += 1) {\n if (typeof newChild === 'string') {\n const tempDiv = document.createElement('div');\n tempDiv.innerHTML = newChild;\n for (j = tempDiv.childNodes.length - 1; j >= 0; j -= 1) {\n this[i].insertBefore(tempDiv.childNodes[j], this[i].childNodes[0]);\n }\n } else if (newChild instanceof Dom7) {\n for (j = 0; j < newChild.length; j += 1) {\n this[i].insertBefore(newChild[j], this[i].childNodes[0]);\n }\n } else {\n this[i].insertBefore(newChild, this[i].childNodes[0]);\n }\n }\n return this;\n}\n// eslint-disable-next-line\nfunction prependTo(parent) {\n $(parent).prepend(this);\n return this;\n}\nfunction insertBefore(selector) {\n const before = $(selector);\n for (let i = 0; i < this.length; i += 1) {\n if (before.length === 1) {\n before[0].parentNode.insertBefore(this[i], before[0]);\n } else if (before.length > 1) {\n for (let j = 0; j < before.length; j += 1) {\n before[j].parentNode.insertBefore(this[i].cloneNode(true), before[j]);\n }\n }\n }\n}\nfunction insertAfter(selector) {\n const after = $(selector);\n for (let i = 0; i < this.length; i += 1) {\n if (after.length === 1) {\n after[0].parentNode.insertBefore(this[i], after[0].nextSibling);\n } else if (after.length > 1) {\n for (let j = 0; j < after.length; j += 1) {\n after[j].parentNode.insertBefore(this[i].cloneNode(true), after[j].nextSibling);\n }\n }\n }\n}\nfunction next(selector) {\n if (this.length > 0) {\n if (selector) {\n if (this[0].nextElementSibling && $(this[0].nextElementSibling).is(selector)) {\n return new Dom7([this[0].nextElementSibling]);\n }\n return new Dom7([]);\n }\n\n if (this[0].nextElementSibling) return new Dom7([this[0].nextElementSibling]);\n return new Dom7([]);\n }\n return new Dom7([]);\n}\nfunction nextAll(selector) {\n const nextEls = [];\n let el = this[0];\n if (!el) return new Dom7([]);\n while (el.nextElementSibling) {\n const next = el.nextElementSibling; // eslint-disable-line\n if (selector) {\n if ($(next).is(selector)) nextEls.push(next);\n } else nextEls.push(next);\n el = next;\n }\n return new Dom7(nextEls);\n}\nfunction prev(selector) {\n if (this.length > 0) {\n const el = this[0];\n if (selector) {\n if (el.previousElementSibling && $(el.previousElementSibling).is(selector)) {\n return new Dom7([el.previousElementSibling]);\n }\n return new Dom7([]);\n }\n\n if (el.previousElementSibling) return new Dom7([el.previousElementSibling]);\n return new Dom7([]);\n }\n return new Dom7([]);\n}\nfunction prevAll(selector) {\n const prevEls = [];\n let el = this[0];\n if (!el) return new Dom7([]);\n while (el.previousElementSibling) {\n const prev = el.previousElementSibling; // eslint-disable-line\n if (selector) {\n if ($(prev).is(selector)) prevEls.push(prev);\n } else prevEls.push(prev);\n el = prev;\n }\n return new Dom7(prevEls);\n}\nfunction siblings(selector) {\n return this.nextAll(selector).add(this.prevAll(selector));\n}\nfunction parent(selector) {\n const parents = []; // eslint-disable-line\n for (let i = 0; i < this.length; i += 1) {\n if (this[i].parentNode !== null) {\n if (selector) {\n if ($(this[i].parentNode).is(selector)) parents.push(this[i].parentNode);\n } else {\n parents.push(this[i].parentNode);\n }\n }\n }\n return $(unique(parents));\n}\nfunction parents(selector) {\n const parents = []; // eslint-disable-line\n for (let i = 0; i < this.length; i += 1) {\n let parent = this[i].parentNode; // eslint-disable-line\n while (parent) {\n if (selector) {\n if ($(parent).is(selector)) parents.push(parent);\n } else {\n parents.push(parent);\n }\n parent = parent.parentNode;\n }\n }\n return $(unique(parents));\n}\nfunction closest(selector) {\n let closest = this; // eslint-disable-line\n if (typeof selector === 'undefined') {\n return new Dom7([]);\n }\n if (!closest.is(selector)) {\n closest = closest.parents(selector).eq(0);\n }\n return closest;\n}\nfunction find(selector) {\n const foundElements = [];\n for (let i = 0; i < this.length; i += 1) {\n const found = this[i].querySelectorAll(selector);\n for (let j = 0; j < found.length; j += 1) {\n foundElements.push(found[j]);\n }\n }\n return new Dom7(foundElements);\n}\nfunction children(selector) {\n const children = []; // eslint-disable-line\n for (let i = 0; i < this.length; i += 1) {\n const childNodes = this[i].childNodes;\n\n for (let j = 0; j < childNodes.length; j += 1) {\n if (!selector) {\n if (childNodes[j].nodeType === 1) children.push(childNodes[j]);\n } else if (childNodes[j].nodeType === 1 && $(childNodes[j]).is(selector)) {\n children.push(childNodes[j]);\n }\n }\n }\n return new Dom7(unique(children));\n}\nfunction remove() {\n for (let i = 0; i < this.length; i += 1) {\n if (this[i].parentNode) this[i].parentNode.removeChild(this[i]);\n }\n return this;\n}\nfunction detach() {\n return this.remove();\n}\nfunction add(...args) {\n const dom = this;\n let i;\n let j;\n for (i = 0; i < args.length; i += 1) {\n const toAdd = $(args[i]);\n for (j = 0; j < toAdd.length; j += 1) {\n dom[dom.length] = toAdd[j];\n dom.length += 1;\n }\n }\n return dom;\n}\nfunction empty() {\n for (let i = 0; i < this.length; i += 1) {\n const el = this[i];\n if (el.nodeType === 1) {\n for (let j = 0; j < el.childNodes.length; j += 1) {\n if (el.childNodes[j].parentNode) {\n el.childNodes[j].parentNode.removeChild(el.childNodes[j]);\n }\n }\n el.textContent = '';\n }\n }\n return this;\n}\n\nfunction scrollTo(...args) {\n let [left, top, duration, easing, callback] = args;\n if (args.length === 4 && typeof easing === 'function') {\n callback = easing;\n [left, top, duration, callback, easing] = args;\n }\n if (typeof easing === 'undefined') easing = 'swing';\n\n return this.each(function animate() {\n const el = this;\n let currentTop;\n let currentLeft;\n let maxTop;\n let maxLeft;\n let newTop;\n let newLeft;\n let scrollTop; // eslint-disable-line\n let scrollLeft; // eslint-disable-line\n let animateTop = top > 0 || top === 0;\n let animateLeft = left > 0 || left === 0;\n if (typeof easing === 'undefined') {\n easing = 'swing';\n }\n if (animateTop) {\n currentTop = el.scrollTop;\n if (!duration) {\n el.scrollTop = top;\n }\n }\n if (animateLeft) {\n currentLeft = el.scrollLeft;\n if (!duration) {\n el.scrollLeft = left;\n }\n }\n if (!duration) return;\n if (animateTop) {\n maxTop = el.scrollHeight - el.offsetHeight;\n newTop = Math.max(Math.min(top, maxTop), 0);\n }\n if (animateLeft) {\n maxLeft = el.scrollWidth - el.offsetWidth;\n newLeft = Math.max(Math.min(left, maxLeft), 0);\n }\n let startTime = null;\n if (animateTop && newTop === currentTop) animateTop = false;\n if (animateLeft && newLeft === currentLeft) animateLeft = false;\n function render(time = new Date().getTime()) {\n if (startTime === null) {\n startTime = time;\n }\n const progress = Math.max(Math.min((time - startTime) / duration, 1), 0);\n const easeProgress = easing === 'linear' ? progress : (0.5 - (Math.cos(progress * Math.PI) / 2));\n let done;\n if (animateTop) scrollTop = currentTop + (easeProgress * (newTop - currentTop));\n if (animateLeft) scrollLeft = currentLeft + (easeProgress * (newLeft - currentLeft));\n if (animateTop && newTop > currentTop && scrollTop >= newTop) {\n el.scrollTop = newTop;\n done = true;\n }\n if (animateTop && newTop < currentTop && scrollTop <= newTop) {\n el.scrollTop = newTop;\n done = true;\n }\n if (animateLeft && newLeft > currentLeft && scrollLeft >= newLeft) {\n el.scrollLeft = newLeft;\n done = true;\n }\n if (animateLeft && newLeft < currentLeft && scrollLeft <= newLeft) {\n el.scrollLeft = newLeft;\n done = true;\n }\n\n if (done) {\n if (callback) callback();\n return;\n }\n if (animateTop) el.scrollTop = scrollTop;\n if (animateLeft) el.scrollLeft = scrollLeft;\n requestAnimationFrame(render);\n }\n requestAnimationFrame(render);\n });\n}\n// scrollTop(top, duration, easing, callback) {\nfunction scrollTop(...args) {\n let [top, duration, easing, callback] = args;\n if (args.length === 3 && typeof easing === 'function') {\n [top, duration, callback, easing] = args;\n }\n const dom = this;\n if (typeof top === 'undefined') {\n if (dom.length > 0) return dom[0].scrollTop;\n return null;\n }\n return dom.scrollTo(undefined, top, duration, easing, callback);\n}\nfunction scrollLeft(...args) {\n let [left, duration, easing, callback] = args;\n if (args.length === 3 && typeof easing === 'function') {\n [left, duration, callback, easing] = args;\n }\n const dom = this;\n if (typeof left === 'undefined') {\n if (dom.length > 0) return dom[0].scrollLeft;\n return null;\n }\n return dom.scrollTo(left, undefined, duration, easing, callback);\n}\n\nfunction animate(initialProps, initialParams) {\n const els = this;\n const a = {\n props: Object.assign({}, initialProps),\n params: Object.assign({\n duration: 300,\n easing: 'swing', // or 'linear'\n /* Callbacks\n begin(elements)\n complete(elements)\n progress(elements, complete, remaining, start, tweenValue)\n */\n }, initialParams),\n\n elements: els,\n animating: false,\n que: [],\n\n easingProgress(easing, progress) {\n if (easing === 'swing') {\n return 0.5 - (Math.cos(progress * Math.PI) / 2);\n }\n if (typeof easing === 'function') {\n return easing(progress);\n }\n return progress;\n },\n stop() {\n if (a.frameId) {\n cancelAnimationFrame(a.frameId);\n }\n a.animating = false;\n a.elements.each((index, el) => {\n const element = el;\n delete element.dom7AnimateInstance;\n });\n a.que = [];\n },\n done(complete) {\n a.animating = false;\n a.elements.each((index, el) => {\n const element = el;\n delete element.dom7AnimateInstance;\n });\n if (complete) complete(els);\n if (a.que.length > 0) {\n const que = a.que.shift();\n a.animate(que[0], que[1]);\n }\n },\n animate(props, params) {\n if (a.animating) {\n a.que.push([props, params]);\n return a;\n }\n const elements = [];\n\n // Define & Cache Initials & Units\n a.elements.each((index, el) => {\n let initialFullValue;\n let initialValue;\n let unit;\n let finalValue;\n let finalFullValue;\n\n if (!el.dom7AnimateInstance) a.elements[index].dom7AnimateInstance = a;\n\n elements[index] = {\n container: el,\n };\n Object.keys(props).forEach((prop) => {\n initialFullValue = window.getComputedStyle(el, null).getPropertyValue(prop).replace(',', '.');\n initialValue = parseFloat(initialFullValue);\n unit = initialFullValue.replace(initialValue, '');\n finalValue = parseFloat(props[prop]);\n finalFullValue = props[prop] + unit;\n elements[index][prop] = {\n initialFullValue,\n initialValue,\n unit,\n finalValue,\n finalFullValue,\n currentValue: initialValue,\n };\n });\n });\n\n let startTime = null;\n let time;\n let elementsDone = 0;\n let propsDone = 0;\n let done;\n let began = false;\n\n a.animating = true;\n\n function render() {\n time = new Date().getTime();\n let progress;\n let easeProgress;\n // let el;\n if (!began) {\n began = true;\n if (params.begin) params.begin(els);\n }\n if (startTime === null) {\n startTime = time;\n }\n if (params.progress) {\n // eslint-disable-next-line\n params.progress(els, Math.max(Math.min((time - startTime) / params.duration, 1), 0), ((startTime + params.duration) - time < 0 ? 0 : (startTime + params.duration) - time), startTime);\n }\n\n elements.forEach((element) => {\n const el = element;\n if (done || el.done) return;\n Object.keys(props).forEach((prop) => {\n if (done || el.done) return;\n progress = Math.max(Math.min((time - startTime) / params.duration, 1), 0);\n easeProgress = a.easingProgress(params.easing, progress);\n const { initialValue, finalValue, unit } = el[prop];\n el[prop].currentValue = initialValue + (easeProgress * (finalValue - initialValue));\n const currentValue = el[prop].currentValue;\n\n if (\n (finalValue > initialValue && currentValue >= finalValue) ||\n (finalValue < initialValue && currentValue <= finalValue)) {\n el.container.style[prop] = finalValue + unit;\n propsDone += 1;\n if (propsDone === Object.keys(props).length) {\n el.done = true;\n elementsDone += 1;\n }\n if (elementsDone === elements.length) {\n done = true;\n }\n }\n if (done) {\n a.done(params.complete);\n return;\n }\n el.container.style[prop] = currentValue + unit;\n });\n });\n if (done) return;\n // Then call\n a.frameId = requestAnimationFrame(render);\n }\n a.frameId = requestAnimationFrame(render);\n return a;\n },\n };\n\n if (a.elements.length === 0) {\n return els;\n }\n\n let animateInstance;\n for (let i = 0; i < a.elements.length; i += 1) {\n if (a.elements[i].dom7AnimateInstance) {\n animateInstance = a.elements[i].dom7AnimateInstance;\n } else a.elements[i].dom7AnimateInstance = a;\n }\n if (!animateInstance) {\n animateInstance = a;\n }\n\n if (initialProps === 'stop') {\n animateInstance.stop();\n } else {\n animateInstance.animate(a.props, a.params);\n }\n\n return els;\n}\n\nfunction stop() {\n const els = this;\n for (let i = 0; i < els.length; i += 1) {\n if (els[i].dom7AnimateInstance) {\n els[i].dom7AnimateInstance.stop();\n }\n }\n}\n\nconst noTrigger = ('resize scroll').split(' ');\nfunction eventShortcut(name, ...args) {\n if (typeof args[0] === 'undefined') {\n for (let i = 0; i < this.length; i += 1) {\n if (noTrigger.indexOf(name) < 0) {\n if (name in this[i]) this[i][name]();\n else {\n $(this[i]).trigger(name);\n }\n }\n }\n return this;\n }\n return this.on(name, ...args);\n}\n\nfunction click(...args) {\n return eventShortcut.bind(this)('click', ...args);\n}\nfunction blur(...args) {\n return eventShortcut.bind(this)('blur', ...args);\n}\nfunction focus(...args) {\n return eventShortcut.bind(this)('focus', ...args);\n}\nfunction focusin(...args) {\n return eventShortcut.bind(this)('focusin', ...args);\n}\nfunction focusout(...args) {\n return eventShortcut.bind(this)('focusout', ...args);\n}\nfunction keyup(...args) {\n return eventShortcut.bind(this)('keyup', ...args);\n}\nfunction keydown(...args) {\n return eventShortcut.bind(this)('keydown', ...args);\n}\nfunction keypress(...args) {\n return eventShortcut.bind(this)('keypress', ...args);\n}\nfunction submit(...args) {\n return eventShortcut.bind(this)('submit', ...args);\n}\nfunction change(...args) {\n return eventShortcut.bind(this)('change', ...args);\n}\nfunction mousedown(...args) {\n return eventShortcut.bind(this)('mousedown', ...args);\n}\nfunction mousemove(...args) {\n return eventShortcut.bind(this)('mousemove', ...args);\n}\nfunction mouseup(...args) {\n return eventShortcut.bind(this)('mouseup', ...args);\n}\nfunction mouseenter(...args) {\n return eventShortcut.bind(this)('mouseenter', ...args);\n}\nfunction mouseleave(...args) {\n return eventShortcut.bind(this)('mouseleave', ...args);\n}\nfunction mouseout(...args) {\n return eventShortcut.bind(this)('mouseout', ...args);\n}\nfunction mouseover(...args) {\n return eventShortcut.bind(this)('mouseover', ...args);\n}\nfunction touchstart(...args) {\n return eventShortcut.bind(this)('touchstart', ...args);\n}\nfunction touchend(...args) {\n return eventShortcut.bind(this)('touchend', ...args);\n}\nfunction touchmove(...args) {\n return eventShortcut.bind(this)('touchmove', ...args);\n}\nfunction resize(...args) {\n return eventShortcut.bind(this)('resize', ...args);\n}\nfunction scroll(...args) {\n return eventShortcut.bind(this)('scroll', ...args);\n}\n\nexport { $, addClass, removeClass, hasClass, toggleClass, attr, removeAttr, prop, data, removeData, dataset, val, transform, transition, on, off, once, trigger, transitionEnd, animationEnd, width, outerWidth, height, outerHeight, offset, hide, show, styles, css, toArray, each, forEach, filter, map, html, text, is, indexOf, index, eq, append, appendTo, prepend, prependTo, insertBefore, insertAfter, next, nextAll, prev, prevAll, siblings, parent, parents, closest, find, children, remove, detach, add, empty, scrollTo, scrollTop, scrollLeft, animate, stop, click, blur, focus, focusin, focusout, keyup, keydown, keypress, submit, change, mousedown, mousemove, mouseup, mouseenter, mouseleave, mouseout, mouseover, touchstart, touchend, touchmove, resize, scroll };\n","import {\n $,\n addClass,\n removeClass,\n hasClass,\n toggleClass,\n attr,\n removeAttr,\n data,\n transform,\n transition,\n on,\n off,\n trigger,\n transitionEnd,\n outerWidth,\n outerHeight,\n offset,\n css,\n each,\n html,\n text,\n is,\n index,\n eq,\n append,\n prepend,\n next,\n nextAll,\n prev,\n prevAll,\n parent,\n parents,\n closest,\n find,\n children,\n filter,\n remove,\n add,\n styles,\n} from 'dom7/dist/dom7.modular';\n\nconst Methods = {\n addClass,\n removeClass,\n hasClass,\n toggleClass,\n attr,\n removeAttr,\n data,\n transform,\n transition,\n on,\n off,\n trigger,\n transitionEnd,\n outerWidth,\n outerHeight,\n offset,\n css,\n each,\n html,\n text,\n is,\n index,\n eq,\n append,\n prepend,\n next,\n nextAll,\n prev,\n prevAll,\n parent,\n parents,\n closest,\n find,\n children,\n filter,\n remove,\n add,\n styles,\n};\n\nObject.keys(Methods).forEach((methodName) => {\n $.fn[methodName] = $.fn[methodName] || Methods[methodName];\n});\n\nexport default $;\n","import { window } from 'ssr-window';\n\nconst Utils = {\n deleteProps(obj) {\n const object = obj;\n Object.keys(object).forEach((key) => {\n try {\n object[key] = null;\n } catch (e) {\n // no getter for object\n }\n try {\n delete object[key];\n } catch (e) {\n // something got wrong\n }\n });\n },\n nextTick(callback, delay = 0) {\n return setTimeout(callback, delay);\n },\n now() {\n return Date.now();\n },\n getTranslate(el, axis = 'x') {\n let matrix;\n let curTransform;\n let transformMatrix;\n\n const curStyle = window.getComputedStyle(el, null);\n\n if (window.WebKitCSSMatrix) {\n curTransform = curStyle.transform || curStyle.webkitTransform;\n if (curTransform.split(',').length > 6) {\n curTransform = curTransform.split(', ').map((a) => a.replace(',', '.')).join(', ');\n }\n // Some old versions of Webkit choke when 'none' is passed; pass\n // empty string instead in this case\n transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);\n } else {\n transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');\n matrix = transformMatrix.toString().split(',');\n }\n\n if (axis === 'x') {\n // Latest Chrome and webkits Fix\n if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41;\n // Crazy IE10 Matrix\n else if (matrix.length === 16) curTransform = parseFloat(matrix[12]);\n // Normal Browsers\n else curTransform = parseFloat(matrix[4]);\n }\n if (axis === 'y') {\n // Latest Chrome and webkits Fix\n if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42;\n // Crazy IE10 Matrix\n else if (matrix.length === 16) curTransform = parseFloat(matrix[13]);\n // Normal Browsers\n else curTransform = parseFloat(matrix[5]);\n }\n return curTransform || 0;\n },\n parseUrlQuery(url) {\n const query = {};\n let urlToParse = url || window.location.href;\n let i;\n let params;\n let param;\n let length;\n if (typeof urlToParse === 'string' && urlToParse.length) {\n urlToParse = urlToParse.indexOf('?') > -1 ? urlToParse.replace(/\\S*\\?/, '') : '';\n params = urlToParse.split('&').filter((paramsPart) => paramsPart !== '');\n length = params.length;\n\n for (i = 0; i < length; i += 1) {\n param = params[i].replace(/#\\S+/g, '').split('=');\n query[decodeURIComponent(param[0])] = typeof param[1] === 'undefined' ? undefined : decodeURIComponent(param[1]) || '';\n }\n }\n return query;\n },\n isObject(o) {\n return typeof o === 'object' && o !== null && o.constructor && o.constructor === Object;\n },\n extend(...args) {\n const to = Object(args[0]);\n for (let i = 1; i < args.length; i += 1) {\n const nextSource = args[i];\n if (nextSource !== undefined && nextSource !== null) {\n const keysArray = Object.keys(Object(nextSource));\n for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {\n const nextKey = keysArray[nextIndex];\n const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);\n if (desc !== undefined && desc.enumerable) {\n if (Utils.isObject(to[nextKey]) && Utils.isObject(nextSource[nextKey])) {\n Utils.extend(to[nextKey], nextSource[nextKey]);\n } else if (!Utils.isObject(to[nextKey]) && Utils.isObject(nextSource[nextKey])) {\n to[nextKey] = {};\n Utils.extend(to[nextKey], nextSource[nextKey]);\n } else {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n }\n }\n return to;\n },\n};\nexport default Utils;\n","import { window, document } from 'ssr-window';\n\nconst Support = (function Support() {\n return {\n touch: (window.Modernizr && window.Modernizr.touch === true) || (function checkTouch() {\n return !!((window.navigator.maxTouchPoints > 0) || ('ontouchstart' in window) || (window.DocumentTouch && document instanceof window.DocumentTouch));\n }()),\n\n pointerEvents: !!window.PointerEvent && ('maxTouchPoints' in window.navigator) && window.navigator.maxTouchPoints > 0,\n\n observer: (function checkObserver() {\n return ('MutationObserver' in window || 'WebkitMutationObserver' in window);\n }()),\n\n passiveListener: (function checkPassiveListener() {\n let supportsPassive = false;\n try {\n const opts = Object.defineProperty({}, 'passive', {\n // eslint-disable-next-line\n get() {\n supportsPassive = true;\n },\n });\n window.addEventListener('testPassiveListener', null, opts);\n } catch (e) {\n // No support\n }\n return supportsPassive;\n }()),\n\n gestures: (function checkGestures() {\n return 'ongesturestart' in window;\n }()),\n };\n}());\n\nexport default Support;\n","import Utils from './utils';\n\nclass SwiperClass {\n constructor(params = {}) {\n const self = this;\n self.params = params;\n\n // Events\n self.eventsListeners = {};\n\n if (self.params && self.params.on) {\n Object.keys(self.params.on).forEach((eventName) => {\n self.on(eventName, self.params.on[eventName]);\n });\n }\n }\n\n on(events, handler, priority) {\n const self = this;\n if (typeof handler !== 'function') return self;\n const method = priority ? 'unshift' : 'push';\n events.split(' ').forEach((event) => {\n if (!self.eventsListeners[event]) self.eventsListeners[event] = [];\n self.eventsListeners[event][method](handler);\n });\n return self;\n }\n\n once(events, handler, priority) {\n const self = this;\n if (typeof handler !== 'function') return self;\n function onceHandler(...args) {\n self.off(events, onceHandler);\n if (onceHandler.f7proxy) {\n delete onceHandler.f7proxy;\n }\n handler.apply(self, args);\n }\n onceHandler.f7proxy = handler;\n return self.on(events, onceHandler, priority);\n }\n\n off(events, handler) {\n const self = this;\n if (!self.eventsListeners) return self;\n events.split(' ').forEach((event) => {\n if (typeof handler === 'undefined') {\n self.eventsListeners[event] = [];\n } else if (self.eventsListeners[event] && self.eventsListeners[event].length) {\n self.eventsListeners[event].forEach((eventHandler, index) => {\n if (eventHandler === handler || (eventHandler.f7proxy && eventHandler.f7proxy === handler)) {\n self.eventsListeners[event].splice(index, 1);\n }\n });\n }\n });\n return self;\n }\n\n emit(...args) {\n const self = this;\n if (!self.eventsListeners) return self;\n let events;\n let data;\n let context;\n if (typeof args[0] === 'string' || Array.isArray(args[0])) {\n events = args[0];\n data = args.slice(1, args.length);\n context = self;\n } else {\n events = args[0].events;\n data = args[0].data;\n context = args[0].context || self;\n }\n const eventsArray = Array.isArray(events) ? events : events.split(' ');\n eventsArray.forEach((event) => {\n if (self.eventsListeners && self.eventsListeners[event]) {\n const handlers = [];\n self.eventsListeners[event].forEach((eventHandler) => {\n handlers.push(eventHandler);\n });\n handlers.forEach((eventHandler) => {\n eventHandler.apply(context, data);\n });\n }\n });\n return self;\n }\n\n useModulesParams(instanceParams) {\n const instance = this;\n if (!instance.modules) return;\n Object.keys(instance.modules).forEach((moduleName) => {\n const module = instance.modules[moduleName];\n // Extend params\n if (module.params) {\n Utils.extend(instanceParams, module.params);\n }\n });\n }\n\n useModules(modulesParams = {}) {\n const instance = this;\n if (!instance.modules) return;\n Object.keys(instance.modules).forEach((moduleName) => {\n const module = instance.modules[moduleName];\n const moduleParams = modulesParams[moduleName] || {};\n // Extend instance methods and props\n if (module.instance) {\n Object.keys(module.instance).forEach((modulePropName) => {\n const moduleProp = module.instance[modulePropName];\n if (typeof moduleProp === 'function') {\n instance[modulePropName] = moduleProp.bind(instance);\n } else {\n instance[modulePropName] = moduleProp;\n }\n });\n }\n // Add event listeners\n if (module.on && instance.on) {\n Object.keys(module.on).forEach((moduleEventName) => {\n instance.on(moduleEventName, module.on[moduleEventName]);\n });\n }\n\n // Module create callback\n if (module.create) {\n module.create.bind(instance)(moduleParams);\n }\n });\n }\n\n static set components(components) {\n const Class = this;\n if (!Class.use) return;\n Class.use(components);\n }\n\n static installModule(module, ...params) {\n const Class = this;\n if (!Class.prototype.modules) Class.prototype.modules = {};\n const name = module.name || (`${Object.keys(Class.prototype.modules).length}_${Utils.now()}`);\n Class.prototype.modules[name] = module;\n // Prototype\n if (module.proto) {\n Object.keys(module.proto).forEach((key) => {\n Class.prototype[key] = module.proto[key];\n });\n }\n // Class\n if (module.static) {\n Object.keys(module.static).forEach((key) => {\n Class[key] = module.static[key];\n });\n }\n // Callback\n if (module.install) {\n module.install.apply(Class, params);\n }\n return Class;\n }\n\n static use(module, ...params) {\n const Class = this;\n if (Array.isArray(module)) {\n module.forEach((m) => Class.installModule(m));\n return Class;\n }\n return Class.installModule(module, ...params);\n }\n}\n\nexport default SwiperClass;\n","import Utils from '../../../utils/utils';\n\nexport default function () {\n const swiper = this;\n let width;\n let height;\n const $el = swiper.$el;\n if (typeof swiper.params.width !== 'undefined') {\n width = swiper.params.width;\n } else {\n width = $el[0].clientWidth;\n }\n if (typeof swiper.params.height !== 'undefined') {\n height = swiper.params.height;\n } else {\n height = $el[0].clientHeight;\n }\n if ((width === 0 && swiper.isHorizontal()) || (height === 0 && swiper.isVertical())) {\n return;\n }\n\n // Subtract paddings\n width = width - parseInt($el.css('padding-left'), 10) - parseInt($el.css('padding-right'), 10);\n height = height - parseInt($el.css('padding-top'), 10) - parseInt($el.css('padding-bottom'), 10);\n\n Utils.extend(swiper, {\n width,\n height,\n size: swiper.isHorizontal() ? width : height,\n });\n}\n","import { window } from 'ssr-window';\nimport Utils from '../../../utils/utils';\n\nexport default function () {\n const swiper = this;\n const params = swiper.params;\n\n const {\n $wrapperEl, size: swiperSize, rtlTranslate: rtl, wrongRTL,\n } = swiper;\n const isVirtual = swiper.virtual && params.virtual.enabled;\n const previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;\n const slides = $wrapperEl.children(`.${swiper.params.slideClass}`);\n const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;\n let snapGrid = [];\n const slidesGrid = [];\n const slidesSizesGrid = [];\n\n function slidesForMargin(slideIndex) {\n if (!params.cssMode) return true;\n if (slideIndex === slides.length - 1) {\n return false;\n }\n return true;\n }\n\n let offsetBefore = params.slidesOffsetBefore;\n if (typeof offsetBefore === 'function') {\n offsetBefore = params.slidesOffsetBefore.call(swiper);\n }\n\n let offsetAfter = params.slidesOffsetAfter;\n if (typeof offsetAfter === 'function') {\n offsetAfter = params.slidesOffsetAfter.call(swiper);\n }\n\n const previousSnapGridLength = swiper.snapGrid.length;\n const previousSlidesGridLength = swiper.snapGrid.length;\n\n let spaceBetween = params.spaceBetween;\n let slidePosition = -offsetBefore;\n let prevSlideSize = 0;\n let index = 0;\n if (typeof swiperSize === 'undefined') {\n return;\n }\n if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {\n spaceBetween = (parseFloat(spaceBetween.replace('%', '')) / 100) * swiperSize;\n }\n\n swiper.virtualSize = -spaceBetween;\n\n // reset margins\n if (rtl) slides.css({ marginLeft: '', marginTop: '' });\n else slides.css({ marginRight: '', marginBottom: '' });\n\n let slidesNumberEvenToRows;\n if (params.slidesPerColumn > 1) {\n if (Math.floor(slidesLength / params.slidesPerColumn) === slidesLength / swiper.params.slidesPerColumn) {\n slidesNumberEvenToRows = slidesLength;\n } else {\n slidesNumberEvenToRows = Math.ceil(slidesLength / params.slidesPerColumn) * params.slidesPerColumn;\n }\n if (params.slidesPerView !== 'auto' && params.slidesPerColumnFill === 'row') {\n slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, params.slidesPerView * params.slidesPerColumn);\n }\n }\n\n // Calc slides\n let slideSize;\n const slidesPerColumn = params.slidesPerColumn;\n const slidesPerRow = slidesNumberEvenToRows / slidesPerColumn;\n const numFullColumns = Math.floor(slidesLength / params.slidesPerColumn);\n for (let i = 0; i < slidesLength; i += 1) {\n slideSize = 0;\n const slide = slides.eq(i);\n if (params.slidesPerColumn > 1) {\n // Set slides order\n let newSlideOrderIndex;\n let column;\n let row;\n if (params.slidesPerColumnFill === 'row' && params.slidesPerGroup > 1) {\n const groupIndex = Math.floor(i / (params.slidesPerGroup * params.slidesPerColumn));\n const slideIndexInGroup = i - params.slidesPerColumn * params.slidesPerGroup * groupIndex;\n const columnsInGroup = groupIndex === 0\n ? params.slidesPerGroup\n : Math.min(Math.ceil((slidesLength - groupIndex * slidesPerColumn * params.slidesPerGroup) / slidesPerColumn), params.slidesPerGroup);\n row = Math.floor(slideIndexInGroup / columnsInGroup);\n column = (slideIndexInGroup - row * columnsInGroup) + groupIndex * params.slidesPerGroup;\n\n newSlideOrderIndex = column + ((row * slidesNumberEvenToRows) / slidesPerColumn);\n slide\n .css({\n '-webkit-box-ordinal-group': newSlideOrderIndex,\n '-moz-box-ordinal-group': newSlideOrderIndex,\n '-ms-flex-order': newSlideOrderIndex,\n '-webkit-order': newSlideOrderIndex,\n order: newSlideOrderIndex,\n });\n } else if (params.slidesPerColumnFill === 'column') {\n column = Math.floor(i / slidesPerColumn);\n row = i - (column * slidesPerColumn);\n if (column > numFullColumns || (column === numFullColumns && row === slidesPerColumn - 1)) {\n row += 1;\n if (row >= slidesPerColumn) {\n row = 0;\n column += 1;\n }\n }\n } else {\n row = Math.floor(i / slidesPerRow);\n column = i - (row * slidesPerRow);\n }\n slide.css(\n `margin-${swiper.isHorizontal() ? 'top' : 'left'}`,\n (row !== 0 && params.spaceBetween) && (`${params.spaceBetween}px`)\n );\n }\n if (slide.css('display') === 'none') continue; // eslint-disable-line\n\n if (params.slidesPerView === 'auto') {\n const slideStyles = window.getComputedStyle(slide[0], null);\n const currentTransform = slide[0].style.transform;\n const currentWebKitTransform = slide[0].style.webkitTransform;\n if (currentTransform) {\n slide[0].style.transform = 'none';\n }\n if (currentWebKitTransform) {\n slide[0].style.webkitTransform = 'none';\n }\n if (params.roundLengths) {\n slideSize = swiper.isHorizontal()\n ? slide.outerWidth(true)\n : slide.outerHeight(true);\n } else {\n // eslint-disable-next-line\n if (swiper.isHorizontal()) {\n const width = parseFloat(slideStyles.getPropertyValue('width'));\n const paddingLeft = parseFloat(slideStyles.getPropertyValue('padding-left'));\n const paddingRight = parseFloat(slideStyles.getPropertyValue('padding-right'));\n const marginLeft = parseFloat(slideStyles.getPropertyValue('margin-left'));\n const marginRight = parseFloat(slideStyles.getPropertyValue('margin-right'));\n const boxSizing = slideStyles.getPropertyValue('box-sizing');\n if (boxSizing && boxSizing === 'border-box') {\n slideSize = width + marginLeft + marginRight;\n } else {\n slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight;\n }\n } else {\n const height = parseFloat(slideStyles.getPropertyValue('height'));\n const paddingTop = parseFloat(slideStyles.getPropertyValue('padding-top'));\n const paddingBottom = parseFloat(slideStyles.getPropertyValue('padding-bottom'));\n const marginTop = parseFloat(slideStyles.getPropertyValue('margin-top'));\n const marginBottom = parseFloat(slideStyles.getPropertyValue('margin-bottom'));\n const boxSizing = slideStyles.getPropertyValue('box-sizing');\n if (boxSizing && boxSizing === 'border-box') {\n slideSize = height + marginTop + marginBottom;\n } else {\n slideSize = height + paddingTop + paddingBottom + marginTop + marginBottom;\n }\n }\n }\n if (currentTransform) {\n slide[0].style.transform = currentTransform;\n }\n if (currentWebKitTransform) {\n slide[0].style.webkitTransform = currentWebKitTransform;\n }\n if (params.roundLengths) slideSize = Math.floor(slideSize);\n } else {\n slideSize = (swiperSize - ((params.slidesPerView - 1) * spaceBetween)) / params.slidesPerView;\n if (params.roundLengths) slideSize = Math.floor(slideSize);\n\n if (slides[i]) {\n if (swiper.isHorizontal()) {\n slides[i].style.width = `${slideSize}px`;\n } else {\n slides[i].style.height = `${slideSize}px`;\n }\n }\n }\n if (slides[i]) {\n slides[i].swiperSlideSize = slideSize;\n }\n slidesSizesGrid.push(slideSize);\n\n\n if (params.centeredSlides) {\n slidePosition = slidePosition + (slideSize / 2) + (prevSlideSize / 2) + spaceBetween;\n if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - (swiperSize / 2) - spaceBetween;\n if (i === 0) slidePosition = slidePosition - (swiperSize / 2) - spaceBetween;\n if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;\n if (params.roundLengths) slidePosition = Math.floor(slidePosition);\n if ((index) % params.slidesPerGroup === 0) snapGrid.push(slidePosition);\n slidesGrid.push(slidePosition);\n } else {\n if (params.roundLengths) slidePosition = Math.floor(slidePosition);\n if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition);\n slidesGrid.push(slidePosition);\n slidePosition = slidePosition + slideSize + spaceBetween;\n }\n\n swiper.virtualSize += slideSize + spaceBetween;\n\n prevSlideSize = slideSize;\n\n index += 1;\n }\n swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter;\n let newSlidesGrid;\n\n if (\n rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) {\n $wrapperEl.css({ width: `${swiper.virtualSize + params.spaceBetween}px` });\n }\n if (params.setWrapperSize) {\n if (swiper.isHorizontal()) $wrapperEl.css({ width: `${swiper.virtualSize + params.spaceBetween}px` });\n else $wrapperEl.css({ height: `${swiper.virtualSize + params.spaceBetween}px` });\n }\n\n if (params.slidesPerColumn > 1) {\n swiper.virtualSize = (slideSize + params.spaceBetween) * slidesNumberEvenToRows;\n swiper.virtualSize = Math.ceil(swiper.virtualSize / params.slidesPerColumn) - params.spaceBetween;\n if (swiper.isHorizontal()) $wrapperEl.css({ width: `${swiper.virtualSize + params.spaceBetween}px` });\n else $wrapperEl.css({ height: `${swiper.virtualSize + params.spaceBetween}px` });\n if (params.centeredSlides) {\n newSlidesGrid = [];\n for (let i = 0; i < snapGrid.length; i += 1) {\n let slidesGridItem = snapGrid[i];\n if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);\n if (snapGrid[i] < swiper.virtualSize + snapGrid[0]) newSlidesGrid.push(slidesGridItem);\n }\n snapGrid = newSlidesGrid;\n }\n }\n\n // Remove last grid elements depending on width\n if (!params.centeredSlides) {\n newSlidesGrid = [];\n for (let i = 0; i < snapGrid.length; i += 1) {\n let slidesGridItem = snapGrid[i];\n if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);\n if (snapGrid[i] <= swiper.virtualSize - swiperSize) {\n newSlidesGrid.push(slidesGridItem);\n }\n }\n snapGrid = newSlidesGrid;\n if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {\n snapGrid.push(swiper.virtualSize - swiperSize);\n }\n }\n if (snapGrid.length === 0) snapGrid = [0];\n\n if (params.spaceBetween !== 0) {\n if (swiper.isHorizontal()) {\n if (rtl) slides.filter(slidesForMargin).css({ marginLeft: `${spaceBetween}px` });\n else slides.filter(slidesForMargin).css({ marginRight: `${spaceBetween}px` });\n } else slides.filter(slidesForMargin).css({ marginBottom: `${spaceBetween}px` });\n }\n\n if (params.centeredSlides && params.centeredSlidesBounds) {\n let allSlidesSize = 0;\n slidesSizesGrid.forEach((slideSizeValue) => {\n allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0);\n });\n allSlidesSize -= params.spaceBetween;\n const maxSnap = allSlidesSize - swiperSize;\n snapGrid = snapGrid.map((snap) => {\n if (snap < 0) return -offsetBefore;\n if (snap > maxSnap) return maxSnap + offsetAfter;\n return snap;\n });\n }\n\n if (params.centerInsufficientSlides) {\n let allSlidesSize = 0;\n slidesSizesGrid.forEach((slideSizeValue) => {\n allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0);\n });\n allSlidesSize -= params.spaceBetween;\n if (allSlidesSize < swiperSize) {\n const allSlidesOffset = (swiperSize - allSlidesSize) / 2;\n snapGrid.forEach((snap, snapIndex) => {\n snapGrid[snapIndex] = snap - allSlidesOffset;\n });\n slidesGrid.forEach((snap, snapIndex) => {\n slidesGrid[snapIndex] = snap + allSlidesOffset;\n });\n }\n }\n\n Utils.extend(swiper, {\n slides,\n snapGrid,\n slidesGrid,\n slidesSizesGrid,\n });\n\n if (slidesLength !== previousSlidesLength) {\n swiper.emit('slidesLengthChange');\n }\n if (snapGrid.length !== previousSnapGridLength) {\n if (swiper.params.watchOverflow) swiper.checkOverflow();\n swiper.emit('snapGridLengthChange');\n }\n if (slidesGrid.length !== previousSlidesGridLength) {\n swiper.emit('slidesGridLengthChange');\n }\n\n if (params.watchSlidesProgress || params.watchSlidesVisibility) {\n swiper.updateSlidesOffset();\n }\n}\n","export default function (speed) {\n const swiper = this;\n const activeSlides = [];\n let newHeight = 0;\n let i;\n if (typeof speed === 'number') {\n swiper.setTransition(speed);\n } else if (speed === true) {\n swiper.setTransition(swiper.params.speed);\n }\n // Find slides currently in view\n if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) {\n if (swiper.params.centeredSlides) activeSlides.push(...swiper.visibleSlides);\n else {\n for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) {\n const index = swiper.activeIndex + i;\n if (index > swiper.slides.length) break;\n activeSlides.push(swiper.slides.eq(index)[0]);\n }\n }\n } else {\n activeSlides.push(swiper.slides.eq(swiper.activeIndex)[0]);\n }\n\n // Find new height from highest slide in view\n for (i = 0; i < activeSlides.length; i += 1) {\n if (typeof activeSlides[i] !== 'undefined') {\n const height = activeSlides[i].offsetHeight;\n newHeight = height > newHeight ? height : newHeight;\n }\n }\n\n // Update Height\n if (newHeight) swiper.$wrapperEl.css('height', `${newHeight}px`);\n}\n","export default function () {\n const swiper = this;\n const slides = swiper.slides;\n for (let i = 0; i < slides.length; i += 1) {\n slides[i].swiperSlideOffset = swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop;\n }\n}\n","import $ from '../../../utils/dom';\n\nexport default function (translate = (this && this.translate) || 0) {\n const swiper = this;\n const params = swiper.params;\n\n const { slides, rtlTranslate: rtl } = swiper;\n\n if (slides.length === 0) return;\n if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();\n\n let offsetCenter = -translate;\n if (rtl) offsetCenter = translate;\n\n // Visible Slides\n slides.removeClass(params.slideVisibleClass);\n\n swiper.visibleSlidesIndexes = [];\n swiper.visibleSlides = [];\n\n for (let i = 0; i < slides.length; i += 1) {\n const slide = slides[i];\n const slideProgress = (\n (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0)) - slide.swiperSlideOffset\n ) / (slide.swiperSlideSize + params.spaceBetween);\n if (params.watchSlidesVisibility || (params.centeredSlides && params.autoHeight)) {\n const slideBefore = -(offsetCenter - slide.swiperSlideOffset);\n const slideAfter = slideBefore + swiper.slidesSizesGrid[i];\n const isVisible = (slideBefore >= 0 && slideBefore < swiper.size - 1)\n || (slideAfter > 1 && slideAfter <= swiper.size)\n || (slideBefore <= 0 && slideAfter >= swiper.size);\n if (isVisible) {\n swiper.visibleSlides.push(slide);\n swiper.visibleSlidesIndexes.push(i);\n slides.eq(i).addClass(params.slideVisibleClass);\n }\n }\n slide.progress = rtl ? -slideProgress : slideProgress;\n }\n swiper.visibleSlides = $(swiper.visibleSlides);\n}\n","import Utils from '../../../utils/utils';\n\nexport default function (translate) {\n const swiper = this;\n if (typeof translate === 'undefined') {\n const multiplier = swiper.rtlTranslate ? -1 : 1;\n // eslint-disable-next-line\n translate = (swiper && swiper.translate && (swiper.translate * multiplier)) || 0;\n }\n const params = swiper.params;\n const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();\n let { progress, isBeginning, isEnd } = swiper;\n const wasBeginning = isBeginning;\n const wasEnd = isEnd;\n if (translatesDiff === 0) {\n progress = 0;\n isBeginning = true;\n isEnd = true;\n } else {\n progress = (translate - swiper.minTranslate()) / (translatesDiff);\n isBeginning = progress <= 0;\n isEnd = progress >= 1;\n }\n Utils.extend(swiper, {\n progress,\n isBeginning,\n isEnd,\n });\n\n if (params.watchSlidesProgress || params.watchSlidesVisibility || (params.centeredSlides && params.autoHeight)) swiper.updateSlidesProgress(translate);\n\n if (isBeginning && !wasBeginning) {\n swiper.emit('reachBeginning toEdge');\n }\n if (isEnd && !wasEnd) {\n swiper.emit('reachEnd toEdge');\n }\n if ((wasBeginning && !isBeginning) || (wasEnd && !isEnd)) {\n swiper.emit('fromEdge');\n }\n\n swiper.emit('progress', progress);\n}\n","export default function () {\n const swiper = this;\n\n const {\n slides, params, $wrapperEl, activeIndex, realIndex,\n } = swiper;\n const isVirtual = swiper.virtual && params.virtual.enabled;\n\n slides.removeClass(`${params.slideActiveClass} ${params.slideNextClass} ${params.slidePrevClass} ${params.slideDuplicateActiveClass} ${params.slideDuplicateNextClass} ${params.slideDuplicatePrevClass}`);\n\n let activeSlide;\n if (isVirtual) {\n activeSlide = swiper.$wrapperEl.find(`.${params.slideClass}[data-swiper-slide-index=\"${activeIndex}\"]`);\n } else {\n activeSlide = slides.eq(activeIndex);\n }\n\n // Active classes\n activeSlide.addClass(params.slideActiveClass);\n\n if (params.loop) {\n // Duplicate to all looped slides\n if (activeSlide.hasClass(params.slideDuplicateClass)) {\n $wrapperEl\n .children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index=\"${realIndex}\"]`)\n .addClass(params.slideDuplicateActiveClass);\n } else {\n $wrapperEl\n .children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index=\"${realIndex}\"]`)\n .addClass(params.slideDuplicateActiveClass);\n }\n }\n // Next Slide\n let nextSlide = activeSlide.nextAll(`.${params.slideClass}`).eq(0).addClass(params.slideNextClass);\n if (params.loop && nextSlide.length === 0) {\n nextSlide = slides.eq(0);\n nextSlide.addClass(params.slideNextClass);\n }\n // Prev Slide\n let prevSlide = activeSlide.prevAll(`.${params.slideClass}`).eq(0).addClass(params.slidePrevClass);\n if (params.loop && prevSlide.length === 0) {\n prevSlide = slides.eq(-1);\n prevSlide.addClass(params.slidePrevClass);\n }\n if (params.loop) {\n // Duplicate to all looped slides\n if (nextSlide.hasClass(params.slideDuplicateClass)) {\n $wrapperEl\n .children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index=\"${nextSlide.attr('data-swiper-slide-index')}\"]`)\n .addClass(params.slideDuplicateNextClass);\n } else {\n $wrapperEl\n .children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index=\"${nextSlide.attr('data-swiper-slide-index')}\"]`)\n .addClass(params.slideDuplicateNextClass);\n }\n if (prevSlide.hasClass(params.slideDuplicateClass)) {\n $wrapperEl\n .children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index=\"${prevSlide.attr('data-swiper-slide-index')}\"]`)\n .addClass(params.slideDuplicatePrevClass);\n } else {\n $wrapperEl\n .children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index=\"${prevSlide.attr('data-swiper-slide-index')}\"]`)\n .addClass(params.slideDuplicatePrevClass);\n }\n }\n}\n","import Utils from '../../../utils/utils';\n\nexport default function (newActiveIndex) {\n const swiper = this;\n const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;\n const {\n slidesGrid, snapGrid, params, activeIndex: previousIndex, realIndex: previousRealIndex, snapIndex: previousSnapIndex,\n } = swiper;\n let activeIndex = newActiveIndex;\n let snapIndex;\n if (typeof activeIndex === 'undefined') {\n for (let i = 0; i < slidesGrid.length; i += 1) {\n if (typeof slidesGrid[i + 1] !== 'undefined') {\n if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - ((slidesGrid[i + 1] - slidesGrid[i]) / 2)) {\n activeIndex = i;\n } else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) {\n activeIndex = i + 1;\n }\n } else if (translate >= slidesGrid[i]) {\n activeIndex = i;\n }\n }\n // Normalize slideIndex\n if (params.normalizeSlideIndex) {\n if (activeIndex < 0 || typeof activeIndex === 'undefined') activeIndex = 0;\n }\n }\n if (snapGrid.indexOf(translate) >= 0) {\n snapIndex = snapGrid.indexOf(translate);\n } else {\n const skip = Math.min(params.slidesPerGroupSkip, activeIndex);\n snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);\n }\n if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;\n if (activeIndex === previousIndex) {\n if (snapIndex !== previousSnapIndex) {\n swiper.snapIndex = snapIndex;\n swiper.emit('snapIndexChange');\n }\n return;\n }\n\n // Get real index\n const realIndex = parseInt(swiper.slides.eq(activeIndex).attr('data-swiper-slide-index') || activeIndex, 10);\n\n Utils.extend(swiper, {\n snapIndex,\n realIndex,\n previousIndex,\n activeIndex,\n });\n swiper.emit('activeIndexChange');\n swiper.emit('snapIndexChange');\n if (previousRealIndex !== realIndex) {\n swiper.emit('realIndexChange');\n }\n if (swiper.initialized || swiper.runCallbacksOnInit) {\n swiper.emit('slideChange');\n }\n}\n","import $ from '../../../utils/dom';\n\nexport default function (e) {\n const swiper = this;\n const params = swiper.params;\n const slide = $(e.target).closest(`.${params.slideClass}`)[0];\n let slideFound = false;\n if (slide) {\n for (let i = 0; i < swiper.slides.length; i += 1) {\n if (swiper.slides[i] === slide) slideFound = true;\n }\n }\n\n if (slide && slideFound) {\n swiper.clickedSlide = slide;\n if (swiper.virtual && swiper.params.virtual.enabled) {\n swiper.clickedIndex = parseInt($(slide).attr('data-swiper-slide-index'), 10);\n } else {\n swiper.clickedIndex = $(slide).index();\n }\n } else {\n swiper.clickedSlide = undefined;\n swiper.clickedIndex = undefined;\n return;\n }\n if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) {\n swiper.slideToClickedSlide();\n }\n}\n","import updateSize from './updateSize';\nimport updateSlides from './updateSlides';\nimport updateAutoHeight from './updateAutoHeight';\nimport updateSlidesOffset from './updateSlidesOffset';\nimport updateSlidesProgress from './updateSlidesProgress';\nimport updateProgress from './updateProgress';\nimport updateSlidesClasses from './updateSlidesClasses';\nimport updateActiveIndex from './updateActiveIndex';\nimport updateClickedSlide from './updateClickedSlide';\n\nexport default {\n updateSize,\n updateSlides,\n updateAutoHeight,\n updateSlidesOffset,\n updateSlidesProgress,\n updateProgress,\n updateSlidesClasses,\n updateActiveIndex,\n updateClickedSlide,\n};\n","import Utils from '../../../utils/utils';\n\nexport default function (axis = this.isHorizontal() ? 'x' : 'y') {\n const swiper = this;\n\n const {\n params, rtlTranslate: rtl, translate, $wrapperEl,\n } = swiper;\n\n if (params.virtualTranslate) {\n return rtl ? -translate : translate;\n }\n if (params.cssMode) {\n return translate;\n }\n\n let currentTranslate = Utils.getTranslate($wrapperEl[0], axis);\n if (rtl) currentTranslate = -currentTranslate;\n\n return currentTranslate || 0;\n}\n","export default function (translate, byController) {\n const swiper = this;\n const {\n rtlTranslate: rtl, params, $wrapperEl, wrapperEl, progress,\n } = swiper;\n let x = 0;\n let y = 0;\n const z = 0;\n\n if (swiper.isHorizontal()) {\n x = rtl ? -translate : translate;\n } else {\n y = translate;\n }\n\n if (params.roundLengths) {\n x = Math.floor(x);\n y = Math.floor(y);\n }\n\n if (params.cssMode) {\n wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y;\n } else if (!params.virtualTranslate) {\n $wrapperEl.transform(`translate3d(${x}px, ${y}px, ${z}px)`);\n }\n swiper.previousTranslate = swiper.translate;\n swiper.translate = swiper.isHorizontal() ? x : y;\n\n // Check if we need to update progress\n let newProgress;\n const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();\n if (translatesDiff === 0) {\n newProgress = 0;\n } else {\n newProgress = (translate - swiper.minTranslate()) / (translatesDiff);\n }\n if (newProgress !== progress) {\n swiper.updateProgress(translate);\n }\n\n swiper.emit('setTranslate', swiper.translate, byController);\n}\n","export default function () {\n return (-this.snapGrid[0]);\n}\n","export default function () {\n return (-this.snapGrid[this.snapGrid.length - 1]);\n}\n","export default function (translate = 0, speed = this.params.speed, runCallbacks = true, translateBounds = true, internal) {\n const swiper = this;\n\n const {\n params,\n wrapperEl,\n } = swiper;\n\n if (swiper.animating && params.preventInteractionOnTransition) {\n return false;\n }\n\n const minTranslate = swiper.minTranslate();\n const maxTranslate = swiper.maxTranslate();\n let newTranslate;\n if (translateBounds && translate > minTranslate) newTranslate = minTranslate;\n else if (translateBounds && translate < maxTranslate) newTranslate = maxTranslate;\n else newTranslate = translate;\n\n // Update progress\n swiper.updateProgress(newTranslate);\n\n if (params.cssMode) {\n const isH = swiper.isHorizontal();\n if (speed === 0) {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;\n } else {\n // eslint-disable-next-line\n if (wrapperEl.scrollTo) {\n wrapperEl.scrollTo({\n [isH ? 'left' : 'top']: -newTranslate,\n behavior: 'smooth',\n });\n } else {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;\n }\n }\n return true;\n }\n\n if (speed === 0) {\n swiper.setTransition(0);\n swiper.setTranslate(newTranslate);\n if (runCallbacks) {\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.emit('transitionEnd');\n }\n } else {\n swiper.setTransition(speed);\n swiper.setTranslate(newTranslate);\n if (runCallbacks) {\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.emit('transitionStart');\n }\n if (!swiper.animating) {\n swiper.animating = true;\n if (!swiper.onTranslateToWrapperTransitionEnd) {\n swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) {\n if (!swiper || swiper.destroyed) return;\n if (e.target !== this) return;\n swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);\n swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd);\n swiper.onTranslateToWrapperTransitionEnd = null;\n delete swiper.onTranslateToWrapperTransitionEnd;\n if (runCallbacks) {\n swiper.emit('transitionEnd');\n }\n };\n }\n swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);\n swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd);\n }\n }\n\n return true;\n}\n","import getTranslate from './getTranslate';\nimport setTranslate from './setTranslate';\nimport minTranslate from './minTranslate';\nimport maxTranslate from './maxTranslate';\nimport translateTo from './translateTo';\n\nexport default {\n getTranslate,\n setTranslate,\n minTranslate,\n maxTranslate,\n translateTo,\n};\n","export default function (duration, byController) {\n const swiper = this;\n\n if (!swiper.params.cssMode) {\n swiper.$wrapperEl.transition(duration);\n }\n\n swiper.emit('setTransition', duration, byController);\n}\n","export default function (runCallbacks = true, direction) {\n const swiper = this;\n const { activeIndex, params, previousIndex } = swiper;\n if (params.cssMode) return;\n if (params.autoHeight) {\n swiper.updateAutoHeight();\n }\n\n let dir = direction;\n if (!dir) {\n if (activeIndex > previousIndex) dir = 'next';\n else if (activeIndex < previousIndex) dir = 'prev';\n else dir = 'reset';\n }\n\n swiper.emit('transitionStart');\n\n if (runCallbacks && activeIndex !== previousIndex) {\n if (dir === 'reset') {\n swiper.emit('slideResetTransitionStart');\n return;\n }\n swiper.emit('slideChangeTransitionStart');\n if (dir === 'next') {\n swiper.emit('slideNextTransitionStart');\n } else {\n swiper.emit('slidePrevTransitionStart');\n }\n }\n}\n","export default function (runCallbacks = true, direction) {\n const swiper = this;\n const { activeIndex, previousIndex, params } = swiper;\n swiper.animating = false;\n if (params.cssMode) return;\n swiper.setTransition(0);\n\n let dir = direction;\n if (!dir) {\n if (activeIndex > previousIndex) dir = 'next';\n else if (activeIndex < previousIndex) dir = 'prev';\n else dir = 'reset';\n }\n\n swiper.emit('transitionEnd');\n\n if (runCallbacks && activeIndex !== previousIndex) {\n if (dir === 'reset') {\n swiper.emit('slideResetTransitionEnd');\n return;\n }\n swiper.emit('slideChangeTransitionEnd');\n if (dir === 'next') {\n swiper.emit('slideNextTransitionEnd');\n } else {\n swiper.emit('slidePrevTransitionEnd');\n }\n }\n}\n","import setTransition from './setTransition';\nimport transitionStart from './transitionStart';\nimport transitionEnd from './transitionEnd';\n\nexport default {\n setTransition,\n transitionStart,\n transitionEnd,\n};\n","export default function (index = 0, speed = this.params.speed, runCallbacks = true, internal) {\n const swiper = this;\n let slideIndex = index;\n if (slideIndex < 0) slideIndex = 0;\n\n const {\n params, snapGrid, slidesGrid, previousIndex, activeIndex, rtlTranslate: rtl, wrapperEl,\n } = swiper;\n if (swiper.animating && params.preventInteractionOnTransition) {\n return false;\n }\n\n const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);\n let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);\n if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;\n\n if ((activeIndex || params.initialSlide || 0) === (previousIndex || 0) && runCallbacks) {\n swiper.emit('beforeSlideChangeStart');\n }\n\n const translate = -snapGrid[snapIndex];\n\n // Update progress\n swiper.updateProgress(translate);\n\n // Normalize slideIndex\n if (params.normalizeSlideIndex) {\n for (let i = 0; i < slidesGrid.length; i += 1) {\n if (-Math.floor(translate * 100) >= Math.floor(slidesGrid[i] * 100)) {\n slideIndex = i;\n }\n }\n }\n // Directions locks\n if (swiper.initialized && slideIndex !== activeIndex) {\n if (!swiper.allowSlideNext && translate < swiper.translate && translate < swiper.minTranslate()) {\n return false;\n }\n if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) {\n if ((activeIndex || 0) !== slideIndex) return false;\n }\n }\n\n let direction;\n if (slideIndex > activeIndex) direction = 'next';\n else if (slideIndex < activeIndex) direction = 'prev';\n else direction = 'reset';\n\n\n // Update Index\n if ((rtl && -translate === swiper.translate) || (!rtl && translate === swiper.translate)) {\n swiper.updateActiveIndex(slideIndex);\n // Update Height\n if (params.autoHeight) {\n swiper.updateAutoHeight();\n }\n swiper.updateSlidesClasses();\n if (params.effect !== 'slide') {\n swiper.setTranslate(translate);\n }\n if (direction !== 'reset') {\n swiper.transitionStart(runCallbacks, direction);\n swiper.transitionEnd(runCallbacks, direction);\n }\n return false;\n }\n if (params.cssMode) {\n const isH = swiper.isHorizontal();\n if (speed === 0) {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -translate;\n } else {\n // eslint-disable-next-line\n if (wrapperEl.scrollTo) {\n wrapperEl.scrollTo({\n [isH ? 'left' : 'top']: -translate,\n behavior: 'smooth',\n });\n } else {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -translate;\n }\n }\n return true;\n }\n\n if (speed === 0) {\n swiper.setTransition(0);\n swiper.setTranslate(translate);\n swiper.updateActiveIndex(slideIndex);\n swiper.updateSlidesClasses();\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.transitionStart(runCallbacks, direction);\n swiper.transitionEnd(runCallbacks, direction);\n } else {\n swiper.setTransition(speed);\n swiper.setTranslate(translate);\n swiper.updateActiveIndex(slideIndex);\n swiper.updateSlidesClasses();\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.transitionStart(runCallbacks, direction);\n if (!swiper.animating) {\n swiper.animating = true;\n if (!swiper.onSlideToWrapperTransitionEnd) {\n swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) {\n if (!swiper || swiper.destroyed) return;\n if (e.target !== this) return;\n swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);\n swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);\n swiper.onSlideToWrapperTransitionEnd = null;\n delete swiper.onSlideToWrapperTransitionEnd;\n swiper.transitionEnd(runCallbacks, direction);\n };\n }\n swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);\n swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);\n }\n }\n\n return true;\n}\n","export default function (index = 0, speed = this.params.speed, runCallbacks = true, internal) {\n const swiper = this;\n let newIndex = index;\n if (swiper.params.loop) {\n newIndex += swiper.loopedSlides;\n }\n\n return swiper.slideTo(newIndex, speed, runCallbacks, internal);\n}\n","/* eslint no-unused-vars: \"off\" */\nexport default function (speed = this.params.speed, runCallbacks = true, internal) {\n const swiper = this;\n const { params, animating } = swiper;\n const increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup;\n if (params.loop) {\n if (animating) return false;\n swiper.loopFix();\n // eslint-disable-next-line\n swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;\n }\n return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);\n}\n","/* eslint no-unused-vars: \"off\" */\nexport default function (speed = this.params.speed, runCallbacks = true, internal) {\n const swiper = this;\n const {\n params, animating, snapGrid, slidesGrid, rtlTranslate,\n } = swiper;\n\n if (params.loop) {\n if (animating) return false;\n swiper.loopFix();\n // eslint-disable-next-line\n swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;\n }\n const translate = rtlTranslate ? swiper.translate : -swiper.translate;\n function normalize(val) {\n if (val < 0) return -Math.floor(Math.abs(val));\n return Math.floor(val);\n }\n const normalizedTranslate = normalize(translate);\n const normalizedSnapGrid = snapGrid.map((val) => normalize(val));\n const normalizedSlidesGrid = slidesGrid.map((val) => normalize(val));\n\n const currentSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate)];\n let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];\n if (typeof prevSnap === 'undefined' && params.cssMode) {\n snapGrid.forEach((snap) => {\n if (!prevSnap && normalizedTranslate >= snap) prevSnap = snap;\n });\n }\n let prevIndex;\n if (typeof prevSnap !== 'undefined') {\n prevIndex = slidesGrid.indexOf(prevSnap);\n if (prevIndex < 0) prevIndex = swiper.activeIndex - 1;\n }\n return swiper.slideTo(prevIndex, speed, runCallbacks, internal);\n}\n","/* eslint no-unused-vars: \"off\" */\nexport default function (speed = this.params.speed, runCallbacks = true, internal) {\n const swiper = this;\n return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);\n}\n","/* eslint no-unused-vars: \"off\" */\nexport default function (speed = this.params.speed, runCallbacks = true, internal, threshold = 0.5) {\n const swiper = this;\n let index = swiper.activeIndex;\n const skip = Math.min(swiper.params.slidesPerGroupSkip, index);\n const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);\n\n const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;\n\n if (translate >= swiper.snapGrid[snapIndex]) {\n // The current translate is on or after the current snap index, so the choice\n // is between the current index and the one after it.\n const currentSnap = swiper.snapGrid[snapIndex];\n const nextSnap = swiper.snapGrid[snapIndex + 1];\n if ((translate - currentSnap) > (nextSnap - currentSnap) * threshold) {\n index += swiper.params.slidesPerGroup;\n }\n } else {\n // The current translate is before the current snap index, so the choice\n // is between the current index and the one before it.\n const prevSnap = swiper.snapGrid[snapIndex - 1];\n const currentSnap = swiper.snapGrid[snapIndex];\n if ((translate - prevSnap) <= (currentSnap - prevSnap) * threshold) {\n index -= swiper.params.slidesPerGroup;\n }\n }\n index = Math.max(index, 0);\n index = Math.min(index, swiper.slidesGrid.length - 1);\n\n return swiper.slideTo(index, speed, runCallbacks, internal);\n}\n","import $ from '../../../utils/dom';\nimport Utils from '../../../utils/utils';\n\nexport default function () {\n const swiper = this;\n const { params, $wrapperEl } = swiper;\n\n const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;\n let slideToIndex = swiper.clickedIndex;\n let realIndex;\n if (params.loop) {\n if (swiper.animating) return;\n realIndex = parseInt($(swiper.clickedSlide).attr('data-swiper-slide-index'), 10);\n if (params.centeredSlides) {\n if (\n (slideToIndex < swiper.loopedSlides - (slidesPerView / 2))\n || (slideToIndex > (swiper.slides.length - swiper.loopedSlides) + (slidesPerView / 2))\n ) {\n swiper.loopFix();\n slideToIndex = $wrapperEl\n .children(`.${params.slideClass}[data-swiper-slide-index=\"${realIndex}\"]:not(.${params.slideDuplicateClass})`)\n .eq(0)\n .index();\n\n Utils.nextTick(() => {\n swiper.slideTo(slideToIndex);\n });\n } else {\n swiper.slideTo(slideToIndex);\n }\n } else if (slideToIndex > swiper.slides.length - slidesPerView) {\n swiper.loopFix();\n slideToIndex = $wrapperEl\n .children(`.${params.slideClass}[data-swiper-slide-index=\"${realIndex}\"]:not(.${params.slideDuplicateClass})`)\n .eq(0)\n .index();\n\n Utils.nextTick(() => {\n swiper.slideTo(slideToIndex);\n });\n } else {\n swiper.slideTo(slideToIndex);\n }\n } else {\n swiper.slideTo(slideToIndex);\n }\n}\n","import slideTo from './slideTo';\nimport slideToLoop from './slideToLoop';\nimport slideNext from './slideNext';\nimport slidePrev from './slidePrev';\nimport slideReset from './slideReset';\nimport slideToClosest from './slideToClosest';\nimport slideToClickedSlide from './slideToClickedSlide';\n\nexport default {\n slideTo,\n slideToLoop,\n slideNext,\n slidePrev,\n slideReset,\n slideToClosest,\n slideToClickedSlide,\n};\n","import { document } from 'ssr-window';\nimport $ from '../../../utils/dom';\n\nexport default function () {\n const swiper = this;\n const { params, $wrapperEl } = swiper;\n // Remove duplicated slides\n $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}`).remove();\n\n let slides = $wrapperEl.children(`.${params.slideClass}`);\n\n if (params.loopFillGroupWithBlank) {\n const blankSlidesNum = params.slidesPerGroup - (slides.length % params.slidesPerGroup);\n if (blankSlidesNum !== params.slidesPerGroup) {\n for (let i = 0; i < blankSlidesNum; i += 1) {\n const blankNode = $(document.createElement('div')).addClass(`${params.slideClass} ${params.slideBlankClass}`);\n $wrapperEl.append(blankNode);\n }\n slides = $wrapperEl.children(`.${params.slideClass}`);\n }\n }\n\n if (params.slidesPerView === 'auto' && !params.loopedSlides) params.loopedSlides = slides.length;\n\n swiper.loopedSlides = Math.ceil(parseFloat(params.loopedSlides || params.slidesPerView, 10));\n swiper.loopedSlides += params.loopAdditionalSlides;\n if (swiper.loopedSlides > slides.length) {\n swiper.loopedSlides = slides.length;\n }\n\n const prependSlides = [];\n const appendSlides = [];\n slides.each((index, el) => {\n const slide = $(el);\n if (index < swiper.loopedSlides) appendSlides.push(el);\n if (index < slides.length && index >= slides.length - swiper.loopedSlides) prependSlides.push(el);\n slide.attr('data-swiper-slide-index', index);\n });\n for (let i = 0; i < appendSlides.length; i += 1) {\n $wrapperEl.append($(appendSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass));\n }\n for (let i = prependSlides.length - 1; i >= 0; i -= 1) {\n $wrapperEl.prepend($(prependSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass));\n }\n}\n","export default function () {\n const swiper = this;\n\n swiper.emit('beforeLoopFix');\n\n const {\n activeIndex, slides, loopedSlides, allowSlidePrev, allowSlideNext, snapGrid, rtlTranslate: rtl,\n } = swiper;\n let newIndex;\n swiper.allowSlidePrev = true;\n swiper.allowSlideNext = true;\n\n const snapTranslate = -snapGrid[activeIndex];\n const diff = snapTranslate - swiper.getTranslate();\n\n // Fix For Negative Oversliding\n if (activeIndex < loopedSlides) {\n newIndex = (slides.length - (loopedSlides * 3)) + activeIndex;\n newIndex += loopedSlides;\n const slideChanged = swiper.slideTo(newIndex, 0, false, true);\n if (slideChanged && diff !== 0) {\n swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);\n }\n } else if (activeIndex >= slides.length - loopedSlides) {\n // Fix For Positive Oversliding\n newIndex = -slides.length + activeIndex + loopedSlides;\n newIndex += loopedSlides;\n const slideChanged = swiper.slideTo(newIndex, 0, false, true);\n if (slideChanged && diff !== 0) {\n swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);\n }\n }\n swiper.allowSlidePrev = allowSlidePrev;\n swiper.allowSlideNext = allowSlideNext;\n\n swiper.emit('loopFix');\n}\n","export default function () {\n const swiper = this;\n const { $wrapperEl, params, slides } = swiper;\n $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass},.${params.slideClass}.${params.slideBlankClass}`).remove();\n slides.removeAttr('data-swiper-slide-index');\n}\n","import loopCreate from './loopCreate';\nimport loopFix from './loopFix';\nimport loopDestroy from './loopDestroy';\n\nexport default {\n loopCreate,\n loopFix,\n loopDestroy,\n};\n","import Support from '../../../utils/support';\n\nexport default function (moving) {\n const swiper = this;\n if (Support.touch || !swiper.params.simulateTouch || (swiper.params.watchOverflow && swiper.isLocked) || swiper.params.cssMode) return;\n const el = swiper.el;\n el.style.cursor = 'move';\n el.style.cursor = moving ? '-webkit-grabbing' : '-webkit-grab';\n el.style.cursor = moving ? '-moz-grabbin' : '-moz-grab';\n el.style.cursor = moving ? 'grabbing' : 'grab';\n}\n","import Support from '../../../utils/support';\n\nexport default function () {\n const swiper = this;\n if (Support.touch || (swiper.params.watchOverflow && swiper.isLocked) || swiper.params.cssMode) return;\n swiper.el.style.cursor = '';\n}\n","import setGrabCursor from './setGrabCursor';\nimport unsetGrabCursor from './unsetGrabCursor';\n\nexport default {\n setGrabCursor,\n unsetGrabCursor,\n};\n","import Support from '../../../utils/support';\n\nexport default function (slides) {\n const swiper = this;\n const { $wrapperEl, params } = swiper;\n if (params.loop) {\n swiper.loopDestroy();\n }\n if (typeof slides === 'object' && 'length' in slides) {\n for (let i = 0; i < slides.length; i += 1) {\n if (slides[i]) $wrapperEl.append(slides[i]);\n }\n } else {\n $wrapperEl.append(slides);\n }\n if (params.loop) {\n swiper.loopCreate();\n }\n if (!(params.observer && Support.observer)) {\n swiper.update();\n }\n}\n","import Support from '../../../utils/support';\n\nexport default function (slides) {\n const swiper = this;\n const { params, $wrapperEl, activeIndex } = swiper;\n\n if (params.loop) {\n swiper.loopDestroy();\n }\n let newActiveIndex = activeIndex + 1;\n if (typeof slides === 'object' && 'length' in slides) {\n for (let i = 0; i < slides.length; i += 1) {\n if (slides[i]) $wrapperEl.prepend(slides[i]);\n }\n newActiveIndex = activeIndex + slides.length;\n } else {\n $wrapperEl.prepend(slides);\n }\n if (params.loop) {\n swiper.loopCreate();\n }\n if (!(params.observer && Support.observer)) {\n swiper.update();\n }\n swiper.slideTo(newActiveIndex, 0, false);\n}\n","import Support from '../../../utils/support';\n\nexport default function (index, slides) {\n const swiper = this;\n const { $wrapperEl, params, activeIndex } = swiper;\n let activeIndexBuffer = activeIndex;\n if (params.loop) {\n activeIndexBuffer -= swiper.loopedSlides;\n swiper.loopDestroy();\n swiper.slides = $wrapperEl.children(`.${params.slideClass}`);\n }\n const baseLength = swiper.slides.length;\n if (index <= 0) {\n swiper.prependSlide(slides);\n return;\n }\n if (index >= baseLength) {\n swiper.appendSlide(slides);\n return;\n }\n let newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + 1 : activeIndexBuffer;\n\n const slidesBuffer = [];\n for (let i = baseLength - 1; i >= index; i -= 1) {\n const currentSlide = swiper.slides.eq(i);\n currentSlide.remove();\n slidesBuffer.unshift(currentSlide);\n }\n\n if (typeof slides === 'object' && 'length' in slides) {\n for (let i = 0; i < slides.length; i += 1) {\n if (slides[i]) $wrapperEl.append(slides[i]);\n }\n newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + slides.length : activeIndexBuffer;\n } else {\n $wrapperEl.append(slides);\n }\n\n for (let i = 0; i < slidesBuffer.length; i += 1) {\n $wrapperEl.append(slidesBuffer[i]);\n }\n\n if (params.loop) {\n swiper.loopCreate();\n }\n if (!(params.observer && Support.observer)) {\n swiper.update();\n }\n if (params.loop) {\n swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);\n } else {\n swiper.slideTo(newActiveIndex, 0, false);\n }\n}\n","import Support from '../../../utils/support';\n\nexport default function (slidesIndexes) {\n const swiper = this;\n const { params, $wrapperEl, activeIndex } = swiper;\n\n let activeIndexBuffer = activeIndex;\n if (params.loop) {\n activeIndexBuffer -= swiper.loopedSlides;\n swiper.loopDestroy();\n swiper.slides = $wrapperEl.children(`.${params.slideClass}`);\n }\n let newActiveIndex = activeIndexBuffer;\n let indexToRemove;\n\n if (typeof slidesIndexes === 'object' && 'length' in slidesIndexes) {\n for (let i = 0; i < slidesIndexes.length; i += 1) {\n indexToRemove = slidesIndexes[i];\n if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove();\n if (indexToRemove < newActiveIndex) newActiveIndex -= 1;\n }\n newActiveIndex = Math.max(newActiveIndex, 0);\n } else {\n indexToRemove = slidesIndexes;\n if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove();\n if (indexToRemove < newActiveIndex) newActiveIndex -= 1;\n newActiveIndex = Math.max(newActiveIndex, 0);\n }\n\n if (params.loop) {\n swiper.loopCreate();\n }\n\n if (!(params.observer && Support.observer)) {\n swiper.update();\n }\n if (params.loop) {\n swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);\n } else {\n swiper.slideTo(newActiveIndex, 0, false);\n }\n}\n","export default function () {\n const swiper = this;\n\n const slidesIndexes = [];\n for (let i = 0; i < swiper.slides.length; i += 1) {\n slidesIndexes.push(i);\n }\n swiper.removeSlide(slidesIndexes);\n}\n","import appendSlide from './appendSlide';\nimport prependSlide from './prependSlide';\nimport addSlide from './addSlide';\nimport removeSlide from './removeSlide';\nimport removeAllSlides from './removeAllSlides';\n\nexport default {\n appendSlide,\n prependSlide,\n addSlide,\n removeSlide,\n removeAllSlides,\n};\n","import { window } from 'ssr-window';\nimport Support from './support';\n\nconst Device = (function Device() {\n const platform = window.navigator.platform;\n const ua = window.navigator.userAgent;\n\n const device = {\n ios: false,\n android: false,\n androidChrome: false,\n desktop: false,\n iphone: false,\n ipod: false,\n ipad: false,\n edge: false,\n ie: false,\n firefox: false,\n macos: false,\n windows: false,\n cordova: !!(window.cordova || window.phonegap),\n phonegap: !!(window.cordova || window.phonegap),\n electron: false,\n };\n\n const screenWidth = window.screen.width;\n const screenHeight = window.screen.height;\n\n const android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/); // eslint-disable-line\n let ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n const ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n const iphone = !ipad && ua.match(/(iPhone\\sOS|iOS)\\s([\\d_]+)/);\n const ie = ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\n const edge = ua.indexOf('Edge/') >= 0;\n const firefox = ua.indexOf('Gecko/') >= 0 && ua.indexOf('Firefox/') >= 0;\n const windows = platform === 'Win32';\n const electron = ua.toLowerCase().indexOf('electron') >= 0;\n let macos = platform === 'MacIntel';\n\n // iPadOs 13 fix\n if (!ipad\n && macos\n && Support.touch\n && (\n (screenWidth === 1024 && screenHeight === 1366) // Pro 12.9\n || (screenWidth === 834 && screenHeight === 1194) // Pro 11\n || (screenWidth === 834 && screenHeight === 1112) // Pro 10.5\n || (screenWidth === 768 && screenHeight === 1024) // other\n )\n ) {\n ipad = ua.match(/(Version)\\/([\\d.]+)/);\n macos = false;\n }\n\n device.ie = ie;\n device.edge = edge;\n device.firefox = firefox;\n\n // Android\n if (android && !windows) {\n device.os = 'android';\n device.osVersion = android[2];\n device.android = true;\n device.androidChrome = ua.toLowerCase().indexOf('chrome') >= 0;\n }\n if (ipad || iphone || ipod) {\n device.os = 'ios';\n device.ios = true;\n }\n // iOS\n if (iphone && !ipod) {\n device.osVersion = iphone[2].replace(/_/g, '.');\n device.iphone = true;\n }\n if (ipad) {\n device.osVersion = ipad[2].replace(/_/g, '.');\n device.ipad = true;\n }\n if (ipod) {\n device.osVersion = ipod[3] ? ipod[3].replace(/_/g, '.') : null;\n device.ipod = true;\n }\n // iOS 8+ changed UA\n if (device.ios && device.osVersion && ua.indexOf('Version/') >= 0) {\n if (device.osVersion.split('.')[0] === '10') {\n device.osVersion = ua.toLowerCase().split('version/')[1].split(' ')[0];\n }\n }\n\n // Webview\n device.webView = !!((iphone || ipad || ipod) && (ua.match(/.*AppleWebKit(?!.*Safari)/i) || window.navigator.standalone))\n || (window.matchMedia && window.matchMedia('(display-mode: standalone)').matches);\n device.webview = device.webView;\n device.standalone = device.webView;\n\n // Desktop\n device.desktop = !(device.ios || device.android) || electron;\n if (device.desktop) {\n device.electron = electron;\n device.macos = macos;\n device.windows = windows;\n if (device.macos) {\n device.os = 'macos';\n }\n if (device.windows) {\n device.os = 'windows';\n }\n }\n\n // Pixel Ratio\n device.pixelRatio = window.devicePixelRatio || 1;\n\n // Export object\n return device;\n}());\n\nexport default Device;\n","import { window, document } from 'ssr-window';\nimport $ from '../../../utils/dom';\nimport Utils from '../../../utils/utils';\n\nexport default function (event) {\n const swiper = this;\n const data = swiper.touchEventsData;\n const { params, touches } = swiper;\n\n if (swiper.animating && params.preventInteractionOnTransition) {\n return;\n }\n let e = event;\n if (e.originalEvent) e = e.originalEvent;\n const $targetEl = $(e.target);\n\n if (params.touchEventsTarget === 'wrapper') {\n if (!$targetEl.closest(swiper.wrapperEl).length) return;\n }\n data.isTouchEvent = e.type === 'touchstart';\n if (!data.isTouchEvent && 'which' in e && e.which === 3) return;\n if (!data.isTouchEvent && 'button' in e && e.button > 0) return;\n if (data.isTouched && data.isMoved) return;\n if (params.noSwiping && $targetEl.closest(params.noSwipingSelector ? params.noSwipingSelector : `.${params.noSwipingClass}`)[0]) {\n swiper.allowClick = true;\n return;\n }\n if (params.swipeHandler) {\n if (!$targetEl.closest(params.swipeHandler)[0]) return;\n }\n\n touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;\n touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;\n const startX = touches.currentX;\n const startY = touches.currentY;\n\n // Do NOT start if iOS edge swipe is detected. Otherwise iOS app (UIWebView) cannot swipe-to-go-back anymore\n\n const edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;\n const edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;\n if (\n edgeSwipeDetection\n && ((startX <= edgeSwipeThreshold)\n || (startX >= window.screen.width - edgeSwipeThreshold))\n ) {\n return;\n }\n\n Utils.extend(data, {\n isTouched: true,\n isMoved: false,\n allowTouchCallbacks: true,\n isScrolling: undefined,\n startMoving: undefined,\n });\n\n touches.startX = startX;\n touches.startY = startY;\n data.touchStartTime = Utils.now();\n swiper.allowClick = true;\n swiper.updateSize();\n swiper.swipeDirection = undefined;\n if (params.threshold > 0) data.allowThresholdMove = false;\n if (e.type !== 'touchstart') {\n let preventDefault = true;\n if ($targetEl.is(data.formElements)) preventDefault = false;\n if (\n document.activeElement\n && $(document.activeElement).is(data.formElements)\n && document.activeElement !== $targetEl[0]\n ) {\n document.activeElement.blur();\n }\n\n const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;\n if (params.touchStartForcePreventDefault || shouldPreventDefault) {\n e.preventDefault();\n }\n }\n swiper.emit('touchStart', e);\n}\n","import { document } from 'ssr-window';\nimport $ from '../../../utils/dom';\nimport Utils from '../../../utils/utils';\n\nexport default function (event) {\n const swiper = this;\n const data = swiper.touchEventsData;\n const { params, touches, rtlTranslate: rtl } = swiper;\n let e = event;\n if (e.originalEvent) e = e.originalEvent;\n if (!data.isTouched) {\n if (data.startMoving && data.isScrolling) {\n swiper.emit('touchMoveOpposite', e);\n }\n return;\n }\n if (data.isTouchEvent && e.type === 'mousemove') return;\n const targetTouch = e.type === 'touchmove' && e.targetTouches && (e.targetTouches[0] || e.changedTouches[0]);\n const pageX = e.type === 'touchmove' ? targetTouch.pageX : e.pageX;\n const pageY = e.type === 'touchmove' ? targetTouch.pageY : e.pageY;\n if (e.preventedByNestedSwiper) {\n touches.startX = pageX;\n touches.startY = pageY;\n return;\n }\n if (!swiper.allowTouchMove) {\n // isMoved = true;\n swiper.allowClick = false;\n if (data.isTouched) {\n Utils.extend(touches, {\n startX: pageX,\n startY: pageY,\n currentX: pageX,\n currentY: pageY,\n });\n data.touchStartTime = Utils.now();\n }\n return;\n }\n if (data.isTouchEvent && params.touchReleaseOnEdges && !params.loop) {\n if (swiper.isVertical()) {\n // Vertical\n if (\n (pageY < touches.startY && swiper.translate <= swiper.maxTranslate())\n || (pageY > touches.startY && swiper.translate >= swiper.minTranslate())\n ) {\n data.isTouched = false;\n data.isMoved = false;\n return;\n }\n } else if (\n (pageX < touches.startX && swiper.translate <= swiper.maxTranslate())\n || (pageX > touches.startX && swiper.translate >= swiper.minTranslate())\n ) {\n return;\n }\n }\n if (data.isTouchEvent && document.activeElement) {\n if (e.target === document.activeElement && $(e.target).is(data.formElements)) {\n data.isMoved = true;\n swiper.allowClick = false;\n return;\n }\n }\n if (data.allowTouchCallbacks) {\n swiper.emit('touchMove', e);\n }\n if (e.targetTouches && e.targetTouches.length > 1) return;\n\n touches.currentX = pageX;\n touches.currentY = pageY;\n\n const diffX = touches.currentX - touches.startX;\n const diffY = touches.currentY - touches.startY;\n if (swiper.params.threshold && Math.sqrt((diffX ** 2) + (diffY ** 2)) < swiper.params.threshold) return;\n\n if (typeof data.isScrolling === 'undefined') {\n let touchAngle;\n if ((swiper.isHorizontal() && touches.currentY === touches.startY) || (swiper.isVertical() && touches.currentX === touches.startX)) {\n data.isScrolling = false;\n } else {\n // eslint-disable-next-line\n if ((diffX * diffX) + (diffY * diffY) >= 25) {\n touchAngle = (Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180) / Math.PI;\n data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : (90 - touchAngle > params.touchAngle);\n }\n }\n }\n if (data.isScrolling) {\n swiper.emit('touchMoveOpposite', e);\n }\n if (typeof data.startMoving === 'undefined') {\n if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {\n data.startMoving = true;\n }\n }\n if (data.isScrolling) {\n data.isTouched = false;\n return;\n }\n if (!data.startMoving) {\n return;\n }\n swiper.allowClick = false;\n if (!params.cssMode) {\n e.preventDefault();\n }\n if (params.touchMoveStopPropagation && !params.nested) {\n e.stopPropagation();\n }\n\n if (!data.isMoved) {\n if (params.loop) {\n swiper.loopFix();\n }\n data.startTranslate = swiper.getTranslate();\n swiper.setTransition(0);\n if (swiper.animating) {\n swiper.$wrapperEl.trigger('webkitTransitionEnd transitionend');\n }\n data.allowMomentumBounce = false;\n // Grab Cursor\n if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {\n swiper.setGrabCursor(true);\n }\n swiper.emit('sliderFirstMove', e);\n }\n swiper.emit('sliderMove', e);\n data.isMoved = true;\n\n let diff = swiper.isHorizontal() ? diffX : diffY;\n touches.diff = diff;\n\n diff *= params.touchRatio;\n if (rtl) diff = -diff;\n\n swiper.swipeDirection = diff > 0 ? 'prev' : 'next';\n data.currentTranslate = diff + data.startTranslate;\n\n let disableParentSwiper = true;\n let resistanceRatio = params.resistanceRatio;\n if (params.touchReleaseOnEdges) {\n resistanceRatio = 0;\n }\n if ((diff > 0 && data.currentTranslate > swiper.minTranslate())) {\n disableParentSwiper = false;\n if (params.resistance) data.currentTranslate = (swiper.minTranslate() - 1) + ((-swiper.minTranslate() + data.startTranslate + diff) ** resistanceRatio);\n } else if (diff < 0 && data.currentTranslate < swiper.maxTranslate()) {\n disableParentSwiper = false;\n if (params.resistance) data.currentTranslate = (swiper.maxTranslate() + 1) - ((swiper.maxTranslate() - data.startTranslate - diff) ** resistanceRatio);\n }\n\n if (disableParentSwiper) {\n e.preventedByNestedSwiper = true;\n }\n\n // Directions locks\n if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) {\n data.currentTranslate = data.startTranslate;\n }\n if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) {\n data.currentTranslate = data.startTranslate;\n }\n\n\n // Threshold\n if (params.threshold > 0) {\n if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {\n if (!data.allowThresholdMove) {\n data.allowThresholdMove = true;\n touches.startX = touches.currentX;\n touches.startY = touches.currentY;\n data.currentTranslate = data.startTranslate;\n touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY;\n return;\n }\n } else {\n data.currentTranslate = data.startTranslate;\n return;\n }\n }\n\n if (!params.followFinger || params.cssMode) return;\n\n // Update active index in free mode\n if (params.freeMode || params.watchSlidesProgress || params.watchSlidesVisibility) {\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n }\n if (params.freeMode) {\n // Velocity\n if (data.velocities.length === 0) {\n data.velocities.push({\n position: touches[swiper.isHorizontal() ? 'startX' : 'startY'],\n time: data.touchStartTime,\n });\n }\n data.velocities.push({\n position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'],\n time: Utils.now(),\n });\n }\n // Update progress\n swiper.updateProgress(data.currentTranslate);\n // Update translate\n swiper.setTranslate(data.currentTranslate);\n}\n","import Utils from '../../../utils/utils';\n\nexport default function (event) {\n const swiper = this;\n const data = swiper.touchEventsData;\n\n const {\n params, touches, rtlTranslate: rtl, $wrapperEl, slidesGrid, snapGrid,\n } = swiper;\n let e = event;\n if (e.originalEvent) e = e.originalEvent;\n if (data.allowTouchCallbacks) {\n swiper.emit('touchEnd', e);\n }\n data.allowTouchCallbacks = false;\n if (!data.isTouched) {\n if (data.isMoved && params.grabCursor) {\n swiper.setGrabCursor(false);\n }\n data.isMoved = false;\n data.startMoving = false;\n return;\n }\n // Return Grab Cursor\n if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {\n swiper.setGrabCursor(false);\n }\n\n // Time diff\n const touchEndTime = Utils.now();\n const timeDiff = touchEndTime - data.touchStartTime;\n\n // Tap, doubleTap, Click\n if (swiper.allowClick) {\n swiper.updateClickedSlide(e);\n swiper.emit('tap click', e);\n if (timeDiff < 300 && (touchEndTime - data.lastClickTime) < 300) {\n swiper.emit('doubleTap doubleClick', e);\n }\n }\n\n data.lastClickTime = Utils.now();\n Utils.nextTick(() => {\n if (!swiper.destroyed) swiper.allowClick = true;\n });\n\n if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {\n data.isTouched = false;\n data.isMoved = false;\n data.startMoving = false;\n return;\n }\n data.isTouched = false;\n data.isMoved = false;\n data.startMoving = false;\n\n let currentPos;\n if (params.followFinger) {\n currentPos = rtl ? swiper.translate : -swiper.translate;\n } else {\n currentPos = -data.currentTranslate;\n }\n\n if (params.cssMode) {\n return;\n }\n\n if (params.freeMode) {\n if (currentPos < -swiper.minTranslate()) {\n swiper.slideTo(swiper.activeIndex);\n return;\n }\n if (currentPos > -swiper.maxTranslate()) {\n if (swiper.slides.length < snapGrid.length) {\n swiper.slideTo(snapGrid.length - 1);\n } else {\n swiper.slideTo(swiper.slides.length - 1);\n }\n return;\n }\n\n if (params.freeModeMomentum) {\n if (data.velocities.length > 1) {\n const lastMoveEvent = data.velocities.pop();\n const velocityEvent = data.velocities.pop();\n\n const distance = lastMoveEvent.position - velocityEvent.position;\n const time = lastMoveEvent.time - velocityEvent.time;\n swiper.velocity = distance / time;\n swiper.velocity /= 2;\n if (Math.abs(swiper.velocity) < params.freeModeMinimumVelocity) {\n swiper.velocity = 0;\n }\n // this implies that the user stopped moving a finger then released.\n // There would be no events with distance zero, so the last event is stale.\n if (time > 150 || (Utils.now() - lastMoveEvent.time) > 300) {\n swiper.velocity = 0;\n }\n } else {\n swiper.velocity = 0;\n }\n swiper.velocity *= params.freeModeMomentumVelocityRatio;\n\n data.velocities.length = 0;\n let momentumDuration = 1000 * params.freeModeMomentumRatio;\n const momentumDistance = swiper.velocity * momentumDuration;\n\n let newPosition = swiper.translate + momentumDistance;\n if (rtl) newPosition = -newPosition;\n\n let doBounce = false;\n let afterBouncePosition;\n const bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeModeMomentumBounceRatio;\n let needsLoopFix;\n if (newPosition < swiper.maxTranslate()) {\n if (params.freeModeMomentumBounce) {\n if (newPosition + swiper.maxTranslate() < -bounceAmount) {\n newPosition = swiper.maxTranslate() - bounceAmount;\n }\n afterBouncePosition = swiper.maxTranslate();\n doBounce = true;\n data.allowMomentumBounce = true;\n } else {\n newPosition = swiper.maxTranslate();\n }\n if (params.loop && params.centeredSlides) needsLoopFix = true;\n } else if (newPosition > swiper.minTranslate()) {\n if (params.freeModeMomentumBounce) {\n if (newPosition - swiper.minTranslate() > bounceAmount) {\n newPosition = swiper.minTranslate() + bounceAmount;\n }\n afterBouncePosition = swiper.minTranslate();\n doBounce = true;\n data.allowMomentumBounce = true;\n } else {\n newPosition = swiper.minTranslate();\n }\n if (params.loop && params.centeredSlides) needsLoopFix = true;\n } else if (params.freeModeSticky) {\n let nextSlide;\n for (let j = 0; j < snapGrid.length; j += 1) {\n if (snapGrid[j] > -newPosition) {\n nextSlide = j;\n break;\n }\n }\n\n if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') {\n newPosition = snapGrid[nextSlide];\n } else {\n newPosition = snapGrid[nextSlide - 1];\n }\n newPosition = -newPosition;\n }\n if (needsLoopFix) {\n swiper.once('transitionEnd', () => {\n swiper.loopFix();\n });\n }\n // Fix duration\n if (swiper.velocity !== 0) {\n if (rtl) {\n momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity);\n } else {\n momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity);\n }\n if (params.freeModeSticky) {\n // If freeModeSticky is active and the user ends a swipe with a slow-velocity\n // event, then durations can be 20+ seconds to slide one (or zero!) slides.\n // It's easy to see this when simulating touch with mouse events. To fix this,\n // limit single-slide swipes to the default slide duration. This also has the\n // nice side effect of matching slide speed if the user stopped moving before\n // lifting finger or mouse vs. moving slowly before lifting the finger/mouse.\n // For faster swipes, also apply limits (albeit higher ones).\n const moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate);\n const currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex];\n if (moveDistance < currentSlideSize) {\n momentumDuration = params.speed;\n } else if (moveDistance < 2 * currentSlideSize) {\n momentumDuration = params.speed * 1.5;\n } else {\n momentumDuration = params.speed * 2.5;\n }\n }\n } else if (params.freeModeSticky) {\n swiper.slideToClosest();\n return;\n }\n\n if (params.freeModeMomentumBounce && doBounce) {\n swiper.updateProgress(afterBouncePosition);\n swiper.setTransition(momentumDuration);\n swiper.setTranslate(newPosition);\n swiper.transitionStart(true, swiper.swipeDirection);\n swiper.animating = true;\n $wrapperEl.transitionEnd(() => {\n if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return;\n swiper.emit('momentumBounce');\n\n swiper.setTransition(params.speed);\n swiper.setTranslate(afterBouncePosition);\n $wrapperEl.transitionEnd(() => {\n if (!swiper || swiper.destroyed) return;\n swiper.transitionEnd();\n });\n });\n } else if (swiper.velocity) {\n swiper.updateProgress(newPosition);\n swiper.setTransition(momentumDuration);\n swiper.setTranslate(newPosition);\n swiper.transitionStart(true, swiper.swipeDirection);\n if (!swiper.animating) {\n swiper.animating = true;\n $wrapperEl.transitionEnd(() => {\n if (!swiper || swiper.destroyed) return;\n swiper.transitionEnd();\n });\n }\n } else {\n swiper.updateProgress(newPosition);\n }\n\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n } else if (params.freeModeSticky) {\n swiper.slideToClosest();\n return;\n }\n\n if (!params.freeModeMomentum || timeDiff >= params.longSwipesMs) {\n swiper.updateProgress();\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n }\n return;\n }\n\n // Find current slide\n let stopIndex = 0;\n let groupSize = swiper.slidesSizesGrid[0];\n for (let i = 0; i < slidesGrid.length; i += (i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup)) {\n const increment = (i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup);\n if (typeof slidesGrid[i + increment] !== 'undefined') {\n if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) {\n stopIndex = i;\n groupSize = slidesGrid[i + increment] - slidesGrid[i];\n }\n } else if (currentPos >= slidesGrid[i]) {\n stopIndex = i;\n groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];\n }\n }\n\n // Find current slide size\n const ratio = (currentPos - slidesGrid[stopIndex]) / groupSize;\n const increment = (stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup);\n\n if (timeDiff > params.longSwipesMs) {\n // Long touches\n if (!params.longSwipes) {\n swiper.slideTo(swiper.activeIndex);\n return;\n }\n if (swiper.swipeDirection === 'next') {\n if (ratio >= params.longSwipesRatio) swiper.slideTo(stopIndex + increment);\n else swiper.slideTo(stopIndex);\n }\n if (swiper.swipeDirection === 'prev') {\n if (ratio > (1 - params.longSwipesRatio)) swiper.slideTo(stopIndex + increment);\n else swiper.slideTo(stopIndex);\n }\n } else {\n // Short swipes\n if (!params.shortSwipes) {\n swiper.slideTo(swiper.activeIndex);\n return;\n }\n const isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl);\n if (!isNavButtonTarget) {\n if (swiper.swipeDirection === 'next') {\n swiper.slideTo(stopIndex + increment);\n }\n if (swiper.swipeDirection === 'prev') {\n swiper.slideTo(stopIndex);\n }\n } else if (e.target === swiper.navigation.nextEl) {\n swiper.slideTo(stopIndex + increment);\n } else {\n swiper.slideTo(stopIndex);\n }\n }\n}\n","export default function () {\n const swiper = this;\n\n const { params, el } = swiper;\n\n if (el && el.offsetWidth === 0) return;\n\n // Breakpoints\n if (params.breakpoints) {\n swiper.setBreakpoint();\n }\n\n // Save locks\n const { allowSlideNext, allowSlidePrev, snapGrid } = swiper;\n\n // Disable locks on resize\n swiper.allowSlideNext = true;\n swiper.allowSlidePrev = true;\n\n swiper.updateSize();\n swiper.updateSlides();\n\n swiper.updateSlidesClasses();\n if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) {\n swiper.slideTo(swiper.slides.length - 1, 0, false, true);\n } else {\n swiper.slideTo(swiper.activeIndex, 0, false, true);\n }\n\n if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {\n swiper.autoplay.run();\n }\n // Return locks after resize\n swiper.allowSlidePrev = allowSlidePrev;\n swiper.allowSlideNext = allowSlideNext;\n\n if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) {\n swiper.checkOverflow();\n }\n}\n","export default function (e) {\n const swiper = this;\n if (!swiper.allowClick) {\n if (swiper.params.preventClicks) e.preventDefault();\n if (swiper.params.preventClicksPropagation && swiper.animating) {\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n }\n}\n","export default function () {\n const swiper = this;\n const { wrapperEl } = swiper;\n swiper.previousTranslate = swiper.translate;\n swiper.translate = swiper.isHorizontal() ? -wrapperEl.scrollLeft : -wrapperEl.scrollTop;\n // eslint-disable-next-line\n if (swiper.translate === -0) swiper.translate = 0;\n\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n\n let newProgress;\n const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();\n if (translatesDiff === 0) {\n newProgress = 0;\n } else {\n newProgress = (swiper.translate - swiper.minTranslate()) / (translatesDiff);\n }\n if (newProgress !== swiper.progress) {\n swiper.updateProgress(swiper.translate);\n }\n\n swiper.emit('setTranslate', swiper.translate, false);\n}\n","import { document } from 'ssr-window';\nimport Device from '../../../utils/device';\nimport Support from '../../../utils/support';\n\nimport onTouchStart from './onTouchStart';\nimport onTouchMove from './onTouchMove';\nimport onTouchEnd from './onTouchEnd';\nimport onResize from './onResize';\nimport onClick from './onClick';\nimport onScroll from './onScroll';\n\nlet dummyEventAttached = false;\nfunction dummyEventListener() {}\n\nfunction attachEvents() {\n const swiper = this;\n const {\n params, touchEvents, el, wrapperEl,\n } = swiper;\n\n swiper.onTouchStart = onTouchStart.bind(swiper);\n swiper.onTouchMove = onTouchMove.bind(swiper);\n swiper.onTouchEnd = onTouchEnd.bind(swiper);\n if (params.cssMode) {\n swiper.onScroll = onScroll.bind(swiper);\n }\n\n swiper.onClick = onClick.bind(swiper);\n\n const capture = !!params.nested;\n\n // Touch Events\n if (!Support.touch && Support.pointerEvents) {\n el.addEventListener(touchEvents.start, swiper.onTouchStart, false);\n document.addEventListener(touchEvents.move, swiper.onTouchMove, capture);\n document.addEventListener(touchEvents.end, swiper.onTouchEnd, false);\n } else {\n if (Support.touch) {\n const passiveListener = touchEvents.start === 'touchstart' && Support.passiveListener && params.passiveListeners ? { passive: true, capture: false } : false;\n el.addEventListener(touchEvents.start, swiper.onTouchStart, passiveListener);\n el.addEventListener(touchEvents.move, swiper.onTouchMove, Support.passiveListener ? { passive: false, capture } : capture);\n el.addEventListener(touchEvents.end, swiper.onTouchEnd, passiveListener);\n if (touchEvents.cancel) {\n el.addEventListener(touchEvents.cancel, swiper.onTouchEnd, passiveListener);\n }\n if (!dummyEventAttached) {\n document.addEventListener('touchstart', dummyEventListener);\n dummyEventAttached = true;\n }\n }\n if ((params.simulateTouch && !Device.ios && !Device.android) || (params.simulateTouch && !Support.touch && Device.ios)) {\n el.addEventListener('mousedown', swiper.onTouchStart, false);\n document.addEventListener('mousemove', swiper.onTouchMove, capture);\n document.addEventListener('mouseup', swiper.onTouchEnd, false);\n }\n }\n // Prevent Links Clicks\n if (params.preventClicks || params.preventClicksPropagation) {\n el.addEventListener('click', swiper.onClick, true);\n }\n if (params.cssMode) {\n wrapperEl.addEventListener('scroll', swiper.onScroll);\n }\n\n // Resize handler\n if (params.updateOnWindowResize) {\n swiper.on((Device.ios || Device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate'), onResize, true);\n } else {\n swiper.on('observerUpdate', onResize, true);\n }\n}\n\nfunction detachEvents() {\n const swiper = this;\n\n const {\n params, touchEvents, el, wrapperEl,\n } = swiper;\n\n const capture = !!params.nested;\n\n // Touch Events\n if (!Support.touch && Support.pointerEvents) {\n el.removeEventListener(touchEvents.start, swiper.onTouchStart, false);\n document.removeEventListener(touchEvents.move, swiper.onTouchMove, capture);\n document.removeEventListener(touchEvents.end, swiper.onTouchEnd, false);\n } else {\n if (Support.touch) {\n const passiveListener = touchEvents.start === 'onTouchStart' && Support.passiveListener && params.passiveListeners ? { passive: true, capture: false } : false;\n el.removeEventListener(touchEvents.start, swiper.onTouchStart, passiveListener);\n el.removeEventListener(touchEvents.move, swiper.onTouchMove, capture);\n el.removeEventListener(touchEvents.end, swiper.onTouchEnd, passiveListener);\n if (touchEvents.cancel) {\n el.removeEventListener(touchEvents.cancel, swiper.onTouchEnd, passiveListener);\n }\n }\n if ((params.simulateTouch && !Device.ios && !Device.android) || (params.simulateTouch && !Support.touch && Device.ios)) {\n el.removeEventListener('mousedown', swiper.onTouchStart, false);\n document.removeEventListener('mousemove', swiper.onTouchMove, capture);\n document.removeEventListener('mouseup', swiper.onTouchEnd, false);\n }\n }\n // Prevent Links Clicks\n if (params.preventClicks || params.preventClicksPropagation) {\n el.removeEventListener('click', swiper.onClick, true);\n }\n\n if (params.cssMode) {\n wrapperEl.removeEventListener('scroll', swiper.onScroll);\n }\n\n // Resize handler\n swiper.off((Device.ios || Device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate'), onResize);\n}\n\nexport default {\n attachEvents,\n detachEvents,\n};\n","import Utils from '../../../utils/utils';\n\nexport default function () {\n const swiper = this;\n const {\n activeIndex, initialized, loopedSlides = 0, params, $el,\n } = swiper;\n const breakpoints = params.breakpoints;\n if (!breakpoints || (breakpoints && Object.keys(breakpoints).length === 0)) return;\n\n // Get breakpoint for window width and update parameters\n const breakpoint = swiper.getBreakpoint(breakpoints);\n\n if (breakpoint && swiper.currentBreakpoint !== breakpoint) {\n const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;\n if (breakpointOnlyParams) {\n ['slidesPerView', 'spaceBetween', 'slidesPerGroup', 'slidesPerGroupSkip', 'slidesPerColumn'].forEach((param) => {\n const paramValue = breakpointOnlyParams[param];\n if (typeof paramValue === 'undefined') return;\n if (param === 'slidesPerView' && (paramValue === 'AUTO' || paramValue === 'auto')) {\n breakpointOnlyParams[param] = 'auto';\n } else if (param === 'slidesPerView') {\n breakpointOnlyParams[param] = parseFloat(paramValue);\n } else {\n breakpointOnlyParams[param] = parseInt(paramValue, 10);\n }\n });\n }\n\n const breakpointParams = breakpointOnlyParams || swiper.originalParams;\n const wasMultiRow = params.slidesPerColumn > 1;\n const isMultiRow = breakpointParams.slidesPerColumn > 1;\n if (wasMultiRow && !isMultiRow) {\n $el.removeClass(`${params.containerModifierClass}multirow ${params.containerModifierClass}multirow-column`);\n } else if (!wasMultiRow && isMultiRow) {\n $el.addClass(`${params.containerModifierClass}multirow`);\n if (breakpointParams.slidesPerColumnFill === 'column') {\n $el.addClass(`${params.containerModifierClass}multirow-column`);\n }\n }\n\n const directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction;\n const needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged);\n\n if (directionChanged && initialized) {\n swiper.changeDirection();\n }\n\n Utils.extend(swiper.params, breakpointParams);\n\n Utils.extend(swiper, {\n allowTouchMove: swiper.params.allowTouchMove,\n allowSlideNext: swiper.params.allowSlideNext,\n allowSlidePrev: swiper.params.allowSlidePrev,\n });\n\n swiper.currentBreakpoint = breakpoint;\n\n if (needsReLoop && initialized) {\n swiper.loopDestroy();\n swiper.loopCreate();\n swiper.updateSlides();\n swiper.slideTo((activeIndex - loopedSlides) + swiper.loopedSlides, 0, false);\n }\n\n swiper.emit('breakpoint', breakpointParams);\n }\n}\n","import { window } from 'ssr-window';\n\nexport default function (breakpoints) {\n // Get breakpoint for window width\n if (!breakpoints) return undefined;\n let breakpoint = false;\n\n const points = Object.keys(breakpoints).map((point) => {\n if (typeof point === 'string' && point.indexOf('@') === 0) {\n const minRatio = parseFloat(point.substr(1));\n const value = window.innerHeight * minRatio;\n return { value, point };\n }\n return { value: point, point };\n });\n\n points.sort((a, b) => parseInt(a.value, 10) - parseInt(b.value, 10));\n for (let i = 0; i < points.length; i += 1) {\n const { point, value } = points[i];\n if (value <= window.innerWidth) {\n breakpoint = point;\n }\n }\n return breakpoint || 'max';\n}\n","import setBreakpoint from './setBreakpoint';\nimport getBreakpoint from './getBreakpoint';\n\nexport default { setBreakpoint, getBreakpoint };\n","import Device from '../../../utils/device';\n\nexport default function () {\n const swiper = this;\n const {\n classNames, params, rtl, $el,\n } = swiper;\n const suffixes = [];\n\n suffixes.push('initialized');\n suffixes.push(params.direction);\n\n if (params.freeMode) {\n suffixes.push('free-mode');\n }\n if (params.autoHeight) {\n suffixes.push('autoheight');\n }\n if (rtl) {\n suffixes.push('rtl');\n }\n if (params.slidesPerColumn > 1) {\n suffixes.push('multirow');\n if (params.slidesPerColumnFill === 'column') {\n suffixes.push('multirow-column');\n }\n }\n if (Device.android) {\n suffixes.push('android');\n }\n if (Device.ios) {\n suffixes.push('ios');\n }\n\n if (params.cssMode) {\n suffixes.push('css-mode');\n }\n\n suffixes.forEach((suffix) => {\n classNames.push(params.containerModifierClass + suffix);\n });\n\n $el.addClass(classNames.join(' '));\n}\n","export default function () {\n const swiper = this;\n const { $el, classNames } = swiper;\n\n $el.removeClass(classNames.join(' '));\n}\n","import addClasses from './addClasses';\nimport removeClasses from './removeClasses';\n\nexport default { addClasses, removeClasses };\n","import { window } from 'ssr-window';\n\nexport default function (imageEl, src, srcset, sizes, checkForComplete, callback) {\n let image;\n function onReady() {\n if (callback) callback();\n }\n if (!imageEl.complete || !checkForComplete) {\n if (src) {\n image = new window.Image();\n image.onload = onReady;\n image.onerror = onReady;\n if (sizes) {\n image.sizes = sizes;\n }\n if (srcset) {\n image.srcset = srcset;\n }\n if (src) {\n image.src = src;\n }\n } else {\n onReady();\n }\n } else {\n // image already loaded...\n onReady();\n }\n}\n","export default function () {\n const swiper = this;\n swiper.imagesToLoad = swiper.$el.find('img');\n function onReady() {\n if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper.destroyed) return;\n if (swiper.imagesLoaded !== undefined) swiper.imagesLoaded += 1;\n if (swiper.imagesLoaded === swiper.imagesToLoad.length) {\n if (swiper.params.updateOnImagesReady) swiper.update();\n swiper.emit('imagesReady');\n }\n }\n for (let i = 0; i < swiper.imagesToLoad.length; i += 1) {\n const imageEl = swiper.imagesToLoad[i];\n swiper.loadImage(\n imageEl,\n imageEl.currentSrc || imageEl.getAttribute('src'),\n imageEl.srcset || imageEl.getAttribute('srcset'),\n imageEl.sizes || imageEl.getAttribute('sizes'),\n true,\n onReady\n );\n }\n}\n","import loadImage from './loadImage';\nimport preloadImages from './preloadImages';\n\nexport default {\n loadImage,\n preloadImages,\n};\n","\nfunction checkOverflow() {\n const swiper = this;\n const params = swiper.params;\n const wasLocked = swiper.isLocked;\n const lastSlidePosition = swiper.slides.length > 0 && (params.slidesOffsetBefore + (params.spaceBetween * (swiper.slides.length - 1)) + ((swiper.slides[0]).offsetWidth) * swiper.slides.length);\n\n if (params.slidesOffsetBefore && params.slidesOffsetAfter && lastSlidePosition) {\n swiper.isLocked = lastSlidePosition <= swiper.size;\n } else {\n swiper.isLocked = swiper.snapGrid.length === 1;\n }\n\n swiper.allowSlideNext = !swiper.isLocked;\n swiper.allowSlidePrev = !swiper.isLocked;\n\n // events\n if (wasLocked !== swiper.isLocked) swiper.emit(swiper.isLocked ? 'lock' : 'unlock');\n\n if (wasLocked && wasLocked !== swiper.isLocked) {\n swiper.isEnd = false;\n swiper.navigation.update();\n }\n}\n\nexport default { checkOverflow };\n","export default {\n init: true,\n direction: 'horizontal',\n touchEventsTarget: 'container',\n initialSlide: 0,\n speed: 300,\n cssMode: false,\n updateOnWindowResize: true,\n //\n preventInteractionOnTransition: false,\n\n // To support iOS's swipe-to-go-back gesture (when being used in-app, with UIWebView).\n edgeSwipeDetection: false,\n edgeSwipeThreshold: 20,\n\n // Free mode\n freeMode: false,\n freeModeMomentum: true,\n freeModeMomentumRatio: 1,\n freeModeMomentumBounce: true,\n freeModeMomentumBounceRatio: 1,\n freeModeMomentumVelocityRatio: 1,\n freeModeSticky: false,\n freeModeMinimumVelocity: 0.02,\n\n // Autoheight\n autoHeight: false,\n\n // Set wrapper width\n setWrapperSize: false,\n\n // Virtual Translate\n virtualTranslate: false,\n\n // Effects\n effect: 'slide', // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'\n\n // Breakpoints\n breakpoints: undefined,\n\n // Slides grid\n spaceBetween: 0,\n slidesPerView: 1,\n slidesPerColumn: 1,\n slidesPerColumnFill: 'column',\n slidesPerGroup: 1,\n slidesPerGroupSkip: 0,\n centeredSlides: false,\n centeredSlidesBounds: false,\n slidesOffsetBefore: 0, // in px\n slidesOffsetAfter: 0, // in px\n normalizeSlideIndex: true,\n centerInsufficientSlides: false,\n\n // Disable swiper and hide navigation when container not overflow\n watchOverflow: false,\n\n // Round length\n roundLengths: false,\n\n // Touches\n touchRatio: 1,\n touchAngle: 45,\n simulateTouch: true,\n shortSwipes: true,\n longSwipes: true,\n longSwipesRatio: 0.5,\n longSwipesMs: 300,\n followFinger: true,\n allowTouchMove: true,\n threshold: 0,\n touchMoveStopPropagation: false,\n touchStartPreventDefault: true,\n touchStartForcePreventDefault: false,\n touchReleaseOnEdges: false,\n\n // Unique Navigation Elements\n uniqueNavElements: true,\n\n // Resistance\n resistance: true,\n resistanceRatio: 0.85,\n\n // Progress\n watchSlidesProgress: false,\n watchSlidesVisibility: false,\n\n // Cursor\n grabCursor: false,\n\n // Clicks\n preventClicks: true,\n preventClicksPropagation: true,\n slideToClickedSlide: false,\n\n // Images\n preloadImages: true,\n updateOnImagesReady: true,\n\n // loop\n loop: false,\n loopAdditionalSlides: 0,\n loopedSlides: null,\n loopFillGroupWithBlank: false,\n\n // Swiping/no swiping\n allowSlidePrev: true,\n allowSlideNext: true,\n swipeHandler: null, // '.swipe-handler',\n noSwiping: true,\n noSwipingClass: 'swiper-no-swiping',\n noSwipingSelector: null,\n\n // Passive Listeners\n passiveListeners: true,\n\n // NS\n containerModifierClass: 'swiper-container-', // NEW\n slideClass: 'swiper-slide',\n slideBlankClass: 'swiper-slide-invisible-blank',\n slideActiveClass: 'swiper-slide-active',\n slideDuplicateActiveClass: 'swiper-slide-duplicate-active',\n slideVisibleClass: 'swiper-slide-visible',\n slideDuplicateClass: 'swiper-slide-duplicate',\n slideNextClass: 'swiper-slide-next',\n slideDuplicateNextClass: 'swiper-slide-duplicate-next',\n slidePrevClass: 'swiper-slide-prev',\n slideDuplicatePrevClass: 'swiper-slide-duplicate-prev',\n wrapperClass: 'swiper-wrapper',\n\n // Callbacks\n runCallbacksOnInit: true,\n};\n","/* eslint no-param-reassign: \"off\" */\nimport $ from '../../utils/dom';\nimport Utils from '../../utils/utils';\nimport Support from '../../utils/support';\n\nimport SwiperClass from '../../utils/class';\n\nimport update from './update/index';\nimport translate from './translate/index';\nimport transition from './transition/index';\nimport slide from './slide/index';\nimport loop from './loop/index';\nimport grabCursor from './grab-cursor/index';\nimport manipulation from './manipulation/index';\nimport events from './events/index';\nimport breakpoints from './breakpoints/index';\nimport classes from './classes/index';\nimport images from './images/index';\nimport checkOverflow from './check-overflow/index';\n\nimport defaults from './defaults';\n\nconst prototypes = {\n update,\n translate,\n transition,\n slide,\n loop,\n grabCursor,\n manipulation,\n events,\n breakpoints,\n checkOverflow,\n classes,\n images,\n};\n\nconst extendedDefaults = {};\n\nclass Swiper extends SwiperClass {\n constructor(...args) {\n let el;\n let params;\n if (args.length === 1 && args[0].constructor && args[0].constructor === Object) {\n params = args[0];\n } else {\n [el, params] = args;\n }\n if (!params) params = {};\n\n params = Utils.extend({}, params);\n if (el && !params.el) params.el = el;\n\n super(params);\n\n Object.keys(prototypes).forEach((prototypeGroup) => {\n Object.keys(prototypes[prototypeGroup]).forEach((protoMethod) => {\n if (!Swiper.prototype[protoMethod]) {\n Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod];\n }\n });\n });\n\n // Swiper Instance\n const swiper = this;\n if (typeof swiper.modules === 'undefined') {\n swiper.modules = {};\n }\n Object.keys(swiper.modules).forEach((moduleName) => {\n const module = swiper.modules[moduleName];\n if (module.params) {\n const moduleParamName = Object.keys(module.params)[0];\n const moduleParams = module.params[moduleParamName];\n if (typeof moduleParams !== 'object' || moduleParams === null) return;\n if (!(moduleParamName in params && 'enabled' in moduleParams)) return;\n if (params[moduleParamName] === true) {\n params[moduleParamName] = { enabled: true };\n }\n if (\n typeof params[moduleParamName] === 'object'\n && !('enabled' in params[moduleParamName])\n ) {\n params[moduleParamName].enabled = true;\n }\n if (!params[moduleParamName]) params[moduleParamName] = { enabled: false };\n }\n });\n\n // Extend defaults with modules params\n const swiperParams = Utils.extend({}, defaults);\n swiper.useModulesParams(swiperParams);\n\n // Extend defaults with passed params\n swiper.params = Utils.extend({}, swiperParams, extendedDefaults, params);\n swiper.originalParams = Utils.extend({}, swiper.params);\n swiper.passedParams = Utils.extend({}, params);\n\n // Save Dom lib\n swiper.$ = $;\n\n // Find el\n const $el = $(swiper.params.el);\n el = $el[0];\n\n if (!el) {\n return undefined;\n }\n\n if ($el.length > 1) {\n const swipers = [];\n $el.each((index, containerEl) => {\n const newParams = Utils.extend({}, params, { el: containerEl });\n swipers.push(new Swiper(newParams));\n });\n return swipers;\n }\n\n el.swiper = swiper;\n $el.data('swiper', swiper);\n\n // Find Wrapper\n let $wrapperEl;\n if (el && el.shadowRoot && el.shadowRoot.querySelector) {\n $wrapperEl = $(el.shadowRoot.querySelector(`.${swiper.params.wrapperClass}`));\n // Children needs to return slot items\n $wrapperEl.children = (options) => $el.children(options);\n } else {\n $wrapperEl = $el.children(`.${swiper.params.wrapperClass}`);\n }\n // Extend Swiper\n Utils.extend(swiper, {\n $el,\n el,\n $wrapperEl,\n wrapperEl: $wrapperEl[0],\n\n // Classes\n classNames: [],\n\n // Slides\n slides: $(),\n slidesGrid: [],\n snapGrid: [],\n slidesSizesGrid: [],\n\n // isDirection\n isHorizontal() {\n return swiper.params.direction === 'horizontal';\n },\n isVertical() {\n return swiper.params.direction === 'vertical';\n },\n // RTL\n rtl: (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'),\n rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'),\n wrongRTL: $wrapperEl.css('display') === '-webkit-box',\n\n // Indexes\n activeIndex: 0,\n realIndex: 0,\n\n //\n isBeginning: true,\n isEnd: false,\n\n // Props\n translate: 0,\n previousTranslate: 0,\n progress: 0,\n velocity: 0,\n animating: false,\n\n // Locks\n allowSlideNext: swiper.params.allowSlideNext,\n allowSlidePrev: swiper.params.allowSlidePrev,\n\n // Touch Events\n touchEvents: (function touchEvents() {\n const touch = ['touchstart', 'touchmove', 'touchend', 'touchcancel'];\n let desktop = ['mousedown', 'mousemove', 'mouseup'];\n if (Support.pointerEvents) {\n desktop = ['pointerdown', 'pointermove', 'pointerup'];\n }\n swiper.touchEventsTouch = {\n start: touch[0],\n move: touch[1],\n end: touch[2],\n cancel: touch[3],\n };\n swiper.touchEventsDesktop = {\n start: desktop[0],\n move: desktop[1],\n end: desktop[2],\n };\n return Support.touch || !swiper.params.simulateTouch ? swiper.touchEventsTouch : swiper.touchEventsDesktop;\n }()),\n touchEventsData: {\n isTouched: undefined,\n isMoved: undefined,\n allowTouchCallbacks: undefined,\n touchStartTime: undefined,\n isScrolling: undefined,\n currentTranslate: undefined,\n startTranslate: undefined,\n allowThresholdMove: undefined,\n // Form elements to match\n formElements: 'input, select, option, textarea, button, video, label',\n // Last click time\n lastClickTime: Utils.now(),\n clickTimeout: undefined,\n // Velocities\n velocities: [],\n allowMomentumBounce: undefined,\n isTouchEvent: undefined,\n startMoving: undefined,\n },\n\n // Clicks\n allowClick: true,\n\n // Touches\n allowTouchMove: swiper.params.allowTouchMove,\n\n touches: {\n startX: 0,\n startY: 0,\n currentX: 0,\n currentY: 0,\n diff: 0,\n },\n\n // Images\n imagesToLoad: [],\n imagesLoaded: 0,\n\n });\n\n // Install Modules\n swiper.useModules();\n\n // Init\n if (swiper.params.init) {\n swiper.init();\n }\n\n // Return app instance\n return swiper;\n }\n\n slidesPerViewDynamic() {\n const swiper = this;\n const {\n params, slides, slidesGrid, size: swiperSize, activeIndex,\n } = swiper;\n let spv = 1;\n if (params.centeredSlides) {\n let slideSize = slides[activeIndex].swiperSlideSize;\n let breakLoop;\n for (let i = activeIndex + 1; i < slides.length; i += 1) {\n if (slides[i] && !breakLoop) {\n slideSize += slides[i].swiperSlideSize;\n spv += 1;\n if (slideSize > swiperSize) breakLoop = true;\n }\n }\n for (let i = activeIndex - 1; i >= 0; i -= 1) {\n if (slides[i] && !breakLoop) {\n slideSize += slides[i].swiperSlideSize;\n spv += 1;\n if (slideSize > swiperSize) breakLoop = true;\n }\n }\n } else {\n for (let i = activeIndex + 1; i < slides.length; i += 1) {\n if (slidesGrid[i] - slidesGrid[activeIndex] < swiperSize) {\n spv += 1;\n }\n }\n }\n return spv;\n }\n\n update() {\n const swiper = this;\n if (!swiper || swiper.destroyed) return;\n const { snapGrid, params } = swiper;\n // Breakpoints\n if (params.breakpoints) {\n swiper.setBreakpoint();\n }\n swiper.updateSize();\n swiper.updateSlides();\n swiper.updateProgress();\n swiper.updateSlidesClasses();\n\n function setTranslate() {\n const translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate;\n const newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate());\n swiper.setTranslate(newTranslate);\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n }\n let translated;\n if (swiper.params.freeMode) {\n setTranslate();\n if (swiper.params.autoHeight) {\n swiper.updateAutoHeight();\n }\n } else {\n if ((swiper.params.slidesPerView === 'auto' || swiper.params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) {\n translated = swiper.slideTo(swiper.slides.length - 1, 0, false, true);\n } else {\n translated = swiper.slideTo(swiper.activeIndex, 0, false, true);\n }\n if (!translated) {\n setTranslate();\n }\n }\n if (params.watchOverflow && snapGrid !== swiper.snapGrid) {\n swiper.checkOverflow();\n }\n swiper.emit('update');\n }\n\n changeDirection(newDirection, needUpdate = true) {\n const swiper = this;\n const currentDirection = swiper.params.direction;\n if (!newDirection) {\n // eslint-disable-next-line\n newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal';\n }\n if ((newDirection === currentDirection) || (newDirection !== 'horizontal' && newDirection !== 'vertical')) {\n return swiper;\n }\n\n swiper.$el\n .removeClass(`${swiper.params.containerModifierClass}${currentDirection}`)\n .addClass(`${swiper.params.containerModifierClass}${newDirection}`);\n\n swiper.params.direction = newDirection;\n\n swiper.slides.each((slideIndex, slideEl) => {\n if (newDirection === 'vertical') {\n slideEl.style.width = '';\n } else {\n slideEl.style.height = '';\n }\n });\n\n swiper.emit('changeDirection');\n if (needUpdate) swiper.update();\n\n return swiper;\n }\n\n init() {\n const swiper = this;\n if (swiper.initialized) return;\n\n swiper.emit('beforeInit');\n\n // Set breakpoint\n if (swiper.params.breakpoints) {\n swiper.setBreakpoint();\n }\n\n // Add Classes\n swiper.addClasses();\n\n // Create loop\n if (swiper.params.loop) {\n swiper.loopCreate();\n }\n\n // Update size\n swiper.updateSize();\n\n // Update slides\n swiper.updateSlides();\n\n if (swiper.params.watchOverflow) {\n swiper.checkOverflow();\n }\n\n // Set Grab Cursor\n if (swiper.params.grabCursor) {\n swiper.setGrabCursor();\n }\n\n if (swiper.params.preloadImages) {\n swiper.preloadImages();\n }\n\n // Slide To Initial Slide\n if (swiper.params.loop) {\n swiper.slideTo(swiper.params.initialSlide + swiper.loopedSlides, 0, swiper.params.runCallbacksOnInit);\n } else {\n swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit);\n }\n\n // Attach events\n swiper.attachEvents();\n\n // Init Flag\n swiper.initialized = true;\n\n // Emit\n swiper.emit('init');\n }\n\n destroy(deleteInstance = true, cleanStyles = true) {\n const swiper = this;\n const {\n params, $el, $wrapperEl, slides,\n } = swiper;\n\n if (typeof swiper.params === 'undefined' || swiper.destroyed) {\n return null;\n }\n\n swiper.emit('beforeDestroy');\n\n // Init Flag\n swiper.initialized = false;\n\n // Detach events\n swiper.detachEvents();\n\n // Destroy loop\n if (params.loop) {\n swiper.loopDestroy();\n }\n\n // Cleanup styles\n if (cleanStyles) {\n swiper.removeClasses();\n $el.removeAttr('style');\n $wrapperEl.removeAttr('style');\n if (slides && slides.length) {\n slides\n .removeClass([\n params.slideVisibleClass,\n params.slideActiveClass,\n params.slideNextClass,\n params.slidePrevClass,\n ].join(' '))\n .removeAttr('style')\n .removeAttr('data-swiper-slide-index');\n }\n }\n\n swiper.emit('destroy');\n\n // Detach emitter events\n Object.keys(swiper.eventsListeners).forEach((eventName) => {\n swiper.off(eventName);\n });\n\n if (deleteInstance !== false) {\n swiper.$el[0].swiper = null;\n swiper.$el.data('swiper', null);\n Utils.deleteProps(swiper);\n }\n swiper.destroyed = true;\n\n return null;\n }\n\n static extendDefaults(newDefaults) {\n Utils.extend(extendedDefaults, newDefaults);\n }\n\n static get extendedDefaults() {\n return extendedDefaults;\n }\n\n static get defaults() {\n return defaults;\n }\n\n static get Class() {\n return SwiperClass;\n }\n\n static get $() {\n return $;\n }\n}\n\nexport default Swiper;\n","import Device from '../../utils/device';\n\nexport default {\n name: 'device',\n proto: {\n device: Device,\n },\n static: {\n device: Device,\n },\n};\n","import Support from '../../utils/support';\n\nexport default {\n name: 'support',\n proto: {\n support: Support,\n },\n static: {\n support: Support,\n },\n};\n","import { window } from 'ssr-window';\n\nconst Browser = (function Browser() {\n function isSafari() {\n const ua = window.navigator.userAgent.toLowerCase();\n return (ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0);\n }\n return {\n isEdge: !!window.navigator.userAgent.match(/Edge/g),\n isSafari: isSafari(),\n isUiWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent),\n };\n}());\n\nexport default Browser;\n","import Browser from '../../utils/browser';\n\nexport default {\n name: 'browser',\n proto: {\n browser: Browser,\n },\n static: {\n browser: Browser,\n },\n};\n","import { window } from 'ssr-window';\nimport Utils from '../../utils/utils';\n\nexport default {\n name: 'resize',\n create() {\n const swiper = this;\n Utils.extend(swiper, {\n resize: {\n resizeHandler() {\n if (!swiper || swiper.destroyed || !swiper.initialized) return;\n swiper.emit('beforeResize');\n swiper.emit('resize');\n },\n orientationChangeHandler() {\n if (!swiper || swiper.destroyed || !swiper.initialized) return;\n swiper.emit('orientationchange');\n },\n },\n });\n },\n on: {\n init() {\n const swiper = this;\n // Emit resize\n window.addEventListener('resize', swiper.resize.resizeHandler);\n\n // Emit orientationchange\n window.addEventListener('orientationchange', swiper.resize.orientationChangeHandler);\n },\n destroy() {\n const swiper = this;\n window.removeEventListener('resize', swiper.resize.resizeHandler);\n window.removeEventListener('orientationchange', swiper.resize.orientationChangeHandler);\n },\n },\n};\n","import { window } from 'ssr-window';\nimport Utils from '../../utils/utils';\nimport Support from '../../utils/support';\n\nconst Observer = {\n func: window.MutationObserver || window.WebkitMutationObserver,\n attach(target, options = {}) {\n const swiper = this;\n\n const ObserverFunc = Observer.func;\n const observer = new ObserverFunc((mutations) => {\n // The observerUpdate event should only be triggered\n // once despite the number of mutations. Additional\n // triggers are redundant and are very costly\n if (mutations.length === 1) {\n swiper.emit('observerUpdate', mutations[0]);\n return;\n }\n const observerUpdate = function observerUpdate() {\n swiper.emit('observerUpdate', mutations[0]);\n };\n\n if (window.requestAnimationFrame) {\n window.requestAnimationFrame(observerUpdate);\n } else {\n window.setTimeout(observerUpdate, 0);\n }\n });\n\n observer.observe(target, {\n attributes: typeof options.attributes === 'undefined' ? true : options.attributes,\n childList: typeof options.childList === 'undefined' ? true : options.childList,\n characterData: typeof options.characterData === 'undefined' ? true : options.characterData,\n });\n\n swiper.observer.observers.push(observer);\n },\n init() {\n const swiper = this;\n if (!Support.observer || !swiper.params.observer) return;\n if (swiper.params.observeParents) {\n const containerParents = swiper.$el.parents();\n for (let i = 0; i < containerParents.length; i += 1) {\n swiper.observer.attach(containerParents[i]);\n }\n }\n // Observe container\n swiper.observer.attach(swiper.$el[0], { childList: swiper.params.observeSlideChildren });\n\n // Observe wrapper\n swiper.observer.attach(swiper.$wrapperEl[0], { attributes: false });\n },\n destroy() {\n const swiper = this;\n swiper.observer.observers.forEach((observer) => {\n observer.disconnect();\n });\n swiper.observer.observers = [];\n },\n};\n\nexport default {\n name: 'observer',\n params: {\n observer: false,\n observeParents: false,\n observeSlideChildren: false,\n },\n create() {\n const swiper = this;\n Utils.extend(swiper, {\n observer: {\n init: Observer.init.bind(swiper),\n attach: Observer.attach.bind(swiper),\n destroy: Observer.destroy.bind(swiper),\n observers: [],\n },\n });\n },\n on: {\n init() {\n const swiper = this;\n swiper.observer.init();\n },\n destroy() {\n const swiper = this;\n swiper.observer.destroy();\n },\n },\n};\n","import $ from '../../utils/dom';\nimport Utils from '../../utils/utils';\n\nconst Virtual = {\n update(force) {\n const swiper = this;\n const { slidesPerView, slidesPerGroup, centeredSlides } = swiper.params;\n const { addSlidesBefore, addSlidesAfter } = swiper.params.virtual;\n const {\n from: previousFrom,\n to: previousTo,\n slides,\n slidesGrid: previousSlidesGrid,\n renderSlide,\n offset: previousOffset,\n } = swiper.virtual;\n swiper.updateActiveIndex();\n const activeIndex = swiper.activeIndex || 0;\n\n let offsetProp;\n if (swiper.rtlTranslate) offsetProp = 'right';\n else offsetProp = swiper.isHorizontal() ? 'left' : 'top';\n\n let slidesAfter;\n let slidesBefore;\n if (centeredSlides) {\n slidesAfter = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesBefore;\n slidesBefore = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesAfter;\n } else {\n slidesAfter = slidesPerView + (slidesPerGroup - 1) + addSlidesBefore;\n slidesBefore = slidesPerGroup + addSlidesAfter;\n }\n const from = Math.max((activeIndex || 0) - slidesBefore, 0);\n const to = Math.min((activeIndex || 0) + slidesAfter, slides.length - 1);\n const offset = (swiper.slidesGrid[from] || 0) - (swiper.slidesGrid[0] || 0);\n\n Utils.extend(swiper.virtual, {\n from,\n to,\n offset,\n slidesGrid: swiper.slidesGrid,\n });\n\n function onRendered() {\n swiper.updateSlides();\n swiper.updateProgress();\n swiper.updateSlidesClasses();\n if (swiper.lazy && swiper.params.lazy.enabled) {\n swiper.lazy.load();\n }\n }\n\n if (previousFrom === from && previousTo === to && !force) {\n if (swiper.slidesGrid !== previousSlidesGrid && offset !== previousOffset) {\n swiper.slides.css(offsetProp, `${offset}px`);\n }\n swiper.updateProgress();\n return;\n }\n if (swiper.params.virtual.renderExternal) {\n swiper.params.virtual.renderExternal.call(swiper, {\n offset,\n from,\n to,\n slides: (function getSlides() {\n const slidesToRender = [];\n for (let i = from; i <= to; i += 1) {\n slidesToRender.push(slides[i]);\n }\n return slidesToRender;\n }()),\n });\n onRendered();\n return;\n }\n const prependIndexes = [];\n const appendIndexes = [];\n if (force) {\n swiper.$wrapperEl.find(`.${swiper.params.slideClass}`).remove();\n } else {\n for (let i = previousFrom; i <= previousTo; i += 1) {\n if (i < from || i > to) {\n swiper.$wrapperEl.find(`.${swiper.params.slideClass}[data-swiper-slide-index=\"${i}\"]`).remove();\n }\n }\n }\n for (let i = 0; i < slides.length; i += 1) {\n if (i >= from && i <= to) {\n if (typeof previousTo === 'undefined' || force) {\n appendIndexes.push(i);\n } else {\n if (i > previousTo) appendIndexes.push(i);\n if (i < previousFrom) prependIndexes.push(i);\n }\n }\n }\n appendIndexes.forEach((index) => {\n swiper.$wrapperEl.append(renderSlide(slides[index], index));\n });\n prependIndexes.sort((a, b) => b - a).forEach((index) => {\n swiper.$wrapperEl.prepend(renderSlide(slides[index], index));\n });\n swiper.$wrapperEl.children('.swiper-slide').css(offsetProp, `${offset}px`);\n onRendered();\n },\n renderSlide(slide, index) {\n const swiper = this;\n const params = swiper.params.virtual;\n if (params.cache && swiper.virtual.cache[index]) {\n return swiper.virtual.cache[index];\n }\n const $slideEl = params.renderSlide\n ? $(params.renderSlide.call(swiper, slide, index))\n : $(`<div class=\"${swiper.params.slideClass}\" data-swiper-slide-index=\"${index}\">${slide}</div>`);\n if (!$slideEl.attr('data-swiper-slide-index')) $slideEl.attr('data-swiper-slide-index', index);\n if (params.cache) swiper.virtual.cache[index] = $slideEl;\n return $slideEl;\n },\n appendSlide(slides) {\n const swiper = this;\n if (typeof slides === 'object' && 'length' in slides) {\n for (let i = 0; i < slides.length; i += 1) {\n if (slides[i]) swiper.virtual.slides.push(slides[i]);\n }\n } else {\n swiper.virtual.slides.push(slides);\n }\n swiper.virtual.update(true);\n },\n prependSlide(slides) {\n const swiper = this;\n const activeIndex = swiper.activeIndex;\n let newActiveIndex = activeIndex + 1;\n let numberOfNewSlides = 1;\n\n if (Array.isArray(slides)) {\n for (let i = 0; i < slides.length; i += 1) {\n if (slides[i]) swiper.virtual.slides.unshift(slides[i]);\n }\n newActiveIndex = activeIndex + slides.length;\n numberOfNewSlides = slides.length;\n } else {\n swiper.virtual.slides.unshift(slides);\n }\n if (swiper.params.virtual.cache) {\n const cache = swiper.virtual.cache;\n const newCache = {};\n Object.keys(cache).forEach((cachedIndex) => {\n const $cachedEl = cache[cachedIndex];\n const cachedElIndex = $cachedEl.attr('data-swiper-slide-index');\n if (cachedElIndex) {\n $cachedEl.attr('data-swiper-slide-index', parseInt(cachedElIndex, 10) + 1);\n }\n newCache[parseInt(cachedIndex, 10) + numberOfNewSlides] = $cachedEl;\n });\n swiper.virtual.cache = newCache;\n }\n swiper.virtual.update(true);\n swiper.slideTo(newActiveIndex, 0);\n },\n removeSlide(slidesIndexes) {\n const swiper = this;\n if (typeof slidesIndexes === 'undefined' || slidesIndexes === null) return;\n let activeIndex = swiper.activeIndex;\n if (Array.isArray(slidesIndexes)) {\n for (let i = slidesIndexes.length - 1; i >= 0; i -= 1) {\n swiper.virtual.slides.splice(slidesIndexes[i], 1);\n if (swiper.params.virtual.cache) {\n delete swiper.virtual.cache[slidesIndexes[i]];\n }\n if (slidesIndexes[i] < activeIndex) activeIndex -= 1;\n activeIndex = Math.max(activeIndex, 0);\n }\n } else {\n swiper.virtual.slides.splice(slidesIndexes, 1);\n if (swiper.params.virtual.cache) {\n delete swiper.virtual.cache[slidesIndexes];\n }\n if (slidesIndexes < activeIndex) activeIndex -= 1;\n activeIndex = Math.max(activeIndex, 0);\n }\n swiper.virtual.update(true);\n swiper.slideTo(activeIndex, 0);\n },\n removeAllSlides() {\n const swiper = this;\n swiper.virtual.slides = [];\n if (swiper.params.virtual.cache) {\n swiper.virtual.cache = {};\n }\n swiper.virtual.update(true);\n swiper.slideTo(0, 0);\n },\n};\n\nexport default {\n name: 'virtual',\n params: {\n virtual: {\n enabled: false,\n slides: [],\n cache: true,\n renderSlide: null,\n renderExternal: null,\n addSlidesBefore: 0,\n addSlidesAfter: 0,\n },\n },\n create() {\n const swiper = this;\n Utils.extend(swiper, {\n virtual: {\n update: Virtual.update.bind(swiper),\n appendSlide: Virtual.appendSlide.bind(swiper),\n prependSlide: Virtual.prependSlide.bind(swiper),\n removeSlide: Virtual.removeSlide.bind(swiper),\n removeAllSlides: Virtual.removeAllSlides.bind(swiper),\n renderSlide: Virtual.renderSlide.bind(swiper),\n slides: swiper.params.virtual.slides,\n cache: {},\n },\n });\n },\n on: {\n beforeInit() {\n const swiper = this;\n if (!swiper.params.virtual.enabled) return;\n swiper.classNames.push(`${swiper.params.containerModifierClass}virtual`);\n const overwriteParams = {\n watchSlidesProgress: true,\n };\n Utils.extend(swiper.params, overwriteParams);\n Utils.extend(swiper.originalParams, overwriteParams);\n\n if (!swiper.params.initialSlide) {\n swiper.virtual.update();\n }\n },\n setTranslate() {\n const swiper = this;\n if (!swiper.params.virtual.enabled) return;\n swiper.virtual.update();\n },\n },\n};\n","import { window, document } from 'ssr-window';\nimport $ from '../../utils/dom';\nimport Utils from '../../utils/utils';\n\nconst Keyboard = {\n handle(event) {\n const swiper = this;\n const { rtlTranslate: rtl } = swiper;\n let e = event;\n if (e.originalEvent) e = e.originalEvent; // jquery fix\n const kc = e.keyCode || e.charCode;\n // Directions locks\n if (!swiper.allowSlideNext && ((swiper.isHorizontal() && kc === 39) || (swiper.isVertical() && kc === 40) || kc === 34)) {\n return false;\n }\n if (!swiper.allowSlidePrev && ((swiper.isHorizontal() && kc === 37) || (swiper.isVertical() && kc === 38) || kc === 33)) {\n return false;\n }\n if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {\n return undefined;\n }\n if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {\n return undefined;\n }\n if (swiper.params.keyboard.onlyInViewport && (kc === 33 || kc === 34 || kc === 37 || kc === 39 || kc === 38 || kc === 40)) {\n let inView = false;\n // Check that swiper should be inside of visible area of window\n if (swiper.$el.parents(`.${swiper.params.slideClass}`).length > 0 && swiper.$el.parents(`.${swiper.params.slideActiveClass}`).length === 0) {\n return undefined;\n }\n const windowWidth = window.innerWidth;\n const windowHeight = window.innerHeight;\n const swiperOffset = swiper.$el.offset();\n if (rtl) swiperOffset.left -= swiper.$el[0].scrollLeft;\n const swiperCoord = [\n [swiperOffset.left, swiperOffset.top],\n [swiperOffset.left + swiper.width, swiperOffset.top],\n [swiperOffset.left, swiperOffset.top + swiper.height],\n [swiperOffset.left + swiper.width, swiperOffset.top + swiper.height],\n ];\n for (let i = 0; i < swiperCoord.length; i += 1) {\n const point = swiperC
|