'use strict';

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

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

exports.default = configContext => {
  var _configContext$inputC = configContext.inputComponents;
  const CompoundInput = _configContext$inputC.CompoundInput,
        OptionPickerInput = _configContext$inputC.OptionPickerInput,
        TextInput = _configContext$inputC.TextInput;
  const config = configContext.configHelpers.configKey;


  return {
    document: {
      [config]: {
        view: {
          type: CompoundInput,
          props: {
            defaultChildSubpath: 'ns2:contacts_common'
          }
        }
      },
      'ns2:contacts_common': {
        [config]: {
          service: {
            ns: 'http://collectionspace.org/services/contact'
          }
        },
        emailGroupList: {
          [config]: {
            view: {
              type: CompoundInput
            }
          },
          emailGroup: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  'id': 'field.contacts_common.emailGroup.name',
                  'defaultMessage': 'Email'
                }
              }),
              repeating: true,
              view: {
                type: CompoundInput,
                props: {
                  tabular: true
                }
              }
            },
            email: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.contacts_common.email.name',
                    'defaultMessage': 'Address'
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            emailType: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.contacts_common.emailType.name',
                    'defaultMessage': 'Type'
                  }
                }),
                view: {
                  type: OptionPickerInput,
                  props: {
                    source: 'emailTypes'
                  }
                }
              }
            }
          }
        },
        telephoneNumberGroupList: {
          [config]: {
            view: {
              type: CompoundInput
            }
          },
          telephoneNumberGroup: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  'id': 'field.contacts_common.telephoneNumberGroup.name',
                  'defaultMessage': 'Phone'
                }
              }),
              repeating: true,
              view: {
                type: CompoundInput,
                props: {
                  tabular: true
                }
              }
            },
            telephoneNumber: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.contacts_common.telephoneNumber.name',
                    'defaultMessage': 'Number'
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            telephoneNumberType: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.contacts_common.telephoneNumberType.name',
                    'defaultMessage': 'Type'
                  }
                }),
                view: {
                  type: OptionPickerInput,
                  props: {
                    source: 'telephoneNumberTypes'
                  }
                }
              }
            }
          }
        },
        faxNumberGroupList: {
          [config]: {
            view: {
              type: CompoundInput
            }
          },
          faxNumberGroup: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  'id': 'field.contacts_common.faxNumberGroup.name',
                  'defaultMessage': 'Fax'
                }
              }),
              repeating: true,
              view: {
                type: CompoundInput,
                props: {
                  tabular: true
                }
              }
            },
            faxNumber: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.contacts_common.faxNumber.name',
                    'defaultMessage': 'Number'
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            faxNumberType: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.contacts_common.faxNumberType.name',
                    'defaultMessage': 'Type'
                  }
                }),
                view: {
                  type: OptionPickerInput,
                  props: {
                    source: 'faxNumberTypes'
                  }
                }
              }
            }
          }
        },
        webAddressGroupList: {
          [config]: {
            view: {
              type: CompoundInput
            }
          },
          webAddressGroup: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  'id': 'field.contacts_common.webAddressGroup.name',
                  'defaultMessage': 'Web site'
                }
              }),
              repeating: true,
              view: {
                type: CompoundInput,
                props: {
                  tabular: true
                }
              }
            },
            webAddress: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.contacts_common.webAddress.name',
                    'defaultMessage': 'URL'
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            webAddressType: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.contacts_common.webAddressTypeType.name',
                    'defaultMessage': 'Type'
                  }
                }),
                view: {
                  type: OptionPickerInput,
                  props: {
                    source: 'webAddressTypes'
                  }
                }
              }
            }
          }
        },
        addressGroupList: {
          [config]: {
            view: {
              type: CompoundInput
            }
          },
          addressGroup: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  'id': 'field.contacts_common.addressGroup.name',
                  'defaultMessage': 'Address'
                }
              }),
              repeating: true,
              view: {
                type: CompoundInput
              }
            },
            addressType: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.contacts_common.addressType.name',
                    'defaultMessage': 'Type'
                  }
                }),
                view: {
                  type: OptionPickerInput,
                  props: {
                    source: 'addressTypes'
                  }
                }
              }
            },
            addressPlace1: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.contacts_common.addressPlace1.name',
                    'defaultMessage': 'Line 1'
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            addressPlace2: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.contacts_common.addressPlace2.name',
                    'defaultMessage': 'Line 2'
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            addressMunicipality: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.contacts_common.addressMunicipality.name',
                    'defaultMessage': 'Municipality'
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            addressStateOrProvince: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.contacts_common.addressStateOrProvince.name',
                    'defaultMessage': 'State/province'
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            addressPostCode: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.contacts_common.addressPostCode.name',
                    'defaultMessage': 'Postal code'
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            addressCountry: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.contacts_common.addressCountry.name',
                    'defaultMessage': 'Country'
                  }
                }),
                view: {
                  type: OptionPickerInput,
                  props: {
                    source: 'addressCountries'
                  }
                }
              }
            }
          }
        }
      }
    }
  };
};