import { c as b, a as l, d, e as p } from "./utils-oAGBWzI5.es.js";
import { useCallback as s } from "react";
function m(u) {
  let { isDisabled: r, onFocus: n, onBlur: t, onFocusChange: o } = u;
  const c = s((e) => {
    if (e.target === e.currentTarget)
      return t && t(e), o && o(!1), !0;
  }, [
    t,
    o
  ]), a = b(c), i = s((e) => {
    const f = l(e.target), $ = f ? d(f) : d();
    e.target === e.currentTarget && $ === p(e.nativeEvent) && (n && n(e), o && o(!0), a(e));
  }, [
    o,
    n,
    a
  ]);
  return {
    focusProps: {
      onFocus: !r && (n || o || t) ? i : void 0,
      onBlur: !r && (t || o) ? c : void 0
    }
  };
}
export {
  m as $
};
//# sourceMappingURL=useFocus-CrgTusM3.es.js.map
