local g=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local w=g:WaitForChild("\077\111\100\117\108\101\115")local v=require(w.src.utils.Logger)local A=require(w.src.PetManager)local C=require(w.src.utils.Print)local Q=require(w.src.actions.toClient.clientEquipped)local t=require(w.src.objects.InventoryObjects)local c=require(w.M)local U=3 local function B(g,w)return function(C)local function B(g)return t.PetObjects[g]end local S=c.map(w,B)if S then A:addToCharacter(S,g.Character,U)C:dispatch(Q(tostring(g.UserId),w))else v:w("\078\111 \112\101\116 \111\098\106\101\099\116 \102\111\117\110\100")end end end return B
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local Modules = ReplicatedStorage:WaitForChild('Modules')
local logger = require(Modules.src.utils.Logger)

local PetManager = require(Modules.src.PetManager)
local Print = require(Modules.src.utils.Print)
local clientEquipped = require(Modules.src.actions.toClient.clientEquipped)
local InventoryObjects = require(Modules.src.objects.InventoryObjects)
local M = require(Modules.M)

local playerSlotsCount = 3

local function equipPlayer(player, petIds)
	return function(store)
		local function getShopObjects(petId)
			return InventoryObjects.PetObjects[petId]
		end
		local petObjects = M.map(petIds, getShopObjects)

		if petObjects then
			PetManager:addToCharacter(petObjects, player.Character, playerSlotsCount)
			store:dispatch(clientEquipped(tostring(player.UserId), petIds))
		else
			logger:w('No pet object found')
		end
	end
end

return equipPlayer