'use strict';

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

var _keys = require('babel-runtime/core-js/object/keys');

var _keys2 = _interopRequireDefault(_keys);

var _defineProperty2 = require('babel-runtime/helpers/defineProperty');

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _isFilterable;

var _reselect = require('reselect');

var _field_analysis = require('./field_analysis');

var _field_analysis2 = _interopRequireDefault(_field_analysis);

var _constants = require('../constants');

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

var isFilterable = (_isFilterable = {}, (0, _defineProperty3.default)(_isFilterable, _constants.FILTER_TYPE_DISCRETE, true), (0, _defineProperty3.default)(_isFilterable, _constants.FILTER_TYPE_DATE, true), _isFilterable);

var getFilterableFields = (0, _reselect.createSelector)(_field_analysis2.default, function (fieldAnalysis) {
  return (0, _keys2.default)(fieldAnalysis.properties).filter(function (fieldName) {
    return isFilterable[fieldAnalysis.properties[fieldName].filterType];
  });
});

exports.default = getFilterableFields;
//# sourceMappingURL=filterable_fields.js.map