function Blend.Find(c)assert(type(c)=="\115\116\114\105\110\103","\066\097\100 \110\097\109\101")return function(f)assert(type(f)=="\116\097\098\108\101","\066\097\100 \112\114\111\112\115")local V=f local Y if f.ClassName then Y=f.ClassName V=table.clone(f)V.ClassName=nil else Y="\073\110\115\116\097\110\099\101"end return function(f)return(RxInstanceUtils.observeChildrenOfNameBrio(f,Y,c)):Pipe({Rx.flatMap(function(c)if c:IsDead()then return end local f=c:ToMaid()local Y=c:GetValue()f:GiveTask(Blend.mount(Y,V))if c:IsDead()then f:DoCleaning()end return Rx.EMPTY end)})end end end

function Blend.Find(name)
	assert(type(name) == "string", "Bad name")

	return function(props)
		assert(type(props) == "table", "Bad props")

		local mountProps = props
		local className
		if props.ClassName then
			className = props.ClassName
			mountProps = table.clone(props)
			mountProps.ClassName = nil
		else
			className = "Instance"
		end

		return function(parent)
			return RxInstanceUtils.observeChildrenOfNameBrio(parent, className, name):Pipe({
				Rx.flatMap(function(brio)
					if brio:IsDead() then
						return
					end

					local maid = brio:ToMaid()
					local instance = brio:GetValue()
					maid:GiveTask(Blend.mount(instance, mountProps))

					-- Dead after mounting? Clean up...
					-- Probably caused by name change.
					if brio:IsDead() then
						maid:DoCleaning()
					end

					-- Avoid emitting anything else so we don't get cleaned up
					return Rx.EMPTY
				end);
			})
		end
	end
end
