(function (global, factory) {
  if (typeof define === "function" && define.amd) {
    define(['exports', 'react', 'classnames', '../../iron/IronSelector', './device-view', './px-demo-helpers.scss'], factory);
  } else if (typeof exports !== "undefined") {
    factory(exports, require('react'), require('classnames'), require('../../iron/IronSelector'), require('./device-view'), require('./px-demo-helpers.scss'));
  } else {
    var mod = {
      exports: {}
    };
    factory(mod.exports, global.react, global.classnames, global.IronSelector, global.deviceView, global.pxDemoHelpers);
    global.index = mod.exports;
  }
})(this, function (exports, _react, _classnames, _IronSelector, _deviceView, _pxDemoHelpers) {
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });

  var _react2 = _interopRequireDefault(_react);

  var _classnames2 = _interopRequireDefault(_classnames);

  var _IronSelector2 = _interopRequireDefault(_IronSelector);

  var _deviceView2 = _interopRequireDefault(_deviceView);

  var _pxDemoHelpers2 = _interopRequireDefault(_pxDemoHelpers);

  function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : {
      default: obj
    };
  }

  function _classCallCheck(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }

  var _createClass = function () {
    function defineProperties(target, props) {
      for (var i = 0; i < props.length; i++) {
        var descriptor = props[i];
        descriptor.enumerable = descriptor.enumerable || false;
        descriptor.configurable = true;
        if ("value" in descriptor) descriptor.writable = true;
        Object.defineProperty(target, descriptor.key, descriptor);
      }
    }

    return function (Constructor, protoProps, staticProps) {
      if (protoProps) defineProperties(Constructor.prototype, protoProps);
      if (staticProps) defineProperties(Constructor, staticProps);
      return Constructor;
    };
  }();

  function _possibleConstructorReturn(self, call) {
    if (!self) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }

    return call && (typeof call === "object" || typeof call === "function") ? call : self;
  }

  function _inherits(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
    }

    subClass.prototype = Object.create(superClass && superClass.prototype, {
      constructor: {
        value: subClass,
        enumerable: false,
        writable: true,
        configurable: true
      }
    });
    if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  }

  var DeviceLayoutViewer = function (_React$Component) {
    _inherits(DeviceLayoutViewer, _React$Component);

    function DeviceLayoutViewer() {
      _classCallCheck(this, DeviceLayoutViewer);

      return _possibleConstructorReturn(this, (DeviceLayoutViewer.__proto__ || Object.getPrototypeOf(DeviceLayoutViewer)).apply(this, arguments));
    }

    _createClass(DeviceLayoutViewer, [{
      key: 'render',
      value: function render() {
        var _props = this.props,
            device = _props.device,
            src = _props.src,
            _props$selectedView = _props.selectedView,
            selectedView = _props$selectedView === undefined ? 0 : _props$selectedView,
            children = _props.children;

        return _react2.default.createElement(
          'div',
          { className: 'px-demo-helpers ' + device },
          _react2.default.createElement(
            'div',
            { className: 'canvas ' + device },
            _react2.default.createElement(
              _IronSelector2.default,
              { className: (0, _classnames2.default)('views', device),
                selected: device,
                propForSelected: 'device',
                selectedItem: selectedView },
              _react2.default.createElement(
                _deviceView2.default,
                { device: 'laptop', src: src },
                children
              ),
              _react2.default.createElement(
                _deviceView2.default,
                { device: 'tablet', src: src, landscape: true },
                children
              ),
              _react2.default.createElement(
                _deviceView2.default,
                { device: 'phone', src: src },
                children
              )
            )
          ),
          _react2.default.createElement(
            'style',
            null,
            '' + _pxDemoHelpers2.default
          )
        );
      }
    }]);

    return DeviceLayoutViewer;
  }(_react2.default.Component);

  var DemoHelpers = {
    DeviceView: _deviceView2.default,
    DeviceLayoutViewer: DeviceLayoutViewer
  };

  exports.default = DemoHelpers;
});