import { mergeIconData } from "../icon/merge.js";
import { getIconsTree } from "./tree.js";
function internalGetIconData(t, n, r) {
	let i = t.icons, a = t.aliases || Object.create(null), o = {};
	function s(t) {
		o = mergeIconData(i[t] || a[t], o);
	}
	return s(n), r.forEach(s), mergeIconData(t, o);
}
function getIconData(e, r) {
	if (e.icons[r]) return internalGetIconData(e, r, []);
	let i = getIconsTree(e, [r])[r];
	return i ? internalGetIconData(e, r, i) : null;
}
export { getIconData };
