import { ref as c, computed as d, reactive as i } from "vue";
function h(a, l) {
  const r = c(), t = c(), { parse: u, update: s } = l, n = () => {
    r.value = void 0, t.value = void 0;
  }, v = d({
    get() {
      return r.value !== void 0 ? r.value : a.value;
    },
    set(o) {
      n();
      try {
        const e = u ? u(o) : o;
        (s ? s(e) : !0) ? a.value = e : r.value = e;
      } catch (e) {
        r.value = o, t.value = e instanceof Error ? e.message : String(e);
      }
    }
  });
  return i({
    value: v,
    error: t,
    reset: n
  });
}
export {
  h as useTransformedModel
};
//# sourceMappingURL=useTransformedModel.js.map
