local g=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local n=require(g.Game.Rodux)local K=require(g.Packages.sift)local f={}local k=n.createReducer(f,{NewPlot=function(g,n)return K.Dictionary.merge(g,{[n.key]=n.objects})end,RemovePlot=function(g,n)return K.Dictionary.merge(g,{[n.key]=K.None})end,SetObjects=function(g,n)local f=K.Dictionary.merge(g,{[n.key]=n.objects})return f end,AddObject=function(g,n)return K.Dictionary.mergeDeep(g,{[n.key]=K.Array.push(g[n.key],n.serialized)})end;RemoveObject=function(g,n)return K.Dictionary.mergeDeep(g,{[n.key]=K.Array.removeValue(g[n.key],n.serialized)})end})return k
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Rodux = require(ReplicatedStorage.Game.Rodux)
local Sift = require(ReplicatedStorage.Packages.sift)

local initialState = {}

local reducer = Rodux.createReducer(initialState, {
	NewPlot = function(state, action)
		return Sift.Dictionary.merge(state, {
			[action.key] = action.objects,
		})
	end,

	RemovePlot = function(state, action)
		return Sift.Dictionary.merge(state, {
			[action.key] = Sift.None,
		})
	end,

	SetObjects = function(state, action)
		local newState = Sift.Dictionary.merge(state, {
			[action.key] = action.objects,
		})
		return newState
	end,

	AddObject = function(state, action)
		return Sift.Dictionary.mergeDeep(state, {
			[action.key] = Sift.Array.push(state[action.key], action.serialized),
		})
	end,

	RemoveObject = function(state, action)
		return Sift.Dictionary.mergeDeep(state, {
			[action.key] = Sift.Array.removeValue(state[action.key], action.serialized),
		})
	end,
})

return reducer
