@bigbinary/neeto-site-blocks 1.10.0 → 1.10.2

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
@@ -16278,7 +16278,7 @@ var PageNavigation = function PageNavigation(_ref) {
16278
16278
  }));
16279
16279
  };
16280
16280
 
16281
- var Pagination$1 = function Pagination(_ref) {
16281
+ var Pagination = function Pagination(_ref) {
16282
16282
  var swiper = _ref.swiper,
16283
16283
  _ref$design = _ref.design,
16284
16284
  design = _ref$design === void 0 ? {} : _ref$design,
@@ -16924,16 +16924,6 @@ function elementParents(el, selector) {
16924
16924
  }
16925
16925
  return parents;
16926
16926
  }
16927
- function elementTransitionEnd(el, callback) {
16928
- function fireCallBack(e) {
16929
- if (e.target !== el) return;
16930
- callback.call(el, e);
16931
- el.removeEventListener('transitionend', fireCallBack);
16932
- }
16933
- if (callback) {
16934
- el.addEventListener('transitionend', fireCallBack);
16935
- }
16936
- }
16937
16927
  function elementOuterSize(el, size, includeMargins) {
16938
16928
  const window = getWindow();
16939
16929
  if (includeMargins) {
@@ -40517,6 +40507,105 @@ var FooterWithLinks = function FooterWithLinks(_ref) {
40517
40507
  }, otherProps), copyrightText));
40518
40508
  };
40519
40509
 
40510
+ var GalleryClassic = function GalleryClassic(_ref) {
40511
+ var configurations = _ref.configurations,
40512
+ _ref$className = _ref.className,
40513
+ className = _ref$className === void 0 ? "" : _ref$className,
40514
+ id = _ref.id,
40515
+ disableButtonAndLinks = _ref.disableButtonAndLinks,
40516
+ image = _ref.image;
40517
+ var _useState = useState(null),
40518
+ _useState2 = _slicedToArray(_useState, 2),
40519
+ swiper = _useState2[0],
40520
+ setSwiper = _useState2[1];
40521
+ var properties = configurations.properties,
40522
+ design = configurations.design;
40523
+ var _properties$content = properties.content,
40524
+ title = _properties$content.title,
40525
+ description = _properties$content.description,
40526
+ enableAnimation = properties.enableAnimation,
40527
+ _properties$images = properties.images,
40528
+ images = _properties$images === void 0 ? [] : _properties$images,
40529
+ src = properties.backgroundImage.src;
40530
+ var baseClasses = "grid grid-cols-12 items-center gap-y-8";
40531
+ return /*#__PURE__*/React__default.createElement(BlockWrapper, {
40532
+ className: className,
40533
+ enableAnimation: enableAnimation,
40534
+ id: id,
40535
+ backgroundImage: mergeLeft({
40536
+ src: src
40537
+ }, design.backgroundImage),
40538
+ design: design.body,
40539
+ nestedClassName: baseClasses
40540
+ }, /*#__PURE__*/React__default.createElement("div", {
40541
+ className: "col-span-12 col-start-1 sm:col-span-6 sm:col-start-4"
40542
+ }, /*#__PURE__*/React__default.createElement(Typography$1, {
40543
+ disableButtonAndLinks: disableButtonAndLinks,
40544
+ isTitle: true,
40545
+ component: "h3",
40546
+ id: "gallery-classic-title",
40547
+ style: design.title
40548
+ }, title), /*#__PURE__*/React__default.createElement(Typography$1, {
40549
+ disableButtonAndLinks: disableButtonAndLinks,
40550
+ id: "gallery-classic-description",
40551
+ style: design.description
40552
+ }, description)), /*#__PURE__*/React__default.createElement(ArrowButton, {
40553
+ isStart: true,
40554
+ Icon: ArrowLeft$1,
40555
+ className: "hidden sm:flex",
40556
+ design: design.navigationButtons,
40557
+ onClick: function onClick() {
40558
+ return swiper === null || swiper === void 0 ? void 0 : swiper.slidePrev();
40559
+ }
40560
+ }), /*#__PURE__*/React__default.createElement("div", {
40561
+ className: "ns-gallery-with-multiple-images col-span-10 col-start-2"
40562
+ }, /*#__PURE__*/React__default.createElement(Swiper, {
40563
+ loop: true,
40564
+ breakpointsBase: "container",
40565
+ pagination: {
40566
+ clickable: true
40567
+ },
40568
+ slidesPerView: 1,
40569
+ spaceBetween: 10,
40570
+ breakpoints: {
40571
+ 640: {
40572
+ slidesPerView: 2,
40573
+ spaceBetween: 10
40574
+ }
40575
+ },
40576
+ onSwiper: setSwiper
40577
+ }, images.map(function (_ref2, index) {
40578
+ var src = _ref2.src,
40579
+ caption = _ref2.title,
40580
+ style = _ref2.style;
40581
+ return /*#__PURE__*/React__default.createElement(SwiperSlide, {
40582
+ className: "swiper__wrapper",
40583
+ key: getUniqueKey(src, title, index)
40584
+ }, /*#__PURE__*/React__default.createElement(StyledImage$1, {
40585
+ disableButtonAndLinks: disableButtonAndLinks,
40586
+ image: image,
40587
+ index: index,
40588
+ src: src,
40589
+ alt: caption,
40590
+ className: "sliding-image",
40591
+ design: style,
40592
+ id: "gallery-classic-images-".concat(index, "-image"),
40593
+ title: caption,
40594
+ wrapperClassName: "h-full w-full"
40595
+ }));
40596
+ })), /*#__PURE__*/React__default.createElement(Pagination, {
40597
+ swiper: swiper,
40598
+ design: design.button
40599
+ })), /*#__PURE__*/React__default.createElement(ArrowButton, {
40600
+ Icon: ArrowRight$1,
40601
+ className: "hidden sm:flex",
40602
+ design: design.navigationButtons,
40603
+ onClick: function onClick() {
40604
+ return swiper === null || swiper === void 0 ? void 0 : swiper.slideNext();
40605
+ }
40606
+ }));
40607
+ };
40608
+
40520
40609
  /* eslint-disable consistent-return */
40521
40610
  function Keyboard(_ref) {
40522
40611
  let {
@@ -40630,992 +40719,115 @@ function Keyboard(_ref) {
40630
40719
  });
40631
40720
  }
40632
40721
 
40633
- /* eslint-disable consistent-return */
40634
- function Mousewheel(_ref) {
40722
+ function History(_ref) {
40635
40723
  let {
40636
40724
  swiper,
40637
40725
  extendParams,
40638
- on,
40639
- emit
40726
+ on
40640
40727
  } = _ref;
40641
- const window = getWindow();
40642
40728
  extendParams({
40643
- mousewheel: {
40729
+ history: {
40644
40730
  enabled: false,
40645
- releaseOnEdges: false,
40646
- invert: false,
40647
- forceToAxis: false,
40648
- sensitivity: 1,
40649
- eventsTarget: 'container',
40650
- thresholdDelta: null,
40651
- thresholdTime: null,
40652
- noMousewheelClass: 'swiper-no-mousewheel'
40731
+ root: '',
40732
+ replaceState: false,
40733
+ key: 'slides',
40734
+ keepQuery: false
40653
40735
  }
40654
40736
  });
40655
- swiper.mousewheel = {
40656
- enabled: false
40737
+ let initialized = false;
40738
+ let paths = {};
40739
+ const slugify = text => {
40740
+ return text.toString().replace(/\s+/g, '-').replace(/[^\w-]+/g, '').replace(/--+/g, '-').replace(/^-+/, '').replace(/-+$/, '');
40657
40741
  };
40658
- let timeout;
40659
- let lastScrollTime = now();
40660
- let lastEventBeforeSnap;
40661
- const recentWheelEvents = [];
40662
- function normalize(e) {
40663
- // Reasonable defaults
40664
- const PIXEL_STEP = 10;
40665
- const LINE_HEIGHT = 40;
40666
- const PAGE_HEIGHT = 800;
40667
- let sX = 0;
40668
- let sY = 0; // spinX, spinY
40669
- let pX = 0;
40670
- let pY = 0; // pixelX, pixelY
40671
-
40672
- // Legacy
40673
- if ('detail' in e) {
40674
- sY = e.detail;
40675
- }
40676
- if ('wheelDelta' in e) {
40677
- sY = -e.wheelDelta / 120;
40678
- }
40679
- if ('wheelDeltaY' in e) {
40680
- sY = -e.wheelDeltaY / 120;
40681
- }
40682
- if ('wheelDeltaX' in e) {
40683
- sX = -e.wheelDeltaX / 120;
40684
- }
40685
-
40686
- // side scrolling on FF with DOMMouseScroll
40687
- if ('axis' in e && e.axis === e.HORIZONTAL_AXIS) {
40688
- sX = sY;
40689
- sY = 0;
40690
- }
40691
- pX = sX * PIXEL_STEP;
40692
- pY = sY * PIXEL_STEP;
40693
- if ('deltaY' in e) {
40694
- pY = e.deltaY;
40695
- }
40696
- if ('deltaX' in e) {
40697
- pX = e.deltaX;
40698
- }
40699
- if (e.shiftKey && !pX) {
40700
- // if user scrolls with shift he wants horizontal scroll
40701
- pX = pY;
40702
- pY = 0;
40703
- }
40704
- if ((pX || pY) && e.deltaMode) {
40705
- if (e.deltaMode === 1) {
40706
- // delta in LINE units
40707
- pX *= LINE_HEIGHT;
40708
- pY *= LINE_HEIGHT;
40709
- } else {
40710
- // delta in PAGE units
40711
- pX *= PAGE_HEIGHT;
40712
- pY *= PAGE_HEIGHT;
40713
- }
40714
- }
40715
-
40716
- // Fall-back if spin cannot be determined
40717
- if (pX && !sX) {
40718
- sX = pX < 1 ? -1 : 1;
40719
- }
40720
- if (pY && !sY) {
40721
- sY = pY < 1 ? -1 : 1;
40742
+ const getPathValues = urlOverride => {
40743
+ const window = getWindow();
40744
+ let location;
40745
+ if (urlOverride) {
40746
+ location = new URL(urlOverride);
40747
+ } else {
40748
+ location = window.location;
40722
40749
  }
40750
+ const pathArray = location.pathname.slice(1).split('/').filter(part => part !== '');
40751
+ const total = pathArray.length;
40752
+ const key = pathArray[total - 2];
40753
+ const value = pathArray[total - 1];
40723
40754
  return {
40724
- spinX: sX,
40725
- spinY: sY,
40726
- pixelX: pX,
40727
- pixelY: pY
40755
+ key,
40756
+ value
40728
40757
  };
40729
- }
40730
- function handleMouseEnter() {
40731
- if (!swiper.enabled) return;
40732
- swiper.mouseEntered = true;
40733
- }
40734
- function handleMouseLeave() {
40735
- if (!swiper.enabled) return;
40736
- swiper.mouseEntered = false;
40737
- }
40738
- function animateSlider(newEvent) {
40739
- if (swiper.params.mousewheel.thresholdDelta && newEvent.delta < swiper.params.mousewheel.thresholdDelta) {
40740
- // Prevent if delta of wheel scroll delta is below configured threshold
40741
- return false;
40742
- }
40743
- if (swiper.params.mousewheel.thresholdTime && now() - lastScrollTime < swiper.params.mousewheel.thresholdTime) {
40744
- // Prevent if time between scrolls is below configured threshold
40745
- return false;
40746
- }
40747
-
40748
- // If the movement is NOT big enough and
40749
- // if the last time the user scrolled was too close to the current one (avoid continuously triggering the slider):
40750
- // Don't go any further (avoid insignificant scroll movement).
40751
- if (newEvent.delta >= 6 && now() - lastScrollTime < 60) {
40752
- // Return false as a default
40753
- return true;
40754
- }
40755
- // If user is scrolling towards the end:
40756
- // If the slider hasn't hit the latest slide or
40757
- // if the slider is a loop and
40758
- // if the slider isn't moving right now:
40759
- // Go to next slide and
40760
- // emit a scroll event.
40761
- // Else (the user is scrolling towards the beginning) and
40762
- // if the slider hasn't hit the first slide or
40763
- // if the slider is a loop and
40764
- // if the slider isn't moving right now:
40765
- // Go to prev slide and
40766
- // emit a scroll event.
40767
- if (newEvent.direction < 0) {
40768
- if ((!swiper.isEnd || swiper.params.loop) && !swiper.animating) {
40769
- swiper.slideNext();
40770
- emit('scroll', newEvent.raw);
40771
- }
40772
- } else if ((!swiper.isBeginning || swiper.params.loop) && !swiper.animating) {
40773
- swiper.slidePrev();
40774
- emit('scroll', newEvent.raw);
40758
+ };
40759
+ const setHistory = (key, index) => {
40760
+ const window = getWindow();
40761
+ if (!initialized || !swiper.params.history.enabled) return;
40762
+ let location;
40763
+ if (swiper.params.url) {
40764
+ location = new URL(swiper.params.url);
40765
+ } else {
40766
+ location = window.location;
40775
40767
  }
40776
- // If you got here is because an animation has been triggered so store the current time
40777
- lastScrollTime = new window.Date().getTime();
40778
- // Return false as a default
40779
- return false;
40780
- }
40781
- function releaseScroll(newEvent) {
40782
- const params = swiper.params.mousewheel;
40783
- if (newEvent.direction < 0) {
40784
- if (swiper.isEnd && !swiper.params.loop && params.releaseOnEdges) {
40785
- // Return true to animate scroll on edges
40786
- return true;
40787
- }
40788
- } else if (swiper.isBeginning && !swiper.params.loop && params.releaseOnEdges) {
40789
- // Return true to animate scroll on edges
40790
- return true;
40768
+ const slide = swiper.slides[index];
40769
+ let value = slugify(slide.getAttribute('data-history'));
40770
+ if (swiper.params.history.root.length > 0) {
40771
+ let root = swiper.params.history.root;
40772
+ if (root[root.length - 1] === '/') root = root.slice(0, root.length - 1);
40773
+ value = `${root}/${key ? `${key}/` : ''}${value}`;
40774
+ } else if (!location.pathname.includes(key)) {
40775
+ value = `${key ? `${key}/` : ''}${value}`;
40791
40776
  }
40792
- return false;
40793
- }
40794
- function handle(event) {
40795
- let e = event;
40796
- let disableParentSwiper = true;
40797
- if (!swiper.enabled) return;
40798
-
40799
- // Ignore event if the target or its parents have the swiper-no-mousewheel class
40800
- if (event.target.closest(`.${swiper.params.mousewheel.noMousewheelClass}`)) return;
40801
- const params = swiper.params.mousewheel;
40802
- if (swiper.params.cssMode) {
40803
- e.preventDefault();
40777
+ if (swiper.params.history.keepQuery) {
40778
+ value += location.search;
40804
40779
  }
40805
- let targetEl = swiper.el;
40806
- if (swiper.params.mousewheel.eventsTarget !== 'container') {
40807
- targetEl = document.querySelector(swiper.params.mousewheel.eventsTarget);
40780
+ const currentState = window.history.state;
40781
+ if (currentState && currentState.value === value) {
40782
+ return;
40808
40783
  }
40809
- const targetElContainsTarget = targetEl && targetEl.contains(e.target);
40810
- if (!swiper.mouseEntered && !targetElContainsTarget && !params.releaseOnEdges) return true;
40811
- if (e.originalEvent) e = e.originalEvent; // jquery fix
40812
- let delta = 0;
40813
- const rtlFactor = swiper.rtlTranslate ? -1 : 1;
40814
- const data = normalize(e);
40815
- if (params.forceToAxis) {
40816
- if (swiper.isHorizontal()) {
40817
- if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = -data.pixelX * rtlFactor;else return true;
40818
- } else if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = -data.pixelY;else return true;
40784
+ if (swiper.params.history.replaceState) {
40785
+ window.history.replaceState({
40786
+ value
40787
+ }, null, value);
40819
40788
  } else {
40820
- delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? -data.pixelX * rtlFactor : -data.pixelY;
40821
- }
40822
- if (delta === 0) return true;
40823
- if (params.invert) delta = -delta;
40824
-
40825
- // Get the scroll positions
40826
- let positions = swiper.getTranslate() + delta * params.sensitivity;
40827
- if (positions >= swiper.minTranslate()) positions = swiper.minTranslate();
40828
- if (positions <= swiper.maxTranslate()) positions = swiper.maxTranslate();
40829
-
40830
- // When loop is true:
40831
- // the disableParentSwiper will be true.
40832
- // When loop is false:
40833
- // if the scroll positions is not on edge,
40834
- // then the disableParentSwiper will be true.
40835
- // if the scroll on edge positions,
40836
- // then the disableParentSwiper will be false.
40837
- disableParentSwiper = swiper.params.loop ? true : !(positions === swiper.minTranslate() || positions === swiper.maxTranslate());
40838
- if (disableParentSwiper && swiper.params.nested) e.stopPropagation();
40839
- if (!swiper.params.freeMode || !swiper.params.freeMode.enabled) {
40840
- // Register the new event in a variable which stores the relevant data
40841
- const newEvent = {
40842
- time: now(),
40843
- delta: Math.abs(delta),
40844
- direction: Math.sign(delta),
40845
- raw: event
40846
- };
40847
-
40848
- // Keep the most recent events
40849
- if (recentWheelEvents.length >= 2) {
40850
- recentWheelEvents.shift(); // only store the last N events
40851
- }
40852
-
40853
- const prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined;
40854
- recentWheelEvents.push(newEvent);
40855
-
40856
- // If there is at least one previous recorded event:
40857
- // If direction has changed or
40858
- // if the scroll is quicker than the previous one:
40859
- // Animate the slider.
40860
- // Else (this is the first time the wheel is moved):
40861
- // Animate the slider.
40862
- if (prevEvent) {
40863
- if (newEvent.direction !== prevEvent.direction || newEvent.delta > prevEvent.delta || newEvent.time > prevEvent.time + 150) {
40864
- animateSlider(newEvent);
40789
+ window.history.pushState({
40790
+ value
40791
+ }, null, value);
40792
+ }
40793
+ };
40794
+ const scrollToSlide = (speed, value, runCallbacks) => {
40795
+ if (value) {
40796
+ for (let i = 0, length = swiper.slides.length; i < length; i += 1) {
40797
+ const slide = swiper.slides[i];
40798
+ const slideHistory = slugify(slide.getAttribute('data-history'));
40799
+ if (slideHistory === value) {
40800
+ const index = swiper.getSlideIndex(slide);
40801
+ swiper.slideTo(index, speed, runCallbacks);
40865
40802
  }
40866
- } else {
40867
- animateSlider(newEvent);
40868
- }
40869
-
40870
- // If it's time to release the scroll:
40871
- // Return now so you don't hit the preventDefault.
40872
- if (releaseScroll(newEvent)) {
40873
- return true;
40874
40803
  }
40875
40804
  } else {
40876
- // Freemode or scrollContainer:
40877
-
40878
- // If we recently snapped after a momentum scroll, then ignore wheel events
40879
- // to give time for the deceleration to finish. Stop ignoring after 500 msecs
40880
- // or if it's a new scroll (larger delta or inverse sign as last event before
40881
- // an end-of-momentum snap).
40882
- const newEvent = {
40883
- time: now(),
40884
- delta: Math.abs(delta),
40885
- direction: Math.sign(delta)
40886
- };
40887
- const ignoreWheelEvents = lastEventBeforeSnap && newEvent.time < lastEventBeforeSnap.time + 500 && newEvent.delta <= lastEventBeforeSnap.delta && newEvent.direction === lastEventBeforeSnap.direction;
40888
- if (!ignoreWheelEvents) {
40889
- lastEventBeforeSnap = undefined;
40890
- let position = swiper.getTranslate() + delta * params.sensitivity;
40891
- const wasBeginning = swiper.isBeginning;
40892
- const wasEnd = swiper.isEnd;
40893
- if (position >= swiper.minTranslate()) position = swiper.minTranslate();
40894
- if (position <= swiper.maxTranslate()) position = swiper.maxTranslate();
40895
- swiper.setTransition(0);
40896
- swiper.setTranslate(position);
40897
- swiper.updateProgress();
40898
- swiper.updateActiveIndex();
40899
- swiper.updateSlidesClasses();
40900
- if (!wasBeginning && swiper.isBeginning || !wasEnd && swiper.isEnd) {
40901
- swiper.updateSlidesClasses();
40902
- }
40903
- if (swiper.params.loop) {
40904
- swiper.loopFix({
40905
- direction: newEvent.direction < 0 ? 'next' : 'prev',
40906
- byMousewheel: true
40907
- });
40908
- }
40909
- if (swiper.params.freeMode.sticky) {
40910
- // When wheel scrolling starts with sticky (aka snap) enabled, then detect
40911
- // the end of a momentum scroll by storing recent (N=15?) wheel events.
40912
- // 1. do all N events have decreasing or same (absolute value) delta?
40913
- // 2. did all N events arrive in the last M (M=500?) msecs?
40914
- // 3. does the earliest event have an (absolute value) delta that's
40915
- // at least P (P=1?) larger than the most recent event's delta?
40916
- // 4. does the latest event have a delta that's smaller than Q (Q=6?) pixels?
40917
- // If 1-4 are "yes" then we're near the end of a momentum scroll deceleration.
40918
- // Snap immediately and ignore remaining wheel events in this scroll.
40919
- // See comment above for "remaining wheel events in this scroll" determination.
40920
- // If 1-4 aren't satisfied, then wait to snap until 500ms after the last event.
40921
- clearTimeout(timeout);
40922
- timeout = undefined;
40923
- if (recentWheelEvents.length >= 15) {
40924
- recentWheelEvents.shift(); // only store the last N events
40925
- }
40926
-
40927
- const prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined;
40928
- const firstEvent = recentWheelEvents[0];
40929
- recentWheelEvents.push(newEvent);
40930
- if (prevEvent && (newEvent.delta > prevEvent.delta || newEvent.direction !== prevEvent.direction)) {
40931
- // Increasing or reverse-sign delta means the user started scrolling again. Clear the wheel event log.
40932
- recentWheelEvents.splice(0);
40933
- } else if (recentWheelEvents.length >= 15 && newEvent.time - firstEvent.time < 500 && firstEvent.delta - newEvent.delta >= 1 && newEvent.delta <= 6) {
40934
- // We're at the end of the deceleration of a momentum scroll, so there's no need
40935
- // to wait for more events. Snap ASAP on the next tick.
40936
- // Also, because there's some remaining momentum we'll bias the snap in the
40937
- // direction of the ongoing scroll because it's better UX for the scroll to snap
40938
- // in the same direction as the scroll instead of reversing to snap. Therefore,
40939
- // if it's already scrolled more than 20% in the current direction, keep going.
40940
- const snapToThreshold = delta > 0 ? 0.8 : 0.2;
40941
- lastEventBeforeSnap = newEvent;
40942
- recentWheelEvents.splice(0);
40943
- timeout = nextTick(() => {
40944
- swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold);
40945
- }, 0); // no delay; move on next tick
40946
- }
40947
-
40948
- if (!timeout) {
40949
- // if we get here, then we haven't detected the end of a momentum scroll, so
40950
- // we'll consider a scroll "complete" when there haven't been any wheel events
40951
- // for 500ms.
40952
- timeout = nextTick(() => {
40953
- const snapToThreshold = 0.5;
40954
- lastEventBeforeSnap = newEvent;
40955
- recentWheelEvents.splice(0);
40956
- swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold);
40957
- }, 500);
40958
- }
40959
- }
40960
-
40961
- // Emit event
40962
- if (!ignoreWheelEvents) emit('scroll', e);
40963
-
40964
- // Stop autoplay
40965
- if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) swiper.autoplay.stop();
40966
- // Return page scroll on edge positions
40967
- if (params.releaseOnEdges && (position === swiper.minTranslate() || position === swiper.maxTranslate())) {
40968
- return true;
40969
- }
40970
- }
40805
+ swiper.slideTo(0, speed, runCallbacks);
40971
40806
  }
40972
- if (e.preventDefault) e.preventDefault();else e.returnValue = false;
40973
- return false;
40974
- }
40975
- function events(method) {
40976
- let targetEl = swiper.el;
40977
- if (swiper.params.mousewheel.eventsTarget !== 'container') {
40978
- targetEl = document.querySelector(swiper.params.mousewheel.eventsTarget);
40807
+ };
40808
+ const setHistoryPopState = () => {
40809
+ paths = getPathValues(swiper.params.url);
40810
+ scrollToSlide(swiper.params.speed, paths.value, false);
40811
+ };
40812
+ const init = () => {
40813
+ const window = getWindow();
40814
+ if (!swiper.params.history) return;
40815
+ if (!window.history || !window.history.pushState) {
40816
+ swiper.params.history.enabled = false;
40817
+ swiper.params.hashNavigation.enabled = true;
40818
+ return;
40979
40819
  }
40980
- targetEl[method]('mouseenter', handleMouseEnter);
40981
- targetEl[method]('mouseleave', handleMouseLeave);
40982
- targetEl[method]('wheel', handle);
40983
- }
40984
- function enable() {
40985
- if (swiper.params.cssMode) {
40986
- swiper.wrapperEl.removeEventListener('wheel', handle);
40987
- return true;
40820
+ initialized = true;
40821
+ paths = getPathValues(swiper.params.url);
40822
+ if (!paths.key && !paths.value) {
40823
+ if (!swiper.params.history.replaceState) {
40824
+ window.addEventListener('popstate', setHistoryPopState);
40825
+ }
40826
+ return;
40988
40827
  }
40989
- if (swiper.mousewheel.enabled) return false;
40990
- events('addEventListener');
40991
- swiper.mousewheel.enabled = true;
40992
- return true;
40993
- }
40994
- function disable() {
40995
- if (swiper.params.cssMode) {
40996
- swiper.wrapperEl.addEventListener(event, handle);
40997
- return true;
40998
- }
40999
- if (!swiper.mousewheel.enabled) return false;
41000
- events('removeEventListener');
41001
- swiper.mousewheel.enabled = false;
41002
- return true;
41003
- }
41004
- on('init', () => {
41005
- if (!swiper.params.mousewheel.enabled && swiper.params.cssMode) {
41006
- disable();
41007
- }
41008
- if (swiper.params.mousewheel.enabled) enable();
41009
- });
41010
- on('destroy', () => {
41011
- if (swiper.params.cssMode) {
41012
- enable();
41013
- }
41014
- if (swiper.mousewheel.enabled) disable();
41015
- });
41016
- Object.assign(swiper.mousewheel, {
41017
- enable,
41018
- disable
41019
- });
41020
- }
41021
-
41022
- function createElementIfNotDefined(swiper, originalParams, params, checkProps) {
41023
- if (swiper.params.createElements) {
41024
- Object.keys(checkProps).forEach(key => {
41025
- if (!params[key] && params.auto === true) {
41026
- let element = elementChildren(swiper.el, `.${checkProps[key]}`)[0];
41027
- if (!element) {
41028
- element = createElement('div', checkProps[key]);
41029
- element.className = checkProps[key];
41030
- swiper.el.append(element);
41031
- }
41032
- params[key] = element;
41033
- originalParams[key] = element;
41034
- }
41035
- });
41036
- }
41037
- return params;
41038
- }
41039
-
41040
- function classesToSelector(classes) {
41041
- if (classes === void 0) {
41042
- classes = '';
41043
- }
41044
- return `.${classes.trim().replace(/([\.:!+\/])/g, '\\$1') // eslint-disable-line
41045
- .replace(/ /g, '.')}`;
41046
- }
41047
-
41048
- function Pagination(_ref) {
41049
- let {
41050
- swiper,
41051
- extendParams,
41052
- on,
41053
- emit
41054
- } = _ref;
41055
- const pfx = 'swiper-pagination';
41056
- extendParams({
41057
- pagination: {
41058
- el: null,
41059
- bulletElement: 'span',
41060
- clickable: false,
41061
- hideOnClick: false,
41062
- renderBullet: null,
41063
- renderProgressbar: null,
41064
- renderFraction: null,
41065
- renderCustom: null,
41066
- progressbarOpposite: false,
41067
- type: 'bullets',
41068
- // 'bullets' or 'progressbar' or 'fraction' or 'custom'
41069
- dynamicBullets: false,
41070
- dynamicMainBullets: 1,
41071
- formatFractionCurrent: number => number,
41072
- formatFractionTotal: number => number,
41073
- bulletClass: `${pfx}-bullet`,
41074
- bulletActiveClass: `${pfx}-bullet-active`,
41075
- modifierClass: `${pfx}-`,
41076
- currentClass: `${pfx}-current`,
41077
- totalClass: `${pfx}-total`,
41078
- hiddenClass: `${pfx}-hidden`,
41079
- progressbarFillClass: `${pfx}-progressbar-fill`,
41080
- progressbarOppositeClass: `${pfx}-progressbar-opposite`,
41081
- clickableClass: `${pfx}-clickable`,
41082
- lockClass: `${pfx}-lock`,
41083
- horizontalClass: `${pfx}-horizontal`,
41084
- verticalClass: `${pfx}-vertical`,
41085
- paginationDisabledClass: `${pfx}-disabled`
41086
- }
41087
- });
41088
- swiper.pagination = {
41089
- el: null,
41090
- bullets: []
41091
- };
41092
- let bulletSize;
41093
- let dynamicBulletIndex = 0;
41094
- const makeElementsArray = el => (Array.isArray(el) ? el : [el]).filter(e => !!e);
41095
- function isPaginationDisabled() {
41096
- return !swiper.params.pagination.el || !swiper.pagination.el || Array.isArray(swiper.pagination.el) && swiper.pagination.el.length === 0;
41097
- }
41098
- function setSideBullets(bulletEl, position) {
41099
- const {
41100
- bulletActiveClass
41101
- } = swiper.params.pagination;
41102
- if (!bulletEl) return;
41103
- bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`];
41104
- if (bulletEl) {
41105
- bulletEl.classList.add(`${bulletActiveClass}-${position}`);
41106
- bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`];
41107
- if (bulletEl) {
41108
- bulletEl.classList.add(`${bulletActiveClass}-${position}-${position}`);
41109
- }
41110
- }
41111
- }
41112
- function onBulletClick(e) {
41113
- const bulletEl = e.target.closest(classesToSelector(swiper.params.pagination.bulletClass));
41114
- if (!bulletEl) {
41115
- return;
41116
- }
41117
- e.preventDefault();
41118
- const index = elementIndex(bulletEl) * swiper.params.slidesPerGroup;
41119
- if (swiper.params.loop) {
41120
- if (swiper.realIndex === index) return;
41121
- const realIndex = swiper.realIndex;
41122
- const newSlideIndex = swiper.getSlideIndexByData(index);
41123
- const currentSlideIndex = swiper.getSlideIndexByData(swiper.realIndex);
41124
- const loopFix = dir => {
41125
- const indexBeforeLoopFix = swiper.activeIndex;
41126
- swiper.loopFix({
41127
- direction: dir,
41128
- activeSlideIndex: newSlideIndex,
41129
- slideTo: false
41130
- });
41131
- const indexAfterFix = swiper.activeIndex;
41132
- if (indexBeforeLoopFix === indexAfterFix) {
41133
- swiper.slideToLoop(realIndex, 0, false, true);
41134
- }
41135
- };
41136
- if (newSlideIndex > swiper.slides.length - swiper.loopedSlides) {
41137
- loopFix(newSlideIndex > currentSlideIndex ? 'next' : 'prev');
41138
- } else if (swiper.params.centeredSlides) {
41139
- const slidesPerView = swiper.params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(swiper.params.slidesPerView, 10));
41140
- if (newSlideIndex < Math.floor(slidesPerView / 2)) {
41141
- loopFix('prev');
41142
- }
41143
- }
41144
- swiper.slideToLoop(index);
41145
- } else {
41146
- swiper.slideTo(index);
41147
- }
41148
- }
41149
- function update() {
41150
- // Render || Update Pagination bullets/items
41151
- const rtl = swiper.rtl;
41152
- const params = swiper.params.pagination;
41153
- if (isPaginationDisabled()) return;
41154
- let el = swiper.pagination.el;
41155
- el = makeElementsArray(el);
41156
- // Current/Total
41157
- let current;
41158
- let previousIndex;
41159
- const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
41160
- const total = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
41161
- if (swiper.params.loop) {
41162
- previousIndex = swiper.previousRealIndex || 0;
41163
- current = swiper.params.slidesPerGroup > 1 ? Math.floor(swiper.realIndex / swiper.params.slidesPerGroup) : swiper.realIndex;
41164
- } else if (typeof swiper.snapIndex !== 'undefined') {
41165
- current = swiper.snapIndex;
41166
- previousIndex = swiper.previousSnapIndex;
41167
- } else {
41168
- previousIndex = swiper.previousIndex || 0;
41169
- current = swiper.activeIndex || 0;
41170
- }
41171
- // Types
41172
- if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) {
41173
- const bullets = swiper.pagination.bullets;
41174
- let firstIndex;
41175
- let lastIndex;
41176
- let midIndex;
41177
- if (params.dynamicBullets) {
41178
- bulletSize = elementOuterSize(bullets[0], swiper.isHorizontal() ? 'width' : 'height', true);
41179
- el.forEach(subEl => {
41180
- subEl.style[swiper.isHorizontal() ? 'width' : 'height'] = `${bulletSize * (params.dynamicMainBullets + 4)}px`;
41181
- });
41182
- if (params.dynamicMainBullets > 1 && previousIndex !== undefined) {
41183
- dynamicBulletIndex += current - (previousIndex || 0);
41184
- if (dynamicBulletIndex > params.dynamicMainBullets - 1) {
41185
- dynamicBulletIndex = params.dynamicMainBullets - 1;
41186
- } else if (dynamicBulletIndex < 0) {
41187
- dynamicBulletIndex = 0;
41188
- }
41189
- }
41190
- firstIndex = Math.max(current - dynamicBulletIndex, 0);
41191
- lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1);
41192
- midIndex = (lastIndex + firstIndex) / 2;
41193
- }
41194
- bullets.forEach(bulletEl => {
41195
- const classesToRemove = [...['', '-next', '-next-next', '-prev', '-prev-prev', '-main'].map(suffix => `${params.bulletActiveClass}${suffix}`)].map(s => typeof s === 'string' && s.includes(' ') ? s.split(' ') : s).flat();
41196
- bulletEl.classList.remove(...classesToRemove);
41197
- });
41198
- if (el.length > 1) {
41199
- bullets.forEach(bullet => {
41200
- const bulletIndex = elementIndex(bullet);
41201
- if (bulletIndex === current) {
41202
- bullet.classList.add(...params.bulletActiveClass.split(' '));
41203
- } else if (swiper.isElement) {
41204
- bullet.setAttribute('part', 'bullet');
41205
- }
41206
- if (params.dynamicBullets) {
41207
- if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) {
41208
- bullet.classList.add(...`${params.bulletActiveClass}-main`.split(' '));
41209
- }
41210
- if (bulletIndex === firstIndex) {
41211
- setSideBullets(bullet, 'prev');
41212
- }
41213
- if (bulletIndex === lastIndex) {
41214
- setSideBullets(bullet, 'next');
41215
- }
41216
- }
41217
- });
41218
- } else {
41219
- const bullet = bullets[current];
41220
- if (bullet) {
41221
- bullet.classList.add(...params.bulletActiveClass.split(' '));
41222
- }
41223
- if (swiper.isElement) {
41224
- bullets.forEach((bulletEl, bulletIndex) => {
41225
- bulletEl.setAttribute('part', bulletIndex === current ? 'bullet-active' : 'bullet');
41226
- });
41227
- }
41228
- if (params.dynamicBullets) {
41229
- const firstDisplayedBullet = bullets[firstIndex];
41230
- const lastDisplayedBullet = bullets[lastIndex];
41231
- for (let i = firstIndex; i <= lastIndex; i += 1) {
41232
- if (bullets[i]) {
41233
- bullets[i].classList.add(...`${params.bulletActiveClass}-main`.split(' '));
41234
- }
41235
- }
41236
- setSideBullets(firstDisplayedBullet, 'prev');
41237
- setSideBullets(lastDisplayedBullet, 'next');
41238
- }
41239
- }
41240
- if (params.dynamicBullets) {
41241
- const dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4);
41242
- const bulletsOffset = (bulletSize * dynamicBulletsLength - bulletSize) / 2 - midIndex * bulletSize;
41243
- const offsetProp = rtl ? 'right' : 'left';
41244
- bullets.forEach(bullet => {
41245
- bullet.style[swiper.isHorizontal() ? offsetProp : 'top'] = `${bulletsOffset}px`;
41246
- });
41247
- }
41248
- }
41249
- el.forEach((subEl, subElIndex) => {
41250
- if (params.type === 'fraction') {
41251
- subEl.querySelectorAll(classesToSelector(params.currentClass)).forEach(fractionEl => {
41252
- fractionEl.textContent = params.formatFractionCurrent(current + 1);
41253
- });
41254
- subEl.querySelectorAll(classesToSelector(params.totalClass)).forEach(totalEl => {
41255
- totalEl.textContent = params.formatFractionTotal(total);
41256
- });
41257
- }
41258
- if (params.type === 'progressbar') {
41259
- let progressbarDirection;
41260
- if (params.progressbarOpposite) {
41261
- progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal';
41262
- } else {
41263
- progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical';
41264
- }
41265
- const scale = (current + 1) / total;
41266
- let scaleX = 1;
41267
- let scaleY = 1;
41268
- if (progressbarDirection === 'horizontal') {
41269
- scaleX = scale;
41270
- } else {
41271
- scaleY = scale;
41272
- }
41273
- subEl.querySelectorAll(classesToSelector(params.progressbarFillClass)).forEach(progressEl => {
41274
- progressEl.style.transform = `translate3d(0,0,0) scaleX(${scaleX}) scaleY(${scaleY})`;
41275
- progressEl.style.transitionDuration = `${swiper.params.speed}ms`;
41276
- });
41277
- }
41278
- if (params.type === 'custom' && params.renderCustom) {
41279
- subEl.innerHTML = params.renderCustom(swiper, current + 1, total);
41280
- if (subElIndex === 0) emit('paginationRender', subEl);
41281
- } else {
41282
- if (subElIndex === 0) emit('paginationRender', subEl);
41283
- emit('paginationUpdate', subEl);
41284
- }
41285
- if (swiper.params.watchOverflow && swiper.enabled) {
41286
- subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);
41287
- }
41288
- });
41289
- }
41290
- function render() {
41291
- // Render Container
41292
- const params = swiper.params.pagination;
41293
- if (isPaginationDisabled()) return;
41294
- const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
41295
- let el = swiper.pagination.el;
41296
- el = makeElementsArray(el);
41297
- let paginationHTML = '';
41298
- if (params.type === 'bullets') {
41299
- let numberOfBullets = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
41300
- if (swiper.params.freeMode && swiper.params.freeMode.enabled && numberOfBullets > slidesLength) {
41301
- numberOfBullets = slidesLength;
41302
- }
41303
- for (let i = 0; i < numberOfBullets; i += 1) {
41304
- if (params.renderBullet) {
41305
- paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass);
41306
- } else {
41307
- // prettier-ignore
41308
- paginationHTML += `<${params.bulletElement} ${swiper.isElement ? 'part="bullet"' : ''} class="${params.bulletClass}"></${params.bulletElement}>`;
41309
- }
41310
- }
41311
- }
41312
- if (params.type === 'fraction') {
41313
- if (params.renderFraction) {
41314
- paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass);
41315
- } else {
41316
- paginationHTML = `<span class="${params.currentClass}"></span>` + ' / ' + `<span class="${params.totalClass}"></span>`;
41317
- }
41318
- }
41319
- if (params.type === 'progressbar') {
41320
- if (params.renderProgressbar) {
41321
- paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass);
41322
- } else {
41323
- paginationHTML = `<span class="${params.progressbarFillClass}"></span>`;
41324
- }
41325
- }
41326
- swiper.pagination.bullets = [];
41327
- el.forEach(subEl => {
41328
- if (params.type !== 'custom') {
41329
- subEl.innerHTML = paginationHTML || '';
41330
- }
41331
- if (params.type === 'bullets') {
41332
- swiper.pagination.bullets.push(...subEl.querySelectorAll(classesToSelector(params.bulletClass)));
41333
- }
41334
- });
41335
- if (params.type !== 'custom') {
41336
- emit('paginationRender', el[0]);
41337
- }
41338
- }
41339
- function init() {
41340
- swiper.params.pagination = createElementIfNotDefined(swiper, swiper.originalParams.pagination, swiper.params.pagination, {
41341
- el: 'swiper-pagination'
41342
- });
41343
- const params = swiper.params.pagination;
41344
- if (!params.el) return;
41345
- let el;
41346
- if (typeof params.el === 'string' && swiper.isElement) {
41347
- el = swiper.el.querySelector(params.el);
41348
- }
41349
- if (!el && typeof params.el === 'string') {
41350
- el = [...document.querySelectorAll(params.el)];
41351
- }
41352
- if (!el) {
41353
- el = params.el;
41354
- }
41355
- if (!el || el.length === 0) return;
41356
- if (swiper.params.uniqueNavElements && typeof params.el === 'string' && Array.isArray(el) && el.length > 1) {
41357
- el = [...swiper.el.querySelectorAll(params.el)];
41358
- // check if it belongs to another nested Swiper
41359
- if (el.length > 1) {
41360
- el = el.filter(subEl => {
41361
- if (elementParents(subEl, '.swiper')[0] !== swiper.el) return false;
41362
- return true;
41363
- })[0];
41364
- }
41365
- }
41366
- if (Array.isArray(el) && el.length === 1) el = el[0];
41367
- Object.assign(swiper.pagination, {
41368
- el
41369
- });
41370
- el = makeElementsArray(el);
41371
- el.forEach(subEl => {
41372
- if (params.type === 'bullets' && params.clickable) {
41373
- subEl.classList.add(...(params.clickableClass || '').split(' '));
41374
- }
41375
- subEl.classList.add(params.modifierClass + params.type);
41376
- subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
41377
- if (params.type === 'bullets' && params.dynamicBullets) {
41378
- subEl.classList.add(`${params.modifierClass}${params.type}-dynamic`);
41379
- dynamicBulletIndex = 0;
41380
- if (params.dynamicMainBullets < 1) {
41381
- params.dynamicMainBullets = 1;
41382
- }
41383
- }
41384
- if (params.type === 'progressbar' && params.progressbarOpposite) {
41385
- subEl.classList.add(params.progressbarOppositeClass);
41386
- }
41387
- if (params.clickable) {
41388
- subEl.addEventListener('click', onBulletClick);
41389
- }
41390
- if (!swiper.enabled) {
41391
- subEl.classList.add(params.lockClass);
41392
- }
41393
- });
41394
- }
41395
- function destroy() {
41396
- const params = swiper.params.pagination;
41397
- if (isPaginationDisabled()) return;
41398
- let el = swiper.pagination.el;
41399
- if (el) {
41400
- el = makeElementsArray(el);
41401
- el.forEach(subEl => {
41402
- subEl.classList.remove(params.hiddenClass);
41403
- subEl.classList.remove(params.modifierClass + params.type);
41404
- subEl.classList.remove(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
41405
- if (params.clickable) {
41406
- subEl.classList.remove(...(params.clickableClass || '').split(' '));
41407
- subEl.removeEventListener('click', onBulletClick);
41408
- }
41409
- });
41410
- }
41411
- if (swiper.pagination.bullets) swiper.pagination.bullets.forEach(subEl => subEl.classList.remove(...params.bulletActiveClass.split(' ')));
41412
- }
41413
- on('changeDirection', () => {
41414
- if (!swiper.pagination || !swiper.pagination.el) return;
41415
- const params = swiper.params.pagination;
41416
- let {
41417
- el
41418
- } = swiper.pagination;
41419
- el = makeElementsArray(el);
41420
- el.forEach(subEl => {
41421
- subEl.classList.remove(params.horizontalClass, params.verticalClass);
41422
- subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
41423
- });
41424
- });
41425
- on('init', () => {
41426
- if (swiper.params.pagination.enabled === false) {
41427
- // eslint-disable-next-line
41428
- disable();
41429
- } else {
41430
- init();
41431
- render();
41432
- update();
41433
- }
41434
- });
41435
- on('activeIndexChange', () => {
41436
- if (typeof swiper.snapIndex === 'undefined') {
41437
- update();
41438
- }
41439
- });
41440
- on('snapIndexChange', () => {
41441
- update();
41442
- });
41443
- on('snapGridLengthChange', () => {
41444
- render();
41445
- update();
41446
- });
41447
- on('destroy', () => {
41448
- destroy();
41449
- });
41450
- on('enable disable', () => {
41451
- let {
41452
- el
41453
- } = swiper.pagination;
41454
- if (el) {
41455
- el = makeElementsArray(el);
41456
- el.forEach(subEl => subEl.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.pagination.lockClass));
41457
- }
41458
- });
41459
- on('lock unlock', () => {
41460
- update();
41461
- });
41462
- on('click', (_s, e) => {
41463
- const targetEl = e.target;
41464
- const el = makeElementsArray(swiper.pagination.el);
41465
- if (swiper.params.pagination.el && swiper.params.pagination.hideOnClick && el && el.length > 0 && !targetEl.classList.contains(swiper.params.pagination.bulletClass)) {
41466
- if (swiper.navigation && (swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl || swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl)) return;
41467
- const isHidden = el[0].classList.contains(swiper.params.pagination.hiddenClass);
41468
- if (isHidden === true) {
41469
- emit('paginationShow');
41470
- } else {
41471
- emit('paginationHide');
41472
- }
41473
- el.forEach(subEl => subEl.classList.toggle(swiper.params.pagination.hiddenClass));
41474
- }
41475
- });
41476
- const enable = () => {
41477
- swiper.el.classList.remove(swiper.params.pagination.paginationDisabledClass);
41478
- let {
41479
- el
41480
- } = swiper.pagination;
41481
- if (el) {
41482
- el = makeElementsArray(el);
41483
- el.forEach(subEl => subEl.classList.remove(swiper.params.pagination.paginationDisabledClass));
41484
- }
41485
- init();
41486
- render();
41487
- update();
41488
- };
41489
- const disable = () => {
41490
- swiper.el.classList.add(swiper.params.pagination.paginationDisabledClass);
41491
- let {
41492
- el
41493
- } = swiper.pagination;
41494
- if (el) {
41495
- el = makeElementsArray(el);
41496
- el.forEach(subEl => subEl.classList.add(swiper.params.pagination.paginationDisabledClass));
41497
- }
41498
- destroy();
41499
- };
41500
- Object.assign(swiper.pagination, {
41501
- enable,
41502
- disable,
41503
- render,
41504
- update,
41505
- init,
41506
- destroy
41507
- });
41508
- }
41509
-
41510
- function History(_ref) {
41511
- let {
41512
- swiper,
41513
- extendParams,
41514
- on
41515
- } = _ref;
41516
- extendParams({
41517
- history: {
41518
- enabled: false,
41519
- root: '',
41520
- replaceState: false,
41521
- key: 'slides',
41522
- keepQuery: false
41523
- }
41524
- });
41525
- let initialized = false;
41526
- let paths = {};
41527
- const slugify = text => {
41528
- return text.toString().replace(/\s+/g, '-').replace(/[^\w-]+/g, '').replace(/--+/g, '-').replace(/^-+/, '').replace(/-+$/, '');
41529
- };
41530
- const getPathValues = urlOverride => {
41531
- const window = getWindow();
41532
- let location;
41533
- if (urlOverride) {
41534
- location = new URL(urlOverride);
41535
- } else {
41536
- location = window.location;
41537
- }
41538
- const pathArray = location.pathname.slice(1).split('/').filter(part => part !== '');
41539
- const total = pathArray.length;
41540
- const key = pathArray[total - 2];
41541
- const value = pathArray[total - 1];
41542
- return {
41543
- key,
41544
- value
41545
- };
41546
- };
41547
- const setHistory = (key, index) => {
41548
- const window = getWindow();
41549
- if (!initialized || !swiper.params.history.enabled) return;
41550
- let location;
41551
- if (swiper.params.url) {
41552
- location = new URL(swiper.params.url);
41553
- } else {
41554
- location = window.location;
41555
- }
41556
- const slide = swiper.slides[index];
41557
- let value = slugify(slide.getAttribute('data-history'));
41558
- if (swiper.params.history.root.length > 0) {
41559
- let root = swiper.params.history.root;
41560
- if (root[root.length - 1] === '/') root = root.slice(0, root.length - 1);
41561
- value = `${root}/${key ? `${key}/` : ''}${value}`;
41562
- } else if (!location.pathname.includes(key)) {
41563
- value = `${key ? `${key}/` : ''}${value}`;
41564
- }
41565
- if (swiper.params.history.keepQuery) {
41566
- value += location.search;
41567
- }
41568
- const currentState = window.history.state;
41569
- if (currentState && currentState.value === value) {
41570
- return;
41571
- }
41572
- if (swiper.params.history.replaceState) {
41573
- window.history.replaceState({
41574
- value
41575
- }, null, value);
41576
- } else {
41577
- window.history.pushState({
41578
- value
41579
- }, null, value);
41580
- }
41581
- };
41582
- const scrollToSlide = (speed, value, runCallbacks) => {
41583
- if (value) {
41584
- for (let i = 0, length = swiper.slides.length; i < length; i += 1) {
41585
- const slide = swiper.slides[i];
41586
- const slideHistory = slugify(slide.getAttribute('data-history'));
41587
- if (slideHistory === value) {
41588
- const index = swiper.getSlideIndex(slide);
41589
- swiper.slideTo(index, speed, runCallbacks);
41590
- }
41591
- }
41592
- } else {
41593
- swiper.slideTo(0, speed, runCallbacks);
41594
- }
41595
- };
41596
- const setHistoryPopState = () => {
41597
- paths = getPathValues(swiper.params.url);
41598
- scrollToSlide(swiper.params.speed, paths.value, false);
41599
- };
41600
- const init = () => {
41601
- const window = getWindow();
41602
- if (!swiper.params.history) return;
41603
- if (!window.history || !window.history.pushState) {
41604
- swiper.params.history.enabled = false;
41605
- swiper.params.hashNavigation.enabled = true;
41606
- return;
41607
- }
41608
- initialized = true;
41609
- paths = getPathValues(swiper.params.url);
41610
- if (!paths.key && !paths.value) {
41611
- if (!swiper.params.history.replaceState) {
41612
- window.addEventListener('popstate', setHistoryPopState);
41613
- }
41614
- return;
41615
- }
41616
- scrollToSlide(0, paths.value, swiper.params.runCallbacksOnInit);
41617
- if (!swiper.params.history.replaceState) {
41618
- window.addEventListener('popstate', setHistoryPopState);
40828
+ scrollToSlide(0, paths.value, swiper.params.runCallbacksOnInit);
40829
+ if (!swiper.params.history.replaceState) {
40830
+ window.addEventListener('popstate', setHistoryPopState);
41619
40831
  }
41620
40832
  };
41621
40833
  const destroy = () => {
@@ -42115,342 +41327,6 @@ function Thumb(_ref) {
42115
41327
  });
42116
41328
  }
42117
41329
 
42118
- function freeMode(_ref) {
42119
- let {
42120
- swiper,
42121
- extendParams,
42122
- emit,
42123
- once
42124
- } = _ref;
42125
- extendParams({
42126
- freeMode: {
42127
- enabled: false,
42128
- momentum: true,
42129
- momentumRatio: 1,
42130
- momentumBounce: true,
42131
- momentumBounceRatio: 1,
42132
- momentumVelocityRatio: 1,
42133
- sticky: false,
42134
- minimumVelocity: 0.02
42135
- }
42136
- });
42137
- function onTouchStart() {
42138
- if (swiper.params.cssMode) return;
42139
- const translate = swiper.getTranslate();
42140
- swiper.setTranslate(translate);
42141
- swiper.setTransition(0);
42142
- swiper.touchEventsData.velocities.length = 0;
42143
- swiper.freeMode.onTouchEnd({
42144
- currentPos: swiper.rtl ? swiper.translate : -swiper.translate
42145
- });
42146
- }
42147
- function onTouchMove() {
42148
- if (swiper.params.cssMode) return;
42149
- const {
42150
- touchEventsData: data,
42151
- touches
42152
- } = swiper;
42153
- // Velocity
42154
- if (data.velocities.length === 0) {
42155
- data.velocities.push({
42156
- position: touches[swiper.isHorizontal() ? 'startX' : 'startY'],
42157
- time: data.touchStartTime
42158
- });
42159
- }
42160
- data.velocities.push({
42161
- position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'],
42162
- time: now()
42163
- });
42164
- }
42165
- function onTouchEnd(_ref2) {
42166
- let {
42167
- currentPos
42168
- } = _ref2;
42169
- if (swiper.params.cssMode) return;
42170
- const {
42171
- params,
42172
- wrapperEl,
42173
- rtlTranslate: rtl,
42174
- snapGrid,
42175
- touchEventsData: data
42176
- } = swiper;
42177
- // Time diff
42178
- const touchEndTime = now();
42179
- const timeDiff = touchEndTime - data.touchStartTime;
42180
- if (currentPos < -swiper.minTranslate()) {
42181
- swiper.slideTo(swiper.activeIndex);
42182
- return;
42183
- }
42184
- if (currentPos > -swiper.maxTranslate()) {
42185
- if (swiper.slides.length < snapGrid.length) {
42186
- swiper.slideTo(snapGrid.length - 1);
42187
- } else {
42188
- swiper.slideTo(swiper.slides.length - 1);
42189
- }
42190
- return;
42191
- }
42192
- if (params.freeMode.momentum) {
42193
- if (data.velocities.length > 1) {
42194
- const lastMoveEvent = data.velocities.pop();
42195
- const velocityEvent = data.velocities.pop();
42196
- const distance = lastMoveEvent.position - velocityEvent.position;
42197
- const time = lastMoveEvent.time - velocityEvent.time;
42198
- swiper.velocity = distance / time;
42199
- swiper.velocity /= 2;
42200
- if (Math.abs(swiper.velocity) < params.freeMode.minimumVelocity) {
42201
- swiper.velocity = 0;
42202
- }
42203
- // this implies that the user stopped moving a finger then released.
42204
- // There would be no events with distance zero, so the last event is stale.
42205
- if (time > 150 || now() - lastMoveEvent.time > 300) {
42206
- swiper.velocity = 0;
42207
- }
42208
- } else {
42209
- swiper.velocity = 0;
42210
- }
42211
- swiper.velocity *= params.freeMode.momentumVelocityRatio;
42212
- data.velocities.length = 0;
42213
- let momentumDuration = 1000 * params.freeMode.momentumRatio;
42214
- const momentumDistance = swiper.velocity * momentumDuration;
42215
- let newPosition = swiper.translate + momentumDistance;
42216
- if (rtl) newPosition = -newPosition;
42217
- let doBounce = false;
42218
- let afterBouncePosition;
42219
- const bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeMode.momentumBounceRatio;
42220
- let needsLoopFix;
42221
- if (newPosition < swiper.maxTranslate()) {
42222
- if (params.freeMode.momentumBounce) {
42223
- if (newPosition + swiper.maxTranslate() < -bounceAmount) {
42224
- newPosition = swiper.maxTranslate() - bounceAmount;
42225
- }
42226
- afterBouncePosition = swiper.maxTranslate();
42227
- doBounce = true;
42228
- data.allowMomentumBounce = true;
42229
- } else {
42230
- newPosition = swiper.maxTranslate();
42231
- }
42232
- if (params.loop && params.centeredSlides) needsLoopFix = true;
42233
- } else if (newPosition > swiper.minTranslate()) {
42234
- if (params.freeMode.momentumBounce) {
42235
- if (newPosition - swiper.minTranslate() > bounceAmount) {
42236
- newPosition = swiper.minTranslate() + bounceAmount;
42237
- }
42238
- afterBouncePosition = swiper.minTranslate();
42239
- doBounce = true;
42240
- data.allowMomentumBounce = true;
42241
- } else {
42242
- newPosition = swiper.minTranslate();
42243
- }
42244
- if (params.loop && params.centeredSlides) needsLoopFix = true;
42245
- } else if (params.freeMode.sticky) {
42246
- let nextSlide;
42247
- for (let j = 0; j < snapGrid.length; j += 1) {
42248
- if (snapGrid[j] > -newPosition) {
42249
- nextSlide = j;
42250
- break;
42251
- }
42252
- }
42253
- if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') {
42254
- newPosition = snapGrid[nextSlide];
42255
- } else {
42256
- newPosition = snapGrid[nextSlide - 1];
42257
- }
42258
- newPosition = -newPosition;
42259
- }
42260
- if (needsLoopFix) {
42261
- once('transitionEnd', () => {
42262
- swiper.loopFix();
42263
- });
42264
- }
42265
- // Fix duration
42266
- if (swiper.velocity !== 0) {
42267
- if (rtl) {
42268
- momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity);
42269
- } else {
42270
- momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity);
42271
- }
42272
- if (params.freeMode.sticky) {
42273
- // If freeMode.sticky is active and the user ends a swipe with a slow-velocity
42274
- // event, then durations can be 20+ seconds to slide one (or zero!) slides.
42275
- // It's easy to see this when simulating touch with mouse events. To fix this,
42276
- // limit single-slide swipes to the default slide duration. This also has the
42277
- // nice side effect of matching slide speed if the user stopped moving before
42278
- // lifting finger or mouse vs. moving slowly before lifting the finger/mouse.
42279
- // For faster swipes, also apply limits (albeit higher ones).
42280
- const moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate);
42281
- const currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex];
42282
- if (moveDistance < currentSlideSize) {
42283
- momentumDuration = params.speed;
42284
- } else if (moveDistance < 2 * currentSlideSize) {
42285
- momentumDuration = params.speed * 1.5;
42286
- } else {
42287
- momentumDuration = params.speed * 2.5;
42288
- }
42289
- }
42290
- } else if (params.freeMode.sticky) {
42291
- swiper.slideToClosest();
42292
- return;
42293
- }
42294
- if (params.freeMode.momentumBounce && doBounce) {
42295
- swiper.updateProgress(afterBouncePosition);
42296
- swiper.setTransition(momentumDuration);
42297
- swiper.setTranslate(newPosition);
42298
- swiper.transitionStart(true, swiper.swipeDirection);
42299
- swiper.animating = true;
42300
- elementTransitionEnd(wrapperEl, () => {
42301
- if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return;
42302
- emit('momentumBounce');
42303
- swiper.setTransition(params.speed);
42304
- setTimeout(() => {
42305
- swiper.setTranslate(afterBouncePosition);
42306
- elementTransitionEnd(wrapperEl, () => {
42307
- if (!swiper || swiper.destroyed) return;
42308
- swiper.transitionEnd();
42309
- });
42310
- }, 0);
42311
- });
42312
- } else if (swiper.velocity) {
42313
- emit('_freeModeNoMomentumRelease');
42314
- swiper.updateProgress(newPosition);
42315
- swiper.setTransition(momentumDuration);
42316
- swiper.setTranslate(newPosition);
42317
- swiper.transitionStart(true, swiper.swipeDirection);
42318
- if (!swiper.animating) {
42319
- swiper.animating = true;
42320
- elementTransitionEnd(wrapperEl, () => {
42321
- if (!swiper || swiper.destroyed) return;
42322
- swiper.transitionEnd();
42323
- });
42324
- }
42325
- } else {
42326
- swiper.updateProgress(newPosition);
42327
- }
42328
- swiper.updateActiveIndex();
42329
- swiper.updateSlidesClasses();
42330
- } else if (params.freeMode.sticky) {
42331
- swiper.slideToClosest();
42332
- return;
42333
- } else if (params.freeMode) {
42334
- emit('_freeModeNoMomentumRelease');
42335
- }
42336
- if (!params.freeMode.momentum || timeDiff >= params.longSwipesMs) {
42337
- swiper.updateProgress();
42338
- swiper.updateActiveIndex();
42339
- swiper.updateSlidesClasses();
42340
- }
42341
- }
42342
- Object.assign(swiper, {
42343
- freeMode: {
42344
- onTouchStart,
42345
- onTouchMove,
42346
- onTouchEnd
42347
- }
42348
- });
42349
- }
42350
-
42351
- var GalleryClassic = function GalleryClassic(_ref) {
42352
- var configurations = _ref.configurations,
42353
- _ref$className = _ref.className,
42354
- className = _ref$className === void 0 ? "" : _ref$className,
42355
- id = _ref.id,
42356
- disableButtonAndLinks = _ref.disableButtonAndLinks,
42357
- image = _ref.image;
42358
- var swiperRef = useRef(null);
42359
- var properties = configurations.properties,
42360
- design = configurations.design;
42361
- var _properties$content = properties.content,
42362
- title = _properties$content.title,
42363
- description = _properties$content.description,
42364
- enableAnimation = properties.enableAnimation,
42365
- _properties$images = properties.images,
42366
- images = _properties$images === void 0 ? [] : _properties$images,
42367
- src = properties.backgroundImage.src;
42368
- var baseClasses = "grid grid-cols-12 items-center gap-y-8";
42369
- return /*#__PURE__*/React__default.createElement(BlockWrapper, {
42370
- className: className,
42371
- enableAnimation: enableAnimation,
42372
- id: id,
42373
- backgroundImage: mergeLeft({
42374
- src: src
42375
- }, design.backgroundImage),
42376
- design: design.body,
42377
- nestedClassName: baseClasses
42378
- }, /*#__PURE__*/React__default.createElement("div", {
42379
- className: "col-span-12 col-start-1 sm:col-span-6 sm:col-start-4"
42380
- }, /*#__PURE__*/React__default.createElement(Typography$1, {
42381
- disableButtonAndLinks: disableButtonAndLinks,
42382
- isTitle: true,
42383
- component: "h3",
42384
- id: "gallery-classic-title",
42385
- style: design.title
42386
- }, title), /*#__PURE__*/React__default.createElement(Typography$1, {
42387
- disableButtonAndLinks: disableButtonAndLinks,
42388
- id: "gallery-classic-description",
42389
- style: design.description
42390
- }, description)), /*#__PURE__*/React__default.createElement(ArrowButton, {
42391
- isStart: true,
42392
- Icon: ArrowLeft$1,
42393
- className: "hidden sm:flex",
42394
- design: design.navigationButtons,
42395
- onClick: function onClick() {
42396
- var _swiperRef$current;
42397
- return (_swiperRef$current = swiperRef.current) === null || _swiperRef$current === void 0 ? void 0 : _swiperRef$current.slidePrev();
42398
- }
42399
- }), /*#__PURE__*/React__default.createElement("div", {
42400
- className: "ns-gallery-with-multiple-images col-span-10 col-start-2"
42401
- }, /*#__PURE__*/React__default.createElement(Swiper, {
42402
- freeMode: true,
42403
- grabCursor: true,
42404
- loop: true,
42405
- breakpointsBase: "container",
42406
- modules: [Pagination, Mousewheel, freeMode],
42407
- mousewheel: {
42408
- sensitivity: 0.5
42409
- },
42410
- pagination: {
42411
- clickable: true
42412
- },
42413
- slidesPerView: 1,
42414
- spaceBetween: 10,
42415
- breakpoints: {
42416
- 640: {
42417
- slidesPerView: 2,
42418
- spaceBetween: 10
42419
- }
42420
- },
42421
- onSwiper: function onSwiper(swiper) {
42422
- swiperRef.current = swiper;
42423
- }
42424
- }, images.map(function (_ref2, index) {
42425
- var src = _ref2.src,
42426
- caption = _ref2.title,
42427
- style = _ref2.style;
42428
- return /*#__PURE__*/React__default.createElement(SwiperSlide, {
42429
- className: "swiper__wrapper",
42430
- key: getUniqueKey(src, title, index)
42431
- }, /*#__PURE__*/React__default.createElement(StyledImage$1, {
42432
- disableButtonAndLinks: disableButtonAndLinks,
42433
- image: image,
42434
- index: index,
42435
- src: src,
42436
- alt: caption,
42437
- className: "sliding-image",
42438
- design: style,
42439
- id: "gallery-classic-images-".concat(index, "-image"),
42440
- title: caption,
42441
- wrapperClassName: "h-full w-full"
42442
- }));
42443
- }))), /*#__PURE__*/React__default.createElement(ArrowButton, {
42444
- Icon: ArrowRight$1,
42445
- className: "hidden sm:flex",
42446
- design: design.navigationButtons,
42447
- onClick: function onClick() {
42448
- var _swiperRef$current2;
42449
- return (_swiperRef$current2 = swiperRef.current) === null || _swiperRef$current2 === void 0 ? void 0 : _swiperRef$current2.slideNext();
42450
- }
42451
- }));
42452
- };
42453
-
42454
41330
  var _excluded$a = ["configurations", "className", "id", "image"];
42455
41331
  var GalleryWithAutoplay = function GalleryWithAutoplay(_ref) {
42456
41332
  var configurations = _ref.configurations,
@@ -42463,6 +41339,10 @@ var GalleryWithAutoplay = function GalleryWithAutoplay(_ref) {
42463
41339
  _useState2 = _slicedToArray(_useState, 2),
42464
41340
  thumbsSwiper = _useState2[0],
42465
41341
  setThumbsSwiper = _useState2[1];
41342
+ var _useState3 = useState(null),
41343
+ _useState4 = _slicedToArray(_useState3, 2),
41344
+ swiper = _useState4[0],
41345
+ setSwiper = _useState4[1];
42466
41346
  var properties = configurations.properties,
42467
41347
  design = configurations.design;
42468
41348
  var _properties$content = properties.content,
@@ -42478,7 +41358,6 @@ var GalleryWithAutoplay = function GalleryWithAutoplay(_ref) {
42478
41358
  className: className,
42479
41359
  enableAnimation: enableAnimation,
42480
41360
  id: id,
42481
- as: "footer",
42482
41361
  backgroundImage: mergeLeft({
42483
41362
  src: src
42484
41363
  }, design.backgroundImage),
@@ -42502,17 +41381,15 @@ var GalleryWithAutoplay = function GalleryWithAutoplay(_ref) {
42502
41381
  delay: 5000,
42503
41382
  disableOnInteraction: false
42504
41383
  },
42505
- modules: [Thumb, Autoplay, Mousewheel, Pagination],
42506
- mousewheel: {
42507
- sensitivity: 0.5
42508
- },
41384
+ modules: [Thumb, Autoplay],
42509
41385
  pagination: !isThumbsView && {
42510
41386
  clickable: true
42511
41387
  },
42512
41388
  spaceBetween: 10,
42513
41389
  thumbs: {
42514
41390
  swiper: thumbsSwiper
42515
- }
41391
+ },
41392
+ onSwiper: setSwiper
42516
41393
  }, images.map(function (_ref2, index) {
42517
41394
  var src = _ref2.src,
42518
41395
  caption = _ref2.title,
@@ -42534,18 +41411,14 @@ var GalleryWithAutoplay = function GalleryWithAutoplay(_ref) {
42534
41411
  }))), /*#__PURE__*/React__default.createElement("div", {
42535
41412
  className: "ns-gallery-with-sliding-images sm:col-span-6 sm:col-start-4"
42536
41413
  }, isThumbsView && /*#__PURE__*/React__default.createElement(Swiper, {
42537
- freeMode: true,
42538
41414
  watchSlidesProgress: true,
42539
- modules: [Thumb, Pagination, Mousewheel, freeMode],
42540
- mousewheel: {
42541
- sensitivity: 0.5
42542
- },
41415
+ modules: [Thumb],
42543
41416
  pagination: {
42544
41417
  clickable: true
42545
41418
  },
42546
41419
  slidesPerView: 4,
42547
41420
  spaceBetween: 12,
42548
- className: classnames("hidden sm:block", {
41421
+ className: classnames("pointer-events-none hidden sm:block", {
42549
41422
  swiper__thumbs__slide: images.length <= 3
42550
41423
  }),
42551
41424
  onSwiper: setThumbsSwiper
@@ -42554,8 +41427,11 @@ var GalleryWithAutoplay = function GalleryWithAutoplay(_ref) {
42554
41427
  alt = _ref3.alt,
42555
41428
  title = _ref3.title;
42556
41429
  return /*#__PURE__*/React__default.createElement(SwiperSlide, {
42557
- className: "cursor-pointer",
42558
- key: getUniqueKey(src, title, index)
41430
+ className: "!pointer-events-auto cursor-pointer",
41431
+ key: getUniqueKey(src, title, index),
41432
+ onClick: function onClick() {
41433
+ return swiper === null || swiper === void 0 ? void 0 : swiper.slideTo(index);
41434
+ }
42559
41435
  }, /*#__PURE__*/React__default.createElement(StyledImage$1, {
42560
41436
  alt: alt,
42561
41437
  image: image,
@@ -42564,6 +41440,10 @@ var GalleryWithAutoplay = function GalleryWithAutoplay(_ref) {
42564
41440
  title: title,
42565
41441
  className: "clickable-image"
42566
41442
  }));
41443
+ }), /*#__PURE__*/React__default.createElement(Pagination, {
41444
+ swiper: swiper,
41445
+ className: "!pointer-events-auto",
41446
+ design: design.button
42567
41447
  }))));
42568
41448
  };
42569
41449
 
@@ -43301,7 +42181,7 @@ var HeroWithGallery = function HeroWithGallery(_ref) {
43301
42181
  media: media,
43302
42182
  index: index
43303
42183
  }));
43304
- }), /*#__PURE__*/React__default.createElement(Pagination$1, {
42184
+ }), /*#__PURE__*/React__default.createElement(Pagination, {
43305
42185
  swiper: swiper,
43306
42186
  className: "!relative"
43307
42187
  })), /*#__PURE__*/React__default.createElement(ArrowButton, {
@@ -43738,13 +42618,13 @@ var TestimonialWithSlider = function TestimonialWithSlider(_ref) {
43738
42618
  src = properties.backgroundImage.src;
43739
42619
  var baseClasses = "grid grid-cols-12 sm:gap-x-10 gap-x-2 items-center grid-flow-row-dense gap-y-8";
43740
42620
  var imageClasses = function imageClasses(imagePosition) {
43741
- return classnames("col-span-6 col-start-4 sm:col-span-2 flex flex-col items-center", {
42621
+ return classnames("col-span-6 col-start-4 sm:col-span-2 flex flex-col items-center justify-center", {
43742
42622
  "sm:col-start-2": POSITIONS.LEFT.label === imagePosition,
43743
42623
  "sm:col-start-10": POSITIONS.RIGHT.label === imagePosition
43744
42624
  });
43745
42625
  };
43746
42626
  var contentClasses = function contentClasses(imagePosition) {
43747
- return classnames("col-span-12 my-auto sm:col-span-7", {
42627
+ return classnames("col-span-12 my-auto sm:col-span-7 space-y-2", {
43748
42628
  "sm:col-start-5": POSITIONS.LEFT.label === imagePosition,
43749
42629
  "sm:col-start-2": POSITIONS.RIGHT.label === imagePosition
43750
42630
  });
@@ -43794,6 +42674,7 @@ var TestimonialWithSlider = function TestimonialWithSlider(_ref) {
43794
42674
  image: image,
43795
42675
  index: index,
43796
42676
  src: src,
42677
+ priority: true,
43797
42678
  className: "ns-testimonial-image-aspect-ratio object-cover",
43798
42679
  design: design.testimonialImage,
43799
42680
  disableButtonAndLinks: otherProps.disableButtonAndLinks,
@@ -43815,6 +42696,7 @@ var TestimonialWithSlider = function TestimonialWithSlider(_ref) {
43815
42696
  className: contentClasses(imagePosition)
43816
42697
  }, /*#__PURE__*/React__default.createElement(StyledImage$1, {
43817
42698
  index: index,
42699
+ priority: true,
43818
42700
  className: "mx-auto sm:ml-0",
43819
42701
  design: design.testimonialLogo,
43820
42702
  disableButtonAndLinks: otherProps.disableButtonAndLinks,
@@ -43825,10 +42707,11 @@ var TestimonialWithSlider = function TestimonialWithSlider(_ref) {
43825
42707
  }, _objectSpread(_objectSpread({}, otherProps), {}, {
43826
42708
  index: index
43827
42709
  }), {
42710
+ className: "ns-testimonial-text-align",
43828
42711
  disableButtonAndLinks: otherProps.disableButtonAndLinks,
43829
42712
  id: "testimonial-with-slider-".concat(index, "-description")
43830
42713
  }), testimonialDescription))));
43831
- }), /*#__PURE__*/React__default.createElement(Pagination$1, {
42714
+ }), /*#__PURE__*/React__default.createElement(Pagination, {
43832
42715
  swiper: swiper,
43833
42716
  hasNavigation: true,
43834
42717
  design: design.buttons
@@ -43938,6 +42821,7 @@ var TestimonialWithVerticalView = function TestimonialWithVerticalView(_ref) {
43938
42821
  src: logoUrl
43939
42822
  }), /*#__PURE__*/React__default.createElement(Typography$1, _extends$2({
43940
42823
  index: index,
42824
+ className: "ns-testimonial-text-align",
43941
42825
  id: "testimonial-with-vertical-view-images-".concat(index, "-description"),
43942
42826
  style: design.testimonialDescription
43943
42827
  }, otherProps), testimonialDescription)));