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.addClass('line-ending');
      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;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZC9hdG9tL3NyYy9hdG9tLTEuMTQuMy9vdXQvYXBwL25vZGVfbW9kdWxlcy9saW5lLWVuZGluZy1zZWxlY3Rvci9saWIvbGluZS1lbmRpbmctbGlzdC12aWV3LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztpQ0FFK0Isc0JBQXNCOztBQUZyRCxXQUFXLENBQUE7O0lBSVUsa0JBQWtCO1lBQWxCLGtCQUFrQjs7V0FBbEIsa0JBQWtCOzBCQUFsQixrQkFBa0I7OytCQUFsQixrQkFBa0I7OztlQUFsQixrQkFBa0I7O1dBQzFCLG9CQUFDLFFBQVEsRUFBRTtBQUNwQixVQUFJLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQTtBQUN4QixpQ0FIaUIsa0JBQWtCLDRDQUdqQjtBQUNsQixVQUFJLENBQUMsUUFBUSxDQUFDLGFBQWEsQ0FBQyxDQUFBO0FBQzVCLFVBQUksQ0FBQyxRQUFRLENBQUMsQ0FBQyxFQUFDLElBQUksRUFBRSxJQUFJLEVBQUUsS0FBSyxFQUFFLElBQUksRUFBQyxFQUFFLEVBQUMsSUFBSSxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQUUsTUFBT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