import { useRef as f, useCallback as c, useEffect as d } from "react";
import { getPath as n } from "../../paths/get-path.mjs";
function b({
  $status: t
}) {
  const e = f(
    {}
  ), o = c((r, u) => {
    d(() => (e.current[r] = e.current[r] || [], e.current[r].push(u), () => {
      e.current[r] = e.current[r].filter((s) => s !== u);
    }), [u]);
  }, []), i = c((r) => e.current[r] ? e.current[r].map(
    (u) => (s) => u({
      previousValue: n(r, s.previousValues),
      value: n(r, s.updatedValues),
      touched: t.isTouched(r),
      dirty: t.isDirty(r)
    })
  ) : [], []);
  return {
    subscribers: e,
    watch: o,
    getFieldSubscribers: i
  };
}
export {
  b as useFormWatch
};
//# sourceMappingURL=use-form-watch.mjs.map
