import { reactive as c, watch as r } from "vue";
import { objects as a } from "@milaboratories/helpers";
function s(d, n, o) {
  const e = c({
    data: a.deepClone(n(d.value)),
    changed: !1
  });
  return r(
    () => e.data,
    (t) => {
      e.changed ? o(a.deepClone(t)) : e.changed = !0;
    },
    { deep: !0 }
  ), r(
    d,
    (t) => {
      Object.assign(e, {
        data: a.deepClone(n(t)),
        changed: !1
      });
    },
    { deep: !0, immediate: !0 }
  ), e;
}
export {
  s as useFormState
};
//# sourceMappingURL=useFormState.js.map
