function ElementUtils.iterateElements(g)local n=Type.of(g)if n==Type.Element then local n=false return function()if n then return nil else n=true return ElementUtils.UseParentKey,g end end end local D=typeof(g)if g==nil or D=="\098\111\111\108\101\097\110"then return noop end if D=="\116\097\098\108\101"then return pairs(g)end error("\073\110\118\097\108\105\100 \101\108\101\109\101\110\116\115")end

function ElementUtils.iterateElements(elementOrElements)
	local richType = Type.of(elementOrElements)

	-- Single child
	if richType == Type.Element then
		local called = false

		return function()
			if called then
				return nil
			else
				called = true
				return ElementUtils.UseParentKey, elementOrElements
			end
		end
	end

	local regularType = typeof(elementOrElements)

	if elementOrElements == nil or regularType == "boolean" then
		return noop
	end

	if regularType == "table" then
		return pairs(elementOrElements)
	end

	error("Invalid elements")
end
