modules.waitForHumanoidAnimations=function(a)return function()for a,n in pairs(a.humanoidControllers)do if n:isAnimating()then n.animationCompleted.Event:Wait()end end end end modules.getModelFace=function()return function(a)local n=a:GetAttribute(constants.Attributes.SurfaceCanvasFace)if not n then return Enum.NormalId.Front end n=string.lower(n)for a,t in ipairs(Enum.NormalId:GetEnumItems())do if string.lower(t.Name)==string.lower(n)then return t end end warn("\091\083\117\114\102\097\099\101\065\114\116\093 \070\097\099\101 \112\114\111\118\105\100\101\100 \105\115 \105\110 \097\116\116\114\105\098\117\116\101\115 \105\115 \105\110\118\097\108\105\100\044 \100\101\102\097\117\108\116\105\110\103 \116\111 \070\114\111\110\116")return Enum.NormalId.Front end end modules.cleanup=function(a)return function()a.userInputController:enable()a.guiController:enable()a.cameraModule:animateToHumanoidAsync()end end return modules
--[[
	Check if all humanoids has completed animation for hiding/showing.
]]
modules.waitForHumanoidAnimations = function(self)
	return function()
		for _, humanoidController in pairs(self.humanoidControllers) do
			if humanoidController:isAnimating() then
				humanoidController.animationCompleted.Event:Wait()
			end
		end
	end
end

modules.getModelFace = function()
	return function(model)
		local face = model:GetAttribute(constants.Attributes.SurfaceCanvasFace)
		if not face then
			return Enum.NormalId.Front
		end

		-- Case insensitive to make it more user friendly
		face = string.lower(face)

		for _, enum in ipairs(Enum.NormalId:GetEnumItems()) do
			if string.lower(enum.Name) == string.lower(face) then
				return enum
			end
		end

		warn("[SurfaceArt] Face provided is in attributes is invalid, defaulting to Front")
		return Enum.NormalId.Front
	end
end

modules.cleanup = function(self)
	return function()
		self.userInputController:enable()
		self.guiController:enable()
		self.cameraModule:animateToHumanoidAsync()
	end
end

return modules
