function RxInstanceUtils.observeLastNamedChildBrio(E,e,Z)assert(typeof(E)=="\073\110\115\116\097\110\099\101","\066\097\100 \112\097\114\101\110\116")assert(type(e)=="\115\116\114\105\110\103","\066\097\100 \099\108\097\115\115\078\097\109\101")assert(type(Z)=="\115\116\114\105\110\103","\066\097\100 \110\097\109\101")return Observable.new(function(B)local J=Maid.new()local function T(E)if not E:IsA(e)then return end local T=Maid.new()local function H()if E.Name==Z then local e=Brio.new(E)T._brio=e J._lastBrio=e B:Fire(e)else T._brio=nil end end T:GiveTask((E:GetPropertyChangedSignal("\078\097\109\101")):Connect(H))H()J[E]=T end J:GiveTask(E.ChildAdded:Connect(T))J:GiveTask(E.ChildRemoved:Connect(function(E)J[E]=nil end))for E,e in pairs(E:GetChildren())do T(e)end return J end)end
--[=[
	Observes the last child with a specific name.

	@param parent Instance
	@param className string
	@param name string
	@return Observable<Brio<Instance>>
]=]
function RxInstanceUtils.observeLastNamedChildBrio(parent, className, name)
	assert(typeof(parent) == "Instance", "Bad parent")
	assert(type(className) == "string", "Bad className")
	assert(type(name) == "string", "Bad name")

	return Observable.new(function(sub)
		local topMaid = Maid.new()

		local function handleChild(child)
			if not child:IsA(className) then
				return
			end

			local maid = Maid.new()

			local function handleNameChanged()
				if child.Name == name then
					local brio = Brio.new(child)
					maid._brio = brio
					topMaid._lastBrio = brio

					sub:Fire(brio)
				else
					maid._brio = nil
				end
			end

			maid:GiveTask(child:GetPropertyChangedSignal("Name"):Connect(handleNameChanged))
			handleNameChanged()

			topMaid[child] = maid
		end

		topMaid:GiveTask(parent.ChildAdded:Connect(handleChild))
		topMaid:GiveTask(parent.ChildRemoved:Connect(function(child)
			topMaid[child] = nil
		end))

		for _, child in pairs(parent:GetChildren()) do
			handleChild(child)
		end

		return topMaid
	end)
end
