'use strict';

const index = require('./index-74a00556.js');
const BaseField = require('./BaseField-d019ade6.js');
const index$3 = require('./index-fe19a98b.js');
const index$2 = require('./index-ae305bae.js');
const index$1 = require('./index-a8f1783c.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$3.MultipleChoiceField.type:
      return Object.assign(Object.create(index$3.MultipleChoiceField.prototype), fieldData);
    case index$2.NumberField.type:
      return Object.assign(Object.create(index$2.NumberField.prototype), fieldData);
    case index$2.RangeField.type:
      return Object.assign(Object.create(index$2.RangeField.prototype), fieldData);
    case index$2.SectionHeaderField.type:
      return Object.assign(Object.create(index$2.SectionHeaderField.prototype), fieldData);
    case index$3.SingleChoiceField.type:
      return Object.assign(Object.create(index$3.SingleChoiceField.prototype), fieldData);
    case index$2.SubFormField.type:
      return Object.assign(Object.create(index$2.SubFormField.prototype), fieldData);
    case index$1.TextField.type:
      return Object.assign(Object.create(index$1.TextField.prototype), fieldData);
    case index.ReferenceField.type:
      return Object.assign(Object.create(index.ReferenceField.prototype), fieldData);
    default:
      return Object.assign(Object.create(BaseField.BaseField.prototype), fieldData);
  }
}

exports.generateFieldModelFromRawData = generateFieldModelFromRawData;
