import { $ as f } from "./useLabel-DQaRD22u.es.js";
import { b as l, $ as b } from "./mergeProps-Dsl8k3Ig.es.js";
function $(e) {
  let { description: a, errorMessage: o, isInvalid: i, validationState: d } = e, { labelProps: n, fieldProps: r } = f(e), s = l([
    !!a,
    !!o,
    i,
    d
  ]), t = l([
    !!a,
    !!o,
    i,
    d
  ]);
  return r = b(r, {
    "aria-describedby": [
      s,
      // Use aria-describedby for error message because aria-errormessage is unsupported using VoiceOver or NVDA. See https://github.com/adobe/react-spectrum/issues/1346#issuecomment-740136268
      t,
      e["aria-describedby"]
    ].filter(Boolean).join(" ") || void 0
  }), {
    labelProps: n,
    fieldProps: r,
    descriptionProps: {
      id: s
    },
    errorMessageProps: {
      id: t
    }
  };
}
export {
  $
};
//# sourceMappingURL=useField-CHrpmkxe.es.js.map
