@bigbinary/neeto-site-blocks 1.10.7 → 1.11.0-beta2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -17414,13 +17414,6 @@ function getWindow() {
17414
17414
  return win;
17415
17415
  }
17416
17416
 
17417
- function classesToTokens(classes) {
17418
- if (classes === void 0) {
17419
- classes = '';
17420
- }
17421
- return classes.trim().split(' ').filter(c => !!c.trim());
17422
- }
17423
-
17424
17417
  function deleteProps(obj) {
17425
17418
  const object = obj;
17426
17419
  Object.keys(object).forEach(key => {
@@ -17597,20 +17590,12 @@ function elementChildren(element, selector) {
17597
17590
  }
17598
17591
  return [...element.children].filter(el => el.matches(selector));
17599
17592
  }
17600
- function showWarning(text) {
17601
- try {
17602
- console.warn(text);
17603
- return;
17604
- } catch (err) {
17605
- // err
17606
- }
17607
- }
17608
17593
  function createElement(tag, classes) {
17609
17594
  if (classes === void 0) {
17610
17595
  classes = [];
17611
17596
  }
17612
17597
  const el = document.createElement(tag);
17613
- el.classList.add(...(Array.isArray(classes) ? classes : classesToTokens(classes)));
17598
+ el.classList.add(...(Array.isArray(classes) ? classes : [classes]));
17614
17599
  return el;
17615
17600
  }
17616
17601
  function elementOffset(el) {
@@ -17759,7 +17744,6 @@ function getDevice(overrides) {
17759
17744
  let browser$1;
17760
17745
  function calcBrowser() {
17761
17746
  const window = getWindow();
17762
- const device = getDevice();
17763
17747
  let needPerspectiveFix = false;
17764
17748
  function isSafari() {
17765
17749
  const ua = window.navigator.userAgent.toLowerCase();
@@ -17772,14 +17756,10 @@ function calcBrowser() {
17772
17756
  needPerspectiveFix = major < 16 || major === 16 && minor < 2;
17773
17757
  }
17774
17758
  }
17775
- const isWebView = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent);
17776
- const isSafariBrowser = isSafari();
17777
- const need3dFix = isSafariBrowser || isWebView && device.ios;
17778
17759
  return {
17779
- isSafari: needPerspectiveFix || isSafariBrowser,
17760
+ isSafari: needPerspectiveFix || isSafari(),
17780
17761
  needPerspectiveFix,
17781
- need3dFix,
17782
- isWebView
17762
+ isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent)
17783
17763
  };
17784
17764
  }
17785
17765
  function getBrowser() {
@@ -18068,8 +18048,24 @@ function updateSize() {
18068
18048
 
18069
18049
  function updateSlides() {
18070
18050
  const swiper = this;
18051
+ function getDirectionLabel(property) {
18052
+ if (swiper.isHorizontal()) {
18053
+ return property;
18054
+ }
18055
+ // prettier-ignore
18056
+ return {
18057
+ 'width': 'height',
18058
+ 'margin-top': 'margin-left',
18059
+ 'margin-bottom ': 'margin-right',
18060
+ 'margin-left': 'margin-top',
18061
+ 'margin-right': 'margin-bottom',
18062
+ 'padding-left': 'padding-top',
18063
+ 'padding-right': 'padding-bottom',
18064
+ 'marginRight': 'marginBottom'
18065
+ }[property];
18066
+ }
18071
18067
  function getDirectionPropertyValue(node, label) {
18072
- return parseFloat(node.getPropertyValue(swiper.getDirectionLabel(label)) || 0);
18068
+ return parseFloat(node.getPropertyValue(getDirectionLabel(label)) || 0);
18073
18069
  }
18074
18070
  const params = swiper.params;
18075
18071
  const {
@@ -18128,9 +18124,7 @@ function updateSlides() {
18128
18124
  }
18129
18125
  const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;
18130
18126
  if (gridEnabled) {
18131
- swiper.grid.initSlides(slides);
18132
- } else if (swiper.grid) {
18133
- swiper.grid.unsetSlides();
18127
+ swiper.grid.initSlides(slidesLength);
18134
18128
  }
18135
18129
 
18136
18130
  // Calc slides
@@ -18143,13 +18137,13 @@ function updateSlides() {
18143
18137
  let slide;
18144
18138
  if (slides[i]) slide = slides[i];
18145
18139
  if (gridEnabled) {
18146
- swiper.grid.updateSlide(i, slide, slides);
18140
+ swiper.grid.updateSlide(i, slide, slidesLength, getDirectionLabel);
18147
18141
  }
18148
18142
  if (slides[i] && elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line
18149
18143
 
18150
18144
  if (params.slidesPerView === 'auto') {
18151
18145
  if (shouldResetSlideSize) {
18152
- slides[i].style[swiper.getDirectionLabel('width')] = ``;
18146
+ slides[i].style[getDirectionLabel('width')] = ``;
18153
18147
  }
18154
18148
  const slideStyles = getComputedStyle(slide);
18155
18149
  const currentTransform = slide.style.transform;
@@ -18191,7 +18185,7 @@ function updateSlides() {
18191
18185
  slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;
18192
18186
  if (params.roundLengths) slideSize = Math.floor(slideSize);
18193
18187
  if (slides[i]) {
18194
- slides[i].style[swiper.getDirectionLabel('width')] = `${slideSize}px`;
18188
+ slides[i].style[getDirectionLabel('width')] = `${slideSize}px`;
18195
18189
  }
18196
18190
  }
18197
18191
  if (slides[i]) {
@@ -18221,10 +18215,10 @@ function updateSlides() {
18221
18215
  wrapperEl.style.width = `${swiper.virtualSize + spaceBetween}px`;
18222
18216
  }
18223
18217
  if (params.setWrapperSize) {
18224
- wrapperEl.style[swiper.getDirectionLabel('width')] = `${swiper.virtualSize + spaceBetween}px`;
18218
+ wrapperEl.style[getDirectionLabel('width')] = `${swiper.virtualSize + spaceBetween}px`;
18225
18219
  }
18226
18220
  if (gridEnabled) {
18227
- swiper.grid.updateWrapperSize(slideSize, snapGrid);
18221
+ swiper.grid.updateWrapperSize(slideSize, snapGrid, getDirectionLabel);
18228
18222
  }
18229
18223
 
18230
18224
  // Remove last grid elements depending on width
@@ -18261,7 +18255,7 @@ function updateSlides() {
18261
18255
  }
18262
18256
  if (snapGrid.length === 0) snapGrid = [0];
18263
18257
  if (spaceBetween !== 0) {
18264
- const key = swiper.isHorizontal() && rtl ? 'marginLeft' : swiper.getDirectionLabel('marginRight');
18258
+ const key = swiper.isHorizontal() && rtl ? 'marginLeft' : getDirectionLabel('marginRight');
18265
18259
  slides.filter((_, slideIndex) => {
18266
18260
  if (!params.cssMode || params.loop) return true;
18267
18261
  if (slideIndex === slides.length - 1) {
@@ -18291,9 +18285,8 @@ function updateSlides() {
18291
18285
  allSlidesSize += slideSizeValue + (spaceBetween || 0);
18292
18286
  });
18293
18287
  allSlidesSize -= spaceBetween;
18294
- const offsetSize = (params.slidesOffsetBefore || 0) + (params.slidesOffsetAfter || 0);
18295
- if (allSlidesSize + offsetSize < swiperSize) {
18296
- const allSlidesOffset = (swiperSize - allSlidesSize - offsetSize) / 2;
18288
+ if (allSlidesSize < swiperSize) {
18289
+ const allSlidesOffset = (swiperSize - allSlidesSize) / 2;
18297
18290
  snapGrid.forEach((snap, snapIndex) => {
18298
18291
  snapGrid[snapIndex] = snap - allSlidesOffset;
18299
18292
  });
@@ -18329,7 +18322,6 @@ function updateSlides() {
18329
18322
  if (params.watchSlidesProgress) {
18330
18323
  swiper.updateSlidesOffset();
18331
18324
  }
18332
- swiper.emit('slidesUpdated');
18333
18325
  if (!isVirtual && !params.cssMode && (params.effect === 'slide' || params.effect === 'fade')) {
18334
18326
  const backFaceHiddenClass = `${params.containerModifierClass}backface-hidden`;
18335
18327
  const hasClassBackfaceClassAdded = swiper.el.classList.contains(backFaceHiddenClass);
@@ -18397,13 +18389,6 @@ function updateSlidesOffset() {
18397
18389
  }
18398
18390
  }
18399
18391
 
18400
- const toggleSlideClasses$1 = (slideEl, condition, className) => {
18401
- if (condition && !slideEl.classList.contains(className)) {
18402
- slideEl.classList.add(className);
18403
- } else if (!condition && slideEl.classList.contains(className)) {
18404
- slideEl.classList.remove(className);
18405
- }
18406
- };
18407
18392
  function updateSlidesProgress(translate) {
18408
18393
  if (translate === void 0) {
18409
18394
  translate = this && this.translate || 0;
@@ -18419,6 +18404,11 @@ function updateSlidesProgress(translate) {
18419
18404
  if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();
18420
18405
  let offsetCenter = -translate;
18421
18406
  if (rtl) offsetCenter = translate;
18407
+
18408
+ // Visible Slides
18409
+ slides.forEach(slideEl => {
18410
+ slideEl.classList.remove(params.slideVisibleClass);
18411
+ });
18422
18412
  swiper.visibleSlidesIndexes = [];
18423
18413
  swiper.visibleSlides = [];
18424
18414
  let spaceBetween = params.spaceBetween;
@@ -18437,14 +18427,12 @@ function updateSlidesProgress(translate) {
18437
18427
  const originalSlideProgress = (offsetCenter - snapGrid[0] + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + spaceBetween);
18438
18428
  const slideBefore = -(offsetCenter - slideOffset);
18439
18429
  const slideAfter = slideBefore + swiper.slidesSizesGrid[i];
18440
- const isFullyVisible = slideBefore >= 0 && slideBefore <= swiper.size - swiper.slidesSizesGrid[i];
18441
18430
  const isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size;
18442
18431
  if (isVisible) {
18443
18432
  swiper.visibleSlides.push(slide);
18444
18433
  swiper.visibleSlidesIndexes.push(i);
18434
+ slides[i].classList.add(params.slideVisibleClass);
18445
18435
  }
18446
- toggleSlideClasses$1(slide, isVisible, params.slideVisibleClass);
18447
- toggleSlideClasses$1(slide, isFullyVisible, params.slideFullyVisibleClass);
18448
18436
  slide.progress = rtl ? -slideProgress : slideProgress;
18449
18437
  slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress;
18450
18438
  }
@@ -18513,13 +18501,6 @@ function updateProgress(translate) {
18513
18501
  swiper.emit('progress', progress);
18514
18502
  }
18515
18503
 
18516
- const toggleSlideClasses = (slideEl, condition, className) => {
18517
- if (condition && !slideEl.classList.contains(className)) {
18518
- slideEl.classList.add(className);
18519
- } else if (!condition && slideEl.classList.contains(className)) {
18520
- slideEl.classList.remove(className);
18521
- }
18522
- };
18523
18504
  function updateSlidesClasses() {
18524
18505
  const swiper = this;
18525
18506
  const {
@@ -18529,13 +18510,13 @@ function updateSlidesClasses() {
18529
18510
  activeIndex
18530
18511
  } = swiper;
18531
18512
  const isVirtual = swiper.virtual && params.virtual.enabled;
18532
- const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
18533
18513
  const getFilteredSlide = selector => {
18534
18514
  return elementChildren(slidesEl, `.${params.slideClass}${selector}, swiper-slide${selector}`)[0];
18535
18515
  };
18516
+ slides.forEach(slideEl => {
18517
+ slideEl.classList.remove(params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
18518
+ });
18536
18519
  let activeSlide;
18537
- let prevSlide;
18538
- let nextSlide;
18539
18520
  if (isVirtual) {
18540
18521
  if (params.loop) {
18541
18522
  let slideIndex = activeIndex - swiper.virtual.slidesBefore;
@@ -18546,34 +18527,29 @@ function updateSlidesClasses() {
18546
18527
  activeSlide = getFilteredSlide(`[data-swiper-slide-index="${activeIndex}"]`);
18547
18528
  }
18548
18529
  } else {
18549
- if (gridEnabled) {
18550
- activeSlide = slides.filter(slideEl => slideEl.column === activeIndex)[0];
18551
- nextSlide = slides.filter(slideEl => slideEl.column === activeIndex + 1)[0];
18552
- prevSlide = slides.filter(slideEl => slideEl.column === activeIndex - 1)[0];
18553
- } else {
18554
- activeSlide = slides[activeIndex];
18555
- }
18530
+ activeSlide = slides[activeIndex];
18556
18531
  }
18557
18532
  if (activeSlide) {
18558
- if (!gridEnabled) {
18559
- // Next Slide
18560
- nextSlide = elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
18561
- if (params.loop && !nextSlide) {
18562
- nextSlide = slides[0];
18563
- }
18533
+ // Active classes
18534
+ activeSlide.classList.add(params.slideActiveClass);
18564
18535
 
18565
- // Prev Slide
18566
- prevSlide = elementPrevAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
18567
- if (params.loop && !prevSlide === 0) {
18568
- prevSlide = slides[slides.length - 1];
18569
- }
18536
+ // Next Slide
18537
+ let nextSlide = elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
18538
+ if (params.loop && !nextSlide) {
18539
+ nextSlide = slides[0];
18540
+ }
18541
+ if (nextSlide) {
18542
+ nextSlide.classList.add(params.slideNextClass);
18543
+ }
18544
+ // Prev Slide
18545
+ let prevSlide = elementPrevAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
18546
+ if (params.loop && !prevSlide === 0) {
18547
+ prevSlide = slides[slides.length - 1];
18548
+ }
18549
+ if (prevSlide) {
18550
+ prevSlide.classList.add(params.slidePrevClass);
18570
18551
  }
18571
18552
  }
18572
- slides.forEach(slideEl => {
18573
- toggleSlideClasses(slideEl, slideEl === activeSlide, params.slideActiveClass);
18574
- toggleSlideClasses(slideEl, slideEl === nextSlide, params.slideNextClass);
18575
- toggleSlideClasses(slideEl, slideEl === prevSlide, params.slidePrevClass);
18576
- });
18577
18553
  swiper.emitSlidesClasses();
18578
18554
  }
18579
18555
 
@@ -18696,37 +18672,22 @@ function updateActiveIndex(newActiveIndex) {
18696
18672
  snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);
18697
18673
  }
18698
18674
  if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
18699
- if (activeIndex === previousIndex && !swiper.params.loop) {
18675
+ if (activeIndex === previousIndex) {
18700
18676
  if (snapIndex !== previousSnapIndex) {
18701
18677
  swiper.snapIndex = snapIndex;
18702
18678
  swiper.emit('snapIndexChange');
18703
18679
  }
18680
+ if (swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {
18681
+ swiper.realIndex = getVirtualRealIndex(activeIndex);
18682
+ }
18704
18683
  return;
18705
18684
  }
18706
- if (activeIndex === previousIndex && swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {
18707
- swiper.realIndex = getVirtualRealIndex(activeIndex);
18708
- return;
18709
- }
18710
- const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
18711
-
18712
18685
  // Get real index
18713
18686
  let realIndex;
18714
18687
  if (swiper.virtual && params.virtual.enabled && params.loop) {
18715
18688
  realIndex = getVirtualRealIndex(activeIndex);
18716
- } else if (gridEnabled) {
18717
- const firstSlideInColumn = swiper.slides.filter(slideEl => slideEl.column === activeIndex)[0];
18718
- let activeSlideIndex = parseInt(firstSlideInColumn.getAttribute('data-swiper-slide-index'), 10);
18719
- if (Number.isNaN(activeSlideIndex)) {
18720
- activeSlideIndex = Math.max(swiper.slides.indexOf(firstSlideInColumn), 0);
18721
- }
18722
- realIndex = Math.floor(activeSlideIndex / params.grid.rows);
18723
18689
  } else if (swiper.slides[activeIndex]) {
18724
- const slideIndex = swiper.slides[activeIndex].getAttribute('data-swiper-slide-index');
18725
- if (slideIndex) {
18726
- realIndex = parseInt(slideIndex, 10);
18727
- } else {
18728
- realIndex = activeIndex;
18729
- }
18690
+ realIndex = parseInt(swiper.slides[activeIndex].getAttribute('data-swiper-slide-index') || activeIndex, 10);
18730
18691
  } else {
18731
18692
  realIndex = activeIndex;
18732
18693
  }
@@ -18951,7 +18912,6 @@ function translateTo(translate, speed, runCallbacks, translateBounds, internal)
18951
18912
  swiper.wrapperEl.removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
18952
18913
  swiper.onTranslateToWrapperTransitionEnd = null;
18953
18914
  delete swiper.onTranslateToWrapperTransitionEnd;
18954
- swiper.animating = false;
18955
18915
  if (runCallbacks) {
18956
18916
  swiper.emit('transitionEnd');
18957
18917
  }
@@ -19059,6 +19019,9 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
19059
19019
  if (index === void 0) {
19060
19020
  index = 0;
19061
19021
  }
19022
+ if (speed === void 0) {
19023
+ speed = this.params.speed;
19024
+ }
19062
19025
  if (runCallbacks === void 0) {
19063
19026
  runCallbacks = true;
19064
19027
  }
@@ -19078,12 +19041,9 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
19078
19041
  wrapperEl,
19079
19042
  enabled
19080
19043
  } = swiper;
19081
- if (!enabled && !internal && !initial || swiper.destroyed || swiper.animating && params.preventInteractionOnTransition) {
19044
+ if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial) {
19082
19045
  return false;
19083
19046
  }
19084
- if (typeof speed === 'undefined') {
19085
- speed = swiper.params.speed;
19086
- }
19087
19047
  const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
19088
19048
  let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
19089
19049
  if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
@@ -19210,6 +19170,9 @@ function slideToLoop(index, speed, runCallbacks, internal) {
19210
19170
  if (index === void 0) {
19211
19171
  index = 0;
19212
19172
  }
19173
+ if (speed === void 0) {
19174
+ speed = this.params.speed;
19175
+ }
19213
19176
  if (runCallbacks === void 0) {
19214
19177
  runCallbacks = true;
19215
19178
  }
@@ -19218,69 +19181,23 @@ function slideToLoop(index, speed, runCallbacks, internal) {
19218
19181
  index = indexAsNumber;
19219
19182
  }
19220
19183
  const swiper = this;
19221
- if (swiper.destroyed) return;
19222
- if (typeof speed === 'undefined') {
19223
- speed = swiper.params.speed;
19224
- }
19225
- const gridEnabled = swiper.grid && swiper.params.grid && swiper.params.grid.rows > 1;
19226
19184
  let newIndex = index;
19227
19185
  if (swiper.params.loop) {
19228
19186
  if (swiper.virtual && swiper.params.virtual.enabled) {
19229
19187
  // eslint-disable-next-line
19230
19188
  newIndex = newIndex + swiper.virtual.slidesBefore;
19231
19189
  } else {
19232
- let targetSlideIndex;
19233
- if (gridEnabled) {
19234
- const slideIndex = newIndex * swiper.params.grid.rows;
19235
- targetSlideIndex = swiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex)[0].column;
19236
- } else {
19237
- targetSlideIndex = swiper.getSlideIndexByData(newIndex);
19238
- }
19239
- const cols = gridEnabled ? Math.ceil(swiper.slides.length / swiper.params.grid.rows) : swiper.slides.length;
19240
- const {
19241
- centeredSlides
19242
- } = swiper.params;
19243
- let slidesPerView = swiper.params.slidesPerView;
19244
- if (slidesPerView === 'auto') {
19245
- slidesPerView = swiper.slidesPerViewDynamic();
19246
- } else {
19247
- slidesPerView = Math.ceil(parseFloat(swiper.params.slidesPerView, 10));
19248
- if (centeredSlides && slidesPerView % 2 === 0) {
19249
- slidesPerView = slidesPerView + 1;
19250
- }
19251
- }
19252
- let needLoopFix = cols - targetSlideIndex < slidesPerView;
19253
- if (centeredSlides) {
19254
- needLoopFix = needLoopFix || targetSlideIndex < Math.ceil(slidesPerView / 2);
19255
- }
19256
- if (internal && centeredSlides && swiper.params.slidesPerView !== 'auto' && !gridEnabled) {
19257
- needLoopFix = false;
19258
- }
19259
- if (needLoopFix) {
19260
- const direction = centeredSlides ? targetSlideIndex < swiper.activeIndex ? 'prev' : 'next' : targetSlideIndex - swiper.activeIndex - 1 < swiper.params.slidesPerView ? 'next' : 'prev';
19261
- swiper.loopFix({
19262
- direction,
19263
- slideTo: true,
19264
- activeSlideIndex: direction === 'next' ? targetSlideIndex + 1 : targetSlideIndex - cols + 1,
19265
- slideRealIndex: direction === 'next' ? swiper.realIndex : undefined
19266
- });
19267
- }
19268
- if (gridEnabled) {
19269
- const slideIndex = newIndex * swiper.params.grid.rows;
19270
- newIndex = swiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex)[0].column;
19271
- } else {
19272
- newIndex = swiper.getSlideIndexByData(newIndex);
19273
- }
19190
+ newIndex = swiper.getSlideIndexByData(newIndex);
19274
19191
  }
19275
19192
  }
19276
- requestAnimationFrame(() => {
19277
- swiper.slideTo(newIndex, speed, runCallbacks, internal);
19278
- });
19279
- return swiper;
19193
+ return swiper.slideTo(newIndex, speed, runCallbacks, internal);
19280
19194
  }
19281
19195
 
19282
19196
  /* eslint no-unused-vars: "off" */
19283
19197
  function slideNext(speed, runCallbacks, internal) {
19198
+ if (speed === void 0) {
19199
+ speed = this.params.speed;
19200
+ }
19284
19201
  if (runCallbacks === void 0) {
19285
19202
  runCallbacks = true;
19286
19203
  }
@@ -19290,10 +19207,7 @@ function slideNext(speed, runCallbacks, internal) {
19290
19207
  params,
19291
19208
  animating
19292
19209
  } = swiper;
19293
- if (!enabled || swiper.destroyed) return swiper;
19294
- if (typeof speed === 'undefined') {
19295
- speed = swiper.params.speed;
19296
- }
19210
+ if (!enabled) return swiper;
19297
19211
  let perGroup = params.slidesPerGroup;
19298
19212
  if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
19299
19213
  perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1);
@@ -19309,7 +19223,7 @@ function slideNext(speed, runCallbacks, internal) {
19309
19223
  swiper._clientLeft = swiper.wrapperEl.clientLeft;
19310
19224
  if (swiper.activeIndex === swiper.slides.length - 1 && params.cssMode) {
19311
19225
  requestAnimationFrame(() => {
19312
- swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);
19226
+ swiper.slideTo(swiper.activeIndex + increment);
19313
19227
  });
19314
19228
  return true;
19315
19229
  }
@@ -19317,11 +19231,14 @@ function slideNext(speed, runCallbacks, internal) {
19317
19231
  if (params.rewind && swiper.isEnd) {
19318
19232
  return swiper.slideTo(0, speed, runCallbacks, internal);
19319
19233
  }
19320
- return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);
19234
+ return swiper.slideTo(swiper.activeIndex + increment);
19321
19235
  }
19322
19236
 
19323
19237
  /* eslint no-unused-vars: "off" */
19324
19238
  function slidePrev(speed, runCallbacks, internal) {
19239
+ if (speed === void 0) {
19240
+ speed = this.params.speed;
19241
+ }
19325
19242
  if (runCallbacks === void 0) {
19326
19243
  runCallbacks = true;
19327
19244
  }
@@ -19334,10 +19251,7 @@ function slidePrev(speed, runCallbacks, internal) {
19334
19251
  enabled,
19335
19252
  animating
19336
19253
  } = swiper;
19337
- if (!enabled || swiper.destroyed) return swiper;
19338
- if (typeof speed === 'undefined') {
19339
- speed = swiper.params.speed;
19340
- }
19254
+ if (!enabled) return swiper;
19341
19255
  const isVirtual = swiper.virtual && params.virtual.enabled;
19342
19256
  if (params.loop) {
19343
19257
  if (animating && !isVirtual && params.loopPreventsSliding) return false;
@@ -19390,19 +19304,21 @@ function slidePrev(speed, runCallbacks, internal) {
19390
19304
 
19391
19305
  /* eslint no-unused-vars: "off" */
19392
19306
  function slideReset(speed, runCallbacks, internal) {
19307
+ if (speed === void 0) {
19308
+ speed = this.params.speed;
19309
+ }
19393
19310
  if (runCallbacks === void 0) {
19394
19311
  runCallbacks = true;
19395
19312
  }
19396
19313
  const swiper = this;
19397
- if (swiper.destroyed) return;
19398
- if (typeof speed === 'undefined') {
19399
- speed = swiper.params.speed;
19400
- }
19401
19314
  return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
19402
19315
  }
19403
19316
 
19404
19317
  /* eslint no-unused-vars: "off" */
19405
19318
  function slideToClosest(speed, runCallbacks, internal, threshold) {
19319
+ if (speed === void 0) {
19320
+ speed = this.params.speed;
19321
+ }
19406
19322
  if (runCallbacks === void 0) {
19407
19323
  runCallbacks = true;
19408
19324
  }
@@ -19410,10 +19326,6 @@ function slideToClosest(speed, runCallbacks, internal, threshold) {
19410
19326
  threshold = 0.5;
19411
19327
  }
19412
19328
  const swiper = this;
19413
- if (swiper.destroyed) return;
19414
- if (typeof speed === 'undefined') {
19415
- speed = swiper.params.speed;
19416
- }
19417
19329
  let index = swiper.activeIndex;
19418
19330
  const skip = Math.min(swiper.params.slidesPerGroupSkip, index);
19419
19331
  const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
@@ -19442,7 +19354,6 @@ function slideToClosest(speed, runCallbacks, internal, threshold) {
19442
19354
 
19443
19355
  function slideToClickedSlide() {
19444
19356
  const swiper = this;
19445
- if (swiper.destroyed) return;
19446
19357
  const {
19447
19358
  params,
19448
19359
  slidesEl
@@ -19495,45 +19406,10 @@ function loopCreate(slideRealIndex) {
19495
19406
  slidesEl
19496
19407
  } = swiper;
19497
19408
  if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;
19498
- const initSlides = () => {
19499
- const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
19500
- slides.forEach((el, index) => {
19501
- el.setAttribute('data-swiper-slide-index', index);
19502
- });
19503
- };
19504
- const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
19505
- const slidesPerGroup = params.slidesPerGroup * (gridEnabled ? params.grid.rows : 1);
19506
- const shouldFillGroup = swiper.slides.length % slidesPerGroup !== 0;
19507
- const shouldFillGrid = gridEnabled && swiper.slides.length % params.grid.rows !== 0;
19508
- const addBlankSlides = amountOfSlides => {
19509
- for (let i = 0; i < amountOfSlides; i += 1) {
19510
- const slideEl = swiper.isElement ? createElement('swiper-slide', [params.slideBlankClass]) : createElement('div', [params.slideClass, params.slideBlankClass]);
19511
- swiper.slidesEl.append(slideEl);
19512
- }
19513
- };
19514
- if (shouldFillGroup) {
19515
- if (params.loopAddBlankSlides) {
19516
- const slidesToAdd = slidesPerGroup - swiper.slides.length % slidesPerGroup;
19517
- addBlankSlides(slidesToAdd);
19518
- swiper.recalcSlides();
19519
- swiper.updateSlides();
19520
- } else {
19521
- showWarning('Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)');
19522
- }
19523
- initSlides();
19524
- } else if (shouldFillGrid) {
19525
- if (params.loopAddBlankSlides) {
19526
- const slidesToAdd = params.grid.rows - swiper.slides.length % params.grid.rows;
19527
- addBlankSlides(slidesToAdd);
19528
- swiper.recalcSlides();
19529
- swiper.updateSlides();
19530
- } else {
19531
- showWarning('Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)');
19532
- }
19533
- initSlides();
19534
- } else {
19535
- initSlides();
19536
- }
19409
+ const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
19410
+ slides.forEach((el, index) => {
19411
+ el.setAttribute('data-swiper-slide-index', index);
19412
+ });
19537
19413
  swiper.loopFix({
19538
19414
  slideRealIndex,
19539
19415
  direction: params.centeredSlides ? undefined : 'next'
@@ -19560,9 +19436,6 @@ function loopFix(_temp) {
19560
19436
  slidesEl,
19561
19437
  params
19562
19438
  } = swiper;
19563
- const {
19564
- centeredSlides
19565
- } = params;
19566
19439
  swiper.allowSlidePrev = true;
19567
19440
  swiper.allowSlideNext = true;
19568
19441
  if (swiper.virtual && params.virtual.enabled) {
@@ -19580,33 +19453,17 @@ function loopFix(_temp) {
19580
19453
  swiper.emit('loopFix');
19581
19454
  return;
19582
19455
  }
19583
- let slidesPerView = params.slidesPerView;
19584
- if (slidesPerView === 'auto') {
19585
- slidesPerView = swiper.slidesPerViewDynamic();
19586
- } else {
19587
- slidesPerView = Math.ceil(parseFloat(params.slidesPerView, 10));
19588
- if (centeredSlides && slidesPerView % 2 === 0) {
19589
- slidesPerView = slidesPerView + 1;
19590
- }
19591
- }
19592
- const slidesPerGroup = params.slidesPerGroupAuto ? slidesPerView : params.slidesPerGroup;
19593
- let loopedSlides = slidesPerGroup;
19594
- if (loopedSlides % slidesPerGroup !== 0) {
19595
- loopedSlides += slidesPerGroup - loopedSlides % slidesPerGroup;
19456
+ const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(params.slidesPerView, 10));
19457
+ let loopedSlides = params.loopedSlides || slidesPerView;
19458
+ if (loopedSlides % params.slidesPerGroup !== 0) {
19459
+ loopedSlides += params.slidesPerGroup - loopedSlides % params.slidesPerGroup;
19596
19460
  }
19597
- loopedSlides += params.loopAdditionalSlides;
19598
19461
  swiper.loopedSlides = loopedSlides;
19599
- const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
19600
- if (slides.length < slidesPerView + loopedSlides) {
19601
- showWarning('Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled and not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters');
19602
- } else if (gridEnabled && params.grid.fill === 'row') {
19603
- showWarning('Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`');
19604
- }
19605
19462
  const prependSlidesIndexes = [];
19606
19463
  const appendSlidesIndexes = [];
19607
19464
  let activeIndex = swiper.activeIndex;
19608
19465
  if (typeof activeSlideIndex === 'undefined') {
19609
- activeSlideIndex = swiper.getSlideIndex(slides.filter(el => el.classList.contains(params.slideActiveClass))[0]);
19466
+ activeSlideIndex = swiper.getSlideIndex(swiper.slides.filter(el => el.classList.contains(params.slideActiveClass))[0]);
19610
19467
  } else {
19611
19468
  activeIndex = activeSlideIndex;
19612
19469
  }
@@ -19614,64 +19471,37 @@ function loopFix(_temp) {
19614
19471
  const isPrev = direction === 'prev' || !direction;
19615
19472
  let slidesPrepended = 0;
19616
19473
  let slidesAppended = 0;
19617
- const cols = gridEnabled ? Math.ceil(slides.length / params.grid.rows) : slides.length;
19618
- const activeColIndex = gridEnabled ? slides[activeSlideIndex].column : activeSlideIndex;
19619
- const activeColIndexWithShift = activeColIndex + (centeredSlides && typeof setTranslate === 'undefined' ? -slidesPerView / 2 + 0.5 : 0);
19620
19474
  // prepend last slides before start
19621
- if (activeColIndexWithShift < loopedSlides) {
19622
- slidesPrepended = Math.max(loopedSlides - activeColIndexWithShift, slidesPerGroup);
19623
- for (let i = 0; i < loopedSlides - activeColIndexWithShift; i += 1) {
19624
- const index = i - Math.floor(i / cols) * cols;
19625
- if (gridEnabled) {
19626
- const colIndexToPrepend = cols - index - 1;
19627
- for (let i = slides.length - 1; i >= 0; i -= 1) {
19628
- if (slides[i].column === colIndexToPrepend) prependSlidesIndexes.push(i);
19629
- }
19630
- // slides.forEach((slide, slideIndex) => {
19631
- // if (slide.column === colIndexToPrepend) prependSlidesIndexes.push(slideIndex);
19632
- // });
19633
- } else {
19634
- prependSlidesIndexes.push(cols - index - 1);
19635
- }
19636
- }
19637
- } else if (activeColIndexWithShift + slidesPerView > cols - loopedSlides) {
19638
- slidesAppended = Math.max(activeColIndexWithShift - (cols - loopedSlides * 2), slidesPerGroup);
19475
+ if (activeSlideIndex < loopedSlides) {
19476
+ slidesPrepended = Math.max(loopedSlides - activeSlideIndex, params.slidesPerGroup);
19477
+ for (let i = 0; i < loopedSlides - activeSlideIndex; i += 1) {
19478
+ const index = i - Math.floor(i / slides.length) * slides.length;
19479
+ prependSlidesIndexes.push(slides.length - index - 1);
19480
+ }
19481
+ } else if (activeSlideIndex /* + slidesPerView */ > swiper.slides.length - loopedSlides * 2) {
19482
+ slidesAppended = Math.max(activeSlideIndex - (swiper.slides.length - loopedSlides * 2), params.slidesPerGroup);
19639
19483
  for (let i = 0; i < slidesAppended; i += 1) {
19640
- const index = i - Math.floor(i / cols) * cols;
19641
- if (gridEnabled) {
19642
- slides.forEach((slide, slideIndex) => {
19643
- if (slide.column === index) appendSlidesIndexes.push(slideIndex);
19644
- });
19645
- } else {
19646
- appendSlidesIndexes.push(index);
19647
- }
19484
+ const index = i - Math.floor(i / slides.length) * slides.length;
19485
+ appendSlidesIndexes.push(index);
19648
19486
  }
19649
19487
  }
19650
- swiper.__preventObserver__ = true;
19651
- requestAnimationFrame(() => {
19652
- swiper.__preventObserver__ = false;
19653
- });
19654
19488
  if (isPrev) {
19655
19489
  prependSlidesIndexes.forEach(index => {
19656
- slides[index].swiperLoopMoveDOM = true;
19657
- slidesEl.prepend(slides[index]);
19658
- slides[index].swiperLoopMoveDOM = false;
19490
+ swiper.slides[index].swiperLoopMoveDOM = true;
19491
+ slidesEl.prepend(swiper.slides[index]);
19492
+ swiper.slides[index].swiperLoopMoveDOM = false;
19659
19493
  });
19660
19494
  }
19661
19495
  if (isNext) {
19662
19496
  appendSlidesIndexes.forEach(index => {
19663
- slides[index].swiperLoopMoveDOM = true;
19664
- slidesEl.append(slides[index]);
19665
- slides[index].swiperLoopMoveDOM = false;
19497
+ swiper.slides[index].swiperLoopMoveDOM = true;
19498
+ slidesEl.append(swiper.slides[index]);
19499
+ swiper.slides[index].swiperLoopMoveDOM = false;
19666
19500
  });
19667
19501
  }
19668
19502
  swiper.recalcSlides();
19669
19503
  if (params.slidesPerView === 'auto') {
19670
19504
  swiper.updateSlides();
19671
- } else if (gridEnabled && (prependSlidesIndexes.length > 0 && isPrev || appendSlidesIndexes.length > 0 && isNext)) {
19672
- swiper.slides.forEach((slide, slideIndex) => {
19673
- swiper.grid.updateSlide(slideIndex, slide, swiper.slides);
19674
- });
19675
19505
  }
19676
19506
  if (params.watchSlidesProgress) {
19677
19507
  swiper.updateSlidesOffset();
@@ -19685,16 +19515,15 @@ function loopFix(_temp) {
19685
19515
  if (byMousewheel) {
19686
19516
  swiper.setTranslate(swiper.translate - diff);
19687
19517
  } else {
19688
- swiper.slideTo(activeIndex + Math.ceil(slidesPrepended), 0, false, true);
19518
+ swiper.slideTo(activeIndex + slidesPrepended, 0, false, true);
19689
19519
  if (setTranslate) {
19690
- swiper.touchEventsData.startTranslate = swiper.touchEventsData.startTranslate - diff;
19691
- swiper.touchEventsData.currentTranslate = swiper.touchEventsData.currentTranslate - diff;
19520
+ swiper.touches[swiper.isHorizontal() ? 'startX' : 'startY'] += diff;
19521
+ swiper.touchEventsData.currentTranslate = swiper.translate;
19692
19522
  }
19693
19523
  }
19694
19524
  } else {
19695
19525
  if (setTranslate) {
19696
- const shift = gridEnabled ? prependSlidesIndexes.length / params.grid.rows : prependSlidesIndexes.length;
19697
- swiper.slideTo(swiper.activeIndex + shift, 0, false, true);
19526
+ swiper.slideToLoop(slideRealIndex, 0, false, true);
19698
19527
  swiper.touchEventsData.currentTranslate = swiper.translate;
19699
19528
  }
19700
19529
  }
@@ -19708,13 +19537,12 @@ function loopFix(_temp) {
19708
19537
  } else {
19709
19538
  swiper.slideTo(activeIndex - slidesAppended, 0, false, true);
19710
19539
  if (setTranslate) {
19711
- swiper.touchEventsData.startTranslate = swiper.touchEventsData.startTranslate - diff;
19712
- swiper.touchEventsData.currentTranslate = swiper.touchEventsData.currentTranslate - diff;
19540
+ swiper.touches[swiper.isHorizontal() ? 'startX' : 'startY'] += diff;
19541
+ swiper.touchEventsData.currentTranslate = swiper.translate;
19713
19542
  }
19714
19543
  }
19715
19544
  } else {
19716
- const shift = gridEnabled ? appendSlidesIndexes.length / params.grid.rows : appendSlidesIndexes.length;
19717
- swiper.slideTo(swiper.activeIndex - shift, 0, false, true);
19545
+ swiper.slideToLoop(slideRealIndex, 0, false, true);
19718
19546
  }
19719
19547
  }
19720
19548
  }
@@ -19827,54 +19655,27 @@ function closestElement(selector, base) {
19827
19655
  }
19828
19656
  return __closestFrom(base);
19829
19657
  }
19830
- function preventEdgeSwipe(swiper, event, startX) {
19831
- const window = getWindow();
19832
- const {
19833
- params
19834
- } = swiper;
19835
- const edgeSwipeDetection = params.edgeSwipeDetection;
19836
- const edgeSwipeThreshold = params.edgeSwipeThreshold;
19837
- if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) {
19838
- if (edgeSwipeDetection === 'prevent') {
19839
- event.preventDefault();
19840
- return true;
19841
- }
19842
- return false;
19843
- }
19844
- return true;
19845
- }
19846
19658
  function onTouchStart(event) {
19847
19659
  const swiper = this;
19848
19660
  const document = getDocument();
19849
- let e = event;
19850
- if (e.originalEvent) e = e.originalEvent;
19661
+ const window = getWindow();
19851
19662
  const data = swiper.touchEventsData;
19852
- if (e.type === 'pointerdown') {
19853
- if (data.pointerId !== null && data.pointerId !== e.pointerId) {
19854
- return;
19855
- }
19856
- data.pointerId = e.pointerId;
19857
- } else if (e.type === 'touchstart' && e.targetTouches.length === 1) {
19858
- data.touchId = e.targetTouches[0].identifier;
19859
- }
19860
- if (e.type === 'touchstart') {
19861
- // don't proceed touch event
19862
- preventEdgeSwipe(swiper, e, e.targetTouches[0].pageX);
19863
- return;
19864
- }
19663
+ data.evCache.push(event);
19865
19664
  const {
19866
19665
  params,
19867
19666
  touches,
19868
19667
  enabled
19869
19668
  } = swiper;
19870
19669
  if (!enabled) return;
19871
- if (!params.simulateTouch && e.pointerType === 'mouse') return;
19670
+ if (!params.simulateTouch && event.pointerType === 'mouse') return;
19872
19671
  if (swiper.animating && params.preventInteractionOnTransition) {
19873
19672
  return;
19874
19673
  }
19875
19674
  if (!swiper.animating && params.cssMode && params.loop) {
19876
19675
  swiper.loopFix();
19877
19676
  }
19677
+ let e = event;
19678
+ if (e.originalEvent) e = e.originalEvent;
19878
19679
  let targetEl = e.target;
19879
19680
  if (params.touchEventsTarget === 'wrapper') {
19880
19681
  if (!swiper.wrapperEl.contains(targetEl)) return;
@@ -19886,7 +19687,7 @@ function onTouchStart(event) {
19886
19687
  // change target el for shadow root component
19887
19688
  const swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== '';
19888
19689
  // eslint-disable-next-line
19889
- const eventPath = e.composedPath ? e.composedPath() : e.path;
19690
+ const eventPath = event.composedPath ? event.composedPath() : event.path;
19890
19691
  if (swipingClassHasValue && e.target && e.target.shadowRoot && eventPath) {
19891
19692
  targetEl = eventPath[0];
19892
19693
  }
@@ -19908,8 +19709,14 @@ function onTouchStart(event) {
19908
19709
 
19909
19710
  // Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore
19910
19711
 
19911
- if (!preventEdgeSwipe(swiper, e, startX)) {
19912
- return;
19712
+ const edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;
19713
+ const edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;
19714
+ if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) {
19715
+ if (edgeSwipeDetection === 'prevent') {
19716
+ event.preventDefault();
19717
+ } else {
19718
+ return;
19719
+ }
19913
19720
  }
19914
19721
  Object.assign(data, {
19915
19722
  isTouched: true,
@@ -19959,24 +19766,15 @@ function onTouchMove(event) {
19959
19766
  if (!params.simulateTouch && event.pointerType === 'mouse') return;
19960
19767
  let e = event;
19961
19768
  if (e.originalEvent) e = e.originalEvent;
19962
- if (e.type === 'pointermove') {
19963
- if (data.touchId !== null) return; // return from pointer if we use touch
19964
- const id = e.pointerId;
19965
- if (id !== data.pointerId) return;
19966
- }
19967
- let targetTouch;
19968
- if (e.type === 'touchmove') {
19969
- targetTouch = [...e.changedTouches].filter(t => t.identifier === data.touchId)[0];
19970
- if (!targetTouch || targetTouch.identifier !== data.touchId) return;
19971
- } else {
19972
- targetTouch = e;
19973
- }
19974
19769
  if (!data.isTouched) {
19975
19770
  if (data.startMoving && data.isScrolling) {
19976
19771
  swiper.emit('touchMoveOpposite', e);
19977
19772
  }
19978
19773
  return;
19979
19774
  }
19775
+ const pointerIndex = data.evCache.findIndex(cachedEv => cachedEv.pointerId === e.pointerId);
19776
+ if (pointerIndex >= 0) data.evCache[pointerIndex] = e;
19777
+ const targetTouch = data.evCache.length > 1 ? data.evCache[0] : e;
19980
19778
  const pageX = targetTouch.pageX;
19981
19779
  const pageY = targetTouch.pageY;
19982
19780
  if (e.preventedByNestedSwiper) {
@@ -19992,6 +19790,8 @@ function onTouchMove(event) {
19992
19790
  Object.assign(touches, {
19993
19791
  startX: pageX,
19994
19792
  startY: pageY,
19793
+ prevX: swiper.touches.currentX,
19794
+ prevY: swiper.touches.currentY,
19995
19795
  currentX: pageX,
19996
19796
  currentY: pageY
19997
19797
  });
@@ -20021,8 +19821,7 @@ function onTouchMove(event) {
20021
19821
  if (data.allowTouchCallbacks) {
20022
19822
  swiper.emit('touchMove', e);
20023
19823
  }
20024
- touches.previousX = touches.currentX;
20025
- touches.previousY = touches.currentY;
19824
+ if (e.targetTouches && e.targetTouches.length > 1) return;
20026
19825
  touches.currentX = pageX;
20027
19826
  touches.currentY = pageY;
20028
19827
  const diffX = touches.currentX - touches.startX;
@@ -20048,7 +19847,7 @@ function onTouchMove(event) {
20048
19847
  data.startMoving = true;
20049
19848
  }
20050
19849
  }
20051
- if (data.isScrolling || e.type === 'touchmove' && data.preventTouchMoveFromPointerMove) {
19850
+ if (data.isScrolling || swiper.zoom && swiper.params.zoom && swiper.params.zoom.enabled && data.evCache.length > 1) {
20052
19851
  data.isTouched = false;
20053
19852
  return;
20054
19853
  }
@@ -20078,7 +19877,7 @@ function onTouchMove(event) {
20078
19877
  swiper.swipeDirection = diff > 0 ? 'prev' : 'next';
20079
19878
  swiper.touchesDirection = touchesDiff > 0 ? 'prev' : 'next';
20080
19879
  const isLoop = swiper.params.loop && !params.cssMode;
20081
- const allowLoopFix = swiper.touchesDirection === 'next' && swiper.allowSlideNext || swiper.touchesDirection === 'prev' && swiper.allowSlidePrev;
19880
+ const allowLoopFix = swiper.swipeDirection === 'next' && swiper.allowSlideNext || swiper.swipeDirection === 'prev' && swiper.allowSlidePrev;
20082
19881
  if (!data.isMoved) {
20083
19882
  if (isLoop && allowLoopFix) {
20084
19883
  swiper.loopFix({
@@ -20090,10 +19889,7 @@ function onTouchMove(event) {
20090
19889
  if (swiper.animating) {
20091
19890
  const evt = new window.CustomEvent('transitionend', {
20092
19891
  bubbles: true,
20093
- cancelable: true,
20094
- detail: {
20095
- bySwiperTouchMove: true
20096
- }
19892
+ cancelable: true
20097
19893
  });
20098
19894
  swiper.wrapperEl.dispatchEvent(evt);
20099
19895
  }
@@ -20105,18 +19901,13 @@ function onTouchMove(event) {
20105
19901
  swiper.emit('sliderFirstMove', e);
20106
19902
  }
20107
19903
  let loopFixed;
20108
- new Date().getTime();
20109
- if (data.isMoved && data.allowThresholdMove && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {
20110
- Object.assign(touches, {
20111
- startX: pageX,
20112
- startY: pageY,
20113
- currentX: pageX,
20114
- currentY: pageY,
20115
- startTranslate: data.currentTranslate
19904
+ if (data.isMoved && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {
19905
+ // need another loop fix
19906
+ swiper.loopFix({
19907
+ direction: swiper.swipeDirection,
19908
+ setTranslate: true
20116
19909
  });
20117
- data.loopSwapReset = true;
20118
- data.startTranslate = data.currentTranslate;
20119
- return;
19910
+ loopFixed = true;
20120
19911
  }
20121
19912
  swiper.emit('sliderMove', e);
20122
19913
  data.isMoved = true;
@@ -20127,7 +19918,7 @@ function onTouchMove(event) {
20127
19918
  resistanceRatio = 0;
20128
19919
  }
20129
19920
  if (diff > 0) {
20130
- if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.slidesSizesGrid[swiper.activeIndex + 1] : swiper.minTranslate())) {
19921
+ if (isLoop && allowLoopFix && !loopFixed && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.size / 2 : swiper.minTranslate())) {
20131
19922
  swiper.loopFix({
20132
19923
  direction: 'prev',
20133
19924
  setTranslate: true,
@@ -20141,7 +19932,7 @@ function onTouchMove(event) {
20141
19932
  }
20142
19933
  }
20143
19934
  } else if (diff < 0) {
20144
- if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.slidesSizesGrid[swiper.slidesSizesGrid.length - 1] : swiper.maxTranslate())) {
19935
+ if (isLoop && allowLoopFix && !loopFixed && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.size / 2 : swiper.maxTranslate())) {
20145
19936
  swiper.loopFix({
20146
19937
  direction: 'next',
20147
19938
  setTranslate: true,
@@ -20205,26 +19996,16 @@ function onTouchMove(event) {
20205
19996
  function onTouchEnd(event) {
20206
19997
  const swiper = this;
20207
19998
  const data = swiper.touchEventsData;
20208
- let e = event;
20209
- if (e.originalEvent) e = e.originalEvent;
20210
- let targetTouch;
20211
- const isTouchEvent = e.type === 'touchend' || e.type === 'touchcancel';
20212
- if (!isTouchEvent) {
20213
- if (data.touchId !== null) return; // return from pointer if we use touch
20214
- if (e.pointerId !== data.pointerId) return;
20215
- targetTouch = e;
20216
- } else {
20217
- targetTouch = [...e.changedTouches].filter(t => t.identifier === data.touchId)[0];
20218
- if (!targetTouch || targetTouch.identifier !== data.touchId) return;
19999
+ const pointerIndex = data.evCache.findIndex(cachedEv => cachedEv.pointerId === event.pointerId);
20000
+ if (pointerIndex >= 0) {
20001
+ data.evCache.splice(pointerIndex, 1);
20219
20002
  }
20220
- if (['pointercancel', 'pointerout', 'pointerleave', 'contextmenu'].includes(e.type)) {
20221
- const proceed = ['pointercancel', 'contextmenu'].includes(e.type) && (swiper.browser.isSafari || swiper.browser.isWebView);
20003
+ if (['pointercancel', 'pointerout', 'pointerleave', 'contextmenu'].includes(event.type)) {
20004
+ const proceed = ['pointercancel', 'contextmenu'].includes(event.type) && (swiper.browser.isSafari || swiper.browser.isWebView);
20222
20005
  if (!proceed) {
20223
20006
  return;
20224
20007
  }
20225
20008
  }
20226
- data.pointerId = null;
20227
- data.touchId = null;
20228
20009
  const {
20229
20010
  params,
20230
20011
  touches,
@@ -20233,7 +20014,9 @@ function onTouchEnd(event) {
20233
20014
  enabled
20234
20015
  } = swiper;
20235
20016
  if (!enabled) return;
20236
- if (!params.simulateTouch && e.pointerType === 'mouse') return;
20017
+ if (!params.simulateTouch && event.pointerType === 'mouse') return;
20018
+ let e = event;
20019
+ if (e.originalEvent) e = e.originalEvent;
20237
20020
  if (data.allowTouchCallbacks) {
20238
20021
  swiper.emit('touchEnd', e);
20239
20022
  }
@@ -20246,7 +20029,6 @@ function onTouchEnd(event) {
20246
20029
  data.startMoving = false;
20247
20030
  return;
20248
20031
  }
20249
-
20250
20032
  // Return Grab Cursor
20251
20033
  if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
20252
20034
  swiper.setGrabCursor(false);
@@ -20269,7 +20051,7 @@ function onTouchEnd(event) {
20269
20051
  nextTick(() => {
20270
20052
  if (!swiper.destroyed) swiper.allowClick = true;
20271
20053
  });
20272
- if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 && !data.loopSwapReset || data.currentTranslate === data.startTranslate && !data.loopSwapReset) {
20054
+ if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {
20273
20055
  data.isTouched = false;
20274
20056
  data.isMoved = false;
20275
20057
  data.startMoving = false;
@@ -20295,17 +20077,16 @@ function onTouchEnd(event) {
20295
20077
  }
20296
20078
 
20297
20079
  // Find current slide
20298
- const swipeToLast = currentPos >= -swiper.maxTranslate() && !swiper.params.loop;
20299
20080
  let stopIndex = 0;
20300
20081
  let groupSize = swiper.slidesSizesGrid[0];
20301
20082
  for (let i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) {
20302
20083
  const increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
20303
20084
  if (typeof slidesGrid[i + increment] !== 'undefined') {
20304
- if (swipeToLast || currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) {
20085
+ if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) {
20305
20086
  stopIndex = i;
20306
20087
  groupSize = slidesGrid[i + increment] - slidesGrid[i];
20307
20088
  }
20308
- } else if (swipeToLast || currentPos >= slidesGrid[i]) {
20089
+ } else if (currentPos >= slidesGrid[i]) {
20309
20090
  stopIndex = i;
20310
20091
  groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];
20311
20092
  }
@@ -20467,15 +20248,8 @@ function onLoad(e) {
20467
20248
  swiper.update();
20468
20249
  }
20469
20250
 
20470
- function onDocumentTouchStart() {
20471
- const swiper = this;
20472
- if (swiper.documentTouchHandlerProceeded) return;
20473
- swiper.documentTouchHandlerProceeded = true;
20474
- if (swiper.params.touchReleaseOnEdges) {
20475
- swiper.el.style.touchAction = 'auto';
20476
- }
20477
- }
20478
-
20251
+ let dummyEventAttached = false;
20252
+ function dummyEventListener() {}
20479
20253
  const events = (swiper, method) => {
20480
20254
  const document = getDocument();
20481
20255
  const {
@@ -20487,39 +20261,21 @@ const events = (swiper, method) => {
20487
20261
  const capture = !!params.nested;
20488
20262
  const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener';
20489
20263
  const swiperMethod = method;
20490
- if (!el || typeof el === 'string') return;
20491
20264
 
20492
20265
  // Touch Events
20493
- document[domMethod]('touchstart', swiper.onDocumentTouchStart, {
20494
- passive: false,
20495
- capture
20496
- });
20497
- el[domMethod]('touchstart', swiper.onTouchStart, {
20498
- passive: false
20499
- });
20500
20266
  el[domMethod]('pointerdown', swiper.onTouchStart, {
20501
20267
  passive: false
20502
20268
  });
20503
- document[domMethod]('touchmove', swiper.onTouchMove, {
20504
- passive: false,
20505
- capture
20506
- });
20507
20269
  document[domMethod]('pointermove', swiper.onTouchMove, {
20508
20270
  passive: false,
20509
20271
  capture
20510
20272
  });
20511
- document[domMethod]('touchend', swiper.onTouchEnd, {
20512
- passive: true
20513
- });
20514
20273
  document[domMethod]('pointerup', swiper.onTouchEnd, {
20515
20274
  passive: true
20516
20275
  });
20517
20276
  document[domMethod]('pointercancel', swiper.onTouchEnd, {
20518
20277
  passive: true
20519
20278
  });
20520
- document[domMethod]('touchcancel', swiper.onTouchEnd, {
20521
- passive: true
20522
- });
20523
20279
  document[domMethod]('pointerout', swiper.onTouchEnd, {
20524
20280
  passive: true
20525
20281
  });
@@ -20552,18 +20308,22 @@ const events = (swiper, method) => {
20552
20308
  };
20553
20309
  function attachEvents() {
20554
20310
  const swiper = this;
20311
+ const document = getDocument();
20555
20312
  const {
20556
20313
  params
20557
20314
  } = swiper;
20558
20315
  swiper.onTouchStart = onTouchStart.bind(swiper);
20559
20316
  swiper.onTouchMove = onTouchMove.bind(swiper);
20560
20317
  swiper.onTouchEnd = onTouchEnd.bind(swiper);
20561
- swiper.onDocumentTouchStart = onDocumentTouchStart.bind(swiper);
20562
20318
  if (params.cssMode) {
20563
20319
  swiper.onScroll = onScroll.bind(swiper);
20564
20320
  }
20565
20321
  swiper.onClick = onClick.bind(swiper);
20566
20322
  swiper.onLoad = onLoad.bind(swiper);
20323
+ if (!dummyEventAttached) {
20324
+ document.addEventListener('touchstart', dummyEventListener);
20325
+ dummyEventAttached = true;
20326
+ }
20567
20327
  events(swiper, 'on');
20568
20328
  }
20569
20329
  function detachEvents() {
@@ -20596,8 +20356,6 @@ function setBreakpoint() {
20596
20356
  const breakpointParams = breakpointOnlyParams || swiper.originalParams;
20597
20357
  const wasMultiRow = isGridEnabled(swiper, params);
20598
20358
  const isMultiRow = isGridEnabled(swiper, breakpointParams);
20599
- const wasGrabCursor = swiper.params.grabCursor;
20600
- const isGrabCursor = breakpointParams.grabCursor;
20601
20359
  const wasEnabled = params.enabled;
20602
20360
  if (wasMultiRow && !isMultiRow) {
20603
20361
  el.classList.remove(`${params.containerModifierClass}grid`, `${params.containerModifierClass}grid-column`);
@@ -20609,11 +20367,6 @@ function setBreakpoint() {
20609
20367
  }
20610
20368
  swiper.emitContainerClasses();
20611
20369
  }
20612
- if (wasGrabCursor && !isGrabCursor) {
20613
- swiper.unsetGrabCursor();
20614
- } else if (!wasGrabCursor && isGrabCursor) {
20615
- swiper.setGrabCursor();
20616
- }
20617
20370
 
20618
20371
  // Toggle navigation, pagination, scrollbar
20619
20372
  ['navigation', 'pagination', 'scrollbar'].forEach(prop => {
@@ -20764,7 +20517,6 @@ function removeClasses() {
20764
20517
  el,
20765
20518
  classNames
20766
20519
  } = swiper;
20767
- if (!el || typeof el === 'string') return;
20768
20520
  el.classList.remove(...classNames);
20769
20521
  swiper.emitContainerClasses();
20770
20522
  }
@@ -20811,7 +20563,6 @@ var defaults$4 = {
20811
20563
  init: true,
20812
20564
  direction: 'horizontal',
20813
20565
  oneWayMovement: false,
20814
- swiperElementNodeName: 'SWIPER-CONTAINER',
20815
20566
  touchEventsTarget: 'wrapper',
20816
20567
  initialSlide: 0,
20817
20568
  speed: 300,
@@ -20820,7 +20571,6 @@ var defaults$4 = {
20820
20571
  resizeObserver: true,
20821
20572
  nested: false,
20822
20573
  createElements: false,
20823
- eventsPrefix: 'swiper',
20824
20574
  enabled: true,
20825
20575
  focusableElements: 'input, select, option, textarea, button, video, label',
20826
20576
  // Overrides
@@ -20895,8 +20645,7 @@ var defaults$4 = {
20895
20645
  slideToClickedSlide: false,
20896
20646
  // loop
20897
20647
  loop: false,
20898
- loopAddBlankSlides: true,
20899
- loopAdditionalSlides: 0,
20648
+ loopedSlides: null,
20900
20649
  loopPreventsSliding: true,
20901
20650
  // rewind
20902
20651
  rewind: false,
@@ -20915,10 +20664,8 @@ var defaults$4 = {
20915
20664
  containerModifierClass: 'swiper-',
20916
20665
  // NEW
20917
20666
  slideClass: 'swiper-slide',
20918
- slideBlankClass: 'swiper-slide-blank',
20919
20667
  slideActiveClass: 'swiper-slide-active',
20920
20668
  slideVisibleClass: 'swiper-slide-visible',
20921
- slideFullyVisibleClass: 'swiper-slide-fully-visible',
20922
20669
  slideNextClass: 'swiper-slide-next',
20923
20670
  slidePrevClass: 'swiper-slide-prev',
20924
20671
  wrapperClass: 'swiper-wrapper',
@@ -21111,8 +20858,7 @@ class Swiper$1 {
21111
20858
  velocities: [],
21112
20859
  allowMomentumBounce: undefined,
21113
20860
  startMoving: undefined,
21114
- pointerId: null,
21115
- touchId: null
20861
+ evCache: []
21116
20862
  },
21117
20863
  // Clicks
21118
20864
  allowClick: true,
@@ -21140,22 +20886,6 @@ class Swiper$1 {
21140
20886
  // eslint-disable-next-line no-constructor-return
21141
20887
  return swiper;
21142
20888
  }
21143
- getDirectionLabel(property) {
21144
- if (this.isHorizontal()) {
21145
- return property;
21146
- }
21147
- // prettier-ignore
21148
- return {
21149
- 'width': 'height',
21150
- 'margin-top': 'margin-left',
21151
- 'margin-bottom ': 'margin-right',
21152
- 'margin-left': 'margin-top',
21153
- 'margin-right': 'margin-bottom',
21154
- 'padding-left': 'padding-top',
21155
- 'padding-right': 'padding-bottom',
21156
- 'marginRight': 'marginBottom'
21157
- }[property];
21158
- }
21159
20889
  getSlideIndex(slideEl) {
21160
20890
  const {
21161
20891
  slidesEl,
@@ -21252,11 +20982,11 @@ class Swiper$1 {
21252
20982
  let spv = 1;
21253
20983
  if (typeof params.slidesPerView === 'number') return params.slidesPerView;
21254
20984
  if (params.centeredSlides) {
21255
- let slideSize = slides[activeIndex] ? Math.ceil(slides[activeIndex].swiperSlideSize) : 0;
20985
+ let slideSize = slides[activeIndex] ? slides[activeIndex].swiperSlideSize : 0;
21256
20986
  let breakLoop;
21257
20987
  for (let i = activeIndex + 1; i < slides.length; i += 1) {
21258
20988
  if (slides[i] && !breakLoop) {
21259
- slideSize += Math.ceil(slides[i].swiperSlideSize);
20989
+ slideSize += slides[i].swiperSlideSize;
21260
20990
  spv += 1;
21261
20991
  if (slideSize > swiperSize) breakLoop = true;
21262
20992
  }
@@ -21393,7 +21123,7 @@ class Swiper$1 {
21393
21123
  return false;
21394
21124
  }
21395
21125
  el.swiper = swiper;
21396
- if (el.parentNode && el.parentNode.host && el.parentNode.host.nodeName === swiper.params.swiperElementNodeName.toUpperCase()) {
21126
+ if (el.parentNode && el.parentNode.host && el.parentNode.host.nodeName === 'SWIPER-CONTAINER') {
21397
21127
  swiper.isElement = true;
21398
21128
  }
21399
21129
  const getWrapperSelector = () => {
@@ -21529,15 +21259,11 @@ class Swiper$1 {
21529
21259
  // Cleanup styles
21530
21260
  if (cleanStyles) {
21531
21261
  swiper.removeClasses();
21532
- if (el && typeof el !== 'string') {
21533
- el.removeAttribute('style');
21534
- }
21535
- if (wrapperEl) {
21536
- wrapperEl.removeAttribute('style');
21537
- }
21262
+ el.removeAttribute('style');
21263
+ wrapperEl.removeAttribute('style');
21538
21264
  if (slides && slides.length) {
21539
21265
  slides.forEach(slideEl => {
21540
- slideEl.classList.remove(params.slideVisibleClass, params.slideFullyVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
21266
+ slideEl.classList.remove(params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
21541
21267
  slideEl.removeAttribute('style');
21542
21268
  slideEl.removeAttribute('data-swiper-slide-index');
21543
21269
  });
@@ -21550,9 +21276,7 @@ class Swiper$1 {
21550
21276
  swiper.off(eventName);
21551
21277
  });
21552
21278
  if (deleteInstance !== false) {
21553
- if (swiper.el && typeof swiper.el !== 'string') {
21554
- swiper.el.swiper = null;
21555
- }
21279
+ swiper.el.swiper = null;
21556
21280
  deleteProps(swiper);
21557
21281
  }
21558
21282
  swiper.destroyed = true;
@@ -21591,7 +21315,7 @@ Object.keys(prototypes).forEach(prototypeGroup => {
21591
21315
  Swiper$1.use([Resize, Observer]);
21592
21316
 
21593
21317
  /* underscore in name -> watch for changes */
21594
- const paramsList = ['eventsPrefix', 'injectStyles', 'injectStylesUrls', 'modules', 'init', '_direction', 'oneWayMovement', 'swiperElementNodeName', 'touchEventsTarget', 'initialSlide', '_speed', 'cssMode', 'updateOnWindowResize', 'resizeObserver', 'nested', 'focusableElements', '_enabled', '_width', '_height', 'preventInteractionOnTransition', 'userAgent', 'url', '_edgeSwipeDetection', '_edgeSwipeThreshold', '_freeMode', '_autoHeight', 'setWrapperSize', 'virtualTranslate', '_effect', 'breakpoints', 'breakpointsBase', '_spaceBetween', '_slidesPerView', 'maxBackfaceHiddenSlides', '_grid', '_slidesPerGroup', '_slidesPerGroupSkip', '_slidesPerGroupAuto', '_centeredSlides', '_centeredSlidesBounds', '_slidesOffsetBefore', '_slidesOffsetAfter', 'normalizeSlideIndex', '_centerInsufficientSlides', '_watchOverflow', 'roundLengths', 'touchRatio', 'touchAngle', 'simulateTouch', '_shortSwipes', '_longSwipes', 'longSwipesRatio', 'longSwipesMs', '_followFinger', 'allowTouchMove', '_threshold', 'touchMoveStopPropagation', 'touchStartPreventDefault', 'touchStartForcePreventDefault', 'touchReleaseOnEdges', 'uniqueNavElements', '_resistance', '_resistanceRatio', '_watchSlidesProgress', '_grabCursor', 'preventClicks', 'preventClicksPropagation', '_slideToClickedSlide', '_loop', 'loopAdditionalSlides', 'loopAddBlankSlides', 'loopPreventsSliding', '_rewind', '_allowSlidePrev', '_allowSlideNext', '_swipeHandler', '_noSwiping', 'noSwipingClass', 'noSwipingSelector', 'passiveListeners', 'containerModifierClass', 'slideClass', 'slideActiveClass', 'slideVisibleClass', 'slideFullyVisibleClass', 'slideNextClass', 'slidePrevClass', 'slideBlankClass', 'wrapperClass', 'lazyPreloaderClass', 'lazyPreloadPrevNext', 'runCallbacksOnInit', 'observer', 'observeParents', 'observeSlideChildren',
21318
+ const paramsList = ['eventsPrefix', 'injectStyles', 'injectStylesUrls', 'modules', 'init', '_direction', 'oneWayMovement', 'touchEventsTarget', 'initialSlide', '_speed', 'cssMode', 'updateOnWindowResize', 'resizeObserver', 'nested', 'focusableElements', '_enabled', '_width', '_height', 'preventInteractionOnTransition', 'userAgent', 'url', '_edgeSwipeDetection', '_edgeSwipeThreshold', '_freeMode', '_autoHeight', 'setWrapperSize', 'virtualTranslate', '_effect', 'breakpoints', 'breakpointsBase', '_spaceBetween', '_slidesPerView', 'maxBackfaceHiddenSlides', '_grid', '_slidesPerGroup', '_slidesPerGroupSkip', '_slidesPerGroupAuto', '_centeredSlides', '_centeredSlidesBounds', '_slidesOffsetBefore', '_slidesOffsetAfter', 'normalizeSlideIndex', '_centerInsufficientSlides', '_watchOverflow', 'roundLengths', 'touchRatio', 'touchAngle', 'simulateTouch', '_shortSwipes', '_longSwipes', 'longSwipesRatio', 'longSwipesMs', '_followFinger', 'allowTouchMove', '_threshold', 'touchMoveStopPropagation', 'touchStartPreventDefault', 'touchStartForcePreventDefault', 'touchReleaseOnEdges', 'uniqueNavElements', '_resistance', '_resistanceRatio', '_watchSlidesProgress', '_grabCursor', 'preventClicks', 'preventClicksPropagation', '_slideToClickedSlide', '_loop', 'loopedSlides', 'loopPreventsSliding', '_rewind', '_allowSlidePrev', '_allowSlideNext', '_swipeHandler', '_noSwiping', 'noSwipingClass', 'noSwipingSelector', 'passiveListeners', 'containerModifierClass', 'slideClass', 'slideActiveClass', 'slideVisibleClass', 'slideNextClass', 'slidePrevClass', 'wrapperClass', 'lazyPreloaderClass', 'lazyPreloadPrevNext', 'runCallbacksOnInit', 'observer', 'observeParents', 'observeSlideChildren',
21595
21319
  // modules
21596
21320
  'a11y', '_autoplay', '_controller', 'coverflowEffect', 'cubeEffect', 'fadeEffect', 'flipEffect', 'creativeEffect', 'cardsEffect', 'hashNavigation', 'history', 'keyboard', 'mousewheel', '_navigation', '_pagination', 'parallax', '_scrollbar', '_thumbs', 'virtual', 'zoom', 'control'];
21597
21321
 
@@ -21720,7 +21444,7 @@ function updateSwiper(_ref) {
21720
21444
  }
21721
21445
  updateParams.forEach(key => {
21722
21446
  if (isObject$1(currentParams[key]) && isObject$1(passedParams[key])) {
21723
- Object.assign(currentParams[key], passedParams[key]);
21447
+ extend$1(currentParams[key], passedParams[key]);
21724
21448
  if ((key === 'navigation' || key === 'pagination' || key === 'scrollbar') && 'enabled' in passedParams[key] && !passedParams[key].enabled) {
21725
21449
  destroyModule(key);
21726
21450
  }
@@ -21741,9 +21465,6 @@ function updateSwiper(_ref) {
21741
21465
  if (changedParams.includes('children') && slides && virtual && currentParams.virtual.enabled) {
21742
21466
  virtual.slides = slides;
21743
21467
  virtual.update(true);
21744
- } else if (changedParams.includes('virtual') && virtual && currentParams.virtual.enabled) {
21745
- if (slides) virtual.slides = slides;
21746
- virtual.update(true);
21747
21468
  }
21748
21469
  if (changedParams.includes('children') && slides && currentParams.loop) {
21749
21470
  loopNeedReloop = true;
@@ -21946,15 +21667,15 @@ const updateOnVirtualData = swiper => {
21946
21667
  };
21947
21668
 
21948
21669
  /**
21949
- * Swiper React 11.1.4
21670
+ * Swiper React 10.3.0
21950
21671
  * Most modern mobile touch slider and framework with hardware accelerated transitions
21951
21672
  * https://swiperjs.com
21952
21673
  *
21953
- * Copyright 2014-2024 Vladimir Kharlampidi
21674
+ * Copyright 2014-2023 Vladimir Kharlampidi
21954
21675
  *
21955
21676
  * Released under the MIT License
21956
21677
  *
21957
- * Released on: May 30, 2024
21678
+ * Released on: September 21, 2023
21958
21679
  */
21959
21680
 
21960
21681
  function _extends() {
@@ -22049,7 +21770,7 @@ function renderVirtual(swiper, slides, virtualData) {
22049
21770
  return /*#__PURE__*/React__default.cloneElement(child, {
22050
21771
  swiper,
22051
21772
  style,
22052
- key: child.props.virtualIndex || child.key || `slide-${index}`
21773
+ key: `slide-${index}`
22053
21774
  });
22054
21775
  });
22055
21776
  }
@@ -22175,7 +21896,7 @@ const Swiper = /*#__PURE__*/forwardRef(function (_temp, externalElRef) {
22175
21896
  scrollbarEl: scrollbarElRef.current,
22176
21897
  swiper: swiperRef.current
22177
21898
  }, swiperParams);
22178
- if (onSwiper && !swiperRef.current.destroyed) onSwiper(swiperRef.current);
21899
+ if (onSwiper) onSwiper(swiperRef.current);
22179
21900
  // eslint-disable-next-line
22180
21901
  return () => {
22181
21902
  if (swiperRef.current && !swiperRef.current.destroyed) {
@@ -41793,7 +41514,7 @@ function History(_ref) {
41793
41514
  } else {
41794
41515
  location = window.location;
41795
41516
  }
41796
- const slide = swiper.virtual && swiper.params.virtual.enabled ? swiper.slidesEl.querySelector(`[data-swiper-slide-index="${index}"]`) : swiper.slides[index];
41517
+ const slide = swiper.slides[index];
41797
41518
  let value = slugify(slide.getAttribute('data-history'));
41798
41519
  if (swiper.params.history.root.length > 0) {
41799
41520
  let root = swiper.params.history.root;
@@ -41906,7 +41627,7 @@ function Autoplay(_ref) {
41906
41627
  enabled: false,
41907
41628
  delay: 3000,
41908
41629
  waitForTransition: true,
41909
- disableOnInteraction: false,
41630
+ disableOnInteraction: true,
41910
41631
  stopOnLastSlide: false,
41911
41632
  reverseDirection: false,
41912
41633
  pauseOnMouseEnter: false
@@ -41917,21 +41638,17 @@ function Autoplay(_ref) {
41917
41638
  let autoplayDelayTotal = params && params.autoplay ? params.autoplay.delay : 3000;
41918
41639
  let autoplayDelayCurrent = params && params.autoplay ? params.autoplay.delay : 3000;
41919
41640
  let autoplayTimeLeft;
41920
- let autoplayStartTime = new Date().getTime();
41641
+ let autoplayStartTime = new Date().getTime;
41921
41642
  let wasPaused;
41922
41643
  let isTouched;
41923
41644
  let pausedByTouch;
41924
41645
  let touchStartTimeout;
41925
41646
  let slideChanged;
41926
41647
  let pausedByInteraction;
41927
- let pausedByPointerEnter;
41928
41648
  function onTransitionEnd(e) {
41929
41649
  if (!swiper || swiper.destroyed || !swiper.wrapperEl) return;
41930
41650
  if (e.target !== swiper.wrapperEl) return;
41931
41651
  swiper.wrapperEl.removeEventListener('transitionend', onTransitionEnd);
41932
- if (pausedByPointerEnter || e.detail && e.detail.bySwiperTouchMove) {
41933
- return;
41934
- }
41935
41652
  resume();
41936
41653
  }
41937
41654
  const calcTimeLeft = () => {
@@ -42016,7 +41733,6 @@ function Autoplay(_ref) {
42016
41733
  return delay;
42017
41734
  };
42018
41735
  const start = () => {
42019
- autoplayStartTime = new Date().getTime();
42020
41736
  swiper.autoplay.running = true;
42021
41737
  run();
42022
41738
  emit('autoplayStart');
@@ -42082,13 +41798,11 @@ function Autoplay(_ref) {
42082
41798
  const onPointerEnter = e => {
42083
41799
  if (e.pointerType !== 'mouse') return;
42084
41800
  pausedByInteraction = true;
42085
- pausedByPointerEnter = true;
42086
41801
  if (swiper.animating || swiper.autoplay.paused) return;
42087
41802
  pause(true);
42088
41803
  };
42089
41804
  const onPointerLeave = e => {
42090
41805
  if (e.pointerType !== 'mouse') return;
42091
- pausedByPointerEnter = false;
42092
41806
  if (swiper.autoplay.paused) {
42093
41807
  resume();
42094
41808
  }
@@ -42100,10 +41814,8 @@ function Autoplay(_ref) {
42100
41814
  }
42101
41815
  };
42102
41816
  const detachMouseEvents = () => {
42103
- if (swiper.el && typeof swiper.el !== 'string') {
42104
- swiper.el.removeEventListener('pointerenter', onPointerEnter);
42105
- swiper.el.removeEventListener('pointerleave', onPointerLeave);
42106
- }
41817
+ swiper.el.removeEventListener('pointerenter', onPointerEnter);
41818
+ swiper.el.removeEventListener('pointerleave', onPointerLeave);
42107
41819
  };
42108
41820
  const attachDocumentEvents = () => {
42109
41821
  const document = getDocument();
@@ -42117,6 +41829,7 @@ function Autoplay(_ref) {
42117
41829
  if (swiper.params.autoplay.enabled) {
42118
41830
  attachMouseEvents();
42119
41831
  attachDocumentEvents();
41832
+ autoplayStartTime = new Date().getTime();
42120
41833
  start();
42121
41834
  }
42122
41835
  });
@@ -42127,18 +41840,6 @@ function Autoplay(_ref) {
42127
41840
  stop();
42128
41841
  }
42129
41842
  });
42130
- on('_freeModeStaticRelease', () => {
42131
- if (pausedByTouch || pausedByInteraction) {
42132
- resume();
42133
- }
42134
- });
42135
- on('_freeModeNoMomentumRelease', () => {
42136
- if (!swiper.params.autoplay.disableOnInteraction) {
42137
- pause(true, true);
42138
- } else {
42139
- stop();
42140
- }
42141
- });
42142
41843
  on('beforeTransitionStart', (_s, speed, internal) => {
42143
41844
  if (swiper.destroyed || !swiper.autoplay.running) return;
42144
41845
  if (internal || !swiper.params.autoplay.disableOnInteraction) {
@@ -43232,9 +42933,6 @@ var HeroWithGallery = function HeroWithGallery(_ref) {
43232
42933
  media: media,
43233
42934
  index: index
43234
42935
  }));
43235
- }), /*#__PURE__*/React__default.createElement(Pagination, {
43236
- swiper: swiper,
43237
- className: "!relative"
43238
42936
  })), /*#__PURE__*/React__default.createElement(ArrowButton, {
43239
42937
  Icon: ArrowRightS$1,
43240
42938
  className: "hidden sm:flex",