'use strict';

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

var _reactIntl = require('react-intl');

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

exports.default = function (pluginContext) {
  var _ns2Pottags_common;

  var _pluginContext$inputC = pluginContext.inputComponents,
      CompoundInput = _pluginContext$inputC.CompoundInput,
      OptionPickerInput = _pluginContext$inputC.OptionPickerInput,
      TextInput = _pluginContext$inputC.TextInput,
      AutocompleteInput = _pluginContext$inputC.AutocompleteInput;
  var config = pluginContext.configHelpers.configKey;
  var DATA_TYPE_INT = pluginContext.dataTypes.DATA_TYPE_INT;
  var extensions = pluginContext.config.extensions;


  return {
    document: Object.assign(_defineProperty({}, config, {
      view: {
        type: CompoundInput,
        props: {
          defaultChildSubpath: 'ns2:pottags_common'
        }
      }
    }), extensions.core.fields, {
      'ns2:pottags_common': (_ns2Pottags_common = {}, _defineProperty(_ns2Pottags_common, config, {
        service: {
          ns: 'http://collectionspace.org/services/pottag'
        }
      }), _defineProperty(_ns2Pottags_common, 'family', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.pottags_common.family.name',
            'defaultMessage': 'Family'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'taxon/local'
          }
        }
      })), _defineProperty(_ns2Pottags_common, 'commonName', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.pottags_common.commonName.name',
            'defaultMessage': 'Common name'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Pottags_common, 'locale', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.pottags_common.locale.name',
            'defaultMessage': 'Country name/locale'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Pottags_common, 'taxonName', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.pottags_common.taxonName.name',
            'defaultMessage': 'Taxon name'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'taxon/local'
          }
        }
      })), _defineProperty(_ns2Pottags_common, 'labelData', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.pottags_common.labelData.name',
            'defaultMessage': 'Label data'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Pottags_common, 'numberOfLabels', _defineProperty({}, config, {
        dataType: DATA_TYPE_INT,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.pottags_common.numberOfLabels.name',
            'defaultMessage': 'Number of labels'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Pottags_common, 'printLabels', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.pottags_common.printLabels.name',
            'defaultMessage': 'Print labels'
          }
        }),
        view: {
          type: OptionPickerInput,
          props: {
            source: 'printLabelOptions'
          }
        }
      })), _ns2Pottags_common)
    })
  };
};