'use strict';

const referenceField = require('./reference-field-dda66f2e.js');
const BaseField = require('./BaseField-d019ade6.js');
require('./index-f92537c9.js');
const index$4 = require('./index-9ea6c7b1.js');
const index$3 = require('./index-93271b8c.js');
const index$2 = require('./index-29b7cb16.js');
const index$1 = require('./index-792d710c.js');
const index = require('./index-7e3bc620.js');
const date = require('./date-25b104f6.js');

function generateFieldModelFromRawData(fieldData) {
  if (!fieldData) {
    return undefined;
  }
  switch (fieldData.type) {
    case date.DateField.type:
      return Object.assign(Object.create(date.DateField.prototype), fieldData);
    case index$4.MultipleChoiceField.type:
      return Object.assign(Object.create(index$4.MultipleChoiceField.prototype), fieldData);
    case index$3.NumberField.type:
      return Object.assign(Object.create(index$3.NumberField.prototype), fieldData);
    case index$3.RangeField.type:
      return Object.assign(Object.create(index$3.RangeField.prototype), fieldData);
    case index$3.SectionHeaderField.type:
      return Object.assign(Object.create(index$3.SectionHeaderField.prototype), fieldData);
    case index$2.SingleChoiceField.type:
      return Object.assign(Object.create(index$2.SingleChoiceField.prototype), fieldData);
    case index$1.SubFormField.type:
      return Object.assign(Object.create(index$1.SubFormField.prototype), fieldData);
    case index.TextField.type:
      return Object.assign(Object.create(index.TextField.prototype), fieldData);
    case referenceField.ReferenceField.type:
      return Object.assign(Object.create(referenceField.ReferenceField.prototype), fieldData);
    default:
      return Object.assign(Object.create(BaseField.BaseField.prototype), fieldData);
  }
}

exports.generateFieldModelFromRawData = generateFieldModelFromRawData;
