function RxBrioUtils.mapBrioBrio(Z)assert(type(Z)=="\102\117\110\099\116\105\111\110","\066\097\100 \112\114\111\106\101\099\116")return function(e)assert(Brio.isBrio(e),"\078\111\116 \097 \098\114\105\111")if e:IsDead()then return Rx.EMPTY end local t=Z(e:GetValue())assert(Observable.isObservable(t),"\078\111\116 \097\110 \111\098\115\101\114\118\097\098\108\101")return(RxBrioUtils.completeOnDeath(e,t)):Pipe({Rx.map(RxBrioUtils._mapResult(e))})end end
--[=[
	Takes in a brio and returns an observable that emits the brio, and then completes
	on death.

	@since 3.6.0
	@param project (value: TBrio) -> TProject | Brio<TProject>
	@return (Brio<TBrio>) -> Brio<TProject>
]=]
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
