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

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; }; })();

var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };

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

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 _atomSpacePenViews = require('atom-space-pen-views');

'use babel';

var LineEndingListView = (function (_SelectListView) {
  _inherits(LineEndingListView, _SelectListView);

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

    _get(Object.getPrototypeOf(LineEndingListView.prototype), 'constructor', this).apply(this, arguments);
  }

  _createClass(LineEndingListView, [{
    key: 'initialize',
    value: function initialize(callback) {
      this.callback = callback;
      _get(Object.getPrototypeOf(LineEndingListView.prototype), 'initialize', this).call(this);
      this.setItems([{ name: 'LF', value: '\n' }, { name: 'CRLF', value: '\r\n' }]);
    }
  }, {
    key: 'getFilterKey',
    value: function getFilterKey() {
      return 'name';
    }
  }, {
    key: 'viewForItem',
    value: function viewForItem(ending) {
      var element = document.createElement('li');
      element.textContent = ending.name;
      return element;
    }
  }, {
    key: 'cancelled',
    value: function cancelled() {
      this.callback();
    }
  }, {
    key: 'confirmed',
    value: function confirmed(ending) {
      this.cancel();
      this.callback(ending.value);
    }
  }, {
    key: 'reset',
    value: function reset() {
      this.filterEditorView.focus();
      this.populateList();
    }
  }]);

  return LineEndingListView;
})(_atomSpacePenViews.SelectListView);

exports['default'] = LineEndingListView;
module.exports = exports['default'];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZC9hdG9tL3NyYy9hdG9tLTEuMTIuNy9vdXQvYXBwL25vZGVfbW9kdWxlcy9saW5lLWVuZGluZy1zZWxlY3Rvci9saWIvbGluZS1lbmRpbmctbGlzdC12aWV3LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztpQ0FFK0Isc0JBQXNCOztBQUZyRCxXQUFXLENBQUE7O0lBSVUsa0JBQWtCO1lBQWxCLGtCQUFrQjs7V0FBbEIsa0JBQWtCOzBCQUFsQixrQkFBa0I7OytCQUFsQixrQkFBa0I7OztlQUFsQixrQkFBa0I7O1dBQzFCLG9CQUFDLFFBQVEsRUFBRTtBQUNwQixVQUFJLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQTtBQUN4QixpQ0FIaUIsa0JBQWtCLDRDQUdqQjtBQUNsQixVQUFJLENBQUMsUUFBUSxDQUFDLENBQUMsRUFBQyxJQUFJLEVBQUUsSUFBSSxFQUFFLEtBQUssRUFBRSxJQUFJLEVBQUMsRUFBRSxFQUFDLElBQUksRUFBRSxNQUFNLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBQyxDQUFDLENBQUMsQ0FBQTtLQUMxRTs7O1dBRVksd0JBQUc7QUFDZCxhQUFPLE1BQU0sQ0F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