local L={}L.ClassName="\080\101\110\100\105\110\103\080\114\111\109\105\115\101\084\114\097\099\107\101\114"L.__index=L function L.new()local A=setmetatable({},L)A._pendingPromises={}return A end function L.Add(A,L)if L:IsPending()then A._pendingPromises[L]=true L:Finally(function()A._pendingPromises[L]=nil end)end end function L.GetAll(L)local A={}for L,g in pairs(L._pendingPromises)do table.insert(A,L)end return A end return L
--[=[
	Tracks pending promises
	@class PendingPromiseTracker
]=]

local PendingPromiseTracker = {}
PendingPromiseTracker.ClassName = "PendingPromiseTracker"
PendingPromiseTracker.__index = PendingPromiseTracker

function PendingPromiseTracker.new()
	local self = setmetatable({}, PendingPromiseTracker)

	self._pendingPromises = {}

	return self
end

function PendingPromiseTracker:Add(promise)
	if promise:IsPending() then
		self._pendingPromises[promise] = true
		promise:Finally(function()
			self._pendingPromises[promise] = nil
		end)
	end
end

function PendingPromiseTracker:GetAll()
	local promises = {}
	for promise, _ in pairs(self._pendingPromises) do
		table.insert(promises, promise)
	end
	return promises
end

return PendingPromiseTracker
