function red.error(M)print(M)end red.remotes=RunService:IsClient()and ReplicatedStorage:WaitForChild(Constants.remoteFolderName)or ReplicatedStorage:FindFirstChild(Constants.remoteFolderName)if not red.remotes then red.remotes=Instance.new("\070\111\108\100\101\114")red.remotes.Name=Constants.remoteFolderName local M=Instance.new("\082\101\109\111\116\101\069\118\101\110\116")M.Name="\067\108\105\101\110\116"M.Parent=red.remotes local L=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")L.Name="\083\101\114\118\101\114"L.Parent=red.remotes red.remotes.Parent=ReplicatedStorage end return Util.extend(red,{Server=require(script.Server);State=require(script.State),Store=require(script.Store)})
-- Error handler
function red.error(err)
	print(err)
end

red.remotes = RunService:IsClient() and ReplicatedStorage:WaitForChild(Constants.remoteFolderName)
	or ReplicatedStorage:FindFirstChild(Constants.remoteFolderName)

if not red.remotes then
	-- Container for remotes
	red.remotes = Instance.new("Folder")
	red.remotes.Name = Constants.remoteFolderName

	-- store:dispatch() calls from client to server and server to client
	local client = Instance.new("RemoteEvent")
	client.Name = "Client"
	client.Parent = red.remotes

	-- store:dispatch() calls from server to server
	local server = Instance.new("BindableEvent")
	server.Name = "Server"
	server.Parent = red.remotes

	red.remotes.Parent = ReplicatedStorage
end

return Util.extend(red, {
	Server = require(script.Server),
	State = require(script.State),
	Store = require(script.Store),
})
