function Carousel(element, options) {
      var _this;

      _classCallCheck(this, Carousel);

      _this = _possibleConstructorReturn(this, _getPrototypeOf(Carousel).call(this, element, options));

      _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "handleClick", function (evt) {
        if (evt.target.matches(_this.options.selectorScrollRight)) {
          _this.sideScroll('right');
        } else {
          _this.sideScroll('left');
        }
      });

      _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "sideScroll", function (direction) {
        var filmstripWidth = _this.filmstrip.getBoundingClientRect().width;

        var itemWidth = _this.carouselItem.getBoundingClientRect().width + 20;
        var re = /\.*translateX\((.*)px\)/i;
        var translateXValue = _this.filmstrip.style.transform ? Number(_this.filmstrip.style.transform.split(re)[1]) : 0;
        var directionValue = direction === 'right' ? -1 : 1;
        var itemWidthDirection = itemWidth * directionValue;
        var newTranslateValue = itemWidthDirection + translateXValue;

        if (newTranslateValue > 0) {
          newTranslateValue = 0;
        }

        if (newTranslateValue < filmstripWidth * -1) {
          newTranslateValue = filmstripWidth * -1;
        }

        _this.filmstrip.style.transform = "translateX(".concat(newTranslateValue, "px)");
      });

      _this.filmstrip = _this.element.querySelector(_this.options.selectorFilmstrip);
      _this.carouselItem = _this.element.querySelector(_this.options.selectorCarouselItem);

      _this.element.addEventListener('click', function (evt) {
        return _this.handleClick(evt);
      });

      return _this;
    }
/**
     * Carousel.
     * @extends CreateComponent
     * @extends InitComponentBySearch
     * @param {HTMLElement} element The element working as an carousel.
     */
Carousel.
@extends CreateComponent
@extends InitComponentBySearch
@param {HTMLElement} element The element working as an carousel.
Carousel . @extends CreateComponent @extends InitComponentBySearch @param { HTMLElement } element The element working as an carousel .
function Carousel(element, options) {
      var _this;
      _classCallCheck(this, Carousel);
      _this = _possibleConstructorReturn(this, _getPrototypeOf(Carousel).call(this, element, options));
      _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "handleClick", function (evt) {
        if (evt.target.matches(_this.options.selectorScrollRight)) {
          _this.sideScroll('right');
        } else {
          _this.sideScroll('left');
        }
      });
      _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "sideScroll", function (direction) {
        var filmstripWidth = _this.filmstrip.getBoundingClientRect().width;
        var itemWidth = _this.carouselItem.getBoundingClientRect().width + 20;
        var re = /\.*translateX\((.*)px\)/i;
        var translateXValue = _this.filmstrip.style.transform ? Number(_this.filmstrip.style.transform.split(re)[1]) : 0;
        var directionValue = direction === 'right' ? -1 : 1;
        var itemWidthDirection = itemWidth * directionValue;
        var newTranslateValue = itemWidthDirection + translateXValue;
        if (newTranslateValue > 0) {
          newTranslateValue = 0;
        }
        if (newTranslateValue < filmstripWidth * -1) {
          newTranslateValue = filmstripWidth * -1;
        }
        _this.filmstrip.style.transform = "translateX(".concat(newTranslateValue, "px)");
      });
      _this.filmstrip = _this.element.querySelector(_this.options.selectorFilmstrip);
      _this.carouselItem = _this.element.querySelector(_this.options.selectorCarouselItem);
      _this.element.addEventListener('click', function (evt) {
        return _this.handleClick(evt);
      });
      return _this;
    }
function Carousel ( element , options ) { var _this ; _classCallCheck ( this , Carousel ) ; _this = _possibleConstructorReturn ( this , _getPrototypeOf ( Carousel ) . call ( this , element , options ) ) ; _defineProperty ( _assertThisInitialized ( _assertThisInitialized ( _this ) ) , "handleClick" , function ( evt ) { if ( evt . target . matches ( _this . options . selectorScrollRight ) ) { _this . sideScroll ( 'right' ) ; } else { _this . sideScroll ( 'left' ) ; } } ) ; _defineProperty ( _assertThisInitialized ( _assertThisInitialized ( _this ) ) , "sideScroll" , function ( direction ) { var filmstripWidth = _this . filmstrip . getBoundingClientRect ( ) . width ; var itemWidth = _this . carouselItem . getBoundingClientRect ( ) . width + 20 ; var re = / \.*translateX\((.*)px\) / i ; var translateXValue = _this . filmstrip . style . transform ? Number ( _this . filmstrip . style . transform . split ( re ) [ 1 ] ) : 0 ; var directionValue = direction === 'right' ? - 1 : 1 ; var itemWidthDirection = itemWidth * directionValue ; var newTranslateValue = itemWidthDirection + translateXValue ; if ( newTranslateValue > 0 ) { newTranslateValue = 0 ; } if ( newTranslateValue < filmstripWidth * - 1 ) { newTranslateValue = filmstripWidth * - 1 ; } _this . filmstrip . style . transform = "translateX(" . concat ( newTranslateValue , "px)" ) ; } ) ; _this . filmstrip = _this . element . querySelector ( _this . options . selectorFilmstrip ) ; _this . carouselItem = _this . element . querySelector ( _this . options . selectorCarouselItem ) ; _this . element . addEventListener ( 'click' , function ( evt ) { return _this . handleClick ( evt ) ; } ) ; return _this ; }
Carousel.
Carousel .