import { T as TextField } from './index-403e215e.js';

function findFieldNestedField(fields, fieldId) {
  if (fieldId.includes('.')) {
    const nestedFieldId = fieldId.split('.')[0];
    return fields.find(field => field.id === nestedFieldId);
  }
  return undefined;
}
function findField(fields, fieldId) {
  if (fieldId === 'name') {
    return new TextField('name', '');
  }
  return fields.find(field => field.id === fieldId) || findFieldNestedField(fields, fieldId);
}

export { findField as f };
