import { c } from "react/compiler-runtime";
import { useFormContext } from "react-hook-form";
const useFieldConfig = (n, r, i, a) => {
	let o = c(14), s = useFormContext()?.formState.errors[n], l = i, u = l?.title ?? r.title ?? n, d = l?.help ?? r.help, f = l?.description ?? r.description, p = l?.readonly ?? r.readonly, m = l?.disabled ?? r.disabled ?? a, h;
	o[0] !== s || o[1] !== n || o[2] !== r.description || o[3] !== l?.description ? (h = () => ({
		"aria-describedby": l?.description ?? r.description ? `${n}-description` : void 0,
		"aria-invalid": !!s
	}), o[0] = s, o[1] = n, o[2] = r.description, o[3] = l?.description, o[4] = h) : h = o[4];
	let g;
	return o[5] !== s || o[6] !== r.default || o[7] !== u || o[8] !== d || o[9] !== f || o[10] !== p || o[11] !== m || o[12] !== h ? (g = {
		fieldLabel: u,
		helpText: d,
		description: f,
		isReadOnly: p,
		isDisabled: m,
		defaultValue: r.default,
		error: s,
		getAriaProps: h
	}, o[5] = s, o[6] = r.default, o[7] = u, o[8] = d, o[9] = f, o[10] = p, o[11] = m, o[12] = h, o[13] = g) : g = o[13], g;
};
export { useFieldConfig };
