local h=game:GetService("\067\111\108\108\101\099\116\105\111\110\083\101\114\118\105\099\101")local z=require(script.Parent.Constants)local r={}r.ValidSelection=function(r)for r,k in pairs(r)do if h:HasTag(k,"\095\105\103\110\111\114\101\108\097\121\101\114\115")then return false end if k.Name=="\084\111\111\108\098\111\120\084\101\109\112\111\114\097\114\121\073\110\115\101\114\116\077\111\100\101\108"then return false end if k:IsDescendantOf(workspace.Camera)then return false end for h,z in pairs(z.ValidInstances)do if k:IsA(z)then return true end end end return false end return r
local CollectionService = game:GetService("CollectionService")

local Constants = require(script.Parent.Constants)

local Util = {}

Util.ValidSelection = function(instances)
	for _, instance in pairs(instances) do

		if CollectionService:HasTag(instance, "_ignorelayers") then
			return false
		end

		if instance.Name == "ToolboxTemporaryInsertModel" then
			return false
		end

		-- It is not unusual for plugins to store visual indicators in the camera. This plugin tends to interfere with them.
		if instance:IsDescendantOf(workspace.Camera) then
			return false
		end

		for _, baseType in pairs(Constants.ValidInstances) do
			if instance:IsA(baseType) then
				return true
			end
		end
	end

	return false
end

return Util