import { computed as e, ref as t, watch as n } from "vue";
import { deepClone as r, isJsonEqual as i } from "@milaboratories/helpers";
//#region src/composition/computedCached.ts
function a(a) {
	let o, s, c = !1;
	typeof a == "function" ? o = a : (o = a.get, s = a.set, c = a.writeThrough ?? !1);
	let l = t(o());
	return n(o, (e) => {
		i(e, l.value) || (l.value = r(e));
	}, { deep: !0 }), s ? e({
		get: () => l.value,
		set: c ? (e) => {
			i(e, l.value) || (l.value = r(e)), s(e);
		} : s
	}) : l;
}
//#endregion
export { a as computedCached };

//# sourceMappingURL=computedCached.js.map