var search = /[#.]/g;
function parseSelector(t, n) {
	let r = t || "", i = {}, a = 0, o, s;
	for (; a < r.length;) {
		search.lastIndex = a;
		let t = search.exec(r), n = r.slice(a, t ? t.index : r.length);
		n && (o ? o === "#" ? i.id = n : Array.isArray(i.className) ? i.className.push(n) : i.className = [n] : s = n, a += n.length), t && (o = t[0], a++);
	}
	return {
		type: "element",
		tagName: s || n || "div",
		properties: i,
		children: []
	};
}
export { parseSelector };
