function RxBrioUtils.mapBrioBrio(t)assert(type(t)=="\102\117\110\099\116\105\111\110","\066\097\100 \112\114\111\106\101\099\116")return function(i)assert(Brio.isBrio(i),"\078\111\116 \097 \098\114\105\111")if i:IsDead()then return Rx.EMPTY end local o=t(i:GetValue())assert(Observable.isObservable(o),"\078\111\116 \097\110 \111\098\115\101\114\118\097\098\108\101")return(RxBrioUtils.completeOnDeath(i,o)):Pipe({Rx.map(RxBrioUtils._mapResult(i))})end end

function RxBrioUtils.mapBrioBrio(project)
	assert(type(project) == "function", "Bad project")

	return function(brio)
		assert(Brio.isBrio(brio), "Not a brio")

		if brio:IsDead() then
			return Rx.EMPTY
		end

		local observable = project(brio:GetValue())
		assert(Observable.isObservable(observable), "Not an observable")

		return RxBrioUtils.completeOnDeath(brio, observable):Pipe({
			Rx.map(RxBrioUtils._mapResult(brio))
		})
	end
end
