'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,
        DateInput = _configContext$inputC.DateInput,
        OptionPickerInput = _configContext$inputC.OptionPickerInput,
        TextInput = _configContext$inputC.TextInput,
        AutocompleteInput = _configContext$inputC.AutocompleteInput,
        IDGeneratorInput = _configContext$inputC.IDGeneratorInput;
  const config = configContext.configHelpers.configKey;
  const DATA_TYPE_DATE = configContext.dataTypes.DATA_TYPE_DATE;
  const extensions = configContext.config.extensions;


  return {
    document: Object.assign({
      [config]: {
        view: {
          type: CompoundInput,
          props: {
            defaultChildSubpath: 'ns2:conditionchecks_common'
          }
        }
      }
    }, extensions.core.fields, {
      'ns2:conditionchecks_common': {
        [config]: {
          service: {
            ns: 'http://collectionspace.org/services/conditioncheck'
          }
        },
        objectAuditCategory: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.conditionchecks_common.objectAuditCategory.name',
                'defaultMessage': 'Object audit category'
              }
            }),
            view: {
              type: OptionPickerInput,
              props: {
                source: 'objectAuditCategories'
              }
            }
          }
        },
        completenessGroupList: {
          [config]: {
            view: {
              type: CompoundInput
            }
          },
          completenessGroup: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  'id': 'field.conditionchecks_common.completenessGroup.name',
                  'defaultMessage': 'Completeness'
                }
              }),
              repeating: true,
              view: {
                type: CompoundInput,
                props: {
                  tabular: true
                }
              }
            },
            completeness: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.completeness.name',
                    'defaultMessage': 'Description'
                  }
                }),
                view: {
                  type: OptionPickerInput,
                  props: {
                    source: 'completenessLevels'
                  }
                }
              }
            },
            completenessDate: {
              [config]: {
                dataType: DATA_TYPE_DATE,
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.completenessDate.name',
                    'defaultMessage': 'Date'
                  },
                  fullName: {
                    'id': 'field.conditionchecks_common.completenessDate.fullName',
                    'defaultMessage': 'Completeness date'
                  }
                }),
                view: {
                  type: DateInput
                }
              }
            },
            completenessNote: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.completenessNote.name',
                    'defaultMessage': 'Note'
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            }
          }
        },
        conditionCheckGroupList: {
          [config]: {
            view: {
              type: CompoundInput
            }
          },
          conditionCheckGroup: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  'id': 'field.conditionchecks_common.conditionCheckGroup.name',
                  'defaultMessage': 'Condition'
                }
              }),
              repeating: true,
              view: {
                type: CompoundInput,
                props: {
                  tabular: true
                }
              }
            },
            condition: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.condition.name',
                    'defaultMessage': 'Description'
                  },
                  fullName: {
                    'id': 'field.conditionchecks_common.condition.fullName',
                    'defaultMessage': 'Condition description'
                  }
                }),
                view: {
                  type: OptionPickerInput,
                  props: {
                    source: 'conditions'
                  }
                }
              }
            },
            conditionDate: {
              [config]: {
                dataType: DATA_TYPE_DATE,
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.conditionDate.name',
                    'defaultMessage': 'Date'
                  },
                  fullName: {
                    'id': 'field.conditionchecks_common.conditionDate.fullName',
                    'defaultMessage': 'Condition date'
                  }
                }),
                view: {
                  type: DateInput
                }
              }
            },
            conditionNote: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.conditionNote.name',
                    'defaultMessage': 'Note'
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            }
          }
        },
        conservationTreatmentPriority: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.conditionchecks_common.conservationTreatmentPriority.name',
                'defaultMessage': 'Conservation treatment priority'
              }
            }),
            view: {
              type: OptionPickerInput,
              props: {
                source: 'conservationTreatmentPriorities'
              }
            }
          }
        },
        envConditionNoteGroupList: {
          [config]: {
            view: {
              type: CompoundInput
            }
          },
          envConditionNoteGroup: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  'id': 'field.conditionchecks_common.envConditionNoteGroup.name',
                  'defaultMessage': 'Environmental condition'
                }
              }),
              repeating: true,
              view: {
                type: CompoundInput,
                props: {
                  tabular: true
                }
              }
            },
            envConditionNote: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.envConditionNote.name',
                    'defaultMessage': 'Note'
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            envConditionNoteDate: {
              [config]: {
                dataType: DATA_TYPE_DATE,
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.envConditionNoteDate.name',
                    'defaultMessage': 'Date'
                  },
                  fullName: {
                    'id': 'field.conditionchecks_common.envConditionNoteDate.fullName',
                    'defaultMessage': 'Environmental condition date'
                  }
                }),
                view: {
                  type: DateInput
                }
              }
            }
          }
        },
        nextConditionCheckDate: {
          [config]: {
            dataType: DATA_TYPE_DATE,
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.conditionchecks_common.nextConditionCheckDate.name',
                'defaultMessage': 'Next check/assessment date'
              }
            }),
            view: {
              type: DateInput
            }
          }
        },
        techAssessmentGroupList: {
          [config]: {
            view: {
              type: CompoundInput
            }
          },
          techAssessmentGroup: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  'id': 'field.conditionchecks_common.techAssessmentGroup.name',
                  'defaultMessage': 'Technical assessment'
                }
              }),
              repeating: true,
              view: {
                type: CompoundInput,
                props: {
                  tabular: true
                }
              }
            },
            techAssessment: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.techAssessment.name',
                    'defaultMessage': 'Description'
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            techAssessmentDate: {
              [config]: {
                dataType: DATA_TYPE_DATE,
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.techAssessmentDate.name',
                    'defaultMessage': 'Date'
                  },
                  fullName: {
                    'id': 'field.conditionchecks_common.techAssessmentDate.fullName',
                    'defaultMessage': 'Technical assessment date'
                  }
                }),
                view: {
                  type: DateInput
                }
              }
            }
          }
        },
        hazardGroupList: {
          [config]: {
            view: {
              type: CompoundInput
            }
          },
          hazardGroup: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  'id': 'field.conditionchecks_common.hazardGroup.name',
                  'defaultMessage': 'Hazard'
                }
              }),
              repeating: true,
              view: {
                type: CompoundInput,
                props: {
                  tabular: true
                }
              }
            },
            hazard: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.hazard.name',
                    'defaultMessage': 'Description'
                  }
                }),
                view: {
                  type: OptionPickerInput,
                  props: {
                    source: 'hazards'
                  }
                }
              }
            },
            hazardDate: {
              [config]: {
                dataType: DATA_TYPE_DATE,
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.hazardDate.name',
                    'defaultMessage': 'Date'
                  },
                  fullName: {
                    'id': 'field.conditionchecks_common.hazardDate.fullName',
                    'defaultMessage': 'Hazard date'
                  }
                }),
                view: {
                  type: DateInput
                }
              }
            },
            hazardNote: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.hazardNote.name',
                    'defaultMessage': 'Note'
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            }
          }
        },
        conditionCheckAssessmentDate: {
          [config]: {
            dataType: DATA_TYPE_DATE,
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.conditionchecks_common.conditionCheckAssessmentDate.name',
                'defaultMessage': 'Check/assessment date'
              }
            }),
            view: {
              type: DateInput
            }
          }
        },
        conditionCheckMethod: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.conditionchecks_common.conditionCheckMethod.name',
                'defaultMessage': 'Method'
              }
            }),
            view: {
              type: OptionPickerInput,
              props: {
                source: 'conditionCheckMethods'
              }
            }
          }
        },
        conditionCheckNote: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.conditionchecks_common.conditionCheckNote.name',
                'defaultMessage': 'Note'
              }
            }),
            view: {
              type: TextInput,
              props: {
                multiline: true
              }
            }
          }
        },
        conditionCheckReason: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.conditionchecks_common.conditionCheckReason.name',
                'defaultMessage': 'Reason'
              }
            }),
            view: {
              type: OptionPickerInput,
              props: {
                source: 'conditionCheckReasons'
              }
            }
          }
        },
        conditionCheckRefNumber: {
          [config]: {
            cloneable: false,
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.conditionchecks_common.conditionCheckRefNumber.name',
                'defaultMessage': 'Reference number'
              }
            }),
            required: true,
            searchView: {
              type: TextInput
            },
            view: {
              type: IDGeneratorInput,
              props: {
                source: 'conditioncheck'
              }
            }
          }
        },
        conditionChecker: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.conditionchecks_common.conditionChecker.name',
                'defaultMessage': 'Checker/assessor'
              }
            }),
            view: {
              type: AutocompleteInput,
              props: {
                source: 'person/local,person/shared,organization/local,organization/shared'
              }
            }
          }
        },
        displayRecommendations: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.conditionchecks_common.displayRecommendations.name',
                'defaultMessage': 'Display recommendation'
              }
            }),
            view: {
              type: TextInput,
              props: {
                multiline: true
              }
            }
          }
        },
        envRecommendations: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.conditionchecks_common.envRecommendations.name',
                'defaultMessage': 'Environmental recommendation'
              }
            }),
            view: {
              type: TextInput,
              props: {
                multiline: true
              }
            }
          }
        },
        handlingRecommendations: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.conditionchecks_common.handlingRecommendations.name',
                'defaultMessage': 'Handling recommendation'
              }
            }),
            view: {
              type: TextInput,
              props: {
                multiline: true
              }
            }
          }
        },
        packingRecommendations: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.conditionchecks_common.packingRecommendations.name',
                'defaultMessage': 'Packing recommendation'
              }
            }),
            view: {
              type: TextInput,
              props: {
                multiline: true
              }
            }
          }
        },
        securityRecommendations: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.conditionchecks_common.securityRecommendations.name',
                'defaultMessage': 'Security recommendation'
              }
            }),
            view: {
              type: TextInput,
              props: {
                multiline: true
              }
            }
          }
        },
        specialRequirements: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.conditionchecks_common.specialRequirements.name',
                'defaultMessage': 'Special requirement'
              }
            }),
            view: {
              type: TextInput,
              props: {
                multiline: true
              }
            }
          }
        },
        storageRequirements: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.conditionchecks_common.storageRequirements.name',
                'defaultMessage': 'Storage recommendation'
              }
            }),
            view: {
              type: TextInput,
              props: {
                multiline: true
              }
            }
          }
        },
        legalRequirements: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.conditionchecks_common.legalRequirements.name',
                'defaultMessage': 'Legal requirement'
              }
            }),
            view: {
              type: TextInput,
              props: {
                multiline: true
              }
            }
          }
        },
        salvagePriorityCodeGroupList: {
          [config]: {
            view: {
              type: CompoundInput
            }
          },
          salvagePriorityCodeGroup: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  'id': 'field.conditionchecks_common.salvagePriorityCodeGroup.name',
                  'defaultMessage': 'Salvage priority'
                }
              }),
              repeating: true,
              view: {
                type: CompoundInput,
                props: {
                  tabular: true
                }
              }
            },
            salvagePriorityCode: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.salvagePriorityCode.name',
                    'defaultMessage': 'Code'
                  }
                }),
                view: {
                  type: OptionPickerInput,
                  props: {
                    source: 'salvagePriorityCodes'
                  }
                }
              }
            },
            salvagePriorityCodeDate: {
              [config]: {
                dataType: DATA_TYPE_DATE,
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.salvagePriorityCodeDate.name',
                    'defaultMessage': 'Date'
                  },
                  fullName: {
                    'id': 'field.conditionchecks_common.salvagePriorityCodeDate.fullName',
                    'defaultMessage': 'Salvage priority date'
                  }
                }),
                view: {
                  type: DateInput
                }
              }
            }
          }
        },
        legalReqsHeldGroupList: {
          [config]: {
            view: {
              type: CompoundInput
            }
          },
          legalReqsHeldGroup: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  'id': 'field.conditionchecks_common.legalReqsHeldGroup.name',
                  'defaultMessage': 'Legal/license requirement held'
                }
              }),
              repeating: true,
              view: {
                type: CompoundInput,
                props: {
                  tabular: true
                }
              }
            },
            legalReqsHeld: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.legalReqsHeld.name',
                    'defaultMessage': 'Description'
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            legalReqsHeldBeginDate: {
              [config]: {
                dataType: DATA_TYPE_DATE,
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.legalReqsHeldBeginDate.name',
                    'defaultMessage': 'Begin date'
                  },
                  fullName: {
                    'id': 'field.conditionchecks_common.legalReqsHeldBeginDate.fullName',
                    'defaultMessage': 'Legal/license requirement begin date'
                  }
                }),
                view: {
                  type: DateInput
                }
              }
            },
            legalReqsHeldEndDate: {
              [config]: {
                dataType: DATA_TYPE_DATE,
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.legalReqsHeldEndDate.name',
                    'defaultMessage': 'End date'
                  },
                  fullName: {
                    'id': 'field.conditionchecks_common.legalReqsHeldEndDate.fullName',
                    'defaultMessage': 'Legal/license requirement end date'
                  }
                }),
                view: {
                  type: DateInput
                }
              }
            },
            legalReqsHeldNumber: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.legalReqsHeldNumber.name',
                    'defaultMessage': 'Number'
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            legalReqsHeldRenewDate: {
              [config]: {
                dataType: DATA_TYPE_DATE,
                messages: (0, _reactIntl.defineMessages)({
                  name: {
                    'id': 'field.conditionchecks_common.legalReqsHeldRenewDate.name',
                    'defaultMessage': 'Renewal date'
                  },
                  fullName: {
                    'id': 'field.conditionchecks_common.legalReqsHeldRenewDate.fullName',
                    'defaultMessage': 'Legal/license requirement renewal date'
                  }
                }),
                view: {
                  type: DateInput
                }
              }
            }
          }
        }
      }
    })
  };
};