import { b, $ as l, c as d, d as p } from "./utils-V7nfNEif.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
  ]), f = b(c), i = s((e) => {
    const a = l(e.target), $ = a ? d(a) : d();
    e.target === e.currentTarget && $ === p(e.nativeEvent) && (n && n(e), o && o(!0), f(e));
  }, [
    o,
    n,
    f
  ]);
  return {
    focusProps: {
      onFocus: !r && (n || o || t) ? i : void 0,
      onBlur: !r && (t || o) ? c : void 0
    }
  };
}
export {
  m as $
};
//# sourceMappingURL=useFocus-DWn32Fi6.es.js.map
