local function a(a)return coroutine.wrap(function()local u=1 while true do for a,O in a:GetCurrentPage()do coroutine.yield(O,u)end if a.IsFinished then break end a:AdvanceToNextPageAsync()u+=1 end end)end return a

local function PageIterator(pages)
	return coroutine.wrap(function()
		local pageNumber = 1
		
		while true do
			for _, item in pages:GetCurrentPage() do
				coroutine.yield(item, pageNumber)
			end
			
			if pages.IsFinished then
				break
			end
			
			pages:AdvanceToNextPageAsync()
			pageNumber += 1
		end
	end)
end

return PageIterator
