'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.wrapperStyle = exports.stageStyle = exports.getDefaultStyle = exports.itemStyles = exports.intermediateTransitionProps = undefined;

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

(function () {
  var enterModule = require('react-hot-loader').enterModule;

  enterModule && enterModule(module);
})();

var _animation = require('./animation');

var intermediateTransitionProps = exports.intermediateTransitionProps = function intermediateTransitionProps(condition, duration) {
  return condition ? { fadeoutAnimationProcessing: true, style: { transition: 'transform 0ms ease-out' } } : { style: { transition: 'transform ' + duration + 'ms ease-out' } };
};

var itemStyles = exports.itemStyles = function itemStyles(i, state, animationProps) {
  var fadeOutOffset = animationProps.fadeOutOffset;
  var itemWidth = state.itemWidth,
      duration = state.duration;


  return (0, _animation.isAnimatedItem)(i, animationProps) ? { transform: 'translateX(' + fadeOutOffset + 'px)', animationDuration: duration + 'ms', width: itemWidth + 'px' } : { width: itemWidth + 'px' };
};

var getDefaultStyle = exports.getDefaultStyle = function getDefaultStyle() {
  return { transition: 'transform 0ms ease-out' };
};

var stageStyle = exports.stageStyle = function stageStyle() {
  var currentStyles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var nextStyles = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  var _nextStyles$translate = nextStyles.translate3d,
      translate3d = _nextStyles$translate === undefined ? 0 : _nextStyles$translate,
      height = nextStyles.height;

  var transform = 'translate3d(' + translate3d + 'px, 0, 0)';

  return _extends({}, currentStyles, { transform: transform, height: height });
};

var wrapperStyle = exports.wrapperStyle = function wrapperStyle(_ref) {
  var paddingLeft = _ref.paddingLeft,
      paddingRight = _ref.paddingRight;

  return { paddingLeft: paddingLeft + 'px', paddingRight: paddingRight + 'px' };
};
;

(function () {
  var reactHotLoader = require('react-hot-loader').default;

  var leaveModule = require('react-hot-loader').leaveModule;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(intermediateTransitionProps, 'intermediateTransitionProps', '/Users/mmarinich/WebstormProjects/react-alice-carousel/src/lib/utils/style.js');
  reactHotLoader.register(itemStyles, 'itemStyles', '/Users/mmarinich/WebstormProjects/react-alice-carousel/src/lib/utils/style.js');
  reactHotLoader.register(getDefaultStyle, 'getDefaultStyle', '/Users/mmarinich/WebstormProjects/react-alice-carousel/src/lib/utils/style.js');
  reactHotLoader.register(stageStyle, 'stageStyle', '/Users/mmarinich/WebstormProjects/react-alice-carousel/src/lib/utils/style.js');
  reactHotLoader.register(wrapperStyle, 'wrapperStyle', '/Users/mmarinich/WebstormProjects/react-alice-carousel/src/lib/utils/style.js');
  leaveModule(module);
})();

;