'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 _lenderGroup, _lenderGroupList, _loanStatusGroup, _loanStatusGroupList, _ns2Loansin_common, _document;

  var _pluginContext$inputC = pluginContext.inputComponents,
      CompoundInput = _pluginContext$inputC.CompoundInput,
      DateInput = _pluginContext$inputC.DateInput,
      OptionPickerInput = _pluginContext$inputC.OptionPickerInput,
      TextInput = _pluginContext$inputC.TextInput,
      AutocompleteInput = _pluginContext$inputC.AutocompleteInput,
      IDGeneratorInput = _pluginContext$inputC.IDGeneratorInput,
      TermPickerInput = _pluginContext$inputC.TermPickerInput;
  var config = pluginContext.configHelpers.configKey;
  var DATA_TYPE_DATETIME = pluginContext.dataTypes.DATA_TYPE_DATETIME;


  return {
    document: (_document = {}, _defineProperty(_document, config, {
      view: {
        type: CompoundInput,
        props: {
          defaultChildSubpath: 'ns2:loansin_common'
        }
      }
    }), _defineProperty(_document, 'ns2:collectionspace_core', {
      createdAt: _defineProperty({}, config, {
        dataType: DATA_TYPE_DATETIME,
        view: {
          type: DateInput
        }
      }),
      createdBy: _defineProperty({}, config, {
        view: {
          type: TextInput
        }
      }),
      updatedAt: _defineProperty({}, config, {
        dataType: DATA_TYPE_DATETIME,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.collectionspace_core.updatedAt.name',
            'defaultMessage': 'Last updated time'
          }
        }),
        view: {
          type: DateInput
        }
      }),
      updatedBy: _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.collectionspace_core.updatedBy.name',
            'defaultMessage': 'Last updated by'
          }
        }),
        view: {
          type: TextInput
        }
      })
    }), _defineProperty(_document, 'ns2:loansin_common', (_ns2Loansin_common = {}, _defineProperty(_ns2Loansin_common, config, {
      service: {
        ns: 'http://collectionspace.org/services/loanin'
      }
    }), _defineProperty(_ns2Loansin_common, 'loanInNumber', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.loanInNumber.name',
          'defaultMessage': 'Loan in number'
        }
      }),
      required: true,
      searchView: {
        type: TextInput
      },
      view: {
        type: IDGeneratorInput,
        props: {
          idGeneratorName: 'loanin'
        }
      }
    })), _defineProperty(_ns2Loansin_common, 'loanPurpose', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.loanPurpose.name',
          'defaultMessage': 'Loan purpose'
        }
      }),
      view: {
        type: OptionPickerInput,
        props: {
          source: 'loanPurposes'
        }
      }
    })), _defineProperty(_ns2Loansin_common, 'lenderGroupList', (_lenderGroupList = {}, _defineProperty(_lenderGroupList, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.lenderGroupList.name',
          'defaultMessage': 'Lender'
        }
      }),
      view: {
        type: CompoundInput
      }
    }), _defineProperty(_lenderGroupList, 'lenderGroup', (_lenderGroup = {}, _defineProperty(_lenderGroup, config, {
      repeating: true,
      view: {
        type: CompoundInput,
        props: {
          tabular: true
        }
      }
    }), _defineProperty(_lenderGroup, 'lender', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.lender.name',
          'defaultMessage': 'Lender'
        }
      }),
      view: {
        type: AutocompleteInput,
        props: {
          source: 'person/local,person/shared,organization/local,organization/shared'
        }
      }
    })), _defineProperty(_lenderGroup, 'lendersAuthorizer', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.lendersAuthorizer.name',
          'defaultMessage': 'Lender\'s authorizer'
        }
      }),
      view: {
        type: AutocompleteInput,
        props: {
          source: 'person/local,person/shared'
        }
      }
    })), _defineProperty(_lenderGroup, 'lendersContact', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.lendersContact.name',
          'defaultMessage': 'Lender\'s contact'
        }
      }),
      view: {
        type: AutocompleteInput,
        props: {
          source: 'person/local,person/shared'
        }
      }
    })), _defineProperty(_lenderGroup, 'lendersAuthorizationDate', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.lendersAuthorizationDate.name',
          'defaultMessage': 'Lender\'s authorization date'
        }
      }),
      view: {
        type: DateInput
      }
    })), _lenderGroup)), _lenderGroupList)), _defineProperty(_ns2Loansin_common, 'borrowersContact', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.borrowersContact.name',
          'defaultMessage': 'Borrower\'s contact'
        }
      }),
      view: {
        type: AutocompleteInput,
        props: {
          source: 'person/local,person/shared'
        }
      }
    })), _defineProperty(_ns2Loansin_common, 'borrowersAuthorizer', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.borrowersAuthorizer.name',
          'defaultMessage': 'Borrower\'s authorizer'
        }
      }),
      view: {
        type: AutocompleteInput,
        props: {
          source: 'person/local,person/shared'
        }
      }
    })), _defineProperty(_ns2Loansin_common, 'borrowersAuthorizationDate', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.borrowersAuthorizationDate.name',
          'defaultMessage': 'Borrower\'s authorization date'
        }
      }),
      view: {
        type: DateInput
      }
    })), _defineProperty(_ns2Loansin_common, 'specialConditionsOfLoan', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.specialConditionsOfLoan.name',
          'defaultMessage': 'Loan in conditions'
        }
      }),
      view: {
        type: TextInput,
        props: {
          multiline: true
        }
      }
    })), _defineProperty(_ns2Loansin_common, 'loanInNote', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.loanInNote.name',
          'defaultMessage': 'Loan in note'
        }
      }),
      view: {
        type: TextInput,
        props: {
          multiline: true
        }
      }
    })), _defineProperty(_ns2Loansin_common, 'loanStatusGroupList', (_loanStatusGroupList = {}, _defineProperty(_loanStatusGroupList, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.loanStatusGroupList.name',
          'defaultMessage': 'Loan status'
        }
      }),
      view: {
        type: CompoundInput
      }
    }), _defineProperty(_loanStatusGroupList, 'loanStatusGroup', (_loanStatusGroup = {}, _defineProperty(_loanStatusGroup, config, {
      repeating: true,
      view: {
        type: CompoundInput,
        props: {
          tabular: true
        }
      }
    }), _defineProperty(_loanStatusGroup, 'loanStatus', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.loanStatus.name',
          'defaultMessage': 'Loan status'
        }
      }),
      view: {
        type: TermPickerInput,
        props: {
          source: 'loanoutstatus'
        }
      }
    })), _defineProperty(_loanStatusGroup, 'loanStatusDate', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.loanStatusDate.name',
          'defaultMessage': 'Loan status date'
        }
      }),
      view: {
        type: DateInput
      }
    })), _defineProperty(_loanStatusGroup, 'loanStatusNote', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.loanStatusNote.name',
          'defaultMessage': 'Loan status note'
        }
      }),
      view: {
        type: TextInput
      }
    })), _loanStatusGroup)), _loanStatusGroupList)), _defineProperty(_ns2Loansin_common, 'loanInDate', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.loanInDate.name',
          'defaultMessage': 'Loan in date'
        }
      }),
      view: {
        type: DateInput
      }
    })), _defineProperty(_ns2Loansin_common, 'loanReturnDate', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.loanReturnDate.name',
          'defaultMessage': 'Loan return date'
        }
      }),
      view: {
        type: DateInput
      }
    })), _defineProperty(_ns2Loansin_common, 'loanRenewalApplicationDate', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.loansin_common.loanRenewalApplicationDate.name',
          'defaultMessage': 'Loan renewal application date'
        }
      }),
      view: {
        type: DateInput
      }
    })), _ns2Loansin_common)), _document)
  };
};