import e from "../../../lodash-es/map.js";
import t from "../../../lodash-es/clone.js";
import n from "../../../lodash-es/isUndefined.js";
import "./graph.js";
//#region ../../node_modules/dagre-d3-es/src/graphlib/json.js
function r(e) {
	var r = {
		options: {
			directed: e.isDirected(),
			multigraph: e.isMultigraph(),
			compound: e.isCompound()
		},
		nodes: i(e),
		edges: a(e)
	};
	return n(e.graph()) || (r.value = t(e.graph())), r;
}
function i(t) {
	return e(t.nodes(), function(e) {
		var r = t.node(e), i = t.parent(e), a = { v: e };
		return n(r) || (a.value = r), n(i) || (a.parent = i), a;
	});
}
function a(t) {
	return e(t.edges(), function(e) {
		var r = t.edge(e), i = {
			v: e.v,
			w: e.w
		};
		return n(e.name) || (i.name = e.name), n(r) || (i.value = r), i;
	});
}
//#endregion
export { r as write };
